Deleted Added
full compact
icmp6.h (62587) icmp6.h (78064)
1/* $FreeBSD: head/sys/netinet/icmp6.h 62587 2000-07-04 16:35:15Z itojun $ */
2/* $KAME: icmp6.h,v 1.18 2000/07/03 02:51:08 itojun Exp $ */
1/* $FreeBSD: head/sys/netinet/icmp6.h 78064 2001-06-11 12:39:29Z ume $ */
2/* $KAME: icmp6.h,v 1.46 2001/04/27 15:09:48 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
10 * are met:

--- 64 unchanged lines hidden (view full) ---

75 u_int8_t icmp6_type; /* type field */
76 u_int8_t icmp6_code; /* code field */
77 u_int16_t icmp6_cksum; /* checksum field */
78 union {
79 u_int32_t icmp6_un_data32[1]; /* type-specific field */
80 u_int16_t icmp6_un_data16[2]; /* type-specific field */
81 u_int8_t icmp6_un_data8[4]; /* type-specific field */
82 } icmp6_dataun;
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
10 * are met:

--- 64 unchanged lines hidden (view full) ---

75 u_int8_t icmp6_type; /* type field */
76 u_int8_t icmp6_code; /* code field */
77 u_int16_t icmp6_cksum; /* checksum field */
78 union {
79 u_int32_t icmp6_un_data32[1]; /* type-specific field */
80 u_int16_t icmp6_un_data16[2]; /* type-specific field */
81 u_int8_t icmp6_un_data8[4]; /* type-specific field */
82 } icmp6_dataun;
83};
83} __attribute__((__packed__));
84
85#define icmp6_data32 icmp6_dataun.icmp6_un_data32
86#define icmp6_data16 icmp6_dataun.icmp6_un_data16
87#define icmp6_data8 icmp6_dataun.icmp6_un_data8
88#define icmp6_pptr icmp6_data32[0] /* parameter prob */
89#define icmp6_mtu icmp6_data32[0] /* packet too big */
90#define icmp6_id icmp6_data16[0] /* echo request/reply */
91#define icmp6_seq icmp6_data16[1] /* echo request/reply */

--- 27 unchanged lines hidden (view full) ---

119#define ICMP6_FQDN_REPLY 140 /* FQDN reply */
120#define ICMP6_NI_QUERY 139 /* node information request */
121#define ICMP6_NI_REPLY 140 /* node information reply */
122
123/* The definitions below are experimental. TBA */
124#define MLD6_MTRACE_RESP 141 /* mtrace response(to sender) */
125#define MLD6_MTRACE 142 /* mtrace messages */
126
84
85#define icmp6_data32 icmp6_dataun.icmp6_un_data32
86#define icmp6_data16 icmp6_dataun.icmp6_un_data16
87#define icmp6_data8 icmp6_dataun.icmp6_un_data8
88#define icmp6_pptr icmp6_data32[0] /* parameter prob */
89#define icmp6_mtu icmp6_data32[0] /* packet too big */
90#define icmp6_id icmp6_data16[0] /* echo request/reply */
91#define icmp6_seq icmp6_data16[1] /* echo request/reply */

--- 27 unchanged lines hidden (view full) ---

119#define ICMP6_FQDN_REPLY 140 /* FQDN reply */
120#define ICMP6_NI_QUERY 139 /* node information request */
121#define ICMP6_NI_REPLY 140 /* node information reply */
122
123/* The definitions below are experimental. TBA */
124#define MLD6_MTRACE_RESP 141 /* mtrace response(to sender) */
125#define MLD6_MTRACE 142 /* mtrace messages */
126
127#define ICMP6_MAXTYPE 142
127#define ICMP6_HADISCOV_REQUEST 143 /* XXX To be defined */
128#define ICMP6_HADISCOV_REPLY 144 /* XXX To be defined */
129
130#define ICMP6_MAXTYPE 144
128
129#define ICMP6_DST_UNREACH_NOROUTE 0 /* no route to destination */
130#define ICMP6_DST_UNREACH_ADMIN 1 /* administratively prohibited */
131#define ICMP6_DST_UNREACH_NOTNEIGHBOR 2 /* not a neighbor(obsolete) */
132#define ICMP6_DST_UNREACH_BEYONDSCOPE 2 /* beyond scope of source address */
133#define ICMP6_DST_UNREACH_ADDR 3 /* address unreachable */
134#define ICMP6_DST_UNREACH_NOPORT 4 /* port unreachable */
135

--- 5 unchanged lines hidden (view full) ---

