xref: /freebsd/usr.sbin/ppp/proto.h (revision b3e7694832e81d7a904a10f525f8797b753bf0d3)
165309e5cSBrian Somers /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
31de7b4b8SPedro F. Giffuni  *
465309e5cSBrian Somers  * Copyright (c) 1996 - 2001 Brian Somers <brian@Awfulhak.org>
565309e5cSBrian Somers  *          based on work by Toshiharu OHNO <tony-o@iij.ad.jp>
665309e5cSBrian Somers  *                           Internet Initiative Japan, Inc (IIJ)
765309e5cSBrian Somers  * All rights reserved.
85d9e6103SBrian Somers  *
965309e5cSBrian Somers  * Redistribution and use in source and binary forms, with or without
1065309e5cSBrian Somers  * modification, are permitted provided that the following conditions
1165309e5cSBrian Somers  * are met:
1265309e5cSBrian Somers  * 1. Redistributions of source code must retain the above copyright
1365309e5cSBrian Somers  *    notice, this list of conditions and the following disclaimer.
1465309e5cSBrian Somers  * 2. Redistributions in binary form must reproduce the above copyright
1565309e5cSBrian Somers  *    notice, this list of conditions and the following disclaimer in the
1665309e5cSBrian Somers  *    documentation and/or other materials provided with the distribution.
175d9e6103SBrian Somers  *
1865309e5cSBrian Somers  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1965309e5cSBrian Somers  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2065309e5cSBrian Somers  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2165309e5cSBrian Somers  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
2265309e5cSBrian Somers  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2365309e5cSBrian Somers  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2465309e5cSBrian Somers  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2565309e5cSBrian Somers  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2665309e5cSBrian Somers  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2765309e5cSBrian Somers  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2865309e5cSBrian Somers  * SUCH DAMAGE.
295d9e6103SBrian Somers  */
305d9e6103SBrian Somers 
315d9e6103SBrian Somers /*
325d9e6103SBrian Somers  *  Definition of protocol numbers
335d9e6103SBrian Somers  */
345d9e6103SBrian Somers #define	PROTO_IP	0x0021	/* IP */
355d9e6103SBrian Somers #define	PROTO_VJUNCOMP	0x002f	/* VJ Uncompressed */
365d9e6103SBrian Somers #define	PROTO_VJCOMP	0x002d	/* VJ Compressed */
375d9e6103SBrian Somers #define	PROTO_MP	0x003d	/* Multilink fragment */
3830949fd4SBrian Somers #ifndef NOINET6
3930949fd4SBrian Somers #define	PROTO_IPV6	0x0057	/* IPv6 */
4030949fd4SBrian Somers #endif
415d9e6103SBrian Somers #define	PROTO_ICOMPD	0x00fb	/* Individual link compressed */
425d9e6103SBrian Somers #define	PROTO_COMPD	0x00fd	/* Compressed datagram */
435d9e6103SBrian Somers 
44c03b8e5eSBrian Somers #define PROTO_COMPRESSIBLE(p) (((p) & 0xff81) == 0x01)
455d9e6103SBrian Somers 
465d9e6103SBrian Somers #define	PROTO_IPCP	0x8021
4730949fd4SBrian Somers #ifndef NOINET6
4830949fd4SBrian Somers #define	PROTO_IPV6CP	0x8057
4930949fd4SBrian Somers #endif
505d9e6103SBrian Somers #define	PROTO_ICCP	0x80fb
515d9e6103SBrian Somers #define	PROTO_CCP	0x80fd
525d9e6103SBrian Somers 
535d9e6103SBrian Somers #define	PROTO_LCP	0xc021
545d9e6103SBrian Somers #define	PROTO_PAP	0xc023
555d9e6103SBrian Somers #define	PROTO_CBCP	0xc029
565d9e6103SBrian Somers #define	PROTO_LQR	0xc025
575d9e6103SBrian Somers #define	PROTO_CHAP	0xc223
585d9e6103SBrian Somers 
595d9e6103SBrian Somers struct lcp;
605d9e6103SBrian Somers 
615d9e6103SBrian Somers extern int proto_WrapperOctets(struct lcp *, u_short);
625d9e6103SBrian Somers struct mbuf *proto_Prepend(struct mbuf *, u_short, unsigned, int);
635d9e6103SBrian Somers 
645d9e6103SBrian Somers extern struct layer protolayer;
65