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

How to use match

ccie5000 edited this page Aug 4, 2013 · 19 revisions

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

Built-in fields are:

FIELD TYPE EXAMPLE
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
Examples: match(srcip=IP("1.1.1.2")) match(srcmac=MAC("00:00:00:00:00:01")) match(switch=4)
Clone this wiki locally