~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/net/slhc_vj.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/net/slhc_vj.h (Version linux-6.12-rc7) and /include/net/slhc_vj.h (Version linux-5.10.229)


  1 #ifndef _SLHC_H                                     1 #ifndef _SLHC_H
  2 #define _SLHC_H                                     2 #define _SLHC_H
  3 /*                                                  3 /*
  4  * Definitions for tcp compression routines.        4  * Definitions for tcp compression routines.
  5  *                                                  5  *
  6  * $Header: slcompress.h,v 1.10 89/12/31 08:53      6  * $Header: slcompress.h,v 1.10 89/12/31 08:53:02 van Exp $
  7  *                                                  7  *
  8  * Copyright (c) 1989 Regents of the Universit      8  * Copyright (c) 1989 Regents of the University of California.
  9  * All rights reserved.                             9  * All rights reserved.
 10  *                                                 10  *
 11  * Redistribution and use in source and binary     11  * Redistribution and use in source and binary forms are permitted
 12  * provided that the above copyright notice an     12  * provided that the above copyright notice and this paragraph are
 13  * duplicated in all such forms and that any d     13  * duplicated in all such forms and that any documentation,
 14  * advertising materials, and other materials      14  * advertising materials, and other materials related to such
 15  * distribution and use acknowledge that the s     15  * distribution and use acknowledge that the software was developed
 16  * by the University of California, Berkeley.      16  * by the University of California, Berkeley.  The name of the
 17  * University may not be used to endorse or pr     17  * University may not be used to endorse or promote products derived
 18  * from this software without specific prior w     18  * from this software without specific prior written permission.
 19  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WIT     19  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 20  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMI     20  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 21  * WARRANTIES OF MERCHANTABILITY AND FITNESS F     21  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 22  *                                                 22  *
 23  *      Van Jacobson (van@helios.ee.lbl.gov),      23  *      Van Jacobson (van@helios.ee.lbl.gov), Dec 31, 1989:
 24  *      - Initial distribution.                    24  *      - Initial distribution.
 25  *                                                 25  *
 26  *                                                 26  *
 27  * modified for KA9Q Internet Software Package     27  * modified for KA9Q Internet Software Package by
 28  * Katie Stevens (dkstevens@ucdavis.edu)           28  * Katie Stevens (dkstevens@ucdavis.edu)
 29  * University of California, Davis                 29  * University of California, Davis
 30  * Computing Services                              30  * Computing Services
 31  *      - 01-31-90      initial adaptation         31  *      - 01-31-90      initial adaptation
 32  *                                                 32  *
 33  *      - Feb 1991      Bill_Simpson@um.cc.umi     33  *      - Feb 1991      Bill_Simpson@um.cc.umich.edu
 34  *                      variable number of con     34  *                      variable number of conversation slots
 35  *                      allow zero or one slot     35  *                      allow zero or one slots
 36  *                      separate routines          36  *                      separate routines
 37  *                      status display             37  *                      status display
 38  */                                                38  */
 39                                                    39 
 40 /*                                                 40 /*
 41  * Compressed packet format:                       41  * Compressed packet format:
 42  *                                                 42  *
 43  * The first octet contains the packet type (t     43  * The first octet contains the packet type (top 3 bits), TCP
 44  * 'push' bit, and flags that indicate which o     44  * 'push' bit, and flags that indicate which of the 4 TCP sequence
 45  * numbers have changed (bottom 5 bits).  The      45  * numbers have changed (bottom 5 bits).  The next octet is a
 46  * conversation number that associates a saved     46  * conversation number that associates a saved IP/TCP header with
 47  * the compressed packet.  The next two octets     47  * the compressed packet.  The next two octets are the TCP checksum
 48  * from the original datagram.  The next 0 to      48  * from the original datagram.  The next 0 to 15 octets are
 49  * sequence number changes, one change per bit     49  * sequence number changes, one change per bit set in the header
 50  * (there may be no changes and there are two      50  * (there may be no changes and there are two special cases where
 51  * the receiver implicitly knows what changed      51  * the receiver implicitly knows what changed -- see below).
 52  *                                                 52  *
 53  * There are 5 numbers which can change (they      53  * There are 5 numbers which can change (they are always inserted
 54  * in the following order): TCP urgent pointer     54  * in the following order): TCP urgent pointer, window,
 55  * acknowledgment, sequence number and IP ID.      55  * acknowledgment, sequence number and IP ID.  (The urgent pointer
 56  * is different from the others in that its va     56  * is different from the others in that its value is sent, not the
 57  * change in value.)  Since typical use of SLI     57  * change in value.)  Since typical use of SLIP links is biased
 58  * toward small packets (see comments on MTU/M     58  * toward small packets (see comments on MTU/MSS below), changes
 59  * use a variable length coding with one octet     59  * use a variable length coding with one octet for numbers in the
 60  * range 1 - 255 and 3 octets (0, MSB, LSB) fo     60  * range 1 - 255 and 3 octets (0, MSB, LSB) for numbers in the
 61  * range 256 - 65535 or 0.  (If the change in      61  * range 256 - 65535 or 0.  (If the change in sequence number or
 62  * ack is more than 65535, an uncompressed pac     62  * ack is more than 65535, an uncompressed packet is sent.)
 63  */                                                63  */
 64                                                    64 
 65 /*                                                 65 /*
 66  * Packet types (must not conflict with IP pro     66  * Packet types (must not conflict with IP protocol version)
 67  *                                                 67  *
 68  * The top nibble of the first octet is the pa     68  * The top nibble of the first octet is the packet type.  There are
 69  * three possible types: IP (not proto TCP or      69  * three possible types: IP (not proto TCP or tcp with one of the
 70  * control flags set); uncompressed TCP (a nor     70  * control flags set); uncompressed TCP (a normal IP/TCP packet but
 71  * with the 8-bit protocol field replaced by a     71  * with the 8-bit protocol field replaced by an 8-bit connection id --
 72  * this type of packet syncs the sender & rece     72  * this type of packet syncs the sender & receiver); and compressed
 73  * TCP (described above).                          73  * TCP (described above).
 74  *                                                 74  *
 75  * LSB of 4-bit field is TCP "PUSH" bit (a wor     75  * LSB of 4-bit field is TCP "PUSH" bit (a worthless anachronism) and
 76  * is logically part of the 4-bit "changes" fi     76  * is logically part of the 4-bit "changes" field that follows.  Top
 77  * three bits are actual packet type.  For bac     77  * three bits are actual packet type.  For backward compatibility
 78  * and in the interest of conserving bits, num     78  * and in the interest of conserving bits, numbers are chosen so the
 79  * IP protocol version number (4) which normal     79  * IP protocol version number (4) which normally appears in this nibble
 80  * means "IP packet".                              80  * means "IP packet".
 81  */                                                81  */
 82                                                    82 
 83                                                    83 
 84 #include <linux/ip.h>                              84 #include <linux/ip.h>
 85 #include <linux/tcp.h>                             85 #include <linux/tcp.h>
 86                                                    86 
 87 /* SLIP compression masks for len/vers byte */     87 /* SLIP compression masks for len/vers byte */
 88 #define SL_TYPE_IP 0x40                            88 #define SL_TYPE_IP 0x40
 89 #define SL_TYPE_UNCOMPRESSED_TCP 0x70              89 #define SL_TYPE_UNCOMPRESSED_TCP 0x70
 90 #define SL_TYPE_COMPRESSED_TCP 0x80                90 #define SL_TYPE_COMPRESSED_TCP 0x80
 91 #define SL_TYPE_ERROR 0x00                         91 #define SL_TYPE_ERROR 0x00
 92                                                    92 
 93 /* Bits in first octet of compressed packet */     93 /* Bits in first octet of compressed packet */
 94 #define NEW_C   0x40    /* flag bits for what      94 #define NEW_C   0x40    /* flag bits for what changed in a packet */
 95 #define NEW_I   0x20                               95 #define NEW_I   0x20
 96 #define NEW_S   0x08                               96 #define NEW_S   0x08
 97 #define NEW_A   0x04                               97 #define NEW_A   0x04
 98 #define NEW_W   0x02                               98 #define NEW_W   0x02
 99 #define NEW_U   0x01                               99 #define NEW_U   0x01
