#include <netinet/ip_icmp.h>

netinet/ip_icmp.h

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

structicmp_ra_addr

Internal of an ICMP Router Advertisement
size 8, align 4
u_int32_tira_addr
u_int32_tira_preference

structicmp

Structure of an icmp header.
size 28, align 4
u_charicmp_typetype of message, see below
u_charicmp_codetype sub code
u_shorticmp_cksumones complement cksum of struct
unnamed union at netinet/ip_icmp.h:93:2icmp_hun
u_charih_pptrICMP_PARAMPROB
struct in_addrih_gwaddrICMP_REDIRECT
struct ih_idseqih_idseq
intih_void
struct ih_pmtuih_pmtuICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191)
struct ih_rtradvih_rtradv
unnamed union at netinet/ip_icmp.h:124:2icmp_dun
struct id_tsid_ts
struct id_ipid_ip
struct icmp_ra_addrid_radv
u_int32_tid_mask
char[1]id_data

macroicmp_pptr

#define icmp_pptr icmp_hun.ih_pptr

macroicmp_gwaddr

#define icmp_gwaddr icmp_hun.ih_gwaddr

macroicmp_id

#define icmp_id icmp_hun.ih_idseq.icd_id

macroicmp_seq

#define icmp_seq icmp_hun.ih_idseq.icd_seq

macroicmp_void

#define icmp_void icmp_hun.ih_void

macroicmp_pmvoid

#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void

macroicmp_nextmtu

#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu

macroicmp_num_addrs

#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs

macroicmp_wpa

#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa

macroicmp_lifetime

#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime

macroicmp_otime

#define icmp_otime icmp_dun.id_ts.its_otime

macroicmp_rtime

#define icmp_rtime icmp_dun.id_ts.its_rtime

macroicmp_ttime

#define icmp_ttime icmp_dun.id_ts.its_ttime

macroicmp_ip

#define icmp_ip icmp_dun.id_ip.idi_ip

macroicmp_radv

#define icmp_radv icmp_dun.id_radv

macroicmp_mask

#define icmp_mask icmp_dun.id_mask

macroicmp_data

#define icmp_data icmp_dun.id_data

macroICMP_MINLEN

Lower bounds on packet lengths for various types. For the error advice packets must first insure that the packet is large enough to contain the returned ip header. Only then can we do the check to see if 64 bits of packet data have been returned, since we need to check the returned ip header length.
#define ICMP_MINLEN 8
abs minimum

macroICMP_TSLEN

#define ICMP_TSLEN (8 + 3 * sizeof (n_time))
timestamp

macroICMP_MASKLEN

#define ICMP_MASKLEN 12
address mask

macroICMP_ADVLENMIN

#define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8)
min

macroICMP_ADVLEN

#define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8)

macroICMP_ECHOREPLY

Definition of type and code field values.
#define ICMP_ECHOREPLY 0
echo reply

macroICMP_UNREACH

#define ICMP_UNREACH 3
dest unreachable, codes:

macroICMP_UNREACH_NET

#define ICMP_UNREACH_NET 0
bad net

macroICMP_UNREACH_HOST

#define ICMP_UNREACH_HOST 1
bad host

macroICMP_UNREACH_PROTOCOL

#define ICMP_UNREACH_PROTOCOL 2
bad protocol

macroICMP_UNREACH_PORT

#define ICMP_UNREACH_PORT 3
bad port

macroICMP_UNREACH_NEEDFRAG

#define ICMP_UNREACH_NEEDFRAG 4
IP_DF caused drop

macroICMP_UNREACH_SRCFAIL

#define ICMP_UNREACH_SRCFAIL 5
src route failed

macroICMP_UNREACH_NET_UNKNOWN

#define ICMP_UNREACH_NET_UNKNOWN 6
unknown net

macroICMP_UNREACH_HOST_UNKNOWN

#define ICMP_UNREACH_HOST_UNKNOWN 7
unknown host

macroICMP_UNREACH_ISOLATED

#define ICMP_UNREACH_ISOLATED 8
src host isolated

macroICMP_UNREACH_NET_PROHIB

#define ICMP_UNREACH_NET_PROHIB 9
prohibited access

macroICMP_UNREACH_HOST_PROHIB

#define ICMP_UNREACH_HOST_PROHIB 10
ditto

macroICMP_UNREACH_TOSNET

#define ICMP_UNREACH_TOSNET 11
bad tos for net

macroICMP_UNREACH_TOSHOST

#define ICMP_UNREACH_TOSHOST 12
bad tos for host

macroICMP_UNREACH_FILTER_PROHIB

#define ICMP_UNREACH_FILTER_PROHIB 13
admin prohib

macroICMP_UNREACH_HOST_PRECEDENCE

#define ICMP_UNREACH_HOST_PRECEDENCE 14
host prec vio.

macroICMP_UNREACH_PRECEDENCE_CUTOFF

