]> git.ozlabs.org Git - ppp.git/commitdiff
added stuff for compression and demand dialling;
authorPaul Mackerras <paulus@samba.org>
Wed, 31 Aug 1994 23:51:23 +0000 (23:51 +0000)
committerPaul Mackerras <paulus@samba.org>
Wed, 31 Aug 1994 23:51:23 +0000 (23:51 +0000)
removed ppp_if_info stuff.

include/net/ppp_str.h

index c2ee6c1ff78605b75c4817d3bd5e5f7f279ceba1..5a26af1297ac7264ac4ff33fdfbd3f166a69d741 100644 (file)
 #define        PPP_MTU         1500    /* Default MTU (size of Info field) */
 #define PPP_MRU                1500    /* Default MRU (max receive unit) */
 #define PPP_MAXMRU     65000   /* Largest MRU we allow */
+#define PPP_HDRLEN     4       /* sizeof(struct ppp_header) must be 4 */
 
 /* Extended asyncmap - allows any character to be escaped. */
 typedef u_long ext_accm[8];
 
+/*
+ * Statistics.
+ */
+struct pppstat {
+    u_int      ppp_ibytes;     /* bytes received */
+    u_int      ppp_ipackets;   /* packets received */
+    u_int      ppp_ierrors;    /* receive errors */
+    u_int      ppp_obytes;     /* bytes sent */
+    u_int      ppp_opackets;   /* packets sent */
+    u_int      ppp_oerrors;    /* transmit errors */
+};
+
+struct vjstat {
+    u_int      sls_packets;    /* outbound packets */
+    u_int      sls_compressed; /* outbound compressed packets */
+    u_int      sls_searches;   /* searches for connection state */
+    u_int      sls_misses;     /* times couldn't find conn. state */
+    u_int      sls_uncompressedin; /* inbound uncompressed packets */
+    u_int      sls_compressedin;   /* inbound compressed packets */
+    u_int      sls_errorin;    /* inbound unknown type packets */
+    u_int      sls_tossed;     /* inbound packets tossed because of error */
+};
+
+struct ppp_stats {
+    struct pppstat     p;
+    struct vjstat      vj;
+};
+
+/*
+ * What to do with network protocol (NP) packets.
+ */
+
+enum NPmode {
+    NPMODE_PASS,               /* pass the packet through */
+    NPMODE_DROP,               /* silently drop the packet */
+    NPMODE_ERROR,              /* return an error */
+    NPMODE_QUEUE               /* save it up for later. */
+};
+
+struct npioctl {
+    int                protocol;       /* PPP procotol, e.g. PPP_IP */
+    enum NPmode        mode;
+};
+
+/* Structure describing a CCP configuration option, for SIOCSCOMPRESS */
+#define MAX_PPP_OPTION 32
+struct ppp_option_data {
+       u_int   length;
+       int     transmit;
+       u_char  opt_data[MAX_PPP_OPTION];
+};
+
+/*
+ * Ioctl definitions.
+ */
+
 #ifdef __STDC__
 #define        SIOCSIFCOMPAC   _IOW('p', 130, char)
 #define        SIOCSIFCOMPPROT _IOW('p', 131, char)
@@ -63,6 +120,12 @@ typedef u_long      ext_accm[8];
 #define        SIOCSIFRASYNCMAP _IOW('p', 141, long)   /* set receive async map */
 #define        SIOCGIFXASYNCMAP _IOR('p', 142, ext_accm)  /* get extended xmit map */
 #define        SIOCSIFXASYNCMAP _IOW('p', 143, ext_accm)  /* set extended xmit map */
+#define        SIOCSETU        _IOW('p', 144, int)     /* set unit number */
+#define SIOCSETNPMODE  _IOW('p', 145, struct npioctl)  /* set NP mode */
+#define SIOCGETNPMODE  _IOWR('p', 146, struct npioctl) /* get NP mode */
+#define SIOCGETSTATS   _IOR('p', 147, struct ppp_stats)
+#define SIOCSIFCOMP    _IOW('p', 148, int)     /* set CCP closed/open/up */
+#define SIOCSCOMPRESS  _IOW('p', 149, struct ppp_option_data)
 
 #else
 /* traditional C compiler */
