From 2638336b0ecf4e6ad163ce194ceb52ff87beb79f Mon Sep 17 00:00:00 2001 From: Art Yerkes Date: Mon, 4 Oct 2004 18:32:30 +0000 Subject: [PATCH] Fixed IPStartup prototype and moved DisplayIPPacket out of ifdef. svn path=/trunk/; revision=11184 --- reactos/drivers/lib/ip/network/ip.c | 5 +- reactos/drivers/lib/ip/network/routines.c | 110 +++++++++++----------- 2 files changed, 56 insertions(+), 59 deletions(-) diff --git a/reactos/drivers/lib/ip/network/ip.c b/reactos/drivers/lib/ip/network/ip.c index 49267148121..17432291ef3 100644 --- a/reactos/drivers/lib/ip/network/ip.c +++ b/reactos/drivers/lib/ip/network/ip.c @@ -926,13 +926,10 @@ VOID DefaultProtocolHandler( } -NTSTATUS IPStartup( - PDRIVER_OBJECT DriverObject, - PUNICODE_STRING RegistryPath) +NTSTATUS IPStartup(PUNICODE_STRING RegistryPath) /* * FUNCTION: Initializes the IP subsystem * ARGUMENTS: - * DriverObject = Pointer to a driver object for this driver * RegistryPath = Our registry node for configuration parameters * RETURNS: * Status of operation diff --git a/reactos/drivers/lib/ip/network/routines.c b/reactos/drivers/lib/ip/network/routines.c index 79682c0e1e2..1b661226d8a 100644 --- a/reactos/drivers/lib/ip/network/routines.c +++ b/reactos/drivers/lib/ip/network/routines.c @@ -27,7 +27,6 @@ UINT Random( } #ifdef DBG - static VOID DisplayIPHeader( PCHAR Header, UINT Length) @@ -55,59 +54,6 @@ static VOID DisplayIPHeader( ((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( PCHAR Header, UINT Length) @@ -179,5 +125,59 @@ VOID DisplayTCPPacket( 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 */