tc: actions: add helpers to parse and print control actions
Each tc action is terminated by a control action. Each action parses and
prints then intividually. Introduce set of helpers and allow to share
this code.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
diff --git a/tc/m_sample.c b/tc/m_sample.c
index 9291109..ff5ee6b 100644
--- a/tc/m_sample.c
+++ b/tc/m_sample.c
@@ -98,9 +98,7 @@
NEXT_ARG_FWD();
}
- p.action = TC_ACT_PIPE;
- if (argc && !action_a2n(*argv, &p.action, false))
- NEXT_ARG_FWD();
+ parse_action_control_dflt(&argc, &argv, &p.action, false, TC_ACT_PIPE);
if (argc) {
if (matches(*argv, "index") == 0) {