]> The Tcpdump Group git mirrors - tcpdump/blobdiff - ip6.h
Makefile.in: don't remove configure and config.h.in in make distclean.
[tcpdump] / ip6.h
diff --git a/ip6.h b/ip6.h
index a821cd2345e32cb8d15c2255a1c7fdc3da26a8d8..28725d05eff971a9d0fc9898a03f230bdd71012c 100644 (file)
--- a/ip6.h
+++ b/ip6.h
@@ -65,8 +65,8 @@
  *     @(#)ip.h        8.1 (Berkeley) 6/10/93
  */
 
-#ifndef _NETINET_IP6_H_
-#define _NETINET_IP6_H_
+#ifndef ND_IP6_H_
+#define ND_IP6_H_
 
 /*
  * Definition for internet protocol version 6.
@@ -85,10 +85,10 @@ struct ip6_hdr {
        } ip6_ctlun;
        nd_ipv6 ip6_src;        /* source address */
        nd_ipv6 ip6_dst;        /* destination address */
-} ND_UNALIGNED;
+};
 
 #define ip6_vfc                ip6_ctlun.ip6_un2_vfc
-#define IP6_VERSION(ip6_hdr)   ((EXTRACT_U_1((ip6_hdr)->ip6_vfc) & 0xf0) >> 4)
+#define IP6_VERSION(ip6_hdr)   ((GET_U_1((ip6_hdr)->ip6_vfc) & 0xf0) >> 4)
 #define ip6_flow       ip6_ctlun.ip6_un1.ip6_un1_flow
 #define ip6_plen       ip6_ctlun.ip6_un1.ip6_un1_plen
 #define ip6_nxt                ip6_ctlun.ip6_un1.ip6_un1_nxt
@@ -98,11 +98,6 @@ struct ip6_hdr {
 /* in network endian */
 #define IPV6_FLOWINFO_MASK     ((uint32_t)htonl(0x0fffffff))   /* flow info (28 bits) */
 #define IPV6_FLOWLABEL_MASK    ((uint32_t)htonl(0x000fffff))   /* flow label (20 bits) */
-#if 1
-/* ECN bits proposed by Sally Floyd */
-#define IP6TOS_CE              0x01    /* congestion experienced */
-#define IP6TOS_ECT             0x02    /* ECN-capable transport */
-#endif
 
 /*
  * Extension Headers
@@ -111,23 +106,23 @@ struct ip6_hdr {
 struct ip6_ext {
        nd_uint8_t ip6e_nxt;
        nd_uint8_t ip6e_len;
-} ND_UNALIGNED;
+};
 
 /* Hop-by-Hop options header */
 struct ip6_hbh {
        nd_uint8_t ip6h_nxt;    /* next header */
        nd_uint8_t ip6h_len;    /* length in units of 8 octets */
        /* followed by options */
-} ND_UNALIGNED;
+};
 
 /* Destination options header */
 struct ip6_dest {
        nd_uint8_t ip6d_nxt;    /* next header */
        nd_uint8_t ip6d_len;    /* length in units of 8 octets */
        /* followed by options */
-} ND_UNALIGNED;
+};
 
-/* http://www.iana.org/assignments/ipv6-parameters/ipv6-parameters.xhtml */
+/* https://www.iana.org/assignments/ipv6-parameters/ipv6-parameters.xhtml */
 
 /* Option types and related macros */
 #define IP6OPT_PAD1            0x00    /* 00 0 00000 */
@@ -170,7 +165,7 @@ struct ip6_rthdr {
        nd_uint8_t  ip6r_type;          /* routing type */
        nd_uint8_t  ip6r_segleft;       /* segments left */
        /* followed by routing type specific data */
-} ND_UNALIGNED;
+};
 
 #define IPV6_RTHDR_TYPE_0 0
 #define IPV6_RTHDR_TYPE_2 2
@@ -208,10 +203,10 @@ struct ip6_frag {
        nd_uint8_t  ip6f_reserved;      /* reserved field */
        nd_uint16_t ip6f_offlg;         /* offset, reserved, and flag */
        nd_uint32_t ip6f_ident;         /* identification */
-} ND_UNALIGNED;
+};
 
 #define IP6F_OFF_MASK          0xfff8  /* mask out offset from ip6f_offlg */
 #define IP6F_RESERVED_MASK     0x0006  /* reserved bits in ip6f_offlg */
 #define IP6F_MORE_FRAG         0x0001  /* more-fragments flag */
 
-#endif /* not _NETINET_IP6_H_ */
+#endif /* not ND_IP6_H_ */