1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 #define ICMP_ECHOREPLY 0
17 #define ICMP_DEST_UNREACH 3
18 #define ICMP_SOURCE_QUENCH 4
19 #define ICMP_REDIRECT 5
20 #define ICMP_ECHO 8
21 #define ICMP_TIME_EXCEEDED 11
22 #define ICMP_PARAMETERPROB 12
23 #define ICMP_TIMESTAMP 13
24 #define ICMP_TIMESTAMPREPLY 14
25 #define ICMP_INFO_REQUEST 15
26 #define ICMP_INFO_REPLY 16
27
28
29
30
31 #define ICMP_NET_UNREACH 0
32 #define ICMP_HOST_UNREACH 1
33 #define ICMP_PROT_UNREACH 2
34 #define ICMP_PORT_UNREACH 3
35 #define ICMP_FRAG_NNEDED 4
36 #define ICMP_SR_FAILED 5
37 #define ICMP_NET_UNKNOWN 6
38 #define ICMP_HOST_UNKNOWN 7
39 #define ICMP_HOST_ISOLATED 8
40 #define ICMP_NET_ANO 9
41 #define ICMP_HOST_ANO 10
42 #define ICMP_NET_UNR_TOS 11
43 #define ICMP_HOST_UNR_TOS 12
44
45
46 struct icmp_header
47 {
48 unsigned char type;
49 unsigned char code;
50 unsigned short checksum;
51 union
52 {
53 struct
54 {
55 unsigned short id;
56 unsigned short sequence;
57 } echo;
58 unsigned long gateway;
59 } un;
60 };
61
62 struct icmp_err
63 {
64 int errno;
65 unsigned fatal:1;
66 };
67
68 extern struct icmp_err icmp_err_convert[];
69
70 int
71 icmp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
72 unsigned long daddr, unsigned short len,
73 unsigned long saddr, int redo, struct ip_protocol *protocol);
74
75 void
76 icmp_reply (struct sk_buff *skb_in, int type, int code, struct device *dev);