The following figure shows the fields in a NET_BUFFER structure.
The NET_BUFFER structure includes a NET_BUFFER_HEADER structure in the NetBufferHeader member. The NET_BUFFER_HEADER structure includes a NET_BUFFER_DATA structure in the NetBufferData member. You should use NDIS macros to access NET_BUFFER structure members. For a complete list of these macros, see the NET_BUFFER structure reference page.
Some of the NET_BUFFER structure members are only used by NDIS. The members that drivers typically use are:
Specifies a pointer to the first MDL that the current driver is using. This pointer provides an optimization that improves performance by skipping over any MDLs that the current driver is not using.
The following figure shows the relationship between the CurrentMdl, CurrentMdlOffset, DataOffset, and DataLength members and the data space.
NDIS provides functions to manage the data space in the MDL chain. How drivers use the data space changes dynamically with the current driver. Sometimes there is data space that is currently unused by the current driver. Although the unused data space is currently unused, it can contain valid data. For example, on the receive path, the unused data space can contain header information that was used by a lower level driver.
Drivers perform retreat and advance operations to increase and decrease the used data space. For more information about retreat and advance operations, see Retreat and Advance Operations.
The following terms and definitions describe elements of the NET_BUFFER data space:
Used data space
Used data space contains data that the current driver is using at the current time. Drivers increase used data space with retreat operations and reduce used data space with advance operations.