THIS WILL NOT COMPILE - CLASS RANGES PROBABLY WRONG. /* Internet Protocol Constants and Datagram Format * */ #define IP-Alen 4 /* IP address length in bytes */ typedef char IPaddr[(IP-Alen)]; /* Internet address */ #define IP-ClassA(x) ((x[0] & 0x80) == 0x00) /*IP Class A address */ #define IP-ClassB(x) ((x[0] & 0xc0) == 0x80) /*IP Class B address */ #define IP-ClassC(x) ((x[0] & 0xe0) == 0xc0) /*IP Class C address */ #define IP-ClassD(x) ((x[0] & 0xf0) == 0xe0) /*IP Class D address */ #define IP-ClassE(x) ((x[0] & 0x80) == 0xf0) /*IP Class E address */ /* Protocol Numbers */ #define IPT_ICMP 1 #define IPT_TCP 6 #define IPT_EGP 8 #define IPT_UDP 17 struct ip ( char IP-verlens; /* IP version & header length in logs */ char IP-type; /* Type of service */ short IP-lenr; /* total packet length in octets */ short IP-id; /* datagram id */ short IP-fragoff; /* fram offset in 8-octets */ char IP-ttl; /* time to live */ char IP-proto; /* carried protocol */ short IP-cksum; /* header checksum */ IPaddr IP-src; /* source address */ IPaddr IP-dst; /* destination address */ char IP-date[1] /* variable length data */ );