* [iproute2 1/2] tcindex classifier support for multiple actions
@ 2014-10-06 11:30 Jamal Hadi Salim
2014-10-06 11:30 ` [iproute2 2/2] route " Jamal Hadi Salim
0 siblings, 1 reply; 2+ messages in thread
From: Jamal Hadi Salim @ 2014-10-06 11:30 UTC (permalink / raw)
To: stephen; +Cc: netdev, xiyou.wangcong, john.r.fastabend, Jamal Hadi Salim
From: Jamal Hadi Salim <jhs@mojatatu.com>
tcindex can now use the action syntax
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
tc/f_tcindex.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/tc/f_tcindex.c b/tc/f_tcindex.c
index 590c0a6..b1847c8 100644
--- a/tc/f_tcindex.c
+++ b/tc/f_tcindex.c
@@ -21,7 +21,7 @@ static void explain(void)
" [ shift SHIFT ]\n");
fprintf(stderr," [ pass_on | fall_through ]\n");
fprintf(stderr," [ classid CLASSID ] "
- "[ police POLICE_SPEC ]\n");
+ "[ action ACTION_SPEC ]\n");
}
static int tcindex_parse_opt(struct filter_util *qu, char *handle, int argc,
@@ -106,6 +106,14 @@ static int tcindex_parse_opt(struct filter_util *qu, char *handle, int argc,
}
continue;
}
+ else if (!strcmp(*argv,"action")) {
+ NEXT_ARG();
+ if (parse_police(&argc, &argv, TCA_TCINDEX_ACT, n)) {
+ fprintf(stderr, "Illegal \"action\"\n");
+ return -1;
+ }
+ continue;
+ }
else {
explain();
return -1;
@@ -171,6 +179,10 @@ static int tcindex_print_opt(struct filter_util *qu, FILE *f,
fprintf(f, "\n");
tc_print_police(f, tb[TCA_TCINDEX_POLICE]);
}
+ if (tb[TCA_TCINDEX_ACT]) {
+ fprintf(f, "\n");
+ tc_print_police(f, tb[TCA_TCINDEX_ACT]);
+ }
return 0;
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread* [iproute2 2/2] route classifier support for multiple actions
2014-10-06 11:30 [iproute2 1/2] tcindex classifier support for multiple actions Jamal Hadi Salim
@ 2014-10-06 11:30 ` Jamal Hadi Salim
0 siblings, 0 replies; 2+ messages in thread
From: Jamal Hadi Salim @ 2014-10-06 11:30 UTC (permalink / raw)
To: stephen; +Cc: netdev, xiyou.wangcong, john.r.fastabend, Jamal Hadi Salim
From: Jamal Hadi Salim <jhs@mojatatu.com>
route can now use the action syntax
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
tc/f_route.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/tc/f_route.c b/tc/f_route.c
index 649e0ec..23c4ecc 100644
--- a/tc/f_route.c
+++ b/tc/f_route.c
@@ -28,8 +28,8 @@
static void explain(void)
{
fprintf(stderr, "Usage: ... route [ from REALM | fromif TAG ] [ to REALM ]\n");
- fprintf(stderr, " [ flowid CLASSID ] [ police POLICE_SPEC ]\n");
- fprintf(stderr, " POLICE_SPEC := ... look at TBF\n");
+ fprintf(stderr, " [ flowid CLASSID ] [ action ACTION_SPEC ]]\n");
+ fprintf(stderr, " ACTION_SPEC := ... look at individual actions\n");
fprintf(stderr, " CLASSID := X:Y\n");
fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\n");
}
@@ -105,6 +105,13 @@ static int route_parse_opt(struct filter_util *qu, char *handle, int argc, char
return -1;
}
continue;
+ } else if (matches(*argv, "action") == 0) {
+ NEXT_ARG();
+ if (parse_action(&argc, &argv, TCA_ROUTE4_ACT, n)) {
+ fprintf(stderr, "Illegal \"action\"\n");
+ return -1;
+ }
+ continue;
} else if (matches(*argv, "order") == 0) {
NEXT_ARG();
if (get_u32(&order, *argv, 0)) {
@@ -158,6 +165,8 @@ static int route_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt,
fprintf(f, "fromif %s", ll_index_to_name(*(int*)RTA_DATA(tb[TCA_ROUTE4_IIF])));
if (tb[TCA_ROUTE4_POLICE])
tc_print_police(f, tb[TCA_ROUTE4_POLICE]);
+ if (tb[TCA_ROUTE4_ACT])
+ tc_print_action(f, tb[TCA_ROUTE4_ACT]);
return 0;
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-10-06 11:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-06 11:30 [iproute2 1/2] tcindex classifier support for multiple actions Jamal Hadi Salim
2014-10-06 11:30 ` [iproute2 2/2] route " Jamal Hadi Salim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox