]> The Tcpdump Group git mirrors - tcpdump/blobdiff - linux-include/netinet/if_ether.h
style pedant. buffer length check cleanup will be next.
[tcpdump] / linux-include / netinet / if_ether.h
index 4148ab83ea49d621f22c3f95751a0297ad38fa66..7374c72599f1c77c2e4295190a80a9fbfad51954 100644 (file)
 
 #include <net/if_arp.h>
 
+/*
+ * The number of bytes in an ethernet (MAC) address.
+ */
+#define        ETHER_ADDR_LEN          6
+
 /*
  * Ethernet address - 6 octets
  */
 struct ether_addr {
-       u_char  ether_addr_octet[6];
-};
+       u_char  ether_addr_octet[ETHER_ADDR_LEN];
+} __attribute__ ((packed));
 
 /*
  * Structure of a 10Mb/s Ethernet header.
  */
 struct ether_header {
-       u_char  ether_dhost[6];
-       u_char  ether_shost[6];
+       u_char  ether_dhost[ETHER_ADDR_LEN];
+       u_char  ether_shost[ETHER_ADDR_LEN];
        u_short ether_type;
-};
+} __attribute__ ((packed));
 
 #define        ETHERTYPE_PUP           0x0200  /* PUP protocol */
 #define        ETHERTYPE_IP            0x0800  /* IP protocol */
 #define ETHERTYPE_ARP          0x0806  /* Addr. resolution protocol */
 #define ETHERTYPE_REVARP       0x8035  /* reverse Addr. resolution protocol */
+#define ETHERTYPE_IPV6         0x86dd  /* IPv6 */
 
 /*
  * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
@@ -80,7 +86,7 @@ struct        ether_arp {
        u_char  arp_spa[4];     /* sender protocol address */
        u_char  arp_tha[6];     /* target hardware address */
        u_char  arp_tpa[4];     /* target protocol address */
-};
+} __attribute__ ((packed));
 #define        arp_hrd ea_hdr.ar_hrd
 #define        arp_pro ea_hdr.ar_pro
 #define        arp_hln ea_hdr.ar_hln