I'm trying to write a script that will read a pcap file and then split the traffic by vlan, so for example:
1. read ehternet packet
2. if it has a vlan tag remove the vlan tag and copy the packet to another file called vlanX (where X is the vlan id from the packet)
3. if it doesn't have a vlan tag then copy to a file called novlan
Any pointers on how to accomplish this will be appreciated.