Commit | Line | Data |
---|---|---|
8b3438a6 RG |
1 | /* |
2 | * if_ppp.h - Point-to-Point Protocol definitions. | |
3 | * | |
4 | * Copyright (c) 1989 Carnegie Mellon University. | |
5 | * All rights reserved. | |
6 | * | |
7 | * Redistribution and use in source and binary forms are permitted | |
8 | * provided that the above copyright notice and this paragraph are | |
9 | * duplicated in all such forms and that any documentation, | |
10 | * advertising materials, and other materials related to such | |
11 | * distribution and use acknowledge that the software was developed | |
12 | * by Carnegie Mellon University. The name of the | |
13 | * University may not be used to endorse or promote products derived | |
14 | * from this software without specific prior written permission. | |
15 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
16 | * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
17 | * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
18 | * | |
19 | * Modified by Paul Mackerras (paulus@cs.anu.edu.au) | |
2875cbc6 | 20 | * Added PPP_MRU, sc_outm, sc_fastq, sc_bpf. |
8b3438a6 | 21 | * |
8ace4366 | 22 | * $Id: if_ppp.h,v 1.2 1993/08/31 05:40:38 rgrimes Exp $ |
2875cbc6 | 23 | * From: if_ppp.h,v 1.4 1993/08/29 11:22:37 paulus Exp $ |
8b3438a6 RG |
24 | */ |
25 | ||
8ace4366 GW |
26 | #ifndef _NET_IF_PPP_H_ |
27 | #define _NET_IF_PPP_H_ 1 | |
28 | ||
8b3438a6 RG |
29 | /* |
30 | * Standard PPP header. | |
31 | */ | |
32 | struct ppp_header { | |
33 | u_char ph_address; /* Address Field */ | |
34 | u_char ph_control; /* Control Field */ | |
35 | u_short ph_protocol; /* Protocol Field */ | |
36 | }; | |
37 | ||
2875cbc6 RG |
38 | #define PPP_HEADER_LEN 4 /* octets, must == sizeof(struct ppp_header) */ |
39 | #define PPP_FCS_LEN 2 /* octets for FCS */ | |
40 | ||
8b3438a6 RG |
41 | #define PPP_ALLSTATIONS 0xff /* All-Stations broadcast address */ |
42 | #define PPP_UI 0x03 /* Unnumbered Information */ | |
43 | #define PPP_FLAG 0x7e /* Flag Sequence */ | |
44 | #define PPP_ESCAPE 0x7d /* Asynchronous Control Escape */ | |
45 | #define PPP_TRANS 0x20 /* Asynchronous transparency modifier */ | |
46 | ||
47 | /* | |
48 | * Protocol types. | |
49 | */ | |
50 | #define PPP_IP 0x21 /* Internet Protocol */ | |
51 | #define PPP_XNS 0x25 /* Xerox NS */ | |
52 | #define PPP_VJC_COMP 0x2d /* VJ compressed TCP */ | |
53 | #define PPP_VJC_UNCOMP 0x2f /* VJ uncompressed TCP */ | |
54 | #define PPP_LCP 0xc021 /* Link Control Protocol */ | |
55 | ||
56 | /* | |
57 | * Important FCS values. | |
58 | */ | |
59 | #define PPP_INITFCS 0xffff /* Initial FCS value */ | |
60 | #define PPP_GOODFCS 0xf0b8 /* Good final FCS value */ | |
61 | #define PPP_FCS(fcs, c) (((fcs) >> 8) ^ fcstab[((fcs) ^ (c)) & 0xff]) | |
62 | ||
2875cbc6 | 63 | #define PPP_MTU 1500 /* Default MTU (size of Info field) */ |
8b3438a6 | 64 | #define PPP_MRU 1500 /* Default MRU (max receive unit) */ |
2875cbc6 | 65 | #define PPP_MAXMRU 65000 /* Largest MRU we allow */ |
8b3438a6 RG |
66 | #define PPP_HIWAT 400 /* Don't start a new packet if HIWAT on que */ |
67 | ||
68 | struct ppp_softc { | |
69 | struct ifnet sc_if; /* network-visible interface */ | |
70 | u_int sc_flags; /* see below */ | |
71 | struct tty *sc_ttyp; /* pointer to tty structure */ | |
72 | struct mbuf *sc_outm; /* mbuf chain being output currently */ | |
73 | struct mbuf *sc_m; /* pointer to input mbuf chain */ | |
74 | struct mbuf *sc_mc; /* pointer to current input mbuf */ | |
75 | char *sc_mp; /* pointer to next char in input mbuf */ | |
76 | short sc_ilen; /* length of input-packet-so-far */ | |
2875cbc6 RG |
77 | u_short sc_fcs; /* FCS so far (input) */ |
78 | u_short sc_outfcs; /* FCS so far for output packet */ | |
79 | short sc_mru; /* max receive unit */ | |
8b3438a6 | 80 | u_long sc_asyncmap; /* async control character map */ |
2875cbc6 | 81 | u_long sc_rasyncmap; /* receive async control char map */ |
8b3438a6 | 82 | struct ifqueue sc_inq; /* TTY side input queue */ |
2875cbc6 | 83 | struct ifqueue sc_fastq; /* IP interactive output packet queue */ |
8b3438a6 RG |
84 | #ifdef VJC |
85 | struct slcompress sc_comp; /* vjc control buffer */ | |
86 | #endif | |
87 | u_int sc_bytessent; | |
88 | u_int sc_bytesrcvd; | |
2875cbc6 | 89 | caddr_t sc_bpf; |
8b3438a6 RG |
90 | }; |
91 | ||
92 | /* flags */ | |
2875cbc6 RG |
93 | #define SC_COMP_PROT 0x00000001 /* protocol compression (output) */ |
94 | #define SC_COMP_AC 0x00000002 /* header compression (output) */ | |
95 | #define SC_COMP_TCP 0x00000004 /* TCP (VJ) compression (output) */ | |
96 | #define SC_NO_TCP_CCID 0x00000008 /* disable VJ connection-id comp. */ | |
97 | #define SC_REJ_COMP_AC 0x00000010 /* reject adrs/ctrl comp. on input */ | |
98 | #define SC_REJ_COMP_TCP 0x00000020 /* reject TCP (VJ) comp. on input */ | |
99 | #define SC_MASK 0x0000ffff /* bits that user can change */ | |
100 | ||
101 | /* state bits */ | |
8b3438a6 RG |
102 | #define SC_ESCAPED 0x00010000 /* saw a PPP_ESCAPE */ |
103 | #define SC_FLUSH 0x00020000 /* flush input until next PPP_FLAG */ | |
8b3438a6 RG |
104 | |
105 | #define t_sc T_LINEP | |
106 | ||
107 | /* this stuff doesn't belong here... */ | |
108 | #define PPPIOCGFLAGS _IOR('t', 90, int) /* get configuration flags */ | |
109 | #define PPPIOCSFLAGS _IOW('t', 89, int) /* set configuration flags */ | |
110 | #define PPPIOCGASYNCMAP _IOR('t', 88, int) /* get async map */ | |
111 | #define PPPIOCSASYNCMAP _IOW('t', 87, int) /* set async map */ | |
112 | #define PPPIOCGUNIT _IOR('t', 86, int) /* get ppp unit number */ | |
2875cbc6 RG |
113 | #define PPPIOCGRASYNCMAP _IOR('t', 85, int) /* get receive async map */ |
114 | #define PPPIOCSRASYNCMAP _IOW('t', 84, int) /* set receive async map */ | |
115 | #define PPPIOCGMRU _IOR('t', 83, int) /* get max receive unit */ | |
116 | #define PPPIOCSMRU _IOW('t', 82, int) /* set max receive unit */ | |
8b3438a6 RG |
117 | |
118 | /* old copies of PPP may have defined this */ | |
119 | #if !defined(ifr_mtu) | |
120 | #define ifr_mtu ifr_metric | |
121 | #endif | |
122 | ||
8ace4366 | 123 | #endif /* _NET_IF_PPP_H_ */ |