This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH,HURD] Update sysdep/mach/hurd/net/{ethernet.h,if_arp.h,if_ether.h}
- From: Samuel Thibault <samuel dot thibault at ens-lyon dot org>
- To: roland at gnu dot org
- Cc: libc-alpha at sources dot redhat dot com
- Date: Thu, 8 Jan 2009 00:39:49 +0100
- Subject: [PATCH,HURD] Update sysdep/mach/hurd/net/{ethernet.h,if_arp.h,if_ether.h}
Hello,
The patch below brings the Hurd's net/{ethernet.h,if_arp.h,if_ether.h}
up to date with Linux'.
Samuel
2009-01-08 Samuel Thibault <samuel.thibault@ens-lyon.org>
* sysdeps/mach/hurd/net/ethernet.h (struct ether_addr,
struct ether_header): Add packed attribute.
(ETHERTYPE_SPRITE,ETHERTYPE_AT,ETHERTYPE_AARP,ETHERTYPE_VLAN,
ETHERTYPE_IPX,ETHERTYPE_IPV6,ETHERTYPE_LOOPBACK): New macros.
(ETHER_MIN_LEN, ETHER_MAX_LEN): Use ETHER_CRC_LEN instead of
non-existent ETH_CRC_LEN.
* sysdeps/mach/hurd/net/if_arp.h (ARPOP_InREQUEST,ARPOP_InREPLY,
ARPOP_NAK, ARPHRD_ATM,ARPHRD_IEEE1394,ARPHRD_EUI64,
ARPHRD_INFINIBAND,ARPHRD_HWX25,ARPHRD_CISCO,ARPHRD_DDCMP,
ARPHRD_RAWHDLC,ARPHRD_IPDDP,ARPHRD_IPGRE,ARPHRD_PIMREG,
ARPHRD_HIPPI,ARPHRD_ASH,ARPHRD_ECONET,ARPHRD_IRDA,ARPHRD_FCPP,
ARPHRD_FCAL,ARPHRD_FCPL,ARPHRD_FCFABRIC,ARPHRD_IEEE802_TR,
ARPHRD_IEEE80212,ARPHRD_IEEE80211_PRISM,
ARPHRD_IEEE80211_RADIOTAP,ARPHRD_VOID,ARPHRD_NONE): New macros.
* sysdeps/mach/hurd/net/if_ether.h (ETH_P_IEEEPUP,
ETH_P_IEEEPUPAT,ETH_P_8021Q,ETH_P_PAUSE,ETH_P_SLOW,ETH_P_WCCP,
ETH_P_PPP_DISC,ETH_P_PPP_SES,ETH_P_MPLS_UC,ETH_P_MPLS_MC,
ETH_P_ATMMPOA,ETH_P_ATMFATE,ETH_P_AOE,ETH_P_TIPC,ETH_P_CAN,
ETH_P_MOBITEX,ETH_P_CONTROL,ETH_P_IRDA,ETH_P_ECONET,ETH_P_HDLC,
ETH_P_ARCNET: New macros.
(struct ethhdr): Add packed attribute.
Index: sysdeps/mach/hurd/net/ethernet.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/mach/hurd/net/ethernet.h,v
retrieving revision 1.2
diff -u -p -r1.2 ethernet.h
--- sysdeps/mach/hurd/net/ethernet.h 6 Jul 2001 04:55:59 -0000 1.2
+++ sysdeps/mach/hurd/net/ethernet.h 7 Jan 2009 22:56:21 -0000
@@ -33,7 +33,7 @@ __BEGIN_DECLS
struct ether_addr
{
u_int8_t ether_addr_octet[ETH_ALEN];
-};
+} __attribute__ ((__packed__));
/* 10Mb/s ethernet header */
struct ether_header
@@ -41,20 +41,28 @@ struct ether_header
u_int8_t ether_dhost[ETH_ALEN]; /* destination eth addr */
u_int8_t ether_shost[ETH_ALEN]; /* source ether addr */
u_int16_t ether_type; /* packet type ID field */
-};
+} __attribute__ ((__packed__));
/* Ethernet protocol ID's */
#define ETHERTYPE_PUP 0x0200 /* Xerox PUP */
+#define ETHERTYPE_SPRITE 0x0500 /* Sprite */
#define ETHERTYPE_IP 0x0800 /* IP */
#define ETHERTYPE_ARP 0x0806 /* Address resolution */
#define ETHERTYPE_REVARP 0x8035 /* Reverse ARP */
+#define ETHERTYPE_AT 0x809B /* AppleTalk protocol */
+#define ETHERTYPE_AARP 0x80F3 /* AppleTalk ARP */
+#define ETHERTYPE_VLAN 0x8100 /* IEEE 802.1Q VLAN tagging */
+#define ETHERTYPE_IPX 0x8137 /* IPX */
+#define ETHERTYPE_IPV6 0x86dd /* IP protocol version 6 */
+#define ETHERTYPE_LOOPBACK 0x9000 /* used to test interfaces */
+
#define ETHER_ADDR_LEN ETH_ALEN /* size of ethernet addr */
#define ETHER_TYPE_LEN 2 /* bytes in type field */
#define ETHER_CRC_LEN 4 /* bytes in CRC field */
#define ETHER_HDR_LEN ETH_HLEN /* total octets in header */
-#define ETHER_MIN_LEN (ETH_ZLEN + ETH_CRC_LEN) /* min packet length */
-#define ETHER_MAX_LEN (ETH_FRAME_LEN + ETH_CRC_LEN) /* max packet length */
+#define ETHER_MIN_LEN (ETH_ZLEN + ETHER_CRC_LEN) /* min packet length */
+#define ETHER_MAX_LEN (ETH_FRAME_LEN + ETHER_CRC_LEN) /* max packet length */
/* make sure ethenet length is valid */
#define ETHER_IS_VALID_LEN(foo) \
Index: sysdeps/mach/hurd/net/if_arp.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/mach/hurd/net/if_arp.h,v
retrieving revision 1.2
diff -u -p -r1.2 if_arp.h
--- sysdeps/mach/hurd/net/if_arp.h 6 Jul 2001 04:55:59 -0000 1.2
+++ sysdeps/mach/hurd/net/if_arp.h 7 Jan 2009 22:56:21 -0000
@@ -41,6 +41,9 @@ __BEGIN_DECLS
#define ARPOP_REPLY 2 /* ARP reply. */
#define ARPOP_RREQUEST 3 /* RARP request. */
#define ARPOP_RREPLY 4 /* RARP reply. */
+#define ARPOP_InREQUEST 8 /* InARP request. */
+#define ARPOP_InREPLY 9 /* InARP reply. */
+#define ARPOP_NAK 10 /* (ATM)ARP NAK. */
/* See RFC 826 for protocol description. ARP packets are variable
in size; the arphdr structure defines the fixed-length portion.
@@ -69,7 +72,7 @@ struct arphdr
/* ARP protocol HARDWARE identifiers. */
#define ARPHRD_NETROM 0 /* From KA9Q: NET/ROM pseudo. */
-#define ARPHRD_ETHER 1 /* Ethernet 10Mbps. */
+#define ARPHRD_ETHER 1 /* Ethernet 10/100Mbps. */
#define ARPHRD_EETHER 2 /* Experimental Ethernet. */
#define ARPHRD_AX25 3 /* AX.25 Level 2. */
#define ARPHRD_PRONET 4 /* PROnet token ring. */
@@ -78,7 +81,11 @@ struct arphdr
#define ARPHRD_ARCNET 7 /* ARCnet. */
#define ARPHRD_APPLETLK 8 /* APPLEtalk. */
#define ARPHRD_DLCI 15 /* Frame Relay DLCI. */
+#define ARPHRD_ATM 19 /* ATM. */
#define ARPHRD_METRICOM 23 /* Metricom STRIP (new IANA id). */
+#define ARPHRD_IEEE1394 24 /* IEEE 1394 IPv4 - RFC 2734. */
+#define ARPHRD_EUI64 27 /* EUI-64. */
+#define ARPHRD_INFINIBAND 32 /* InfiniBand. */
/* Dummy types for non ARP hardware */
#define ARPHRD_SLIP 256
@@ -89,9 +96,13 @@ struct arphdr
#define ARPHRD_ADAPT 264
#define ARPHRD_ROSE 270
#define ARPHRD_X25 271 /* CCITT X.25. */
+#define ARPHRD_HWX25 272 /* Boards with X.25 in firmware. */
#define ARPHRD_PPP 512
-#define ARPHRD_HDLC 513 /* (Cisco) HDLC. */
+#define ARPHRD_CISCO 513 /* Cisco HDLC. */
+#define ARPHRD_HDLC ARPHRD_CISCO
#define ARPHRD_LAPB 516 /* LAPB. */
+#define ARPHRD_DDCMP 517 /* Digital's DDCMP. */
+#define ARPHRD_RAWHDLC 518 /* Raw HDLC. */
#define ARPHRD_TUNNEL 768 /* IPIP tunnel. */
#define ARPHRD_TUNNEL6 769 /* IPIP6 tunnel. */
@@ -102,6 +113,24 @@ struct arphdr
#define ARPHRD_FDDI 774 /* Fiber Distributed Data Interface. */
#define ARPHRD_BIF 775 /* AP1000 BIF. */
#define ARPHRD_SIT 776 /* sit0 device - IPv6-in-IPv4. */
+#define ARPHRD_IPDDP 777 /* IP-in-DDP tunnel. */
+#define ARPHRD_IPGRE 778 /* GRE over IP. */
+#define ARPHRD_PIMREG 779 /* PIMSM register interface. */
+#define ARPHRD_HIPPI 780 /* High Performance Parallel I'face. */
+#define ARPHRD_ASH 781 /* (Nexus Electronics) Ash. */
+#define ARPHRD_ECONET 782 /* Acorn Econet. */
+#define ARPHRD_IRDA 783 /* Linux-IrDA. */
+#define ARPHRD_FCPP 784 /* Point to point fibrechanel. */
+#define ARPHRD_FCAL 785 /* Fibrechanel arbitrated loop. */
+#define ARPHRD_FCPL 786 /* Fibrechanel public loop. */
+#define ARPHRD_FCFABRIC 787 /* Fibrechanel fabric. */
+#define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR. */
+#define ARPHRD_IEEE80211 801 /* IEEE 802.11. */
+#define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header. */
+#define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header. */
+
+#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known. */
+#define ARPHRD_NONE 0xFFFE /* Zero header length. */
/* ARP ioctl request. */
Index: sysdeps/mach/hurd/net/if_ether.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/mach/hurd/net/if_ether.h,v
retrieving revision 1.2
diff -u -p -r1.2 if_ether.h
--- sysdeps/mach/hurd/net/if_ether.h 6 Jul 2001 04:55:59 -0000 1.2
+++ sysdeps/mach/hurd/net/if_ether.h 7 Jan 2009 22:56:21 -0000
@@ -41,6 +41,8 @@
#define ETH_P_X25 0x0805 /* CCITT X.25 */
#define ETH_P_ARP 0x0806 /* Address Resolution packet */
#define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */
+#define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */
+#define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */
#define ETH_P_DEC 0x6000 /* DEC Assigned proto */
#define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */
#define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */
@@ -52,8 +54,23 @@
#define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */
#define ETH_P_ATALK 0x809B /* Appletalk DDP */
#define ETH_P_AARP 0x80F3 /* Appletalk AARP */
+#define ETH_P_8021Q 0x8100 /* 802.1Q VLAN Extended Header */
#define ETH_P_IPX 0x8137 /* IPX over DIX */
#define ETH_P_IPV6 0x86DD /* IPv6 over bluebook */
+#define ETH_P_PAUSE 0x8808 /* IEEE Pause frames. See 802.3 31B */
+#define ETH_P_SLOW 0x8809 /* Slow Protocol. See 802.3ad 43B */
+#define ETH_P_WCCP 0x883E /* Web-cache coordination protocol
+ * defined in draft-wilson-wrec-wccp-v2-00.txt */
+#define ETH_P_PPP_DISC 0x8863 /* PPPoE discovery messages */
+#define ETH_P_PPP_SES 0x8864 /* PPPoE session messages */
+#define ETH_P_MPLS_UC 0x8847 /* MPLS Unicast traffic */
+#define ETH_P_MPLS_MC 0x8848 /* MPLS Multicast traffic */
+#define ETH_P_ATMMPOA 0x884c /* MultiProtocol Over ATM */
+#define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport
+ * over Ethernet
+ */
+#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */
+#define ETH_P_TIPC 0x88CA /* TIPC */
/*
* Non DIX types. Won't clash for 1500 types.
@@ -68,8 +85,15 @@
#define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/
#define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */
#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */
+#define ETH_P_CAN 0x000C /* Controller Area Network */
#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/
#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */
+#define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */
+#define ETH_P_CONTROL 0x0016 /* Card specific control frames */
+#define ETH_P_IRDA 0x0017 /* Linux-IrDA */
+#define ETH_P_ECONET 0x0018 /* Acorn Econet */
+#define ETH_P_HDLC 0x0019 /* HDLC frames */
+#define ETH_P_ARCNET 0x001A /* 1A for ArcNet :-) */
/*
* This is an Ethernet frame header.
@@ -80,6 +104,6 @@ struct ethhdr
unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
unsigned char h_source[ETH_ALEN]; /* source ether addr */
unsigned short int h_proto; /* packet type ID field */
-};
+} __attribute__((packed));
#endif /* net/if_ether.h */