1 /* $Id: if_pppvar.h,v 1.8 2002/12/06 12:03:44 paulus Exp $ */
3 * if_pppvar.h - private structures and declarations for PPP.
5 * Copyright (c) 1994 Paul Mackerras. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in
16 * the documentation and/or other materials provided with the
19 * 3. The name(s) of the authors of this software must not be used to
20 * endorse or promote products derived from this software without
21 * prior written permission.
23 * 4. Redistributions of any form whatsoever must retain the following
25 * "This product includes software developed by Paul Mackerras
26 * <paulus@samba.org>".
28 * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
29 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
30 * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
31 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
32 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
33 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
34 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
36 * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved.
38 * Redistribution and use in source and binary forms, with or without
39 * modification, are permitted provided that the following conditions
42 * 1. Redistributions of source code must retain the above copyright
43 * notice, this list of conditions and the following disclaimer.
45 * 2. Redistributions in binary form must reproduce the above copyright
46 * notice, this list of conditions and the following disclaimer in
47 * the documentation and/or other materials provided with the
50 * 3. The name "Carnegie Mellon University" must not be used to
51 * endorse or promote products derived from this software without
52 * prior written permission. For permission or any legal
53 * details, please contact
54 * Office of Technology Transfer
55 * Carnegie Mellon University
57 * Pittsburgh, PA 15213-3890
58 * (412) 268-4387, fax: (412) 268-7395
59 * tech-transfer@andrew.cmu.edu
61 * 4. Redistributions of any form whatsoever must retain the following
63 * "This product includes software developed by Computing Services
64 * at Carnegie Mellon University (http://www.cmu.edu/computing/)."
66 * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
67 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
68 * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
69 * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
70 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
71 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
72 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
76 * Supported network protocols. These values are used for
79 #define NP_IP 0 /* Internet Protocol */
80 #define NUM_NP 1 /* Number of NPs. */
83 * Structure describing each ppp unit.
86 struct ifnet sc_if; /* network-visible interface */
87 u_int sc_flags; /* control/status bits; see if_ppp.h */
88 void *sc_devp; /* pointer to device-dep structure */
89 void (*sc_start) __P((struct ppp_softc *)); /* start output proc */
90 void (*sc_ctlp) __P((struct ppp_softc *)); /* rcvd control pkt */
91 void (*sc_relinq) __P((struct ppp_softc *)); /* relinquish ifunit */
92 short sc_mru; /* max receive unit */
93 pid_t sc_xfer; /* used in transferring unit */
94 struct ifqueue sc_rawq; /* received packets */
95 struct ifqueue sc_inq; /* queue of input packets for daemon */
96 struct ifqueue sc_fastq; /* interactive output packet q */
97 struct mbuf *sc_togo; /* output packet ready to go */
98 struct mbuf *sc_npqueue; /* output packets not to be sent yet */
99 struct mbuf **sc_npqtail; /* ptr to last next ptr in npqueue */
100 struct pppstat sc_stats; /* count of bytes/pkts sent/rcvd */
101 caddr_t sc_bpf; /* hook for BPF */
102 enum NPmode sc_npmode[NUM_NP]; /* what to do with each NP */
103 struct compressor *sc_xcomp; /* transmit compressor */
104 void *sc_xc_state; /* transmit compressor state */
105 struct compressor *sc_rcomp; /* receive decompressor */
106 void *sc_rc_state; /* receive decompressor state */
107 time_t sc_last_sent; /* time (secs) last NP pkt sent */
108 time_t sc_last_recv; /* time (secs) last NP pkt rcvd */
110 struct slcompress *sc_comp; /* vjc control buffer */
113 /* Device-dependent part for async lines. */
114 ext_accm sc_asyncmap; /* async control character map */
115 u_long sc_rasyncmap; /* receive async control char map */
116 struct mbuf *sc_outm; /* mbuf chain currently being output */
117 struct mbuf *sc_m; /* pointer to input mbuf chain */
118 struct mbuf *sc_mc; /* pointer to current input mbuf */
119 char *sc_mp; /* ptr to next char in input mbuf */
120 short sc_ilen; /* length of input packet so far */
121 u_short sc_fcs; /* FCS so far (input) */
122 u_short sc_outfcs; /* FCS so far for output packet */
123 u_char sc_rawin[16]; /* chars as received */
124 int sc_rawin_count; /* # in sc_rawin */
127 struct ppp_softc ppp_softc[NPPP];
129 struct ppp_softc *pppalloc(pid_t pid);
130 void pppdealloc(struct ppp_softc *sc);
131 int pppoutput(struct ifnet *, struct mbuf *, struct sockaddr *);
132 int pppioctl(struct ppp_softc *sc, int cmd, caddr_t data, int flag);
133 void ppp_restart(struct ppp_softc *sc);
134 void ppppktin(struct ppp_softc *sc, struct mbuf *m, int lost);
135 struct mbuf *ppp_dequeue(struct ppp_softc *sc);