2 ppp_str.h - streams version include file
4 Copyright (C) 1990 Brad K. Clements, All Rights Reserved,
5 See copyright statement in NOTES
8 #include <sys/ioccom.h>
10 #define PPP_HDRLEN 4 /* octets for standard ppp header */
11 #define PPP_FCSLEN 2 /* octets for FCS */
13 #define PPP_ADDRESS(cp) ((cp)[0])
14 #define PPP_CONTROL(cp) ((cp)[1])
15 #define PPP_PROTOCOL(cp) (((cp)[2] << 8) + (cp)[3])
17 #define PPP_ALLSTATIONS 0xff /* All-Stations broadcast address */
18 #define PPP_UI 0x03 /* Unnumbered Information */
19 #define PPP_FLAG 0x7e /* Flag Sequence */
20 #define PPP_ESCAPE 0x7d /* Asynchronous Control Escape */
21 #define PPP_TRANS 0x20 /* Asynchronous transparency modifier */
24 * Protocol field values.
26 #define PPP_IP 0x21 /* Internet Protocol */
27 #define PPP_XNS 0x25 /* Xerox NS */
28 #define PPP_VJC_COMP 0x2d /* VJ compressed TCP */
29 #define PPP_VJC_UNCOMP 0x2f /* VJ uncompressed TCP */
30 #define PPP_COMP 0xfd /* compressed packet */
31 #define PPP_LCP 0xc021 /* Link Control Protocol */
32 #define PPP_CCP 0x80fd /* Compression Control Protocol */
35 * Important FCS values.
37 #define PPP_INITFCS 0xffff /* Initial FCS value */
38 #define PPP_GOODFCS 0xf0b8 /* Good final FCS value */
39 #define PPP_FCS(fcs, c) (((fcs) >> 8) ^ fcstab[((fcs) ^ (c)) & 0xff])
44 #define PPP_MTU 1500 /* Default MTU (size of Info field) */
45 #define PPP_MRU 1500 /* Default MRU (max receive unit) */
46 #define PPP_MAXMRU 65000 /* Largest MRU we allow */
48 /* Extended asyncmap - allows any character to be escaped. */
49 typedef u_long ext_accm[8];
52 #define SIOCSIFCOMPAC _IOW('p', 130, char)
53 #define SIOCSIFCOMPPROT _IOW('p', 131, char)
54 #define SIOCSIFMRU _IOW('p', 132, int) /* set max receive unit */
55 #define SIOCGIFMRU _IOR('p', 133, int) /* get max receive unit */
56 #define SIOCGIFASYNCMAP _IOR('p', 134, long) /* get transmit async map */
57 #define SIOCSIFASYNCMAP _IOW('p', 135, long) /* set transmit async map */
58 #define SIOCGETU _IOR('p', 136, int) /* get unit number */
59 #define SIOCSIFVJCOMP _IOW('p', 137, char) /* enable/disable VJ comp */
60 #define SIOCGIFDEBUG _IOR('p', 138, int) /* get debug flags */
61 #define SIOCSIFDEBUG _IOW('p', 139, int) /* set debug flags */
62 #define SIOCGIFRASYNCMAP _IOR('p', 140, long) /* get receive async map */
63 #define SIOCSIFRASYNCMAP _IOW('p', 141, long) /* set receive async map */
64 #define SIOCGIFXASYNCMAP _IOR('p', 142, ext_accm) /* get extended xmit map */
65 #define SIOCSIFXASYNCMAP _IOW('p', 143, ext_accm) /* set extended xmit map */
68 /* traditional C compiler */
69 #define SIOCSIFCOMPAC _IOW(p, 130, char)
70 #define SIOCSIFCOMPPROT _IOW(p, 131, char)
71 #define SIOCSIFMRU _IOW(p, 132, int) /* set max receive unit */
72 #define SIOCGIFMRU _IOR(p, 133, int) /* get max receive unit */
73 #define SIOCGIFASYNCMAP _IOR(p, 134, long) /* get transmit async map */
74 #define SIOCSIFASYNCMAP _IOW(p, 135, long) /* set transmit async map */
75 #define SIOCGETU _IOR(p, 136, int) /* get unit number */
76 #define SIOCSIFVJCOMP _IOW(p, 137, char) /* enable/disable VJ comp */
77 #define SIOCGIFDEBUG _IOR(p, 138, int) /* get debug flags */
78 #define SIOCSIFDEBUG _IOW(p, 139, int) /* set debug flags */
79 #define SIOCGIFRASYNCMAP _IOR(p, 140, long) /* get receive async map */
80 #define SIOCSIFRASYNCMAP _IOW(p, 141, long) /* set receive async map */
81 #define SIOCGIFXASYNCMAP _IOR(p, 142, ext_accm) /* get extended xmit map */
82 #define SIOCSIFXASYNCMAP _IOW(p, 143, ext_accm) /* set extended xmit map */
86 * Note on SIOCSIFVJCOMP: the parameter is now encoded as follows.
87 * Bit 0 = overall VJ enable, bit 1 = don't compress connection ID,
88 * bit 2 = receiver rejects VJ compression,
89 * bits 4--7 = maximum slot ID (0 => use default (15)).
93 * Structure used within the ppp_if streams module.
97 #define PII_FLAGS_INUSE 0x1 /* in use by a stream */
98 #define PII_FLAGS_ATTACHED 0x8 /* already if_attached */
99 #define PII_FLAGS_VJC_ON 0x10 /* VJ TCP header compression enabled */
100 #define PII_FLAGS_VJC_NOCCID 0x20 /* VJ: don't compress conn. id */
101 #define PII_FLAGS_VJC_REJ 0x40 /* receive: reject VJ comp */
102 #define PII_FLAGS_DEBUG 0x80 /* enable debug printout */
104 struct ifnet pii_ifnet;
105 queue_t *pii_writeq; /* used by ppp_output */
107 struct slcompress pii_sc_comp; /* vjc control buffer */
121 /* defines for streams modules */
122 #define IF_INPUT_ERROR 0xe1
123 #define IF_OUTPUT_ERROR 0xe2
125 #define ALLOCBSIZE 64 /* how big of a buffer block to
126 allocate for each chunk of the input chain */
128 #define PPP_MTU 1500 /* Default MTU (size of Info field) */
129 #define PPP_HDRLEN 4 /* sizeof(struct ppp_header) must be 4 */