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?