View | Details | Raw Unified | Return to bug 11142 | Differences between
and this patch

Collapse All | Expand All

(-)a/sysdeps/gnu/Makefile (+5 lines)
Lines 77-79 endif Link Here
77
ifeq ($(subdir),misc)
77
ifeq ($(subdir),misc)
78
sysdep_headers += sys/mtio.h
78
sysdep_headers += sys/mtio.h
79
endif
79
endif
80
81
ifeq ($(subdir),socket)
82
sysdep_headers += net/ethernet.h net/if_arp.h net/if_ether.h net/if_ppp.h \
83
		  net/route.h
84
endif
(-)a/sysdeps/unix/sysv/linux/net/ethernet.h (-2 / +2 lines)
Lines 1-4 Link Here
1
/* Copyright (C) 1997, 1999, 2001, 2008 Free Software Foundation, Inc.
1
/* Copyright (C) 1997, 1999, 2001, 2008, 2010 Free Software Foundation, Inc.
2
   This file is part of the GNU C Library.
2
   This file is part of the GNU C Library.
3
3
4
   The GNU C Library is free software; you can redistribute it and/or
4
   The GNU C Library is free software; you can redistribute it and/or
Lines 24-30 Link Here
24
24
25
#include <sys/cdefs.h>
25
#include <sys/cdefs.h>
26
#include <sys/types.h>
26
#include <sys/types.h>
27
#include <linux/if_ether.h>     /* IEEE 802.3 Ethernet constants */
27
#include <net/if_ether.h>     /* IEEE 802.3 Ethernet constants */
28
28
29
__BEGIN_DECLS
29
__BEGIN_DECLS
30
30
(-)a/sysdeps/mach/hurd/net/if_ether.h (-4 / +35 lines)
Lines 1-4 Link Here
1
/* Copyright (C) 1997 Free Software Foundation, Inc.
1
/* Copyright (C) 1997,2010 Free Software Foundation, Inc.
2
   This file is part of the GNU C Library.
2
   This file is part of the GNU C Library.
3
3
4
   The GNU C Library is free software; you can redistribute it and/or
4
   The GNU C Library is free software; you can redistribute it and/or
Lines 29-46 Link Here
29
#define ETH_ZLEN	60		/* Min. octets in frame sans FCS */
29
#define ETH_ZLEN	60		/* Min. octets in frame sans FCS */
30
#define ETH_DATA_LEN	1500		/* Max. octets in payload	 */
30
#define ETH_DATA_LEN	1500		/* Max. octets in payload	 */
31
#define ETH_FRAME_LEN	1514		/* Max. octets in frame sans FCS */
31
#define ETH_FRAME_LEN	1514		/* Max. octets in frame sans FCS */
32
#define ETH_FCS_LEN	4		/* Octets in the FCS		 */
32
33
33
/*
34
/*
34
 *	These are the defined Ethernet Protocol ID's.
35
 *	These are the defined Ethernet Protocol ID's.
35
 */
36
 */
36
37
37
#define ETH_P_LOOP	0x0060		/* Ethernet Loopback packet	*/
38
#define ETH_P_LOOP	0x0060		/* Ethernet Loopback packet	*/
38
#define ETH_P_ECHO	0x0200		/* Ethernet Echo packet		*/
39
#define ETH_P_PUP	0x0200		/* Xerox PUP packet		*/
39
#define ETH_P_PUP	0x0400		/* Xerox PUP packet		*/
40
#define ETH_P_PUPAT	0x0201		/* Xerox PUP Addr Trans packet	*/
40
#define ETH_P_IP	0x0800		/* Internet Protocol packet	*/
41
#define ETH_P_IP	0x0800		/* Internet Protocol packet	*/
41
#define ETH_P_X25	0x0805		/* CCITT X.25			*/
42
#define ETH_P_X25	0x0805		/* CCITT X.25			*/
42
#define ETH_P_ARP	0x0806		/* Address Resolution packet	*/
43
#define ETH_P_ARP	0x0806		/* Address Resolution packet	*/
43
#define	ETH_P_BPQ	0x08FF		/* G8BPQ AX.25 Ethernet Packet	[ NOT AN OFFICIALLY REGISTERED ID ] */
44
#define	ETH_P_BPQ	0x08FF		/* G8BPQ AX.25 Ethernet Packet	[ NOT AN OFFICIALLY REGISTERED ID ] */
45
#define ETH_P_IEEEPUP	0x0a00		/* Xerox IEEE802.3 PUP packet */
46
#define ETH_P_IEEEPUPAT	0x0a01		/* Xerox IEEE802.3 PUP Addr Trans packet */
44
#define ETH_P_DEC       0x6000          /* DEC Assigned proto           */
47
#define ETH_P_DEC       0x6000          /* DEC Assigned proto           */
45
#define ETH_P_DNA_DL    0x6001          /* DEC DNA Dump/Load            */
48
#define ETH_P_DNA_DL    0x6001          /* DEC DNA Dump/Load            */
46
#define ETH_P_DNA_RC    0x6002          /* DEC DNA Remote Console       */
49
#define ETH_P_DNA_RC    0x6002          /* DEC DNA Remote Console       */
Lines 52-59 Link Here
52
#define ETH_P_RARP      0x8035		/* Reverse Addr Res packet	*/
55
#define ETH_P_RARP      0x8035		/* Reverse Addr Res packet	*/
53
#define ETH_P_ATALK	0x809B		/* Appletalk DDP		*/
56
#define ETH_P_ATALK	0x809B		/* Appletalk DDP		*/
54
#define ETH_P_AARP	0x80F3		/* Appletalk AARP		*/
57
#define ETH_P_AARP	0x80F3		/* Appletalk AARP		*/
58
#define ETH_P_8021Q	0x8100          /* 802.1Q VLAN Extended Header  */
55
#define ETH_P_IPX	0x8137		/* IPX over DIX			*/
59
#define ETH_P_IPX	0x8137		/* IPX over DIX			*/
56
#define ETH_P_IPV6	0x86DD		/* IPv6 over bluebook		*/
60
#define ETH_P_IPV6	0x86DD		/* IPv6 over bluebook		*/
61
#define ETH_P_PAUSE	0x8808		/* IEEE Pause frames. See 802.3 31B */
62
#define ETH_P_SLOW	0x8809		/* Slow Protocol. See 802.3ad 43B */
63
#define ETH_P_WCCP	0x883E		/* Web-cache coordination protocol
64
					 * defined in draft-wilson-wrec-wccp-v2-00.txt */
