minix/include/net/gen/vjhc.h
Ben Gras 2fe8fb192f Full switch to clang/ELF. Drop ack. Simplify.
There is important information about booting non-ack images in
docs/UPDATING. ack/aout-format images can't be built any more, and
booting clang/ELF-format ones is a little different. Updating to the
new boot monitor is recommended.

Changes in this commit:

	. drop boot monitor -> allowing dropping ack support
	. facility to copy ELF boot files to /boot so that old boot monitor
	  can still boot fairly easily, see UPDATING
	. no more ack-format libraries -> single-case libraries
	. some cleanup of OBJECT_FMT, COMPILER_TYPE, etc cases
	. drop several ack toolchain commands, but not all support
	  commands (e.g. aal is gone but acksize is not yet).
	. a few libc files moved to netbsd libc dir
	. new /bin/date as minix date used code in libc/
	. test compile fix
	. harmonize includes
	. /usr/lib is no longer special: without ack, /usr/lib plays no
	  kind of special bootstrapping role any more and bootstrapping
	  is done exclusively through packages, so releases depend even
	  less on the state of the machine making them now.
	. rename nbsd_lib* to lib*
	. reduce mtree
2012-02-14 14:52:02 +01:00

85 lines
1.5 KiB
C

/*
net/gen/vjhc.h
Defines for Van Jacobson TCP/IP Header Compression as defined in RFC-1144
Created: Nov 15, 1993 by Philip Homburg <philip@cs.vu.nl>
*/
#ifndef __NET__GEN__VJHC_H__
#define __NET__GEN__VJHC_H__
#define VJHC_FLAG_U 0x01
#define VJHC_FLAG_W 0x02
#define VJHC_FLAG_A 0x04
#define VJHC_FLAG_S 0x08
#define VJHC_FLAG_P 0x10
#define VJHC_FLAG_I 0x20
#define VJHC_FLAG_C 0x40
#define VJHC_SPEC_I (VJHC_FLAG_S | VJHC_FLAG_W | VJHC_FLAG_U)
#define VJHC_SPEC_D (VJHC_FLAG_S | VJHC_FLAG_A | VJHC_FLAG_W | VJHC_FLAG_U)
#define VJHC_SPEC_MASK (VJHC_FLAG_S | VJHC_FLAG_A | VJHC_FLAG_W | VJHC_FLAG_U)
#define VJHC_ENCODE(cp, n) \
{ \
if ((u16_t)(n) >= 256) \
{ \
*(cp)++= 0; \
*(cp)++= (n >> 8); \
*(cp)++= (n); \
} \
else \
*(cp)++= (n); \
}
#define VJHC_ENCODEZ(cp, n) \
{ \
if ((u16_t)(n) == 0 || (u16_t)(n) >= 256) \
{ \
*(cp)++= 0; \
*(cp)++= (n >> 8); \
*(cp)++= (n); \
} \
else \
*(cp)++= (n); \
}
#define VJHC_DECODEL(cp, l) \
{ \
if (*(cp) == 0) \
{ \
(l)= htonl(ntohl((l)) + (((cp)[1] << 8) | (cp)[2])); \
(cp) += 3; \
} \
else \
(l)= htonl(ntohl((l)) + (u32_t)*(cp)++); \
}
#define VJHC_DECODES(cp, s) \
{ \
if (*(cp) == 0) \
{ \
(s)= htons(ntohs((s)) + (((cp)[1] << 8) | (cp)[2])); \
(cp) += 3; \
} \
else \
(s)= htons(ntohs((s)) + (u16_t)*(cp)++); \
}
#define VJHC_DECODEU(cp, s) \
{ \
if (*(cp) == 0) \
{ \
(s)= htons(((cp)[1] << 8) | (cp)[2]); \
(cp) += 3; \
} \
else \
(s)= htons((u16_t)*(cp)++); \
}
#endif /* __NET__GEN__VJHC_H__ */
/*
* $PchId: vjhc.h,v 1.2 1995/11/17 22:14:46 philip Exp $
*/