a1787a01bd144dcb06621ce7eee1ee3b992410ad
[reactos.git] / reactos / drivers / net / tcpip / include / icmp.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS TCP/IP protocol driver
4 * FILE: include/icmp.h
5 * PURPOSE: Internet Control Message Protocol definitions
6 */
7 #ifndef __ICMP_H
8 #define __ICMP_H
9
10 typedef struct ICMP_HEADER {
11 UCHAR Type; /* ICMP message type */
12 UCHAR Code; /* ICMP message code */
13 USHORT Checksum; /* ICMP message checksum */
14 ULONG Unused; /* ICMP unused */
15 } ICMP_HEADER, *PICMP_HEADER;
16
17 /* ICMP message types */
18 #define ICMP_TYPE_ECHO_REPLY 0 /* Echo reply */
19 #define ICMP_TYPE_DEST_UNREACH 3 /* Destination unreachable */
20 #define ICMP_TYPE_SOURCE_QUENCH 4 /* Source quench */
21 #define ICMP_TYPE_REDIRECT 5 /* Redirect */
22 #define ICMP_TYPE_ECHO_REQUEST 8 /* Echo request */
23 #define ICMP_TYPE_TIME_EXCEEDED 11 /* Time exceeded */
24 #define ICMP_TYPE_PARAMETER 12 /* Parameter problem */
25 #define ICMP_TYPE_TIMESTAMP_REQUEST 13 /* Timestamp request */
26 #define ICMP_TYPE_TIMESTAMP_REPLY 14 /* Timestamp reply */
27 #define ICMP_TYPE_INFO_REQUEST 15 /* Information request */
28 #define ICMP_TYPE_INFO_REPLY 16 /* Information reply */
29
30 /* ICMP codes for ICMP_TYPE_DEST_UNREACH */
31 #define ICMP_CODE_DU_NET_UNREACH 0 /* Network unreachable */
32 #define ICMP_CODE_DU_HOST_UNREACH 1 /* Host unreachable */
33 #define ICMP_CODE_DU_PROTOCOL_UNREACH 2 /* Protocol unreachable */
34 #define ICMP_CODE_DU_PORT_UNREACH 3 /* Port unreachable */
35 #define ICMP_CODE_DU_FRAG_DF_SET 4 /* Fragmentation needed and DF set */
36 #define ICMP_CODE_DU_SOURCE_ROUTE_FAILED 5 /* Source route failed */
37
38 /* ICMP codes for ICMP_TYPE_REDIRECT */
39 #define ICMP_CODE_RD_NET 0 /* Redirect datagrams for the network */
40 #define ICMP_CODE_RD_HOST 1 /* Redirect datagrams for the host */
41 #define ICMP_CODE_RD_TOS_NET 2 /* Redirect datagrams for the Type of Service and network */
42 #define ICMP_CODE_RD_TOS_HOST 3 /* Redirect datagrams for the Type of Service and host */
43
44 /* ICMP codes for ICMP_TYPE_TIME_EXCEEDED */
45 #define ICMP_CODE_TE_TTL 0 /* Time to live exceeded in transit */
46 #define ICMP_CODE_TE_REASSEMBLY 1 /* Fragment reassembly time exceeded */
47
48 /* ICMP codes for ICMP_TYPE_PARAMETER */
49 #define ICMP_CODE_TP_POINTER 1 /* Pointer indicates the error */
50
51
52 VOID ICMPReceive(
53 PNET_TABLE_ENTRY NTE,
54 PIP_PACKET IPPacket);
55
56 VOID ICMPTransmit(
57 PNET_TABLE_ENTRY NTE,
58 PIP_PACKET IPPacket,
59 PIP_TRANSMIT_COMPLETE Complete,
60 PVOID Context);
61
62 VOID ICMPReply(
63 PNET_TABLE_ENTRY NTE,
64 PIP_PACKET IPPacket,
65 UCHAR Type,
66 UCHAR Code);
67
68 #endif /* __ICMP_H */
69
70 /* EOF */