xref: /illumos-gate/usr/src/uts/common/net/ppp_defs.h (revision 7c478bd9)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*	$Id: ppp_defs.h,v 1.14 1999/08/13 01:55:40 paulus Exp $	*/
23*7c478bd9Sstevel@tonic-gate 
24*7c478bd9Sstevel@tonic-gate /*
25*7c478bd9Sstevel@tonic-gate  * ppp_defs.h - PPP definitions.
26*7c478bd9Sstevel@tonic-gate  *
27*7c478bd9Sstevel@tonic-gate  * Copyright 2000-2003 Sun Microsystems, Inc.  All rights reserved.
28*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
29*7c478bd9Sstevel@tonic-gate  *
30*7c478bd9Sstevel@tonic-gate  * Copyright (c) 1994 The Australian National University.
31*7c478bd9Sstevel@tonic-gate  * All rights reserved.
32*7c478bd9Sstevel@tonic-gate  *
33*7c478bd9Sstevel@tonic-gate  * Permission to use, copy, modify, and distribute this software and its
34*7c478bd9Sstevel@tonic-gate  * documentation is hereby granted, provided that the above copyright
35*7c478bd9Sstevel@tonic-gate  * notice appears in all copies.  This software is provided without any
36*7c478bd9Sstevel@tonic-gate  * warranty, express or implied. The Australian National University
37*7c478bd9Sstevel@tonic-gate  * makes no representations about the suitability of this software for
38*7c478bd9Sstevel@tonic-gate  * any purpose.
39*7c478bd9Sstevel@tonic-gate  *
40*7c478bd9Sstevel@tonic-gate  * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
41*7c478bd9Sstevel@tonic-gate  * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
42*7c478bd9Sstevel@tonic-gate  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
43*7c478bd9Sstevel@tonic-gate  * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
44*7c478bd9Sstevel@tonic-gate  * OF SUCH DAMAGE.
45*7c478bd9Sstevel@tonic-gate  *
46*7c478bd9Sstevel@tonic-gate  * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
47*7c478bd9Sstevel@tonic-gate  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
48*7c478bd9Sstevel@tonic-gate  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
49*7c478bd9Sstevel@tonic-gate  * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
50*7c478bd9Sstevel@tonic-gate  * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
51*7c478bd9Sstevel@tonic-gate  * OR MODIFICATIONS.
52*7c478bd9Sstevel@tonic-gate  */
53*7c478bd9Sstevel@tonic-gate 
54*7c478bd9Sstevel@tonic-gate #ifndef _PPP_DEFS_H_
55*7c478bd9Sstevel@tonic-gate #define	_PPP_DEFS_H_
56*7c478bd9Sstevel@tonic-gate 
57*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
58*7c478bd9Sstevel@tonic-gate 
59*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus
60*7c478bd9Sstevel@tonic-gate extern "C" {
61*7c478bd9Sstevel@tonic-gate #endif
62*7c478bd9Sstevel@tonic-gate 
63*7c478bd9Sstevel@tonic-gate /*
64*7c478bd9Sstevel@tonic-gate  * The basic PPP frame.
65*7c478bd9Sstevel@tonic-gate  */
66*7c478bd9Sstevel@tonic-gate #define	PPP_HDRLEN	4	/* octets for standard ppp header */
67*7c478bd9Sstevel@tonic-gate #define	PPP_FCSLEN	2	/* octets for FCS */
68*7c478bd9Sstevel@tonic-gate #define	PPP_FCS32LEN	4	/* octets for FCS-32 */
69*7c478bd9Sstevel@tonic-gate #define	PPP_MAX_MUX_LEN	127	/* maximum length of muxed frame */
70*7c478bd9Sstevel@tonic-gate #define	PFF		0x80	/* protocol field flag */
71*7c478bd9Sstevel@tonic-gate 
72*7c478bd9Sstevel@tonic-gate /*
73*7c478bd9Sstevel@tonic-gate  * Packet sizes
74*7c478bd9Sstevel@tonic-gate  */
75*7c478bd9Sstevel@tonic-gate #define	PPP_MTU		1500	/* Default MTU (size of Info field) */
76*7c478bd9Sstevel@tonic-gate #define	PPP_MAXMTU	65535 - (PPP_HDRLEN + PPP_FCSLEN)
77*7c478bd9Sstevel@tonic-gate #define	PPP_MINMTU	64
78*7c478bd9Sstevel@tonic-gate #define	PPP_MRU		1500	/* default MRU = max length of info field */
79*7c478bd9Sstevel@tonic-gate #define	PPP_MAXMRU	65000	/* Largest MRU we allow */
80*7c478bd9Sstevel@tonic-gate #define	PPP_MINMRU	128
81*7c478bd9Sstevel@tonic-gate 
82*7c478bd9Sstevel@tonic-gate #define	PPP_ADDRESS(p)	(((uchar_t *)(p))[0])
83*7c478bd9Sstevel@tonic-gate #define	PPP_CONTROL(p)	(((uchar_t *)(p))[1])
84*7c478bd9Sstevel@tonic-gate #define	PPP_PROTOCOL(p)	((((uchar_t *)(p))[2] << 8) + ((uchar_t *)(p))[3])
85*7c478bd9Sstevel@tonic-gate 
86*7c478bd9Sstevel@tonic-gate /*
87*7c478bd9Sstevel@tonic-gate  * Significant octet values.
88*7c478bd9Sstevel@tonic-gate  */
89*7c478bd9Sstevel@tonic-gate #define	PPP_ALLSTATIONS	0xff	/* All-Stations broadcast address */
90*7c478bd9Sstevel@tonic-gate #define	PPP_UI		0x03	/* Unnumbered Information */
91*7c478bd9Sstevel@tonic-gate #define	PPP_FLAG	0x7e	/* Flag Sequence */
92*7c478bd9Sstevel@tonic-gate #define	PPP_ESCAPE	0x7d	/* Asynchronous Control Escape */
93*7c478bd9Sstevel@tonic-gate #define	PPP_TRANS	0x20	/* Asynchronous transparency modifier */
94*7c478bd9Sstevel@tonic-gate 
95*7c478bd9Sstevel@tonic-gate /*
96*7c478bd9Sstevel@tonic-gate  * Protocol field values.
97*7c478bd9Sstevel@tonic-gate  */
98*7c478bd9Sstevel@tonic-gate #define	PPP_IP		0x21	/* Internet Protocol */
99*7c478bd9Sstevel@tonic-gate #define	PPP_OSI		0x23	/* OSI Network Layer */
100*7c478bd9Sstevel@tonic-gate #define	PPP_AT		0x29	/* AppleTalk Protocol */
101*7c478bd9Sstevel@tonic-gate #define	PPP_IPX		0x2b	/* IPX protocol */
102*7c478bd9Sstevel@tonic-gate #define	PPP_VJC_COMP	0x2d	/* VJ compressed TCP */
103*7c478bd9Sstevel@tonic-gate #define	PPP_VJC_UNCOMP	0x2f	/* VJ uncompressed TCP */
104*7c478bd9Sstevel@tonic-gate #define	PPP_BRIDGE	0x31	/* Bridging */
105*7c478bd9Sstevel@tonic-gate #define	PPP_MP		0x3d	/* Multilink protocol */
106*7c478bd9Sstevel@tonic-gate #define	PPP_ENCRYPT	0x53	/* Encryption */
107*7c478bd9Sstevel@tonic-gate #define	PPP_ENCRYPTFRAG	0x55	/* Individual Link Encryption */
108*7c478bd9Sstevel@tonic-gate #define	PPP_IPV6	0x57	/* Internet Protocol Version 6 */
109*7c478bd9Sstevel@tonic-gate #define	PPP_MUX		0x59	/* PPP Muxing */
110*7c478bd9Sstevel@tonic-gate #define	PPP_FULLHDR	0x61	/* IP Compression; full header */
111*7c478bd9Sstevel@tonic-gate #define	PPP_COMPTCP	0x63	/* IP Compression; compressed TCP */
112*7c478bd9Sstevel@tonic-gate #define	PPP_COMPNONTCP	0x65	/* IP Compression; non TCP */
113*7c478bd9Sstevel@tonic-gate #define	PPP_COMPUDP8	0x67	/* IP Compression; UDP, 8 bit CID */
114*7c478bd9Sstevel@tonic-gate #define	PPP_COMPRTP8	0x69	/* IP Compression; RTP, 8 bit CID */
115*7c478bd9Sstevel@tonic-gate #define	PPP_COMPFRAG	0xfb	/* fragment compressed below bundle */
116*7c478bd9Sstevel@tonic-gate #define	PPP_COMP	0xfd	/* compressed packet */
117*7c478bd9Sstevel@tonic-gate #define	PPP_802HELLO	0x201	/* 802.1d Hello (OBSOLETE) */
118*7c478bd9Sstevel@tonic-gate #define	PPP_MPLS	0x281	/* MPLS Unicast */
119*7c478bd9Sstevel@tonic-gate #define	PPP_MPLSMC	0x283	/* MPLS Multicast */
120*7c478bd9Sstevel@tonic-gate #define	PPP_COMPTCPND	0x2063	/* IP Compression; compressed TCP no delta */
121*7c478bd9Sstevel@tonic-gate #define	PPP_COMPSTATE	0x2065	/* IP Compression; state message */
122*7c478bd9Sstevel@tonic-gate #define	PPP_COMPUDP16	0x2067	/* IP Compression; UDP, 16 bit CID */
123*7c478bd9Sstevel@tonic-gate #define	PPP_COMPRTP16	0x2069	/* IP Compression; RTP, 16 bit CID */
124*7c478bd9Sstevel@tonic-gate #define	PPP_IPCP	0x8021	/* IP Control Protocol */
125*7c478bd9Sstevel@tonic-gate #define	PPP_OSINLCP	0x8023	/* OSI Network Layer Control Protocol */
126*7c478bd9Sstevel@tonic-gate #define	PPP_ATCP	0x8029	/* AppleTalk Control Protocol */
127*7c478bd9Sstevel@tonic-gate #define	PPP_IPXCP	0x802b	/* IPX Control Protocol */
128*7c478bd9Sstevel@tonic-gate #define	PPP_BCP		0x8031	/* Bridging Control Protocol */
129*7c478bd9Sstevel@tonic-gate #define	PPP_ECP		0x8053	/* Encryption Control Protocol */
130*7c478bd9Sstevel@tonic-gate #define	PPP_ECPFRAG	0x8055	/* ECP at link level (below MP bundle) */
131*7c478bd9Sstevel@tonic-gate #define	PPP_IPV6CP	0x8057	/* IPv6 Control Protocol */
132*7c478bd9Sstevel@tonic-gate #define	PPP_MUXCP	0x8059	/* PPP Muxing Control Protocol */
133*7c478bd9Sstevel@tonic-gate #define	PPP_CCPFRAG	0x80fb	/* CCP at link level (below MP bundle) */
134*7c478bd9Sstevel@tonic-gate #define	PPP_CCP		0x80fd	/* Compression Control Protocol */
135*7c478bd9Sstevel@tonic-gate #define	PPP_MPLSCP	0x8281	/* MPLS Control Protocol */
136*7c478bd9Sstevel@tonic-gate #define	PPP_LCP		0xc021	/* Link Control Protocol */
137*7c478bd9Sstevel@tonic-gate #define	PPP_PAP		0xc023	/* Password Authentication Protocol */
138*7c478bd9Sstevel@tonic-gate #define	PPP_LQR		0xc025	/* Link Quality Report protocol */
139*7c478bd9Sstevel@tonic-gate #define	PPP_BACP	0xc02b	/* Bandwidth Allocation Control Protocol */
140*7c478bd9Sstevel@tonic-gate #define	PPP_BAP		0xc02d	/* Bandwidth Allocation Protocol */
141*7c478bd9Sstevel@tonic-gate #define	PPP_CBCP	0xc029	/* Callback Control Protocol */
142*7c478bd9Sstevel@tonic-gate #define	PPP_CHAP	0xc223	/* Challenge Handshake Auth. Protocol */
143*7c478bd9Sstevel@tonic-gate #define	PPP_EAP		0xc227	/* Extensible Authentication Protocol */
144*7c478bd9Sstevel@tonic-gate 
145*7c478bd9Sstevel@tonic-gate /*
146*7c478bd9Sstevel@tonic-gate  * Values for FCS calculations.
147*7c478bd9Sstevel@tonic-gate  */
148*7c478bd9Sstevel@tonic-gate #define	PPP_INITFCS	0xffff	/* Initial FCS value */
149*7c478bd9Sstevel@tonic-gate #define	PPP_GOODFCS	0xf0b8	/* Good final FCS value */
150*7c478bd9Sstevel@tonic-gate #define	PPP_FCS(fcs, c)	(((fcs) >> 8) ^ fcstab[((fcs) ^ (c)) & 0xff])
151*7c478bd9Sstevel@tonic-gate 
152*7c478bd9Sstevel@tonic-gate #define	PPPINITFCS16	PPP_INITFCS
153*7c478bd9Sstevel@tonic-gate #define	PPPGOODFCS16	PPP_GOODFCS
154*7c478bd9Sstevel@tonic-gate #define	PPPFCS16(fcs, c)	PPP_FCS((fcs), (c))
155*7c478bd9Sstevel@tonic-gate 
156*7c478bd9Sstevel@tonic-gate #define	PPPINITFCS32	0xfffffffful
157*7c478bd9Sstevel@tonic-gate #define	PPPGOODFCS32	0xdebb20e3ul
158*7c478bd9Sstevel@tonic-gate #define	PPPFCS32(fcs, c) (((fcs) >> 8) ^ crc32_table[((fcs) ^ (c)) & 0xff])
159*7c478bd9Sstevel@tonic-gate 
160*7c478bd9Sstevel@tonic-gate /* Marker values shared between pppdump and pppd. */
161*7c478bd9Sstevel@tonic-gate #define	RECMARK_STARTSEND	1
162*7c478bd9Sstevel@tonic-gate #define	RECMARK_STARTRECV	2
163*7c478bd9Sstevel@tonic-gate #define	RECMARK_ENDSEND		3
164*7c478bd9Sstevel@tonic-gate #define	RECMARK_ENDRECV		4
165*7c478bd9Sstevel@tonic-gate #define	RECMARK_TIMEDELTA32	5
166*7c478bd9Sstevel@tonic-gate #define	RECMARK_TIMEDELTA8	6
167*7c478bd9Sstevel@tonic-gate #define	RECMARK_TIMESTART	7
168*7c478bd9Sstevel@tonic-gate 
169*7c478bd9Sstevel@tonic-gate /*
170*7c478bd9Sstevel@tonic-gate  * A 32-bit unsigned integral type.
171*7c478bd9Sstevel@tonic-gate  */
172*7c478bd9Sstevel@tonic-gate 
173*7c478bd9Sstevel@tonic-gate #if !defined(__BIT_TYPES_DEFINED__) && !defined(_BITYPES) && \
174*7c478bd9Sstevel@tonic-gate 	!defined(__FreeBSD__) && (NS_TARGET < 40)
175*7c478bd9Sstevel@tonic-gate #ifdef	UINT32_T
176*7c478bd9Sstevel@tonic-gate typedef UINT32_T	u_int32_t;
177*7c478bd9Sstevel@tonic-gate #else
178*7c478bd9Sstevel@tonic-gate typedef unsigned int	u_int32_t;
179*7c478bd9Sstevel@tonic-gate typedef unsigned short  u_int16_t;
180*7c478bd9Sstevel@tonic-gate #endif
181*7c478bd9Sstevel@tonic-gate #endif
182*7c478bd9Sstevel@tonic-gate 
183*7c478bd9Sstevel@tonic-gate #if defined(__sun) && !defined(_SYS_INT_TYPES_H) && !defined(_UINT32_T)
184*7c478bd9Sstevel@tonic-gate /* Backward compatibility */
185*7c478bd9Sstevel@tonic-gate typedef uint_t uint32_t;
186*7c478bd9Sstevel@tonic-gate typedef ushort_t uint16_t;
187*7c478bd9Sstevel@tonic-gate typedef uchar_t uint8_t;
188*7c478bd9Sstevel@tonic-gate typedef unsigned long uintptr_t;
189*7c478bd9Sstevel@tonic-gate #define	_UINT32_T
190*7c478bd9Sstevel@tonic-gate #endif
191*7c478bd9Sstevel@tonic-gate 
192*7c478bd9Sstevel@tonic-gate /*
193*7c478bd9Sstevel@tonic-gate  * Extended asyncmap - allows any character to be escaped.
194*7c478bd9Sstevel@tonic-gate  */
195*7c478bd9Sstevel@tonic-gate typedef u_int32_t	ext_accm[8];
196*7c478bd9Sstevel@tonic-gate 
197*7c478bd9Sstevel@tonic-gate /*
198*7c478bd9Sstevel@tonic-gate  * What to do with network protocol (NP) packets.
199*7c478bd9Sstevel@tonic-gate  */
200*7c478bd9Sstevel@tonic-gate enum NPmode {
201*7c478bd9Sstevel@tonic-gate     NPMODE_PASS,		/* pass the packet through */
202*7c478bd9Sstevel@tonic-gate     NPMODE_DROP,		/* silently drop the packet */
203*7c478bd9Sstevel@tonic-gate     NPMODE_ERROR,		/* return an error */
204*7c478bd9Sstevel@tonic-gate     NPMODE_QUEUE		/* save it up for later. */
205*7c478bd9Sstevel@tonic-gate };
206*7c478bd9Sstevel@tonic-gate 
207*7c478bd9Sstevel@tonic-gate /*
208*7c478bd9Sstevel@tonic-gate  * Statistics.
209*7c478bd9Sstevel@tonic-gate  */
210*7c478bd9Sstevel@tonic-gate struct pppstat	{
211*7c478bd9Sstevel@tonic-gate     u_int32_t ppp_ibytes;	/* bytes received */
212*7c478bd9Sstevel@tonic-gate     u_int32_t ppp_ipackets;	/* packets received */
213*7c478bd9Sstevel@tonic-gate     u_int32_t ppp_ierrors;	/* receive errors */
214*7c478bd9Sstevel@tonic-gate     u_int32_t ppp_obytes;	/* bytes sent */
215*7c478bd9Sstevel@tonic-gate     u_int32_t ppp_opackets;	/* packets sent */
216*7c478bd9Sstevel@tonic-gate     u_int32_t ppp_oerrors;	/* transmit errors */
217*7c478bd9Sstevel@tonic-gate };
218*7c478bd9Sstevel@tonic-gate 
219*7c478bd9Sstevel@tonic-gate struct vjstat {
220*7c478bd9Sstevel@tonic-gate     u_int32_t vjs_packets;	/* outbound packets */
221*7c478bd9Sstevel@tonic-gate     u_int32_t vjs_compressed; /* outbound compressed packets */
222*7c478bd9Sstevel@tonic-gate     u_int32_t vjs_searches;	/* searches for connection state */
223*7c478bd9Sstevel@tonic-gate     u_int32_t vjs_misses;	/* times couldn't find conn. state */
224*7c478bd9Sstevel@tonic-gate     u_int32_t vjs_uncompressedin; /* inbound uncompressed packets */
225*7c478bd9Sstevel@tonic-gate     u_int32_t vjs_compressedin; /* inbound compressed packets */
226*7c478bd9Sstevel@tonic-gate     u_int32_t vjs_errorin;	/* inbound unknown type packets */
227*7c478bd9Sstevel@tonic-gate     u_int32_t vjs_tossed;	/* inbound packets tossed because of error */
228*7c478bd9Sstevel@tonic-gate };
229*7c478bd9Sstevel@tonic-gate 
230*7c478bd9Sstevel@tonic-gate struct ppp_stats {
231*7c478bd9Sstevel@tonic-gate     struct pppstat p;		/* basic PPP statistics */
232*7c478bd9Sstevel@tonic-gate     struct vjstat vj;		/* VJ header compression statistics */
233*7c478bd9Sstevel@tonic-gate };
234*7c478bd9Sstevel@tonic-gate 
235*7c478bd9Sstevel@tonic-gate #ifdef SOL2
236*7c478bd9Sstevel@tonic-gate #define	PPP_COUNTER_F	"llu"
237*7c478bd9Sstevel@tonic-gate typedef uint64_t	ppp_counter_t;
238*7c478bd9Sstevel@tonic-gate 
239*7c478bd9Sstevel@tonic-gate struct pppstat64 {
240*7c478bd9Sstevel@tonic-gate 	ppp_counter_t ppp_ibytes;	/* bytes received */
241*7c478bd9Sstevel@tonic-gate 	ppp_counter_t ppp_ipackets;	/* packets received */
242*7c478bd9Sstevel@tonic-gate 	ppp_counter_t ppp_ierrors;	/* receive errors */
243*7c478bd9Sstevel@tonic-gate 	ppp_counter_t ppp_obytes;	/* bytes sent */
244*7c478bd9Sstevel@tonic-gate 	ppp_counter_t ppp_opackets;	/* packets sent */
245*7c478bd9Sstevel@tonic-gate 	ppp_counter_t ppp_oerrors;	/* transmit errors */
246*7c478bd9Sstevel@tonic-gate };
247*7c478bd9Sstevel@tonic-gate 
248*7c478bd9Sstevel@tonic-gate struct ppp_stats64 {
249*7c478bd9Sstevel@tonic-gate 	struct pppstat64 p;
250*7c478bd9Sstevel@tonic-gate 	struct vjstat vj;
251*7c478bd9Sstevel@tonic-gate };
252*7c478bd9Sstevel@tonic-gate #else
253*7c478bd9Sstevel@tonic-gate #define	PPP_COUNTER_F	"u"
254*7c478bd9Sstevel@tonic-gate typedef u_int32_t	ppp_counter_t;
255*7c478bd9Sstevel@tonic-gate #endif
256*7c478bd9Sstevel@tonic-gate 
257*7c478bd9Sstevel@tonic-gate struct compstat {
258*7c478bd9Sstevel@tonic-gate     u_int32_t unc_bytes;	/* total uncompressed bytes */
259*7c478bd9Sstevel@tonic-gate     u_int32_t unc_packets;	/* total uncompressed packets */
260*7c478bd9Sstevel@tonic-gate     u_int32_t comp_bytes;	/* compressed bytes */
261*7c478bd9Sstevel@tonic-gate     u_int32_t comp_packets;	/* compressed packets */
262*7c478bd9Sstevel@tonic-gate     u_int32_t inc_bytes;	/* incompressible bytes */
263*7c478bd9Sstevel@tonic-gate     u_int32_t inc_packets;	/* incompressible packets */
264*7c478bd9Sstevel@tonic-gate     u_int32_t ratio;		/* recent compression ratio << 8 */
265*7c478bd9Sstevel@tonic-gate };
266*7c478bd9Sstevel@tonic-gate 
267*7c478bd9Sstevel@tonic-gate struct ppp_comp_stats {
268*7c478bd9Sstevel@tonic-gate     struct compstat c;		/* packet compression statistics */
269*7c478bd9Sstevel@tonic-gate     struct compstat d;		/* packet decompression statistics */
270*7c478bd9Sstevel@tonic-gate };
271*7c478bd9Sstevel@tonic-gate 
272*7c478bd9Sstevel@tonic-gate /*
273*7c478bd9Sstevel@tonic-gate  * The following structure records the time in seconds since
274*7c478bd9Sstevel@tonic-gate  * the last NP packet was sent or received.
275*7c478bd9Sstevel@tonic-gate  */
276*7c478bd9Sstevel@tonic-gate struct ppp_idle {
277*7c478bd9Sstevel@tonic-gate 	/*
278*7c478bd9Sstevel@tonic-gate 	 * Fix the length of these fields to be 32-bit, since
279*7c478bd9Sstevel@tonic-gate 	 * otherwise, a time_t (long) is 64-bit in kernel while 32-bit
280*7c478bd9Sstevel@tonic-gate 	 * in userland when running on a 64-bit CPU with a 64-bit OS.
281*7c478bd9Sstevel@tonic-gate 	 */
282*7c478bd9Sstevel@tonic-gate     u_int32_t xmit_idle;	/* time since last NP packet sent */
283*7c478bd9Sstevel@tonic-gate     u_int32_t recv_idle;	/* time since last NP packet received */
284*7c478bd9Sstevel@tonic-gate };
285*7c478bd9Sstevel@tonic-gate 
286*7c478bd9Sstevel@tonic-gate enum LSstat {
287*7c478bd9Sstevel@tonic-gate     PPP_LINKSTAT_HANGUP = 0xabcd, /* link is hung up */
288*7c478bd9Sstevel@tonic-gate     PPP_LINKSTAT_NEEDUP,	/* link is down and needs to be up */
289*7c478bd9Sstevel@tonic-gate     PPP_LINKSTAT_IPV4_UNBOUND,	/* DL_UNBIND received on IPv4 stream */
290*7c478bd9Sstevel@tonic-gate     PPP_LINKSTAT_IPV6_UNBOUND,	/* DL_UNBIND received on IPv6 stream */
291*7c478bd9Sstevel@tonic-gate     PPP_LINKSTAT_IPV4_BOUND,	/* DL_BIND received on IPv4 stream */
292*7c478bd9Sstevel@tonic-gate     PPP_LINKSTAT_IPV6_BOUND,	/* DL_BIND received on IPv6 stream */
293*7c478bd9Sstevel@tonic-gate     PPP_LINKSTAT_UP		/* Integrated driver; hardware is up */
294*7c478bd9Sstevel@tonic-gate };
295*7c478bd9Sstevel@tonic-gate 
296*7c478bd9Sstevel@tonic-gate #define	PPPLSMAGIC	0x53505050
297*7c478bd9Sstevel@tonic-gate 
298*7c478bd9Sstevel@tonic-gate struct ppp_ls {
299*7c478bd9Sstevel@tonic-gate     u_int32_t magic;		/* magic number identifier (PPPLSMAGIC) */
300*7c478bd9Sstevel@tonic-gate     u_int32_t ppp_message;	/* link status message */
301*7c478bd9Sstevel@tonic-gate };
302*7c478bd9Sstevel@tonic-gate 
303*7c478bd9Sstevel@tonic-gate #ifndef __P
304*7c478bd9Sstevel@tonic-gate #ifdef __STDC__
305*7c478bd9Sstevel@tonic-gate #define	__P(x)	x
306*7c478bd9Sstevel@tonic-gate #else
307*7c478bd9Sstevel@tonic-gate #define	__P(x)	()
308*7c478bd9Sstevel@tonic-gate #endif
309*7c478bd9Sstevel@tonic-gate #endif
310*7c478bd9Sstevel@tonic-gate 
311*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus
312*7c478bd9Sstevel@tonic-gate }
313*7c478bd9Sstevel@tonic-gate #endif
314*7c478bd9Sstevel@tonic-gate 
315*7c478bd9Sstevel@tonic-gate #endif /* _PPP_DEFS_H_ */
316