static ucli_status_t utest_ucli_options__deep__(ucli_context_t* uc) { int i; ucli_node_t* last = NULL; ucli_t* ucli; UCLI_COMMAND_INFO(uc, "deep", 0, "Run the deep test."); for(i = sizeof(modules)/sizeof(modules[0]) - 2; i >= 0; i--) { ucli_node_t* node; ucli_module_init(modules[i]); node = ucli_node_create(modules[i]->name, NULL, modules[i]); if(last == NULL) { last = node; } else { ucli_node_subnode_add(node, last); last = node; } } ucli = ucli_create(NULL, NULL, NULL); ucli_node_add(ucli, last); ucli_run(ucli, "deep"); return UCLI_STATUS_OK; }
ucli_module_t* ppe_utm_create(void) { ppe_utm_ctrl_t* ppec = aim_zmalloc(sizeof(*ppec)); ppe_utm_module__.cookie = ppec; ucli_module_init(&ppe_utm_module__); return &ppe_utm_module__; }
ucli_node_t* x86_64_quanta_ix8_rglbmc_ucli_node_create(void) { ucli_node_t* n; ucli_module_init(&x86_64_quanta_ix8_rglbmc_ucli_module__); n = ucli_node_create("x86_64_quanta_ix8_rglbmc", NULL, &x86_64_quanta_ix8_rglbmc_ucli_module__); ucli_node_subnode_add(n, ucli_module_log_node_create("x86_64_quanta_ix8_rglbmc")); return n; }
ucli_node_t* x86_64_lenovo_ne10032_ucli_node_create(void) { ucli_node_t* n; ucli_module_init(&x86_64_lenovo_ne10032_ucli_module__); n = ucli_node_create("x86_64_lenovo_ne10032", NULL, &x86_64_lenovo_ne10032_ucli_module__); ucli_node_subnode_add(n, ucli_module_log_node_create("x86_64_lenovo_ne10032")); return n; }
ucli_node_t* onlp_ucli_node_create(void) { ucli_node_t* n; ucli_module_init(&onlp_ucli_module__); n = ucli_node_create("onlp", NULL, &onlp_ucli_module__); ucli_node_subnode_add(n, ucli_module_log_node_create("onlp")); return n; }
ucli_node_t* powerpc_quanta_lb9_r0_ucli_node_create(void) { ucli_node_t* n; ucli_module_init(&powerpc_quanta_lb9_r0_ucli_module__); n = ucli_node_create("powerpc_quanta_lb9_r0", NULL, &powerpc_quanta_lb9_r0_ucli_module__); ucli_node_subnode_add(n, ucli_module_log_node_create("powerpc_quanta_lb9_r0")); return n; }
ucli_node_t* ppe_ucli_node_create(void) { ucli_node_t* n; ucli_module_init(&ppe_ucli_module__); n = ucli_node_create("ppe", NULL, &ppe_ucli_module__); ucli_node_subnode_add(n, ucli_module_log_node_create("ppe")); return n; }
ucli_node_t* arm64_nxp_layerscape_ucli_node_create(void) { ucli_node_t* n; ucli_module_init(&arm64_nxp_layerscape_ucli_module__); n = ucli_node_create("arm64_nxp_layerscape", NULL, &arm64_nxp_layerscape_ucli_module__); ucli_node_subnode_add(n, ucli_module_log_node_create("arm64_nxp_layerscape")); return n; }
ucli_node_t* x86_64_mlnx_msn2700_ucli_node_create(void) { ucli_node_t* n; ucli_module_init(&x86_64_mlnx_msn2700_ucli_module__); n = ucli_node_create("x86_64_mlnx_msn2700", NULL, &x86_64_mlnx_msn2700_ucli_module__); ucli_node_subnode_add(n, ucli_module_log_node_create("x86_64_mlnx_msn2700")); return n; }
ucli_node_t* slot_allocator_ucli_node_create(void) { ucli_node_t* n; ucli_module_init(&slot_allocator_ucli_module__); n = ucli_node_create("slot_allocator", NULL, &slot_allocator_ucli_module__); ucli_node_subnode_add(n, ucli_module_log_node_create("slot_allocator")); return n; }
ucli_node_t* x86_64_alphanetworks_snx60a0_486f_ucli_node_create(void) { ucli_node_t* n; ucli_module_init(&x86_64_alphanetworks_snx60a0_486f_ucli_module__); n = ucli_node_create("x86_64_alphanetworks_snx60a0_486f", NULL, &x86_64_alphanetworks_snx60a0_486f_ucli_module__); ucli_node_subnode_add(n, ucli_module_log_node_create("x86_64_alphanetworks_snx60a0_486f")); return n; }
ucli_node_t* wnc_sys_eeprom_ucli_node_create(void) { ucli_node_t* n; ucli_module_init(&wnc_sys_eeprom_ucli_module__); n = ucli_node_create("wnc_sys_eeprom", NULL, &wnc_sys_eeprom_ucli_module__); ucli_node_subnode_add(n, ucli_module_log_node_create("wnc_sys_eeprom")); return n; }
ucli_node_t* timer_wheel_ucli_node_create(void) { ucli_node_t* n; ucli_module_init(&timer_wheel_ucli_module__); n = ucli_node_create("timer_wheel", NULL, &timer_wheel_ucli_module__); ucli_node_subnode_add(n, ucli_module_log_node_create("timer_wheel")); return n; }
ucli_node_t* x86_64_delta_ag9032v2_ucli_node_create(void) { ucli_node_t* n; ucli_module_init(&x86_64_delta_ag9032v2_ucli_module__); n = ucli_node_create("x86_64_delta_ag9032v2", NULL, &x86_64_delta_ag9032v2_ucli_module__); ucli_node_subnode_add(n, ucli_module_log_node_create("x86_64_delta_ag9032v2")); return n; }
ucli_node_t* x86_64_inventec_d7032q28b_ucli_node_create(void) { ucli_node_t* n; ucli_module_init(&x86_64_inventec_d7032q28b_ucli_module__); n = ucli_node_create("x86_64_inventec_d7032q28b", NULL, &x86_64_inventec_d7032q28b_ucli_module__); ucli_node_subnode_add(n, ucli_module_log_node_create("x86_64_inventec_d7032q28b")); return n; }
ucli_node_t* x86_64_kvm_x86_64_ucli_node_create(void) { ucli_node_t* n; ucli_module_init(&x86_64_kvm_x86_64_ucli_module__); n = ucli_node_create("x86_64_kvm_x86_64", NULL, &x86_64_kvm_x86_64_ucli_module__); ucli_node_subnode_add(n, ucli_module_log_node_create("x86_64_kvm_x86_64")); return n; }
ucli_node_t* x86_64_accton_as7312_54xs_ucli_node_create(void) { ucli_node_t* n; ucli_module_init(&x86_64_accton_as7312_54xs_ucli_module__); n = ucli_node_create("x86_64_accton_as7312_54xs", NULL, &x86_64_accton_as7312_54xs_ucli_module__); ucli_node_subnode_add(n, ucli_module_log_node_create("x86_64_accton_as7312_54xs")); return n; }
ucli_node_t* els_ucli_node_create(void) { ucli_node_t* n; ucli_module_init(&els_ucli_module__); n = ucli_node_create("els", NULL, &els_ucli_module__); ucli_node_subnode_add(n, ucli_module_log_node_create("els")); return n; }
ucli_node_t* x86_64_netberg_aurora_720_rangeley_ucli_node_create(void) { ucli_node_t* n; ucli_module_init(&x86_64_netberg_aurora_720_rangeley_ucli_module__); n = ucli_node_create("x86_64_netberg_aurora_720_rangeley", NULL, &x86_64_netberg_aurora_720_rangeley_ucli_module__); ucli_node_subnode_add(n, ucli_module_log_node_create("x86_64_netberg_aurora_720_rangeley")); return n; }
ucli_module_t* fme_utm_create(void) { fme_utm_ctrl_t* fmec = aim_zmalloc(sizeof(*fmec)); fme_create(&fmec->fme, "fme_utm", FME_CONFIG_UTM_ENTRIES); fme_utm_module__.cookie = fmec; ucli_module_init(&fme_utm_module__); return &fme_utm_module__; }
ucli_node_t* socketmanager_ucli_node_create(void) { ucli_node_t* n; ucli_module_init(&socketmanager_ucli_module__); n = ucli_node_create("socketmanager", NULL, &socketmanager_ucli_module__); ucli_node_subnode_add(n, ucli_module_log_node_create("socketmanager")); return n; }
ucli_node_t* ofconnectionmanager_ucli_node_create(void) { ucli_node_t* n; ucli_module_init(&ofconnectionmanager_ucli_module__); n = ucli_node_create("ofconnectionmanager", NULL, &ofconnectionmanager_ucli_module__); ucli_node_subnode_add(n, ucli_module_log_node_create("ofconnectionmanager")); return n; }
int main(int argc, char* argv[]) { ucli_t* uopts; AIM_REFERENCE(argc); ucli_init(); ucli_module_init(&options_module); uopts = ucli_create(NULL, &options_module, NULL); ucli_dispatch_argv(uopts, &aim_pvs_stdout, argv+1); ucli_destroy(uopts); ucli_denit(); return 0; }
static ucli_status_t utest_ucli_options__flat__(ucli_context_t* uc) { int i; ucli_t* ucli; UCLI_COMMAND_INFO(uc, "flat", 0, "Run the flat test."); ucli = ucli_create(NULL, NULL, NULL); for(i = 0; modules[i]; i++) { ucli_module_init(modules[i]); ucli_module_add(ucli, modules[i]); } ucli_run(ucli, "flat"); ucli_destroy(ucli); return UCLI_STATUS_OK; }
int aim_main(int argc, char* argv[]) { signal(SIGINT, __sighandler); if(argc == 1 || !strcmp(argv[1], "help") || !strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")) { const char* usage = "Usage:\n" " vpitool -dump <vpiSpec>\n" " Dump all packets on the given VPI\n" "\n" " vpitool -bridge <vpiSec1> <vpiSpec2>\n" " Forward all packets between two VPI interfaces.\n" "\n" " vpitool -send <vpiSpec> <packetdata>\n" " Send a single packet on the given VPI.\n" "\n" " vpitool -echo <vpiSpec> <packetdata>\n" " Send a VPI echo request.\n" "\n" " vpitool -sendrecv <vpiSpec> <packetdata>\n" " Send a single packet on the given VPI and wait for a response.\n" "\n" " vpitool help\n" " This help message.\n" "\n" "EXAMPLES:\n" "\n" " # Dump all packets on veth0:\n" " > vpitool -dump \"veth|veth0\"\n" "\n" "\n" " # Bridge all packets between veth1 and veth2:\n" " > vpitool -bridge \"veth|veth1\" \"veth|veth2\"\n" "\n" " # Send a single packet to veth0\n" " > vpitool -send \"veth|veth0\" {FFFFFFFFFFFF}{000000000001}{0800}{AABBCCDD}\n" "\n" " # Send and receive a packet between two VPIs over UDP:\n" " > vpitool -dump \"udp|bind|6000|6001\"\n" " > vpitool -send \"udp|bind|6001|6000\" {FFFFFFFFFFFF}{000000000001}{0800}{AABBCCDD}\n" "\n" " # A loopback server on port 8000:\n" " > vpitool -bridge \"udp|recv:8000\" \"loop\"\n" " # The corresponding client:\n" " > vpitool -sendrecv \"*s|udp|send:8000|recv:5566\" {DEADBEEFCAFE} \n" "\n"; printf("%s", usage); return 0; } { ucli_t* u; ucli_init(); ucli_module_init(&vt_module); u = ucli_create(NULL, &vt_module, NULL); ucli_dispatch_argv(u, &aim_pvs_stdout, argv+1); } if(vt_ctrl__.bridges > 0) { for(;;) { sleep(1000); } } return 0; }