xref: /utopia/UTPA2-700.0.x/projects/tools/lint/mips-linux-gnu_include/net/if_ppp.h (revision 53ee8cc121a030b8d368113ac3e966b4705770ef)
1*53ee8cc1Swenshuai.xi /*	From: if_ppp.h,v 1.3 1995/06/12 11:36:50 paulus Exp */
2*53ee8cc1Swenshuai.xi 
3*53ee8cc1Swenshuai.xi /*
4*53ee8cc1Swenshuai.xi  * if_ppp.h - Point-to-Point Protocol definitions.
5*53ee8cc1Swenshuai.xi  *
6*53ee8cc1Swenshuai.xi  * Copyright (c) 1989 Carnegie Mellon University.
7*53ee8cc1Swenshuai.xi  *
8*53ee8cc1Swenshuai.xi  * Redistribution and use in source and binary forms, with or without
9*53ee8cc1Swenshuai.xi  * modification, are permitted provided that the following conditions
10*53ee8cc1Swenshuai.xi  * are met:
11*53ee8cc1Swenshuai.xi  * 1. Redistributions of source code must retain the above copyright
12*53ee8cc1Swenshuai.xi  *    notice, this list of conditions and the following disclaimer.
13*53ee8cc1Swenshuai.xi  * 2. Redistributions in binary form must reproduce the above copyright
14*53ee8cc1Swenshuai.xi  *    notice, this list of conditions and the following disclaimer in the
15*53ee8cc1Swenshuai.xi  *    documentation and/or other materials provided with the distribution.
16*53ee8cc1Swenshuai.xi  * 3. Neither the name of the University nor the names of its contributors
17*53ee8cc1Swenshuai.xi  *    may be used to endorse or promote products derived from this software
18*53ee8cc1Swenshuai.xi  *    without specific prior written permission.
19*53ee8cc1Swenshuai.xi  *
20*53ee8cc1Swenshuai.xi  * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY AND
21*53ee8cc1Swenshuai.xi  * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22*53ee8cc1Swenshuai.xi  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23*53ee8cc1Swenshuai.xi  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24*53ee8cc1Swenshuai.xi  * IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE FOR ANY
25*53ee8cc1Swenshuai.xi  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26*53ee8cc1Swenshuai.xi  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
27*53ee8cc1Swenshuai.xi  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28*53ee8cc1Swenshuai.xi  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
29*53ee8cc1Swenshuai.xi  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
30*53ee8cc1Swenshuai.xi  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
31*53ee8cc1Swenshuai.xi  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32*53ee8cc1Swenshuai.xi  *
33*53ee8cc1Swenshuai.xi  */
34*53ee8cc1Swenshuai.xi 
35*53ee8cc1Swenshuai.xi /*
36*53ee8cc1Swenshuai.xi  *  ==FILEVERSION 960926==
37*53ee8cc1Swenshuai.xi  *
38*53ee8cc1Swenshuai.xi  *  NOTE TO MAINTAINERS:
39*53ee8cc1Swenshuai.xi  *     If you modify this file at all, please set the above date.
40*53ee8cc1Swenshuai.xi  *     if_ppp.h is shipped with a PPP distribution as well as with the kernel;
41*53ee8cc1Swenshuai.xi  *     if everyone increases the FILEVERSION number above, then scripts
42*53ee8cc1Swenshuai.xi  *     can do the right thing when deciding whether to install a new if_ppp.h
43*53ee8cc1Swenshuai.xi  *     file.  Don't change the format of that line otherwise, so the
44*53ee8cc1Swenshuai.xi  *     installation script can recognize it.
45*53ee8cc1Swenshuai.xi  */
46*53ee8cc1Swenshuai.xi 
47*53ee8cc1Swenshuai.xi 
48*53ee8cc1Swenshuai.xi #ifndef __NET_IF_PPP_H
49*53ee8cc1Swenshuai.xi #define __NET_IF_PPP_H 1
50*53ee8cc1Swenshuai.xi 
51*53ee8cc1Swenshuai.xi #include <sys/types.h>
52*53ee8cc1Swenshuai.xi #include <sys/cdefs.h>
53*53ee8cc1Swenshuai.xi 
54*53ee8cc1Swenshuai.xi #include <net/if.h>
55*53ee8cc1Swenshuai.xi #include <sys/ioctl.h>
56*53ee8cc1Swenshuai.xi #include <net/ppp_defs.h>
57*53ee8cc1Swenshuai.xi 
58*53ee8cc1Swenshuai.xi __BEGIN_DECLS
59*53ee8cc1Swenshuai.xi 
60*53ee8cc1Swenshuai.xi /*
61*53ee8cc1Swenshuai.xi  * Packet sizes
62*53ee8cc1Swenshuai.xi  */
63*53ee8cc1Swenshuai.xi 
64*53ee8cc1Swenshuai.xi #define	PPP_MTU		1500	/* Default MTU (size of Info field) */
65*53ee8cc1Swenshuai.xi #define PPP_MAXMRU	65000	/* Largest MRU we allow */
66*53ee8cc1Swenshuai.xi #define PPP_VERSION	"2.2.0"
67*53ee8cc1Swenshuai.xi #define PPP_MAGIC	0x5002	/* Magic value for the ppp structure */
68*53ee8cc1Swenshuai.xi #define PROTO_IPX	0x002b	/* protocol numbers */
69*53ee8cc1Swenshuai.xi #define PROTO_DNA_RT    0x0027  /* DNA Routing */
70*53ee8cc1Swenshuai.xi 
71*53ee8cc1Swenshuai.xi 
72*53ee8cc1Swenshuai.xi /*
73*53ee8cc1Swenshuai.xi  * Bit definitions for flags.
74*53ee8cc1Swenshuai.xi  */
75*53ee8cc1Swenshuai.xi 
76*53ee8cc1Swenshuai.xi #define SC_COMP_PROT	0x00000001	/* protocol compression (output) */
77*53ee8cc1Swenshuai.xi #define SC_COMP_AC	0x00000002	/* header compression (output) */
78*53ee8cc1Swenshuai.xi #define	SC_COMP_TCP	0x00000004	/* TCP (VJ) compression (output) */
79*53ee8cc1Swenshuai.xi #define SC_NO_TCP_CCID	0x00000008	/* disable VJ connection-id comp. */
80*53ee8cc1Swenshuai.xi #define SC_REJ_COMP_AC	0x00000010	/* reject adrs/ctrl comp. on input */
81*53ee8cc1Swenshuai.xi #define SC_REJ_COMP_TCP	0x00000020	/* reject TCP (VJ) comp. on input */
82*53ee8cc1Swenshuai.xi #define SC_CCP_OPEN	0x00000040	/* Look at CCP packets */
83*53ee8cc1Swenshuai.xi #define SC_CCP_UP	0x00000080	/* May send/recv compressed packets */
84*53ee8cc1Swenshuai.xi #define SC_ENABLE_IP	0x00000100	/* IP packets may be exchanged */
85*53ee8cc1Swenshuai.xi #define SC_COMP_RUN	0x00001000	/* compressor has been inited */
86*53ee8cc1Swenshuai.xi #define SC_DECOMP_RUN	0x00002000	/* decompressor has been inited */
87*53ee8cc1Swenshuai.xi #define SC_DEBUG	0x00010000	/* enable debug messages */
88*53ee8cc1Swenshuai.xi #define SC_LOG_INPKT	0x00020000	/* log contents of good pkts recvd */
89*53ee8cc1Swenshuai.xi #define SC_LOG_OUTPKT	0x00040000	/* log contents of pkts sent */
90*53ee8cc1Swenshuai.xi #define SC_LOG_RAWIN	0x00080000	/* log all chars received */
91*53ee8cc1Swenshuai.xi #define SC_LOG_FLUSH	0x00100000	/* log all chars flushed */
92*53ee8cc1Swenshuai.xi #define	SC_MASK		0x0fE0ffff	/* bits that user can change */
93*53ee8cc1Swenshuai.xi 
94*53ee8cc1Swenshuai.xi /* state bits */
95*53ee8cc1Swenshuai.xi #define	SC_ESCAPED	0x80000000	/* saw a PPP_ESCAPE */
96*53ee8cc1Swenshuai.xi #define	SC_FLUSH	0x40000000	/* flush input until next PPP_FLAG */
97*53ee8cc1Swenshuai.xi #define SC_VJ_RESET	0x20000000	/* Need to reset the VJ decompressor */
98*53ee8cc1Swenshuai.xi #define SC_XMIT_BUSY	0x10000000	/* ppp_write_wakeup is active */
99*53ee8cc1Swenshuai.xi #define SC_RCV_ODDP	0x08000000	/* have rcvd char with odd parity */
100*53ee8cc1Swenshuai.xi #define SC_RCV_EVNP	0x04000000	/* have rcvd char with even parity */
101*53ee8cc1Swenshuai.xi #define SC_RCV_B7_1	0x02000000	/* have rcvd char with bit 7 = 1 */
102*53ee8cc1Swenshuai.xi #define SC_RCV_B7_0	0x01000000	/* have rcvd char with bit 7 = 0 */
103*53ee8cc1Swenshuai.xi #define SC_DC_FERROR	0x00800000	/* fatal decomp error detected */
104*53ee8cc1Swenshuai.xi #define SC_DC_ERROR	0x00400000	/* non-fatal decomp error detected */
105*53ee8cc1Swenshuai.xi 
106*53ee8cc1Swenshuai.xi /*
107*53ee8cc1Swenshuai.xi  * Ioctl definitions.
108*53ee8cc1Swenshuai.xi  */
109*53ee8cc1Swenshuai.xi 
110*53ee8cc1Swenshuai.xi struct npioctl {
111*53ee8cc1Swenshuai.xi     int		protocol;	/* PPP protocol, e.g. PPP_IP */
112*53ee8cc1Swenshuai.xi     enum NPmode	mode;
113*53ee8cc1Swenshuai.xi };
114*53ee8cc1Swenshuai.xi 
115*53ee8cc1Swenshuai.xi /* Structure describing a CCP configuration option, for PPPIOCSCOMPRESS */
116*53ee8cc1Swenshuai.xi struct ppp_option_data {
117*53ee8cc1Swenshuai.xi 	u_int8_t  *ptr;
118*53ee8cc1Swenshuai.xi 	u_int32_t length;
119*53ee8cc1Swenshuai.xi 	int	  transmit;
120*53ee8cc1Swenshuai.xi };
121*53ee8cc1Swenshuai.xi 
122*53ee8cc1Swenshuai.xi struct ifpppstatsreq {
123*53ee8cc1Swenshuai.xi   struct ifreq	   b;
124*53ee8cc1Swenshuai.xi   struct ppp_stats stats;			/* statistic information */
125*53ee8cc1Swenshuai.xi };
126*53ee8cc1Swenshuai.xi 
127*53ee8cc1Swenshuai.xi struct ifpppcstatsreq {
128*53ee8cc1Swenshuai.xi   struct ifreq		b;
129*53ee8cc1Swenshuai.xi   struct ppp_comp_stats stats;
130*53ee8cc1Swenshuai.xi };
131*53ee8cc1Swenshuai.xi 
132*53ee8cc1Swenshuai.xi #define ifr__name       b.ifr_ifrn.ifrn_name
133*53ee8cc1Swenshuai.xi #define stats_ptr       b.ifr_ifru.ifru_data
134*53ee8cc1Swenshuai.xi 
135*53ee8cc1Swenshuai.xi /*
136*53ee8cc1Swenshuai.xi  * Ioctl definitions.
137*53ee8cc1Swenshuai.xi  */
138*53ee8cc1Swenshuai.xi 
139*53ee8cc1Swenshuai.xi #define	PPPIOCGFLAGS	_IOR('t', 90, int)	/* get configuration flags */
140*53ee8cc1Swenshuai.xi #define	PPPIOCSFLAGS	_IOW('t', 89, int)	/* set configuration flags */
141*53ee8cc1Swenshuai.xi #define	PPPIOCGASYNCMAP	_IOR('t', 88, int)	/* get async map */
142*53ee8cc1Swenshuai.xi #define	PPPIOCSASYNCMAP	_IOW('t', 87, int)	/* set async map */
143*53ee8cc1Swenshuai.xi #define	PPPIOCGUNIT	_IOR('t', 86, int)	/* get ppp unit number */
144*53ee8cc1Swenshuai.xi #define	PPPIOCGRASYNCMAP _IOR('t', 85, int)	/* get receive async map */
145*53ee8cc1Swenshuai.xi #define	PPPIOCSRASYNCMAP _IOW('t', 84, int)	/* set receive async map */
146*53ee8cc1Swenshuai.xi #define	PPPIOCGMRU	_IOR('t', 83, int)	/* get max receive unit */
147*53ee8cc1Swenshuai.xi #define	PPPIOCSMRU	_IOW('t', 82, int)	/* set max receive unit */
148*53ee8cc1Swenshuai.xi #define	PPPIOCSMAXCID	_IOW('t', 81, int)	/* set VJ max slot ID */
149*53ee8cc1Swenshuai.xi #define PPPIOCGXASYNCMAP _IOR('t', 80, ext_accm) /* get extended ACCM */
150*53ee8cc1Swenshuai.xi #define PPPIOCSXASYNCMAP _IOW('t', 79, ext_accm) /* set extended ACCM */
151*53ee8cc1Swenshuai.xi #define PPPIOCXFERUNIT	_IO('t', 78)		/* transfer PPP unit */
152*53ee8cc1Swenshuai.xi #define PPPIOCSCOMPRESS	_IOW('t', 77, struct ppp_option_data)
153*53ee8cc1Swenshuai.xi #define PPPIOCGNPMODE	_IOWR('t', 76, struct npioctl) /* get NP mode */
154*53ee8cc1Swenshuai.xi #define PPPIOCSNPMODE	_IOW('t', 75, struct npioctl)  /* set NP mode */
155*53ee8cc1Swenshuai.xi #define PPPIOCGDEBUG	_IOR('t', 65, int)	/* Read debug level */
156*53ee8cc1Swenshuai.xi #define PPPIOCSDEBUG	_IOW('t', 64, int)	/* Set debug level */
157*53ee8cc1Swenshuai.xi #define PPPIOCGIDLE	_IOR('t', 63, struct ppp_idle) /* get idle time */
158*53ee8cc1Swenshuai.xi 
159*53ee8cc1Swenshuai.xi #define SIOCGPPPSTATS   (SIOCDEVPRIVATE + 0)
160*53ee8cc1Swenshuai.xi #define SIOCGPPPVER     (SIOCDEVPRIVATE + 1)  /* NEVER change this!! */
161*53ee8cc1Swenshuai.xi #define SIOCGPPPCSTATS  (SIOCDEVPRIVATE + 2)
162*53ee8cc1Swenshuai.xi 
163*53ee8cc1Swenshuai.xi #if !defined(ifr_mtu)
164*53ee8cc1Swenshuai.xi #define ifr_mtu	ifr_ifru.ifru_metric
165*53ee8cc1Swenshuai.xi #endif
166*53ee8cc1Swenshuai.xi 
167*53ee8cc1Swenshuai.xi __END_DECLS
168*53ee8cc1Swenshuai.xi 
169*53ee8cc1Swenshuai.xi #endif /* net/if_ppp.h */
170