141#define ICMP6_PARAMPROB_OPTION 2 /* unrecognized option */
142
143#define ICMP6_INFOMSG_MASK 0x80 /* all informational messages */
144
145#define ICMP6_NI_SUBJ_IPV6 0 /* Query Subject is an IPv6 address */
146#define ICMP6_NI_SUBJ_FQDN 1 /* Query Subject is a Domain name */
147#define ICMP6_NI_SUBJ_IPV4 2 /* Query Subject is an IPv4 address */
148
131
132#define ICMP6_DST_UNREACH_NOROUTE 0 /* no route to destination */
133#define ICMP6_DST_UNREACH_ADMIN 1 /* administratively prohibited */
134#define ICMP6_DST_UNREACH_NOTNEIGHBOR 2 /* not a neighbor(obsolete) */
135#define ICMP6_DST_UNREACH_BEYONDSCOPE 2 /* beyond scope of source address */
136#define ICMP6_DST_UNREACH_ADDR 3 /* address unreachable */
137#define ICMP6_DST_UNREACH_NOPORT 4 /* port unreachable */
138

--- 5 unchanged lines hidden (view full) ---

144#define ICMP6_PARAMPROB_OPTION 2 /* unrecognized option */
145
146#define ICMP6_INFOMSG_MASK 0x80 /* all informational messages */
147
148#define ICMP6_NI_SUBJ_IPV6 0 /* Query Subject is an IPv6 address */
149#define ICMP6_NI_SUBJ_FQDN 1 /* Query Subject is a Domain name */
150#define ICMP6_NI_SUBJ_IPV4 2 /* Query Subject is an IPv4 address */
151
149#define ICMP6_NI_SUCESS 0 /* node information successful reply */
152#define ICMP6_NI_SUCCESS 0 /* node information successful reply */
150#define ICMP6_NI_REFUSED 1 /* node information request is refused */
151#define ICMP6_NI_UNKNOWN 2 /* unknown Qtype */
152
153#define ICMP6_ROUTER_RENUMBERING_COMMAND 0 /* rr command */
154#define ICMP6_ROUTER_RENUMBERING_RESULT 1 /* rr result */
155#define ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET 255 /* rr seq num reset */
156
157/* Used in kernel only */
158#define ND_REDIRECT_ONLINK 0 /* redirect to an on-link node */
159#define ND_REDIRECT_ROUTER 1 /* redirect to a better router */
160
161/*
162 * Multicast Listener Discovery
163 */
164struct mld6_hdr {
165 struct icmp6_hdr mld6_hdr;
166 struct in6_addr mld6_addr; /* multicast address */
153#define ICMP6_NI_REFUSED 1 /* node information request is refused */
154#define ICMP6_NI_UNKNOWN 2 /* unknown Qtype */
155
156#define ICMP6_ROUTER_RENUMBERING_COMMAND 0 /* rr command */
157#define ICMP6_ROUTER_RENUMBERING_RESULT 1 /* rr result */
158#define ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET 255 /* rr seq num reset */
159
160/* Used in kernel only */
161#define ND_REDIRECT_ONLINK 0 /* redirect to an on-link node */
162#define ND_REDIRECT_ROUTER 1 /* redirect to a better router */
163
164/*
165 * Multicast Listener Discovery
166 */
167struct mld6_hdr {
168 struct icmp6_hdr mld6_hdr;
169 struct in6_addr mld6_addr; /* multicast address */
167};
170} __attribute__((__packed__));
168
169#define mld6_type mld6_hdr.icmp6_type
170#define mld6_code mld6_hdr.icmp6_code
171#define mld6_cksum mld6_hdr.icmp6_cksum
172#define mld6_maxdelay mld6_hdr.icmp6_data16[0]
173#define mld6_reserved mld6_hdr.icmp6_data16[1]
174
175/*
176 * Neighbor Discovery
177 */
178
179struct nd_router_solicit { /* router solicitation */
180 struct icmp6_hdr nd_rs_hdr;
181 /* could be followed by options */
171
172#define mld6_type mld6_hdr.icmp6_type
173#define mld6_code mld6_hdr.icmp6_code
174#define mld6_cksum mld6_hdr.icmp6_cksum
175#define mld6_maxdelay mld6_hdr.icmp6_data16[0]
176#define mld6_reserved mld6_hdr.icmp6_data16[1]
177
178/*
179 * Neighbor Discovery
180 */
181
182struct nd_router_solicit { /* router solicitation */
183 struct icmp6_hdr nd_rs_hdr;
184 /* could be followed by options */
182};
185} __attribute__((__packed__));
183
184#define nd_rs_type nd_rs_hdr.icmp6_type
185#define nd_rs_code nd_rs_hdr.icmp6_code
186#define nd_rs_cksum nd_rs_hdr.icmp6_cksum
187#define nd_rs_reserved nd_rs_hdr.icmp6_data32[0]
188
189struct nd_router_advert { /* router advertisement */
190 struct icmp6_hdr nd_ra_hdr;
191 u_int32_t nd_ra_reachable; /* reachable time */
192 u_int32_t nd_ra_retransmit; /* retransmit timer */
193 /* could be followed by options */
186
187#define nd_rs_type nd_rs_hdr.icmp6_type
188#define nd_rs_code nd_rs_hdr.icmp6_code
189#define nd_rs_cksum nd_rs_hdr.icmp6_cksum
190#define nd_rs_reserved nd_rs_hdr.icmp6_data32[0]
191
192struct nd_router_advert { /* router advertisement */
193 struct icmp6_hdr nd_ra_hdr;
194 u_int32_t nd_ra_reachable; /* reachable time */
195 u_int32_t nd_ra_retransmit; /* retransmit timer */
196 /* could be followed by options */
194};
197} __attribute__((__packed__));
195
196#define nd_ra_type nd_ra_hdr.icmp6_type
197#define nd_ra_code nd_ra_hdr.icmp6_code
198#define nd_ra_cksum nd_ra_hdr.icmp6_cksum
199#define nd_ra_curhoplimit nd_ra_hdr.icmp6_data8[0]
200#define nd_ra_flags_reserved nd_ra_hdr.icmp6_data8[1]
201#define ND_RA_FLAG_MANAGED 0x80
202#define ND_RA_FLAG_OTHER 0x40
198
199#define nd_ra_type nd_ra_hdr.icmp6_type
200#define nd_ra_code nd_ra_hdr.icmp6_code
201#define nd_ra_cksum nd_ra_hdr.icmp6_cksum
202#define nd_ra_curhoplimit nd_ra_hdr.icmp6_data8[0]
203#define nd_ra_flags_reserved nd_ra_hdr.icmp6_data8[1]
204#define ND_RA_FLAG_MANAGED 0x80
205#define ND_RA_FLAG_OTHER 0x40
206#define ND_RA_FLAG_HA 0x20
207
208/*
209 * Router preference values based on draft-draves-ipngwg-router-selection-01.
210 * These are non-standard definitions.
211 */
212#define ND_RA_FLAG_RTPREF_MASK 0x18 /* 00011000 */
213
214#define ND_RA_FLAG_RTPREF_HIGH 0x08 /* 00001000 */
215#define ND_RA_FLAG_RTPREF_MEDIUM 0x00 /* 00000000 */
216#define ND_RA_FLAG_RTPREF_LOW 0x18 /* 00011000 */
217#define ND_RA_FLAG_RTPREF_RSV 0x10 /* 00010000 */
218
203#define nd_ra_router_lifetime nd_ra_hdr.icmp6_data16[1]
204
205struct nd_neighbor_solicit { /* neighbor solicitation */
206 struct icmp6_hdr nd_ns_hdr;
207 struct in6_addr nd_ns_target; /*target address */
208 /* could be followed by options */
219#define nd_ra_router_lifetime nd_ra_hdr.icmp6_data16[1]
220
221struct nd_neighbor_solicit { /* neighbor solicitation */
222 struct icmp6_hdr nd_ns_hdr;
223 struct in6_addr nd_ns_target; /*target address */
224 /* could be followed by options */
209};
225} __attribute__((__packed__));
210
211#define nd_ns_type nd_ns_hdr.icmp6_type
212#define nd_ns_code nd_ns_hdr.icmp6_code
213#define nd_ns_cksum nd_ns_hdr.icmp6_cksum
214#define nd_ns_reserved nd_ns_hdr.icmp6_data32[0]
215
216struct nd_neighbor_advert { /* neighbor advertisement */
217 struct icmp6_hdr nd_na_hdr;
218 struct in6_addr nd_na_target; /* target address */
219 /* could be followed by options */
226
227#define nd_ns_type nd_ns_hdr.icmp6_type
228#define nd_ns_code nd_ns_hdr.icmp6_code
229#define nd_ns_cksum nd_ns_hdr.icmp6_cksum
230#define nd_ns_reserved nd_ns_hdr.icmp6_data32[0]
231
232struct nd_neighbor_advert { /* neighbor advertisement */
233 struct icmp6_hdr nd_na_hdr;
234 struct in6_addr nd_na_target; /* target address */
235 /* could be followed by options */
220};
236} __attribute__((__packed__));
221
222#define nd_na_type nd_na_hdr.icmp6_type
223#define nd_na_code nd_na_hdr.icmp6_code
224#define nd_na_cksum nd_na_hdr.icmp6_cksum
225#define nd_na_flags_reserved nd_na_hdr.icmp6_data32[0]
226#if BYTE_ORDER == BIG_ENDIAN
227#define ND_NA_FLAG_ROUTER 0x80000000
228#define ND_NA_FLAG_SOLICITED 0x40000000