65
#define ETH_P_PPP_DISC	0x8863		/* PPPoE discovery messages     */
66
#define ETH_P_PPP_SES	0x8864		/* PPPoE session messages	*/
67
#define ETH_P_MPLS_UC	0x8847		/* MPLS Unicast traffic		*/
68
#define ETH_P_MPLS_MC	0x8848		/* MPLS Multicast traffic	*/
69
#define ETH_P_ATMMPOA	0x884c		/* MultiProtocol Over ATM	*/
70
#define ETH_P_ATMFATE	0x8884		/* Frame-based ATM Transport
71
					 * over Ethernet
72
					 */
73
#define ETH_P_PAE	0x888E		/* Port Access Entity (IEEE 802.1X) */
74
#define ETH_P_AOE	0x88A2		/* ATA over Ethernet		*/
75
#define ETH_P_TIPC	0x88CA		/* TIPC 			*/
76
#define ETH_P_FCOE	0x8906		/* Fibre Channel over Ethernet  */
77
#define ETH_P_EDSA	0xDADA		/* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
57
78
58
/*
79
/*
59
 *	Non DIX types. Won't clash for 1500 types.
80
 *	Non DIX types. Won't clash for 1500 types.
Lines 68-75 Link Here
68
#define ETH_P_WAN_PPP   0x0007          /* Dummy type for WAN PPP frames*/
89
#define ETH_P_WAN_PPP   0x0007          /* Dummy type for WAN PPP frames*/
69
#define ETH_P_PPP_MP    0x0008          /* Dummy type for PPP MP frames */
90
#define ETH_P_PPP_MP    0x0008          /* Dummy type for PPP MP frames */
70
#define ETH_P_LOCALTALK 0x0009		/* Localtalk pseudo type 	*/
91
#define ETH_P_LOCALTALK 0x0009		/* Localtalk pseudo type 	*/
92
#define ETH_P_CAN	0x000C		/* Controller Area Network      */
71
#define ETH_P_PPPTALK	0x0010		/* Dummy type for Atalk over PPP*/
93
#define ETH_P_PPPTALK	0x0010		/* Dummy type for Atalk over PPP*/
72
#define ETH_P_TR_802_2	0x0011		/* 802.2 frames 		*/
94
#define ETH_P_TR_802_2	0x0011		/* 802.2 frames 		*/
95
#define ETH_P_MOBITEX	0x0015		/* Mobitex (kaz@cafe.net)	*/
96
#define ETH_P_CONTROL	0x0016		/* Card specific control frames */
97
#define ETH_P_IRDA	0x0017		/* Linux-IrDA			*/
98
#define ETH_P_ECONET	0x0018		/* Acorn Econet			*/
99
#define ETH_P_HDLC	0x0019		/* HDLC frames			*/
100
#define ETH_P_ARCNET	0x001A		/* 1A for ArcNet :-)            */
101
#define ETH_P_DSA	0x001B		/* Distributed Switch Arch.	*/
102
#define ETH_P_TRAILER	0x001C		/* Trailer switch tagging	*/
103
#define ETH_P_PHONET	0x00F5		/* Nokia Phonet frames          */
73
104
74
/*
105
/*
75
 *	This is an Ethernet frame header.
106
 *	This is an Ethernet frame header.
Lines 80-85 struct ethhdr Link Here
80
  unsigned char	h_dest[ETH_ALEN];	/* destination eth addr	*/
