ip6.h (78064) | ip6.h (103842) |
---|---|
1/* $FreeBSD: head/sys/netinet/ip6.h 78064 2001-06-11 12:39:29Z ume $ */ | 1/* $FreeBSD: head/sys/netinet/ip6.h 103842 2002-09-23 06:25:08Z alfred $ */ |
2/* $KAME: ip6.h,v 1.18 2001/03/29 05:34:30 itojun Exp $ */ 3 4/* 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 70 unchanged lines hidden (view full) --- 80 u_int16_t ip6_un1_plen; /* payload length */ 81 u_int8_t ip6_un1_nxt; /* next header */ 82 u_int8_t ip6_un1_hlim; /* hop limit */ 83 } ip6_un1; 84 u_int8_t ip6_un2_vfc; /* 4 bits version, top 4 bits class */ 85 } ip6_ctlun; 86 struct in6_addr ip6_src; /* source address */ 87 struct in6_addr ip6_dst; /* destination address */ | 2/* $KAME: ip6.h,v 1.18 2001/03/29 05:34:30 itojun Exp $ */ 3 4/* 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 70 unchanged lines hidden (view full) --- 80 u_int16_t ip6_un1_plen; /* payload length */ 81 u_int8_t ip6_un1_nxt; /* next header */ 82 u_int8_t ip6_un1_hlim; /* hop limit */ 83 } ip6_un1; 84 u_int8_t ip6_un2_vfc; /* 4 bits version, top 4 bits class */ 85 } ip6_ctlun; 86 struct in6_addr ip6_src; /* source address */ 87 struct in6_addr ip6_dst; /* destination address */ |
88} __attribute__((__packed__)); | 88} __packed; |
89 90#define ip6_vfc ip6_ctlun.ip6_un2_vfc 91#define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow 92#define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen 93#define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt 94#define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim 95#define ip6_hops ip6_ctlun.ip6_un1.ip6_un1_hlim 96 --- 17 unchanged lines hidden (view full) --- 114 115/* 116 * Extension Headers 117 */ 118 119struct ip6_ext { 120 u_int8_t ip6e_nxt; 121 u_int8_t ip6e_len; | 89 90#define ip6_vfc ip6_ctlun.ip6_un2_vfc 91#define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow 92#define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen 93#define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt 94#define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim 95#define ip6_hops ip6_ctlun.ip6_un1.ip6_un1_hlim 96 --- 17 unchanged lines hidden (view full) --- 114 115/* 116 * Extension Headers 117 */ 118 119struct ip6_ext { 120 u_int8_t ip6e_nxt; 121 u_int8_t ip6e_len; |
122} __attribute__((__packed__)); | 122} __packed; |
123 124/* Hop-by-Hop options header */ 125/* XXX should we pad it to force alignment on an 8-byte boundary? */ 126struct ip6_hbh { 127 u_int8_t ip6h_nxt; /* next header */ 128 u_int8_t ip6h_len; /* length in units of 8 octets */ 129 /* followed by options */ | 123 124/* Hop-by-Hop options header */ 125/* XXX should we pad it to force alignment on an 8-byte boundary? */ 126struct ip6_hbh { 127 u_int8_t ip6h_nxt; /* next header */ 128 u_int8_t ip6h_len; /* length in units of 8 octets */ 129 /* followed by options */ |
130} __attribute__((__packed__)); | 130} __packed; |
131 132/* Destination options header */ 133/* XXX should we pad it to force alignment on an 8-byte boundary? */ 134struct ip6_dest { 135 u_int8_t ip6d_nxt; /* next header */ 136 u_int8_t ip6d_len; /* length in units of 8 octets */ 137 /* followed by options */ | 131 132/* Destination options header */ 133/* XXX should we pad it to force alignment on an 8-byte boundary? */ 134struct ip6_dest { 135 u_int8_t ip6d_nxt; /* next header */ 136 u_int8_t ip6d_len; /* length in units of 8 octets */ 137 /* followed by options */ |
138} __attribute__((__packed__)); | 138} __packed; |
139 140/* Option types and related macros */ 141#define IP6OPT_PAD1 0x00 /* 00 0 00000 */ 142#define IP6OPT_PADN 0x01 /* 00 0 00001 */ 143#define IP6OPT_JUMBO 0xC2 /* 11 0 00010 = 194 */ 144#define IP6OPT_NSAP_ADDR 0xC3 /* 11 0 00011 */ 145#define IP6OPT_TUNNEL_LIMIT 0x04 /* 00 0 00100 */ 146#define IP6OPT_RTALERT 0x05 /* 00 0 00101 (KAME definition) */ --- 22 unchanged lines hidden (view full) --- 169 170/* Routing header */ 171struct ip6_rthdr { 172 u_int8_t ip6r_nxt; /* next header */ 173 u_int8_t ip6r_len; /* length in units of 8 octets */ 174 u_int8_t ip6r_type; /* routing type */ 175 u_int8_t ip6r_segleft; /* segments left */ 176 /* followed by routing type specific data */ | 139 140/* Option types and related macros */ 141#define IP6OPT_PAD1 0x00 /* 00 0 00000 */ 142#define IP6OPT_PADN 0x01 /* 00 0 00001 */ 143#define IP6OPT_JUMBO 0xC2 /* 11 0 00010 = 194 */ 144#define IP6OPT_NSAP_ADDR 0xC3 /* 11 0 00011 */ 145#define IP6OPT_TUNNEL_LIMIT 0x04 /* 00 0 00100 */ 146#define IP6OPT_RTALERT 0x05 /* 00 0 00101 (KAME definition) */ --- 22 unchanged lines hidden (view full) --- 169 170/* Routing header */ 171struct ip6_rthdr { 172 u_int8_t ip6r_nxt; /* next header */ 173 u_int8_t ip6r_len; /* length in units of 8 octets */ 174 u_int8_t ip6r_type; /* routing type */ 175 u_int8_t ip6r_segleft; /* segments left */ 176 /* followed by routing type specific data */ |
177} __attribute__((__packed__)); | 177} __packed; |
178 179/* Type 0 Routing header */ 180struct ip6_rthdr0 { 181 u_int8_t ip6r0_nxt; /* next header */ 182 u_int8_t ip6r0_len; /* length in units of 8 octets */ 183 u_int8_t ip6r0_type; /* always zero */ 184 u_int8_t ip6r0_segleft; /* segments left */ 185 u_int8_t ip6r0_reserved; /* reserved field */ 186 u_int8_t ip6r0_slmap[3]; /* strict/loose bit map */ 187 struct in6_addr ip6r0_addr[1]; /* up to 23 addresses */ | 178 179/* Type 0 Routing header */ 180struct ip6_rthdr0 { 181 u_int8_t ip6r0_nxt; /* next header */ 182 u_int8_t ip6r0_len; /* length in units of 8 octets */ 183 u_int8_t ip6r0_type; /* always zero */ 184 u_int8_t ip6r0_segleft; /* segments left */ 185 u_int8_t ip6r0_reserved; /* reserved field */ 186 u_int8_t ip6r0_slmap[3]; /* strict/loose bit map */ 187 struct in6_addr ip6r0_addr[1]; /* up to 23 addresses */ |
188} __attribute__((__packed__)); | 188} __packed; |
189 190/* Fragment header */ 191struct ip6_frag { 192 u_int8_t ip6f_nxt; /* next header */ 193 u_int8_t ip6f_reserved; /* reserved field */ 194 u_int16_t ip6f_offlg; /* offset, reserved, and flag */ 195 u_int32_t ip6f_ident; /* identification */ | 189 190/* Fragment header */ 191struct ip6_frag { 192 u_int8_t ip6f_nxt; /* next header */ 193 u_int8_t ip6f_reserved; /* reserved field */ 194 u_int16_t ip6f_offlg; /* offset, reserved, and flag */ 195 u_int32_t ip6f_ident; /* identification */ |
196} __attribute__((__packed__)); | 196} __packed; |
197 198#if BYTE_ORDER == BIG_ENDIAN 199#define IP6F_OFF_MASK 0xfff8 /* mask out offset from _offlg */ 200#define IP6F_RESERVED_MASK 0x0006 /* reserved bits in ip6f_offlg */ 201#define IP6F_MORE_FRAG 0x0001 /* more-fragments flag */ 202#else /* BYTE_ORDER == LITTLE_ENDIAN */ 203#define IP6F_OFF_MASK 0xf8ff /* mask out offset from _offlg */ 204#define IP6F_RESERVED_MASK 0x0600 /* reserved bits in ip6f_offlg */ --- 104 unchanged lines hidden --- | 197 198#if BYTE_ORDER == BIG_ENDIAN 199#define IP6F_OFF_MASK 0xfff8 /* mask out offset from _offlg */ 200#define IP6F_RESERVED_MASK 0x0006 /* reserved bits in ip6f_offlg */ 201#define IP6F_MORE_FRAG 0x0001 /* more-fragments flag */ 202#else /* BYTE_ORDER == LITTLE_ENDIAN */ 203#define IP6F_OFF_MASK 0xf8ff /* mask out offset from _offlg */ 204#define IP6F_RESERVED_MASK 0x0600 /* reserved bits in ip6f_offlg */ --- 104 unchanged lines hidden --- |