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