Igalia / pflua

Packet filtering in Lua
Other
313 stars 39 forks source link

Implement 'vlanid' operator #246

Open dpino opened 8 years ago

dpino commented 8 years ago

This PR implements a simple operator which can match a VLAN tag. Pflan 'vlan' handles VLAN hierarchies incrementing filter offsets by 4 on each use [1]

The proposed 'vlanid' operator does a simple matching of a 802.1q packet by VLAN_ID.

| dst.mac | src.mac | 0x8100 | PCP/DEI/VLAN_ID |

Where VLAN_ID = 12-bit number [0-4095].

[1] http://biot.com/capstats/bpf.html