Hi folks,
I find it is a little tricky to make a NDIS_PACKET by myself. I allocate
memory, write the content, allocate NDIS_BUFFER, NDIS_PACKET and chain the
NDIS_BUFFER into a packet. However, I don't know how to set the parameters
in NDIS_PACKET.
for example, I suppose the struct of _NDIS_PACKET_PRIVATE contains the
information of the packet.
typedef struct _NDIS_PACKET_PRIVATE
{
UINT PhysicalCount; // number of physical pages in packet.
UINT TotalLength; // Total amount of data in the packet.
PNDIS_BUFFER Head; // first buffer in the chain
PNDIS_BUFFER Tail; // last buffer in the chain
// if Head is NULL the chain is empty; Tail doesn't have to be NULL also
PNDIS_PACKET_POOL Pool; // so we know where to free it back to
UINT Count;
ULONG Flags;
BOOLEAN ValidCounts;
UCHAR NdisPacketFlags; // See fPACKET_xxx bits below
USHORT NdisPacketOobOffset;
} NDIS_PACKET_PRIVATE, * PNDIS_PACKET_PRIVATE;
And the functions could configure the parameters of my packet:
NDIS_SET_ORIGINAL_PACKET
NDIS_SET_PACKET_CANCEL_ID
NDIS_SET_PACKET_HEADER_SIZE
NDIS_SET_PACKET_MEDIA_SPECIFIC_INFO
NDIS_SET_PACKET_STATUS
Unfortunately, there is few samples on how the set the parameters from
scratch. Could anyone here kindly give me a hint?
Thanks!
-Liang