Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
iproute2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
iproute2
Commits
c487348a
Commit
c487348a
authored
Aug 09, 2012
by
Florian Westphal
Committed by
Stephen Hemminger
Aug 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ematch man page
parent
8194411a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
153 additions
and
0 deletions
+153
-0
man/man8/tc-ematch.8
man/man8/tc-ematch.8
+152
-0
man/man8/tc.8
man/man8/tc.8
+1
-0
No files found.
man/man8/tc-ematch.8
0 → 100644
View file @
c487348a
.TH filter ematch "6 August 2012" iproute2 Linux
.
.SH NAME
ematch \- extended matches for use with "basic" or "flow" filters
.
.SH SYNOPSIS
.sp
.ad l
.in +8
.ti -8
.B "tc filter add .. basic match"
.RI EXPR
.B .. flowid ..
.sp
.ti -8
.IR EXPR " := " TERM " [ { "
.B and | or
}
.IR EXPR
]
.ti -8
.IR TERM " := [ " not " ] { " MATCH " | '(' " EXPR " ')' } "
.ti -8
.IR MATCH " := " module " '(' " ARGS " ')' "
.ti -8
.IR ARGS " := " ARG1 " " ARG2 " ..
.SH MATCHES
.SS cmp
Simple comparison ematch: arithmetic compare of packet data to a given value.
.ti
.IR cmp "( " ALIGN " at " OFFSET " [ " ATTRS " ] { " eq " | " lt " | " gt " } " VALUE " )
.ti
.IR ALIGN " := { " u8 " | " u16 " | " u32 " } "
.ti
.IR ATTRS " := [ layer " LAYER " ] [ mask " MASK " ] [ " trans " ] "
.ti
.IR ALIGN " := { " u8 " | " u16 " | " u32 } "
.ti
.IR LAYER " := { " link " | " network " | " transport " | " 0..%d " }
.SS meta
Metadata ematch
.ti
.IR meta "( " OBJECT " { " eq " | " lt " |" gt " } " OBJECT " )
.ti
.IR OBJECT " := { " META_ID " | " VALUE " }
.ti
.IR META_ID " := id " [ shift " SHIFT " ] [ mask " MASK " ]
.TP
meta attributes:
\fBrandom\fP 32 bit random value
\fBloadavg_1\fP Load average in last 5 minutes
\fBnf_mark\fP Netfilter mark
\fBvlan\fP Vlan tag
\fBsk_rcvbuf\fP Receive buffer size
\fBsk_snd_queue\fP Send queue length
.PP
A full list of meta attributes can be obtained via
# tc filter add dev eth1 basic match 'meta(list)'
.SS nbyte
match packet data byte sequence
.ti
.IR nbyte "( " NEEDLE " at " OFFSET " [ layer " LAYER " ] )
.ti
.IR NEEDLE " := { " string " | " c-escape-sequence " } "
.ti
.IR OFFSET " := " int
.ti
.IR LAYER " := { " link " | " network " | " transport " | " 0..%d " }
.SS u32
u32 ematch
.ti
.IR u32 "( " ALIGN VALUE MASK " at " [ nexthdr+ ] " OFFSET " )
.ti
.IR ALIGN " := " { " u8 " | " u16 " | " u32 " }
.SS ipset
test packet agains ipset membership
.ti
.IR ipset "( " SETNAME FLAGS )
.ti
.IR SETNAME " := " string
.ti
.IR FLAGS " := " { " FLAG " [, " FLAGS "] }
The flag options are the same as those used by the iptables "set" match.
When using the ipset ematch with the "ip_set_hash:net,iface" set type,
the interface can be queried using "src,dst (source ip address, outgoing interface) or
"src,src" (source ip address, incoming interface) syntax.
.SH CAVEATS
The ematch syntax uses '(' and ')' to group expressions. All braces need to be
escaped properly to prevent shell commandline from interpreting these directly.
When using the ipset ematch with the "ifb" device, the outgoing device will be the
ifb device itself, e.g. "ifb0".
The original interface (i.e. the device the packet arrived on) is treated as the incoming interface.
.SH EXAMPLE & USAGE
# tc filter add .. basic match ...
# 'cmp(u16 at 3 layer 2 mask 0xff00 gt 20)'
# 'meta(nfmark gt 24)' and 'meta(tcindex mask 0xf0 eq 0xf0)'
# 'nbyte("ababa" at 12 layer 1)'
# 'u32(u16 0x1122 0xffff at nexthdr+4)'
Check if packet source ip address is member of set named \fBbulk\fP:
# 'ipset(bulk src)'
Check if packet source ip and the interface the packet arrived on is member of "hash:net,iface" set named \fBinteractive\fP:
# 'ipset(interactive src,src)'
.SH "AUTHOR"
The extended match infrastructure was added by Thomas Graf.
man/man8/tc.8
View file @
c487348a
...
...
@@ -374,6 +374,7 @@ was written by Alexey N. Kuznetsov and added in Linux 2.2.
.BR tc-choke (8),
.BR tc-codel (8),
.BR tc-drr (8),
.BR tc-ematch (8),
.BR tc-fq_codel (8),
.BR tc-hfsc (7),
.BR tc-hfsc (8),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment