1 #ifndef _NETINET_IP_ICMP_H
2 #define _NETINET_IP_ICMP_H
5 #include <netinet/in.h>
6 #include <netinet/ip.h>
29 #define ICMP_ECHOREPLY 0
30 #define ICMP_DEST_UNREACH 3
31 #define ICMP_SOURCE_QUENCH 4
32 #define ICMP_REDIRECT 5
34 #define ICMP_TIME_EXCEEDED 11
35 #define ICMP_PARAMETERPROB 12
36 #define ICMP_TIMESTAMP 13
37 #define ICMP_TIMESTAMPREPLY 14
38 #define ICMP_INFO_REQUEST 15
39 #define ICMP_INFO_REPLY 16
40 #define ICMP_ADDRESS 17
41 #define ICMP_ADDRESSREPLY 18
42 #define NR_ICMP_TYPES 18
45 #define ICMP_NET_UNREACH 0
46 #define ICMP_HOST_UNREACH 1
47 #define ICMP_PROT_UNREACH 2
48 #define ICMP_PORT_UNREACH 3
49 #define ICMP_FRAG_NEEDED 4
50 #define ICMP_SR_FAILED 5
51 #define ICMP_NET_UNKNOWN 6
52 #define ICMP_HOST_UNKNOWN 7
53 #define ICMP_HOST_ISOLATED 8
54 #define ICMP_NET_ANO 9
55 #define ICMP_HOST_ANO 10
56 #define ICMP_NET_UNR_TOS 11
57 #define ICMP_HOST_UNR_TOS 12
58 #define ICMP_PKT_FILTERED 13
59 #define ICMP_PREC_VIOLATION 14
60 #define ICMP_PREC_CUTOFF 15
61 #define NR_ICMP_UNREACH 15
63 #define ICMP_REDIR_NET 0
64 #define ICMP_REDIR_HOST 1
65 #define ICMP_REDIR_NETTOS 2
66 #define ICMP_REDIR_HOSTTOS 3
68 #define ICMP_EXC_TTL 0
69 #define ICMP_EXC_FRAGTIME 1
74 uint32_t ira_preference;
83 struct in_addr ih_gwaddr;
96 uint8_t irt_num_addrs;
98 uint16_t irt_lifetime;
110 struct icmp_ra_addr id_radv;
116 #define icmp_pptr icmp_hun.ih_pptr
117 #define icmp_gwaddr icmp_hun.ih_gwaddr
118 #define icmp_id icmp_hun.ih_idseq.icd_id
119 #define icmp_seq icmp_hun.ih_idseq.icd_seq
120 #define icmp_void icmp_hun.ih_void
121 #define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void
122 #define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu
123 #define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs
124 #define icmp_wpa icmp_hun.ih_rtradv.irt_wpa
125 #define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime
126 #define icmp_otime icmp_dun.id_ts.its_otime
127 #define icmp_rtime icmp_dun.id_ts.its_rtime
128 #define icmp_ttime icmp_dun.id_ts.its_ttime
129 #define icmp_ip icmp_dun.id_ip.idi_ip
130 #define icmp_radv icmp_dun.id_radv
131 #define icmp_mask icmp_dun.id_mask
132 #define icmp_data icmp_dun.id_data
134 #define ICMP_MINLEN 8
135 #define ICMP_TSLEN (8 + 3 * sizeof (n_time))
136 #define ICMP_MASKLEN 12
137 #define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8)
138 #define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8)
140 #define ICMP_UNREACH 3
141 #define ICMP_SOURCEQUENCH 4
142 #define ICMP_ROUTERADVERT 9
143 #define ICMP_ROUTERSOLICIT 10
144 #define ICMP_TIMXCEED 11
145 #define ICMP_PARAMPROB 12
146 #define ICMP_TSTAMP 13
147 #define ICMP_TSTAMPREPLY 14
149 #define ICMP_IREQREPLY 16
150 #define ICMP_MASKREQ 17
151 #define ICMP_MASKREPLY 18
152 #define ICMP_MAXTYPE 18
154 #define ICMP_UNREACH_NET 0
155 #define ICMP_UNREACH_HOST 1
156 #define ICMP_UNREACH_PROTOCOL 2
157 #define ICMP_UNREACH_PORT 3
158 #define ICMP_UNREACH_NEEDFRAG 4
159 #define ICMP_UNREACH_SRCFAIL 5
160 #define ICMP_UNREACH_NET_UNKNOWN 6
161 #define ICMP_UNREACH_HOST_UNKNOWN 7
162 #define ICMP_UNREACH_ISOLATED 8
163 #define ICMP_UNREACH_NET_PROHIB 9
164 #define ICMP_UNREACH_HOST_PROHIB 10
165 #define ICMP_UNREACH_TOSNET 11
166 #define ICMP_UNREACH_TOSHOST 12
167 #define ICMP_UNREACH_FILTER_PROHIB 13
168 #define ICMP_UNREACH_HOST_PRECEDENCE 14
169 #define ICMP_UNREACH_PRECEDENCE_CUTOFF 15
171 #define ICMP_REDIRECT_NET 0
172 #define ICMP_REDIRECT_HOST 1
173 #define ICMP_REDIRECT_TOSNET 2
174 #define ICMP_REDIRECT_TOSHOST 3
176 #define ICMP_TIMXCEED_INTRANS 0
177 #define ICMP_TIMXCEED_REASS 1
179 #define ICMP_PARAMPROB_OPTABSENT 1
181 #define ICMP_INFOTYPE(type) \
182 ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \
183 (type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || \
184 (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \
185 (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \
186 (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)