forked from mit-pdos/xv6-public
-
Notifications
You must be signed in to change notification settings - Fork 14
/
icmp.h
31 lines (27 loc) · 895 Bytes
/
icmp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#define ICMP_TYPE_ECHOREPLY 0
#define ICMP_TYPE_DEST_UNREACH 3
#define ICMP_TYPE_SOURCE_QUENCH 4
#define ICMP_TYPE_REDIRECT 5
#define ICMP_TYPE_ECHO 8
#define ICMP_TYPE_TIME_EXCEEDED 11
#define ICMP_TYPE_PARAM_PROBLEM 12
#define ICMP_TYPE_TIMESTAMP 13
#define ICMP_TYPE_TIMESTAMPREPLY 14
#define ICMP_TYPE_INFO_REQUEST 15
#define ICMP_TYPE_INFO_REPLY 16
/* for UNREACH */
#define ICMP_CODE_NET_UNREACH 0
#define ICMP_CODE_HOST_UNREACH 1
#define ICMP_CODE_PROTO_UNREACH 2
#define ICMP_CODE_PORT_UNREACH 3
#define ICMP_CODE_FRAGMENT_NEEDED 4
#define ICMP_CODE_SOURCE_ROUTE_FAILED 5
/* for REDIRECT */
#define ICMP_CODE_REDIRECT_NET 0
#define ICMP_CODE_REDIRECT_HOST 1
#define ICMP_CODE_REDIRECT_TOS_NET 2
#define ICMP_CODE_REDIRECT_TOS_HOST 3
/* for TIME_EXEEDED */
#define ICMP_CODE_EXCEEDED_TTL 0
#define ICMP_CODE_EXCEEDED_FRAGMENT 1
#define ICMP_COPY_LEN(x) ((((x)->vhl & 0x0f) << 2) + 8)