mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Fixed IPStartup prototype and moved DisplayIPPacket out of ifdef.
svn path=/trunk/; revision=11184
This commit is contained in:
parent
706ff78e48
commit
2638336b0e
2 changed files with 56 additions and 59 deletions
|
@ -926,13 +926,10 @@ VOID DefaultProtocolHandler(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS IPStartup(
|
NTSTATUS IPStartup(PUNICODE_STRING RegistryPath)
|
||||||
PDRIVER_OBJECT DriverObject,
|
|
||||||
PUNICODE_STRING RegistryPath)
|
|
||||||
/*
|
/*
|
||||||
* FUNCTION: Initializes the IP subsystem
|
* FUNCTION: Initializes the IP subsystem
|
||||||
* ARGUMENTS:
|
* ARGUMENTS:
|
||||||
* DriverObject = Pointer to a driver object for this driver
|
|
||||||
* RegistryPath = Our registry node for configuration parameters
|
* RegistryPath = Our registry node for configuration parameters
|
||||||
* RETURNS:
|
* RETURNS:
|
||||||
* Status of operation
|
* Status of operation
|
||||||
|
|
|
@ -27,7 +27,6 @@ UINT Random(
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
|
|
||||||
static VOID DisplayIPHeader(
|
static VOID DisplayIPHeader(
|
||||||
PCHAR Header,
|
PCHAR Header,
|
||||||
UINT Length)
|
UINT Length)
|
||||||
|
@ -55,59 +54,6 @@ static VOID DisplayIPHeader(
|
||||||
((IPHeader->DstAddr >> 16) & 0xFF), ((IPHeader->DstAddr >> 24) & 0xFF));
|
((IPHeader->DstAddr >> 16) & 0xFF), ((IPHeader->DstAddr >> 24) & 0xFF));
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID DisplayIPPacket(
|
|
||||||
PIP_PACKET IPPacket)
|
|
||||||
{
|
|
||||||
PCHAR p;
|
|
||||||
UINT Length;
|
|
||||||
PNDIS_BUFFER Buffer;
|
|
||||||
PNDIS_BUFFER NextBuffer;
|
|
||||||
PCHAR CharBuffer;
|
|
||||||
|
|
||||||
if ((DebugTraceLevel & (DEBUG_PBUFFER | DEBUG_IP)) != (DEBUG_PBUFFER | DEBUG_IP)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!IPPacket) {
|
|
||||||
TI_DbgPrint(MIN_TRACE, ("Cannot display null packet.\n"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
TI_DbgPrint(MIN_TRACE, ("IPPacket is at (0x%X).\n", IPPacket));
|
|
||||||
TI_DbgPrint(MIN_TRACE, ("Header buffer is at (0x%X).\n", IPPacket->Header));
|
|
||||||
TI_DbgPrint(MIN_TRACE, ("Header size is (%d).\n", IPPacket->HeaderSize));
|
|
||||||
TI_DbgPrint(MIN_TRACE, ("TotalSize (%d).\n", IPPacket->TotalSize));
|
|
||||||
TI_DbgPrint(MIN_TRACE, ("ContigSize (%d).\n", IPPacket->ContigSize));
|
|
||||||
TI_DbgPrint(MIN_TRACE, ("NdisPacket (0x%X).\n", IPPacket->NdisPacket));
|
|
||||||
|
|
||||||
if (IPPacket->NdisPacket) {
|
|
||||||
NdisQueryPacket(IPPacket->NdisPacket, NULL, NULL, &Buffer, NULL);
|
|
||||||
for (; Buffer != NULL; Buffer = NextBuffer) {
|
|
||||||
NdisGetNextBuffer(Buffer, &NextBuffer);
|
|
||||||
NdisQueryBuffer(Buffer, (PVOID)&p, &Length);
|
|
||||||
//OskitDumpBuffer( p, Length );
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
p = IPPacket->Header;
|
|
||||||
Length = IPPacket->ContigSize;
|
|
||||||
//OskitDumpBuffer( p, Length );
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IPPacket->NdisPacket) {
|
|
||||||
NdisQueryPacket(IPPacket->NdisPacket, NULL, NULL, NULL, &Length);
|
|
||||||
Length -= MaxLLHeaderSize;
|
|
||||||
CharBuffer = exAllocatePool(NonPagedPool, Length);
|
|
||||||
Length = CopyPacketToBuffer(CharBuffer, IPPacket->NdisPacket, MaxLLHeaderSize, Length);
|
|
||||||
DisplayIPHeader(CharBuffer, Length);
|
|
||||||
exFreePool(CharBuffer);
|
|
||||||
} else {
|
|
||||||
CharBuffer = IPPacket->Header;
|
|
||||||
Length = IPPacket->ContigSize;
|
|
||||||
DisplayIPHeader(CharBuffer, Length);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static VOID DisplayTCPHeader(
|
static VOID DisplayTCPHeader(
|
||||||
PCHAR Header,
|
PCHAR Header,
|
||||||
UINT Length)
|
UINT Length)
|
||||||
|
@ -179,5 +125,59 @@ VOID DisplayTCPPacket(
|
||||||
DisplayTCPHeader(Buffer, Length);
|
DisplayTCPHeader(Buffer, Length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
VOID DisplayIPPacket(
|
||||||
|
PIP_PACKET IPPacket)
|
||||||
|
{
|
||||||
|
#ifdef DBG
|
||||||
|
PCHAR p;
|
||||||
|
UINT Length;
|
||||||
|
PNDIS_BUFFER Buffer;
|
||||||
|
PNDIS_BUFFER NextBuffer;
|
||||||
|
PCHAR CharBuffer;
|
||||||
|
|
||||||
|
if ((DebugTraceLevel & (DEBUG_PBUFFER | DEBUG_IP)) != (DEBUG_PBUFFER | DEBUG_IP)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!IPPacket) {
|
||||||
|
TI_DbgPrint(MIN_TRACE, ("Cannot display null packet.\n"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
TI_DbgPrint(MIN_TRACE, ("IPPacket is at (0x%X).\n", IPPacket));
|
||||||
|
TI_DbgPrint(MIN_TRACE, ("Header buffer is at (0x%X).\n", IPPacket->Header));
|
||||||
|
TI_DbgPrint(MIN_TRACE, ("Header size is (%d).\n", IPPacket->HeaderSize));
|
||||||
|
TI_DbgPrint(MIN_TRACE, ("TotalSize (%d).\n", IPPacket->TotalSize));
|
||||||
|
TI_DbgPrint(MIN_TRACE, ("ContigSize (%d).\n", IPPacket->ContigSize));
|
||||||
|
TI_DbgPrint(MIN_TRACE, ("NdisPacket (0x%X).\n", IPPacket->NdisPacket));
|
||||||
|
|
||||||
|
if (IPPacket->NdisPacket) {
|
||||||
|
NdisQueryPacket(IPPacket->NdisPacket, NULL, NULL, &Buffer, NULL);
|
||||||
|
for (; Buffer != NULL; Buffer = NextBuffer) {
|
||||||
|
NdisGetNextBuffer(Buffer, &NextBuffer);
|
||||||
|
NdisQueryBuffer(Buffer, (PVOID)&p, &Length);
|
||||||
|
//OskitDumpBuffer( p, Length );
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
p = IPPacket->Header;
|
||||||
|
Length = IPPacket->ContigSize;
|
||||||
|
//OskitDumpBuffer( p, Length );
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IPPacket->NdisPacket) {
|
||||||
|
NdisQueryPacket(IPPacket->NdisPacket, NULL, NULL, NULL, &Length);
|
||||||
|
Length -= MaxLLHeaderSize;
|
||||||
|
CharBuffer = exAllocatePool(NonPagedPool, Length);
|
||||||
|
Length = CopyPacketToBuffer(CharBuffer, IPPacket->NdisPacket, MaxLLHeaderSize, Length);
|
||||||
|
DisplayIPHeader(CharBuffer, Length);
|
||||||
|
exFreePool(CharBuffer);
|
||||||
|
} else {
|
||||||
|
CharBuffer = IPPacket->Header;
|
||||||
|
Length = IPPacket->ContigSize;
|
||||||
|
DisplayIPHeader(CharBuffer, Length);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#endif/* DBG */
|
|
||||||
|
|
Loading…
Reference in a new issue