111
  unsigned char	h_dest[ETH_ALEN];	/* destination eth addr	*/
81
  unsigned char	h_source[ETH_ALEN];	/* source ether addr	*/
112
  unsigned char	h_source[ETH_ALEN];	/* source ether addr	*/
82
  unsigned short int h_proto;		/* packet type ID field	*/
113
  unsigned short int h_proto;		/* packet type ID field	*/
83
};
114
} __attribute__((packed));
84
115
85
#endif	/* net/if_ether.h */
116
#endif	/* net/if_ether.h */
(-)a/sysdeps/unix/sysv/linux/netinet/if_ether.h (-2 / +1 lines)
Lines 22-29 Link Here
22
#include <features.h>
22
#include <features.h>
23
#include <sys/types.h>
23
#include <sys/types.h>
24
24
25
/* Get definitions from kernel header file.  */
25
#include <net/if_ether.h>
26
#include <linux/if_ether.h>
27
26
28
#ifdef __USE_BSD
27
#ifdef __USE_BSD
29
/*
28
/*
(-)a/sysdeps/mach/hurd/Makefile (-5 lines)
Lines 206-214 ifeq ($(subdir),sunrpc) Link Here
206
sysdep_headers += nfs/nfs.h
206
sysdep_headers += nfs/nfs.h
207
endif
207
endif
208
208
209
ifeq ($(subdir),socket)
210
sysdep_headers += net/ethernet.h net/if_arp.h net/if_ether.h net/if_ppp.h \
211
		  net/route.h
212
endif
213
214
endif	# in-Makerules
209
endif	# in-Makerules
(-)a/sysdeps/mach/hurd/net/ethernet.h (-76 lines)
Lines 1-76 Link Here
1
/* Copyright (C) 1997 Free Software Foundation, Inc.
2
   This file is part of the GNU C Library.
3
4
   The GNU C Library is free software; you can redistribute it and/or
5
   modify it under the terms of the GNU Lesser General Public
6
   License as published by the Free Software Foundation; either
7
   version 2.1 of the License, or (at your option) any later version.
8
9
   The GNU C Library is distributed in the hope that it will be useful,
10
   but WITHOUT ANY WARRANTY; without even the implied warranty of
11
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
   Lesser General Public License for more details.
13
14
   You should have received a copy of the GNU Lesser General Public
15
   License along with the GNU C Library; if not, write to the Free
16
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17
   02111-1307 USA.  */
18
19
/* Based on the FreeBSD version of this file. Curiously, that file
20
   lacks a copyright in the header. */
21
22
#ifndef __NET_ETHERNET_H
23
#define __NET_ETHERNET_H 1
24
25
#include <sys/cdefs.h>
26
#include <sys/types.h>
27
#include <net/if_ether.h>     /* IEEE 802.3 Ethernet constants */
28
29
__BEGIN_DECLS
30
31
/* This is a name for the 48 bit ethernet address available on many
32
   systems.  */
