#include <netinet/ip.h>

netinet/ip.h

includes: sys/appleapiopts.h, sys/types.h, netinet/in.h, netinet/in_systm.h
61 macros · 2 structs

macroIPVERSION

Definitions for internet protocol version 4. Per RFC 791, September 1981.
#define IPVERSION 4

structip

Structure of an internet header, naked of options.
size 20, align 4
u_int:4ip_hlheader length
u_int:4ip_vversion
u_charip_tostype of service
u_shortip_lentotal length
u_shortip_ididentification
u_shortip_offfragment offset field
u_charip_ttltime to live
u_charip_pprotocol
u_shortip_sumchecksum
struct in_addrip_srcsource and dest address
struct in_addrip_dst

macroIP_RF

#define IP_RF 0x8000
reserved fragment flag

macroIP_DF

#define IP_DF 0x4000
dont fragment flag

macroIP_MF

#define IP_MF 0x2000
more fragments flag

macroIP_OFFMASK

#define IP_OFFMASK 0x1fff
mask for fragmenting bits

macroIP_MAXPACKET

#define IP_MAXPACKET 65535
maximum packet size

macroIPTOS_LOWDELAY

Definitions for IP type of service (ip_tos)
#define IPTOS_LOWDELAY 0x10

macroIPTOS_THROUGHPUT

#define IPTOS_THROUGHPUT 0x08

macroIPTOS_RELIABILITY

#define IPTOS_RELIABILITY 0x04

macroIPTOS_MINCOST

#define IPTOS_MINCOST 0x02

macroIPTOS_CE

ECN RFC3168 obsoletes RFC2481, and these will be deprecated soon.
#define IPTOS_CE 0x01

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_ECN_ECT1

#define IPTOS_ECN_ECT1 0x01
ECN-capable transport (1)

macroIPTOS_ECN_ECT0

#define IPTOS_ECN_ECT0 0x02
ECN-capable transport (0)

macroIPTOS_ECN_CE

#define IPTOS_ECN_CE 0x03
congestion experienced

macroIPTOS_ECN_MASK

#define IPTOS_ECN_MASK 0x03
ECN field mask

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_COPIED

Definitions for options.
#define IPOPT_COPIED(o) ((o)&0x80)

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_EOL

#define IPOPT_EOL 0
end of option list

macroIPOPT_NOP

#define IPOPT_NOP 1
no operation

macroIPOPT_RR

#define IPOPT_RR 7
record packet route

macroIPOPT_TS

#define IPOPT_TS 68
timestamp

macroIPOPT_SECURITY

#define IPOPT_SECURITY 130
provide s,c,h,tcc

macroIPOPT_LSRR

#define IPOPT_LSRR 131
loose source route

macroIPOPT_SATID

#define IPOPT_SATID 136
satnet id

macroIPOPT_SSRR

#define IPOPT_SSRR 137
strict source route

macroIPOPT_RA

#define IPOPT_RA 148
router alert

macroIPOPT_OPTVAL

Offsets to fields in options other than EOL and NOP.
#define IPOPT_OPTVAL 0
option ID

macroIPOPT_OLEN

#define IPOPT_OLEN 1
option length

macroIPOPT_OFFSET

#define IPOPT_OFFSET 2
offset within option

macroIPOPT_MINOFF

#define IPOPT_MINOFF 4
min value of above

structip_timestamp

Time stamp option structure.
size 12, align 4
u_chaript_codeIPOPT_TS
u_chaript_lensize of structure (variable)
u_chaript_ptrindex of current entry
u_int:4ipt_flgflags, see below
u_int:4ipt_oflwoverflow counter
union ipt_timestampipt_timestamp

macroIPOPT_TS_TSONLY

flag bits for ipt_flg
#define IPOPT_TS_TSONLY 0
timestamps only

macroIPOPT_TS_TSANDADDR

#define IPOPT_TS_TSANDADDR 1
timestamps and addresses

macroIPOPT_TS_PRESPEC

#define IPOPT_TS_PRESPEC 3
specified modules only

macroIPOPT_SECUR_UNCLASS

bits for security (not byte swapped)
#define IPOPT_SECUR_UNCLASS 0x0000

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

macroMAXTTL

Internet implementation parameters.
#define MAXTTL 255
maximum time to live (seconds)

macroIPDEFTTL

#define IPDEFTTL 64
default ttl, from RFC 1340

macroIPFRAGTTL

#define IPFRAGTTL 30
time to live for frags (seconds)

macroIPTTLDEC

#define IPTTLDEC 1
subtracted when forwarding

macroIP_MSS

#define IP_MSS 576
default maximum segment size