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