#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15
prec cutoff

macroICMP_SOURCEQUENCH

#define ICMP_SOURCEQUENCH 4
packet lost, slow down

macroICMP_REDIRECT

#define ICMP_REDIRECT 5
shorter route, codes:

macroICMP_REDIRECT_NET

#define ICMP_REDIRECT_NET 0
for network

macroICMP_REDIRECT_HOST

#define ICMP_REDIRECT_HOST 1
for host

macroICMP_REDIRECT_TOSNET

#define ICMP_REDIRECT_TOSNET 2
for tos and net

macroICMP_REDIRECT_TOSHOST

#define ICMP_REDIRECT_TOSHOST 3
for tos and host

macroICMP_ALTHOSTADDR

#define ICMP_ALTHOSTADDR 6
alternate host address

macroICMP_ECHO

#define ICMP_ECHO 8
echo service

macroICMP_ROUTERADVERT

#define ICMP_ROUTERADVERT 9
router advertisement

macroICMP_ROUTERADVERT_NORMAL

#define ICMP_ROUTERADVERT_NORMAL 0
normal advertisement

macroICMP_ROUTERADVERT_NOROUTE_COMMON

#define ICMP_ROUTERADVERT_NOROUTE_COMMON 16
selective routing

macroICMP_ROUTERSOLICIT

#define ICMP_ROUTERSOLICIT 10
router solicitation

macroICMP_TIMXCEED

#define ICMP_TIMXCEED 11
time exceeded, code:

macroICMP_TIMXCEED_INTRANS

#define ICMP_TIMXCEED_INTRANS 0
ttl==0 in transit

macroICMP_TIMXCEED_REASS

#define ICMP_TIMXCEED_REASS 1
ttl==0 in reass

macroICMP_PARAMPROB

#define ICMP_PARAMPROB 12
ip header bad

macroICMP_PARAMPROB_ERRATPTR

#define ICMP_PARAMPROB_ERRATPTR 0
error at param ptr

macroICMP_PARAMPROB_OPTABSENT

#define ICMP_PARAMPROB_OPTABSENT 1
req. opt. absent

macroICMP_PARAMPROB_LENGTH

#define ICMP_PARAMPROB_LENGTH 2
bad length

macroICMP_TSTAMP

#define ICMP_TSTAMP 13
timestamp request

macroICMP_TSTAMPREPLY

#define ICMP_TSTAMPREPLY 14
timestamp reply

macroICMP_IREQ

#define ICMP_IREQ 15
information request

macroICMP_IREQREPLY

#define ICMP_IREQREPLY 16
information reply

macroICMP_MASKREQ

#define ICMP_MASKREQ 17
address mask request

macroICMP_MASKREPLY

#define ICMP_MASKREPLY 18
address mask reply

macroICMP_TRACEROUTE

#define ICMP_TRACEROUTE 30
traceroute

macroICMP_DATACONVERR

#define ICMP_DATACONVERR 31
data conversion error

macroICMP_MOBILE_REDIRECT

#define ICMP_MOBILE_REDIRECT 32
mobile host redirect

macroICMP_IPV6_WHEREAREYOU

#define ICMP_IPV6_WHEREAREYOU 33
IPv6 where-are-you

macroICMP_IPV6_IAMHERE

#define ICMP_IPV6_IAMHERE 34
IPv6 i-am-here

macroICMP_MOBILE_REGREQUEST

#define ICMP_MOBILE_REGREQUEST 35
mobile registration req

macroICMP_MOBILE_REGREPLY

#define ICMP_MOBILE_REGREPLY 36
mobile registration reply

macroICMP_SKIP

#define ICMP_SKIP 39
SKIP

macroICMP_PHOTURIS

#define ICMP_PHOTURIS 40
Photuris

macroICMP_PHOTURIS_UNKNOWN_INDEX

#define ICMP_PHOTURIS_UNKNOWN_INDEX 1
unknown sec index

macroICMP_PHOTURIS_AUTH_FAILED

#define ICMP_PHOTURIS_AUTH_FAILED 2
auth failed

macroICMP_PHOTURIS_DECRYPT_FAILED

#define ICMP_PHOTURIS_DECRYPT_FAILED 3
decrypt failed

macroICMP_MAXTYPE

#define ICMP_MAXTYPE 40

macroICMP_INFOTYPE

#define ICMP_INFOTYPE(type) ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO ||
	(type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT ||
	(type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY ||
	(type) == ICMP_IREQ || (type) == ICMP_IREQREPLY ||
	(type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)

macroICMP_ERRORTYPE

#define ICMP_ERRORTYPE(type) ((type) == ICMP_UNREACH || (type) == ICMP_SOURCEQUENCH ||
	(type) == ICMP_REDIRECT || (type) == ICMP_TIMXCEED ||
	(type) == ICMP_PARAMPROB)