diff --git a/include/netinet/ip.h b/include/netinet/ip.h index aa8b98ca06..8aa9660a25 100644 --- a/include/netinet/ip.h +++ b/include/netinet/ip.h @@ -32,6 +32,33 @@ * Public Type Definitions ****************************************************************************/ +#define IPVERSION 4 /* IP version number */ +#define IPDEFTTL 64 /* default ttl, from RFC 1340 */ + +struct iphdr +{ +#if __BYTE_ORDER == __LITTLE_ENDIAN + unsigned int ihl:4; + unsigned int version:4; +#elif __BYTE_ORDER == __BIG_ENDIAN + unsigned int version:4; + unsigned int ihl:4; +#else +# error "unknown endian" +#endif + uint8_t tos; + uint16_t tot_len; + uint16_t id; + uint16_t frag_off; + uint8_t ttl; + uint8_t protocol; + uint16_t check; + uint32_t saddr; + uint32_t daddr; + + /* The options start here. */ +}; + /**************************************************************************** * Public Function Prototypes ****************************************************************************/