int main(int argc, char **argv) { struct cmdline *cl; int ret; ret = rte_eal_init(argc, argv); if (ret < 0) return -1; rte_timer_subsystem_init(); argc -= ret; argv += ret; prgname = argv[0]; #ifndef RTE_EXEC_ENV_BAREMETAL if ((recursive_call = getenv(RECURSIVE_ENV_VAR)) != NULL) return do_recursive_call(); #endif cl = cmdline_stdin_new(main_ctx, "RTE>>"); if (cl == NULL) { return -1; } cmdline_interact(cl); cmdline_stdin_exit(cl); return 0; }
int main(void) { int ret; struct cmdline *cl; int param_num = 8; char *param[] = {"anscli", "-c", "1", "-n", "1", "--no-pci", "--socket-mem=1", "--proc-type=secondary", NULL}; rte_set_log_level(RTE_LOG_ERR); ret = rte_eal_init(param_num, param); if (ret < 0) rte_panic("Cannot init EAL\n"); ret = anscli_ring_init(); if(ret != 0) rte_panic("Cannot init ring\n"); cl = cmdline_stdin_new(ip_main_ctx, "ans> "); if (cl == NULL) rte_panic("Cannot create ans cmdline instance\n"); cmdline_interact(cl); cmdline_stdin_exit(cl); return 0; }
static int pipeline_free(void *pipeline) { struct pipeline_master *p = (struct pipeline_master *) pipeline; if (p == NULL) return -EINVAL; cmdline_stdin_exit(p->cl); rte_free(p); return 0; }
int main(int argc, char **argv) { #ifdef RTE_LIBRTE_CMDLINE struct cmdline *cl; #endif int ret; ret = rte_eal_init(argc, argv); if (ret < 0) return -1; #ifdef RTE_LIBRTE_TIMER rte_timer_subsystem_init(); #endif if (commands_init() < 0) return -1; argv += ret; prgname = argv[0]; #ifndef RTE_EXEC_ENV_BAREMETAL if ((recursive_call = getenv(RECURSIVE_ENV_VAR)) != NULL) return do_recursive_call(); #endif #ifdef RTE_LIBEAL_USE_HPET if (rte_eal_hpet_init(1) < 0) #endif RTE_LOG(INFO, APP, "HPET is not enabled, using TSC as default timer\n"); #ifdef RTE_LIBRTE_CMDLINE cl = cmdline_stdin_new(main_ctx, "RTE>>"); if (cl == NULL) { return -1; } cmdline_interact(cl); cmdline_stdin_exit(cl); #endif return 0; }
int main(int argc, char **argv) { int ret; struct cmdline *cl; ret = rte_eal_init(argc, argv); if (ret < 0) rte_panic("Cannot init EAL\n"); cl = cmdline_stdin_new(main_ctx, "example> "); if (cl == NULL) rte_panic("Cannot create cmdline instance\n"); cmdline_interact(cl); cmdline_stdin_exit(cl); return 0; }
int MAIN(int argc, char **argv) { int ret; struct cmdline *cl; rte_set_log_level(RTE_LOG_INFO); ret = rte_eal_init(argc, argv); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot initialize EAL\n"); setup_shared_variables(); cl = cmdline_stdin_new(qwctl_ctx, "qwctl> "); if (cl == NULL) rte_exit(EXIT_FAILURE, "Cannot create cmdline instance\n"); cmdline_interact(cl); cmdline_stdin_exit(cl); return 0; }
static int pipeline_run(void *pipeline) { struct pipeline_master *p = (struct pipeline_master *) pipeline; int status; if (p->script_file_done == 0) { struct app_params *app = p->app; int fd = open(app->script_file, O_RDONLY); if (fd < 0) printf("Cannot open CLI script file \"%s\"\n", app->script_file); else { struct cmdline *file_cl; printf("Running CLI script file \"%s\" ...\n", app->script_file); file_cl = cmdline_new(p->cl->ctx, "", fd, 1); cmdline_interact(file_cl); close(fd); } p->script_file_done = 1; } status = cmdline_poll(p->cl); if (status < 0) rte_panic("CLI poll error (%" PRId32 ")\n", status); else if (status == RDLINE_EXITED) { cmdline_stdin_exit(p->cl); rte_exit(0, "Bye!\n"); } return 0; }