33
struct ether_addr
34
{
35
  u_int8_t ether_addr_octet[ETH_ALEN];
36
};
37
38
/* 10Mb/s ethernet header */
39
struct ether_header
40
{
41
  u_int8_t  ether_dhost[ETH_ALEN];	/* destination eth addr	*/
42
  u_int8_t  ether_shost[ETH_ALEN];	/* source ether addr	*/
43
  u_int16_t ether_type;		        /* packet type ID field	*/
44
};
45
46
/* Ethernet protocol ID's */
47
#define	ETHERTYPE_PUP		0x0200          /* Xerox PUP */
48
#define	ETHERTYPE_IP		0x0800		/* IP */
49
#define	ETHERTYPE_ARP		0x0806		/* Address resolution */
50
#define	ETHERTYPE_REVARP	0x8035		/* Reverse ARP */
51
52
#define	ETHER_ADDR_LEN	ETH_ALEN                 /* size of ethernet addr */
53
#define	ETHER_TYPE_LEN	2                        /* bytes in type field */
54
#define	ETHER_CRC_LEN	4                        /* bytes in CRC field */
55
#define	ETHER_HDR_LEN	ETH_HLEN                 /* total octets in header */
56
#define	ETHER_MIN_LEN	(ETH_ZLEN + ETH_CRC_LEN) /* min packet length */
57
#define	ETHER_MAX_LEN	(ETH_FRAME_LEN + ETH_CRC_LEN) /* max packet length */
58
59
/* make sure ethenet length is valid */
60
#define	ETHER_IS_VALID_LEN(foo)	\
61
	((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN)
62
63
/*
64
 * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
65
 * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
66
 * by an ETHER type (as given above) and then the (variable-length) header.
67
 */
68
#define	ETHERTYPE_TRAIL		0x1000		/* Trailer packet */
69
#define	ETHERTYPE_NTRAILER	16
70
71
#define	ETHERMTU	ETH_DATA_LEN
72
#define	ETHERMIN	(ETHER_MIN_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN)
73
74
__END_DECLS
75
76
#endif /* net/ethernet.h */
(-)a/sysdeps/mach/hurd/net/if_arp.h (-145 lines)
Lines 1-145 Link Here
1
/* Definitions for Address Resolution Protocol.
2
   Copyright (C) 1997 Free Software Foundation, Inc.
3
   This file is part of the GNU C Library.
4
   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
5
6
   The GNU C Library is free software; you can redistribute it and/or
7
   modify it under the terms of the GNU Lesser General Public
8
   License as published by the Free Software Foundation; either
9
   version 2.1 of the License, or (at your option) any later version.
10
11
   The GNU C Library is distributed in the hope that it will be useful,
12
   but WITHOUT ANY WARRANTY; without even the implied warranty of
13
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
   Lesser General Public License for more details.
15
16
   You should have received a copy of the GNU Lesser General Public
17
   License along with the GNU C Library; if not, write to the Free
18
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19
   02111-1307 USA.  */
20
21
/* Based on the 4.4BSD and Linux version of this file.  */
22
23
#ifndef _NET_IF_ARP_H
24
25
#define _NET_IF_ARP_H 1
26
#include <sys/cdefs.h>
27
28
#include <sys/types.h>
29
#include <sys/socket.h>
30
31
__BEGIN_DECLS
32
33
/* Some internals from deep down in the kernel.  */
34
#define MAX_ADDR_LEN	7
35
36
37
/* This structure defines an ethernet arp header.  */
38
39
/* ARP protocol opcodes. */
40
#define	ARPOP_REQUEST	1		/* ARP request.  */
41
#define	ARPOP_REPLY	2		/* ARP reply.  */
42
#define	ARPOP_RREQUEST	3		/* RARP request.  */
43
#define	ARPOP_RREPLY	4		/* RARP reply.  */
44
45
/* See RFC 826 for protocol description.  ARP packets are variable
46
   in size; the arphdr structure defines the fixed-length portion.
47
   Protocol type values are the same as those for 10 Mb/s Ethernet.
48
   It is followed by the variable-sized fields ar_sha, arp_spa,
49
   arp_tha and arp_tpa in that order, according to the lengths
50
   specified.  Field names used correspond to RFC 826.  */
51
52
struct arphdr
53
  {
54
    unsigned short int ar_hrd;		/* Format of hardware address.  */
55
    unsigned short int ar_pro;		/* Format of protocol address.  */
56
    unsigned char ar_hln;		/* Length of hardware address.  */
57
    unsigned char ar_pln;		/* Length of protocol address.  */
58
    unsigned short int ar_op;		/* ARP opcode (command).  */
59
#if 0
60
    /* Ethernet looks like this : This bit is variable sized
61
       however...  */
62
    unsigned char __ar_sha[ETH_ALEN];	/* Sender hardware address.  */
63
    unsigned char __ar_sip[4];		/* Sender IP address.  */
64
    unsigned char __ar_tha[ETH_ALEN];	/* Target hardware address.  */
65
    unsigned char __ar_tip[4];		/* Target IP address.  */
66
#endif
67
  };
68
69
70
/* ARP protocol HARDWARE identifiers. */
71
#define ARPHRD_NETROM	0		/* From KA9Q: NET/ROM pseudo. */
72
#define ARPHRD_ETHER 	1		/* Ethernet 10Mbps.  */
73
#define	ARPHRD_EETHER	2		/* Experimental Ethernet.  */
74
#define	ARPHRD_AX25	3		/* AX.25 Level 2.  */
75
#define	ARPHRD_PRONET	4		/* PROnet token ring.  */
76
#define	ARPHRD_CHAOS	5		/* Chaosnet.  */
77
#define	ARPHRD_IEEE802	6		/* IEEE 802.2 Ethernet/TR/TB.  */
78
#define	ARPHRD_ARCNET	7		/* ARCnet.  */
79
#define	ARPHRD_APPLETLK	8		/* APPLEtalk.  */
80
#define ARPHRD_DLCI	15		/* Frame Relay DLCI.  */
81
#define ARPHRD_METRICOM	23		/* Metricom STRIP (new IANA id).  */
82
83
/* Dummy types for non ARP hardware */
84
#define ARPHRD_SLIP	256
85
#define ARPHRD_CSLIP	257
86
#define ARPHRD_SLIP6	258
87
#define ARPHRD_CSLIP6	259
88
#define ARPHRD_RSRVD	260		/* Notional KISS type.  */
89
#define ARPHRD_ADAPT	264
90
#define ARPHRD_ROSE	270
91
#define ARPHRD_X25	271		/* CCITT X.25.  */
92
#define ARPHRD_PPP	512
93
#define ARPHRD_HDLC	513		/* (Cisco) HDLC.  */
94
#define ARPHRD_LAPB	516		/* LAPB.  */
95
96
#define ARPHRD_TUNNEL	768		/* IPIP tunnel.  */
97
#define ARPHRD_TUNNEL6	769		/* IPIP6 tunnel.  */
98
#define ARPHRD_FRAD	770             /* Frame Relay Access Device.  */
99
#define ARPHRD_SKIP	771		/* SKIP vif.  */
100
#define ARPHRD_LOOPBACK	772		/* Loopback device.  */
101
#define ARPHRD_LOCALTLK 773		/* Localtalk device.  */
102
#define ARPHRD_FDDI	774		/* Fiber Distributed Data Interface. */
103
#define ARPHRD_BIF      775             /* AP1000 BIF.  */
104
#define ARPHRD_SIT	776		/* sit0 device - IPv6-in-IPv4.  */
105
106
107
/* ARP ioctl request.  */
108
struct arpreq
109
  {
110
    struct sockaddr arp_pa;		/* Protocol address.  */
111
    struct sockaddr arp_ha;		/* Hardware address.  */
112
    int arp_flags;			/* Flags.  */
113
    struct sockaddr arp_netmask;	/* Netmask (only for proxy arps).  */
114
    char arp_dev[16];
115
  };
116
117
/* ARP Flag values.  */
118
#define ATF_COM		0x02		/* Completed entry (ha valid).  */
119
#define	ATF_PERM	0x04		/* Permanent entry.  */
120
#define	ATF_PUBL	0x08		/* Publish entry.  */
121
#define	ATF_USETRAILERS	0x10		/* Has requested trailers.  */
122
#define ATF_NETMASK     0x20            /* Want to use a netmask (only
123
					   for proxy entries).  */
