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