Skip to content
This repository has been archived by the owner on Jun 27, 2018. It is now read-only.

How to use match

Joshua Reich edited this page Jul 26, 2013 · 19 revisions

match(f=v): match packets whose field f has value v

builtin fields are:

FIELD TYPE E.G.
switch int 4
inport int 3
outport int 2
srcmac MAC MAC('00:00:00:00:00:01')
dstmac MAC MAC('00:00:00:00:00:03')
srcip IP,string IP('10.0.1.1'), '10.0.0/24'
dstip IP,string IP('10.0.1.2'), '10.0.1/24'
tos int 0
srcport int 80
dstport int 8080
ethtype int 1
protocol int 7
vlan_id int 0
vlan_pcp int 0
e.g., match(srcip=IP("1.1.1.2")) match(srcmac=MAC("00:00:00:00:00:01")) match(switch=4)
Clone this wiki locally