|
|
cd1737 |
From 3d016b2ca5862b3f47da5b28aca43bd96d5c3c49 Mon Sep 17 00:00:00 2001
|
|
|
cd1737 |
From: Phil Sutter <psutter@redhat.com>
|
|
|
cd1737 |
Date: Fri, 11 Aug 2017 11:13:26 +0200
|
|
|
cd1737 |
Subject: [PATCH] tc-simple: Fix documentation
|
|
|
cd1737 |
|
|
|
cd1737 |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1477523
|
|
|
cd1737 |
Upstream Status: iproute2.git commit e2a055dd23f0e
|
|
|
cd1737 |
|
|
|
cd1737 |
commit e2a055dd23f0e7527a987c24687cb6b0b86f0cde
|
|
|
cd1737 |
Author: Phil Sutter <phil@nwl.cc>
|
|
|
cd1737 |
Date: Thu Aug 3 17:00:51 2017 +0200
|
|
|
cd1737 |
|
|
|
cd1737 |
tc-simple: Fix documentation
|
|
|
cd1737 |
|
|
|
cd1737 |
- CONTROL has to come last, otherwise 'index' applies to gact and not
|
|
|
cd1737 |
simple itself.
|
|
|
cd1737 |
- Man page wasn't updated to reflect syntax changes.
|
|
|
cd1737 |
|
|
|
cd1737 |
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
|
cd1737 |
---
|
|
|
cd1737 |
man/man8/tc-simple.8 | 29 ++++++++++++++++++++++++++---
|
|
|
cd1737 |
tc/m_simple.c | 4 ++--
|
|
|
cd1737 |
2 files changed, 28 insertions(+), 5 deletions(-)
|
|
|
cd1737 |
|
|
|
cd1737 |
diff --git a/man/man8/tc-simple.8 b/man/man8/tc-simple.8
|
|
|
d30c09 |
index 2206dc3b88614..7363ab563e189 100644
|
|
|
cd1737 |
--- a/man/man8/tc-simple.8
|
|
|
cd1737 |
+++ b/man/man8/tc-simple.8
|
|
|
cd1737 |
@@ -6,15 +6,37 @@ simple - basic example action
|
|
|
cd1737 |
.in +8
|
|
|
cd1737 |
.ti -8
|
|
|
cd1737 |
.BR tc " ... " "action simple"
|
|
|
cd1737 |
-.I STRING
|
|
|
cd1737 |
+[
|
|
|
cd1737 |
+.BI sdata " STRING"
|
|
|
cd1737 |
+] [
|
|
|
cd1737 |
+.BI index " INDEX"
|
|
|
cd1737 |
+] [
|
|
|
cd1737 |
+.I CONTROL
|
|
|
cd1737 |
+]
|
|
|
cd1737 |
+
|
|
|
cd1737 |
+.ti -8
|
|
|
cd1737 |
+.IR CONTROL " := {"
|
|
|
cd1737 |
+.BR reclassify " | " pipe " | " drop " | " continue " | " ok " }"
|
|
|
cd1737 |
+
|
|
|
cd1737 |
.SH DESCRIPTION
|
|
|
cd1737 |
This is a pedagogical example rather than an actually useful action. Upon every access, it prints the given
|
|
|
cd1737 |
.I STRING
|
|
|
cd1737 |
which may be of arbitrary length.
|
|
|
cd1737 |
.SH OPTIONS
|
|
|
cd1737 |
.TP
|
|
|
cd1737 |
-.I STRING
|
|
|
cd1737 |
+.BI sdata " STRING"
|
|
|
cd1737 |
The actual string to print.
|
|
|
cd1737 |
+.TP
|
|
|
cd1737 |
+.BI index " INDEX"
|
|
|
cd1737 |
+Optional action index value.
|
|
|
cd1737 |
+.TP
|
|
|
cd1737 |
+.I CONTROL
|
|
|
cd1737 |
+Indicate how
|
|
|
cd1737 |
+.B tc
|
|
|
cd1737 |
+should proceed after executing the action. For a description of the possible
|
|
|
cd1737 |
+.I CONTROL
|
|
|
cd1737 |
+values, see
|
|
|
cd1737 |
+.BR tc-actions (8).
|
|
|
cd1737 |
.SH EXAMPLES
|
|
|
cd1737 |
The following example makes the kernel yell "Incoming ICMP!" every time it sees
|
|
|
cd1737 |
an incoming ICMP on eth0. Steps are:
|
|
|
cd1737 |
@@ -36,7 +58,7 @@ display stats again and observe increment by 1
|
|
|
cd1737 |
.EX
|
|
|
cd1737 |
hadi@noma1:$ tc qdisc add dev eth0 ingress
|
|
|
cd1737 |
hadi@noma1:$tc filter add dev eth0 parent ffff: protocol ip prio 5 \\
|
|
|
cd1737 |
- u32 match ip protocol 1 0xff flowid 1:1 action simple "Incoming ICMP"
|
|
|
cd1737 |
+ u32 match ip protocol 1 0xff flowid 1:1 action simple sdata "Incoming ICMP"
|
|
|
cd1737 |
|
|
|
cd1737 |
hadi@noma1:$ sudo tc -s filter ls dev eth0 parent ffff:
|
|
|
cd1737 |
filter protocol ip pref 5 u32
|
|
|
cd1737 |
@@ -74,3 +96,4 @@ display stats again and observe increment by 1
|
|
|
cd1737 |
.EE
|
|
|
cd1737 |
.SH SEE ALSO
|
|
|
cd1737 |
.BR tc (8)
|
|
|
cd1737 |
+.BR tc-actions (8)
|
|
|
cd1737 |
diff --git a/tc/m_simple.c b/tc/m_simple.c
|
|
|
d30c09 |
index 3a8bd916d3bfb..ab633849f7b45 100644
|
|
|
cd1737 |
--- a/tc/m_simple.c
|
|
|
cd1737 |
+++ b/tc/m_simple.c
|
|
|
cd1737 |
@@ -81,10 +81,10 @@
|
|
|
cd1737 |
#endif
|
|
|
cd1737 |
static void explain(void)
|
|
|
cd1737 |
{
|
|
|
cd1737 |
- fprintf(stderr, "Usage:... simple [sdata STRING] [CONTROL] [index INDEX]\n");
|
|
|
cd1737 |
+ fprintf(stderr, "Usage:... simple [sdata STRING] [index INDEX] [CONTROL]\n");
|
|
|
cd1737 |
fprintf(stderr, "\tSTRING being an arbitrary string\n"
|
|
|
cd1737 |
- "\tCONTROL := reclassify|pipe|drop|continue|ok\n"
|
|
|
cd1737 |
"\tINDEX := optional index value used\n");
|
|
|
cd1737 |
+ "\tCONTROL := reclassify|pipe|drop|continue|ok\n"
|
|
|
cd1737 |
}
|
|
|
cd1737 |
|
|
|
cd1737 |
static void usage(void)
|
|
|
cd1737 |
--
|
|
|
d30c09 |
2.21.0
|
|
|
cd1737 |
|