100                                                   100 
101 /* reserved, special-case values of above */      101 /* reserved, special-case values of above */
102 #define SPECIAL_I (NEW_S|NEW_W|NEW_U)             102 #define SPECIAL_I (NEW_S|NEW_W|NEW_U)           /* echoed interactive traffic */
103 #define SPECIAL_D (NEW_S|NEW_A|NEW_W|NEW_U)       103 #define SPECIAL_D (NEW_S|NEW_A|NEW_W|NEW_U)     /* unidirectional data */
104 #define SPECIALS_MASK (NEW_S|NEW_A|NEW_W|NEW_U    104 #define SPECIALS_MASK (NEW_S|NEW_A|NEW_W|NEW_U)
105                                                   105 
106 #define TCP_PUSH_BIT 0x10                         106 #define TCP_PUSH_BIT 0x10
107                                                   107 
108 /*                                                108 /*
109  * data type and sizes conversion assumptions:    109  * data type and sizes conversion assumptions:
110  *                                                110  *
111  *      VJ code         KA9Q style      generi    111  *      VJ code         KA9Q style      generic
112  *      u_char          byte_t          unsign    112  *      u_char          byte_t          unsigned char    8 bits
113  *      u_short         int16           unsign    113  *      u_short         int16           unsigned short  16 bits
114  *      u_int           int16           unsign    114  *      u_int           int16           unsigned short  16 bits
115  *      u_long          unsigned long   unsign    115  *      u_long          unsigned long   unsigned long   32 bits
116  *      int             int32           long      116  *      int             int32           long            32 bits
117  */                                               117  */
118                                                   118 
119 typedef __u8 byte_t;                              119 typedef __u8 byte_t;
120 typedef __u32 int32;                              120 typedef __u32 int32;
121                                                   121 
122 /*                                                122 /*
123  * "state" data for each active tcp conversati    123  * "state" data for each active tcp conversation on the wire.  This is
124  * basically a copy of the entire IP/TCP heade    124  * basically a copy of the entire IP/TCP header from the last packet
125  * we saw from the conversation together with     125  * we saw from the conversation together with a small identifier
126  * the transmit & receive ends of the line use    126  * the transmit & receive ends of the line use to locate saved header.
127  */                                               127  */
128 struct cstate {                                   128 struct cstate {
129         byte_t  cs_this;        /* connection     129         byte_t  cs_this;        /* connection id number (xmit) */
130         bool    initialized;    /* true if ini    130         bool    initialized;    /* true if initialized */
131         struct cstate *next;    /* next in rin    131         struct cstate *next;    /* next in ring (xmit) */
132         struct iphdr cs_ip;     /* ip/tcp hdr     132         struct iphdr cs_ip;     /* ip/tcp hdr from most recent packet */
133         struct tcphdr cs_tcp;                     133         struct tcphdr cs_tcp;
134         unsigned char cs_ipopt[64];               134         unsigned char cs_ipopt[64];
135         unsigned char cs_tcpopt[64];              135         unsigned char cs_tcpopt[64];
136         int cs_hsize;                             136         int cs_hsize;
137 };                                                137 };
138 #define NULLSLSTATE     (struct cstate *)0        138 #define NULLSLSTATE     (struct cstate *)0
139                                                   139 
140 /*                                                140 /*
141  * all the state data for one serial line (we     141  * all the state data for one serial line (we need one of these per line).
142  */                                               142  */
143 struct slcompress {                               143 struct slcompress {
144         struct cstate *tstate;  /* transmit co    144         struct cstate *tstate;  /* transmit connection states (array)*/
145         struct cstate *rstate;  /* receive con    145         struct cstate *rstate;  /* receive connection states (array)*/
146                                                   146 
147         byte_t tslot_limit;     /* highest tra    147         byte_t tslot_limit;     /* highest transmit slot id (0-l)*/
148         byte_t rslot_limit;     /* highest rec    148         byte_t rslot_limit;     /* highest receive slot id (0-l)*/
149                                                   149 
150         byte_t xmit_oldest;     /* oldest xmit    150         byte_t xmit_oldest;     /* oldest xmit in ring */
151         byte_t xmit_current;    /* most recent    151         byte_t xmit_current;    /* most recent xmit id */
152         byte_t recv_current;    /* most recent    152         byte_t recv_current;    /* most recent rcvd id */
153                                                   153 
154         byte_t flags;                             154         byte_t flags;
155 #define SLF_TOSS        0x01    /* tossing rcv    155 #define SLF_TOSS        0x01    /* tossing rcvd frames until id received */
156                                                   156 
157         int32 sls_o_nontcp;     /* outbound no    157         int32 sls_o_nontcp;     /* outbound non-TCP packets */
158         int32 sls_o_tcp;        /* outbound TC    158         int32 sls_o_tcp;        /* outbound TCP packets */
159         int32 sls_o_uncompressed;       /* out    159         int32 sls_o_uncompressed;       /* outbound uncompressed packets */
160         int32 sls_o_compressed; /* outbound co    160         int32 sls_o_compressed; /* outbound compressed packets */
161         int32 sls_o_searches;   /* searches fo    161         int32 sls_o_searches;   /* searches for connection state */
162         int32 sls_o_misses;     /* times could    162         int32 sls_o_misses;     /* times couldn't find conn. state */
163                                                   163 
164         int32 sls_i_uncompressed;       /* inb    164         int32 sls_i_uncompressed;       /* inbound uncompressed packets */
165         int32 sls_i_compressed; /* inbound com    165         int32 sls_i_compressed; /* inbound compressed packets */
166         int32 sls_i_error;      /* inbound err    166         int32 sls_i_error;      /* inbound error packets */
167         int32 sls_i_tossed;     /* inbound pac    167         int32 sls_i_tossed;     /* inbound packets tossed because of error */
168                                                   168 
169         int32 sls_i_runt;                         169         int32 sls_i_runt;
170         int32 sls_i_badcheck;                     170         int32 sls_i_badcheck;
171 };                                                171 };
172 #define NULLSLCOMPR     (struct slcompress *)0    172 #define NULLSLCOMPR     (struct slcompress *)0
173                                                   173 
174 /* In slhc.c: */                                  174 /* In slhc.c: */
175 struct slcompress *slhc_init(int rslots, int t    175 struct slcompress *slhc_init(int rslots, int tslots);
176 void slhc_free(struct slcompress *comp);          176 void slhc_free(struct slcompress *comp);
177                                                   177 
178 int slhc_compress(struct slcompress *comp, uns    178 int slhc_compress(struct slcompress *comp, unsigned char *icp, int isize,
179                   unsigned char *ocp, unsigned    179                   unsigned char *ocp, unsigned char **cpp, int compress_cid);
180 int slhc_uncompress(struct slcompress *comp, u    180 int slhc_uncompress(struct slcompress *comp, unsigned char *icp, int isize);
181 int slhc_remember(struct slcompress *comp, uns    181 int slhc_remember(struct slcompress *comp, unsigned char *icp, int isize);
182 int slhc_toss(struct slcompress *comp);           182 int slhc_toss(struct slcompress *comp);
183                                                   183 
184 #endif  /* _SLHC_H */                             184 #endif  /* _SLHC_H */
185                                                   185 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php