Back to index

glibc  2.9
if_ppp.h
Go to the documentation of this file.
00001 /*     From: if_ppp.h,v 1.3 1995/06/12 11:36:50 paulus Exp */
00002 
00003 /*
00004  * if_ppp.h - Point-to-Point Protocol definitions.
00005  *
00006  * Copyright (c) 1989 Carnegie Mellon University. 
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted provided that the following conditions
00010  * are met:
00011  * 1. Redistributions of source code must retain the above copyright
00012  *    notice, this list of conditions and the following disclaimer.
00013  * 2. Redistributions in binary form must reproduce the above copyright
00014  *    notice, this list of conditions and the following disclaimer in the
00015  *    documentation and/or other materials provided with the distribution.
00016  * 3. Neither the name of the University nor the names of its contributors
00017  *    may be used to endorse or promote products derived from this software
00018  *    without specific prior written permission.
00019  *
00020  * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY AND
00021  * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
00022  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00023  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
00024  * IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE FOR ANY
00025  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00026  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
00027  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00028  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
00029  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00030  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
00031  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00032  *
00033  */
00034 
00035 /*
00036  *  ==FILEVERSION 960926==
00037  *
00038  *  NOTE TO MAINTAINERS:
00039  *     If you modify this file at all, please set the above date.
00040  *     if_ppp.h is shipped with a PPP distribution as well as with the kernel;
00041  *     if everyone increases the FILEVERSION number above, then scripts
00042  *     can do the right thing when deciding whether to install a new if_ppp.h
00043  *     file.  Don't change the format of that line otherwise, so the
00044  *     installation script can recognize it.
00045  */
00046 
00047 
00048 #ifndef __NET_IF_PPP_H
00049 #define __NET_IF_PPP_H 1
00050 
00051 #include <sys/types.h>
00052 #include <sys/cdefs.h>
00053 
00054 #include <net/if.h>
00055 #include <sys/ioctl.h>
00056 #include <net/ppp_defs.h>
00057 
00058 __BEGIN_DECLS
00059 
00060 /*
00061  * Packet sizes
00062  */
00063 
00064 #define       PPP_MTU              1500   /* Default MTU (size of Info field) */
00065 #define PPP_MAXMRU   65000  /* Largest MRU we allow */
00066 #define PPP_VERSION  "2.2.0"
00067 #define PPP_MAGIC    0x5002 /* Magic value for the ppp structure */
00068 #define PROTO_IPX    0x002b /* protocol numbers */
00069 #define PROTO_DNA_RT    0x0027  /* DNA Routing */
00070 
00071 
00072 /*
00073  * Bit definitions for flags.
00074  */
00075 
00076 #define SC_COMP_PROT 0x00000001    /* protocol compression (output) */
00077 #define SC_COMP_AC   0x00000002    /* header compression (output) */
00078 #define       SC_COMP_TCP   0x00000004    /* TCP (VJ) compression (output) */
00079 #define SC_NO_TCP_CCID      0x00000008    /* disable VJ connection-id comp. */
00080 #define SC_REJ_COMP_AC      0x00000010    /* reject adrs/ctrl comp. on input */
00081 #define SC_REJ_COMP_TCP     0x00000020    /* reject TCP (VJ) comp. on input */
00082 #define SC_CCP_OPEN  0x00000040    /* Look at CCP packets */
00083 #define SC_CCP_UP    0x00000080    /* May send/recv compressed packets */
00084 #define SC_ENABLE_IP 0x00000100    /* IP packets may be exchanged */
00085 #define SC_COMP_RUN  0x00001000    /* compressor has been inited */
00086 #define SC_DECOMP_RUN       0x00002000    /* decompressor has been inited */
00087 #define SC_DEBUG     0x00010000    /* enable debug messages */
00088 #define SC_LOG_INPKT 0x00020000    /* log contents of good pkts recvd */
00089 #define SC_LOG_OUTPKT       0x00040000    /* log contents of pkts sent */
00090 #define SC_LOG_RAWIN 0x00080000    /* log all chars received */
00091 #define SC_LOG_FLUSH 0x00100000    /* log all chars flushed */
00092 #define       SC_MASK              0x0fE0ffff    /* bits that user can change */
00093 
00094 /* state bits */
00095 #define       SC_ESCAPED    0x80000000    /* saw a PPP_ESCAPE */
00096 #define       SC_FLUSH      0x40000000    /* flush input until next PPP_FLAG */
00097 #define SC_VJ_RESET  0x20000000    /* Need to reset the VJ decompressor */
00098 #define SC_XMIT_BUSY 0x10000000    /* ppp_write_wakeup is active */
00099 #define SC_RCV_ODDP  0x08000000    /* have rcvd char with odd parity */
00100 #define SC_RCV_EVNP  0x04000000    /* have rcvd char with even parity */
00101 #define SC_RCV_B7_1  0x02000000    /* have rcvd char with bit 7 = 1 */
00102 #define SC_RCV_B7_0  0x01000000    /* have rcvd char with bit 7 = 0 */
00103 #define SC_DC_FERROR 0x00800000    /* fatal decomp error detected */
00104 #define SC_DC_ERROR  0x00400000    /* non-fatal decomp error detected */
00105 
00106 /*
00107  * Ioctl definitions.
00108  */
00109 
00110 struct npioctl {
00111     int              protocol;     /* PPP protocol, e.g. PPP_IP */
00112     enum NPmode      mode;
00113 };
00114 
00115 /* Structure describing a CCP configuration option, for PPPIOCSCOMPRESS */
00116 struct ppp_option_data {
00117        u_int8_t  *ptr;
00118        u_int32_t length;
00119        int      transmit;
00120 };
00121 
00122 struct ifpppstatsreq {
00123   struct ifreq          b;
00124   struct ppp_stats stats;                 /* statistic information */
00125 };
00126 
00127 struct ifpppcstatsreq {
00128   struct ifreq              b;
00129   struct ppp_comp_stats stats;
00130 };
00131 
00132 #define ifr__name       b.ifr_ifrn.ifrn_name
00133 #define stats_ptr       b.ifr_ifru.ifru_data
00134 
00135 /*
00136  * Ioctl definitions.
00137  */
00138 
00139 #define       PPPIOCGFLAGS  _IOR('t', 90, int)   /* get configuration flags */
00140 #define       PPPIOCSFLAGS  _IOW('t', 89, int)   /* set configuration flags */
00141 #define       PPPIOCGASYNCMAP      _IOR('t', 88, int)   /* get async map */
00142 #define       PPPIOCSASYNCMAP      _IOW('t', 87, int)   /* set async map */
00143 #define       PPPIOCGUNIT   _IOR('t', 86, int)   /* get ppp unit number */
00144 #define       PPPIOCGRASYNCMAP _IOR('t', 85, int)       /* get receive async map */
00145 #define       PPPIOCSRASYNCMAP _IOW('t', 84, int)       /* set receive async map */
00146 #define       PPPIOCGMRU    _IOR('t', 83, int)   /* get max receive unit */
00147 #define       PPPIOCSMRU    _IOW('t', 82, int)   /* set max receive unit */
00148 #define       PPPIOCSMAXCID _IOW('t', 81, int)   /* set VJ max slot ID */
00149 #define PPPIOCGXASYNCMAP _IOR('t', 80, ext_accm) /* get extended ACCM */
00150 #define PPPIOCSXASYNCMAP _IOW('t', 79, ext_accm) /* set extended ACCM */
00151 #define PPPIOCXFERUNIT      _IO('t', 78)         /* transfer PPP unit */
00152 #define PPPIOCSCOMPRESS     _IOW('t', 77, struct ppp_option_data)
00153 #define PPPIOCGNPMODE       _IOWR('t', 76, struct npioctl) /* get NP mode */
00154 #define PPPIOCSNPMODE       _IOW('t', 75, struct npioctl)  /* set NP mode */
00155 #define PPPIOCGDEBUG _IOR('t', 65, int)   /* Read debug level */
00156 #define PPPIOCSDEBUG _IOW('t', 64, int)   /* Set debug level */
00157 #define PPPIOCGIDLE  _IOR('t', 63, struct ppp_idle) /* get idle time */
00158 
00159 #define SIOCGPPPSTATS   (SIOCDEVPRIVATE + 0)
00160 #define SIOCGPPPVER     (SIOCDEVPRIVATE + 1)  /* NEVER change this!! */
00161 #define SIOCGPPPCSTATS  (SIOCDEVPRIVATE + 2)
00162 
00163 #if !defined(ifr_mtu)
00164 #define ifr_mtu      ifr_ifru.ifru_metric
00165 #endif
00166 
00167 __END_DECLS
00168 
00169 #endif /* net/if_ppp.h */