--- 6 unchanged lines hidden (view full) ---

235#endif
236#endif
237
238struct nd_redirect { /* redirect */
239 struct icmp6_hdr nd_rd_hdr;
240 struct in6_addr nd_rd_target; /* target address */
241 struct in6_addr nd_rd_dst; /* destination address */
242 /* could be followed by options */
237
238#define nd_na_type nd_na_hdr.icmp6_type
239#define nd_na_code nd_na_hdr.icmp6_code
240#define nd_na_cksum nd_na_hdr.icmp6_cksum
241#define nd_na_flags_reserved nd_na_hdr.icmp6_data32[0]
242#if BYTE_ORDER == BIG_ENDIAN
243#define ND_NA_FLAG_ROUTER 0x80000000
244#define ND_NA_FLAG_SOLICITED 0x40000000

--- 6 unchanged lines hidden (view full) ---

251#endif
252#endif
253
254struct nd_redirect { /* redirect */
255 struct icmp6_hdr nd_rd_hdr;
256 struct in6_addr nd_rd_target; /* target address */
257 struct in6_addr nd_rd_dst; /* destination address */
258 /* could be followed by options */
243};
259} __attribute__((__packed__));
244
245#define nd_rd_type nd_rd_hdr.icmp6_type
246#define nd_rd_code nd_rd_hdr.icmp6_code
247#define nd_rd_cksum nd_rd_hdr.icmp6_cksum
248#define nd_rd_reserved nd_rd_hdr.icmp6_data32[0]
249
250struct nd_opt_hdr { /* Neighbor discovery option header */
251 u_int8_t nd_opt_type;
252 u_int8_t nd_opt_len;
253 /* followed by option specific data*/
260
261#define nd_rd_type nd_rd_hdr.icmp6_type
262#define nd_rd_code nd_rd_hdr.icmp6_code
263#define nd_rd_cksum nd_rd_hdr.icmp6_cksum
264#define nd_rd_reserved nd_rd_hdr.icmp6_data32[0]
265
266struct nd_opt_hdr { /* Neighbor discovery option header */
267 u_int8_t nd_opt_type;
268 u_int8_t nd_opt_len;
269 /* followed by option specific data*/
254};
270} __attribute__((__packed__));
255
256#define ND_OPT_SOURCE_LINKADDR 1
257#define ND_OPT_TARGET_LINKADDR 2
258#define ND_OPT_PREFIX_INFORMATION 3
259#define ND_OPT_REDIRECTED_HEADER 4
260#define ND_OPT_MTU 5
271
272#define ND_OPT_SOURCE_LINKADDR 1
273#define ND_OPT_TARGET_LINKADDR 2
274#define ND_OPT_PREFIX_INFORMATION 3
275#define ND_OPT_REDIRECTED_HEADER 4
276#define ND_OPT_MTU 5
277#define ND_OPT_ROUTE_INFO 9 /* draft-draves-router-preference, not officially assigned yet */
261
262struct nd_opt_prefix_info { /* prefix information */
263 u_int8_t nd_opt_pi_type;
264 u_int8_t nd_opt_pi_len;
265 u_int8_t nd_opt_pi_prefix_len;
266 u_int8_t nd_opt_pi_flags_reserved;
267 u_int32_t nd_opt_pi_valid_time;
268 u_int32_t nd_opt_pi_preferred_time;
269 u_int32_t nd_opt_pi_reserved2;
270 struct in6_addr nd_opt_pi_prefix;
278
279struct nd_opt_prefix_info { /* prefix information */
280 u_int8_t nd_opt_pi_type;
281 u_int8_t nd_opt_pi_len;
282 u_int8_t nd_opt_pi_prefix_len;
283 u_int8_t nd_opt_pi_flags_reserved;
284 u_int32_t nd_opt_pi_valid_time;
285 u_int32_t nd_opt_pi_preferred_time;
286 u_int32_t nd_opt_pi_reserved2;
287 struct in6_addr nd_opt_pi_prefix;
271};
288} __attribute__((__packed__));
272
273#define ND_OPT_PI_FLAG_ONLINK 0x80
274#define ND_OPT_PI_FLAG_AUTO 0x40
275
276struct nd_opt_rd_hdr { /* redirected header */
277 u_int8_t nd_opt_rh_type;
278 u_int8_t nd_opt_rh_len;
279 u_int16_t nd_opt_rh_reserved1;
280 u_int32_t nd_opt_rh_reserved2;
281 /* followed by IP header and data */
289
290#define ND_OPT_PI_FLAG_ONLINK 0x80
291#define ND_OPT_PI_FLAG_AUTO 0x40
292
293struct nd_opt_rd_hdr { /* redirected header */
294 u_int8_t nd_opt_rh_type;
295 u_int8_t nd_opt_rh_len;
296 u_int16_t nd_opt_rh_reserved1;
297 u_int32_t nd_opt_rh_reserved2;
298 /* followed by IP header and data */
282};
299} __attribute__((__packed__));
283
284struct nd_opt_mtu { /* MTU option */
285 u_int8_t nd_opt_mtu_type;
286 u_int8_t nd_opt_mtu_len;
287 u_int16_t nd_opt_mtu_reserved;
288 u_int32_t nd_opt_mtu_mtu;
300
301struct nd_opt_mtu { /* MTU option */
302 u_int8_t nd_opt_mtu_type;
303 u_int8_t nd_opt_mtu_len;
304 u_int16_t nd_opt_mtu_reserved;
305 u_int32_t nd_opt_mtu_mtu;
289};
306} __attribute__((__packed__));
290
307
308struct nd_opt_route_info { /* route info */
309 u_int8_t nd_opt_rti_type;
310 u_int8_t nd_opt_rti_len;
311 u_int8_t nd_opt_rti_prefixlen;
312 u_int8_t nd_opt_rti_flags;
313 u_int32_t nd_opt_rti_lifetime;
314 /* followed by prefix */
315} __attribute__((__packed__));
291/*
292 * icmp6 namelookup
293 */
294
295struct icmp6_namelookup {
296 struct icmp6_hdr icmp6_nl_hdr;
297 u_int8_t icmp6_nl_nonce[8];
298 int32_t icmp6_nl_ttl;
299#if 0
300 u_int8_t icmp6_nl_len;
301 u_int8_t icmp6_nl_name[3];
302#endif
303 /* could be followed by options */
316/*
317 * icmp6 namelookup
318 */
319
320struct icmp6_namelookup {
321 struct icmp6_hdr icmp6_nl_hdr;
322 u_int8_t icmp6_nl_nonce[8];
323 int32_t icmp6_nl_ttl;
324#if 0
325 u_int8_t icmp6_nl_len;
326 u_int8_t icmp6_nl_name[3];
327#endif
328 /* could be followed by options */
304};
329} __attribute__((__packed__));
305
306/*
307 * icmp6 node information
308 */
309struct icmp6_nodeinfo {
310 struct icmp6_hdr icmp6_ni_hdr;
311 u_int8_t icmp6_ni_nonce[8];
312 /* could be followed by reply data */
330
331/*
332 * icmp6 node information
333 */
334struct icmp6_nodeinfo {
335 struct icmp6_hdr icmp6_ni_hdr;
336 u_int8_t icmp6_ni_nonce[8];
337 /* could be followed by reply data */
313};
338} __attribute__((__packed__));
314
315#define ni_type icmp6_ni_hdr.icmp6_type
316#define ni_code icmp6_ni_hdr.icmp6_code
317#define ni_cksum icmp6_ni_hdr.icmp6_cksum
318#define ni_qtype icmp6_ni_hdr.icmp6_data16[0]
319#define ni_flags icmp6_ni_hdr.icmp6_data16[1]
320
321#define NI_QTYPE_NOOP 0 /* NOOP */
322#define NI_QTYPE_SUPTYPES 1 /* Supported Qtypes */
339
340#define ni_type icmp6_ni_hdr.icmp6_type
341#define ni_code icmp6_ni_hdr.icmp6_code
342#define ni_cksum icmp6_ni_hdr.icmp6_cksum
343#define ni_qtype icmp6_ni_hdr.icmp6_data16[0]
344#define ni_flags icmp6_ni_hdr.icmp6_data16[1]
345
346#define NI_QTYPE_NOOP 0 /* NOOP */
347#define NI_QTYPE_SUPTYPES 1 /* Supported Qtypes */
323#define NI_QTYPE_FQDN 2 /* FQDN */
324#define NI_QTYPE_NODEADDR 3 /* Node Addresses. XXX: spec says 2, but it may be a typo... */
348#define NI_QTYPE_FQDN 2 /* FQDN (draft 04) */
349#define NI_QTYPE_DNSNAME 2 /* DNS Name */
350#define NI_QTYPE_NODEADDR 3 /* Node Addresses */
351#define NI_QTYPE_IPV4ADDR 4 /* IPv4 Addresses */
325
326#if BYTE_ORDER == BIG_ENDIAN
327#define NI_SUPTYPE_FLAG_COMPRESS 0x1
328#define NI_FQDN_FLAG_VALIDTTL 0x1
329#elif BYTE_ORDER == LITTLE_ENDIAN
330#define NI_SUPTYPE_FLAG_COMPRESS 0x0100
331#define NI_FQDN_FLAG_VALIDTTL 0x0100
332#endif

