0

My application uses npcap/winpcap interface to send packets on a network interface.

The application layer wants to apply priorities but no VLAN id, so it prepares the VLAN header with priority but VLAN id 0.

If I send to a VLAN tagging interface, the packets don't get the correct VLAN id but still have 0. I verify this by looking at the receiver side using tcpdump/wireshark.

I want to patch in the correct VLAN id, so I need to know it. For the application VLAN selection shall be implicit through interface selection (via the IP address or MAC address).

In Powershell Get-NetAdapter or Get-NetAdapterAdvancedProperties have a VlanID and I know I can access this information using COM to access the WMI database.

But is there a simpler way like an ioctl request or something similar to GetAdaptersInfo that returns the VLAN ID?

  • 1
    Here is a [thread](https://social.technet.microsoft.com/Forums/windowsserver/en-US/fd2f7fc3-a054-4f2d-8820-d98dbda1ed4f/how-to-get-the-vlan-id-of-a-network-adapter-using-win32-classes) for your reference. – Junjie Zhu - MSFT Jan 20 '23 at 10:16

0 Answers0