-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathicmp.h
executable file
·50 lines (45 loc) · 1.4 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef FLTR_ICMP_H
#define FLTR_ICMP_H
enum ICMP_MESSAGE_TYPE{
// Query Messages
ICMPMT_ECHO_REPLY = 0,
ICMPMT_ECHO_REQUEST = 8,
ICMPMT_TIMESTAMP_REQUEST = 13,
ICMPMT_TIMESTAMP_REPLY = 14,
// Error-reporting messages
ICMPMT_DESTINATION_UNREACHABLE = 3,
ICMPMT_SOURCE_QUENCH = 4,
ICMPMT_REDIRECTION = 5,
ICMPMT_TIME_EXCEEDED = 11,
ICMPMT_PARAMETER_PROBLEM = 12
};
enum ICMP_DESTINATION_UNREACHABLE_CODE{
/* codes can be generated by destination or routers */
ICMPDUC_NETWORK = 0, // NETWORK UNREACHABLE
ICMPDUC_HOST, // HOST UNREACHABLE
ICMPDUC_PROTOCOL, // PROTOCOL unreachable // only destination can generate
ICMPDUC_PORT, // port unreachable // only destination can generate
ICMPDUC_FRAGMENTATION_REQUIRED,
ICMPDUC_NO_SOURCE_ROUTING = 5,
ICMPDUC_UNKNOWN_DESTINATION_NETWORK,
ICMPDUC_UNKNOWN_DESTINATION_HOST,
ICMPDUC_ISOLATED_SOURCE_HOST,
ICMPDUC_PROHIBITED_NETWORK,
ICMPDUC_PROHIBITED_HOST = 10,
ICMPDUC_WRONG_SERVICE_UNREACHABLE_NETWORK,
ICMPDUC_WRONG_SERVICE_UNREACHABLE_HOST,
ICMPDUC_HOST_ADMIN_FILTER,
ICMPDUC_HOST_PRECEDENCE_VIOLATED,
ICMPDUC_HOST_PRECEDENCE_CUT_OFF = 15
};
struct ICMP_HEADER{
UCHAR Type;
UCHAR Code;
USHORT Checksum;
ULONG RestOfHeader;
};
void DebugPrintICMPHeader(struct ICMP_HEADER * icmph);
BOOLEAN IsQueryMessage(UCHAR type);
BOOLEAN IsDestinationUnreachable(UCHAR type);
BOOLEAN IsPing(UCHAR type);
#endif