]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tcindex classifier support for multiple actions
authorJamal Hadi Salim <jhs@mojatatu.com>
Mon, 6 Oct 2014 11:30:16 +0000 (07:30 -0400)
committerStephen Hemminger <shemming@brocade.com>
Thu, 9 Oct 2014 15:26:56 +0000 (08:26 -0700)
tcindex can now use the action syntax

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
tc/f_tcindex.c

index 590c0a6fc14bcc8d18a2ae0acb9728607584c911..b1847c899f35e2950c95ed7087328f1a2b9b7455 100644 (file)
@@ -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;
 }