app/testpmd: fix metering and policing command for RFC4115
[dpdk.git] / app / test / commands.c
index d48dd51..887caba 100644 (file)
@@ -8,8 +8,6 @@
 #include <stdint.h>
 #include <string.h>
 #include <stdlib.h>
-#include <netinet/in.h>
-#include <termios.h>
 #include <inttypes.h>
 #include <errno.h>
 #include <sys/queue.h>
@@ -25,7 +23,6 @@
 #include <rte_eal.h>
 #include <rte_per_lcore.h>
 #include <rte_lcore.h>
-#include <rte_atomic.h>
 #include <rte_branch_prediction.h>
 #include <rte_ring.h>
 #include <rte_malloc.h>
@@ -381,3 +378,14 @@ int commands_init(void)
        cmd_autotest_autotest.string_data.str = commands;
        return 0;
 }
+
+int command_valid(const char *cmd)
+{
+       struct test_command *t;
+
+       TAILQ_FOREACH(t, &commands_list, next) {
+               if (strcmp(t->command, cmd) == 0)
+                       return 1;
+       }
+       return 0;
+}