1 http://sourceware.org/ml/libc-alpha/2009-01/msg00026.html
3 TODO: re-submit, now that it doesn't pose <net/route.h> problems any more.
5 commit b4da06a7e200d0cf8d132a83852e473b7795f691
6 Author: Samuel Thibault <sthibault@dalton.bordeaux.inria.fr>
7 Date: Sun Jan 10 23:55:28 2010 +0100
9 Factorize ethernet,if_arp,if_ether,if_ppp
11 2010-01-10 Samuel Thibault <samuel.thibault@ens-lyon.org>
13 * sysdeps/mach/hurd/Makefile (sysdep_headers) [subdir=socket]:
14 Remove net/ethernet.h net/if_arp.h net/if_ether.h net/if_ppp.h
15 * sysdeps/gnu/Makefile (sysdep_headers) [subdir=socket]:
16 Add net/ethernet.h net/if_arp.h net/if_ether.h net/if_ppp.h
17 * sysdeps/unix/sysv/linux/Makefile (sysdep_headers)
18 [subdir=socket]: Remove net/ethernet.h net/if_arp.h net/if_ppp.h
20 * sysdeps/mach/hurd/net/ethernet.h: Remove file.
21 * sysdeps/unix/sysv/linux/net/ethernet.h: Move file to...
22 * sysdeps/gnu/net/ethernet.h: ... this, and include
23 <net/if_ether.h> instead of <linux/if_ether.h>.
25 * sysdeps/mach/hurd/net/if_ether.h: Move file to...
26 * sysdeps/gnu/net/if_ether.h: ... this.
27 (ETH_FCS_LEN,ETH_P_PUPAT,ETH_P_IEEEPUP,ETH_P_IEEEPUPAT,
28 ETH_P_8021Q,ETH_P_PAUSE,ETH_P_SLOW,ETH_P_WCCP,ETH_P_PPP_DISC,
29 ETH_P_PPP_SES,ETH_P_MPLS_UC,ETH_P_MPLS_MC,ETH_P_ATMMPOA,
30 ETH_P_ATMFATE,ETH_P_PAE,ETH_P_AOE,ETH_P_TIPC,ETH_P_FCOE,
31 ETH_P_EDSA,ETH_P_CAN,ETH_P_MOBITEX,ETH_P_CONTROL,ETH_P_IRDA,
32 ETH_P_ECONET,ETH_P_HDLC,ETH_P_ARCNET,ETH_P_DSA,ETH_P_TRAILER,
33 ETH_P_PHONET): New macros.
34 (ETH_P_ECHO): Remove macro.
35 (ETH_P_PUP): Change value from 0x0400 to 0x0200.
36 (struct ethhdr): Add packed attribute.
37 * sysdeps/unix/sysv/linux/net/if_ether.h: New file, includes
40 * sysdeps/unix/sysv/linux/net/if_arp.h: Move file to...
41 * sysdeps/gnu/net/if_arp.h: ... this.
42 * sysdeps/mach/hurd/net/if_arp.h: Remove file.
44 * sysdeps/unix/sysv/linux/net/if_ppp.h: Move file to...
45 * sysdeps/gnu/net/if_ppp.h: ... this.
46 * sysdeps/mach/hurd/net/if_ppp.h: Remove file.
48 No topgit branch, TODO?
51 sysdeps/gnu/Makefile | 5
52 sysdeps/gnu/net/ethernet.h | 84 +++++++++++++
53 sysdeps/gnu/net/if_arp.h | 184 +++++++++++++++++++++++++++++
54 sysdeps/gnu/net/if_ether.h | 116 ++++++++++++++++++
55 sysdeps/gnu/net/if_ppp.h | 169 ++++++++++++++++++++++++++
56 sysdeps/gnu/netinet/if_ether.h | 104 ++++++++++++++++
57 sysdeps/mach/hurd/Makefile | 5
58 sysdeps/mach/hurd/net/ethernet.h | 76 -----------
59 sysdeps/mach/hurd/net/if_arp.h | 145 ----------------------
60 sysdeps/mach/hurd/net/if_ether.h | 85 -------------
61 sysdeps/mach/hurd/net/if_ppp.h | 169 --------------------------
62 sysdeps/unix/sysv/linux/Makefile | 3
63 sysdeps/unix/sysv/linux/net/ethernet.h | 84 -------------
64 sysdeps/unix/sysv/linux/net/if_arp.h | 184 -----------------------------
65 sysdeps/unix/sysv/linux/net/if_ether.h | 7 +
66 sysdeps/unix/sysv/linux/net/if_ppp.h | 169 --------------------------
67 sysdeps/unix/sysv/linux/netinet/if_ether.h | 105 ----------------
68 17 files changed, 815 insertions(+), 1310 deletions(-)
70 Index: glibc-2.27/sysdeps/gnu/Makefile
71 ===================================================================
72 --- glibc-2.27.orig/sysdeps/gnu/Makefile
73 +++ glibc-2.27/sysdeps/gnu/Makefile
74 @@ -87,3 +87,7 @@ librt-sysdep_routines += rt-unwind-resum
75 librt-shared-only-routines += rt-unwind-resume
76 CFLAGS-rt-unwind-resume.c += -fexceptions -fasynchronous-unwind-tables
79 +ifeq ($(subdir),socket)
80 +sysdep_headers += net/ethernet.h net/if_arp.h net/if_ether.h
82 Index: glibc-2.27/sysdeps/gnu/net/ethernet.h
83 ===================================================================
85 +++ glibc-2.27/sysdeps/gnu/net/ethernet.h
87 +/* Copyright (C) 1997-2022 Free Software Foundation, Inc.
88 + This file is part of the GNU C Library.
90 + The GNU C Library is free software; you can redistribute it and/or
91 + modify it under the terms of the GNU Lesser General Public
92 + License as published by the Free Software Foundation; either
93 + version 2.1 of the License, or (at your option) any later version.
95 + The GNU C Library is distributed in the hope that it will be useful,
96 + but WITHOUT ANY WARRANTY; without even the implied warranty of
97 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
98 + Lesser General Public License for more details.
100 + You should have received a copy of the GNU Lesser General Public
101 + License along with the GNU C Library; if not, see
102 + <https://www.gnu.org/licenses/>. */
104 +/* Based on the FreeBSD version of this file. Curiously, that file
105 + lacks a copyright in the header. */
107 +#ifndef __NET_ETHERNET_H
108 +#define __NET_ETHERNET_H 1
110 +#include <sys/types.h>
113 +#include <net/if_ether.h> /* IEEE 802.3 Ethernet constants */
117 +/* This is a name for the 48 bit ethernet address available on many
121 + uint8_t ether_addr_octet[ETH_ALEN];
122 +} __attribute__ ((__packed__));
124 +/* 10Mb/s ethernet header */
127 + uint8_t ether_dhost[ETH_ALEN]; /* destination eth addr */
128 + uint8_t ether_shost[ETH_ALEN]; /* source ether addr */
129 + uint16_t ether_type; /* packet type ID field */
130 +} __attribute__ ((__packed__));
132 +/* Ethernet protocol ID's */
133 +#define ETHERTYPE_PUP 0x0200 /* Xerox PUP */
134 +#define ETHERTYPE_SPRITE 0x0500 /* Sprite */
135 +#define ETHERTYPE_IP 0x0800 /* IP */
136 +#define ETHERTYPE_ARP 0x0806 /* Address resolution */
137 +#define ETHERTYPE_REVARP 0x8035 /* Reverse ARP */
138 +#define ETHERTYPE_AT 0x809B /* AppleTalk protocol */
139 +#define ETHERTYPE_AARP 0x80F3 /* AppleTalk ARP */
140 +#define ETHERTYPE_VLAN 0x8100 /* IEEE 802.1Q VLAN tagging */
141 +#define ETHERTYPE_IPX 0x8137 /* IPX */
142 +#define ETHERTYPE_IPV6 0x86dd /* IP protocol version 6 */
143 +#define ETHERTYPE_LOOPBACK 0x9000 /* used to test interfaces */
145 +#define ETHER_ADDR_LEN ETH_ALEN /* size of ethernet addr */
146 +#define ETHER_TYPE_LEN 2 /* bytes in type field */
147 +#define ETHER_CRC_LEN 4 /* bytes in CRC field */
148 +#define ETHER_HDR_LEN ETH_HLEN /* total octets in header */
149 +#define ETHER_MIN_LEN (ETH_ZLEN + ETHER_CRC_LEN) /* min packet length */
150 +#define ETHER_MAX_LEN (ETH_FRAME_LEN + ETHER_CRC_LEN) /* max packet length */
152 +/* make sure ethernet length is valid */
153 +#define ETHER_IS_VALID_LEN(foo) \
154 + ((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN)
157 + * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
158 + * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
159 + * by an ETHER type (as given above) and then the (variable-length) header.
161 +#define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */
162 +#define ETHERTYPE_NTRAILER 16
164 +#define ETHERMTU ETH_DATA_LEN
165 +#define ETHERMIN (ETHER_MIN_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN)
169 +#endif /* net/ethernet.h */
170 Index: glibc-2.27/sysdeps/gnu/net/if_arp.h
171 ===================================================================
173 +++ glibc-2.27/sysdeps/gnu/net/if_arp.h
175 +/* Definitions for Address Resolution Protocol.
176 + Copyright (C) 1997-2022 Free Software Foundation, Inc.
177 + This file is part of the GNU C Library.
179 + The GNU C Library is free software; you can redistribute it and/or
180 + modify it under the terms of the GNU Lesser General Public
181 + License as published by the Free Software Foundation; either
182 + version 2.1 of the License, or (at your option) any later version.
184 + The GNU C Library is distributed in the hope that it will be useful,
185 + but WITHOUT ANY WARRANTY; without even the implied warranty of
186 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
187 + Lesser General Public License for more details.
189 + You should have received a copy of the GNU Lesser General Public
190 + License along with the GNU C Library; if not, see
191 + <https://www.gnu.org/licenses/>. */
193 +/* Based on the 4.4BSD and Linux version of this file. */
195 +#ifndef _NET_IF_ARP_H
196 +#define _NET_IF_ARP_H 1
198 +#include <sys/types.h>
199 +#include <sys/socket.h>
204 +/* Some internals from deep down in the kernel. */
205 +#define MAX_ADDR_LEN 7
208 +/* This structure defines an ethernet arp header. */
210 +/* ARP protocol opcodes. */
211 +#define ARPOP_REQUEST 1 /* ARP request. */
212 +#define ARPOP_REPLY 2 /* ARP reply. */
213 +#define ARPOP_RREQUEST 3 /* RARP request. */
214 +#define ARPOP_RREPLY 4 /* RARP reply. */
215 +#define ARPOP_InREQUEST 8 /* InARP request. */
216 +#define ARPOP_InREPLY 9 /* InARP reply. */
217 +#define ARPOP_NAK 10 /* (ATM)ARP NAK. */
219 +/* See RFC 826 for protocol description. ARP packets are variable
220 + in size; the arphdr structure defines the fixed-length portion.
221 + Protocol type values are the same as those for 10 Mb/s Ethernet.
222 + It is followed by the variable-sized fields ar_sha, arp_spa,
223 + arp_tha and arp_tpa in that order, according to the lengths
224 + specified. Field names used correspond to RFC 826. */
228 + unsigned short int ar_hrd; /* Format of hardware address. */
229 + unsigned short int ar_pro; /* Format of protocol address. */
230 + unsigned char ar_hln; /* Length of hardware address. */
231 + unsigned char ar_pln; /* Length of protocol address. */
232 + unsigned short int ar_op; /* ARP opcode (command). */
234 + /* Ethernet looks like this : This bit is variable sized
236 + unsigned char __ar_sha[ETH_ALEN]; /* Sender hardware address. */
237 + unsigned char __ar_sip[4]; /* Sender IP address. */
238 + unsigned char __ar_tha[ETH_ALEN]; /* Target hardware address. */
239 + unsigned char __ar_tip[4]; /* Target IP address. */
244 +/* ARP protocol HARDWARE identifiers. */
245 +#define ARPHRD_NETROM 0 /* From KA9Q: NET/ROM pseudo. */
246 +#define ARPHRD_ETHER 1 /* Ethernet 10/100Mbps. */
247 +#define ARPHRD_EETHER 2 /* Experimental Ethernet. */
248 +#define ARPHRD_AX25 3 /* AX.25 Level 2. */
249 +#define ARPHRD_PRONET 4 /* PROnet token ring. */
250 +#define ARPHRD_CHAOS 5 /* Chaosnet. */
251 +#define ARPHRD_IEEE802 6 /* IEEE 802.2 Ethernet/TR/TB. */
252 +#define ARPHRD_ARCNET 7 /* ARCnet. */
253 +#define ARPHRD_APPLETLK 8 /* APPLEtalk. */
254 +#define ARPHRD_DLCI 15 /* Frame Relay DLCI. */
255 +#define ARPHRD_ATM 19 /* ATM. */
256 +#define ARPHRD_METRICOM 23 /* Metricom STRIP (new IANA id). */
257 +#define ARPHRD_IEEE1394 24 /* IEEE 1394 IPv4 - RFC 2734. */
258 +#define ARPHRD_EUI64 27 /* EUI-64. */
259 +#define ARPHRD_INFINIBAND 32 /* InfiniBand. */
261 +/* Dummy types for non ARP hardware */
262 +#define ARPHRD_SLIP 256
263 +#define ARPHRD_CSLIP 257
264 +#define ARPHRD_SLIP6 258
265 +#define ARPHRD_CSLIP6 259
266 +#define ARPHRD_RSRVD 260 /* Notional KISS type. */
267 +#define ARPHRD_ADAPT 264
268 +#define ARPHRD_ROSE 270
269 +#define ARPHRD_X25 271 /* CCITT X.25. */
270 +#define ARPHRD_HWX25 272 /* Boards with X.25 in firmware. */
271 +#define ARPHRD_CAN 280 /* Controller Area Network. */
272 +#define ARPHRD_MCTP 290
273 +#define ARPHRD_PPP 512
274 +#define ARPHRD_CISCO 513 /* Cisco HDLC. */
275 +#define ARPHRD_HDLC ARPHRD_CISCO
276 +#define ARPHRD_LAPB 516 /* LAPB. */
277 +#define ARPHRD_DDCMP 517 /* Digital's DDCMP. */
278 +#define ARPHRD_RAWHDLC 518 /* Raw HDLC. */
279 +#define ARPHRD_RAWIP 519 /* Raw IP. */
281 +#define ARPHRD_TUNNEL 768 /* IPIP tunnel. */
282 +#define ARPHRD_TUNNEL6 769 /* IPIP6 tunnel. */
283 +#define ARPHRD_FRAD 770 /* Frame Relay Access Device. */
284 +#define ARPHRD_SKIP 771 /* SKIP vif. */
285 +#define ARPHRD_LOOPBACK 772 /* Loopback device. */
286 +#define ARPHRD_LOCALTLK 773 /* Localtalk device. */
287 +#define ARPHRD_FDDI 774 /* Fiber Distributed Data Interface. */
288 +#define ARPHRD_BIF 775 /* AP1000 BIF. */
289 +#define ARPHRD_SIT 776 /* sit0 device - IPv6-in-IPv4. */
290 +#define ARPHRD_IPDDP 777 /* IP-in-DDP tunnel. */
291 +#define ARPHRD_IPGRE 778 /* GRE over IP. */
292 +#define ARPHRD_PIMREG 779 /* PIMSM register interface. */
293 +#define ARPHRD_HIPPI 780 /* High Performance Parallel I'face. */
294 +#define ARPHRD_ASH 781 /* (Nexus Electronics) Ash. */
295 +#define ARPHRD_ECONET 782 /* Acorn Econet. */
296 +#define ARPHRD_IRDA 783 /* Linux-IrDA. */
297 +#define ARPHRD_FCPP 784 /* Point to point fibrechanel. */
298 +#define ARPHRD_FCAL 785 /* Fibrechanel arbitrated loop. */
299 +#define ARPHRD_FCPL 786 /* Fibrechanel public loop. */
300 +#define ARPHRD_FCFABRIC 787 /* Fibrechanel fabric. */
301 +#define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR. */
302 +#define ARPHRD_IEEE80211 801 /* IEEE 802.11. */
303 +#define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header. */
304 +#define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header. */
305 +#define ARPHRD_IEEE802154 804 /* IEEE 802.15.4 header. */
306 +#define ARPHRD_IEEE802154_PHY 805 /* IEEE 802.15.4 PHY header. */
308 +#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known. */
309 +#define ARPHRD_NONE 0xFFFE /* Zero header length. */
312 +/* ARP ioctl request. */
315 + struct sockaddr arp_pa; /* Protocol address. */
316 + struct sockaddr arp_ha; /* Hardware address. */
317 + int arp_flags; /* Flags. */
318 + struct sockaddr arp_netmask; /* Netmask (only for proxy arps). */
324 + struct sockaddr arp_pa; /* Protocol address. */
325 + struct sockaddr arp_ha; /* Hardware address. */
326 + int arp_flags; /* Flags. */
327 + struct sockaddr arp_netmask; /* Netmask (only for proxy arps). */
330 +/* ARP Flag values. */
331 +#define ATF_COM 0x02 /* Completed entry (ha valid). */
332 +#define ATF_PERM 0x04 /* Permanent entry. */
333 +#define ATF_PUBL 0x08 /* Publish entry. */
334 +#define ATF_USETRAILERS 0x10 /* Has requested trailers. */
335 +#define ATF_NETMASK 0x20 /* Want to use a netmask (only
336 + for proxy entries). */
337 +#define ATF_DONTPUB 0x40 /* Don't answer this addresses. */
338 +#define ATF_MAGIC 0x80 /* Automatically added entry. */
341 +/* Support for the user space arp daemon, arpd. */
342 +#define ARPD_UPDATE 0x01
343 +#define ARPD_LOOKUP 0x02
344 +#define ARPD_FLUSH 0x03
348 + unsigned short int req; /* Request type. */
349 + uint32_t ip; /* IP address of entry. */
350 + unsigned long int dev; /* Device entry is tied to. */
351 + unsigned long int stamp;
352 + unsigned long int updated;
353 + unsigned char ha[MAX_ADDR_LEN]; /* Hardware address. */
358 +#endif /* net/if_arp.h */
359 Index: glibc-2.27/sysdeps/gnu/net/if_ether.h
360 ===================================================================
362 +++ glibc-2.27/sysdeps/gnu/net/if_ether.h
364 +/* Copyright (C) 1997-2022 Free Software Foundation, Inc.
365 + This file is part of the GNU C Library.
367 + The GNU C Library is free software; you can redistribute it and/or
368 + modify it under the terms of the GNU Lesser General Public
369 + License as published by the Free Software Foundation; either
370 + version 2.1 of the License, or (at your option) any later version.
372 + The GNU C Library is distributed in the hope that it will be useful,
373 + but WITHOUT ANY WARRANTY; without even the implied warranty of
374 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
375 + Lesser General Public License for more details.
377 + You should have received a copy of the GNU Lesser General Public
378 + License along with the GNU C Library; if not, see
379 + <https://www.gnu.org/licenses/>. */
381 +#ifndef _NET_IF_ETHER_H
382 +#define _NET_IF_ETHER_H 1
385 + * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
386 + * and FCS/CRC (frame check sequence).
389 +#define ETH_ALEN 6 /* Octets in one ethernet addr */
390 +#define ETH_HLEN 14 /* Total octets in header. */
391 +#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */
392 +#define ETH_DATA_LEN 1500 /* Max. octets in payload */
393 +#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
394 +#define ETH_FCS_LEN 4 /* Octets in the FCS */
397 + * These are the defined Ethernet Protocol ID's.
400 +#define ETH_P_LOOP 0x0060 /* Ethernet Loopback packet */
401 +#define ETH_P_PUP 0x0200 /* Xerox PUP packet */
402 +#define ETH_P_PUPAT 0x0201 /* Xerox PUP Addr Trans packet */
403 +#define ETH_P_IP 0x0800 /* Internet Protocol packet */
404 +#define ETH_P_X25 0x0805 /* CCITT X.25 */
405 +#define ETH_P_ARP 0x0806 /* Address Resolution packet */
406 +#define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */
407 +#define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */
408 +#define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */
409 +#define ETH_P_DEC 0x6000 /* DEC Assigned proto */
410 +#define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */
411 +#define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */
412 +#define ETH_P_DNA_RT 0x6003 /* DEC DNA Routing */
413 +#define ETH_P_LAT 0x6004 /* DEC LAT */
414 +#define ETH_P_DIAG 0x6005 /* DEC Diagnostics */
415 +#define ETH_P_CUST 0x6006 /* DEC Customer use */
416 +#define ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */
417 +#define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */
418 +#define ETH_P_ATALK 0x809B /* Appletalk DDP */
419 +#define ETH_P_AARP 0x80F3 /* Appletalk AARP */
420 +#define ETH_P_8021Q 0x8100 /* 802.1Q VLAN Extended Header */
421 +#define ETH_P_IPX 0x8137 /* IPX over DIX */
422 +#define ETH_P_IPV6 0x86DD /* IPv6 over bluebook */
423 +#define ETH_P_PAUSE 0x8808 /* IEEE Pause frames. See 802.3 31B */
424 +#define ETH_P_SLOW 0x8809 /* Slow Protocol. See 802.3ad 43B */
425 +#define ETH_P_WCCP 0x883E /* Web-cache coordination protocol
426 + * defined in draft-wilson-wrec-wccp-v2-00.txt */
427 +#define ETH_P_PPP_DISC 0x8863 /* PPPoE discovery messages */
428 +#define ETH_P_PPP_SES 0x8864 /* PPPoE session messages */
429 +#define ETH_P_MPLS_UC 0x8847 /* MPLS Unicast traffic */
430 +#define ETH_P_MPLS_MC 0x8848 /* MPLS Multicast traffic */
431 +#define ETH_P_ATMMPOA 0x884c /* MultiProtocol Over ATM */
432 +#define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport
435 +#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
436 +#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */
437 +#define ETH_P_TIPC 0x88CA /* TIPC */
438 +#define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */
439 +#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
442 + * Non DIX types. Won't clash for 1500 types.
445 +#define ETH_P_802_3 0x0001 /* Dummy type for 802.3 frames */
446 +#define ETH_P_AX25 0x0002 /* Dummy protocol id for AX.25 */
447 +#define ETH_P_ALL 0x0003 /* Every packet (be careful!!!) */
448 +#define ETH_P_802_2 0x0004 /* 802.2 frames */
449 +#define ETH_P_SNAP 0x0005 /* Internal only */
450 +#define ETH_P_DDCMP 0x0006 /* DEC DDCMP: Internal only */
451 +#define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/
452 +#define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */
453 +#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */
454 +#define ETH_P_CAN 0x000C /* Controller Area Network */
455 +#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/
456 +#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */
457 +#define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */
458 +#define ETH_P_CONTROL 0x0016 /* Card specific control frames */
459 +#define ETH_P_IRDA 0x0017 /* Linux-IrDA */
460 +#define ETH_P_ECONET 0x0018 /* Acorn Econet */
461 +#define ETH_P_HDLC 0x0019 /* HDLC frames */
462 +#define ETH_P_ARCNET 0x001A /* 1A for ArcNet :-) */
463 +#define ETH_P_DSA 0x001B /* Distributed Switch Arch. */
464 +#define ETH_P_TRAILER 0x001C /* Trailer switch tagging */
465 +#define ETH_P_PHONET 0x00F5 /* Nokia Phonet frames */
468 + * This is an Ethernet frame header.
473 + unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
474 + unsigned char h_source[ETH_ALEN]; /* source ether addr */
475 + unsigned short int h_proto; /* packet type ID field */
476 +} __attribute__((packed));
478 +#endif /* net/if_ether.h */
479 Index: glibc-2.27/sysdeps/gnu/net/if_ppp.h
480 ===================================================================
482 +++ glibc-2.27/sysdeps/gnu/net/if_ppp.h
484 +/* From: if_ppp.h,v 1.3 1995/06/12 11:36:50 paulus Exp */
487 + * if_ppp.h - Point-to-Point Protocol definitions.
489 + * Copyright (c) 1989 Carnegie Mellon University.
491 + * Redistribution and use in source and binary forms, with or without
492 + * modification, are permitted provided that the following conditions
494 + * 1. Redistributions of source code must retain the above copyright
495 + * notice, this list of conditions and the following disclaimer.
496 + * 2. Redistributions in binary form must reproduce the above copyright
497 + * notice, this list of conditions and the following disclaimer in the
498 + * documentation and/or other materials provided with the distribution.
499 + * 3. Neither the name of the University nor the names of its contributors
500 + * may be used to endorse or promote products derived from this software
501 + * without specific prior written permission.
503 + * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY AND
504 + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
505 + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
506 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
507 + * IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE FOR ANY
508 + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
509 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
510 + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
511 + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
512 + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
513 + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
514 + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
519 + * ==FILEVERSION 960926==
521 + * NOTE TO MAINTAINERS:
522 + * If you modify this file at all, please set the above date.
523 + * if_ppp.h is shipped with a PPP distribution as well as with the kernel;
524 + * if everyone increases the FILEVERSION number above, then scripts
525 + * can do the right thing when deciding whether to install a new if_ppp.h
526 + * file. Don't change the format of that line otherwise, so the
527 + * installation script can recognize it.
531 +#ifndef __NET_IF_PPP_H
532 +#define __NET_IF_PPP_H 1
534 +#include <sys/types.h>
537 +#include <sys/ioctl.h>
538 +#include <net/ppp_defs.h>
546 +#define PPP_MTU 1500 /* Default MTU (size of Info field) */
547 +#define PPP_MAXMRU 65000 /* Largest MRU we allow */
548 +#define PPP_VERSION "2.2.0"
549 +#define PPP_MAGIC 0x5002 /* Magic value for the ppp structure */
550 +#define PROTO_IPX 0x002b /* protocol numbers */
551 +#define PROTO_DNA_RT 0x0027 /* DNA Routing */
555 + * Bit definitions for flags.
558 +#define SC_COMP_PROT 0x00000001 /* protocol compression (output) */
559 +#define SC_COMP_AC 0x00000002 /* header compression (output) */
560 +#define SC_COMP_TCP 0x00000004 /* TCP (VJ) compression (output) */
561 +#define SC_NO_TCP_CCID 0x00000008 /* disable VJ connection-id comp. */
562 +#define SC_REJ_COMP_AC 0x00000010 /* reject adrs/ctrl comp. on input */
563 +#define SC_REJ_COMP_TCP 0x00000020 /* reject TCP (VJ) comp. on input */
564 +#define SC_CCP_OPEN 0x00000040 /* Look at CCP packets */
565 +#define SC_CCP_UP 0x00000080 /* May send/recv compressed packets */
566 +#define SC_ENABLE_IP 0x00000100 /* IP packets may be exchanged */
567 +#define SC_COMP_RUN 0x00001000 /* compressor has been inited */
568 +#define SC_DECOMP_RUN 0x00002000 /* decompressor has been inited */
569 +#define SC_DEBUG 0x00010000 /* enable debug messages */
570 +#define SC_LOG_INPKT 0x00020000 /* log contents of good pkts recvd */
571 +#define SC_LOG_OUTPKT 0x00040000 /* log contents of pkts sent */
572 +#define SC_LOG_RAWIN 0x00080000 /* log all chars received */
573 +#define SC_LOG_FLUSH 0x00100000 /* log all chars flushed */
574 +#define SC_MASK 0x0fE0ffff /* bits that user can change */
577 +#define SC_ESCAPED 0x80000000 /* saw a PPP_ESCAPE */
578 +#define SC_FLUSH 0x40000000 /* flush input until next PPP_FLAG */
579 +#define SC_VJ_RESET 0x20000000 /* Need to reset the VJ decompressor */
580 +#define SC_XMIT_BUSY 0x10000000 /* ppp_write_wakeup is active */
581 +#define SC_RCV_ODDP 0x08000000 /* have rcvd char with odd parity */
582 +#define SC_RCV_EVNP 0x04000000 /* have rcvd char with even parity */
583 +#define SC_RCV_B7_1 0x02000000 /* have rcvd char with bit 7 = 1 */
584 +#define SC_RCV_B7_0 0x01000000 /* have rcvd char with bit 7 = 0 */
585 +#define SC_DC_FERROR 0x00800000 /* fatal decomp error detected */
586 +#define SC_DC_ERROR 0x00400000 /* non-fatal decomp error detected */
589 + * Ioctl definitions.
593 + int protocol; /* PPP protocol, e.g. PPP_IP */
597 +/* Structure describing a CCP configuration option, for PPPIOCSCOMPRESS */
598 +struct ppp_option_data {
604 +/* 'struct ifreq' is only available from net/if.h under __USE_MISC. */
606 +struct ifpppstatsreq {
608 + struct ppp_stats stats; /* statistic information */
611 +struct ifpppcstatsreq {
613 + struct ppp_comp_stats stats;
616 +#define ifr__name b.ifr_ifrn.ifrn_name
617 +#define stats_ptr b.ifr_ifru.ifru_data
621 + * Ioctl definitions.
624 +#define PPPIOCGFLAGS _IOR('t', 90, int) /* get configuration flags */
625 +#define PPPIOCSFLAGS _IOW('t', 89, int) /* set configuration flags */
626 +#define PPPIOCGASYNCMAP _IOR('t', 88, int) /* get async map */
627 +#define PPPIOCSASYNCMAP _IOW('t', 87, int) /* set async map */
628 +#define PPPIOCGUNIT _IOR('t', 86, int) /* get ppp unit number */
629 +#define PPPIOCGRASYNCMAP _IOR('t', 85, int) /* get receive async map */
630 +#define PPPIOCSRASYNCMAP _IOW('t', 84, int) /* set receive async map */
631 +#define PPPIOCGMRU _IOR('t', 83, int) /* get max receive unit */
632 +#define PPPIOCSMRU _IOW('t', 82, int) /* set max receive unit */
633 +#define PPPIOCSMAXCID _IOW('t', 81, int) /* set VJ max slot ID */
634 +#define PPPIOCGXASYNCMAP _IOR('t', 80, ext_accm) /* get extended ACCM */
635 +#define PPPIOCSXASYNCMAP _IOW('t', 79, ext_accm) /* set extended ACCM */
636 +#define PPPIOCXFERUNIT _IO('t', 78) /* transfer PPP unit */
637 +#define PPPIOCSCOMPRESS _IOW('t', 77, struct ppp_option_data)
638 +#define PPPIOCGNPMODE _IOWR('t', 76, struct npioctl) /* get NP mode */
639 +#define PPPIOCSNPMODE _IOW('t', 75, struct npioctl) /* set NP mode */
640 +#define PPPIOCGDEBUG _IOR('t', 65, int) /* Read debug level */
641 +#define PPPIOCSDEBUG _IOW('t', 64, int) /* Set debug level */
642 +#define PPPIOCGIDLE _IOR('t', 63, struct ppp_idle) /* get idle time */
644 +#define SIOCGPPPSTATS (SIOCDEVPRIVATE + 0)
645 +#define SIOCGPPPVER (SIOCDEVPRIVATE + 1) /* NEVER change this!! */
646 +#define SIOCGPPPCSTATS (SIOCDEVPRIVATE + 2)
648 +#if !defined(ifr_mtu)
649 +#define ifr_mtu ifr_ifru.ifru_metric
654 +#endif /* net/if_ppp.h */
655 Index: glibc-2.27/sysdeps/gnu/netinet/if_ether.h
656 ===================================================================
658 +++ glibc-2.27/sysdeps/gnu/netinet/if_ether.h
660 +/* Copyright (C) 1996-2022 Free Software Foundation, Inc.
661 + This file is part of the GNU C Library.
663 + The GNU C Library is free software; you can redistribute it and/or
664 + modify it under the terms of the GNU Lesser General Public
665 + License as published by the Free Software Foundation; either
666 + version 2.1 of the License, or (at your option) any later version.
668 + The GNU C Library is distributed in the hope that it will be useful,
669 + but WITHOUT ANY WARRANTY; without even the implied warranty of
670 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
671 + Lesser General Public License for more details.
673 + You should have received a copy of the GNU Lesser General Public
674 + License along with the GNU C Library; if not, see
675 + <https://www.gnu.org/licenses/>. */
677 +#ifndef __NETINET_IF_ETHER_H
679 +#define __NETINET_IF_ETHER_H 1
680 +#include <features.h>
681 +#include <sys/types.h>
683 +#include <net/if_ether.h>
687 + * Copyright (c) 1982, 1986, 1993
688 + * The Regents of the University of California. All rights reserved.
690 + * Redistribution and use in source and binary forms, with or without
691 + * modification, are permitted provided that the following conditions
693 + * 1. Redistributions of source code must retain the above copyright
694 + * notice, this list of conditions and the following disclaimer.
695 + * 2. Redistributions in binary form must reproduce the above copyright
696 + * notice, this list of conditions and the following disclaimer in the
697 + * documentation and/or other materials provided with the distribution.
698 + * 4. Neither the name of the University nor the names of its contributors
699 + * may be used to endorse or promote products derived from this software
700 + * without specific prior written permission.
702 + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
703 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
704 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
705 + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
706 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
707 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
708 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
709 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
710 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
711 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
714 + * @(#)if_ether.h 8.3 (Berkeley) 5/2/95
718 +#include <net/ethernet.h>
719 +#include <net/if_arp.h>
723 + * Ethernet Address Resolution Protocol.
725 + * See RFC 826 for protocol description. Structure below is adapted
726 + * to resolving internet addresses. Field names used correspond to
730 + struct arphdr ea_hdr; /* fixed-size header */
731 + uint8_t arp_sha[ETH_ALEN]; /* sender hardware address */
732 + uint8_t arp_spa[4]; /* sender protocol address */
733 + uint8_t arp_tha[ETH_ALEN]; /* target hardware address */
734 + uint8_t arp_tpa[4]; /* target protocol address */
736 +#define arp_hrd ea_hdr.ar_hrd
737 +#define arp_pro ea_hdr.ar_pro
738 +#define arp_hln ea_hdr.ar_hln
739 +#define arp_pln ea_hdr.ar_pln
740 +#define arp_op ea_hdr.ar_op
743 + * Macro to map an IP multicast address to an Ethernet multicast address.
744 + * The high-order 25 bits of the Ethernet address are statically assigned,
745 + * and the low-order 23 bits are taken from the low end of the IP address.
747 +#define ETHER_MAP_IP_MULTICAST(ipaddr, enaddr) \
748 + /* struct in_addr *ipaddr; */ \
749 + /* uint8_t enaddr[ETH_ALEN]; */ \
751 + (enaddr)[0] = 0x01; \
752 + (enaddr)[1] = 0x00; \
753 + (enaddr)[2] = 0x5e; \
754 + (enaddr)[3] = ((uint8_t *)ipaddr)[1] & 0x7f; \
755 + (enaddr)[4] = ((uint8_t *)ipaddr)[2]; \
756 + (enaddr)[5] = ((uint8_t *)ipaddr)[3]; \
760 +#endif /* __USE_MISC */
762 +#endif /* netinet/if_ether.h */
763 Index: glibc-2.27/sysdeps/mach/hurd/Makefile
764 ===================================================================
765 --- glibc-2.27.orig/sysdeps/mach/hurd/Makefile
766 +++ glibc-2.27/sysdeps/mach/hurd/Makefile
767 @@ -202,7 +202,7 @@ ifeq ($(subdir),sunrpc)
770 ifeq ($(subdir),socket)
771 -sysdep_headers += net/ethernet.h net/if_arp.h net/if_ether.h net/route.h
772 +sysdep_headers += net/route.h
776 Index: glibc-2.27/sysdeps/mach/hurd/net/ethernet.h
777 ===================================================================
778 --- glibc-2.27.orig/sysdeps/mach/hurd/net/ethernet.h
781 -/* Copyright (C) 1997-2022 Free Software Foundation, Inc.
782 - This file is part of the GNU C Library.
784 - The GNU C Library is free software; you can redistribute it and/or
785 - modify it under the terms of the GNU Lesser General Public
786 - License as published by the Free Software Foundation; either
787 - version 2.1 of the License, or (at your option) any later version.
789 - The GNU C Library is distributed in the hope that it will be useful,
790 - but WITHOUT ANY WARRANTY; without even the implied warranty of
791 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
792 - Lesser General Public License for more details.
794 - You should have received a copy of the GNU Lesser General Public
795 - License along with the GNU C Library; if not, see
796 - <https://www.gnu.org/licenses/>. */
798 -/* Based on the FreeBSD version of this file. Curiously, that file
799 - lacks a copyright in the header. */
801 -#ifndef __NET_ETHERNET_H
802 -#define __NET_ETHERNET_H 1
804 -#include <sys/cdefs.h>
805 -#include <sys/types.h>
807 -#include <net/if_ether.h> /* IEEE 802.3 Ethernet constants */
811 -/* This is a name for the 48 bit ethernet address available on many
815 - uint8_t ether_addr_octet[ETH_ALEN];
818 -/* 10Mb/s ethernet header */
821 - uint8_t ether_dhost[ETH_ALEN]; /* destination eth addr */
822 - uint8_t ether_shost[ETH_ALEN]; /* source ether addr */
823 - uint16_t ether_type; /* packet type ID field */
826 -/* Ethernet protocol ID's */
827 -#define ETHERTYPE_PUP 0x0200 /* Xerox PUP */
828 -#define ETHERTYPE_IP 0x0800 /* IP */
829 -#define ETHERTYPE_ARP 0x0806 /* Address resolution */
830 -#define ETHERTYPE_REVARP 0x8035 /* Reverse ARP */
832 -#define ETHER_ADDR_LEN ETH_ALEN /* size of ethernet addr */
833 -#define ETHER_TYPE_LEN 2 /* bytes in type field */
834 -#define ETHER_CRC_LEN 4 /* bytes in CRC field */
835 -#define ETHER_HDR_LEN ETH_HLEN /* total octets in header */
836 -#define ETHER_MIN_LEN (ETH_ZLEN + ETH_CRC_LEN) /* min packet length */
837 -#define ETHER_MAX_LEN (ETH_FRAME_LEN + ETH_CRC_LEN) /* max packet length */
839 -/* make sure ethernet length is valid */
840 -#define ETHER_IS_VALID_LEN(foo) \
841 - ((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN)
844 - * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
845 - * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
846 - * by an ETHER type (as given above) and then the (variable-length) header.
848 -#define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */
849 -#define ETHERTYPE_NTRAILER 16
851 -#define ETHERMTU ETH_DATA_LEN
852 -#define ETHERMIN (ETHER_MIN_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN)
856 -#endif /* net/ethernet.h */
857 Index: glibc-2.27/sysdeps/mach/hurd/net/if_arp.h
858 ===================================================================
859 --- glibc-2.27.orig/sysdeps/mach/hurd/net/if_arp.h
862 -/* Definitions for Address Resolution Protocol.
863 - Copyright (C) 1997-2022 Free Software Foundation, Inc.
864 - This file is part of the GNU C Library.
866 - The GNU C Library is free software; you can redistribute it and/or
867 - modify it under the terms of the GNU Lesser General Public
868 - License as published by the Free Software Foundation; either
869 - version 2.1 of the License, or (at your option) any later version.
871 - The GNU C Library is distributed in the hope that it will be useful,
872 - but WITHOUT ANY WARRANTY; without even the implied warranty of
873 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
874 - Lesser General Public License for more details.
876 - You should have received a copy of the GNU Lesser General Public
877 - License along with the GNU C Library; if not, see
878 - <https://www.gnu.org/licenses/>. */
880 -/* Based on the 4.4BSD and Linux version of this file. */
882 -#ifndef _NET_IF_ARP_H
884 -#define _NET_IF_ARP_H 1
885 -#include <sys/cdefs.h>
887 -#include <sys/types.h>
888 -#include <sys/socket.h>
893 -/* Some internals from deep down in the kernel. */
894 -#define MAX_ADDR_LEN 7
897 -/* This structure defines an ethernet arp header. */
899 -/* ARP protocol opcodes. */
900 -#define ARPOP_REQUEST 1 /* ARP request. */
901 -#define ARPOP_REPLY 2 /* ARP reply. */
902 -#define ARPOP_RREQUEST 3 /* RARP request. */
903 -#define ARPOP_RREPLY 4 /* RARP reply. */
905 -/* See RFC 826 for protocol description. ARP packets are variable
906 - in size; the arphdr structure defines the fixed-length portion.
907 - Protocol type values are the same as those for 10 Mb/s Ethernet.
908 - It is followed by the variable-sized fields ar_sha, arp_spa,
909 - arp_tha and arp_tpa in that order, according to the lengths
910 - specified. Field names used correspond to RFC 826. */
914 - unsigned short int ar_hrd; /* Format of hardware address. */
915 - unsigned short int ar_pro; /* Format of protocol address. */
916 - unsigned char ar_hln; /* Length of hardware address. */
917 - unsigned char ar_pln; /* Length of protocol address. */
918 - unsigned short int ar_op; /* ARP opcode (command). */
920 - /* Ethernet looks like this : This bit is variable sized
922 - unsigned char __ar_sha[ETH_ALEN]; /* Sender hardware address. */
923 - unsigned char __ar_sip[4]; /* Sender IP address. */
924 - unsigned char __ar_tha[ETH_ALEN]; /* Target hardware address. */
925 - unsigned char __ar_tip[4]; /* Target IP address. */
930 -/* ARP protocol HARDWARE identifiers. */
931 -#define ARPHRD_NETROM 0 /* From KA9Q: NET/ROM pseudo. */
932 -#define ARPHRD_ETHER 1 /* Ethernet 10Mbps. */
933 -#define ARPHRD_EETHER 2 /* Experimental Ethernet. */
934 -#define ARPHRD_AX25 3 /* AX.25 Level 2. */
935 -#define ARPHRD_PRONET 4 /* PROnet token ring. */
936 -#define ARPHRD_CHAOS 5 /* Chaosnet. */
937 -#define ARPHRD_IEEE802 6 /* IEEE 802.2 Ethernet/TR/TB. */
938 -#define ARPHRD_ARCNET 7 /* ARCnet. */
939 -#define ARPHRD_APPLETLK 8 /* APPLEtalk. */
940 -#define ARPHRD_DLCI 15 /* Frame Relay DLCI. */
941 -#define ARPHRD_METRICOM 23 /* Metricom STRIP (new IANA id). */
943 -/* Dummy types for non ARP hardware */
944 -#define ARPHRD_SLIP 256
945 -#define ARPHRD_CSLIP 257
946 -#define ARPHRD_SLIP6 258
947 -#define ARPHRD_CSLIP6 259
948 -#define ARPHRD_RSRVD 260 /* Notional KISS type. */
949 -#define ARPHRD_ADAPT 264
950 -#define ARPHRD_ROSE 270
951 -#define ARPHRD_X25 271 /* CCITT X.25. */
952 -#define ARPHRD_PPP 512
953 -#define ARPHRD_HDLC 513 /* (Cisco) HDLC. */
954 -#define ARPHRD_LAPB 516 /* LAPB. */
956 -#define ARPHRD_TUNNEL 768 /* IPIP tunnel. */
957 -#define ARPHRD_TUNNEL6 769 /* IPIP6 tunnel. */
958 -#define ARPHRD_FRAD 770 /* Frame Relay Access Device. */
959 -#define ARPHRD_SKIP 771 /* SKIP vif. */
960 -#define ARPHRD_LOOPBACK 772 /* Loopback device. */
961 -#define ARPHRD_LOCALTLK 773 /* Localtalk device. */
962 -#define ARPHRD_FDDI 774 /* Fiber Distributed Data Interface. */
963 -#define ARPHRD_BIF 775 /* AP1000 BIF. */
964 -#define ARPHRD_SIT 776 /* sit0 device - IPv6-in-IPv4. */
967 -/* ARP ioctl request. */
970 - struct sockaddr arp_pa; /* Protocol address. */
971 - struct sockaddr arp_ha; /* Hardware address. */
972 - int arp_flags; /* Flags. */
973 - struct sockaddr arp_netmask; /* Netmask (only for proxy arps). */
977 -/* ARP Flag values. */
978 -#define ATF_COM 0x02 /* Completed entry (ha valid). */
979 -#define ATF_PERM 0x04 /* Permanent entry. */
980 -#define ATF_PUBL 0x08 /* Publish entry. */
981 -#define ATF_USETRAILERS 0x10 /* Has requested trailers. */
982 -#define ATF_NETMASK 0x20 /* Want to use a netmask (only
983 - for proxy entries). */
984 -#define ATF_DONTPUB 0x40 /* Don't answer this addresses. */
985 -#define ATF_MAGIC 0x80 /* Automatically added entry. */
988 -/* Support for the user space arp daemon, arpd. */
989 -#define ARPD_UPDATE 0x01
990 -#define ARPD_LOOKUP 0x02
991 -#define ARPD_FLUSH 0x03
995 - unsigned short int req; /* Request type. */
996 - uint32_t ip; /* IP address of entry. */
997 - unsigned long int dev; /* Device entry is tied to. */
998 - unsigned long int stamp;
999 - unsigned long int updated;
1000 - unsigned char ha[MAX_ADDR_LEN]; /* Hardware address. */
1005 -#endif /* net/if_arp.h */
1006 Index: glibc-2.27/sysdeps/mach/hurd/net/if_ether.h
1007 ===================================================================
1008 --- glibc-2.27.orig/sysdeps/mach/hurd/net/if_ether.h
1011 -/* Copyright (C) 1997-2022 Free Software Foundation, Inc.
1012 - This file is part of the GNU C Library.
1014 - The GNU C Library is free software; you can redistribute it and/or
1015 - modify it under the terms of the GNU Lesser General Public
1016 - License as published by the Free Software Foundation; either
1017 - version 2.1 of the License, or (at your option) any later version.
1019 - The GNU C Library is distributed in the hope that it will be useful,
1020 - but WITHOUT ANY WARRANTY; without even the implied warranty of
1021 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1022 - Lesser General Public License for more details.
1024 - You should have received a copy of the GNU Lesser General Public
1025 - License along with the GNU C Library; if not, see
1026 - <https://www.gnu.org/licenses/>. */
1028 -#ifndef _NET_IF_ETHER_H
1029 -#define _NET_IF_ETHER_H 1
1032 - * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
1033 - * and FCS/CRC (frame check sequence).
1036 -#define ETH_ALEN 6 /* Octets in one ethernet addr */
1037 -#define ETH_HLEN 14 /* Total octets in header. */
1038 -#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */
1039 -#define ETH_DATA_LEN 1500 /* Max. octets in payload */
1040 -#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
1043 - * These are the defined Ethernet Protocol ID's.
1046 -#define ETH_P_LOOP 0x0060 /* Ethernet Loopback packet */
1047 -#define ETH_P_ECHO 0x0200 /* Ethernet Echo packet */
1048 -#define ETH_P_PUP 0x0400 /* Xerox PUP packet */
1049 -#define ETH_P_IP 0x0800 /* Internet Protocol packet */
1050 -#define ETH_P_X25 0x0805 /* CCITT X.25 */
1051 -#define ETH_P_ARP 0x0806 /* Address Resolution packet */
1052 -#define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */
1053 -#define ETH_P_DEC 0x6000 /* DEC Assigned proto */
1054 -#define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */
1055 -#define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */
1056 -#define ETH_P_DNA_RT 0x6003 /* DEC DNA Routing */
1057 -#define ETH_P_LAT 0x6004 /* DEC LAT */
1058 -#define ETH_P_DIAG 0x6005 /* DEC Diagnostics */
1059 -#define ETH_P_CUST 0x6006 /* DEC Customer use */
1060 -#define ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */
1061 -#define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */
1062 -#define ETH_P_ATALK 0x809B /* Appletalk DDP */
1063 -#define ETH_P_AARP 0x80F3 /* Appletalk AARP */
1064 -#define ETH_P_IPX 0x8137 /* IPX over DIX */
1065 -#define ETH_P_IPV6 0x86DD /* IPv6 over bluebook */
1068 - * Non DIX types. Won't clash for 1500 types.
1071 -#define ETH_P_802_3 0x0001 /* Dummy type for 802.3 frames */
1072 -#define ETH_P_AX25 0x0002 /* Dummy protocol id for AX.25 */
1073 -#define ETH_P_ALL 0x0003 /* Every packet (be careful!!!) */
1074 -#define ETH_P_802_2 0x0004 /* 802.2 frames */
1075 -#define ETH_P_SNAP 0x0005 /* Internal only */
1076 -#define ETH_P_DDCMP 0x0006 /* DEC DDCMP: Internal only */
1077 -#define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/
1078 -#define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */
1079 -#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */
1080 -#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/
1081 -#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */
1084 - * This is an Ethernet frame header.
1089 - unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
1090 - unsigned char h_source[ETH_ALEN]; /* source ether addr */
1091 - unsigned short int h_proto; /* packet type ID field */
1094 -#endif /* net/if_ether.h */
1095 Index: glibc-2.27/sysdeps/unix/sysv/linux/Makefile
1096 ===================================================================
1097 --- glibc-2.27.orig/sysdeps/unix/sysv/linux/Makefile
1098 +++ glibc-2.27/sysdeps/unix/sysv/linux/Makefile
1099 @@ -118,8 +118,7 @@ $(objpfx)tst-signal-numbers.out: \
1102 ifeq ($(subdir),socket)
1103 -sysdep_headers += net/if_ppp.h net/ppp-comp.h \
1104 - net/ppp_defs.h net/if_arp.h net/route.h net/ethernet.h \
1105 +sysdep_headers += net/ppp-comp.h net/ppp_defs.h net/route.h \
1106 net/if_slip.h net/if_packet.h net/if_shaper.h \
1107 bits/socket-constants.h
1108 sysdep_routines += cmsg_nxthdr
1109 Index: glibc-2.27/sysdeps/unix/sysv/linux/net/ethernet.h
1110 ===================================================================
1111 --- glibc-2.27.orig/sysdeps/unix/sysv/linux/net/ethernet.h
1114 -/* Copyright (C) 1997-2022 Free Software Foundation, Inc.
1115 - This file is part of the GNU C Library.
1117 - The GNU C Library is free software; you can redistribute it and/or
1118 - modify it under the terms of the GNU Lesser General Public
1119 - License as published by the Free Software Foundation; either
1120 - version 2.1 of the License, or (at your option) any later version.
1122 - The GNU C Library is distributed in the hope that it will be useful,
1123 - but WITHOUT ANY WARRANTY; without even the implied warranty of
1124 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1125 - Lesser General Public License for more details.
1127 - You should have received a copy of the GNU Lesser General Public
1128 - License along with the GNU C Library; if not, see
1129 - <https://www.gnu.org/licenses/>. */
1131 -/* Based on the FreeBSD version of this file. Curiously, that file
1132 - lacks a copyright in the header. */
1134 -#ifndef __NET_ETHERNET_H
1135 -#define __NET_ETHERNET_H 1
1137 -#include <sys/types.h>
1138 -#include <stdint.h>
1140 -#include <linux/if_ether.h> /* IEEE 802.3 Ethernet constants */
1144 -/* This is a name for the 48 bit ethernet address available on many
1148 - uint8_t ether_addr_octet[ETH_ALEN];
1149 -} __attribute__ ((__packed__));
1151 -/* 10Mb/s ethernet header */
1152 -struct ether_header
1154 - uint8_t ether_dhost[ETH_ALEN]; /* destination eth addr */
1155 - uint8_t ether_shost[ETH_ALEN]; /* source ether addr */
1156 - uint16_t ether_type; /* packet type ID field */
1157 -} __attribute__ ((__packed__));
1159 -/* Ethernet protocol ID's */
1160 -#define ETHERTYPE_PUP 0x0200 /* Xerox PUP */
1161 -#define ETHERTYPE_SPRITE 0x0500 /* Sprite */
1162 -#define ETHERTYPE_IP 0x0800 /* IP */
1163 -#define ETHERTYPE_ARP 0x0806 /* Address resolution */
1164 -#define ETHERTYPE_REVARP 0x8035 /* Reverse ARP */
1165 -#define ETHERTYPE_AT 0x809B /* AppleTalk protocol */
1166 -#define ETHERTYPE_AARP 0x80F3 /* AppleTalk ARP */
1167 -#define ETHERTYPE_VLAN 0x8100 /* IEEE 802.1Q VLAN tagging */
1168 -#define ETHERTYPE_IPX 0x8137 /* IPX */
1169 -#define ETHERTYPE_IPV6 0x86dd /* IP protocol version 6 */
1170 -#define ETHERTYPE_LOOPBACK 0x9000 /* used to test interfaces */
1172 -#define ETHER_ADDR_LEN ETH_ALEN /* size of ethernet addr */
1173 -#define ETHER_TYPE_LEN 2 /* bytes in type field */
1174 -#define ETHER_CRC_LEN 4 /* bytes in CRC field */
1175 -#define ETHER_HDR_LEN ETH_HLEN /* total octets in header */
1176 -#define ETHER_MIN_LEN (ETH_ZLEN + ETHER_CRC_LEN) /* min packet length */
1177 -#define ETHER_MAX_LEN (ETH_FRAME_LEN + ETHER_CRC_LEN) /* max packet length */
1179 -/* make sure ethernet length is valid */
1180 -#define ETHER_IS_VALID_LEN(foo) \
1181 - ((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN)
1184 - * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
1185 - * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
1186 - * by an ETHER type (as given above) and then the (variable-length) header.
1188 -#define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */
1189 -#define ETHERTYPE_NTRAILER 16
1191 -#define ETHERMTU ETH_DATA_LEN
1192 -#define ETHERMIN (ETHER_MIN_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN)
1196 -#endif /* net/ethernet.h */
1197 Index: glibc-2.27/sysdeps/unix/sysv/linux/net/if_arp.h
1198 ===================================================================
1199 --- glibc-2.27.orig/sysdeps/unix/sysv/linux/net/if_arp.h
1202 -/* Definitions for Address Resolution Protocol.
1203 - Copyright (C) 1997-2022 Free Software Foundation, Inc.
1204 - This file is part of the GNU C Library.
1206 - The GNU C Library is free software; you can redistribute it and/or
1207 - modify it under the terms of the GNU Lesser General Public
1208 - License as published by the Free Software Foundation; either
1209 - version 2.1 of the License, or (at your option) any later version.
1211 - The GNU C Library is distributed in the hope that it will be useful,
1212 - but WITHOUT ANY WARRANTY; without even the implied warranty of
1213 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1214 - Lesser General Public License for more details.
1216 - You should have received a copy of the GNU Lesser General Public
1217 - License along with the GNU C Library; if not, see
1218 - <https://www.gnu.org/licenses/>. */
1220 -/* Based on the 4.4BSD and Linux version of this file. */
1222 -#ifndef _NET_IF_ARP_H
1223 -#define _NET_IF_ARP_H 1
1225 -#include <sys/types.h>
1226 -#include <sys/socket.h>
1227 -#include <stdint.h>
1231 -/* Some internals from deep down in the kernel. */
1232 -#define MAX_ADDR_LEN 7
1235 -/* This structure defines an ethernet arp header. */
1237 -/* ARP protocol opcodes. */
1238 -#define ARPOP_REQUEST 1 /* ARP request. */
1239 -#define ARPOP_REPLY 2 /* ARP reply. */
1240 -#define ARPOP_RREQUEST 3 /* RARP request. */
1241 -#define ARPOP_RREPLY 4 /* RARP reply. */
1242 -#define ARPOP_InREQUEST 8 /* InARP request. */
1243 -#define ARPOP_InREPLY 9 /* InARP reply. */
1244 -#define ARPOP_NAK 10 /* (ATM)ARP NAK. */
1246 -/* See RFC 826 for protocol description. ARP packets are variable
1247 - in size; the arphdr structure defines the fixed-length portion.
1248 - Protocol type values are the same as those for 10 Mb/s Ethernet.
1249 - It is followed by the variable-sized fields ar_sha, arp_spa,
1250 - arp_tha and arp_tpa in that order, according to the lengths
1251 - specified. Field names used correspond to RFC 826. */
1255 - unsigned short int ar_hrd; /* Format of hardware address. */
1256 - unsigned short int ar_pro; /* Format of protocol address. */
1257 - unsigned char ar_hln; /* Length of hardware address. */
1258 - unsigned char ar_pln; /* Length of protocol address. */
1259 - unsigned short int ar_op; /* ARP opcode (command). */
1261 - /* Ethernet looks like this : This bit is variable sized
1263 - unsigned char __ar_sha[ETH_ALEN]; /* Sender hardware address. */
1264 - unsigned char __ar_sip[4]; /* Sender IP address. */
1265 - unsigned char __ar_tha[ETH_ALEN]; /* Target hardware address. */
1266 - unsigned char __ar_tip[4]; /* Target IP address. */
1271 -/* ARP protocol HARDWARE identifiers. */
1272 -#define ARPHRD_NETROM 0 /* From KA9Q: NET/ROM pseudo. */
1273 -#define ARPHRD_ETHER 1 /* Ethernet 10/100Mbps. */
1274 -#define ARPHRD_EETHER 2 /* Experimental Ethernet. */
1275 -#define ARPHRD_AX25 3 /* AX.25 Level 2. */
1276 -#define ARPHRD_PRONET 4 /* PROnet token ring. */
1277 -#define ARPHRD_CHAOS 5 /* Chaosnet. */
1278 -#define ARPHRD_IEEE802 6 /* IEEE 802.2 Ethernet/TR/TB. */
1279 -#define ARPHRD_ARCNET 7 /* ARCnet. */
1280 -#define ARPHRD_APPLETLK 8 /* APPLEtalk. */
1281 -#define ARPHRD_DLCI 15 /* Frame Relay DLCI. */
1282 -#define ARPHRD_ATM 19 /* ATM. */
1283 -#define ARPHRD_METRICOM 23 /* Metricom STRIP (new IANA id). */
1284 -#define ARPHRD_IEEE1394 24 /* IEEE 1394 IPv4 - RFC 2734. */
1285 -#define ARPHRD_EUI64 27 /* EUI-64. */
1286 -#define ARPHRD_INFINIBAND 32 /* InfiniBand. */
1288 -/* Dummy types for non ARP hardware */
1289 -#define ARPHRD_SLIP 256
1290 -#define ARPHRD_CSLIP 257
1291 -#define ARPHRD_SLIP6 258
1292 -#define ARPHRD_CSLIP6 259
1293 -#define ARPHRD_RSRVD 260 /* Notional KISS type. */
1294 -#define ARPHRD_ADAPT 264
1295 -#define ARPHRD_ROSE 270
1296 -#define ARPHRD_X25 271 /* CCITT X.25. */
1297 -#define ARPHRD_HWX25 272 /* Boards with X.25 in firmware. */
1298 -#define ARPHRD_CAN 280 /* Controller Area Network. */
1299 -#define ARPHRD_MCTP 290
1300 -#define ARPHRD_PPP 512
1301 -#define ARPHRD_CISCO 513 /* Cisco HDLC. */
1302 -#define ARPHRD_HDLC ARPHRD_CISCO
1303 -#define ARPHRD_LAPB 516 /* LAPB. */
1304 -#define ARPHRD_DDCMP 517 /* Digital's DDCMP. */
1305 -#define ARPHRD_RAWHDLC 518 /* Raw HDLC. */
1306 -#define ARPHRD_RAWIP 519 /* Raw IP. */
1308 -#define ARPHRD_TUNNEL 768 /* IPIP tunnel. */
1309 -#define ARPHRD_TUNNEL6 769 /* IPIP6 tunnel. */
1310 -#define ARPHRD_FRAD 770 /* Frame Relay Access Device. */
1311 -#define ARPHRD_SKIP 771 /* SKIP vif. */
1312 -#define ARPHRD_LOOPBACK 772 /* Loopback device. */
1313 -#define ARPHRD_LOCALTLK 773 /* Localtalk device. */
1314 -#define ARPHRD_FDDI 774 /* Fiber Distributed Data Interface. */
1315 -#define ARPHRD_BIF 775 /* AP1000 BIF. */
1316 -#define ARPHRD_SIT 776 /* sit0 device - IPv6-in-IPv4. */
1317 -#define ARPHRD_IPDDP 777 /* IP-in-DDP tunnel. */
1318 -#define ARPHRD_IPGRE 778 /* GRE over IP. */
1319 -#define ARPHRD_PIMREG 779 /* PIMSM register interface. */
1320 -#define ARPHRD_HIPPI 780 /* High Performance Parallel I'face. */
1321 -#define ARPHRD_ASH 781 /* (Nexus Electronics) Ash. */
1322 -#define ARPHRD_ECONET 782 /* Acorn Econet. */
1323 -#define ARPHRD_IRDA 783 /* Linux-IrDA. */
1324 -#define ARPHRD_FCPP 784 /* Point to point fibrechanel. */
1325 -#define ARPHRD_FCAL 785 /* Fibrechanel arbitrated loop. */
1326 -#define ARPHRD_FCPL 786 /* Fibrechanel public loop. */
1327 -#define ARPHRD_FCFABRIC 787 /* Fibrechanel fabric. */
1328 -#define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR. */
1329 -#define ARPHRD_IEEE80211 801 /* IEEE 802.11. */
1330 -#define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header. */
1331 -#define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header. */
1332 -#define ARPHRD_IEEE802154 804 /* IEEE 802.15.4 header. */
1333 -#define ARPHRD_IEEE802154_PHY 805 /* IEEE 802.15.4 PHY header. */
1335 -#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known. */
1336 -#define ARPHRD_NONE 0xFFFE /* Zero header length. */
1339 -/* ARP ioctl request. */
1342 - struct sockaddr arp_pa; /* Protocol address. */
1343 - struct sockaddr arp_ha; /* Hardware address. */
1344 - int arp_flags; /* Flags. */
1345 - struct sockaddr arp_netmask; /* Netmask (only for proxy arps). */
1351 - struct sockaddr arp_pa; /* Protocol address. */
1352 - struct sockaddr arp_ha; /* Hardware address. */
1353 - int arp_flags; /* Flags. */
1354 - struct sockaddr arp_netmask; /* Netmask (only for proxy arps). */
1357 -/* ARP Flag values. */
1358 -#define ATF_COM 0x02 /* Completed entry (ha valid). */
1359 -#define ATF_PERM 0x04 /* Permanent entry. */
1360 -#define ATF_PUBL 0x08 /* Publish entry. */
1361 -#define ATF_USETRAILERS 0x10 /* Has requested trailers. */
1362 -#define ATF_NETMASK 0x20 /* Want to use a netmask (only
1363 - for proxy entries). */
1364 -#define ATF_DONTPUB 0x40 /* Don't answer this addresses. */
1365 -#define ATF_MAGIC 0x80 /* Automatically added entry. */
1368 -/* Support for the user space arp daemon, arpd. */
1369 -#define ARPD_UPDATE 0x01
1370 -#define ARPD_LOOKUP 0x02
1371 -#define ARPD_FLUSH 0x03
1373 -struct arpd_request
1375 - unsigned short int req; /* Request type. */
1376 - uint32_t ip; /* IP address of entry. */
1377 - unsigned long int dev; /* Device entry is tied to. */
1378 - unsigned long int stamp;
1379 - unsigned long int updated;
1380 - unsigned char ha[MAX_ADDR_LEN]; /* Hardware address. */
1385 -#endif /* net/if_arp.h */
1386 Index: glibc-2.27/sysdeps/unix/sysv/linux/net/if_ether.h
1387 ===================================================================
1389 +++ glibc-2.27/sysdeps/unix/sysv/linux/net/if_ether.h
1391 +#ifndef _NET_IF_ETHER_H
1392 +#define _NET_IF_ETHER_H 1
1394 +/* Get definitions from kernel header file. */
1395 +#include <linux/if_ether.h>
1397 +#endif /* net/if_ether.h */
1398 Index: glibc-2.27/sysdeps/unix/sysv/linux/net/if_ppp.h
1399 ===================================================================
1400 --- glibc-2.27.orig/sysdeps/unix/sysv/linux/net/if_ppp.h
1403 -/* From: if_ppp.h,v 1.3 1995/06/12 11:36:50 paulus Exp */
1406 - * if_ppp.h - Point-to-Point Protocol definitions.
1408 - * Copyright (c) 1989 Carnegie Mellon University.
1410 - * Redistribution and use in source and binary forms, with or without
1411 - * modification, are permitted provided that the following conditions
1413 - * 1. Redistributions of source code must retain the above copyright
1414 - * notice, this list of conditions and the following disclaimer.
1415 - * 2. Redistributions in binary form must reproduce the above copyright
1416 - * notice, this list of conditions and the following disclaimer in the
1417 - * documentation and/or other materials provided with the distribution.
1418 - * 3. Neither the name of the University nor the names of its contributors
1419 - * may be used to endorse or promote products derived from this software
1420 - * without specific prior written permission.
1422 - * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY AND
1423 - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
1424 - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
1425 - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1426 - * IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE FOR ANY
1427 - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1428 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
1429 - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
1430 - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
1431 - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
1432 - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
1433 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1438 - * ==FILEVERSION 960926==
1440 - * NOTE TO MAINTAINERS:
1441 - * If you modify this file at all, please set the above date.
1442 - * if_ppp.h is shipped with a PPP distribution as well as with the kernel;
1443 - * if everyone increases the FILEVERSION number above, then scripts
1444 - * can do the right thing when deciding whether to install a new if_ppp.h
1445 - * file. Don't change the format of that line otherwise, so the
1446 - * installation script can recognize it.
1450 -#ifndef __NET_IF_PPP_H
1451 -#define __NET_IF_PPP_H 1
1453 -#include <sys/types.h>
1454 -#include <stdint.h>
1455 -#include <net/if.h>
1456 -#include <sys/ioctl.h>
1457 -#include <net/ppp_defs.h>
1465 -#define PPP_MTU 1500 /* Default MTU (size of Info field) */
1466 -#define PPP_MAXMRU 65000 /* Largest MRU we allow */
1467 -#define PPP_VERSION "2.2.0"
1468 -#define PPP_MAGIC 0x5002 /* Magic value for the ppp structure */
1469 -#define PROTO_IPX 0x002b /* protocol numbers */
1470 -#define PROTO_DNA_RT 0x0027 /* DNA Routing */
1474 - * Bit definitions for flags.
1477 -#define SC_COMP_PROT 0x00000001 /* protocol compression (output) */
1478 -#define SC_COMP_AC 0x00000002 /* header compression (output) */
1479 -#define SC_COMP_TCP 0x00000004 /* TCP (VJ) compression (output) */
1480 -#define SC_NO_TCP_CCID 0x00000008 /* disable VJ connection-id comp. */
1481 -#define SC_REJ_COMP_AC 0x00000010 /* reject adrs/ctrl comp. on input */
1482 -#define SC_REJ_COMP_TCP 0x00000020 /* reject TCP (VJ) comp. on input */
1483 -#define SC_CCP_OPEN 0x00000040 /* Look at CCP packets */
1484 -#define SC_CCP_UP 0x00000080 /* May send/recv compressed packets */
1485 -#define SC_ENABLE_IP 0x00000100 /* IP packets may be exchanged */
1486 -#define SC_COMP_RUN 0x00001000 /* compressor has been inited */
1487 -#define SC_DECOMP_RUN 0x00002000 /* decompressor has been inited */
1488 -#define SC_DEBUG 0x00010000 /* enable debug messages */
1489 -#define SC_LOG_INPKT 0x00020000 /* log contents of good pkts recvd */
1490 -#define SC_LOG_OUTPKT 0x00040000 /* log contents of pkts sent */
1491 -#define SC_LOG_RAWIN 0x00080000 /* log all chars received */
1492 -#define SC_LOG_FLUSH 0x00100000 /* log all chars flushed */
1493 -#define SC_MASK 0x0fE0ffff /* bits that user can change */
1496 -#define SC_ESCAPED 0x80000000 /* saw a PPP_ESCAPE */
1497 -#define SC_FLUSH 0x40000000 /* flush input until next PPP_FLAG */
1498 -#define SC_VJ_RESET 0x20000000 /* Need to reset the VJ decompressor */
1499 -#define SC_XMIT_BUSY 0x10000000 /* ppp_write_wakeup is active */
1500 -#define SC_RCV_ODDP 0x08000000 /* have rcvd char with odd parity */
1501 -#define SC_RCV_EVNP 0x04000000 /* have rcvd char with even parity */
1502 -#define SC_RCV_B7_1 0x02000000 /* have rcvd char with bit 7 = 1 */
1503 -#define SC_RCV_B7_0 0x01000000 /* have rcvd char with bit 7 = 0 */
1504 -#define SC_DC_FERROR 0x00800000 /* fatal decomp error detected */
1505 -#define SC_DC_ERROR 0x00400000 /* non-fatal decomp error detected */
1508 - * Ioctl definitions.
1512 - int protocol; /* PPP protocol, e.g. PPP_IP */
1516 -/* Structure describing a CCP configuration option, for PPPIOCSCOMPRESS */
1517 -struct ppp_option_data {
1523 -/* 'struct ifreq' is only available from net/if.h under __USE_MISC. */
1525 -struct ifpppstatsreq {
1527 - struct ppp_stats stats; /* statistic information */
1530 -struct ifpppcstatsreq {
1532 - struct ppp_comp_stats stats;
1535 -#define ifr__name b.ifr_ifrn.ifrn_name
1536 -#define stats_ptr b.ifr_ifru.ifru_data
1540 - * Ioctl definitions.
1543 -#define PPPIOCGFLAGS _IOR('t', 90, int) /* get configuration flags */
1544 -#define PPPIOCSFLAGS _IOW('t', 89, int) /* set configuration flags */
1545 -#define PPPIOCGASYNCMAP _IOR('t', 88, int) /* get async map */
1546 -#define PPPIOCSASYNCMAP _IOW('t', 87, int) /* set async map */
1547 -#define PPPIOCGUNIT _IOR('t', 86, int) /* get ppp unit number */
1548 -#define PPPIOCGRASYNCMAP _IOR('t', 85, int) /* get receive async map */
1549 -#define PPPIOCSRASYNCMAP _IOW('t', 84, int) /* set receive async map */
1550 -#define PPPIOCGMRU _IOR('t', 83, int) /* get max receive unit */
1551 -#define PPPIOCSMRU _IOW('t', 82, int) /* set max receive unit */
1552 -#define PPPIOCSMAXCID _IOW('t', 81, int) /* set VJ max slot ID */
1553 -#define PPPIOCGXASYNCMAP _IOR('t', 80, ext_accm) /* get extended ACCM */
1554 -#define PPPIOCSXASYNCMAP _IOW('t', 79, ext_accm) /* set extended ACCM */
1555 -#define PPPIOCXFERUNIT _IO('t', 78) /* transfer PPP unit */
1556 -#define PPPIOCSCOMPRESS _IOW('t', 77, struct ppp_option_data)
1557 -#define PPPIOCGNPMODE _IOWR('t', 76, struct npioctl) /* get NP mode */
1558 -#define PPPIOCSNPMODE _IOW('t', 75, struct npioctl) /* set NP mode */
1559 -#define PPPIOCGDEBUG _IOR('t', 65, int) /* Read debug level */
1560 -#define PPPIOCSDEBUG _IOW('t', 64, int) /* Set debug level */
1561 -#define PPPIOCGIDLE _IOR('t', 63, struct ppp_idle) /* get idle time */
1563 -#define SIOCGPPPSTATS (SIOCDEVPRIVATE + 0)
1564 -#define SIOCGPPPVER (SIOCDEVPRIVATE + 1) /* NEVER change this!! */
1565 -#define SIOCGPPPCSTATS (SIOCDEVPRIVATE + 2)
1567 -#if !defined(ifr_mtu)
1568 -#define ifr_mtu ifr_ifru.ifru_metric
1573 -#endif /* net/if_ppp.h */
1574 Index: glibc-2.27/sysdeps/unix/sysv/linux/netinet/if_ether.h
1575 ===================================================================
1576 --- glibc-2.27.orig/sysdeps/unix/sysv/linux/netinet/if_ether.h
1579 -/* Copyright (C) 1996-2022 Free Software Foundation, Inc.
1580 - This file is part of the GNU C Library.
1582 - The GNU C Library is free software; you can redistribute it and/or
1583 - modify it under the terms of the GNU Lesser General Public
1584 - License as published by the Free Software Foundation; either
1585 - version 2.1 of the License, or (at your option) any later version.
1587 - The GNU C Library is distributed in the hope that it will be useful,
1588 - but WITHOUT ANY WARRANTY; without even the implied warranty of
1589 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1590 - Lesser General Public License for more details.
1592 - You should have received a copy of the GNU Lesser General Public
1593 - License along with the GNU C Library; if not, see
1594 - <https://www.gnu.org/licenses/>. */
1596 -#ifndef __NETINET_IF_ETHER_H
1598 -#define __NETINET_IF_ETHER_H 1
1599 -#include <features.h>
1600 -#include <sys/types.h>
1602 -/* Get definitions from kernel header file. */
1603 -#include <linux/if_ether.h>
1607 - * Copyright (c) 1982, 1986, 1993
1608 - * The Regents of the University of California. All rights reserved.
1610 - * Redistribution and use in source and binary forms, with or without
1611 - * modification, are permitted provided that the following conditions
1613 - * 1. Redistributions of source code must retain the above copyright
1614 - * notice, this list of conditions and the following disclaimer.
1615 - * 2. Redistributions in binary form must reproduce the above copyright
1616 - * notice, this list of conditions and the following disclaimer in the
1617 - * documentation and/or other materials provided with the distribution.
1618 - * 4. Neither the name of the University nor the names of its contributors
1619 - * may be used to endorse or promote products derived from this software
1620 - * without specific prior written permission.
1622 - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
1623 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1624 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1625 - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
1626 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1627 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
1628 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
1629 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
1630 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
1631 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
1634 - * @(#)if_ether.h 8.3 (Berkeley) 5/2/95
1638 -#include <net/ethernet.h>
1639 -#include <net/if_arp.h>
1643 - * Ethernet Address Resolution Protocol.
1645 - * See RFC 826 for protocol description. Structure below is adapted
1646 - * to resolving internet addresses. Field names used correspond to
1650 - struct arphdr ea_hdr; /* fixed-size header */
1651 - uint8_t arp_sha[ETH_ALEN]; /* sender hardware address */
1652 - uint8_t arp_spa[4]; /* sender protocol address */
1653 - uint8_t arp_tha[ETH_ALEN]; /* target hardware address */
1654 - uint8_t arp_tpa[4]; /* target protocol address */
1656 -#define arp_hrd ea_hdr.ar_hrd
1657 -#define arp_pro ea_hdr.ar_pro
1658 -#define arp_hln ea_hdr.ar_hln
1659 -#define arp_pln ea_hdr.ar_pln
1660 -#define arp_op ea_hdr.ar_op
1663 - * Macro to map an IP multicast address to an Ethernet multicast address.
1664 - * The high-order 25 bits of the Ethernet address are statically assigned,
1665 - * and the low-order 23 bits are taken from the low end of the IP address.
1667 -#define ETHER_MAP_IP_MULTICAST(ipaddr, enaddr) \
1668 - /* struct in_addr *ipaddr; */ \
1669 - /* uint8_t enaddr[ETH_ALEN]; */ \
1671 - (enaddr)[0] = 0x01; \
1672 - (enaddr)[1] = 0x00; \
1673 - (enaddr)[2] = 0x5e; \
1674 - (enaddr)[3] = ((uint8_t *)ipaddr)[1] & 0x7f; \
1675 - (enaddr)[4] = ((uint8_t *)ipaddr)[2]; \
1676 - (enaddr)[5] = ((uint8_t *)ipaddr)[3]; \
1680 -#endif /* __USE_MISC */
1682 -#endif /* netinet/if_ether.h */