-/* @(#) $Header: /tcpdump/master/tcpdump/icmp6.h,v 1.13 2002-11-09 17:19:18 itojun Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/icmp6.h,v 1.16.2.1 2005-09-05 09:29:28 guy Exp $ (LBL) */
/* $NetBSD: icmp6.h,v 1.13 2000/08/03 16:30:37 itojun Exp $ */
/* $KAME: icmp6.h,v 1.22 2000/08/03 15:25:16 jinmei Exp $ */
u_int16_t icmp6_un_data16[2]; /* type-specific field */
u_int8_t icmp6_un_data8[4]; /* type-specific field */
} icmp6_dataun;
-} __attribute__((packed));
+};
#define icmp6_data32 icmp6_dataun.icmp6_un_data32
#define icmp6_data16 icmp6_dataun.icmp6_un_data16
#define MLD6_LISTENER_DONE 132 /* multicast listener done */
#define ND_ROUTER_SOLICIT 133 /* router solicitation */
-#define ND_ROUTER_ADVERT 134 /* router advertisment */
+#define ND_ROUTER_ADVERT 134 /* router advertisement */
#define ND_NEIGHBOR_SOLICIT 135 /* neighbor solicitation */
-#define ND_NEIGHBOR_ADVERT 136 /* neighbor advertisment */
+#define ND_NEIGHBOR_ADVERT 136 /* neighbor advertisement */
#define ND_REDIRECT 137 /* redirect */
#define ICMP6_ROUTER_RENUMBERING 138 /* router renumbering */
#define ICMP6_FQDN_REPLY 140 /* FQDN reply */
#define ICMP6_NI_QUERY 139 /* node information request */
#define ICMP6_NI_REPLY 140 /* node information reply */
+#define IND_SOLICIT 141 /* inverse neighbor solicitation */
+#define IND_ADVERT 142 /* inverse neighbor advertisement */
-/* The definitions below are experimental. TBA */
-#define MLD6_MTRACE_RESP 141 /* mtrace response(to sender) */
-#define MLD6_MTRACE 142 /* mtrace messages */
+#define ICMP6_V2_MEMBERSHIP_REPORT 143 /* v2 membership report */
+#define MLDV2_LISTENER_REPORT 143 /* v2 multicast listener report */
+#define ICMP6_HADISCOV_REQUEST 144
+#define ICMP6_HADISCOV_REPLY 145
+#define ICMP6_MOBILEPREFIX_SOLICIT 146
+#define ICMP6_MOBILEPREFIX_ADVERT 147
-/* Folloing numbers are defined in the mobile-ip draft. */
-#define ICMP6_HADISCOV_REQUEST 150 /* XXX To be authorized */
-#define ICMP6_HADISCOV_REPLY 151 /* XXX To be authorized */
-#define ICMP6_MOBILEPREFIX_SOLICIT 152 /* XXX To be authorized */
-#define ICMP6_MOBILEPREFIX_ADVERT 153 /* XXX To be authorized */
+#define MLD6_MTRACE_RESP 200 /* mtrace response(to sender) */
+#define MLD6_MTRACE 201 /* mtrace messages */
-#define ICMP6_MAXTYPE 153
+#define ICMP6_MAXTYPE 201
#define ICMP6_DST_UNREACH_NOROUTE 0 /* no route to destination */
#define ICMP6_DST_UNREACH_ADMIN 1 /* administratively prohibited */
struct mld6_hdr {
struct icmp6_hdr mld6_hdr;
struct in6_addr mld6_addr; /* multicast address */
-} __attribute__((packed));
+};
#define mld6_type mld6_hdr.icmp6_type
#define mld6_code mld6_hdr.icmp6_code
#define mld6_maxdelay mld6_hdr.icmp6_data16[0]
#define mld6_reserved mld6_hdr.icmp6_data16[1]
+#define MLD_MINLEN 24
+#define MLDV2_MINLEN 28
+
/*
* Neighbor Discovery
*/
struct nd_router_solicit { /* router solicitation */
struct icmp6_hdr nd_rs_hdr;
/* could be followed by options */
-} __attribute__((packed));
+};
#define nd_rs_type nd_rs_hdr.icmp6_type
#define nd_rs_code nd_rs_hdr.icmp6_code
u_int32_t nd_ra_reachable; /* reachable time */
u_int32_t nd_ra_retransmit; /* retransmit timer */
/* could be followed by options */
-} __attribute__((packed));
+};
#define nd_ra_type nd_ra_hdr.icmp6_type
#define nd_ra_code nd_ra_hdr.icmp6_code
struct icmp6_hdr nd_ns_hdr;
struct in6_addr nd_ns_target; /*target address */
/* could be followed by options */
-} __attribute__((packed));
+};
#define nd_ns_type nd_ns_hdr.icmp6_type
#define nd_ns_code nd_ns_hdr.icmp6_code
struct icmp6_hdr nd_na_hdr;
struct in6_addr nd_na_target; /* target address */
/* could be followed by options */
-} __attribute__((packed));
+};
#define nd_na_type nd_na_hdr.icmp6_type
#define nd_na_code nd_na_hdr.icmp6_code
#define nd_na_cksum nd_na_hdr.icmp6_cksum
#define nd_na_flags_reserved nd_na_hdr.icmp6_data32[0]
-/* netowkr endian */
-#define ND_NA_FLAG_ROUTER ((u_int32_t)htonl(0x80000000))
-#define ND_NA_FLAG_SOLICITED ((u_int32_t)htonl(0x40000000))
-#define ND_NA_FLAG_OVERRIDE ((u_int32_t)htonl(0x20000000))
+
+#define ND_NA_FLAG_ROUTER 0x80000000
+#define ND_NA_FLAG_SOLICITED 0x40000000
+#define ND_NA_FLAG_OVERRIDE 0x20000000
struct nd_redirect { /* redirect */
struct icmp6_hdr nd_rd_hdr;
struct in6_addr nd_rd_target; /* target address */
struct in6_addr nd_rd_dst; /* destination address */
/* could be followed by options */
-} __attribute__((packed));
+};
#define nd_rd_type nd_rd_hdr.icmp6_type
#define nd_rd_code nd_rd_hdr.icmp6_code
u_int8_t nd_opt_type;
u_int8_t nd_opt_len;
/* followed by option specific data*/
-} __attribute__((packed));
+};
#define ND_OPT_SOURCE_LINKADDR 1
#define ND_OPT_TARGET_LINKADDR 2
u_int8_t nd_opt_pi_len;
u_int8_t nd_opt_pi_prefix_len;
u_int8_t nd_opt_pi_flags_reserved;
- u_int32_t nd_opt_pi_valid_time;
- u_int32_t nd_opt_pi_preferred_time;
- u_int32_t nd_opt_pi_reserved2;
+ u_int8_t nd_opt_pi_valid_time[4];
+ u_int8_t nd_opt_pi_preferred_time[4];
+ u_int8_t nd_opt_pi_reserved2[4];
struct in6_addr nd_opt_pi_prefix;
-} __attribute__((packed));
+};
#define ND_OPT_PI_FLAG_ONLINK 0x80
#define ND_OPT_PI_FLAG_AUTO 0x40
u_int16_t nd_opt_rh_reserved1;
u_int32_t nd_opt_rh_reserved2;
/* followed by IP header and data */
-} __attribute__((packed));
+};
struct nd_opt_mtu { /* MTU option */
u_int8_t nd_opt_mtu_type;
u_int8_t nd_opt_mtu_len;
u_int16_t nd_opt_mtu_reserved;
u_int32_t nd_opt_mtu_mtu;
-} __attribute__((packed));
+};
struct nd_opt_advinterval { /* Advertisement interval option */
u_int8_t nd_opt_adv_type;
u_int8_t nd_opt_adv_len;
u_int16_t nd_opt_adv_reserved;
u_int32_t nd_opt_adv_interval;
-} __attribute__((packed));
+};
struct nd_opt_homeagent_info { /* Home Agent info */
u_int8_t nd_opt_hai_type;
u_int16_t nd_opt_hai_reserved;
int16_t nd_opt_hai_preference;
u_int16_t nd_opt_hai_lifetime;
-} __attribute__((packed));
+};
struct nd_opt_route_info { /* route info */
u_int8_t nd_opt_rti_type;
u_int8_t nd_opt_rti_flags;
u_int32_t nd_opt_rti_lifetime;
/* prefix follows */
-} __attribute__((packed));
+};
/*
* icmp6 namelookup
u_int8_t icmp6_nl_name[3];
#endif
/* could be followed by options */
-} __attribute__((packed));
+};
/*
* icmp6 node information
struct icmp6_hdr icmp6_ni_hdr;
u_int8_t icmp6_ni_nonce[8];
/* could be followed by reply data */
-} __attribute__((packed));
+};
#define ni_type icmp6_ni_hdr.icmp6_type
#define ni_code icmp6_ni_hdr.icmp6_code
u_int32_t ni_fqdn_ttl; /* TTL */
u_int8_t ni_fqdn_namelen; /* length in octets of the FQDN */
u_int8_t ni_fqdn_name[3]; /* XXX: alignment */
-} __attribute__((packed));
+};
/*
* Router Renumbering. as router-renum-08.txt
u_int8_t rr_flags;
u_int16_t rr_maxdelay;
u_int32_t rr_reserved;
-} __attribute__((packed));
+};
#define ICMP6_RR_FLAGS_TEST 0x80
#define ICMP6_RR_FLAGS_REQRESULT 0x40
#define ICMP6_RR_FLAGS_FORCEAPPLY 0x20
u_int8_t rpm_maxlen;
u_int16_t rpm_reserved;
struct in6_addr rpm_prefix;
-} __attribute__((packed));
+};
#define RPM_PCO_ADD 1
#define RPM_PCO_CHANGE 2
u_int32_t rpu_pltime;
u_int32_t rpu_flags;
struct in6_addr rpu_prefix;
-} __attribute__((packed));
+};
#define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK 0x80
#define ICMP6_RR_PCOUSE_RAFLAGS_AUTO 0x40
u_int8_t rrr_matchedlen;
u_int32_t rrr_ifid;
struct in6_addr rrr_prefix;
-} __attribute__((packed));
+};
/* network endian */
#define ICMP6_RR_RESULT_FLAGS_OOB ((u_int16_t)htons(0x0002))
#define ICMP6_RR_RESULT_FLAGS_FORBIDDEN ((u_int16_t)htons(0x0001))