1 /*
2  * COPYRIGHT:   See COPYING in the top level directory
3  * PROJECT:     ReactOS TCP/IP protocol driver
4  * FILE:        include/routines.h
5  * PURPOSE:     Common routine prototypes
6  */
7 
8 #pragma once
9 
10 UINT Random(VOID);
11 
12 UINT CopyBufferToBufferChain(
13     PNDIS_BUFFER DstBuffer,
14     UINT DstOffset,
15     PCHAR SrcData,
16     UINT Length);
17 
18 UINT CopyBufferChainToBuffer(
19     PCHAR DstData,
20     PNDIS_BUFFER SrcBuffer,
21     UINT SrcOffset,
22     UINT Length);
23 
24 UINT CopyPacketToBuffer(
25     PCHAR DstData,
26     PNDIS_PACKET SrcPacket,
27     UINT SrcOffset,
28     UINT Length);
29 
30 UINT CopyPacketToBufferChain(
31     PNDIS_BUFFER DstBuffer,
32     UINT DstOffset,
33     PNDIS_PACKET SrcPacket,
34     UINT SrcOffset,
35     UINT Length);
36 
37 VOID FreeNdisPacketX(
38     PNDIS_PACKET Packet,
39     PCHAR File,
40     UINT Line);
41 
42 PVOID AdjustPacket(
43     PNDIS_PACKET Packet,
44     UINT Available,
45     UINT Needed);
46 
47 UINT ResizePacket(
48     PNDIS_PACKET Packet,
49     UINT Size);
50 
51 NDIS_STATUS AllocatePacketWithBuffer( PNDIS_PACKET *NdisPacket,
52 				       PCHAR Data, UINT Len );
53 
54 VOID FreeNdisPacket( PNDIS_PACKET Packet );
55 
56 void GetDataPtr( PNDIS_PACKET Packet,
57 		 UINT Offset,
58 		 PCHAR *DataOut,
59 		 PUINT Size );
60 
61 #if DBG
62 VOID DisplayIPPacket(
63     PIP_PACKET IPPacket);
64 #define DISPLAY_IP_PACKET(x) DisplayIPPacket(x)
65 VOID DisplayTCPPacket(
66     PIP_PACKET IPPacket);
67 #define DISPLAY_TCP_PACKET(x) DisplayTCPPacket(x)
68 #else
69 #define DISPLAY_IP_PACKET(x)
70 #define DISPLAY_TCP_PACKET(x)
71 #endif /* DBG */
72 
73 /* EOF */
74