Поделиться через


Sending 802.1Q-Marked Packets (NDIS 5.1)

Note   NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.

A miniport driver that supports 802.1Q must insert 802.1Q information into a packet that the driver transmits over the network. The information includes the driver's configured VLAN ID and the VLAN ID in the per-packet information.

Before inserting 802.1Q information into a packet, the miniport driver retrieves per-packet VLAN information by calling the NDIS_PER_PACKET_INFO_FROM_PACKETmacro with the InfoType parameter set to Ieee8021Qinfo.

The following code example shows how a miniport driver:

  • Retrieves the 802.1Q values that are contained in the packet descriptor that the pPacketDesc variable points to.

  • Assigns the priority and VLAN ID values to the UserPriority and VlanID variables, respectively.

NDIS_PACKET_8021Q_INFO VlanPriInfo;
UINT32 UserPriority;
UINT32 VlanID;
VlanPriInfo.Value = 
      NDIS_PER_PACKET_INFO_FROM_PACKET(pPacketDesc, Ieee8021QInfo);
UserPriority = VlanPriInfo.TagHeader.UserPriority;
VlanID = VlanPriInfo.TagHeader.VlanId;

The miniport driver will generate the tag header by using its own heuristics.

 

 

Send comments about this topic to Microsoft