1/* From: if_pppvar.h,v 1.2 1995/06/12 11:36:51 paulus Exp */ 2/* 3 * if_pppvar.h - private structures and declarations for PPP. 4 * 5 * Copyright (c) 1989-2002 Paul Mackerras. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 14 * 2. Redistributions in binary form must reproduce the above copyright 15 * notice, this list of conditions and the following disclaimer in 16 * the documentation and/or other materials provided with the 17 * distribution. 18 * 19 * 3. The name(s) of the authors of this software must not be used to 20 * endorse or promote products derived from this software without 21 * prior written permission. 22 * 23 * 4. Redistributions of any form whatsoever must retain the following 24 * acknowledgment: 25 * "This product includes software developed by Paul Mackerras 26 * <paulus@samba.org>". 27 * 28 * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO 29 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 30 * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY 31 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 32 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 33 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 34 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 35 * 36 * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved. 37 * 38 * Redistribution and use in source and binary forms, with or without 39 * modification, are permitted provided that the following conditions 40 * are met: 41 * 42 * 1. Redistributions of source code must retain the above copyright 43 * notice, this list of conditions and the following disclaimer. 44 * 45 * 2. Redistributions in binary form must reproduce the above copyright 46 * notice, this list of conditions and the following disclaimer in 47 * the documentation and/or other materials provided with the 48 * distribution. 49 * 50 * 3. The name "Carnegie Mellon University" must not be used to 51 * endorse or promote products derived from this software without 52 * prior written permission. For permission or any legal 53 * details, please contact 54 * Office of Technology Transfer 55 * Carnegie Mellon University 56 * 5000 Forbes Avenue 57 * Pittsburgh, PA 15213-3890 58 * (412) 268-4387, fax: (412) 268-7395 59 * tech-transfer@andrew.cmu.edu 60 * 61 * 4. Redistributions of any form whatsoever must retain the following 62 * acknowledgment: 63 * "This product includes software developed by Computing Services 64 * at Carnegie Mellon University (http://www.cmu.edu/computing/)." 65 * 66 * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO 67 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 68 * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE 69 * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 70 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 71 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 72 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 73 */ 74 75/* 76 * ==FILEVERSION 990911== 77 * 78 * NOTE TO MAINTAINERS: 79 * If you modify this file at all, please set the above date. 80 * if_pppvar.h is shipped with a PPP distribution as well as with the kernel; 81 * if everyone increases the FILEVERSION number above, then scripts 82 * can do the right thing when deciding whether to install a new if_pppvar.h 83 * file. Don't change the format of that line otherwise, so the 84 * installation script can recognize it. 85 */ 86 87/* 88 * Supported network protocols. These values are used for 89 * indexing sc_npmode. 90 */ 91 92#define NP_IP 0 /* Internet Protocol */ 93#define NP_IPX 1 /* IPX protocol */ 94#define NP_AT 2 /* Appletalk protocol */ 95#define NP_IPV6 3 /* Internet Protocol */ 96#define NUM_NP 4 /* Number of NPs. */ 97 98#define OBUFSIZE 256 /* # chars of output buffering */ 99 100/* 101 * Structure describing each ppp unit. 102 */ 103 104struct ppp { 105 int magic; /* magic value for structure */ 106 struct ppp *next; /* unit with next index */ 107 unsigned long inuse; /* are we allocated? */ 108 int line; /* network interface unit # */ 109 __u32 flags; /* miscellaneous control flags */ 110 int mtu; /* maximum xmit frame size */ 111 int mru; /* maximum receive frame size */ 112 struct slcompress *slcomp; /* for TCP header compression */ 113 struct sk_buff_head xmt_q; /* frames to send from pppd */ 114 struct sk_buff_head rcv_q; /* frames for pppd to read */ 115 unsigned long xmit_busy; /* bit 0 set when xmitter busy */ 116 117 /* Information specific to using ppp on async serial lines. */ 118 struct tty_struct *tty; /* ptr to TTY structure */ 119 struct tty_struct *backup_tty; /* TTY to use if tty gets closed */ 120 __u8 escape; /* 0x20 if prev char was PPP_ESC */ 121 __u8 toss; /* toss this frame */ 122 volatile __u8 tty_pushing; /* internal state flag */ 123 volatile __u8 woke_up; /* internal state flag */ 124 __u32 xmit_async_map[8]; /* 1 bit means that given control 125 character is quoted on output*/ 126 __u32 recv_async_map; /* 1 bit means that given control 127 character is ignored on input*/ 128 __u32 bytes_sent; /* Bytes sent on frame */ 129 __u32 bytes_rcvd; /* Bytes recvd on frame */ 130 131 /* Async transmission information */ 132 struct sk_buff *tpkt; /* frame currently being sent */ 133 int tpkt_pos; /* how much of it we've done */ 134 __u16 tfcs; /* FCS so far for it */ 135 unsigned char *optr; /* where we're up to in sending */ 136 unsigned char *olim; /* points past last valid char */ 137 138 /* Async reception information */ 139 struct sk_buff *rpkt; /* frame currently being rcvd */ 140 __u16 rfcs; /* FCS so far of rpkt */ 141 142 /* Queues for select() functionality */ 143 struct wait_queue *read_wait; /* queue for reading processes */ 144 145 /* info for detecting idle channels */ 146 unsigned long last_xmit; /* time of last transmission */ 147 unsigned long last_recv; /* time last packet received */ 148 149 /* Statistic information */ 150 struct pppstat stats; /* statistic information */ 151 152 /* PPP compression protocol information */ 153 struct compressor *sc_xcomp; /* transmit compressor */ 154 void *sc_xc_state; /* transmit compressor state */ 155 struct compressor *sc_rcomp; /* receive decompressor */ 156 void *sc_rc_state; /* receive decompressor state */ 157 158 enum NPmode sc_npmode[NUM_NP]; /* what to do with each NP */ 159 int sc_xfer; /* PID of reserved PPP table */ 160 char name[8]; /* space for unit name */ 161 struct device dev; /* net device structure */ 162 struct enet_statistics estats; /* more detailed stats */ 163 164 /* tty output buffer */ 165 unsigned char obuf[OBUFSIZE]; /* buffer for characters to send */ 166}; 167 168#define PPP_MAGIC 0x5002 169#define PPP_VERSION "2.3.11" 170