I need to make a tool that modifies the VLanTaggedFrame.VLanIdentifier in a packet. The problem is, my packets may have multiple vlan tags.
realistically it’s between 1~3 tags but I want to make a recursive procedure and not make a chain of if statements.
I need some way to extract every VLanTaggedFrame layer (into a list or array) without knowing how many there are (as long as x.EtherType == EthernetType.VLanTaggedFrame , but where x is constantly changing stack of layers).
Any idea how I can do this?
My main direction was taking the packet.ethernet.vlantaggedframe.payload, but it’s of Datagram type and there seem to be no ‘<em>payload’ in datagram type object, so I can’t do x = x.payload recursively.
any help will be appreciated :)