summaryrefslogtreecommitdiffstats
path: root/net/ax25/ax25_vj.h
diff options
context:
space:
mode:
Diffstat (limited to 'net/ax25/ax25_vj.h')
-rw-r--r--net/ax25/ax25_vj.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/net/ax25/ax25_vj.h b/net/ax25/ax25_vj.h
new file mode 100644
index 000000000..da059392c
--- /dev/null
+++ b/net/ax25/ax25_vj.h
@@ -0,0 +1,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