MCPcopy Create free account
hub / github.com/F-Stack/f-stack / cmd_pipeline_table_rule_delete

Function cmd_pipeline_table_rule_delete

dpdk/examples/ip_pipeline/cli.c:4561–4623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4559" match <match>\n";
4560
4561static void
4562cmd_pipeline_table_rule_delete(char **tokens,
4563 uint32_t n_tokens,
4564 char *out,
4565 size_t out_size)
4566{
4567 struct table_rule_match m;
4568 char *pipeline_name;
4569 uint32_t table_id, n_tokens_parsed, t0;
4570 int status;
4571
4572 if (n_tokens < 8) {
4573 snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
4574 return;
4575 }
4576
4577 pipeline_name = tokens[1];
4578
4579 if (strcmp(tokens[2], "table") != 0) {
4580 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "table");
4581 return;
4582 }
4583
4584 if (parser_read_uint32(&table_id, tokens[3]) != 0) {
4585 snprintf(out, out_size, MSG_ARG_INVALID, "table_id");
4586 return;
4587 }
4588
4589 if (strcmp(tokens[4], "rule") != 0) {
4590 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "rule");
4591 return;
4592 }
4593
4594 if (strcmp(tokens[5], "delete") != 0) {
4595 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "delete");
4596 return;
4597 }
4598
4599 t0 = 6;
4600
4601 /* match */
4602 n_tokens_parsed = parse_match(tokens + t0,
4603 n_tokens - t0,
4604 out,
4605 out_size,
4606 &m);
4607 if (n_tokens_parsed == 0)
4608 return;
4609 t0 += n_tokens_parsed;
4610
4611 if (n_tokens != t0) {
4612 snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
4613 return;
4614 }
4615
4616 status = pipeline_table_rule_delete(pipeline_name,
4617 table_id,
4618 &m);

Callers 1

cli_processFunction · 0.85

Calls 5

snprintfFunction · 0.85
strcmpFunction · 0.85
parse_matchFunction · 0.85
parser_read_uint32Function · 0.70

Tested by

no test coverage detected