2000-08-02 00:24:26 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS TCP/IP protocol driver
|
|
|
|
* FILE: include/icmp.h
|
|
|
|
* PURPOSE: Internet Control Message Protocol definitions
|
|
|
|
*/
|
2010-02-26 11:43:19 +00:00
|
|
|
|
|
|
|
#pragma once
|
2000-08-02 00:24:26 +00:00
|
|
|
|
2019-11-18 17:55:10 +00:00
|
|
|
#include <pshpack1.h>
|
2000-08-02 00:24:26 +00:00
|
|
|
typedef struct ICMP_HEADER {
|
2019-11-18 17:55:10 +00:00
|
|
|
UINT8 Type; /* ICMP message type */
|
|
|
|
UINT8 Code; /* ICMP message code */
|
|
|
|
UINT16 Checksum; /* ICMP message checksum */
|
|
|
|
UINT16 Identifier; /* ICMP Echo message identifier */
|
|
|
|
UINT16 Seq; /* ICMP Echo message sequence num */
|
2000-08-02 00:24:26 +00:00
|
|
|
} ICMP_HEADER, *PICMP_HEADER;
|
2019-11-18 17:55:10 +00:00
|
|
|
#include <poppack.h>
|
2000-08-02 00:24:26 +00:00
|
|
|
|
|
|
|
/* ICMP message types */
|
|
|
|
#define ICMP_TYPE_ECHO_REPLY 0 /* Echo reply */
|
|
|
|
#define ICMP_TYPE_DEST_UNREACH 3 /* Destination unreachable */
|
|
|
|
#define ICMP_TYPE_SOURCE_QUENCH 4 /* Source quench */
|
|
|
|
#define ICMP_TYPE_REDIRECT 5 /* Redirect */
|
|
|
|
#define ICMP_TYPE_ECHO_REQUEST 8 /* Echo request */
|
|
|
|
#define ICMP_TYPE_TIME_EXCEEDED 11 /* Time exceeded */
|
|
|
|
#define ICMP_TYPE_PARAMETER 12 /* Parameter problem */
|
|
|
|
#define ICMP_TYPE_TIMESTAMP_REQUEST 13 /* Timestamp request */
|
|
|
|
#define ICMP_TYPE_TIMESTAMP_REPLY 14 /* Timestamp reply */
|
|
|
|
#define ICMP_TYPE_INFO_REQUEST 15 /* Information request */
|
|
|
|
#define ICMP_TYPE_INFO_REPLY 16 /* Information reply */
|
|
|
|
|
|
|
|
/* ICMP codes for ICMP_TYPE_DEST_UNREACH */
|
|
|
|
#define ICMP_CODE_DU_NET_UNREACH 0 /* Network unreachable */
|
|
|
|
#define ICMP_CODE_DU_HOST_UNREACH 1 /* Host unreachable */
|
|
|
|
#define ICMP_CODE_DU_PROTOCOL_UNREACH 2 /* Protocol unreachable */
|
|
|
|
#define ICMP_CODE_DU_PORT_UNREACH 3 /* Port unreachable */
|
|
|
|
#define ICMP_CODE_DU_FRAG_DF_SET 4 /* Fragmentation needed and DF set */
|
|
|
|
#define ICMP_CODE_DU_SOURCE_ROUTE_FAILED 5 /* Source route failed */
|
|
|
|
|
|
|
|
/* ICMP codes for ICMP_TYPE_REDIRECT */
|
|
|
|
#define ICMP_CODE_RD_NET 0 /* Redirect datagrams for the network */
|
|
|
|
#define ICMP_CODE_RD_HOST 1 /* Redirect datagrams for the host */
|
|
|
|
#define ICMP_CODE_RD_TOS_NET 2 /* Redirect datagrams for the Type of Service and network */
|
|
|
|
#define ICMP_CODE_RD_TOS_HOST 3 /* Redirect datagrams for the Type of Service and host */
|
|
|
|
|
|
|
|
/* ICMP codes for ICMP_TYPE_TIME_EXCEEDED */
|
|
|
|
#define ICMP_CODE_TE_TTL 0 /* Time to live exceeded in transit */
|
|
|
|
#define ICMP_CODE_TE_REASSEMBLY 1 /* Fragment reassembly time exceeded */
|
|
|
|
|
|
|
|
/* ICMP codes for ICMP_TYPE_PARAMETER */
|
|
|
|
#define ICMP_CODE_TP_POINTER 1 /* Pointer indicates the error */
|
|
|
|
|
2019-11-18 17:55:10 +00:00
|
|
|
NTSTATUS
|
|
|
|
DispEchoRequest(
|
|
|
|
PDEVICE_OBJECT DeviceObject,
|
|
|
|
PIRP Irp,
|
|
|
|
PIO_STACK_LOCATION IrpSp);
|
|
|
|
|
2009-07-19 14:48:48 +00:00
|
|
|
NTSTATUS ICMPSendDatagram(
|
|
|
|
PADDRESS_FILE AddrFile,
|
|
|
|
PTDI_CONNECTION_INFORMATION ConnInfo,
|
|
|
|
PCHAR BufferData,
|
|
|
|
ULONG DataSize,
|
|
|
|
PULONG DataUsed );
|
|
|
|
|
2011-03-15 18:41:17 +00:00
|
|
|
NTSTATUS ICMPStartup(VOID);
|
2009-07-19 14:48:48 +00:00
|
|
|
|
2011-03-15 18:41:17 +00:00
|
|
|
NTSTATUS ICMPShutdown(VOID);
|
2000-08-02 00:24:26 +00:00
|
|
|
|
|
|
|
VOID ICMPReceive(
|
2004-11-25 23:56:59 +00:00
|
|
|
PIP_INTERFACE Interface,
|
2000-08-02 00:24:26 +00:00
|
|
|
PIP_PACKET IPPacket);
|
|
|
|
|
|
|
|
VOID ICMPReply(
|
2004-11-25 23:56:59 +00:00
|
|
|
PIP_INTERFACE Interface,
|
2000-08-02 00:24:26 +00:00
|
|
|
PIP_PACKET IPPacket,
|
2004-11-25 23:56:59 +00:00
|
|
|
UCHAR Type,
|
|
|
|
UCHAR Code);
|
2000-08-02 00:24:26 +00:00
|
|
|
|
|
|
|
/* EOF */
|