#include <netinet/ip_icmp.h>
netinet/ip_icmp.h
structicmp
Structure of an icmp header.
| u_char | icmp_type | type of message, see below | ||||||||||||||||||
| u_char | icmp_code | type sub code | ||||||||||||||||||
| u_short | icmp_cksum | ones complement cksum of struct | ||||||||||||||||||
| unnamed union at netinet/ip_icmp.h:93:2 | icmp_hun | |||||||||||||||||||
| ||||||||||||||||||||
| unnamed union at netinet/ip_icmp.h:124:2 | icmp_dun | |||||||||||||||||||
| ||||||||||||||||||||
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_ADVLEN
#define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8)
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)