use of org.openkilda.floodlight.shared.packet.VlanTag in project open-kilda by telstra.
the class EthernetPacketToolbox method extractPayload.
/**
* Read through intermediate vlan headers up to actual packet payload. Return both payload and vlan stack.
*/
public static IPacket extractPayload(Ethernet packet, List<Integer> vlanStack) {
short rootVlan = packet.getVlanID();
if (0 < rootVlan) {
vlanStack.add((int) rootVlan);
}
IPacket payload = packet.getPayload();
while (payload instanceof VlanTag) {
short vlanId = ((VlanTag) payload).getVlanId();
vlanStack.add((int) vlanId);
payload = payload.getPayload();
}
return payload;
}