124
#define ATF_DONTPUB	0x40		/* Don't answer this addresses.  */
125
#define ATF_MAGIC	0x80		/* Automatically added entry.  */
126
127
128
/* Support for the user space arp daemon, arpd.  */
129
#define ARPD_UPDATE	0x01
130
#define ARPD_LOOKUP	0x02
131
#define ARPD_FLUSH	0x03
132
133
struct arpd_request
134
  {
135
    unsigned short int req;		/* Request type.  */
136
    u_int32_t ip;			/* IP address of entry.  */
137
    unsigned long int dev;		/* Device entry is tied to.  */
138
    unsigned long int stamp;
139
    unsigned long int updated;
140
    unsigned char ha[MAX_ADDR_LEN];	/* Hardware address.  */
141
  };
142
143
__END_DECLS
144
145
#endif	/* net/if_arp.h */
(-)a/sysdeps/mach/hurd/net/route.h (-141 lines)
Lines 1-141 Link Here
1
/* Copyright (C) 1997 Free Software Foundation, Inc..
2
   This file is part of the GNU C Library.
3
4
   The GNU C Library is free software; you can redistribute it and/or
5
   modify it under the terms of the GNU Lesser General Public
6
   License as published by the Free Software Foundation; either
7
   version 2.1 of the License, or (at your option) any later version.
8
9
   The GNU C Library is distributed in the hope that it will be useful,
10
   but WITHOUT ANY WARRANTY; without even the implied warranty of
11
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
   Lesser General Public License for more details.
13
14
   You should have received a copy of the GNU Lesser General Public
15
   License along with the GNU C Library; if not, write to the Free
16
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17
   02111-1307 USA.  */
18
19
/* Based on the 4.4BSD and Linux version of this file.  */
20
21
#ifndef _NET_ROUTE_H
22
23
#define _NET_ROUTE_H	1
24
#include <features.h>
25
26
#include <sys/socket.h>
27
#include <sys/types.h>
28
#include <netinet/in.h>
29
30
31
/* This structure gets passed by the SIOCADDRT and SIOCDELRT calls. */
32
struct rtentry
33
  {
34
    unsigned long int rt_pad1;
35
    struct sockaddr rt_dst;		/* Target address.  */
36
    struct sockaddr rt_gateway;		/* Gateway addr (RTF_GATEWAY).  */
37
    struct sockaddr rt_genmask;		/* Target network mask (IP).  */
38
    unsigned short int rt_flags;
39
    short int rt_pad2;
40
    unsigned long int rt_pad3;
41
    unsigned char rt_tos;
42
    unsigned char rt_class;
43
    short int rt_pad4;
44
    short int rt_metric;		/* +1 for binary compatibility!  */
45
    char *rt_dev;			/* Forcing the device at add.  */
46
    unsigned long int rt_mtu;		/* Per route MTU/Window.  */
47
    unsigned long int rt_window;	/* Window clamping.  */
48
    unsigned short int rt_irtt;		/* Initial RTT.  */
49
  };
