Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet have packed attribute to protocol structs. sync...



details:   https://anonhg.NetBSD.org/src/rev/466316b52ee7
branches:  trunk
changeset: 519590:466316b52ee7
user:      itojun <itojun%NetBSD.org@localhost>
date:      Fri Dec 21 02:52:18 2001 +0000

description:
have packed attribute to protocol structs.  sync with kame

diffstat:

 sys/netinet/icmp6.h |  50 +++++++++++++++++++++++++++-----------------------
 1 files changed, 27 insertions(+), 23 deletions(-)

diffs (197 lines):

diff -r a399c6301928 -r 466316b52ee7 sys/netinet/icmp6.h
--- a/sys/netinet/icmp6.h       Fri Dec 21 02:51:47 2001 +0000
+++ b/sys/netinet/icmp6.h       Fri Dec 21 02:52:18 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: icmp6.h,v 1.20 2001/12/07 10:10:43 itojun Exp $        */
+/*     $NetBSD: icmp6.h,v 1.21 2001/12/21 02:52:18 itojun Exp $        */
 /*     $KAME: icmp6.h,v 1.39 2001/02/06 03:48:06 itojun Exp $  */
 
 /*
@@ -80,7 +80,7 @@
                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
@@ -121,10 +121,10 @@
 #define ICMP6_NI_REPLY                 140     /* node information reply */
 
 /* The definitions below are experimental. TBA */
-#define MLD6_MTRACE_RESP               141     /* mtrace response(to sender) */
-#define MLD6_MTRACE                    142     /* mtrace messages */
+#define MLD6_MTRACE_RESP               200     /* mtrace response(to sender) */
+#define MLD6_MTRACE                    201     /* mtrace messages */
 
-#define ICMP6_MAXTYPE                  142
+#define ICMP6_MAXTYPE                  201
 
 #define ICMP6_DST_UNREACH_NOROUTE      0       /* no route to destination */
 #define ICMP6_DST_UNREACH_ADMIN                1       /* administratively prohibited */
@@ -164,7 +164,7 @@
 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
@@ -179,7 +179,7 @@
 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
@@ -191,7 +191,7 @@
        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
@@ -206,7 +206,7 @@
        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
@@ -217,7 +217,7 @@
        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
@@ -240,7 +240,7 @@
        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
@@ -251,7 +251,7 @@
        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
@@ -268,7 +268,7 @@
        u_int32_t       nd_opt_pi_preferred_time;
        u_int32_t       nd_opt_pi_reserved2;
        struct in6_addr nd_opt_pi_prefix;
-};
+} __attribute__((__packed__));
 
 #define ND_OPT_PI_FLAG_ONLINK          0x80
 #define ND_OPT_PI_FLAG_AUTO            0x40
@@ -279,14 +279,14 @@
        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__));
 
 /*
  * icmp6 namelookup
@@ -301,7 +301,7 @@
        u_int8_t        icmp6_nl_name[3];
 #endif
        /* could be followed by options */
-};
+} __attribute__((__packed__));
 
 /*
  * icmp6 node information
@@ -310,7 +310,7 @@
        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
@@ -373,7 +373,7 @@
        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
@@ -384,7 +384,7 @@
        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
@@ -406,7 +406,7 @@
        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
@@ -422,7 +422,7 @@
        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
 
@@ -440,7 +440,7 @@
        u_int8_t        rrr_matchedlen;
        u_int32_t       rrr_ifid;
        struct  in6_addr rrr_prefix;
-};
+} __attribute__((__packed__));
 #if BYTE_ORDER == BIG_ENDIAN
 #define ICMP6_RR_RESULT_FLAGS_OOB              0x0002
 #define ICMP6_RR_RESULT_FLAGS_FORBIDDEN                0x0001
@@ -514,7 +514,11 @@
        u_quad_t icp6s_tooshort;        /* packet < sizeof(struct icmp6_hdr) */
        u_quad_t icp6s_checksum;        /* bad checksum */
        u_quad_t icp6s_badlen;          /* calculated bound mismatch */
-       u_quad_t icp6s_reflect;         /* number of responses */
+       /*
+        * number of responses: this member is inherited from netinet code, but
+        * for netinet6 code, it is already available in icp6s_outhist[].
+        */
+       u_quad_t icp6s_reflect;
        u_quad_t icp6s_inhist[256];     
        u_quad_t icp6s_nd_toomanyopt;   /* too many ND options */
        struct icmp6errstat icp6s_outerrhist;



Home | Main Index | Thread Index | Old Index