X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest%2Fcommands.c;h=76f6ee5d233a45b0aaf8427ab4159e0a3cf03382;hb=88caad251c8de3a84e353b0b2a27014bc303df87;hp=8d5a03a9548add27b62a06fe2bd6cde358db0a3d;hpb=323643727f4c5653d9a1ddc552d95bae2b2c2e5c;p=dpdk.git diff --git a/app/test/commands.c b/app/test/commands.c index 8d5a03a954..76f6ee5d23 100644 --- a/app/test/commands.c +++ b/app/test/commands.c @@ -10,11 +10,6 @@ #include #include #include -#ifndef __linux__ -#ifndef __FreeBSD__ -#include -#endif -#endif #include #include #include @@ -64,8 +59,8 @@ struct cmd_autotest_result { }; static void cmd_autotest_parsed(void *parsed_result, - __attribute__((unused)) struct cmdline *cl, - __attribute__((unused)) void *data) + __rte_unused struct cmdline *cl, + __rte_unused void *data) { struct test_command *t; struct cmd_autotest_result *res = parsed_result; @@ -117,8 +112,8 @@ dump_struct_sizes(void) } static void cmd_dump_parsed(void *parsed_result, - __attribute__((unused)) struct cmdline *cl, - __attribute__((unused)) void *data) + __rte_unused struct cmdline *cl, + __rte_unused void *data) { struct cmd_dump_result *res = parsed_result; @@ -172,7 +167,7 @@ struct cmd_dump_one_result { }; static void cmd_dump_one_parsed(void *parsed_result, struct cmdline *cl, - __attribute__((unused)) void *data) + __rte_unused void *data) { struct cmd_dump_one_result *res = parsed_result; @@ -221,9 +216,9 @@ struct cmd_quit_result { }; static void -cmd_quit_parsed(__attribute__((unused)) void *parsed_result, +cmd_quit_parsed(__rte_unused void *parsed_result, struct cmdline *cl, - __attribute__((unused)) void *data) + __rte_unused void *data) { cmdline_quit(cl); } @@ -250,7 +245,7 @@ struct cmd_set_rxtx_result { }; static void cmd_set_rxtx_parsed(void *parsed_result, struct cmdline *cl, - __attribute__((unused)) void *data) + __rte_unused void *data) { struct cmd_set_rxtx_result *res = parsed_result; if (test_set_rxtx_conf(res->mode) < 0) @@ -286,7 +281,7 @@ struct cmd_set_rxtx_anchor { static void cmd_set_rxtx_anchor_parsed(void *parsed_result, struct cmdline *cl, - __attribute__((unused)) void *data) + __rte_unused void *data) { struct cmd_set_rxtx_anchor *res = parsed_result; if (test_set_rxtx_anchor(res->type) < 0) @@ -323,7 +318,7 @@ struct cmd_set_rxtx_sc { static void cmd_set_rxtx_sc_parsed(void *parsed_result, struct cmdline *cl, - __attribute__((unused)) void *data) + __rte_unused void *data) { struct cmd_set_rxtx_sc *res = parsed_result; if (test_set_rxtx_sc(res->type) < 0) @@ -386,3 +381,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; +}