Commit 08139c2f authored by Jamal Hadi Salim's avatar Jamal Hadi Salim Committed by Stephen Hemminger

tcindex classifier support for multiple actions

tcindex can now use the action syntax
Signed-off-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
parent 4cb8d030
...@@ -21,7 +21,7 @@ static void explain(void) ...@@ -21,7 +21,7 @@ static void explain(void)
" [ shift SHIFT ]\n"); " [ shift SHIFT ]\n");
fprintf(stderr," [ pass_on | fall_through ]\n"); fprintf(stderr," [ pass_on | fall_through ]\n");
fprintf(stderr," [ classid CLASSID ] " 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, 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, ...@@ -106,6 +106,14 @@ static int tcindex_parse_opt(struct filter_util *qu, char *handle, int argc,
} }
continue; 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 { else {
explain(); explain();
return -1; return -1;
...@@ -171,6 +179,10 @@ static int tcindex_print_opt(struct filter_util *qu, FILE *f, ...@@ -171,6 +179,10 @@ static int tcindex_print_opt(struct filter_util *qu, FILE *f,
fprintf(f, "\n"); fprintf(f, "\n");
tc_print_police(f, tb[TCA_TCINDEX_POLICE]); 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; 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