xref: /illumos-gate/usr/src/uts/common/net/pppio.h (revision 2d6eb4a5e0a47d30189497241345dc5466bb68ab)
1 /*
2  * pppio.h - ioctl and other misc. definitions for STREAMS modules.
3  *
4  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
5  * Use is subject to license terms.
6  *
7  * Copyright (c) 1994 The Australian National University.
8  * All rights reserved.
9  *
10  * Permission to use, copy, modify, and distribute this software and its
11  * documentation is hereby granted, provided that the above copyright
12  * notice appears in all copies.  This software is provided without any
13  * warranty, express or implied. The Australian National University
14  * makes no representations about the suitability of this software for
15  * any purpose.
16  *
17  * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
18  * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
19  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
20  * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
21  * OF SUCH DAMAGE.
22  *
23  * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
24  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
25  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
26  * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
27  * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
28  * OR MODIFICATIONS.
29  *
30  * $Id: pppio.h,v 1.8 1996/08/28 06:36:51 paulus Exp $
31  */
32 
33 #ifndef __PPPIO_H
34 #define	__PPPIO_H
35 
36 #ifdef	__cplusplus
37 extern "C" {
38 #endif
39 
40 #define	_PPPIO(n)	(('p' << 8) + (n))
41 
42 #define	PPPIO_NEWPPA	_PPPIO(130)	/* allocate a new PPP unit */
43 #define	PPPIO_GETSTAT	_PPPIO(131)	/* get PPP statistics */
44 #define	PPPIO_GETCSTAT	_PPPIO(132)	/* get PPP compression stats */
45 #define	PPPIO_MTU	_PPPIO(133)	/* set max transmission unit */
46 #define	PPPIO_MRU	_PPPIO(134)	/* set max receive unit */
47 #define	PPPIO_CFLAGS	_PPPIO(135)	/* set/clear/get compression flags */
48 #define	PPPIO_XCOMP	_PPPIO(136)	/* alloc transmit compressor */
49 #define	PPPIO_RCOMP	_PPPIO(137)	/* alloc receive decompressor */
50 #define	PPPIO_XACCM	_PPPIO(138)	/* set transmit asyncmap */
51 #define	PPPIO_RACCM	_PPPIO(139)	/* set receive asyncmap */
52 #define	PPPIO_VJINIT	_PPPIO(140)	/* initialize VJ comp/decomp */
53 #define	PPPIO_ATTACH	_PPPIO(141)	/* attach to a ppa (without putmsg) */
54 #define	PPPIO_LASTMOD	_PPPIO(142)	/* mark last ppp module */
55 #define	PPPIO_GCLEAN	_PPPIO(143)	/* get 8-bit-clean flags */
56 #define	PPPIO_DEBUG	_PPPIO(144)	/* request debug information */
57 #define	PPPIO_BIND	_PPPIO(145)	/* bind to SAP */
58 #define	PPPIO_NPMODE	_PPPIO(146)	/* set mode for handling data pkts */
59 #define	PPPIO_GIDLE	_PPPIO(147)	/* get time since last data pkt */
60 #define	PPPIO_PASSFILT	_PPPIO(148)	/* set filter for packets to pass */
61 #define	PPPIO_ACTIVEFILT _PPPIO(149)	/* set filter for "link active" pkts */
62 #define	PPPIO_USETIMESTAMP _PPPIO(150)	/* enable packet time-stamp */
63 #define	PPPIO_DETACH	_PPPIO(151)	/* detach from a ppa (w/o putmsg ) */
64 #define	PPPIO_XFCS	_PPPIO(152)	/* set transmit FCS type */
65 #define	PPPIO_RFCS	_PPPIO(153)	/* set receive FCS type */
66 #define	PPPIO_COMPLEV	_PPPIO(154)	/* set compression effort level */
67 #define	PPPIO_GTYPE	_PPPIO(155)	/* get existing driver type */
68 #define	PPPIO_MUX	_PPPIO(156)	/* multiplexed frame */
69 #define	PPPIO_GETSTAT64	_PPPIO(157)	/* get PPP 64-bit statistics */
70 #define	PPPIO_BLOCKNP	_PPPIO(158)	/* block pkts with proto np in kernel */
71 #define	PPPIO_UNBLOCKNP	_PPPIO(159)	/* unblock pkts with proto np */
72 
73 /* Values for PPPIO_MUX FLAGS */
74 #define	X_MUXMASK	0x10		/* transmit muxed frame option */
75 #define	R_MUXMASK	0x20		/* receive muxed frame option */
76 
77 /*
78  * Values for PPPIO_CFLAGS.  Data sent in is u_int32_t val[2], where
79  * result is newflags = val[0] | (oldflags & ~val[1]).  Returned data
80  * is a single u_int32_t, containing the current flags.
81  */
82 #define	COMP_AC		0x1		/* compress address/control */
83 #define	DECOMP_AC	0x2		/* decompress address/control */
84 #define	COMP_PROT	0x4		/* compress PPP protocol */
85 #define	DECOMP_PROT	0x8		/* decompress PPP protocol */
86 
87 #define	COMP_VJC	0x10		/* compress TCP/IP headers */
88 #define	COMP_VJCCID	0x20		/* compress connection ID as well */
89 #define	DECOMP_VJC	0x40		/* decompress TCP/IP headers */
90 #define	DECOMP_VJCCID	0x80		/* accept compressed connection ID */
91 
92 #define	CCP_ISOPEN	0x100		/* look at CCP packets */
93 #define	CCP_ISUP	0x200		/* do packet comp/decomp */
94 #define	CCP_ERROR	0x400		/* (status) error in packet decomp */
95 #define	CCP_FATALERROR	0x800		/* (status) fatal error ditto */
96 #define	CCP_COMP_RUN	0x1000		/* (status) seen CCP ack sent */
97 #define	CCP_DECOMP_RUN	0x2000		/* (status) seen CCP ack rcvd */
98 
99 
100 /*
101  * Values for PPPIO_XFCS/PPPIO_RFCS.  (Note that we don't support
102  * simultaneous use of 16 bit and 32 bit CRCs.)
103  */
104 #define	PPPFCS_16	0		/* The default, usually; CRC-16 */
105 #define	PPPFCS_32	1		/* CRC-32 */
106 #define	PPPFCS_NONE	2		/* No CRC */
107 
108 /*
109  * Values for 8-bit-clean flags.
110  */
111 #define	RCV_B7_0	1		/* have rcvd char with bit 7 = 0 */
112 #define	RCV_B7_1	2		/* have rcvd char with bit 7 = 1 */
113 #define	RCV_EVNP	4		/* have rcvd char with even parity */
114 #define	RCV_ODDP	8		/* have rcvd char with odd parity */
115 
116 /*
117  * Values for the first byte of M_CTL messages passed between
118  * PPP modules.
119  */
120 #define	PPPCTL_OERROR	0xe0		/* output error [up] */
121 #define	PPPCTL_IERROR	0xe1		/* input error (e.g. FCS) [up] */
122 #define	PPPCTL_MTU	0xe2		/* set MTU [down] */
123 #define	PPPCTL_MRU	0xe3		/* set MRU [down] */
124 #define	PPPCTL_UNIT	0xe4		/* note PPP unit number [down] */
125 
126 /*
127  * Values for the u_int32_t argument to PPPIO_DEBUG.
128  */
129 #define	PPPDBG_DUMP	0x10000		/* print out debug info now */
130 #define	PPPDBG_LOG	0x100		/* log various things */
131 #define	PPPDBG_DRIVER	0		/* identifies ppp driver as target */
132 #define	PPPDBG_IF	1		/* identifies ppp network i/f target */
133 #define	PPPDBG_COMP	2		/* identifies ppp compression target */
134 #define	PPPDBG_AHDLC	3		/* identifies ppp async hdlc target */
135 
136 /*
137  * Values for the u_int32_t return from PPPIO_GTYPE.  Only lastmod
138  * should respond.  Current modules return PPPTYP_AHDLC (async
139  * module), PPPTYP_HC (compression module) and PPPTYP_MUX (PPP
140  * interface driver).
141  */
142 #define	PPPTYP_HDLC	0		/* raw HDLC I/O; no PPP handling */
143 #define	PPPTYP_AHDLC	1		/* async HDLC; has [XR]ACCM */
144 #define	PPPTYP_HC	2		/* HDLC with ACFC and PFC support */
145 #define	PPPTYP_AHC	3		/* async with ACFC and PFC */
146 #define	PPPTYP_MUX	4		/* multiplexor */
147 
148 #ifdef SOL2
149 /* Officially allocated module numbers */
150 #define	PPP_MOD_ID	2101	/* PPP multiplexor */
151 #define	COMP_MOD_ID	2102	/* Data and header compression */
152 #define	AHDLC_MOD_ID	2103	/* Asynchronous HDLC-like encapsulation */
153 #define	TUN_MOD_ID	2104	/* Tunneling protocols */
154 #define	MP_MOD_ID	2105	/* Multilink PPP */
155 #define	PPP_DRV_NAME	"sppp"
156 #define	AHDLC_MOD_NAME	"spppasyn"
157 #define	COMP_MOD_NAME	"spppcomp"
158 #define	TUN_MOD_NAME	"sppptun"
159 #define	MP_MOD_NAME	"spppmp"
160 #else
161 #define	PPP_MOD_ID	0xb1a6
162 #define	COMP_MOD_ID	0xbadf
163 #define	AHDLC_MOD_ID	0x7d23
164 #define	PPP_DRV_NAME	"ppp"
165 #define	AHDLC_MOD_NAME	"ppp_ahdl"
166 #define	COMP_MOD_NAME	"ppp_comp"
167 #endif
168 #define	PPP_DEV_NAME	"/dev/" PPP_DRV_NAME
169 
170 #ifdef	__cplusplus
171 }
172 #endif
173 
174 #endif /* __PPPIO_H */
175