NET_BUFFER structure (ndis/nbl.h)
The NET_BUFFER structure specifies data that is transmitted or received over the network.
Syntax
typedef struct _NET_BUFFER {
union {
struct {
NET_BUFFER *Next;
MDL *CurrentMdl;
ULONG CurrentMdlOffset;
union {
ULONG DataLength;
SIZE_T stDataLength;
};
MDL *MdlChain;
ULONG DataOffset;
};
SLIST_HEADER Link;
NET_BUFFER_HEADER NetBufferHeader;
};
USHORT ChecksumBias;
USHORT Reserved;
NDIS_HANDLE NdisPoolHandle;
PVOID NdisReserved[2];
PVOID ProtocolReserved[6];
PVOID MiniportReserved[4];
PHYSICAL_ADDRESS DataPhysicalAddress;
union {
NET_BUFFER_SHARED_MEMORY *SharedMemoryInfo;
SCATTER_GATHER_LIST *ScatterGatherList;
};
} NET_BUFFER, *PNET_BUFFER;
Members
Next
A pointer to the next NET_BUFFER structure in a linked list of NET_BUFFER structures. If this structure is the last NET_BUFFER structure in the list, this member is NULL.
CurrentMdl
A pointer to the first MDL that the current driver is using. This member provides an optimization that improves performance by skipping over any MDLs that the current driver is not using.
CurrentMdlOffset
The offset, in bytes, to the beginning of the used data space in the MDL that is specified by the CurrentMdl member.
DataLength
The length, in bytes, of the used data space in the MDL chain. The maximum length is 0xFFFFFFFF bytes.
stDataLength
The length, in bytes, of the used data space in the MDL chain. The maximum length is 0xFFFFFFFF bytes. This member is the same as DataLength, but its type is SIZE_T instead of ULONG.
MdlChain
A pointer to a linked list of MDLs that map a data buffer. The data buffer stores the network data.
DataOffset
The offset, in bytes, from the beginning of the MDL chain to the beginning of the network data in the MDL chain. This offset is also the size, in bytes, of the unused data space.
Link
Reserved for NDIS.
NetBufferHeader
A NET_BUFFER_HEADER structure. This is a duplicate of the above union, for compatibility reasons.
ChecksumBias
The number of bytes to skip over from the beginning of the data buffer when computing a checksum. This member is used by the TCP/IP protocol.
Reserved
Reserved for future use.
NdisPoolHandle
A pool handle that identifies the NET_BUFFER pool from which the NET_BUFFER structure was allocated.
NdisReserved[2]
Reserved for NDIS.
ProtocolReserved[6]
Reserved for use by protocol drivers. Protocol drivers and NDIS intermediate drivers can use this area for their own purposes. Intermediate drivers can use this member only if it is not already in use.
MiniportReserved[4]
Reserved for use by miniport drivers. Miniport drivers and NDIS intermediate drivers can use this area for their own purposes.
DataPhysicalAddress
SharedMemoryInfo
A pointer to an NET_BUFFER_SHARED_MEMORY structure.
ScatterGatherList
The SCATTER_GATHER_LIST structure describes a scatter/gather list for DMA.
Remarks
NDIS drivers can call the following functions to allocate and initialize a NET_BUFFER structure:
NDIS drivers can call the NdisAllocateNetBufferListPool function and then set the fAllocateNetBuffer member of the NET_BUFFER_LIST_POOL_PARAMETERS structure to TRUE when allocating a NET_BUFFER_LIST structure pool. In this case, a NET_BUFFER structure is preallocated with each NET_BUFFER_LIST structure that the driver allocates from the pool.Chained to each NET_BUFFER structure are one or more buffer descriptors that map buffers that contain network packet data. These buffer descriptors are specified as an MDL chain in the NetBufferHeader member. Such network packet data either was received or will be transmitted.
To access additional data space in the MDL chain, NDIS drivers can call the following functions:
NDIS drivers typically use the MiniportReserved or ProtocolReserved members of the NET_BUFFER structure to maintain NET_BUFFER structure context information.For more information on how to use net buffers, see NET_BUFFER Architecture.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Supported in NDIS 6.0 and later. |
Header | ndis/nbl.h (include ndis.h) |
See also
NET_BUFFER_LIST_POOL_PARAMETERS
NdisAllocateNetBufferAndNetBufferList NdisAllocateNetBufferListPool NdisMSendNetBufferListsComplete NdisRetreatNetBufferDataStart NdisRetreatNetBufferListDataStart