Skip to main content
Open topic with navigation CAPL Functions » Ethernet » Function Overview » ethernetPacket::RemoveVlan

ethernetPacket::RemoveVlan

Valid for: CANoe DE • CANoe4SW DE

Method Syntax

  • long ethernetPacket.RemoveVlan(); // form 1
  • long ethernetPacket.RemoveVlan(dword vlanIndex); // form 2

Description

Removes a VLAN tag from an Ethernet packet. To remove a specific VLAN tag from a double-tagged packet form 2 can be used.

Parameters

  • vlanIndex: Index of the VLAN tag for double-tagged VLANs. Index 0 is the inner VLAN, index 1 the outer VLAN. Range 0..2

Example

on ethernetPacket *
{
  if ((this.hasVlan()) && (this.msgChannel == 1))
  {
    ethernetPacket forwardPkt;

    forwardPkt = this;
    forwardPkt.msgChannel = 2;
    forwardPkt.RemoveVlan();

    output(forwardPkt);
  }
}
See Also