summaryrefslogtreecommitdiffstats
path: root/net/ax25/ax25_vj.h
blob: da059392c02e130a50b177e8e3a75c898873a159 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
 * Interface declaration of the VJ compression code
 *
 * Matthias Welwarsky (DG2FEF) 05/25/98
 */

#ifndef _AX25_VJ_H
#define _AX25_VJ_H

#include <net/ip.h>
#include <net/tcp.h>

/*
 * MW: copied this into ax25.h to unclobber the original struct cstate.
 * "state" data for each active tcp conversation on the "wire".  This is
 * basically a copy of the entire IP/TCP header from the last packet
 * we saw from the conversation together with a small identifier
 * the transmit & receive ends of the line use to locate saved header.
 */
struct axvj_cstate {
	unsigned char cs_this;	/* connection id number (xmit) */
	struct axvj_cstate *next;	/* next in ring (xmit) */
	struct iphdr  cs_ip;	/* ip/tcp hdr from most recent packet */
	struct tcphdr cs_tcp;
	unsigned char cs_ipopt[64];
	unsigned char cs_tcpopt[64];
	int cs_hsize;
        unsigned char deny_compression; /* MW: for vj compression via AX.25 */
        unsigned long lastdropped;
};

/*
 * all the state data for one VC (we need one of these per VC).
 */
struct axvj_slcomp {
	struct axvj_cstate *tstate;	/* transmit connection states (array)*/
	struct axvj_cstate *rstate;	/* receive connection states (array)*/

	unsigned char tslot_limit;	/* highest transmit slot id (0-l)*/
	unsigned char rslot_limit;	/* highest receive slot id (0-l)*/

        unsigned char xmit_oldest;	/* oldest xmit in ring */
	unsigned char xmit_current;	/* most recent xmit id */
	unsigned char recv_current;	/* most recent rcvd id */

	unsigned char flags;
#define SLF_TOSS	0x01	/* tossing rcvd frames until id received */

	int sls_o_nontcp;	/* outbound non-TCP packets */
	int sls_o_tcp;	/* outbound TCP packets */
	int sls_o_uncompressed;	/* outbound uncompressed packets */
	int sls_o_compressed;	/* outbound compressed packets */
	int sls_o_searches;	/* searches for connection state */
	int sls_o_misses;	/* times couldn't find conn. state */

	int sls_i_uncompressed;	/* inbound uncompressed packets */
	int sls_i_compressed;	/* inbound compressed packets */
	int sls_i_error;	/* inbound error packets */
	int sls_i_tossed;	/* inbound packets tossed because of error */

	int sls_i_runt;
	int sls_i_badcheck;
};

extern struct axvj_slcomp* axhc_init(int, int);
extern void   axhc_free(struct axvj_slcomp*);
extern int    axhc_compress(struct axvj_slcomp *comp, struct sk_buff *skb, int do_compression);
extern void   ax25_vj_init(void);
extern void   ax25_vj_cleanup(void);
extern int    axhc_uncompress(struct axvj_slcomp *comp, struct sk_buff *skb);
extern int    axhc_remember(struct axvj_slcomp *comp, struct sk_buff *skb);

#endif