]> git.ozlabs.org Git - ppp.git/blob - ultrix/if_pppvar.h
More copyright updates. The new CMU copyright notice is from CMU and
[ppp.git] / ultrix / if_pppvar.h
1 /*      $Id: if_pppvar.h,v 1.8 2002/12/06 12:03:44 paulus Exp $ */
2 /*
3  * if_pppvar.h - private structures and declarations for PPP.
4  *
5  * Copyright (c) 1994 Paul Mackerras. All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  *
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
17  *    distribution.
18  *
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.
22  *
23  * 4. Redistributions of any form whatsoever must retain the following
24  *    acknowledgment:
25  *    "This product includes software developed by Paul Mackerras
26  *     <paulus@samba.org>".
27  *
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.
35  *
36  * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved.
37  *
38  * Redistribution and use in source and binary forms, with or without
39  * modification, are permitted provided that the following conditions
40  * are met:
41  *
42  * 1. Redistributions of source code must retain the above copyright
43  *    notice, this list of conditions and the following disclaimer.
44  *
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
48  *    distribution.
49  *
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
56  *      5000 Forbes Avenue
57  *      Pittsburgh, PA  15213-3890
58  *      (412) 268-4387, fax: (412) 268-7395
59  *      tech-transfer@andrew.cmu.edu
60  *
61  * 4. Redistributions of any form whatsoever must retain the following
62  *    acknowledgment:
63  *    "This product includes software developed by Computing Services
64  *     at Carnegie Mellon University (http://www.cmu.edu/computing/)."
65  *
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.
73  */
74
75 /*
76  * Supported network protocols.  These values are used for
77  * indexing sc_npmode.
78  */
79 #define NP_IP   0               /* Internet Protocol */
80 #define NUM_NP  1               /* Number of NPs. */
81
82 /*
83  * Structure describing each ppp unit.
84  */
85 struct ppp_softc {
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 */
109 #ifdef  VJC
110         struct  slcompress *sc_comp;    /* vjc control buffer */
111 #endif
112
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 */
125 };
126
127 struct  ppp_softc ppp_softc[NPPP];
128
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);