]> git.saurik.com Git - apple/xnu.git/blob - bsd/net/if_pppvar.h
xnu-344.tar.gz
[apple/xnu.git] / bsd / net / if_pppvar.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 /*
23 * if_pppvar.h - private structures and declarations for PPP.
24 *
25 * Copyright (c) 1994 The Australian National University.
26 * All rights reserved.
27 *
28 * Permission to use, copy, modify, and distribute this software and its
29 * documentation is hereby granted, provided that the above copyright
30 * notice appears in all copies. This software is provided without any
31 * warranty, express or implied. The Australian National University
32 * makes no representations about the suitability of this software for
33 * any purpose.
34 *
35 * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
36 * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
37 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
38 * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
39 * OF SUCH DAMAGE.
40 *
41 * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
42 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
43 * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
44 * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
45 * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
46 * OR MODIFICATIONS.
47 *
48 * Copyright (c) 1989 Carnegie Mellon University.
49 * All rights reserved.
50 *
51 * Redistribution and use in source and binary forms are permitted
52 * provided that the above copyright notice and this paragraph are
53 * duplicated in all such forms and that any documentation,
54 * advertising materials, and other materials related to such
55 * distribution and use acknowledge that the software was developed
56 * by Carnegie Mellon University. The name of the
57 * University may not be used to endorse or promote products derived
58 * from this software without specific prior written permission.
59 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
60 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
61 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
62 *
63 * $FreeBSD: src/sys/net/if_pppvar.h,v 1.15 2000/01/29 16:56:23 peter Exp $
64 */
65
66 #include <sys/appleapiopts.h>
67 #ifndef DONT_WARN_OBSOLETE
68 #warning if_pppvar.h is not used by the darwin kernel
69 #endif
70
71 #ifdef __APPLE_API_PRIVATE
72
73 /*
74 * Supported network protocols. These values are used for
75 * indexing sc_npmode.
76 */
77 #define NP_IP 0 /* Internet Protocol */
78 #define NUM_NP 1 /* Number of NPs. */
79
80 /*
81 * Structure describing each ppp unit.
82 */
83 struct ppp_softc {
84 struct ifnet sc_if; /* network-visible interface */
85 /*hi*/ u_int sc_flags; /* control/status bits; see if_ppp.h */
86 struct callout_handle sc_ch; /* Used for scheduling timeouts */
87 void *sc_devp; /* pointer to device-dep structure */
88 void (*sc_start) __P((struct ppp_softc *)); /* start output proc */
89 void (*sc_ctlp) __P((struct ppp_softc *)); /* rcvd control pkt */
90 void (*sc_relinq) __P((struct ppp_softc *)); /* relinquish ifunit */
91 void (*sc_setmtu) __P((struct ppp_softc *)); /* set mtu */
92 short sc_mru; /* max receive unit */
93 pid_t sc_xfer; /* used in transferring unit */
94 /*hi*/ struct ifqueue sc_rawq; /* received packets */
95 /*net*/ struct ifqueue sc_inq; /* queue of input packets for daemon */
96 /*net*/ struct ifqueue sc_fastq; /* interactive output packet q */
97 struct mbuf *sc_npqueue; /* output packets not to be sent yet */
98 struct mbuf **sc_npqtail; /* ptr to last next ptr in npqueue */
99 struct pppstat sc_stats; /* count of bytes/pkts sent/rcvd */
100 enum NPmode sc_npmode[NUM_NP]; /* what to do with each NP */
101 struct compressor *sc_xcomp; /* transmit compressor */
102 void *sc_xc_state; /* transmit compressor state */
103 struct compressor *sc_rcomp; /* receive decompressor */
104 void *sc_rc_state; /* receive decompressor state */
105 time_t sc_last_sent; /* time (secs) last NP pkt sent */
106 time_t sc_last_recv; /* time (secs) last NP pkt rcvd */
107 #if PPP_FILTER
108 struct bpf_program sc_pass_filt; /* filter for packets to pass */
109 struct bpf_program sc_active_filt; /* filter for "non-idle" packets */
110 #endif /* PPP_FILTER */
111 #if VJC
112 struct slcompress *sc_comp; /* vjc control buffer */
113 #endif
114
115 /* Device-dependent part for async lines. */
116 ext_accm sc_asyncmap; /* async control character map */
117 u_long sc_rasyncmap; /* receive async control char map */
118 struct mbuf *sc_outm; /* mbuf chain currently being output */
119 struct mbuf *sc_m; /* pointer to input mbuf chain */
120 struct mbuf *sc_mc; /* pointer to current input mbuf */
121 char *sc_mp; /* ptr to next char in input mbuf */
122 short sc_ilen; /* length of input packet so far */
123 u_short sc_fcs; /* FCS so far (input) */
124 u_short sc_outfcs; /* FCS so far for output packet */
125 u_char sc_rawin[16]; /* chars as received */
126 int sc_rawin_count; /* # in sc_rawin */
127 };
128
129 extern struct ppp_softc ppp_softc[];
130
131 struct ppp_softc *pppalloc __P((pid_t pid));
132 void pppdealloc __P((struct ppp_softc *sc));
133 int pppioctl __P((struct ppp_softc *sc, u_long cmd, caddr_t data,
134 int flag, struct proc *p));
135 int pppoutput __P((struct ifnet *ifp, struct mbuf *m0,
136 struct sockaddr *dst, struct rtentry *rtp));
137 void ppp_restart __P((struct ppp_softc *sc));
138 void ppppktin __P((struct ppp_softc *sc, struct mbuf *m, int lost));
139 struct mbuf *ppp_dequeue __P((struct ppp_softc *sc));
140 #endif /* __APPLE_API_PRIVATE */