lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 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) 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 990911== |
| 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 | #define NP_IP 0 /* Internet Protocol */ |
| 62 | #define NP_IPX 1 /* IPX protocol */ |
| 63 | #define NP_AT 2 /* Appletalk protocol */ |
| 64 | #define NP_IPV6 3 /* Internet Protocol */ |
| 65 | #define NUM_NP 4 /* Number of NPs. */ |
| 66 | |
| 67 | #define OBUFSIZE 256 /* # chars of output buffering */ |
| 68 | |
| 69 | /* |
| 70 | * Structure describing each ppp unit. |
| 71 | */ |
| 72 | |
| 73 | struct ppp { |
| 74 | int magic; /* magic value for structure */ |
| 75 | struct ppp *next; /* unit with next index */ |
| 76 | unsigned long inuse; /* are we allocated? */ |
| 77 | int line; /* network interface unit # */ |
| 78 | __u32 flags; /* miscellaneous control flags */ |
| 79 | int mtu; /* maximum xmit frame size */ |
| 80 | int mru; /* maximum receive frame size */ |
| 81 | struct slcompress *slcomp; /* for TCP header compression */ |
| 82 | struct sk_buff_head xmt_q; /* frames to send from pppd */ |
| 83 | struct sk_buff_head rcv_q; /* frames for pppd to read */ |
| 84 | unsigned long xmit_busy; /* bit 0 set when xmitter busy */ |
| 85 | |
| 86 | /* Information specific to using ppp on async serial lines. */ |
| 87 | struct tty_struct *tty; /* ptr to TTY structure */ |
| 88 | struct tty_struct *backup_tty; /* TTY to use if tty gets closed */ |
| 89 | __u8 escape; /* 0x20 if prev char was PPP_ESC */ |
| 90 | __u8 toss; /* toss this frame */ |
| 91 | volatile __u8 tty_pushing; /* internal state flag */ |
| 92 | volatile __u8 woke_up; /* internal state flag */ |
| 93 | __u32 xmit_async_map[8]; /* 1 bit means that given control |
| 94 | character is quoted on output*/ |
| 95 | __u32 recv_async_map; /* 1 bit means that given control |
| 96 | character is ignored on input*/ |
| 97 | __u32 bytes_sent; /* Bytes sent on frame */ |
| 98 | __u32 bytes_rcvd; /* Bytes recvd on frame */ |
| 99 | |
| 100 | /* Async transmission information */ |
| 101 | struct sk_buff *tpkt; /* frame currently being sent */ |
| 102 | int tpkt_pos; /* how much of it we've done */ |
| 103 | __u16 tfcs; /* FCS so far for it */ |
| 104 | unsigned char *optr; /* where we're up to in sending */ |
| 105 | unsigned char *olim; /* points past last valid char */ |
| 106 | |
| 107 | /* Async reception information */ |
| 108 | struct sk_buff *rpkt; /* frame currently being rcvd */ |
| 109 | __u16 rfcs; /* FCS so far of rpkt */ |
| 110 | |
| 111 | /* Queues for select() functionality */ |
| 112 | struct wait_queue *read_wait; /* queue for reading processes */ |
| 113 | |
| 114 | /* info for detecting idle channels */ |
| 115 | unsigned long last_xmit; /* time of last transmission */ |
| 116 | unsigned long last_recv; /* time last packet received */ |
| 117 | |
| 118 | /* Statistic information */ |
| 119 | struct pppstat stats; /* statistic information */ |
| 120 | |
| 121 | /* PPP compression protocol information */ |
| 122 | struct compressor *sc_xcomp; /* transmit compressor */ |
| 123 | void *sc_xc_state; /* transmit compressor state */ |
| 124 | struct compressor *sc_rcomp; /* receive decompressor */ |
| 125 | void *sc_rc_state; /* receive decompressor state */ |
| 126 | |
| 127 | enum NPmode sc_npmode[NUM_NP]; /* what to do with each NP */ |
| 128 | int sc_xfer; /* PID of reserved PPP table */ |
| 129 | char name[8]; /* space for unit name */ |
| 130 | struct device dev; /* net device structure */ |
| 131 | struct enet_statistics estats; /* more detailed stats */ |
| 132 | |
| 133 | /* tty output buffer */ |
| 134 | unsigned char obuf[OBUFSIZE]; /* buffer for characters to send */ |
| 135 | }; |
| 136 | |
| 137 | #define PPP_MAGIC 0x5002 |
| 138 | #define PPP_VERSION "2.3.11" |