4#include <clicknet/ip.h>
27struct click_icmp_sequenced {
31 uint16_t icmp_identifier;
32 uint16_t icmp_sequence;
36struct click_icmp_paramprob {
46struct click_icmp_redirect {
50 struct in_addr icmp_gateway;
55struct click_icmp_tstamp {
59 uint16_t icmp_identifier;
60 uint16_t icmp_sequence;
61 uint32_t icmp_originate;
62 uint32_t icmp_receive;
63 uint32_t icmp_transmit;
67struct click_icmp_needfrag {
72 uint16_t icmp_nextmtu;
76#define click_icmp_unreach click_icmp
77#define click_icmp_sourcequench click_icmp
78#define click_icmp_timxceed click_icmp
79#define click_icmp_echo click_icmp_sequenced
83#define ICMP_ECHOREPLY 0
85#define ICMP_UNREACH_NET 0
86#define ICMP_UNREACH_HOST 1
87#define ICMP_UNREACH_PROTOCOL 2
88#define ICMP_UNREACH_PORT 3
89#define ICMP_UNREACH_NEEDFRAG 4
90#define ICMP_UNREACH_SRCFAIL 5
91#define ICMP_UNREACH_NET_UNKNOWN 6
92#define ICMP_UNREACH_HOST_UNKNOWN 7
93#define ICMP_UNREACH_ISOLATED 8
94#define ICMP_UNREACH_NET_PROHIB 9
95#define ICMP_UNREACH_HOST_PROHIB 10
96#define ICMP_UNREACH_TOSNET 11
97#define ICMP_UNREACH_TOSHOST 12
98#define ICMP_UNREACH_FILTER_PROHIB 13
99#define ICMP_UNREACH_HOST_PRECEDENCE 14
100#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15
101#define ICMP_SOURCEQUENCH 4
102#define ICMP_REDIRECT 5
103#define ICMP_REDIRECT_NET 0
104#define ICMP_REDIRECT_HOST 1
105#define ICMP_REDIRECT_TOSNET 2
106#define ICMP_REDIRECT_TOSHOST 3
108#define ICMP_ROUTERADVERT 9
109#define ICMP_ROUTERSOLICIT 10
110#define ICMP_TIMXCEED 11
111#define ICMP_TIMXCEED_TRANSIT 0
112#define ICMP_TIMXCEED_REASSEMBLY 1
113#define ICMP_PARAMPROB 12
114#define ICMP_PARAMPROB_ERRATPTR 0
115#define ICMP_PARAMPROB_OPTABSENT 1
116#define ICMP_PARAMPROB_LENGTH 2
117#define ICMP_TSTAMP 13
118#define ICMP_TSTAMPREPLY 14
120#define ICMP_IREQREPLY 16
121#define ICMP_MASKREQ 17
122#define ICMP_MASKREQREPLY 18
125click_icmp_hl(uint8_t icmp_type)
127 if (icmp_type == ICMP_TSTAMP || icmp_type == ICMP_TSTAMPREPLY)
128 return sizeof(click_icmp_tstamp);
130 return sizeof(click_icmp);