50
/* Compatibility hack.  */
51
#define rt_mss	rt_mtu
52
53
54
struct in6_rtmsg
55
  {
56
    struct in6_addr rtmsg_dst;
57
    struct in6_addr rtmsg_src;
58
    struct in6_addr rtmsg_gateway;
59
    u_int32_t rtmsg_type;
60
    u_int16_t rtmsg_dst_len;
61
    u_int16_t rtmsg_src_len;
62
    u_int32_t rtmsg_metric;
63
    unsigned long int rtmsg_info;
64
    u_int32_t rtmsg_flags;
65
    int rtmsg_ifindex;
66
  };
67
68
69
#define	RTF_UP		0x0001		/* Route usable.  */
70
#define	RTF_GATEWAY	0x0002		/* Destination is a gateway.  */
71
72
#define	RTF_HOST	0x0004		/* Host entry (net otherwise).  */
73
#define RTF_REINSTATE	0x0008		/* Reinstate route after timeout.  */
74
#define	RTF_DYNAMIC	0x0010		/* Created dyn. (by redirect).  */
75
#define	RTF_MODIFIED	0x0020		/* Modified dyn. (by redirect).  */
76
#define RTF_MTU		0x0040		/* Specific MTU for this route.  */
77
#define RTF_MSS		RTF_MTU		/* Compatibility.  */
78
#define RTF_WINDOW	0x0080		/* Per route window clamping.  */
79
#define RTF_IRTT	0x0100		/* Initial round trip time.  */
80
#define RTF_REJECT	0x0200		/* Reject route.  */
81
#define	RTF_STATIC	0x0400		/* Manually injected route.  */
82
#define	RTF_XRESOLVE	0x0800		/* External resolver.  */
83
#define RTF_NOFORWARD   0x1000		/* Forwarding inhibited.  */
84
#define RTF_THROW	0x2000		/* Go to next class.  */
85
#define RTF_NOPMTUDISC  0x4000		/* Do not send packets with DF.  */
86
87
/* for IPv6 */
88
#define RTF_DEFAULT	0x00010000	/* default - learned via ND	*/
89
#define RTF_ALLONLINK	0x00020000	/* fallback, no routers on link	*/
90
#define RTF_ADDRCONF	0x00040000	/* addrconf route - RA		*/
91
92
#define RTF_LINKRT	0x00100000	/* link specific - device match	*/
93
#define RTF_NONEXTHOP	0x00200000	/* route with no nexthop	*/
94
95
#define RTF_CACHE	0x01000000	/* cache entry			*/
96
#define RTF_FLOW	0x02000000	/* flow significant route	*/
97
#define RTF_POLICY	0x04000000	/* policy route			*/
98
99
#define RTCF_VALVE	0x00200000
100
#define RTCF_MASQ	0x00400000
101
#define RTCF_NAT	0x00800000
102
#define RTCF_DOREDIRECT 0x01000000
103
#define RTCF_LOG	0x02000000
104
#define RTCF_DIRECTSRC	0x04000000
105
106
#define RTF_LOCAL	0x80000000
107
#define RTF_INTERFACE	0x40000000
108
#define RTF_MULTICAST	0x20000000
109
#define RTF_BROADCAST	0x10000000
110
#define RTF_NAT		0x08000000
111
112
#define RTF_ADDRCLASSMASK	0xF8000000
113
#define RT_ADDRCLASS(flags)	((__u_int32_t) flags >> 23)
114
115
#define RT_TOS(tos)		((tos) & IPTOS_TOS_MASK)
116
117
#define RT_LOCALADDR(flags)	((flags & RTF_ADDRCLASSMASK) \
118
				 == (RTF_LOCAL|RTF_INTERFACE))
119
120
#define RT_CLASS_UNSPEC		0
121
#define RT_CLASS_DEFAULT	253
122
123
#define RT_CLASS_MAIN		254
124
#define RT_CLASS_LOCAL		255
125
#define RT_CLASS_MAX		255
126
127
128
#define RTMSG_ACK		NLMSG_ACK
129
#define RTMSG_OVERRUN		NLMSG_OVERRUN
130
131
#define RTMSG_NEWDEVICE		0x11
132
#define RTMSG_DELDEVICE		0x12
133
#define RTMSG_NEWROUTE		0x21
134
#define RTMSG_DELROUTE		0x22
135
#define RTMSG_NEWRULE		0x31
136
#define RTMSG_DELRULE		0x32
137
#define RTMSG_CONTROL		0x40
138
139
#define RTMSG_AR_FAILED		0x51	/* Address Resolution failed.  */
140
141
#endif /* net/route.h */
(-)a/sysdeps/unix/sysv/linux/Makefile (-2 / +1 lines)
Lines 101-108 sysdep_routines += ntp_gettime ntp_gettimex Link Here
101
endif
101
endif
102
102
103
ifeq ($(subdir),socket)
103
ifeq ($(subdir),socket)
104
sysdep_headers += net/if_ppp.h net/ppp-comp.h \
104
sysdep_headers += net/ppp-comp.h net/ppp_defs.h \
105
		  net/ppp_defs.h net/if_arp.h net/route.h net/ethernet.h \
