Netdev List
 help / color / mirror / Atom feed
From: Jamal Hadi Salim <jhs@mojatatu.com>
To: stephen@networkplumber.org
Cc: netdev@vger.kernel.org, xiyou.wangcong@gmail.com,
	john.r.fastabend@intel.com, Jamal Hadi Salim <jhs@mojatatu.com>
Subject: [iproute2 1/2] tcindex classifier support for multiple actions
Date: Mon,  6 Oct 2014 07:30:16 -0400	[thread overview]
Message-ID: <1412595017-6346-1-git-send-email-jhs@emojatatu.com> (raw)

From: Jamal Hadi Salim <jhs@mojatatu.com>

tcindex can now use the action syntax

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
 tc/f_tcindex.c |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/tc/f_tcindex.c b/tc/f_tcindex.c
index 590c0a6..b1847c8 100644
--- a/tc/f_tcindex.c
+++ b/tc/f_tcindex.c
@@ -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;
 }
 
-- 
1.7.9.5

             reply	other threads:[~2014-10-06 11:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-06 11:30 Jamal Hadi Salim [this message]
2014-10-06 11:30 ` [iproute2 2/2] route classifier support for multiple actions Jamal Hadi Salim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1412595017-6346-1-git-send-email-jhs@emojatatu.com \
    --to=jhs@mojatatu.com \
    --cc=john.r.fastabend@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox