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

Function cli_process

dpdk/examples/pipeline/cli.c:3774–4048  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3772}
3773
3774void
3775cli_process(char *in, char *out, size_t out_size, void *obj)
3776{
3777 char *tokens[CMD_MAX_TOKENS];
3778 uint32_t n_tokens = RTE_DIM(tokens);
3779 int status;
3780
3781 if (is_comment(in))
3782 return;
3783
3784 status = parse_tokenize_string(in, tokens, &n_tokens);
3785 if (status) {
3786 snprintf(out, out_size, MSG_ARG_TOO_MANY, "");
3787 return;
3788 }
3789
3790 if (n_tokens == 0)
3791 return;
3792
3793 if (strcmp(tokens[0], "help") == 0) {
3794 cmd_help(tokens, n_tokens, out, out_size, obj);
3795 return;
3796 }
3797
3798 if (strcmp(tokens[0], "mempool") == 0) {
3799 cmd_mempool(tokens, n_tokens, out, out_size, obj);
3800 return;
3801 }
3802
3803 if (strcmp(tokens[0], "ethdev") == 0) {
3804 if ((n_tokens >= 2) && (strcmp(tokens[1], "show") == 0)) {
3805 cmd_ethdev_show(tokens, n_tokens, out, out_size, obj);
3806 return;
3807 }
3808
3809 cmd_ethdev(tokens, n_tokens, out, out_size, obj);
3810 return;
3811 }
3812
3813 if (strcmp(tokens[0], "ring") == 0) {
3814 cmd_ring(tokens, n_tokens, out, out_size, obj);
3815 return;
3816 }
3817
3818 if (!strcmp(tokens[0], "cryptodev")) {
3819 cmd_cryptodev(tokens, n_tokens, out, out_size, obj);
3820 return;
3821 }
3822
3823 if (strcmp(tokens[0], "pipeline") == 0) {
3824 if ((n_tokens >= 3) &&
3825 (strcmp(tokens[1], "codegen") == 0)) {
3826 cmd_pipeline_codegen(tokens, n_tokens, out, out_size,
3827 obj);
3828 return;
3829 }
3830
3831 if ((n_tokens >= 3) &&

Callers 1

cli_script_processFunction · 0.70

Calls 15

snprintfFunction · 0.85
strcmpFunction · 0.85
cmd_ethdev_showFunction · 0.85
cmd_ethdevFunction · 0.85
cmd_ringFunction · 0.85
cmd_pipeline_codegenFunction · 0.85
cmd_pipeline_libbuildFunction · 0.85
cmd_pipeline_buildFunction · 0.85
cmd_pipeline_table_addFunction · 0.85
cmd_pipeline_table_showFunction · 0.85

Tested by

no test coverage detected