xref: /freebsd/usr.sbin/ppp/layer.h (revision b3e7694832e81d7a904a10f525f8797b753bf0d3)
15d9e6103SBrian Somers /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
31de7b4b8SPedro F. Giffuni  *
45d9e6103SBrian Somers  * Copyright (c) 1999 Brian Somers <brian@Awfulhak.org>
55d9e6103SBrian Somers  * All rights reserved.
65d9e6103SBrian Somers  *
75d9e6103SBrian Somers  * Redistribution and use in source and binary forms, with or without
85d9e6103SBrian Somers  * modification, are permitted provided that the following conditions
95d9e6103SBrian Somers  * are met:
105d9e6103SBrian Somers  * 1. Redistributions of source code must retain the above copyright
115d9e6103SBrian Somers  *    notice, this list of conditions and the following disclaimer.
125d9e6103SBrian Somers  * 2. Redistributions in binary form must reproduce the above copyright
135d9e6103SBrian Somers  *    notice, this list of conditions and the following disclaimer in the
145d9e6103SBrian Somers  *    documentation and/or other materials provided with the distribution.
155d9e6103SBrian Somers  *
165d9e6103SBrian Somers  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
175d9e6103SBrian Somers  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
185d9e6103SBrian Somers  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
195d9e6103SBrian Somers  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
205d9e6103SBrian Somers  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
215d9e6103SBrian Somers  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
225d9e6103SBrian Somers  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
235d9e6103SBrian Somers  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
245d9e6103SBrian Somers  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
255d9e6103SBrian Somers  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
265d9e6103SBrian Somers  * SUCH DAMAGE.
275d9e6103SBrian Somers  */
285d9e6103SBrian Somers 
295d9e6103SBrian Somers #define	LAYER_ASYNC	2
305d9e6103SBrian Somers #define	LAYER_SYNC	3
315d9e6103SBrian Somers #define	LAYER_HDLC	4
325d9e6103SBrian Somers #define	LAYER_ACF	5
335d9e6103SBrian Somers #define	LAYER_PROTO	6
345d9e6103SBrian Somers #define	LAYER_LQR	7
355d9e6103SBrian Somers #define	LAYER_CCP	8
365d9e6103SBrian Somers #define	LAYER_VJ	9
3767b072f7SBrian Somers #define	LAYER_NAT	10
385d9e6103SBrian Somers 
395d9e6103SBrian Somers #define	LAYER_MAX	10	/* How many layers we can handle on a link */
405d9e6103SBrian Somers 
415d9e6103SBrian Somers struct mbuf;
425d9e6103SBrian Somers struct link;
435d9e6103SBrian Somers struct bundle;
445d9e6103SBrian Somers 
455d9e6103SBrian Somers struct layer {
465d9e6103SBrian Somers   int type;
475d9e6103SBrian Somers   const char *name;
485d9e6103SBrian Somers   struct mbuf *(*push)(struct bundle *, struct link *, struct mbuf *,
495d9e6103SBrian Somers                        int pri, u_short *proto);
505d9e6103SBrian Somers   struct mbuf *(*pull)(struct bundle *, struct link *, struct mbuf *,
515d9e6103SBrian Somers                        u_short *);
525d9e6103SBrian Somers };
53