]> git.karo-electronics.de Git - karo-tx-redboot.git/blob - packages/net/ppp/v2_0/include/net/if_pppvar.h
Initial revision
[karo-tx-redboot.git] / packages / net / ppp / v2_0 / include / net / if_pppvar.h
1 //==========================================================================
2 //
3 //      include/net/if_pppvar.h
4 //
5 //==========================================================================
6 //####ECOSGPLCOPYRIGHTBEGIN####
7 // -------------------------------------------
8 // This file is part of eCos, the Embedded Configurable Operating System.
9 // Portions created by Nick Garnett are
10 // Copyright (C) 2003 eCosCentric Ltd.
11 //
12 // eCos is free software; you can redistribute it and/or modify it under
13 // the terms of the GNU General Public License as published by the Free
14 // Software Foundation; either version 2 or (at your option) any later version.
15 //
16 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
17 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19 // for more details.
20 //
21 // You should have received a copy of the GNU General Public License along
22 // with eCos; if not, write to the Free Software Foundation, Inc.,
23 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
24 //
25 // As a special exception, if other files instantiate templates or use macros
26 // or inline functions from this file, or you compile this file and link it
27 // with other works to produce a work based on this file, this file does not
28 // by itself cause the resulting work to be covered by the GNU General Public
29 // License. However the source code for this file must still be made available
30 // in accordance with section (3) of the GNU General Public License.
31 //
32 // This exception does not invalidate any other reasons why a work based on
33 // this file might be covered by the GNU General Public License.
34 //
35 // -------------------------------------------
36 //####ECOSGPLCOPYRIGHTEND####
37 //####BSDCOPYRIGHTBEGIN####
38 //
39 // -------------------------------------------
40 //
41 // Portions of this software may have been derived from OpenBSD, 
42 // FreeBSD or other sources, and are covered by the appropriate
43 // copyright disclaimers included herein.
44 //
45 // -------------------------------------------
46 //
47 //####BSDCOPYRIGHTEND####
48 //==========================================================================
49
50 /*
51  * if_pppvar.h - private structures and declarations for PPP.
52  *
53  * Copyright (c) 1994 The Australian National University.
54  * All rights reserved.
55  *
56  * Permission to use, copy, modify, and distribute this software and its
57  * documentation is hereby granted, provided that the above copyright
58  * notice appears in all copies.  This software is provided without any
59  * warranty, express or implied. The Australian National University
60  * makes no representations about the suitability of this software for
61  * any purpose.
62  *
63  * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
64  * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
65  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
66  * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
67  * OF SUCH DAMAGE.
68  *
69  * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
70  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
71  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
72  * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
73  * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
74  * OR MODIFICATIONS.
75  *
76  * Copyright (c) 1989 Carnegie Mellon University.
77  * All rights reserved.
78  *
79  * Redistribution and use in source and binary forms are permitted
80  * provided that the above copyright notice and this paragraph are
81  * duplicated in all such forms and that any documentation,
82  * advertising materials, and other materials related to such
83  * distribution and use acknowledge that the software was developed
84  * by Carnegie Mellon University.  The name of the
85  * University may not be used to endorse or promote products derived
86  * from this software without specific prior written permission.
87  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
88  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
89  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
90  *
91  * $FreeBSD: src/sys/net/if_pppvar.h,v 1.15 2000/01/29 16:56:23 peter Exp $
92  */
93
94 /*
95  * Supported network protocols.  These values are used for
96  * indexing sc_npmode.
97  */
98 #define NP_IP   0               /* Internet Protocol */
99 #define NUM_NP  1               /* Number of NPs. */
100
101 /*
102  * Structure describing each ppp unit.
103  */
104 struct ppp_softc {
105         struct  ifnet sc_if;            /* network-visible interface */
106 /*hi*/  u_int   sc_flags;               /* control/status bits; see if_ppp.h */
107 //      struct  callout_handle sc_ch;   /* Used for scheduling timeouts */
108         void    *sc_devp;               /* pointer to device-dep structure */
109 //        int     sc_fd;                  /* TTY file descriptor */
110         void    (*sc_start) __P((struct ppp_softc *));  /* start output proc */
111         void    (*sc_ctlp) __P((struct ppp_softc *)); /* rcvd control pkt */
112         void    (*sc_relinq) __P((struct ppp_softc *)); /* relinquish ifunit */
113         void    (*sc_setmtu) __P((struct ppp_softc *)); /* set mtu */
114         short   sc_mru;                 /* max receive unit */
115         pid_t   sc_xfer;                /* used in transferring unit */
116 /*hi*/  struct  ifqueue sc_rawq;        /* received packets */
117 /*net*/ struct  ifqueue sc_inq;         /* queue of input packets for daemon */
118 /*net*/ struct  ifqueue sc_fastq;       /* interactive output packet q */
119         struct  mbuf *sc_npqueue;       /* output packets not to be sent yet */
120         struct  mbuf **sc_npqtail;      /* ptr to last next ptr in npqueue */
121         struct  pppstat sc_stats;       /* count of bytes/pkts sent/rcvd */
122         enum    NPmode sc_npmode[NUM_NP]; /* what to do with each NP */
123         struct  compressor *sc_xcomp;   /* transmit compressor */
124         void    *sc_xc_state;           /* transmit compressor state */
125         struct  compressor *sc_rcomp;   /* receive decompressor */
126         void    *sc_rc_state;           /* receive decompressor state */
127         time_t  sc_last_sent;           /* time (secs) last NP pkt sent */
128         time_t  sc_last_recv;           /* time (secs) last NP pkt rcvd */
129 #ifdef PPP_FILTER
130         struct  bpf_program sc_pass_filt;   /* filter for packets to pass */
131         struct  bpf_program sc_active_filt; /* filter for "non-idle" packets */
132 #endif /* PPP_FILTER */
133 #ifdef  VJC
134         struct  slcompress *sc_comp;    /* vjc control buffer */
135 #endif
136
137         /* Device-dependent part for async lines. */
138         ext_accm sc_asyncmap;           /* async control character map */
139         u_long  sc_rasyncmap;           /* receive async control char map */
140         struct  mbuf *sc_outm;          /* mbuf chain currently being output */
141         struct  mbuf *sc_m;             /* pointer to input mbuf chain */
142         struct  mbuf *sc_mc;            /* pointer to current input mbuf */
143         char    *sc_mp;                 /* ptr to next char in input mbuf */
144         short   sc_ilen;                /* length of input packet so far */
145         u_short sc_fcs;                 /* FCS so far (input) */
146         u_short sc_outfcs;              /* FCS so far for output packet */
147         u_char  sc_rawin[16];           /* chars as received */
148         int     sc_rawin_count;         /* # in sc_rawin */
149 };
150
151 extern struct ppp_softc ppp_softc[];
152
153 struct  ppp_softc *pppalloc __P((pid_t pid));
154 void    pppdealloc __P((struct ppp_softc *sc));
155 int     pppioctl __P((struct ppp_softc *sc, u_long cmd, caddr_t data,
156                       int flag, struct proc *p));
157 int     pppoutput __P((struct ifnet *ifp, struct mbuf *m0,
158                        struct sockaddr *dst, struct rtentry *rtp));
159 void    ppp_restart __P((struct ppp_softc *sc));
160 void    ppppktin __P((struct ppp_softc *sc, struct mbuf *m, int lost));
161 struct  mbuf *ppp_dequeue __P((struct ppp_softc *sc));