]> git.ozlabs.org Git - ppp.git/blob - ultrix/if_pppvar.h
b87f94d00112f4f60dc427dd643c2e938c9fd9c4
[ppp.git] / ultrix / if_pppvar.h
1 /*      $Id: if_pppvar.h,v 1.7 2002/12/06 09:49:16 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) 1989 Carnegie Mellon University.
37  * All rights reserved.
38  *
39  * Redistribution and use in source and binary forms are permitted
40  * provided that the above copyright notice and this paragraph are
41  * duplicated in all such forms and that any documentation,
42  * advertising materials, and other materials related to such
43  * distribution and use acknowledge that the software was developed
44  * by Carnegie Mellon University.  The name of the
45  * University may not be used to endorse or promote products derived
46  * from this software without specific prior written permission.
47  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
48  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
49  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
50  */
51
52 /*
53  * Supported network protocols.  These values are used for
54  * indexing sc_npmode.
55  */
56 #define NP_IP   0               /* Internet Protocol */
57 #define NUM_NP  1               /* Number of NPs. */
58
59 /*
60  * Structure describing each ppp unit.
61  */
62 struct ppp_softc {
63         struct  ifnet sc_if;            /* network-visible interface */
64         u_int   sc_flags;               /* control/status bits; see if_ppp.h */
65         void    *sc_devp;               /* pointer to device-dep structure */
66         void    (*sc_start) __P((struct ppp_softc *));  /* start output proc */
67         void    (*sc_ctlp) __P((struct ppp_softc *)); /* rcvd control pkt */
68         void    (*sc_relinq) __P((struct ppp_softc *)); /* relinquish ifunit */
69         short   sc_mru;                 /* max receive unit */
70         pid_t   sc_xfer;                /* used in transferring unit */
71         struct  ifqueue sc_rawq;        /* received packets */
72         struct  ifqueue sc_inq;         /* queue of input packets for daemon */
73         struct  ifqueue sc_fastq;       /* interactive output packet q */
74         struct  mbuf *sc_togo;          /* output packet ready to go */
75         struct  mbuf *sc_npqueue;       /* output packets not to be sent yet */
76         struct  mbuf **sc_npqtail;      /* ptr to last next ptr in npqueue */
77         struct  pppstat sc_stats;       /* count of bytes/pkts sent/rcvd */
78         caddr_t sc_bpf;                 /* hook for BPF */
79         enum    NPmode sc_npmode[NUM_NP]; /* what to do with each NP */
80         struct  compressor *sc_xcomp;   /* transmit compressor */
81         void    *sc_xc_state;           /* transmit compressor state */
82         struct  compressor *sc_rcomp;   /* receive decompressor */
83         void    *sc_rc_state;           /* receive decompressor state */
84         time_t  sc_last_sent;           /* time (secs) last NP pkt sent */
85         time_t  sc_last_recv;           /* time (secs) last NP pkt rcvd */
86 #ifdef  VJC
87         struct  slcompress *sc_comp;    /* vjc control buffer */
88 #endif
89
90         /* Device-dependent part for async lines. */
91         ext_accm sc_asyncmap;           /* async control character map */
92         u_long  sc_rasyncmap;           /* receive async control char map */
93         struct  mbuf *sc_outm;          /* mbuf chain currently being output */
94         struct  mbuf *sc_m;             /* pointer to input mbuf chain */
95         struct  mbuf *sc_mc;            /* pointer to current input mbuf */
96         char    *sc_mp;                 /* ptr to next char in input mbuf */
97         short   sc_ilen;                /* length of input packet so far */
98         u_short sc_fcs;                 /* FCS so far (input) */
99         u_short sc_outfcs;              /* FCS so far for output packet */
100         u_char  sc_rawin[16];           /* chars as received */
101         int     sc_rawin_count;         /* # in sc_rawin */
102 };
103
104 struct  ppp_softc ppp_softc[NPPP];
105
106 struct  ppp_softc *pppalloc(pid_t pid);
107 void    pppdealloc(struct ppp_softc *sc);
108 int     pppoutput(struct ifnet *, struct mbuf *, struct sockaddr *);
109 int     pppioctl(struct ppp_softc *sc, int cmd, caddr_t data, int flag);
110 void    ppp_restart(struct ppp_softc *sc);
111 void    ppppktin(struct ppp_softc *sc, struct mbuf *m, int lost);
112 struct  mbuf *ppp_dequeue(struct ppp_softc *sc);