--- 33 unchanged lines hidden (view full) ---

366#define NI_NODEADDR_FLAG_ANYCAST 0x4000 /* just experimental. not in spec */
367#endif
368#endif
369
370struct ni_reply_fqdn {
371 u_int32_t ni_fqdn_ttl; /* TTL */
372 u_int8_t ni_fqdn_namelen; /* length in octets of the FQDN */
373 u_int8_t ni_fqdn_name[3]; /* XXX: alignment */
352
353#if BYTE_ORDER == BIG_ENDIAN
354#define NI_SUPTYPE_FLAG_COMPRESS 0x1
355#define NI_FQDN_FLAG_VALIDTTL 0x1
356#elif BYTE_ORDER == LITTLE_ENDIAN
357#define NI_SUPTYPE_FLAG_COMPRESS 0x0100
358#define NI_FQDN_FLAG_VALIDTTL 0x0100
359#endif

--- 33 unchanged lines hidden (view full) ---

393#define NI_NODEADDR_FLAG_ANYCAST 0x4000 /* just experimental. not in spec */
394#endif
395#endif
396
397struct ni_reply_fqdn {
398 u_int32_t ni_fqdn_ttl; /* TTL */
399 u_int8_t ni_fqdn_namelen; /* length in octets of the FQDN */
400 u_int8_t ni_fqdn_name[3]; /* XXX: alignment */
374};
401} __attribute__((__packed__));
375
376/*
377 * Router Renumbering. as router-renum-08.txt
378 */
379struct icmp6_router_renum { /* router renumbering header */
380 struct icmp6_hdr rr_hdr;
381 u_int8_t rr_segnum;
382 u_int8_t rr_flags;
383 u_int16_t rr_maxdelay;
384 u_int32_t rr_reserved;
402
403/*
404 * Router Renumbering. as router-renum-08.txt
405 */
406struct icmp6_router_renum { /* router renumbering header */
407 struct icmp6_hdr rr_hdr;
408 u_int8_t rr_segnum;
409 u_int8_t rr_flags;
410 u_int16_t rr_maxdelay;
411 u_int32_t rr_reserved;
385};
386#define ICMP6_RR_FLAGS_SEGNUM 0x80
387#define ICMP6_RR_FLAGS_TEST 0x40
388#define ICMP6_RR_FLAGS_REQRESULT 0x20
389#define ICMP6_RR_FLAGS_FORCEAPPLY 0x10
390#define ICMP6_RR_FLAGS_SPECSITE 0x08
391#define ICMP6_RR_FLAGS_PREVDONE 0x04
412} __attribute__((__packed__));
392
413
414#define ICMP6_RR_FLAGS_TEST 0x80
415#define ICMP6_RR_FLAGS_REQRESULT 0x40
416#define ICMP6_RR_FLAGS_FORCEAPPLY 0x20
417#define ICMP6_RR_FLAGS_SPECSITE 0x10
418#define ICMP6_RR_FLAGS_PREVDONE 0x08
419
393#define rr_type rr_hdr.icmp6_type
394#define rr_code rr_hdr.icmp6_code
395#define rr_cksum rr_hdr.icmp6_cksum
396#define rr_seqnum rr_hdr.icmp6_data32[0]
397
398struct rr_pco_match { /* match prefix part */
399 u_int8_t rpm_code;
400 u_int8_t rpm_len;
401 u_int8_t rpm_ordinal;
402 u_int8_t rpm_matchlen;
403 u_int8_t rpm_minlen;
404 u_int8_t rpm_maxlen;
405 u_int16_t rpm_reserved;
406 struct in6_addr rpm_prefix;
420#define rr_type rr_hdr.icmp6_type
421#define rr_code rr_hdr.icmp6_code
422#define rr_cksum rr_hdr.icmp6_cksum
423#define rr_seqnum rr_hdr.icmp6_data32[0]
424
425struct rr_pco_match { /* match prefix part */
426 u_int8_t rpm_code;
427 u_int8_t rpm_len;
428 u_int8_t rpm_ordinal;
429 u_int8_t rpm_matchlen;
430 u_int8_t rpm_minlen;
431 u_int8_t rpm_maxlen;
432 u_int16_t rpm_reserved;
433 struct in6_addr rpm_prefix;
407};
434} __attribute__((__packed__));
408
409#define RPM_PCO_ADD 1
410#define RPM_PCO_CHANGE 2
411#define RPM_PCO_SETGLOBAL 3
412#define RPM_PCO_MAX 4
413
414struct rr_pco_use { /* use prefix part */
415 u_int8_t rpu_uselen;
416 u_int8_t rpu_keeplen;
417 u_int8_t rpu_ramask;
418 u_int8_t rpu_raflags;
419 u_int32_t rpu_vltime;
420 u_int32_t rpu_pltime;
421 u_int32_t rpu_flags;
422 struct in6_addr rpu_prefix;
435
436#define RPM_PCO_ADD 1
437#define RPM_PCO_CHANGE 2
438#define RPM_PCO_SETGLOBAL 3
439#define RPM_PCO_MAX 4
440
441struct rr_pco_use { /* use prefix part */
442 u_int8_t rpu_uselen;
443 u_int8_t rpu_keeplen;
444 u_int8_t rpu_ramask;
445 u_int8_t rpu_raflags;
446 u_int32_t rpu_vltime;
447 u_int32_t rpu_pltime;
448 u_int32_t rpu_flags;
449 struct in6_addr rpu_prefix;
423};
450} __attribute__((__packed__));
424#define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK 0x80
425#define ICMP6_RR_PCOUSE_RAFLAGS_AUTO 0x40
426
427#if BYTE_ORDER == BIG_ENDIAN
428#define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80000000
429#define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40000000
430#elif BYTE_ORDER == LITTLE_ENDIAN
431#define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80
432#define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40
433#endif
434
435struct rr_result { /* router renumbering result message */
436 u_int16_t rrr_flags;
437 u_int8_t rrr_ordinal;
438 u_int8_t rrr_matchedlen;
439 u_int32_t rrr_ifid;
440 struct in6_addr rrr_prefix;
451#define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK 0x80
452#define ICMP6_RR_PCOUSE_RAFLAGS_AUTO 0x40
453
454#if BYTE_ORDER == BIG_ENDIAN
455#define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80000000
456#define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40000000
457#elif BYTE_ORDER == LITTLE_ENDIAN
458#define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80
459#define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40
460#endif
461
462struct rr_result { /* router renumbering result message */
463 u_int16_t rrr_flags;
464 u_int8_t rrr_ordinal;
465 u_int8_t rrr_matchedlen;
466 u_int32_t rrr_ifid;
467 struct in6_addr rrr_prefix;
441};
468} __attribute__((__packed__));
442#if BYTE_ORDER == BIG_ENDIAN
443#define ICMP6_RR_RESULT_FLAGS_OOB 0x0002
444#define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0001
445#elif BYTE_ORDER == LITTLE_ENDIAN
469#if BYTE_ORDER == BIG_ENDIAN
470#define ICMP6_RR_RESULT_FLAGS_OOB 0x0002
471#define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0001
472#elif BYTE_ORDER == LITTLE_ENDIAN
446#define ICMP6_RR_RESULT_FLAGS_OOB 0x02
447#define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x01
473#define ICMP6_RR_RESULT_FLAGS_OOB 0x0200
474#define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0100
448#endif
449
450/*
451 * icmp6 filter structures.
452 */
453
454struct icmp6_filter {
455 u_int32_t icmp6_filt[8];

--- 73 unchanged lines hidden (view full) ---

529#define icp6s_otime_exceed_reassembly \
530 icp6s_outerrhist.icp6errs_time_exceed_reassembly
531#define icp6s_oparamprob_header icp6s_outerrhist.icp6errs_paramprob_header
532#define icp6s_oparamprob_nextheader \
533 icp6s_outerrhist.icp6errs_paramprob_nextheader
534#define icp6s_oparamprob_option icp6s_outerrhist.icp6errs_paramprob_option
535#define icp6s_oredirect icp6s_outerrhist.icp6errs_redirect
536#define icp6s_ounknown icp6s_outerrhist.icp6errs_unknown
475#endif
476
477/*
478 * icmp6 filter structures.
479 */
480
481struct icmp6_filter {
482 u_int32_t icmp6_filt[8];

--- 73 unchanged lines hidden (view full) ---

556#define icp6s_otime_exceed_reassembly \
557 icp6s_outerrhist.icp6errs_time_exceed_reassembly
558#define icp6s_oparamprob_header icp6s_outerrhist.icp6errs_paramprob_header
559#define icp6s_oparamprob_nextheader \
560 icp6s_outerrhist.icp6errs_paramprob_nextheader
561#define icp6s_oparamprob_option icp6s_outerrhist.icp6errs_paramprob_option
562#define icp6s_oredirect icp6s_outerrhist.icp6errs_redirect
563#define icp6s_ounknown icp6s_outerrhist.icp6errs_unknown
564 u_quad_t icp6s_pmtuchg; /* path MTU changes */
565 u_quad_t icp6s_nd_badopt; /* bad ND options */
566 u_quad_t icp6s_badns; /* bad neighbor solicitation */
567 u_quad_t icp6s_badna; /* bad neighbor advertisement */
568 u_quad_t icp6s_badrs; /* bad router advertisement */
569 u_quad_t icp6s_badra; /* bad router advertisement */
570 u_quad_t icp6s_badredirect; /* bad redirect message */
537};
538
539/*
540 * Names for ICMP sysctl objects
541 */
542#define ICMPV6CTL_STATS 1
543#define ICMPV6CTL_REDIRACCEPT 2 /* accept/process redirects */
544#define ICMPV6CTL_REDIRTIMEOUT 3 /* redirect cache time */
571};
572
573/*
574 * Names for ICMP sysctl objects
575 */
576#define ICMPV6CTL_STATS 1
577#define ICMPV6CTL_REDIRACCEPT 2 /* accept/process redirects */
578#define ICMPV6CTL_REDIRTIMEOUT 3 /* redirect cache time */
579#if 0 /*obsoleted*/
545#define ICMPV6CTL_ERRRATELIMIT 5 /* ICMPv6 error rate limitation */
580#define ICMPV6CTL_ERRRATELIMIT 5 /* ICMPv6 error rate limitation */
581#endif
546#define ICMPV6CTL_ND6_PRUNE 6
547#define ICMPV6CTL_ND6_DELAY 8
548#define ICMPV6CTL_ND6_UMAXTRIES 9
549#define ICMPV6CTL_ND6_MMAXTRIES 10
550#define ICMPV6CTL_ND6_USELOOPBACK 11
551/*#define ICMPV6CTL_ND6_PROXYALL 12 obsoleted, do not reuse here */
552#define ICMPV6CTL_NODEINFO 13
553#define ICMPV6CTL_ERRPPSLIMIT 14 /* ICMPv6 error pps limitation */
554#define ICMPV6CTL_ND6_MAXNUDHINT 15
582#define ICMPV6CTL_ND6_PRUNE 6
583#define ICMPV6CTL_ND6_DELAY 8
584#define ICMPV6CTL_ND6_UMAXTRIES 9
585#define ICMPV6CTL_ND6_MMAXTRIES 10
586#define ICMPV6CTL_ND6_USELOOPBACK 11
587/*#define ICMPV6CTL_ND6_PROXYALL 12 obsoleted, do not reuse here */
588#define ICMPV6CTL_NODEINFO 13
589#define ICMPV6CTL_ERRPPSLIMIT 14 /* ICMPv6 error pps limitation */
590#define ICMPV6CTL_ND6_MAXNUDHINT 15
555#define ICMPV6CTL_MAXID 16
591#define ICMPV6CTL_MTUDISC_HIWAT 16
592#define ICMPV6CTL_MTUDISC_LOWAT 17
593#define ICMPV6CTL_ND6_DEBUG 18
594#define ICMPV6CTL_ND6_DRLIST 19
595#define ICMPV6CTL_ND6_PRLIST 20
596#define ICMPV6CTL_MAXID 21
556
557#define ICMPV6CTL_NAMES { \
558 { 0, 0 }, \
559 { 0, 0 }, \
560 { "rediraccept", CTLTYPE_INT }, \
561 { "redirtimeout", CTLTYPE_INT }, \
562 { 0, 0 }, \
597
598#define ICMPV6CTL_NAMES { \
599 { 0, 0 }, \
600 { 0, 0 }, \
601 { "rediraccept", CTLTYPE_INT }, \
602 { "redirtimeout", CTLTYPE_INT }, \
603 { 0, 0 }, \
563 { "errratelimit", CTLTYPE_INT }, \
604 { 0, 0 }, \
564 { "nd6_prune", CTLTYPE_INT }, \
565 { 0, 0 }, \
566 { "nd6_delay", CTLTYPE_INT }, \
567 { "nd6_umaxtries", CTLTYPE_INT }, \
568 { "nd6_mmaxtries", CTLTYPE_INT }, \
569 { "nd6_useloopback", CTLTYPE_INT }, \
570 { 0, 0 }, \
571 { "nodeinfo", CTLTYPE_INT }, \
572 { "errppslimit", CTLTYPE_INT }, \
573 { "nd6_maxnudhint", CTLTYPE_INT }, \
605 { "nd6_prune", CTLTYPE_INT }, \
606 { 0, 0 }, \
607 { "nd6_delay", CTLTYPE_INT }, \
608 { "nd6_umaxtries", CTLTYPE_INT }, \
609 { "nd6_mmaxtries", CTLTYPE_INT }, \
610 { "nd6_useloopback", CTLTYPE_INT }, \
611 { 0, 0 }, \
612 { "nodeinfo", CTLTYPE_INT }, \
613 { "errppslimit", CTLTYPE_INT }, \
614 { "nd6_maxnudhint", CTLTYPE_INT }, \
615 { "mtudisc_hiwat", CTLTYPE_INT }, \
616 { "mtudisc_lowat", CTLTYPE_INT }, \
617 { "nd6_debug", CTLTYPE_INT }, \
618 { 0, 0 }, \
619 { 0, 0 }, \
574}
575
576#define RTF_PROBEMTU RTF_PROTO1
577
578#ifdef _KERNEL
579# ifdef __STDC__
580struct rtentry;
581struct rttimer;

