rename project to visftp
[oftp] / libs / watt32 / net / if_pppva.h
1 /*!\file net/if_pppva.h
2  * PPP structures and declarations.
3  */
4
5 /*      $NetBSD: if_pppvar.h,v 1.7 1997/05/17 21:12:03 christos Exp $   */
6 /*      Id: if_pppvar.h,v 1.3 1996/07/01 01:04:37 paulus Exp     */
7
8 /*
9  * if_pppvar.h - private structures and declarations for PPP.
10  *
11  * Copyright (c) 1994 The Australian National University.
12  * All rights reserved.
13  *
14  * Permission to use, copy, modify, and distribute this software and its
15  * documentation is hereby granted, provided that the above copyright
16  * notice appears in all copies.  This software is provided without any
17  * warranty, express or implied. The Australian National University
18  * makes no representations about the suitability of this software for
19  * any purpose.
20  *
21  * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
22  * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
23  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
24  * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
25  * OF SUCH DAMAGE.
26  *
27  * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
28  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
29  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
30  * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
31  * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
32  * OR MODIFICATIONS.
33  *
34  * Copyright (c) 1989 Carnegie Mellon University.
35  * All rights reserved.
36  *
37  * Redistribution and use in source and binary forms are permitted
38  * provided that the above copyright notice and this paragraph are
39  * duplicated in all such forms and that any documentation,
40  * advertising materials, and other materials related to such
41  * distribution and use acknowledge that the software was developed
42  * by Carnegie Mellon University.  The name of the
43  * University may not be used to endorse or promote products derived
44  * from this software without specific prior written permission.
45  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
46  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
47  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
48  */
49
50 #ifndef __NET_IF_PPPVAR_H
51 #define __NET_IF_PPPVAR_H
52
53 /*
54  * Supported network protocols.  These values are used for
55  * indexing sc_npmode.
56  */
57 #define NP_IP   0               /* Internet Protocol */
58 #define NUM_NP  1               /* Number of NPs. */
59
60 /*
61  * Structure describing each ppp unit.
62  */
63 struct ppp_softc {
64         struct  ifnet sc_if;            /* network-visible interface */
65         int     sc_unit;                /* XXX unit number */
66         u_int   sc_flags;               /* control/status bits; see if_ppp.h */
67         void    *sc_devp;               /* pointer to device-dep structure */
68         void    (*sc_start) __P((struct ppp_softc *));  /* start output proc */
69         void    (*sc_ctlp) __P((struct ppp_softc *)); /* rcvd control pkt */
70         void    (*sc_relinq) __P((struct ppp_softc *)); /* relinquish ifunit */
71         u_int16_t sc_mru;               /* max receive unit */
72         int     sc_xfer;                /* used in transferring unit */
73         struct  ifqueue sc_rawq;        /* received packets */
74         struct  ifqueue sc_inq;         /* queue of input packets for daemon */
75         struct  ifqueue sc_fastq;       /* interactive output packet q */
76         struct  mbuf *sc_togo;          /* output packet ready to go */
77         struct  mbuf *sc_npqueue;       /* output packets not to be sent yet */
78         struct  mbuf **sc_npqtail;      /* ptr to last next ptr in npqueue */
79         struct  pppstat sc_stats;       /* count of bytes/pkts sent/rcvd */
80         caddr_t sc_bpf;                 /* hook for BPF */
81         enum    NPmode sc_npmode[NUM_NP]; /* what to do with each NP */
82         struct  compressor *sc_xcomp;   /* transmit compressor */
83         void    *sc_xc_state;           /* transmit compressor state */
84         struct  compressor *sc_rcomp;   /* receive decompressor */
85         void    *sc_rc_state;           /* receive decompressor state */
86         time_t  sc_last_sent;           /* time (secs) last NP pkt sent */
87         time_t  sc_last_recv;           /* time (secs) last NP pkt rcvd */
88 #ifdef PPP_FILTER
89         struct  bpf_program sc_pass_filt;   /* filter for packets to pass */
90         struct  bpf_program sc_active_filt; /* filter for "non-idle" packets */
91 #endif /* PPP_FILTER */
92 #ifdef  VJC
93         struct  slcompress *sc_comp;    /* vjc control buffer */
94 #endif
95
96         /* Device-dependent part for async lines. */
97         ext_accm sc_asyncmap;           /* async control character map */
98         u_int32_t sc_rasyncmap;         /* receive async control char map */
99         struct  mbuf *sc_outm;          /* mbuf chain currently being output */
100         struct  mbuf *sc_m;             /* pointer to input mbuf chain */
101         struct  mbuf *sc_mc;            /* pointer to current input mbuf */
102         char    *sc_mp;                 /* ptr to next char in input mbuf */
103         u_int16_t sc_ilen;              /* length of input packet so far */
104         u_int16_t sc_fcs;               /* FCS so far (input) */
105         u_int16_t sc_outfcs;            /* FCS so far for output packet */
106         u_char  sc_rawin[16];           /* chars as received */
107         int     sc_rawin_count;         /* # in sc_rawin */
108 };
109
110 #endif