123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- #ifndef _SLCOMPRESS_H_
- #define _SLCOMPRESS_H_
- #define MAX_STATES 16
- #define MAX_HDR MLEN
- #define TYPE_IP 0x40
- #define TYPE_UNCOMPRESSED_TCP 0x70
- #define TYPE_COMPRESSED_TCP 0x80
- #define TYPE_ERROR 0x00
- #define NEW_C 0x40
- #define NEW_I 0x20
- #define NEW_S 0x08
- #define NEW_A 0x04
- #define NEW_W 0x02
- #define NEW_U 0x01
- #define SPECIAL_I (NEW_S|NEW_W|NEW_U)
- #define SPECIAL_D (NEW_S|NEW_A|NEW_W|NEW_U)
- #define SPECIALS_MASK (NEW_S|NEW_A|NEW_W|NEW_U)
- #define TCP_PUSH_BIT 0x10
- struct cstate {
- struct cstate *cs_next;
- u_short cs_hlen;
- u_char cs_id;
- u_char cs_filler;
- union {
- char csu_hdr[MAX_HDR];
- struct ip csu_ip;
- } slcs_u;
- };
- #define cs_ip slcs_u.csu_ip
- #define cs_hdr slcs_u.csu_hdr
- struct slcompress {
- struct cstate *last_cs;
- u_char last_recv;
- u_char last_xmit;
- u_short flags;
- #ifndef SL_NO_STATS
- int sls_packets;
- int sls_compressed;
- int sls_searches;
- int sls_misses;
- int sls_uncompressedin;
- int sls_compressedin;
- int sls_errorin;
- int sls_tossed;
- #endif
- struct cstate tstate[MAX_STATES];
- struct cstate rstate[MAX_STATES];
- };
- #define SLF_TOSS 1
- void sl_compress_init __P((struct slcompress *));
- void sl_compress_setup __P((struct slcompress *, int));
- u_int sl_compress_tcp __P((struct mbuf *,
- struct ip *, struct slcompress *, int));
- int sl_uncompress_tcp __P((u_char **, int, u_int, struct slcompress *));
- int sl_uncompress_tcp_core __P((u_char *, int, int, u_int,
- struct slcompress *, u_char **, u_int *));
- #endif
|