| 5045 | " file <file_name>\n"; |
| 5046 | |
| 5047 | static void |
| 5048 | cmd_pipeline_table_rule_show(char **tokens, |
| 5049 | uint32_t n_tokens, |
| 5050 | char *out, |
| 5051 | size_t out_size) |
| 5052 | { |
| 5053 | char *file_name = NULL, *pipeline_name; |
| 5054 | uint32_t table_id; |
| 5055 | int status; |
| 5056 | |
| 5057 | if (n_tokens != 8) { |
| 5058 | snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); |
| 5059 | return; |
| 5060 | } |
| 5061 | |
| 5062 | pipeline_name = tokens[1]; |
| 5063 | |
| 5064 | if (strcmp(tokens[2], "table") != 0) { |
| 5065 | snprintf(out, out_size, MSG_ARG_NOT_FOUND, "table"); |
| 5066 | return; |
| 5067 | } |
| 5068 | |
| 5069 | if (parser_read_uint32(&table_id, tokens[3]) != 0) { |
| 5070 | snprintf(out, out_size, MSG_ARG_INVALID, "table_id"); |
| 5071 | return; |
| 5072 | } |
| 5073 | |
| 5074 | if (strcmp(tokens[4], "rule") != 0) { |
| 5075 | snprintf(out, out_size, MSG_ARG_NOT_FOUND, "rule"); |
| 5076 | return; |
| 5077 | } |
| 5078 | |
| 5079 | if (strcmp(tokens[5], "show") != 0) { |
| 5080 | snprintf(out, out_size, MSG_ARG_NOT_FOUND, "show"); |
| 5081 | return; |
| 5082 | } |
| 5083 | |
| 5084 | if (strcmp(tokens[6], "file") != 0) { |
| 5085 | snprintf(out, out_size, MSG_ARG_NOT_FOUND, "file"); |
| 5086 | return; |
| 5087 | } |
| 5088 | |
| 5089 | file_name = tokens[7]; |
| 5090 | |
| 5091 | status = table_rule_show(pipeline_name, table_id, file_name); |
| 5092 | if (status) { |
| 5093 | snprintf(out, out_size, MSG_CMD_FAIL, tokens[0]); |
| 5094 | return; |
| 5095 | } |
| 5096 | } |
| 5097 | |
| 5098 | static const char cmd_pipeline_table_rule_stats_read_help[] = |
| 5099 | "pipeline <pipeline_name> table <table_id> rule read stats [clear]\n" |
no test coverage detected