-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathneticmp.h
More file actions
45 lines (35 loc) · 931 Bytes
/
Copy pathneticmp.h
File metadata and controls
45 lines (35 loc) · 931 Bytes
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
/*
* Definitions for ICMP protocol implementation
*/
////
// Constants
////
#define ICMPV4_TYPE_ECHO_REPLY 0
#define ICMPV4_TYPE_UNREACHABLE 3
#define ICMPV4_TYPE_ECHO_REQUEST 8
#define ICMPV4_TYPE_TIME_EXCEEDED 11
#define ICMPV4_UNREACHABLE_CODE_NETWORK 0
#define ICMPV4_UNREACHABLE_CODE_MACHINE 1
#define ICMPV4_UNREACHABLE_CODE_PROTOCOL 2
#define ICMPV4_UNREACHABLE_CODE_PORT 3
#define ICMPV4_UNREACHABLE_CODE_FRAGMENT 4
#define ICMPV4_CODE_NONE 0
////
// Structures
////
#pragma pack(1)
typedef struct{
unsigned char type;
unsigned char code;
unsigned short int checksum;
unsigned char data[1];
} ICMPv4_fields;
#pragma pack()
////
// Prototypes
////
#ifdef VERBOSE
void displayICMPv4Packet(FILE *output,ICMPv4_fields *icmp,int size);
#endif
unsigned char icmpDecodePacket(EventsEvent *event,EventsSelector *selector);
unsigned char icmpSendPacket(EventsEvent *event,EventsSelector *selector);