tcindex classifier support for multiple actions

tcindex can now use the action syntax

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
This commit is contained in:
Jamal Hadi Salim 2014-10-06 07:30:16 -04:00 committed by Stephen Hemminger
parent 4cb8d03078
commit 08139c2ffb

View File

@ -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,
} }
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,
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;
} }