1 /* 2 * COPYRIGHT: See COPYING in the top level directory 3 * PROJECT: ReactOS NDIS library 4 * FILE: include/buffer.h 5 * PURPOSE: Buffer management routine definitions 6 */ 7 8 #pragma once 9 10 /* FIXME: Possibly move this to ntddk.h */ 11 typedef struct _NETWORK_HEADER 12 { 13 MDL Mdl; /* Memory Descriptor List */ 14 struct _NETWORK_HEADER *Next; /* Link to next NDIS buffer in pool */ 15 struct _NDIS_BUFFER_POOL *BufferPool; /* Link to NDIS buffer pool */ 16 } NETWORK_HEADER, *PNETWORK_HEADER; 17 18 typedef struct _NDIS_BUFFER_POOL 19 { 20 KSPIN_LOCK SpinLock; 21 PNETWORK_HEADER FreeList; 22 NETWORK_HEADER Buffers[0]; 23 } NDIS_BUFFER_POOL, *PNDIS_BUFFER_POOL; 24 25 typedef struct _NDISI_PACKET_POOL { 26 NDIS_SPIN_LOCK SpinLock; 27 struct _NDIS_PACKET *FreeList; 28 UINT PacketLength; 29 UCHAR Buffer[1]; 30 } NDISI_PACKET_POOL, * PNDISI_PACKET_POOL; 31 32 UINT CopyBufferToBufferChain( 33 PNDIS_BUFFER DstBuffer, 34 UINT DstOffset, 35 PUCHAR SrcData, 36 UINT Length); 37 38 UINT CopyBufferChainToBuffer( 39 PUCHAR DstData, 40 PNDIS_BUFFER SrcBuffer, 41 UINT SrcOffset, 42 UINT Length); 43 44 UINT CopyPacketToBuffer( 45 PUCHAR DstData, 46 PNDIS_PACKET SrcPacket, 47 UINT SrcOffset, 48 UINT Length); 49 50 UINT CopyPacketToBufferChain( 51 PNDIS_BUFFER DstBuffer, 52 UINT DstOffset, 53 PNDIS_PACKET SrcPacket, 54 UINT SrcOffset, 55 UINT Length); 56 57 /* EOF */ 58