1 /* $Id: if_pppvar.h,v 1.1 1994/12/08 01:59:58 paulus Exp $ */
3 * if_pppvar.h - private structures and declarations for PPP.
5 * Copyright (c) 1994 The Australian National University.
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
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
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,
28 * Copyright (c) 1989 Carnegie Mellon University.
29 * All rights reserved.
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.
45 * Supported network protocols. These values are used for
49 #define NP_IP 0 /* Internet Protocol */
50 #define NUM_NP 1 /* Number of NPs. */
53 * Buffers for the PPP process have the following structure
56 #define RBUFSIZE 2048 /* MUST be a power of 2 and be <= 4095 */
58 int size; /* Size of the buffer area */
59 int count; /* Count of characters in bufr */
60 int head; /* index to head of list */
61 int tail; /* index to tail of list */
62 int locked; /* Buffer is being sent */
63 int type; /* Type of the buffer */
64 /* =0, device read buffer */
65 /* =1, device write buffer */
66 /* =2, daemon write buffer */
67 /* =3, daemon read buffer */
68 unsigned short fcs; /* Frame Check Sequence (CRC) */
71 /* Given a pointer to the ppp_buffer then return base address of buffer */
72 #define buf_base(buf) ((u_char *) (&buf[1]))
75 * Structure describing each ppp unit.
79 int magic; /* magic value for structure */
81 /* Bitmapped flag fields. */
82 char inuse; /* are we allocated? */
83 char escape; /* 0x20 if prev char was PPP_ESC*/
84 char toss; /* toss this frame */
86 unsigned int flags; /* miscellany */
88 ext_accm xmit_async_map; /* 1 bit means that given control
89 character is quoted on output*/
91 unsigned long recv_async_map; /* 1 bit means that given control
92 character is ignored on input*/
93 int mtu; /* maximum xmit frame size */
94 int mru; /* maximum receive frame size */
96 /* Information about the current tty data */
97 int line; /* PPP channel number */
98 struct tty_struct *tty; /* ptr to TTY structure */
99 int bytes_sent; /* Bytes sent on frame */
100 int bytes_rcvd; /* Bytes recvd on frame */
102 /* Interface to the network layer */
103 struct device *dev; /* easy for intr handling */
105 /* VJ Header compression data */
106 struct slcompress *slcomp;/* for header compression */
108 /* Transmission information */
109 struct ppp_buffer *xbuf; /* Buffer currently being sent */
110 struct ppp_buffer *s1buf; /* Pointer to daemon buffer */
111 struct ppp_buffer *s2buf; /* Pointer to device buffer */
113 unsigned long last_xmit; /* time of last transmission */
115 /* These are pointers to the malloc()ed frame buffers.
116 These buffers are used while processing a packet. If a packet
117 has to hang around for the user process to read it, it lingers in
118 the user buffers below. */
120 struct ppp_buffer *wbuf; /* Transmission information */
121 struct ppp_buffer *tbuf; /* daemon transmission buffer */
122 struct ppp_buffer *rbuf; /* Receive information */
123 struct ppp_buffer *ubuf; /* User buffer information */
124 struct ppp_buffer *cbuf; /* compression buffer */
126 /* Queues for select() functionality */
127 struct wait_queue *write_wait; /* queue for reading processes */
128 struct wait_queue *read_wait; /* queue for writing processes */
130 /* Statistic information */
131 struct pppstat p; /* statistic information */
132 struct ppp_ddinfo ddinfo; /* demand dial information */
134 /* PPP compression protocol information */
135 u_int sc_bytessent; /* count of octets sent */
136 u_int sc_bytesrcvd; /* count of octets received */
137 enum NPmode sc_npmode[NUM_NP]; /* what to do with each NP */
138 struct compressor *sc_xcomp; /* transmit compressor */
139 void *sc_xc_state; /* transmit compressor state */
140 struct compressor *sc_rcomp; /* receive decompressor */
141 void *sc_rc_state; /* receive decompressor state */