ethernetPacket::SetVlan
Valid for: CANoe DEMethod Syntax
long ethernetPacket.SetVlan(word tpid, word tci); // form 1long ethernetPacket.SetVlan(dword vlanIndex, word tpid, word tci); // form 2
Description
Sets the VLAN tag of an Ethernet packet. If the packets do not contain a VLAN tag, a new VLAN tag is added. For double-tagged VLAN, form 2 can be used.Parameters
- tpid: VLAN TPDI value to set.
- tci: VLAN TCI value to set.
- vlanIndex: Index of the VLAN tag for double-tagged VLANs. Index 0 is the inner VLAN, index 1 the outer VLAN. Range: 0..2
Return Values
- 0: Success
- 1: Failed to add VLAN tag