--- 4 unchanged lines hidden (view full) ---

586void icmp6_error __P((struct mbuf *, int, int, int));
587int icmp6_input __P((struct mbuf **, int *, int));
588void icmp6_fasttimo __P((void));
589void icmp6_reflect __P((struct mbuf *, size_t));
590void icmp6_prepare __P((struct mbuf *));
591void icmp6_redirect_input __P((struct mbuf *, int));
592void icmp6_redirect_output __P((struct mbuf *, struct rtentry *));
593
620}
621
622#define RTF_PROBEMTU RTF_PROTO1
623
624#ifdef _KERNEL
625# ifdef __STDC__
626struct rtentry;
627struct rttimer;

--- 4 unchanged lines hidden (view full) ---

632void icmp6_error __P((struct mbuf *, int, int, int));
633int icmp6_input __P((struct mbuf **, int *, int));
634void icmp6_fasttimo __P((void));
635void icmp6_reflect __P((struct mbuf *, size_t));
636void icmp6_prepare __P((struct mbuf *));
637void icmp6_redirect_input __P((struct mbuf *, int));
638void icmp6_redirect_output __P((struct mbuf *, struct rtentry *));
639
640struct ip6ctlparam;
641void icmp6_mtudisc_update __P((struct ip6ctlparam *, int));
642
594/* XXX: is this the right place for these macros? */
595#define icmp6_ifstat_inc(ifp, tag) \
596do { \
597 if ((ifp) && (ifp)->if_index <= if_index \
598 && (ifp)->if_index < icmp6_ifstatmax \
599 && icmp6_ifstat && icmp6_ifstat[(ifp)->if_index]) { \
600 icmp6_ifstat[(ifp)->if_index]->tag++; \
601 } \

--- 60 unchanged lines hidden ---
643/* XXX: is this the right place for these macros? */
644#define icmp6_ifstat_inc(ifp, tag) \
645do { \
646 if ((ifp) && (ifp)->if_index <= if_index \
647 && (ifp)->if_index < icmp6_ifstatmax \
648 && icmp6_ifstat && icmp6_ifstat[(ifp)->if_index]) { \
649 icmp6_ifstat[(ifp)->if_index]->tag++; \
650 } \

--- 60 unchanged lines hidden ---