4 Defines for Van Jacobson TCP/IP Header Compression as defined in RFC-1144
6 Created: Nov 15, 1993 by Philip Homburg <philip@cs.vu.nl>
9 #ifndef __NET__GEN__VJHC_H__
10 #define __NET__GEN__VJHC_H__
12 #define VJHC_FLAG_U 0x01
13 #define VJHC_FLAG_W 0x02
14 #define VJHC_FLAG_A 0x04
15 #define VJHC_FLAG_S 0x08
16 #define VJHC_FLAG_P 0x10
17 #define VJHC_FLAG_I 0x20
18 #define VJHC_FLAG_C 0x40
20 #define VJHC_SPEC_I (VJHC_FLAG_S | VJHC_FLAG_W | VJHC_FLAG_U)
21 #define VJHC_SPEC_D (VJHC_FLAG_S | VJHC_FLAG_A | VJHC_FLAG_W | VJHC_FLAG_U)
22 #define VJHC_SPEC_MASK (VJHC_FLAG_S | VJHC_FLAG_A | VJHC_FLAG_W | VJHC_FLAG_U)
24 #define VJHC_ENCODE(cp, n) \
26 if ((u16_t)(n) >= 256) \
36 #define VJHC_ENCODEZ(cp, n) \
38 if ((u16_t)(n) == 0 || (u16_t)(n) >= 256) \
48 #define VJHC_DECODEL(cp, l) \
52 (l)= htonl(ntohl((l)) + (((cp)[1] << 8) | (cp)[2])); \
56 (l)= htonl(ntohl((l)) + (u32_t)*(cp)++); \
59 #define VJHC_DECODES(cp, s) \
63 (s)= htons(ntohs((s)) + (((cp)[1] << 8) | (cp)[2])); \
67 (s)= htons(ntohs((s)) + (u16_t)*(cp)++); \
70 #define VJHC_DECODEU(cp, s) \
74 (s)= htons(((cp)[1] << 8) | (cp)[2]); \
78 (s)= htons((u16_t)*(cp)++); \
81 #endif /* __NET__GEN__VJHC_H__ */
84 * $PchId: vjhc.h,v 1.2 1995/11/17 22:14:46 philip Exp $