106
		  net/if_slip.h net/if_packet.h net/if_shaper.h
105
		  net/if_slip.h net/if_packet.h net/if_shaper.h
107
sysdep_routines += cmsg_nxthdr sa_len
106
sysdep_routines += cmsg_nxthdr sa_len
108
endif
107
endif
(-)a/sysdeps/unix/sysv/linux/net/if_ether.h (+7 lines)
Line 0 Link Here
1
#ifndef _NET_IF_ETHER_H
2
#define _NET_IF_ETHER_H 1
3
4
/* Get definitions from kernel header file.  */
5
#include <linux/if_ether.h>
6
7
#endif /* net/if_ether.h */
(-)a/sysdeps/unix/sysv/linux/net/if_ppp.h (-169 lines)
Lines 1-169 Link Here
1
/*	From: if_ppp.h,v 1.3 1995/06/12 11:36:50 paulus Exp */
2
3
/*
4
 * if_ppp.h - Point-to-Point Protocol definitions.
5
 *
6
 * Copyright (c) 1989 Carnegie Mellon University. 
7
 *
8
 * Redistribution and use in source and binary forms, with or without
9
 * modification, are permitted provided that the following conditions
10
 * are met:
11
 * 1. Redistributions of source code must retain the above copyright
12
 *    notice, this list of conditions and the following disclaimer.
13
 * 2. Redistributions in binary form must reproduce the above copyright
14
 *    notice, this list of conditions and the following disclaimer in the
15
 *    documentation and/or other materials provided with the distribution.
16
 * 3. Neither the name of the University nor the names of its contributors
17
 *    may be used to endorse or promote products derived from this software
18
 *    without specific prior written permission.
19
 *
20
 * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY AND
21
 * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24
 * IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE FOR ANY
25
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
27
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
29
 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
30
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
31
 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
 *
33
 */
34
35
/*
36
 *  ==FILEVERSION 960926==
37
 *
38
 *  NOTE TO MAINTAINERS:
39
 *     If you modify this file at all, please set the above date.
40
 *     if_ppp.h is shipped with a PPP distribution as well as with the kernel;
41
 *     if everyone increases the FILEVERSION number above, then scripts
42
 *     can do the right thing when deciding whether to install a new if_ppp.h
43
 *     file.  Don't change the format of that line otherwise, so the
44
 *     installation script can recognize it.
45
 */
46
47
48
#ifndef __NET_IF_PPP_H
49
#define __NET_IF_PPP_H 1
50
51
#include <sys/types.h>
52
#include <sys/cdefs.h>
53
54
#include <net/if.h>
55
#include <sys/ioctl.h>
56
#include <net/ppp_defs.h>
57
58
__BEGIN_DECLS
59
60
/*
61
 * Packet sizes
62
 */
63
64
#define	PPP_MTU		1500	/* Default MTU (size of Info field) */
65
#define PPP_MAXMRU	65000	/* Largest MRU we allow */
66
#define PPP_VERSION	"2.2.0"
67
#define PPP_MAGIC	0x5002	/* Magic value for the ppp structure */
68
#define PROTO_IPX	0x002b	/* protocol numbers */
69
#define PROTO_DNA_RT    0x0027  /* DNA Routing */
70
71
72
/*
73
 * Bit definitions for flags.
74
 */
