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

Function cli_process

dpdk/examples/ip_pipeline/cli.c:6266–6586  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6264}
6265
6266void
6267cli_process(char *in, char *out, size_t out_size)
6268{
6269 char *tokens[CMD_MAX_TOKENS];
6270 uint32_t n_tokens = RTE_DIM(tokens);
6271 int status;
6272
6273 if (is_comment(in))
6274 return;
6275
6276 status = parse_tokenize_string(in, tokens, &n_tokens);
6277 if (status) {
6278 snprintf(out, out_size, MSG_ARG_TOO_MANY, "");
6279 return;
6280 }
6281
6282 if (n_tokens == 0)
6283 return;
6284
6285 if (strcmp(tokens[0], "help") == 0) {
6286 cmd_help(tokens, n_tokens, out, out_size);
6287 return;
6288 }
6289
6290 if (strcmp(tokens[0], "mempool") == 0) {
6291 cmd_mempool(tokens, n_tokens, out, out_size);
6292 return;
6293 }
6294
6295 if (strcmp(tokens[0], "link") == 0) {
6296 if (strcmp(tokens[1], "show") == 0) {
6297 cmd_link_show(tokens, n_tokens, out, out_size);
6298 return;
6299 }
6300
6301 cmd_link(tokens, n_tokens, out, out_size);
6302 return;
6303 }
6304
6305 if (strcmp(tokens[0], "swq") == 0) {
6306 cmd_swq(tokens, n_tokens, out, out_size);
6307 return;
6308 }
6309
6310 if (strcmp(tokens[0], "tmgr") == 0) {
6311 if ((n_tokens >= 3) &&
6312 (strcmp(tokens[1], "subport") == 0) &&
6313 (strcmp(tokens[2], "profile") == 0)) {
6314 cmd_tmgr_subport_profile(tokens, n_tokens,
6315 out, out_size);
6316 return;
6317 }
6318
6319 if ((n_tokens >= 3) &&
6320 (strcmp(tokens[1], "pipe") == 0) &&
6321 (strcmp(tokens[2], "profile") == 0)) {
6322 cmd_tmgr_pipe_profile(tokens, n_tokens, out, out_size);
6323 return;

Callers 1

cli_script_processFunction · 0.70

Calls 15

snprintfFunction · 0.85
strcmpFunction · 0.85
cmd_link_showFunction · 0.85
cmd_linkFunction · 0.85
cmd_tmgr_subport_profileFunction · 0.85
cmd_tmgr_pipe_profileFunction · 0.85
cmd_tmgr_subportFunction · 0.85
cmd_tmgr_subport_pipeFunction · 0.85
cmd_tmgrFunction · 0.85
cmd_tapFunction · 0.85
cmd_table_action_profileFunction · 0.85

Tested by

no test coverage detected