3 --- /dev/null Sat Sep 18 04:00:15 1999
4 +++ netbsd-1.4/if_pppvar.h Sat Sep 18 04:06:25 1999
6 +/* NetBSD: if_pppvar.h,v 1.10 1999/07/30 10:35:38 itojun Exp */
7 +/* Id: if_pppvar.h,v 1.3 1996/07/01 01:04:37 paulus Exp */
10 + * if_pppvar.h - private structures and declarations for PPP.
12 + * Copyright (c) 1994 The Australian National University.
13 + * All rights reserved.
15 + * Permission to use, copy, modify, and distribute this software and its
16 + * documentation is hereby granted, provided that the above copyright
17 + * notice appears in all copies. This software is provided without any
18 + * warranty, express or implied. The Australian National University
19 + * makes no representations about the suitability of this software for
22 + * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
23 + * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
24 + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
25 + * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
28 + * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
29 + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
30 + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
31 + * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
32 + * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
35 + * Copyright (c) 1989 Carnegie Mellon University.
36 + * All rights reserved.
38 + * Redistribution and use in source and binary forms are permitted
39 + * provided that the above copyright notice and this paragraph are
40 + * duplicated in all such forms and that any documentation,
41 + * advertising materials, and other materials related to such
42 + * distribution and use acknowledge that the software was developed
43 + * by Carnegie Mellon University. The name of the
44 + * University may not be used to endorse or promote products derived
45 + * from this software without specific prior written permission.
46 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
47 + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
48 + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
51 +#ifndef _NET_IF_PPPVAR_H_
52 +#define _NET_IF_PPPVAR_H_
55 + * Supported network protocols. These values are used for
56 + * indexing sc_npmode.
58 +#define NP_IP 0 /* Internet Protocol */
59 +#define NP_IPV6 1 /* Internet Protocol version 6 */
60 +#define NUM_NP 2 /* Number of NPs. */
63 + * Structure describing each ppp unit.
66 + struct ifnet sc_if; /* network-visible interface */
67 + int sc_unit; /* XXX unit number */
68 + u_int sc_flags; /* control/status bits; see if_ppp.h */
69 + void *sc_devp; /* pointer to device-dep structure */
70 + void (*sc_start) __P((struct ppp_softc *)); /* start output proc */
71 + void (*sc_ctlp) __P((struct ppp_softc *)); /* rcvd control pkt */
72 + void (*sc_relinq) __P((struct ppp_softc *)); /* relinquish ifunit */
73 + u_int16_t sc_mru; /* max receive unit */
74 + pid_t sc_xfer; /* used in transferring unit */
75 + struct ifqueue sc_rawq; /* received packets */
76 + struct ifqueue sc_inq; /* queue of input packets for daemon */
77 + struct ifqueue sc_fastq; /* interactive output packet q */
78 + struct mbuf *sc_togo; /* output packet ready to go */
79 + struct mbuf *sc_npqueue; /* output packets not to be sent yet */
80 + struct mbuf **sc_npqtail; /* ptr to last next ptr in npqueue */
81 + struct pppstat sc_stats; /* count of bytes/pkts sent/rcvd */
82 + caddr_t sc_bpf; /* hook for BPF */
83 + enum NPmode sc_npmode[NUM_NP]; /* what to do with each NP */
84 + struct compressor *sc_xcomp; /* transmit compressor */
85 + void *sc_xc_state; /* transmit compressor state */
86 + struct compressor *sc_rcomp; /* receive decompressor */
87 + void *sc_rc_state; /* receive decompressor state */
88 + time_t sc_last_sent; /* time (secs) last NP pkt sent */
89 + time_t sc_last_recv; /* time (secs) last NP pkt rcvd */
91 + /* Filter for packets to pass. */
92 + struct bpf_program sc_pass_filt_in;
93 + struct bpf_program sc_pass_filt_out;
95 + /* Filter for "non-idle" packets. */
96 + struct bpf_program sc_active_filt_in;
97 + struct bpf_program sc_active_filt_out;
98 +#endif /* PPP_FILTER */
100 + struct slcompress *sc_comp; /* vjc control buffer */
103 + /* Device-dependent part for async lines. */
104 + ext_accm sc_asyncmap; /* async control character map */
105 + u_int32_t sc_rasyncmap; /* receive async control char map */
106 + struct mbuf *sc_outm; /* mbuf chain currently being output */
107 + struct mbuf *sc_m; /* pointer to input mbuf chain */
108 + struct mbuf *sc_mc; /* pointer to current input mbuf */
109 + char *sc_mp; /* ptr to next char in input mbuf */
110 + u_int16_t sc_ilen; /* length of input packet so far */
111 + u_int16_t sc_fcs; /* FCS so far (input) */
112 + u_int16_t sc_outfcs; /* FCS so far for output packet */
113 + u_char sc_rawin[16]; /* chars as received */
114 + int sc_rawin_count; /* # in sc_rawin */
118 +struct ppp_softc ppp_softc[NPPP];
120 +struct ppp_softc *pppalloc __P((pid_t pid));
121 +void pppdealloc __P((struct ppp_softc *sc));
122 +int pppioctl __P((struct ppp_softc *sc, u_long cmd, caddr_t data,
123 + int flag, struct proc *p));
124 +void ppp_restart __P((struct ppp_softc *sc));
125 +void ppppktin __P((struct ppp_softc *sc, struct mbuf *m, int lost));
126 +struct mbuf *ppp_dequeue __P((struct ppp_softc *sc));
127 +int pppoutput __P((struct ifnet *, struct mbuf *,
128 + struct sockaddr *, struct rtentry *));
129 +#endif /* _KERNEL */
131 +#endif /* _NET_IF_PPPVAR_H_ */