mirror of
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git
synced 2024-11-16 14:35:34 +08:00
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:
parent
4cb8d03078
commit
08139c2ffb
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user