ReactOS 0.4.15-dev-7934-g1dc8d80
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>
11typedef 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 */
unsigned short UINT16
unsigned char UINT8
Type
Definition: Type.h:7
LONG NTSTATUS
Definition: precomp.h:26
_In_ PIRP Irp
Definition: csq.h:116
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137
NTSTATUS ICMPStartup()
Definition: icmp.c:15
NTSTATUS ICMPShutdown()
Definition: icmp.c:22
NTSTATUS DispEchoRequest(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp)
NTSTATUS ICMPSendDatagram(PADDRESS_FILE AddrFile, PTDI_CONNECTION_INFORMATION ConnInfo, PCHAR BufferData, ULONG DataSize, PULONG DataUsed)
Definition: icmp.c:29
VOID ICMPReceive(PIP_INTERFACE Interface, PIP_PACKET IPPacket)
Definition: icmp.c:53
struct ICMP_HEADER * PICMP_HEADER
VOID ICMPReply(PIP_INTERFACE Interface, PIP_PACKET IPPacket, UCHAR Type, UCHAR Code)
Definition: icmp.c:91
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
Definition: ndis.h:4755
UINT16 Seq
Definition: icmp.h:16
UINT8 Type
Definition: icmp.h:12
UINT16 Checksum
Definition: icmp.h:14
UINT8 Code
Definition: icmp.h:13
UINT16 Identifier
Definition: icmp.h:15
Definition: ip.h:77
uint32_t * PULONG
Definition: typedefs.h:59
uint32_t ULONG
Definition: typedefs.h:59
char * PCHAR
Definition: typedefs.h:51
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ UCHAR _In_ UCHAR _In_ ULONG Code
Definition: wdfdevice.h:1701
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465
unsigned char UCHAR
Definition: xmlstorage.h:181