@@ -78,8 +141,16 @@ typedef u_long      ext_accm[8];
 #define        SIOCSIFDEBUG    _IOW(p, 139, int)       /* set debug flags */
 #define        SIOCGIFRASYNCMAP _IOR(p, 140, long)     /* get receive async map */
 #define        SIOCSIFRASYNCMAP _IOW(p, 141, long)     /* set receive async map */
-#define        SIOCGIFXASYNCMAP _IOR(p, 142, ext_accm)  /* get extended xmit map */
-#define        SIOCSIFXASYNCMAP _IOW(p, 143, ext_accm)  /* set extended xmit map */
+#define        SIOCGIFXASYNCMAP _IOR(p, 142, ext_accm) /* get extended xmit map */
+#define        SIOCSIFXASYNCMAP _IOW(p, 143, ext_accm) /* set extended xmit map */
+#define        SIOCSETU        _IOW(p, 136, int)       /* set unit number */
+#define SIOCNPENABLE   _IOW(p, 145, int)       /* enable a network protocol */
+#define SIOCNPDISABLE  _IOW(p, 146, int)       /* disable a network proto. */
+#define SIOCSETNPMODE  _IOW(p, 147, enum NPmode)       /* set NP mode */
+#define SIOCGETNPMODE  _IOR(p, 148, enum NPmode)       /* get NP mode */
+#define SIOCGETSTATS   _IOR(p, 149, struct ppp_stats)
+#define SIOCSIFCOMP    _IOW(p, 148, int)       /* set CCP closed/open/up */
+#define SIOCSCOMPRESS  _IOW(p, 149, struct ppp_option_data)
 #endif
 
 /*
@@ -89,34 +160,12 @@ typedef u_long     ext_accm[8];
  * bits 4--7 = maximum slot ID (0 => use default (15)).
  */
 
-/*
- * Structure used within the ppp_if streams module.
- */
-struct ppp_if_info {
-       int                     pii_flags;
-#define        PII_FLAGS_INUSE         0x1     /* in use by  a stream  */
-#define        PII_FLAGS_ATTACHED      0x8     /* already if_attached  */
-#define        PII_FLAGS_VJC_ON        0x10    /* VJ TCP header compression enabled */
-#define PII_FLAGS_VJC_NOCCID   0x20    /* VJ: don't compress conn. id */
-#define PII_FLAGS_VJC_REJ      0x40    /* receive: reject VJ comp */
-#define PII_FLAGS_DEBUG                0x80    /* enable debug printout */
-
-       struct  ifnet           pii_ifnet;
-       queue_t                 *pii_writeq;    /* used by ppp_output   */
-#ifdef VJC
-       struct  slcompress      pii_sc_comp;    /* vjc control buffer */
-#endif
-#ifdef PPP_STATS
-       struct  pppstat {
-               u_int   ppp_ibytes;
-               u_int   ppp_ipackets;
-               u_int   ppp_ierrors;
-               u_int   ppp_obytes;
-               u_int   ppp_opackets;
-               u_int   ppp_oerrors;
-       }                       pii_stats;
-#endif
-};
+/* Bits for SIOCGIFDEBUG */
+#define PAI_FLAGS_B7_0         0x100
+#define PAI_FLAGS_B7_1         0x200
+#define PAI_FLAGS_PAR_EVEN     0x400
+#define PAI_FLAGS_PAR_ODD      0x800
+#define PAI_FLAGS_HIBITS       0xF00
 
 /* defines for streams modules */
 #define       IF_INPUT_ERROR  0xe1
@@ -125,5 +174,10 @@ struct     ppp_if_info {
 #define       ALLOCBSIZE      64              /* how big of a buffer block to
 allocate for each chunk of the input chain */
 
-#define        PPP_MTU         1500    /* Default MTU (size of Info field) */
-#define PPP_HDRLEN     4       /* sizeof(struct ppp_header) must be 4 */
+#ifndef __P
+#ifdef __STDC__
+#define __P(x) x
+#else
+#define __P(x) ()
+#endif
+#endif