75
76
#define SC_COMP_PROT	0x00000001	/* protocol compression (output) */
77
#define SC_COMP_AC	0x00000002	/* header compression (output) */
78
#define	SC_COMP_TCP	0x00000004	/* TCP (VJ) compression (output) */
79
#define SC_NO_TCP_CCID	0x00000008	/* disable VJ connection-id comp. */
80
#define SC_REJ_COMP_AC	0x00000010	/* reject adrs/ctrl comp. on input */
81
#define SC_REJ_COMP_TCP	0x00000020	/* reject TCP (VJ) comp. on input */
82
#define SC_CCP_OPEN	0x00000040	/* Look at CCP packets */
83
#define SC_CCP_UP	0x00000080	/* May send/recv compressed packets */
84
#define SC_ENABLE_IP	0x00000100	/* IP packets may be exchanged */
85
#define SC_COMP_RUN	0x00001000	/* compressor has been inited */
86
#define SC_DECOMP_RUN	0x00002000	/* decompressor has been inited */
87
#define SC_DEBUG	0x00010000	/* enable debug messages */
88
#define SC_LOG_INPKT	0x00020000	/* log contents of good pkts recvd */
89
#define SC_LOG_OUTPKT	0x00040000	/* log contents of pkts sent */
90
#define SC_LOG_RAWIN	0x00080000	/* log all chars received */
91
#define SC_LOG_FLUSH	0x00100000	/* log all chars flushed */
92
#define	SC_MASK		0x0fE0ffff	/* bits that user can change */
93
94
/* state bits */
95
#define	SC_ESCAPED	0x80000000	/* saw a PPP_ESCAPE */
96
#define	SC_FLUSH	0x40000000	/* flush input until next PPP_FLAG */
97
#define SC_VJ_RESET	0x20000000	/* Need to reset the VJ decompressor */
98
#define SC_XMIT_BUSY	0x10000000	/* ppp_write_wakeup is active */
99
#define SC_RCV_ODDP	0x08000000	/* have rcvd char with odd parity */
100
#define SC_RCV_EVNP	0x04000000	/* have rcvd char with even parity */
101
#define SC_RCV_B7_1	0x02000000	/* have rcvd char with bit 7 = 1 */
102
#define SC_RCV_B7_0	0x01000000	/* have rcvd char with bit 7 = 0 */
103
#define SC_DC_FERROR	0x00800000	/* fatal decomp error detected */
104
#define SC_DC_ERROR	0x00400000	/* non-fatal decomp error detected */
105
106
/*
107
 * Ioctl definitions.
108
 */
109
110
struct npioctl {
111
    int		protocol;	/* PPP protocol, e.g. PPP_IP */
112
    enum NPmode	mode;
113
};
114
115
/* Structure describing a CCP configuration option, for PPPIOCSCOMPRESS */
116
struct ppp_option_data {
117
	u_int8_t  *ptr;
118
	u_int32_t length;
119
	int	  transmit;
120
};
121
122
struct ifpppstatsreq {
123
  struct ifreq	   b;
124
  struct ppp_stats stats;			/* statistic information */
125
};
126
127
struct ifpppcstatsreq {
128
  struct ifreq		b;
129
  struct ppp_comp_stats stats;
130
};
131
132
#define ifr__name       b.ifr_ifrn.ifrn_name
133
#define stats_ptr       b.ifr_ifru.ifru_data
134
135
/*
136
 * Ioctl definitions.
137
 */
138
139
#define	PPPIOCGFLAGS	_IOR('t', 90, int)	/* get configuration flags */
140
#define	PPPIOCSFLAGS	_IOW('t', 89, int)	/* set configuration flags */
141
#define	PPPIOCGASYNCMAP	_IOR('t', 88, int)	/* get async map */
142
#define	PPPIOCSASYNCMAP	_IOW('t', 87, int)	/* set async map */
143
#define	PPPIOCGUNIT	_IOR('t', 86, int)	/* get ppp unit number */
144
#define	PPPIOCGRASYNCMAP _IOR('t', 85, int)	/* get receive async map */
145
#define	PPPIOCSRASYNCMAP _IOW('t', 84, int)	/* set receive async map */
146
#define	PPPIOCGMRU	_IOR('t', 83, int)	/* get max receive unit */
147
#define	PPPIOCSMRU	_IOW('t', 82, int)	/* set max receive unit */
148
#define	PPPIOCSMAXCID	_IOW('t', 81, int)	/* set VJ max slot ID */
149
#define PPPIOCGXASYNCMAP _IOR('t', 80, ext_accm) /* get extended ACCM */
150
#define PPPIOCSXASYNCMAP _IOW('t', 79, ext_accm) /* set extended ACCM */
151
#define PPPIOCXFERUNIT	_IO('t', 78)		/* transfer PPP unit */
152
#define PPPIOCSCOMPRESS	_IOW('t', 77, struct ppp_option_data)
153
#define PPPIOCGNPMODE	_IOWR('t', 76, struct npioctl) /* get NP mode */
154
#define PPPIOCSNPMODE	_IOW('t', 75, struct npioctl)  /* set NP mode */
155
#define PPPIOCGDEBUG	_IOR('t', 65, int)	/* Read debug level */
156
#define PPPIOCSDEBUG	_IOW('t', 64, int)	/* Set debug level */
157
#define PPPIOCGIDLE	_IOR('t', 63, struct ppp_idle) /* get idle time */
158
159
#define SIOCGPPPSTATS   (SIOCDEVPRIVATE + 0)
160
#define SIOCGPPPVER     (SIOCDEVPRIVATE + 1)  /* NEVER change this!! */
161
#define SIOCGPPPCSTATS  (SIOCDEVPRIVATE + 2)
162
163
#if !defined(ifr_mtu)
164
#define ifr_mtu	ifr_ifru.ifru_metric
165
#endif
166
167
__END_DECLS
168
169
#endif /* net/if_ppp.h */

Return to bug 11142