9.8" /spapti /formti a 9.8" href="../linux+v3.7.4/include/net/slhc_vj.h">9.8" img src="../.static/gfx/right.png" alt=">>">9. /spapti9. spap class="lxr_search">9.8"9.8" input typvalhidden" namvalnavtarget" ion val">9.8" input typvaltext" namvalsearch" idalsearch">9.8" buttopttypvalsubmit">Search9.8" Prefsi /a>9. /spapti8" /divti8" form ac9. input typvalhidden" namvalajax_lookup" idalajax_lookup" ion val">98" /formti98" div class="headingbottom">i div idalfile_contents"t
   1 /a>#ifndef  a href="+code=_SLHC_H" class="sref">_SLHC_H /a>9   2 /a>#define  a href="+code=_SLHC_H" class="sref">_SLHC_H /a>9   3 /a> spap class="comment">/* /spapti   4 /a> spap class="comment"> * Defini   5 /a> spap class="comment"> * /spapti   6 /a> spap class="comment"> * $Header: slcompress.h,v 4v40 89/12/31 08:53:02 ion Exp $ /spapti   7 /a> spap class="comment"> * /spapti   8 /a> spap class="comment"> * Copyright (c) 1989 Regents of the University of California. /spapti   9 /a> spap class="comment"> * All rights reserved. /spapti  4.1.a> spap class="comment"> * /spapti  11 /a> spap class="comment"> * Redistribut  12 /a> spap class="comment"> * provided that the above copyright noticetand this paragraph are /spapti  13 /a> spap class="comment"> * duplicated in all such forms and that any documentat  14 /a> spap class="comment"> * advertising materials, and other materials related to such /spapti  15 /a> spap class="comment"> * distribut  16 /a> spap class="comment"> * by the University of California, Berkeley.  The namv of the /spapti  17 /a> spap class="comment"> * University may not be used to endorse or promote products derived /spapti  18 /a> spap class="comment"> * from this software without specific prior written permiss  19 /a> spap class="comment"> * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR /spapti  2.1.a> spap class="comment"> * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED /spapti  21 /a> spap class="comment"> * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. /spapti  22 /a> spap class="comment"> * /spapti  23 /a> spap class="comment"> *      Vap Jacobsopt(, Dec 31, 1989: /spapti  24 /a> spap class="comment"> *      - Ini  25 /a> spap class="comment"> * /spapti  26 /a> spap class="comment"> * /spapti  27 /a> spap class="comment"> * modified for KA9Q Internet Software Package by /spapti  28 /a> spap class="comment"> * Kat  29 /a> spap class="comment"> * University of California, Davis /spapti  3.1.a> spap class="comment"> * Computing Services /spapti  31 /a> spap class="comment"> *      - 01-31-90      ini  32 /a> spap class="comment"> * /spapti  33 /a> spap class="comment"> *      - Feb 1991 /spapti  34 /a> spap class="comment"> *                      variable number of conversat  35 /a> spap class="comment"> *                      allow zero or one slots /spapti  36 /a> spap class="comment"> *                      separate routines /spapti  37 /a> spap class="comment"> *                      status display /spapti  38 /a> spap class="comment"> */ /spapti  39 /a>9  4.1.a> spap class="comment">/* /spapti  41 /a> spap class="comment"> * Compressed packet format: /spapti  42 /a> spap class="comment"> * /spapti  43 /a> spap class="comment"> * The first octet contaips the packet typv (top 3 bits), TCP /spapti  44 /a> spap class="comment"> * 'push' bit, and flags that indicate which of the 4 TCP sequence /spapti  45 /a> spap class="comment"> * numbers have changed (bottom 5 bits).  The next octet is a /spapti  46 /a> spap class="comment"> * conversat  47 /a> spap class="comment"> * the compressed packet.  The next two octets are the TCP checksum /spapti  48 /a> spap class="comment"> * from the original datagram.  The next 0 to 15 octets are /spapti  49 /a> spap class="comment"> * sequence number changes, one change per bit set in the header /spapti  5.1.a> spap class="comment"> * (there may be no changes and there are two special cases where /spapti  51 /a> spap class="comment"> * the receiver implicitly knows what changed -- see below). /spapti  52 /a> spap class="comment"> * /spapti  53 /a> spap class="comment"> * There are 5 numbers which cap change (they are always inserted /spapti  54 /a> spap class="comment"> * in the following order): TCP urgent pointer, window, /spapti  55 /a> spap class="comment"> * acknowledgment, sequence number and IP ID.  (The urgent pointer /spapti  56 /a> spap class="comment"> * is different from the others in that its ion v is sent, not the /spapti  57 /a> spap class="comment"> * change iption v.)  Since typical use of SLIP links is biased /spapti  58 /a> spap class="comment"> * toward small packets (see comments on MTU/MSS below), changes /spapti  59 /a> spap class="comment"> * use a variable length coding with one octet for numbers in the /spapti  6.1.a> spap class="comment"> * range 1 - 255 and 3 octets (0, MSB, LSB) for numbers in the /spapti  61 /a> spap class="comment"> * range 256 - 65535 or 0.  (If the change iptsequence number or /spapti  62 /a> spap class="comment"> * ack is more thap 65535, an uncompressed packet is sent.) /spapti  63 /a> spap class="comment"> */ /spapti  64 /a>9  65 /a> spap class="comment">/* /spapti  66 /a> spap class="comment"> * Packet typvs (must not conflict with IP protocol version) /spapti  67 /a> spap class="comment"> * /spapti  68 /a> spap class="comment"> * The top nibble of the first octet is the packet typv.  There are /spapti  69 /a> spap class="comment"> * three possible typvs: IP (not proto TCP or tcp with one of the /spapti  7.1.a> spap class="comment"> * control flags set); uncompressed TCP (a normal IP/TCP packet but /spapti  71 /a> spap class="comment"> * with the 8-bit protocol field replaced by an 8-bit connec  72 /a> spap class="comment"> * this typv of packet syncs the sender & receiver); and compressed /spapti  73 /a> spap class="comment"> * TCP (described above). /spapti  74 /a> spap class="comment"> * /spapti  75 /a> spap class="comment"> * LSB of 4-bit field is TCP "PUSH" bit (a worthless anachronism) and /spapti  76 /a> spap class="comment"> * is logically part of the 4-bit "changes" field that follows.  Top /spapti  77 /a> spap class="comment"> * three bits are actual packet typv.  For backward compatibility /spapti  78 /a> spap class="comment"> * and in the interest of conserving bits, numbers are chosen so the /spapti  79 /a> spap class="comment"> * IP protocol version number (4) which normally appears in this nibble /spapti  8.1.a> spap class="comment"> * means "IP packet". /spapti  81 /a> spap class="comment"> */ /spapti  82 /a>9  83 /a>9  84 /a>#include <linux/ip.h /a>>9  85 /a>#include <linux/tcp.h /a>>9  86 /a>9  87 /a> spap class="comment">/* SLIP compress  88 /a>#define  a href="+code=SL_TYPE_IP" class="sref">SL_TYPE_IP /a> 0x40i  89 /a>#define  a href="+code=SL_TYPE_UNCOMPRESSED_TCP" class="sref">SL_TYPE_UNCOMPRESSED_TCP /a> 0x70i  90 /a>#define  a href="+code=SL_TYPE_COMPRESSED_TCP" class="sref">SL_TYPE_COMPRESSED_TCP /a> 0x80i  91 /a>#define  a href="+code=SL_TYPE_ERROR" class="sref">SL_TYPE_ERROR /a> 0x00i  92 /a>9  93 /a> spap class="comment">/* Bits in first octet of compressed packet */ /spapti  94 /a>#define  a href="+code=NEW_C" class="sref">NEW_C /a>   0x40
    spap class="comment">/* flag bits for what changed in a packet */ /spapti  95 /a>#define  a href="+code=NEW_I" class="sref">NEW_I /a>   0x20i  96 /a>#define  a href="+code=NEW_S" class="sref">NEW_S /a>   0x08i  97 /a>#define  a href="+code=NEW_A" class="sref">NEW_A /a>   0x04i  98 /a>#define  a href="+code=NEW_W" class="sref">NEW_W /a>   0x02i  99 /a>#define  a href="+code=NEW_U" class="sref">NEW_U /a>   0x01i 100 /a>9 101 /a> spap class="comment">/* reserved, special-casetion vs of above */ /spapti 102 /a>#define  a href="+code=SPECIAL_I" class="sref">SPECIAL_I /a> ( a href="+code=NEW_S" class="sref">NEW_S /a>| a href="+code=NEW_W" class="sref">NEW_W /a>| a href="+code=NEW_U" class="sref">NEW_U /a>)            spap class="comment">/* echoed interac 103 /a>#define  a href="+code=SPECIAL_D" class="sref">SPECIAL_D /a> ( a href="+code=NEW_S" class="sref">NEW_S /a>| a href="+code=NEW_A" class="sref">NEW_A /a>| a href="+code=NEW_W" class="sref">NEW_W /a>| a href="+code=NEW_U" class="sref">NEW_U /a>)      spap class="comment">/* unidirec 104 /a>#define  a href="+code=SPECIALS_MASK" class="sref">SPECIALS_MASK /a> ( a href="+code=NEW_S" class="sref">NEW_S /a>| a href="+code=NEW_A" class="sref">NEW_A /a>| a href="+code=NEW_W" class="sref">NEW_W /a>| a href="+code=NEW_U" class="sref">NEW_U /a>)i 105 /a>9 106 /a>#define  a href="+code=TCP_PUSH_BIT" class="sref">TCP_PUSH_BIT /a> 0x10i 107 /a>9 108 /a> spap class="comment">/* /spapti 109 /a> spap class="comment"> * data typv and sizvs convers 14.1.a> spap class="comment"> * /spapti 111 /a> spap class="comment"> *      VJ code         KA9Q style      generic /spapti 112 /a> spap class="comment"> *      u_char          byte_t          unsigned char    8 bits /spapti 113 /a> spap class="comment"> *      u_short         int16           unsigned short  16 bits /spapti 114 /a> spap class="comment"> *      u_int           int16           unsigned short  16 bits /spapti 115 /a> spap class="comment"> *      u_long          unsigned long   unsigned long   32 bits /spapti 116 /a> spap class="comment"> *      int             int32           long            32 bits /spapti 117 /a> spap class="comment"> */ /spapti 118 /a>i 119 /a>typvdef  a href="+code=__u8" class="sref">__u8 /a>  a href="+code=byte_t" class="sref">byte_t /a>;9 12.1.a>typvdef  a href="+code=__u32" class="sref">__u32 /a>  a href="+code=int32" class="sref">int32 /a>;9 121 /a>9 122 /a> spap class="comment">/* /spapti 123 /a> spap class="comment"> * "state" data for each ac 124 /a> spap class="comment"> * basically a copy of the entire IP/TCP header from the last packet /spapti 125 /a> spap class="comment"> * we saw from the conversat 126 /a> spap class="comment"> * the transmit & receive ends of the line use to locate saved header. /spapti 127 /a> spap class="comment"> */ /spapti 128 /a>struct  a href="+code=cstate" class="sref">cstate /a> {i 129 /a>         a href="+code=byte_t" class="sref">byte_t /a>   a href="+code=cs_this" class="sref">cs_this /a>;         spap class="comment">/* connec 13.1.a>        struct  a href="+code=cstate" class="sref">cstate /a> * a href="+code=next" class="sref">next /a>;     spap class="comment">/* next in ring (xmit) */ /spapti 131 /a>        struct  a href="+code=iphdr" class="sref">iphdr /a>  a href="+code=cs_ip" class="sref">cs_ip /a>;      spap class="comment">/* ip/tcp hdr from most recent packet */ /spapti 132 /a>        struct  a href="+code=tcphdr" class="sref">tcphdr /a>  a href="+code=cs_tcp" class="sref">cs_tcp /a>;9 133 /a>        unsigned char  a href="+code=cs_ipopt" class="sref">cs_ipopt /a>[64];9 134 /a>        unsigned char  a href="+code=cs_tcpopt" class="sref">cs_tcpopt /a>[64];9 135 /a>        int  a href="+code=cs_hsizv" class="sref">cs_hsizv /a>;9 136 /a>};9 137 /a>#define  a href="+code=NULLSLSTATE" class="sref">NULLSLSTATE /a>     (struct  a href="+code=cstate" class="sref">cstate /a> *)0i 138 /a>i 139 /a> spap class="comment">/* /spapti 14.1.a> spap class="comment"> * all the state data for one serial line (we need one of these per line). /spapti 141 /a> spap class="comment"> */ /spapti 142 /a>struct  a href="+code=slcompress" class="sref">slcompress /a> {i 1431.a>        struct  a href="+code=cstate" class="sref">cstate /a> * a href="+code=tstate" class="sref">tstate /a>;   spap class="comment">/* transmit connec 1441.a>        struct  a href="+code=cstate" class="sref">cstate /a> * a href="+code=rstate" class="sref">rstate /a>;   spap class="comment">/* receive connec 145 /a>9 146 /a>         a href="+code=byte_t" class="sref">byte_t /a>  a href="+code=tslot_limit" class="sref">tslot_limit /a>;      spap class="comment">/* highest transmit slot id (0-l)*/ /spapti 147 /a>         a href="+code=byte_t" class="sref">byte_t /a>  a href="+code=rslot_limit" class="sref">rslot_limit /a>;      spap class="comment">/* highest receive slot id (0-l)*/ /spapti 148 /a>i 149 /a>         a href="+code=byte_t" class="sref">byte_t /a>  a href="+code=xmit_oldest" class="sref">xmit_oldest /a>;      spap class="comment">/* oldest xmit in ring */ /spapti 150 /a>         a href="+code=byte_t" class="sref">byte_t /a>  a href="+code=xmit_current" class="sref">xmit_current /a>;     spap class="comment">/* most recent xmit id */ /spapti 151 /a>         a href="+code=byte_t" class="sref">byte_t /a>  a href="+code=recv_current" class="sref">recv_current /a>;     spap class="comment">/* most recent rcvd id */ /spapti 152 /a>9 153 /a>         a href="+code=byte_t" class="sref">byte_t /a>  a href="+code=flags" class="sref">flags /a>;9 154 /a>#define  a href="+code=SLF_TOSS" class="sref">SLF_TOSS /a>        0x01     spap class="comment">/* tossing rcvd framvs until id received */ /spapti 155 /a>9 156 /a>         a href="+code=int32" class="sref">int32 /a>  a href="+code=sls_o_nontcp" class="sref">sls_o_nontcp /a>;      spap class="comment">/* outbound non-TCP packets */ /spapti 157 /a>         a href="+code=int32" class="sref">int32 /a>  a href="+code=sls_o_tcp" class="sref">sls_o_tcp /a>;         spap class="comment">/* outbound TCP packets */ /spapti 158 /a>         a href="+code=int32" class="sref">int32 /a>  a href="+code=sls_o_uncompressed" class="sref">sls_o_uncompressed /a>;        spap class="comment">/* outbound uncompressed packets */ /spapti 159 /a>         a href="+code=int32" class="sref">int32 /a>  a href="+code=sls_o_compressed" class="sref">sls_o_compressed /a>;  spap class="comment">/* outbound compressed packets */ /spapti 160 /a>         a href="+code=int32" class="sref">int32 /a>  a href="+code=sls_o_searches" class="sref">sls_o_searches /a>;    spap class="comment">/* searches for connec 161 /a>         a href="+code=int32" class="sref">int32 /a>  a href="+code=sls_o_misses" class="sref">sls_o_misses /a>;      spap class="comment">/* timvs couldn't find conn. state */ /spapti 162 /a>9 163 /a>         a href="+code=int32" class="sref">int32 /a>  a href="+code=sls_i_uncompressed" class="sref">sls_i_uncompressed /a>;        spap class="comment">/* inbound uncompressed packets */ /spapti 164 /a>         a href="+code=int32" class="sref">int32 /a>  a href="+code=sls_i_compressed" class="sref">sls_i_compressed /a>;  spap class="comment">/* inbound compressed packets */ /spapti 165 /a>         a href="+code=int32" class="sref">int32 /a>  a href="+code=sls_i_error" class="sref">sls_i_error /a>;       spap class="comment">/* inbound error packets */ /spapti 166 /a>         a href="+code=int32" class="sref">int32 /a>  a href="+code=sls_i_tossed" class="sref">sls_i_tossed /a>;      spap class="comment">/* inbound packets tossed because of error */ /spapti 167 /a>9 168 /a>         a href="+code=int32" class="sref">int32 /a>  a href="+code=sls_i_runt" class="sref">sls_i_runt /a>;9 169 /a>         a href="+code=int32" class="sref">int32 /a>  a href="+code=sls_i_badcheck" class="sref">sls_i_badcheck /a>;9 17.1.a>};9 171 /a>#define  a href="+code=NULLSLCOMPR" class="sref">NULLSLCOMPR /a>     (struct  a href="+code=slcompress" class="sref">slcompress /a> *)0i 172 /a>9 173 /a> spap class="comment">/* Ip slhc.c: */ /spapti 174 /a>struct  a href="+code=slcompress" class="sref">slcompress /a> * a href="+code=slhc_ini<" class="sref">slhc_ini< /a>(int  a href="+code=rslots" class="sref">rslots /a>, int  a href="+code=tslots" class="sref">tslots /a>);9 175 /a>void  a href="+code=slhc_free" class="sref">slhc_free /a>(struct  a href="+code=slcompress" class="sref">slcompress /a> * a href="+code=comp" class="sref">comp /a>);9 176 /a>9 177 /a>int  a href="+code=slhc_compress" class="sref">slhc_compress /a>(struct  a href="+code=slcompress" class="sref">slcompress /a> * a href="+code=comp" class="sref">comp /a>, unsigned char * a href="+code=icp" class="sref">icp /a>, int  a href="+code=isizv" class="sref">isizv /a>,9 178 /a>                  unsigned char * a href="+code=ocp" class="sref">ocp /a>, unsigned char ** a href="+code=cpp" class="sref">cpp /a>, int  a href="+code=compress_cid" class="sref">compress_cid /a>);9 179 /a>int  a href="+code=slhc_uncompress" class="sref">slhc_uncompress /a>(struct  a href="+code=slcompress" class="sref">slcompress /a> * a href="+code=comp" class="sref">comp /a>, unsigned char * a href="+code=icp" class="sref">icp /a>, int  a href="+code=isizv" class="sref">isizv /a>);9 18.1.a>int  a href="+code=slhc_remember" class="sref">slhc_remember /a>(struct  a href="+code=slcompress" class="sref">slcompress /a> * a href="+code=comp" class="sref">comp /a>, unsigned char * a href="+code=icp" class="sref">icp /a>, int  a href="+code=isizv" class="sref">isizv /a>);9 181 /a>int  a href="+code=slhc_toss" class="sref">slhc_toss /a>(struct  a href="+code=slcompress" class="sref">slcompress /a> * a href="+code=comp" class="sref">comp /a>);9 182 /a>9 183 /a>#endif   spap class="comment">/* sq"line" namvalL1a> * a href="+code=comp" class="sref">colL84" cla1ass="line" namvalL84">  184 /a1#incluti8"
Tginal datagrLXRare withou Univerhref="+cohttp://tand bforge. claprojects/lxss>LXRat">/unpaptit  aibbleexperilxs@tcp.h.notit .
 div dalco"line" subfootass> kindly hostan 8-bhref="+co">Redpill Lcppro AStit  aed thatonverLcp.hrvingulervicher mperafor tcss /spap simber1995.
 div id/bodyv d/html