xref: /freebsd/usr.sbin/ppp/layer.h (revision 5d9e6103663c28d3986c674a772142f29e6584be)
15d9e6103SBrian Somers /*-
25d9e6103SBrian Somers  * Copyright (c) 1999 Brian Somers <brian@Awfulhak.org>
35d9e6103SBrian Somers  * All rights reserved.
45d9e6103SBrian Somers  *
55d9e6103SBrian Somers  * Redistribution and use in source and binary forms, with or without
65d9e6103SBrian Somers  * modification, are permitted provided that the following conditions
75d9e6103SBrian Somers  * are met:
85d9e6103SBrian Somers  * 1. Redistributions of source code must retain the above copyright
95d9e6103SBrian Somers  *    notice, this list of conditions and the following disclaimer.
105d9e6103SBrian Somers  * 2. Redistributions in binary form must reproduce the above copyright
115d9e6103SBrian Somers  *    notice, this list of conditions and the following disclaimer in the
125d9e6103SBrian Somers  *    documentation and/or other materials provided with the distribution.
135d9e6103SBrian Somers  *
145d9e6103SBrian Somers  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
155d9e6103SBrian Somers  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
165d9e6103SBrian Somers  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
175d9e6103SBrian Somers  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
185d9e6103SBrian Somers  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
195d9e6103SBrian Somers  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
205d9e6103SBrian Somers  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
215d9e6103SBrian Somers  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
225d9e6103SBrian Somers  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
235d9e6103SBrian Somers  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
245d9e6103SBrian Somers  * SUCH DAMAGE.
255d9e6103SBrian Somers  *
265d9e6103SBrian Somers  *	$Id:$
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
375d9e6103SBrian Somers #define	LAYER_ALIAS	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