#include <netinet/ip.h>
netinet/ip.h
macroIPVERSION
Definitions for internet protocol version 4.
Per RFC 791, September 1981.
#define IPVERSION 4
structip
Structure of an internet header, naked of options.
| u_int:4 | ip_hl | header length |
| u_int:4 | ip_v | version |
| u_char | ip_tos | type of service |
| u_short | ip_len | total length |
| u_short | ip_id | identification |
| u_short | ip_off | fragment offset field |
| u_char | ip_ttl | time to live |
| u_char | ip_p | protocol |
| u_short | ip_sum | checksum |
| struct in_addr | ip_src | source and dest address |
| struct in_addr | ip_dst |
macroIPTOS_THROUGHPUT
#define IPTOS_THROUGHPUT 0x08
macroIPTOS_RELIABILITY
#define IPTOS_RELIABILITY 0x04
macroIPTOS_MINCOST
#define IPTOS_MINCOST 0x02
macroIPTOS_ECT
#define IPTOS_ECT 0x02
macroIPTOS_DSCP_SHIFT
#define IPTOS_DSCP_SHIFT 2
macroIPTOS_ECN_NOTECT
ECN (Explicit Congestion Notification) codepoints in RFC3168
mapped to the lower 2 bits of the TOS field.
#define IPTOS_ECN_NOTECT 0x00
not-ECT
macroIPTOS_PREC_NETCONTROL
Definitions for IP precedence (also in ip_tos) (hopefully unused)
#define IPTOS_PREC_NETCONTROL 0xe0
macroIPTOS_PREC_INTERNETCONTROL
#define IPTOS_PREC_INTERNETCONTROL 0xc0
macroIPTOS_PREC_CRITIC_ECP
#define IPTOS_PREC_CRITIC_ECP 0xa0
macroIPTOS_PREC_FLASHOVERRIDE
#define IPTOS_PREC_FLASHOVERRIDE 0x80
macroIPTOS_PREC_FLASH
#define IPTOS_PREC_FLASH 0x60
macroIPTOS_PREC_IMMEDIATE
#define IPTOS_PREC_IMMEDIATE 0x40
macroIPTOS_PREC_PRIORITY
#define IPTOS_PREC_PRIORITY 0x20
macroIPTOS_PREC_ROUTINE
#define IPTOS_PREC_ROUTINE 0x00
macroIPOPT_CLASS
#define IPOPT_CLASS(o) ((o)&0x60)
macroIPOPT_NUMBER
#define IPOPT_NUMBER(o) ((o)&0x1f)
macroIPOPT_CONTROL
#define IPOPT_CONTROL 0x00
macroIPOPT_RESERVED1
#define IPOPT_RESERVED1 0x20
macroIPOPT_DEBMEAS
#define IPOPT_DEBMEAS 0x40
macroIPOPT_RESERVED2
#define IPOPT_RESERVED2 0x60
macroIPOPT_OPTVAL
Offsets to fields in options other than EOL and NOP.
#define IPOPT_OPTVAL 0
option ID
structip_timestamp
Time stamp option structure.
| u_char | ipt_code | IPOPT_TS |
| u_char | ipt_len | size of structure (variable) |
| u_char | ipt_ptr | index of current entry |
| u_int:4 | ipt_flg | flags, see below |
| u_int:4 | ipt_oflw | overflow counter |
| union ipt_timestamp | ipt_timestamp |
macroIPOPT_SECUR_CONFID
#define IPOPT_SECUR_CONFID 0xf135
macroIPOPT_SECUR_EFTO
#define IPOPT_SECUR_EFTO 0x789a
macroIPOPT_SECUR_MMMM
#define IPOPT_SECUR_MMMM 0xbc4d
macroIPOPT_SECUR_RESTR
#define IPOPT_SECUR_RESTR 0xaf13
macroIPOPT_SECUR_SECRET
#define IPOPT_SECUR_SECRET 0xd788
macroIPOPT_SECUR_TOPSECRET
#define IPOPT_SECUR_TOPSECRET 0x6bc5