mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 15:53:03 +00:00
[TCPIP] Implement IOCTL_ICMP_ECHO_REQUEST in tcpip.sys
Also clean up ICMP handling code in sdk/lib/drivers/ip CORE-10760
This commit is contained in:
parent
dd2ff41dfc
commit
740a859e92
9 changed files with 505 additions and 241 deletions
|
@ -7,12 +7,15 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <pshpack1.h>
|
||||
typedef struct ICMP_HEADER {
|
||||
UCHAR Type; /* ICMP message type */
|
||||
UCHAR Code; /* ICMP message code */
|
||||
USHORT Checksum; /* ICMP message checksum */
|
||||
ULONG Unused; /* ICMP unused */
|
||||
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 */
|
||||
} ICMP_HEADER, *PICMP_HEADER;
|
||||
#include <poppack.h>
|
||||
|
||||
/* ICMP message types */
|
||||
#define ICMP_TYPE_ECHO_REPLY 0 /* Echo reply */
|
||||
|
@ -48,6 +51,12 @@ typedef struct ICMP_HEADER {
|
|||
/* ICMP codes for ICMP_TYPE_PARAMETER */
|
||||
#define ICMP_CODE_TP_POINTER 1 /* Pointer indicates the error */
|
||||
|
||||
NTSTATUS
|
||||
DispEchoRequest(
|
||||
PDEVICE_OBJECT DeviceObject,
|
||||
PIRP Irp,
|
||||
PIO_STACK_LOCATION IrpSp);
|
||||
|
||||
NTSTATUS ICMPSendDatagram(
|
||||
PADDRESS_FILE AddrFile,
|
||||
PTDI_CONNECTION_INFORMATION ConnInfo,
|
||||
|
@ -63,11 +72,6 @@ VOID ICMPReceive(
|
|||
PIP_INTERFACE Interface,
|
||||
PIP_PACKET IPPacket);
|
||||
|
||||
VOID ICMPTransmit(
|
||||
PIP_PACKET IPPacket,
|
||||
PIP_TRANSMIT_COMPLETE Complete,
|
||||
PVOID Context);
|
||||
|
||||
VOID ICMPReply(
|
||||
PIP_INTERFACE Interface,
|
||||
PIP_PACKET IPPacket,
|
||||
|
|
|
@ -15,7 +15,9 @@
|
|||
#include <tilists.h>
|
||||
#include <lock.h>
|
||||
#include <interface.h>
|
||||
#include <fileobjs.h>
|
||||
#include <chew/chew.h>
|
||||
#include <pseh/pseh2.h>
|
||||
#include <psdk/ipexport.h>
|
||||
|
||||
#endif /* _TCPIP_PCH_ */
|
||||
|
|
|
@ -36,4 +36,14 @@ NTSTATUS AddGenericHeaderIPv4(
|
|||
UINT ExtraLength,
|
||||
PVOID *NextHeader );
|
||||
|
||||
NTSTATUS BuildRawIpPacket(
|
||||
PADDRESS_FILE AddrFile,
|
||||
PIP_PACKET Packet,
|
||||
PIP_ADDRESS RemoteAddress,
|
||||
USHORT RemotePort,
|
||||
PIP_ADDRESS LocalAddress,
|
||||
USHORT LocalPort,
|
||||
PCHAR DataBuffer,
|
||||
UINT DataLen);
|
||||
|
||||
/* EOF */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue