<!--
{
  "availability" : [
    "driverkit: 24.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NetworkingDriverKit",
  "identifier" : "/documentation/NetworkingDriverKit/IOUserNetworkPacket/getVlanTag",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "NetworkingDriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOUserNetworkPacket@F@getVlanTag#*s#1"
  },
  "title" : "getVlanTag"
}
-->

# getVlanTag

```
bool getVlanTag(uint16_t *vlanTag) const;
```

## Parameters

`vlanTag`

pointer to return vlanTag from the packet.

## Return Value

true if the tag is present, false otherwise.

## Discussion

\abstract Get the Vlan Tag from the packet, where the driver has enabled
the <code>kFeatureHardwareVlan</code> capability, for the case that feature is
not enabled, this method will return false.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)