ReactOS  0.4.15-dev-1152-g6c94e4f
icmp.h
Go to the documentation of this file.
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 
8 #pragma once
9 
10 #include <pshpack1.h>
11 typedef struct ICMP_HEADER {
12  UINT8 Type; /* ICMP message type */
13  UINT8 Code; /* ICMP message code */
14  UINT16 Checksum; /* ICMP message checksum */
15  UINT16 Identifier; /* ICMP Echo message identifier */
16  UINT16 Seq; /* ICMP Echo message sequence num */
18 #include <poppack.h>
19 
20 /* ICMP message types */
21 #define ICMP_TYPE_ECHO_REPLY 0 /* Echo reply */
22 #define ICMP_TYPE_DEST_UNREACH 3 /* Destination unreachable */
23 #define ICMP_TYPE_SOURCE_QUENCH 4 /* Source quench */
24 #define ICMP_TYPE_REDIRECT 5 /* Redirect */
25 #define ICMP_TYPE_ECHO_REQUEST 8 /* Echo request */
26 #define ICMP_TYPE_TIME_EXCEEDED 11 /* Time exceeded */
27 #define ICMP_TYPE_PARAMETER 12 /* Parameter problem */
28 #define ICMP_TYPE_TIMESTAMP_REQUEST 13 /* Timestamp request */
29 #define ICMP_TYPE_TIMESTAMP_REPLY 14 /* Timestamp reply */
30 #define ICMP_TYPE_INFO_REQUEST 15 /* Information request */
31 #define ICMP_TYPE_INFO_REPLY 16 /* Information reply */
32 
33 /* ICMP codes for ICMP_TYPE_DEST_UNREACH */
34 #define ICMP_CODE_DU_NET_UNREACH 0 /* Network unreachable */
35 #define ICMP_CODE_DU_HOST_UNREACH 1 /* Host unreachable */
36 #define ICMP_CODE_DU_PROTOCOL_UNREACH 2 /* Protocol unreachable */
37 #define ICMP_CODE_DU_PORT_UNREACH 3 /* Port unreachable */
38 #define ICMP_CODE_DU_FRAG_DF_SET 4 /* Fragmentation needed and DF set */
39 #define ICMP_CODE_DU_SOURCE_ROUTE_FAILED 5 /* Source route failed */
40 
41 /* ICMP codes for ICMP_TYPE_REDIRECT */
42 #define ICMP_CODE_RD_NET 0 /* Redirect datagrams for the network */
43 #define ICMP_CODE_RD_HOST 1 /* Redirect datagrams for the host */
44 #define ICMP_CODE_RD_TOS_NET 2 /* Redirect datagrams for the Type of Service and network */
45 #define ICMP_CODE_RD_TOS_HOST 3 /* Redirect datagrams for the Type of Service and host */
46 
47 /* ICMP codes for ICMP_TYPE_TIME_EXCEEDED */
48 #define ICMP_CODE_TE_TTL 0 /* Time to live exceeded in transit */
49 #define ICMP_CODE_TE_REASSEMBLY 1 /* Fragment reassembly time exceeded */
50 
51 /* ICMP codes for ICMP_TYPE_PARAMETER */
52 #define ICMP_CODE_TP_POINTER 1 /* Pointer indicates the error */
53 
57  PIRP Irp,
59 
61  PADDRESS_FILE AddrFile,
63  PCHAR BufferData,
65  PULONG DataUsed );
66 
68 
70 
73  PIP_PACKET IPPacket);
74 
77  PIP_PACKET IPPacket,
78  UCHAR Type,
79  UCHAR Code);
80 
81 /* EOF */
signed char * PCHAR
Definition: retypes.h:7
VOID ICMPReceive(PIP_INTERFACE Interface, PIP_PACKET IPPacket)
Definition: icmp.c:53
UINT8 Type
Definition: icmp.h:12
NTSTATUS ICMPSendDatagram(PADDRESS_FILE AddrFile, PTDI_CONNECTION_INFORMATION ConnInfo, PCHAR BufferData, ULONG DataSize, PULONG DataUsed)
Definition: icmp.c:29
UINT16 Identifier
Definition: icmp.h:15
UINT16 Seq
Definition: icmp.h:16
Type
Definition: Type.h:6
struct ICMP_HEADER ICMP_HEADER
_In_ PIRP Irp
Definition: csq.h:116
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS ICMPShutdown(VOID)
NTSTATUS DispEchoRequest(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp)
#define Code
Definition: deflate.h:80
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:361
UINT16 Checksum
Definition: icmp.h:14
UINT8 Code
Definition: icmp.h:13
unsigned char UCHAR
Definition: xmlstorage.h:181
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137
_In_ PDEVICE_OBJECT DeviceObject
Definition: iotypes.h:2464
unsigned short UINT16
unsigned int * PULONG
Definition: retypes.h:1
VOID ICMPReply(PIP_INTERFACE Interface, PIP_PACKET IPPacket, UCHAR Type, UCHAR Code)
Definition: icmp.c:91
struct ICMP_HEADER * PICMP_HEADER
NTSTATUS ICMPStartup(VOID)
unsigned int ULONG
Definition: retypes.h:1
Definition: ip.h:77
unsigned char UINT8
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
Definition: ndis.h:4751