- Stephen Rothwell: APM updates
[davej-history.git] / include / linux / icmp.h
blob49e3e931ded1df86f51116060179fbd0925ca63f
1 /*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
6 * Definitions for the ICMP protocol.
8 * Version: @(#)icmp.h 1.0.3 04/28/93
10 * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version
15 * 2 of the License, or (at your option) any later version.
17 #ifndef _LINUX_ICMP_H
18 #define _LINUX_ICMP_H
20 #define ICMP_ECHOREPLY 0 /* Echo Reply */
21 #define ICMP_DEST_UNREACH 3 /* Destination Unreachable */
22 #define ICMP_SOURCE_QUENCH 4 /* Source Quench */
23 #define ICMP_REDIRECT 5 /* Redirect (change route) */
24 #define ICMP_ECHO 8 /* Echo Request */
25 #define ICMP_TIME_EXCEEDED 11 /* Time Exceeded */
26 #define ICMP_PARAMETERPROB 12 /* Parameter Problem */
27 #define ICMP_TIMESTAMP 13 /* Timestamp Request */
28 #define ICMP_TIMESTAMPREPLY 14 /* Timestamp Reply */
29 #define ICMP_INFO_REQUEST 15 /* Information Request */
30 #define ICMP_INFO_REPLY 16 /* Information Reply */
31 #define ICMP_ADDRESS 17 /* Address Mask Request */
32 #define ICMP_ADDRESSREPLY 18 /* Address Mask Reply */
33 #define NR_ICMP_TYPES 18
36 /* Codes for UNREACH. */
37 #define ICMP_NET_UNREACH 0 /* Network Unreachable */
38 #define ICMP_HOST_UNREACH 1 /* Host Unreachable */
39 #define ICMP_PROT_UNREACH 2 /* Protocol Unreachable */
40 #define ICMP_PORT_UNREACH 3 /* Port Unreachable */
41 #define ICMP_FRAG_NEEDED 4 /* Fragmentation Needed/DF set */
42 #define ICMP_SR_FAILED 5 /* Source Route failed */
43 #define ICMP_NET_UNKNOWN 6
44 #define ICMP_HOST_UNKNOWN 7
45 #define ICMP_HOST_ISOLATED 8
46 #define ICMP_NET_ANO 9
47 #define ICMP_HOST_ANO 10
48 #define ICMP_NET_UNR_TOS 11
49 #define ICMP_HOST_UNR_TOS 12
50 #define ICMP_PKT_FILTERED 13 /* Packet filtered */
51 #define ICMP_PREC_VIOLATION 14 /* Precedence violation */
52 #define ICMP_PREC_CUTOFF 15 /* Precedence cut off */
53 #define NR_ICMP_UNREACH 15 /* instead of hardcoding immediate value */
55 /* Codes for REDIRECT. */
56 #define ICMP_REDIR_NET 0 /* Redirect Net */
57 #define ICMP_REDIR_HOST 1 /* Redirect Host */
58 #define ICMP_REDIR_NETTOS 2 /* Redirect Net for TOS */
59 #define ICMP_REDIR_HOSTTOS 3 /* Redirect Host for TOS */
61 /* Codes for TIME_EXCEEDED. */
62 #define ICMP_EXC_TTL 0 /* TTL count exceeded */
63 #define ICMP_EXC_FRAGTIME 1 /* Fragment Reass time exceeded */
66 struct icmphdr {
67 __u8 type;
68 __u8 code;
69 __u16 checksum;
70 union {
71 struct {
72 __u16 id;
73 __u16 sequence;
74 } echo;
75 __u32 gateway;
76 struct {
77 __u16 __unused;
78 __u16 mtu;
79 } frag;
80 } un;
83 #ifdef __KERNEL__
85 #include <linux/ip.h>
88 * Build xmit assembly blocks
91 struct icmp_bxm
93 void *data_ptr;
94 int data_len;
95 struct icmphdr icmph;
96 unsigned long csum;
97 struct ip_options replyopts;
98 unsigned char optbuf[40];
101 struct sk_buff;
103 extern void icmp_reply(struct icmp_bxm *, struct sk_buff *);
105 #endif
108 * constants for (set|get)sockopt
111 #define ICMP_FILTER 1
113 struct icmp_filter {
114 __u32 data;
118 #endif /* _LINUX_ICMP_H */