Commit 287bf3a9 authored by Jamal Hadi Salim's avatar Jamal Hadi Salim Committed by Stephen Hemminger

route classifier support for multiple actions

route can now use the action syntax
Signed-off-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
parent 08139c2f
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
static void explain(void) static void explain(void)
{ {
fprintf(stderr, "Usage: ... route [ from REALM | fromif TAG ] [ to REALM ]\n"); fprintf(stderr, "Usage: ... route [ from REALM | fromif TAG ] [ to REALM ]\n");
fprintf(stderr, " [ flowid CLASSID ] [ police POLICE_SPEC ]\n"); fprintf(stderr, " [ flowid CLASSID ] [ action ACTION_SPEC ]]\n");
fprintf(stderr, " POLICE_SPEC := ... look at TBF\n"); fprintf(stderr, " ACTION_SPEC := ... look at individual actions\n");
fprintf(stderr, " CLASSID := X:Y\n"); fprintf(stderr, " CLASSID := X:Y\n");
fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\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 ...@@ -105,6 +105,13 @@ static int route_parse_opt(struct filter_util *qu, char *handle, int argc, char
return -1; return -1;
} }
continue; 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) { } else if (matches(*argv, "order") == 0) {
NEXT_ARG(); NEXT_ARG();
if (get_u32(&order, *argv, 0)) { if (get_u32(&order, *argv, 0)) {
...@@ -158,6 +165,8 @@ static int route_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt, ...@@ -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]))); fprintf(f, "fromif %s", ll_index_to_name(*(int*)RTA_DATA(tb[TCA_ROUTE4_IIF])));
if (tb[TCA_ROUTE4_POLICE]) if (tb[TCA_ROUTE4_POLICE])
tc_print_police(f, 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; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment