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

Function cmd_pipeline_port_in_enable

dpdk/examples/ip_pipeline/cli.c:2303–2345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2301"pipeline <pipeline_name> port in <port_id> enable\n";
2302
2303static void
2304cmd_pipeline_port_in_enable(char **tokens,
2305 uint32_t n_tokens,
2306 char *out,
2307 size_t out_size)
2308{
2309 char *pipeline_name;
2310 uint32_t port_id;
2311 int status;
2312
2313 if (n_tokens != 6) {
2314 snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
2315 return;
2316 }
2317
2318 pipeline_name = tokens[1];
2319
2320 if (strcmp(tokens[2], "port") != 0) {
2321 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "port");
2322 return;
2323 }
2324
2325 if (strcmp(tokens[3], "in") != 0) {
2326 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "in");
2327 return;
2328 }
2329
2330 if (parser_read_uint32(&port_id, tokens[4]) != 0) {
2331 snprintf(out, out_size, MSG_ARG_INVALID, "port_id");
2332 return;
2333 }
2334
2335 if (strcmp(tokens[5], "enable") != 0) {
2336 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "enable");
2337 return;
2338 }
2339
2340 status = pipeline_port_in_enable(pipeline_name, port_id);
2341 if (status) {
2342 snprintf(out, out_size, MSG_CMD_FAIL, tokens[0]);
2343 return;
2344 }
2345}
2346
2347
2348static const char cmd_pipeline_port_in_disable_help[] =

Callers 1

cli_processFunction · 0.85

Calls 4

snprintfFunction · 0.85
strcmpFunction · 0.85
pipeline_port_in_enableFunction · 0.85
parser_read_uint32Function · 0.70

Tested by

no test coverage detected