summaryrefslogtreecommitdiff
path: root/examples/ip_pipeline/cli.c
diff options
context:
space:
mode:
authorJasvinder Singh <jasvinder.singh@intel.com>2018-03-29 19:31:45 +0100
committerCristian Dumitrescu <cristian.dumitrescu@intel.com>2018-04-05 18:23:51 +0200
commit2f74ae28e23f441c6f51241b4f3ea1c9b8b15812 (patch)
tree939142646e11b4b695a20e38ead7bdf9c3d25062 /examples/ip_pipeline/cli.c
parent25961ff3bcb9ae8d7a46305a1565a33438333b7a (diff)
downloaddpdk-2f74ae28e23f441c6f51241b4f3ea1c9b8b15812.zip
dpdk-2f74ae28e23f441c6f51241b4f3ea1c9b8b15812.tar.gz
dpdk-2f74ae28e23f441c6f51241b4f3ea1c9b8b15812.tar.xz
examples/ip_pipeline: add tap object
Add tap object implementation to the application Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com> Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com> Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Diffstat (limited to 'examples/ip_pipeline/cli.c')
-rw-r--r--examples/ip_pipeline/cli.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c
index 72ecbad..430b49d 100644
--- a/examples/ip_pipeline/cli.c
+++ b/examples/ip_pipeline/cli.c
@@ -14,6 +14,7 @@
#include "mempool.h"
#include "parser.h"
#include "swq.h"
+#include "tap.h"
#include "tmgr.h"
#ifndef CMD_MAX_TOKENS
@@ -603,6 +604,32 @@ cmd_tmgr_subport_pipe(char **tokens,
}
}
+/**
+ * tap <tap_name>
+ */
+static void
+cmd_tap(char **tokens,
+ uint32_t n_tokens,
+ char *out,
+ size_t out_size)
+{
+ char *name;
+ struct tap *tap;
+
+ if (n_tokens != 2) {
+ snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
+ return;
+ }
+
+ name = tokens[1];
+
+ tap = tap_create(name);
+ if (tap == NULL) {
+ snprintf(out, out_size, MSG_CMD_FAIL, tokens[0]);
+ return;
+ }
+}
+
void
cli_process(char *in, char *out, size_t out_size)
{
@@ -671,6 +698,11 @@ cli_process(char *in, char *out, size_t out_size)
return;
}
+ if (strcmp(tokens[0], "tap") == 0) {
+ cmd_tap(tokens, n_tokens, out, out_size);
+ return;
+ }
+
snprintf(out, out_size, MSG_CMD_UNKNOWN, tokens[0]);
}