1 |
1633 |
jcastillo |
/* $Id: if_pppvar.h,v 1.1 2005-12-20 11:32:24 jcastillo Exp $ */
|
2 |
|
|
/*
|
3 |
|
|
* if_pppvar.h - private structures and declarations for PPP.
|
4 |
|
|
*
|
5 |
|
|
* Copyright (c) 1994 The Australian National University.
|
6 |
|
|
* All rights reserved.
|
7 |
|
|
*
|
8 |
|
|
* Permission to use, copy, modify, and distribute this software and its
|
9 |
|
|
* documentation is hereby granted, provided that the above copyright
|
10 |
|
|
* notice appears in all copies. This software is provided without any
|
11 |
|
|
* warranty, express or implied. The Australian National University
|
12 |
|
|
* makes no representations about the suitability of this software for
|
13 |
|
|
* any purpose.
|
14 |
|
|
*
|
15 |
|
|
* IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
|
16 |
|
|
* PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
|
17 |
|
|
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
|
18 |
|
|
* THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
|
19 |
|
|
* OF SUCH DAMAGE.
|
20 |
|
|
*
|
21 |
|
|
* THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
|
22 |
|
|
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
23 |
|
|
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
|
24 |
|
|
* ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
|
25 |
|
|
* OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
|
26 |
|
|
* OR MODIFICATIONS.
|
27 |
|
|
*
|
28 |
|
|
* Copyright (c) 1989 Carnegie Mellon University.
|
29 |
|
|
* All rights reserved.
|
30 |
|
|
*
|
31 |
|
|
* Redistribution and use in source and binary forms are permitted
|
32 |
|
|
* provided that the above copyright notice and this paragraph are
|
33 |
|
|
* duplicated in all such forms and that any documentation,
|
34 |
|
|
* advertising materials, and other materials related to such
|
35 |
|
|
* distribution and use acknowledge that the software was developed
|
36 |
|
|
* by Carnegie Mellon University. The name of the
|
37 |
|
|
* University may not be used to endorse or promote products derived
|
38 |
|
|
* from this software without specific prior written permission.
|
39 |
|
|
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
|
40 |
|
|
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
41 |
|
|
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
42 |
|
|
*/
|
43 |
|
|
|
44 |
|
|
/*
|
45 |
|
|
* ==FILEVERSION 960302==
|
46 |
|
|
*
|
47 |
|
|
* NOTE TO MAINTAINERS:
|
48 |
|
|
* If you modify this file at all, please set the above date.
|
49 |
|
|
* if_pppvar.h is shipped with a PPP distribution as well as with the kernel;
|
50 |
|
|
* if everyone increases the FILEVERSION number above, then scripts
|
51 |
|
|
* can do the right thing when deciding whether to install a new if_pppvar.h
|
52 |
|
|
* file. Don't change the format of that line otherwise, so the
|
53 |
|
|
* installation script can recognize it.
|
54 |
|
|
*/
|
55 |
|
|
|
56 |
|
|
/*
|
57 |
|
|
* Supported network protocols. These values are used for
|
58 |
|
|
* indexing sc_npmode.
|
59 |
|
|
*/
|
60 |
|
|
|
61 |
|
|
/*
|
62 |
|
|
* ppp->inuse should be 32 bits -- kja
|
63 |
|
|
*/
|
64 |
|
|
|
65 |
|
|
#define NP_IP 0 /* Internet Protocol */
|
66 |
|
|
#define NUM_NP 1 /* Number of NPs. */
|
67 |
|
|
|
68 |
|
|
/*
|
69 |
|
|
* Buffers for the PPP process have the following structure
|
70 |
|
|
*/
|
71 |
|
|
|
72 |
|
|
#define RBUFSIZE 2048 /* MUST be a power of 2 and be <= 4095 */
|
73 |
|
|
|
74 |
|
|
struct ppp_buffer {
|
75 |
|
|
__s32 size; /* Size of the buffer area */
|
76 |
|
|
__s32 count; /* Count of characters in bufr */
|
77 |
|
|
__s32 head; /* index to head of list */
|
78 |
|
|
__s32 tail; /* index to tail of list */
|
79 |
|
|
__u32 locked; /* Buffer is being sent */
|
80 |
|
|
__s32 type; /* Type of the buffer */
|
81 |
|
|
/* =0, device read buffer */
|
82 |
|
|
/* =1, device write buffer */
|
83 |
|
|
/* =2, daemon write buffer */
|
84 |
|
|
/* =3, daemon read buffer */
|
85 |
|
|
__u16 fcs; /* Frame Check Sequence (CRC) */
|
86 |
|
|
__u8 filler[4]; /* Extra space if needed */
|
87 |
|
|
};
|
88 |
|
|
|
89 |
|
|
/* Given a pointer to the ppp_buffer then return base address of buffer */
|
90 |
|
|
#define buf_base(buf) ((__u8 *) (&buf[1]))
|
91 |
|
|
|
92 |
|
|
/*
|
93 |
|
|
* Structure describing each ppp unit.
|
94 |
|
|
*/
|
95 |
|
|
|
96 |
|
|
struct ppp {
|
97 |
|
|
__s32 magic; /* magic value for structure */
|
98 |
|
|
|
99 |
|
|
/* Bitmapped flag fields. */
|
100 |
|
|
__u32 inuse; /* are we allocated? u8 on intel*/
|
101 |
|
|
__u8 escape; /* 0x20 if prev char was PPP_ESC*/
|
102 |
|
|
__u8 toss; /* toss this frame */
|
103 |
|
|
|
104 |
|
|
__u32 flags; /* miscellany */
|
105 |
|
|
|
106 |
|
|
__u32 xmit_async_map[8]; /* 1 bit means that given control
|
107 |
|
|
character is quoted on output*/
|
108 |
|
|
|
109 |
|
|
__u32 recv_async_map; /* 1 bit means that given control
|
110 |
|
|
character is ignored on input*/
|
111 |
|
|
__s32 mtu; /* maximum xmit frame size */
|
112 |
|
|
__s32 mru; /* maximum receive frame size */
|
113 |
|
|
|
114 |
|
|
/* Information about the current tty data */
|
115 |
|
|
__s32 line; /* PPP channel number */
|
116 |
|
|
struct tty_struct *tty; /* ptr to TTY structure */
|
117 |
|
|
__s32 bytes_sent; /* Bytes sent on frame */
|
118 |
|
|
__s32 bytes_rcvd; /* Bytes recvd on frame */
|
119 |
|
|
|
120 |
|
|
/* Interface to the network layer */
|
121 |
|
|
struct device *dev; /* easy for intr handling */
|
122 |
|
|
|
123 |
|
|
/* VJ Header compression data */
|
124 |
|
|
struct slcompress *slcomp; /* for header compression */
|
125 |
|
|
|
126 |
|
|
/* Transmission information */
|
127 |
|
|
struct ppp_buffer *xbuf; /* Buffer currently being sent */
|
128 |
|
|
struct ppp_buffer *s1buf; /* Pointer to daemon buffer */
|
129 |
|
|
struct ppp_buffer *s2buf; /* Pointer to device buffer */
|
130 |
|
|
|
131 |
|
|
__u32 last_xmit; /* time of last transmission */
|
132 |
|
|
|
133 |
|
|
/* These are pointers to the malloc()ed frame buffers.
|
134 |
|
|
These buffers are used while processing a packet. If a packet
|
135 |
|
|
has to hang around for the user process to read it, it lingers in
|
136 |
|
|
the user buffers below. */
|
137 |
|
|
|
138 |
|
|
struct ppp_buffer *wbuf; /* Transmission information */
|
139 |
|
|
struct ppp_buffer *tbuf; /* daemon transmission buffer */
|
140 |
|
|
struct ppp_buffer *rbuf; /* Receive information */
|
141 |
|
|
struct ppp_buffer *ubuf; /* User buffer information */
|
142 |
|
|
struct ppp_buffer *cbuf; /* compression buffer */
|
143 |
|
|
|
144 |
|
|
/* Queues for select() functionality */
|
145 |
|
|
struct wait_queue *write_wait; /* queue for reading processes */
|
146 |
|
|
struct wait_queue *read_wait; /* queue for writing processes */
|
147 |
|
|
|
148 |
|
|
/* Statistic information */
|
149 |
|
|
struct pppstat stats; /* statistic information */
|
150 |
|
|
struct ppp_idle ddinfo; /* demand dial information */
|
151 |
|
|
|
152 |
|
|
/* PPP compression protocol information */
|
153 |
|
|
__u32 sc_bytessent; /* count of octets sent */
|
154 |
|
|
__u32 sc_bytesrcvd; /* count of octets received */
|
155 |
|
|
enum NPmode sc_npmode[NUM_NP]; /* what to do with each NP */
|
156 |
|
|
struct compressor *sc_xcomp; /* transmit compressor */
|
157 |
|
|
void *sc_xc_state; /* transmit compressor state */
|
158 |
|
|
struct compressor *sc_rcomp; /* receive decompressor */
|
159 |
|
|
void *sc_rc_state; /* receive decompressor state */
|
160 |
|
|
__s32 sc_xfer; /* PID of reserved PPP table */
|
161 |
|
|
};
|