Commit Graph

75 Commits

Author SHA1 Message Date
Jamal Hadi Salim
9282d08d93 actions: keyword flowid or classid terminates action pipeline
scenario testcase:

TC="sudo ./tc/tc"
DEV="dev eth0"
$TC qdisc del $DEV ingress
$TC qdisc add $DEV ingress
$TC filter add $DEV parent ffff: protocol ip u32 match ip src 10.0.0.0/24 action police rate 6Mbit burst 6Mbit drop flowid :1
$TC filter add $DEV parent ffff: protocol ip u32 match ip dst 10.0.0.0/24 action police rate 1Gbit burst 1Gbit pass flowid :1
$TC -s filter ls $DEV parent ffff: protocol ip
$TC qdisc del $DEV ingress
$TC qdisc add $DEV ingress
$TC filter add $DEV parent ffff: protocol ip u32 match ip src 10.0.0.0/24 flowid 1:1 action police rate 6Mbit burst 6Mbit drop
$TC filter add $DEV parent ffff: protocol ip u32 match ip dst 10.0.0.0/24 flowid 1:2 action police rate 1Gbit burst 1Gbit pass

$TC -s filter ls $DEV parent ffff: protocol ip
$TC qdisc del $DEV ingress
$TC qdisc add $DEV ingress
$TC filter add $DEV parent ffff: protocol ip pref 10 \
u32 match ip protocol 1 0xff \
flowid 1:10 \
action skbedit mark 11 \
action police rate 10kbit burst 10k pipe index 1 \
action skbedit mark 12 \
action police rate 20kbit burst 20k pipe index 2 \
action mirred egress mirror dev dummy0

$TC -s filter ls $DEV parent ffff: protocol ip
$TC qdisc del $DEV ingress
$TC qdisc add $DEV ingress
$TC filter add $DEV parent ffff: protocol ip pref 10 \
u32 match ip protocol 1 0xff \
action skbedit mark 11 \
action police rate 10kbit burst 10k pipe index 1 \
action skbedit mark 12 \
action police rate 20kbit burst 20k pipe index 2 \
action mirred egress mirror dev dummy0 \
flowid 1:10

$TC -s filter ls $DEV parent ffff: protocol ip

Reported-by: Seann Herdejurgen <seann@herdejurgen.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
2014-05-28 16:54:28 -07:00
Jamal Hadi Salim
f24a7e7205 dont skip action order
attached.

cheers,
jamal
commit 58d78f9f6447df324cdeb99262442c5e3f1f924b
Author: Jamal Hadi Salim <jhs@mojatatu.com>
Date:   Sun Dec 22 10:34:18 2013 -0500

    dont skip displaying of action chains or lists by TCA_ACT_MAX_PRIO

    Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
2013-12-28 10:57:34 -08:00
Jamal Hadi Salim
b159a7f1ae allow batch gets of actions
Attached.

cheers,
jamal
commit c5f30cabef14c951596210b96bc9b423b0d39592
Author: Jamal Hadi Salim <hadi@mojatatu.com>
Date:   Sun Dec 22 10:24:17 2013 -0500

    Allow batching of action gets
    Example:
    ----
    tc actions get \
    action gact index 100 \
    action gact index 4
    ----

    Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
2013-12-28 10:57:34 -08:00
Stephen Hemminger
d1f28cf181 ip: make local functions static 2013-02-12 11:38:35 -08:00
Stephen Hemminger
cd70f3f522 libnetlink: remove unused junk callback
Both rtnl_talk and rtnl_dump had a callback for handling portions
of netlink message that do not match the correct pid or seq.
But this callback was never used by any part of iproute2 so remove
it.
2011-12-28 10:37:12 -08:00
Andreas Henriksson
02833d1b38 tc: make symbols loaded from tc action modules global.
Fixes problems with xtables based MARK target ("ipt" module).
When tc loads the "ipt" (xt) module it kept the symbols local,
this made loading of libxtables not find the required struct.

currently ipt/xt is the only tc action module.
iproute2 never seem to do dlclose.
hopefully the modules doesn't export more symbols then needed.

In this situation hopefully the RTLD_GLOBAL flag won't hurt us.

I've been using this patch in the Debian package of iproute for
the last 3 weeks and noone has complained.
( This fixes http://bugs.debian.org/584898 )

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2010-08-02 09:54:59 -07:00
Andreas Henriksson
ab814d6355 iproute2: add option to build m_xt as a tc module (v3)
This will build the xt module (action ipt) of tc as a
shared object that is linked at runtime by tc if used,
rather then built into tc.

This is similar to how the atm qdisc support
is handled (q_atm.so).

Signed-off-by: Andreas Henriksson <andreas@xxxxxxxx>
2010-04-12 11:40:29 -07:00
Stephen Hemminger
ae665a522b Remove trailing whitespace
Go through source files and remove all trailing whitespace

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-12-05 10:10:22 -08:00
Stephen Hemminger
302d3fb720 More TC patches from Jamal.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-09-25 17:08:40 -07:00
Jamal Hadi Salim
ebf32083e0 First part of cleaning up the help output of actions.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-08-08 12:10:08 -07:00
Jamal Hadi Salim
5bec34845b This patch adds ability to monitor tc events similar to ipmonitor.
User runs "tc monitor" (without quotes) and watches events of
addition, deletion and updates from qdiscs, classes, filters and
actions as they happen.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-08-08 11:55:15 -07:00
jamal
f1e4f042a5 Add help text for actions. 2006-08-04 10:59:34 -07:00
site!shemminger
c1027a759b Fix batch mode handle usage.
(Logical change 1.169)
2005-03-14 22:19:16 +00:00
osdl.net!shemminger
52f337c1c1 Style fix.
2005/03/04 18:49:53-08:00 net[shemminger]!shemminger
Import patch iproute-batch.1.050209.patch

(Logical change 1.162)
2005-03-14 19:02:41 +00:00
8!tgraf
ac2fc2df5e Use parse_rtattr_nested
(Logical change 1.129)
2005-01-18 22:11:58 +00:00
8!tgraf
4a86fe19bc Use NLMSG_TAIL
(Logical change 1.127)
2005-01-18 01:24:18 +00:00
8!tgraf
cda4026c7f move dl body cache into get_action_kind
(Logical change 1.125)
2005-01-18 00:09:02 +00:00
ch[shemminger]!tgraf
e5879dc603 iproute2: gnet_stats
(Logical change 1.107)
2004-12-07 23:52:52 +00:00
osdl.net!shemminger
50772dc51a Add ip rule flush capabilty and fix all the prototype changes
because of that code rewrites the nlmsghdr.

(Logical change 1.106)
2004-12-07 21:48:29 +00:00
osdl.net!shemminger
bb6a21a4fc Fix build warnings on x86_64
(Logical change 1.92)
2004-10-06 23:17:10 +00:00
net[shemminger]!kaber
95812b56a5 : prevent tc crashes
(Logical change 1.81)
2004-09-28 18:35:49 +00:00
osdl.net!shemminger
3d327bf58b new tc_stats handling, and const args to filter
(Logical change 1.77)
2004-08-31 17:45:21 +00:00
net[shemminger]!shemminger
d81b135b6f Import patch jamal-p1
(Logical change 1.70)
2004-08-23 20:20:41 +00:00
osdl.net!shemminger
68d5ba5429 (Logical change 1.66) 2004-08-13 23:54:55 +00:00
osdl.net!shemminger
6c45560b07 Initial revision 2004-08-13 23:54:55 +00:00