tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

expanding netinet/icmp6.h with strings (et al)



Hi,

the following patch:
- adds a define for MLDV2_LISTENER_REPORT from FreeBSD (the name is as
  good as any and if it's there, the names won't grow apart as easily)
- adds defines for the missing ICMP6_DST_UNREACH codes
- adds strings for the types and codes (encapsulated by ICMP6_STRINGS)

Comments? Cries of pain? Shedding of bikes? ;)

-------------------------------------------------------------------------
Index: sys/netinet/icmp6.h
===================================================================
RCS file: /cvsroot/src/sys/netinet/icmp6.h,v
retrieving revision 1.44
diff -u -r1.44 icmp6.h
--- sys/netinet/icmp6.h 10 Dec 2011 19:14:29 -0000      1.44
+++ sys/netinet/icmp6.h 18 Jul 2012 12:23:37 -0000
@@ -125,6 +125,7 @@
 #define ICMP6_FQDN_REPLY               140     /* FQDN reply */
 #define ICMP6_NI_QUERY                 139     /* node information request */
 #define ICMP6_NI_REPLY                 140     /* node information reply */
+#define MLDV2_LISTENER_REPORT          143     /* RFC3810 listener report */
 
 /* The definitions below are experimental. TBA */
 #define MLD_MTRACE_RESP                        200     /* mtrace response(to 
sender) */
@@ -144,6 +145,9 @@
 #define ICMP6_DST_UNREACH_BEYONDSCOPE  2       /* beyond scope of source 
address */
 #define ICMP6_DST_UNREACH_ADDR         3       /* address unreachable */
 #define ICMP6_DST_UNREACH_NOPORT       4       /* port unreachable */
+#define ICMP6_DST_UNREACH_POLICY       5       /* source address failed 
ingress/egress policy */
+#define ICMP6_DST_UNREACH_REJROUTE     6       /* reject route to destination 
*/
+#define ICMP6_DST_UNREACH_SOURCERT     7       /* error in source routing 
header */
 
 #define ICMP6_TIME_EXCEED_TRANSIT      0       /* ttl==0 in transit */
 #define ICMP6_TIME_EXCEED_REASSEMBLY   1       /* ttl==0 in reass */
@@ -733,4 +737,41 @@
 extern int     icmp6_redirtimeout;     /* cache time for redirect routes */
 #endif /* _KERNEL */
 
+#ifdef ICMP6_STRINGS
+/* Info: http://www.iana.org/assignments/icmpv6-parameters */
+
+static const char *icmp6_type_err[] = {
+        "reserved0", "unreach", "packet_too_big", "timxceed", "paramprob",
+       NULL
+};
+
+static const char *icmp6_type_info[] = {
+       "echo", "echoreply",
+       "mcastlistenq", "mcastlistenrep", "mcastlistendone",
+       "rtsol", "rtadv", "neighsol", "neighadv", "redirect",
+       "routerrenum", "nodeinfoq", "nodeinfor", "invneighsol", "invneighrep",
+       "mcastlistenrep2", "haad_req", "haad_rep",
+       "mobile_psol", "mobile_padv", "cga_sol", "cga_adv",
+       "experimental150", "mcast_rtadv", "mcast_rtsol", "mcast_rtterm",
+       "fmipv6_msg", "rpl_control", NULL
+};
+
+static const char *icmp6_code_none[] = { "none", NULL };
+
+static const char *icmp6_code_unreach[] = {
+        "noroute", "admin", "beyondscope", "addr", "port",
+       "srcaddr_policy", "reject_route", "source_route_err", NULL
+};
+
+static const char *icmp6_code_timxceed[] = {
+        "intrans", "reass", NULL
+};
+
+static const char *icmp6_code_paramprob[] = {
+        "hdr_field", "nxthdr_type", "option", NULL
+};      
+
+/* not all informational icmps that have codes have a names array */
+#endif
+
 #endif /* !_NETINET_ICMP6_H_ */
-------------------------------------------------------------------------

regards,
        spz
-- 
spz%serpens.de@localhost (S.P.Zeidler)


Home | Main Index | Thread Index | Old Index