int cli_cmd_peer_status_cbk (struct cli_state *state, struct cli_cmd_word *word, const char **words, int wordcount) { int ret = -1; rpc_clnt_procedure_t *proc = NULL; call_frame_t *frame = NULL; int sent = 0; int parse_error = 0; if (wordcount != 2) { cli_usage_out (word->pattern); parse_error = 1; goto out; } proc = &cli_rpc_prog->proctable[GLUSTER_CLI_LIST_FRIENDS]; frame = create_frame (THIS, THIS->ctx->pool); if (!frame) goto out; if (proc->fn) { ret = proc->fn (frame, THIS, (char *)words[1] ); } out: if (ret) { cli_cmd_sent_status_get (&sent); if ((sent == 0) && (parse_error == 0)) cli_out ("Peer status failed"); } return ret; }
void test_print_entry(int unit, test_t *test) /* * Function: test_print_entry * Purpose: Print a single test entry in a pretty formatted way. * Parameters: unit - Strata Switch unit # * test - pointer to test list entry to print * Returns: Nothing */ { int selected; uint32 chip = _test_chip(unit); selected = (test->t_flags & T_F_SEL_ALL) || ((test->t_flags & T_F_SEL_CHIP) && (test->t_flags & chip)); cli_out(" %c%c%c |%4d| %-26s|%5d|%5d|%5d|%5d| %s\n", test->t_flags & _test_chip(unit) ? ' ' : 'U', test->t_flags & T_F_ACTIVE ? 'A' : ' ', selected ? 'S' : ' ', test->t_test, test->t_name, test->t_loops, test->t_runs, test->t_success, test->t_fail, test->t_override_string ? test->t_override_string : test->t_default_string ? test->t_default_string : "(none)"); }
int cli_cmd_peer_probe_cbk (struct cli_state *state, struct cli_cmd_word *word, const char **words, int wordcount) { int ret = -1; rpc_clnt_procedure_t *proc = NULL; call_frame_t *frame = NULL; dict_t *dict = NULL; int sent = 0; int parse_error = 0; if (!(wordcount == 3)) { cli_usage_out (word->pattern); parse_error = 1; goto out; } proc = &cli_rpc_prog->proctable[GLUSTER_CLI_PROBE]; frame = create_frame (THIS, THIS->ctx->pool); if (!frame) goto out; dict = dict_new (); if (!dict) goto out; ret = dict_set_str (dict, "hostname", (char *)words[2]); if (ret) goto out; ret = valid_internet_address ((char *) words[2], _gf_false); if (ret == 1) { ret = 0; } else { cli_usage_out (word->pattern); parse_error = 1; goto out; } /* if (words[3]) { ret = dict_set_str (dict, "port", (char *)words[3]); if (ret) goto out; } */ if (proc->fn) { ret = proc->fn (frame, THIS, dict); } out: if (ret) { cli_cmd_sent_status_get (&sent); if ((sent == 0) && (parse_error == 0)) cli_out ("Peer probe failed"); } if (frame) STACK_DESTROY (frame->root); return ret; }
static int sal_if_deconfig(char *pfx, END_OBJ *eo, char *if_name, int if_unit) /* * Function: * Purpose: * Parameters: pfx - prefix to print on errors/warnings * if_name - name of interface ("sn" for "sn0") * if_unit - unit # (0 for "sn0") * Returns: 0 - success * -1 - failed */ { #if defined(INCLUDE_DRIVERS) int rv; SAL_MAP_NETUNIT(if_unit); if (NULL == endFindByName(if_name, if_unit)) { cli_out("%s: Error: can not locate device: %s%d\n", pfx, if_name, if_unit); return(-1); } rv = sal_if_do_deconfig(pfx, eo, if_name, if_unit); LOG_INFO(BSL_LS_APPL_END, (BSL_META("%s: sal_if_deconfig complete: %s%d (%d)\n"), pfx, if_name, if_unit, rv)); return(rv); #else /* !defined(INCLUDE_DRIVERS) */ return(-1); #endif /* !defined(INCLUDE_DRIVERS) */ }
/* * Function: test_run_selected * Purpose: Run selected tests. * Parameters: u - unit number to run tests on. * Returns: Nothing. */ int test_run_selected(int u) { int i; if (test_options & TEST_O_RANDOM) { cli_out("Test: Random mode not supported yet\n"); return(TEST_STOP); } for (i = 0; i < test_cnt; i++) { if ((test_list[i].t_flags & T_F_SEL_ALL) || ((test_list[i].t_flags & T_F_SEL_CHIP) && (test_list[i].t_flags & _test_chip(u)))) { int rv; switch((rv = test_dispatch(u, &test_list[i], -1, NULL))) { case TEST_STOP: case TEST_INTR: return(rv); } } } return(TEST_RUNNING); }
int cli_cmd_uuid_reset_cbk (struct cli_state *state, struct cli_cmd_word *word, const char **words, int wordcount) { int ret = -1; rpc_clnt_procedure_t *proc = NULL; call_frame_t *frame = NULL; int sent = 0; int parse_error = 0; gf_answer_t answer = GF_ANSWER_NO; char *question = NULL; cli_local_t *local = NULL; dict_t *dict = NULL; xlator_t *this = NULL; question = "Resetting uuid changes the uuid of local glusterd. " "Do you want to continue?"; if (wordcount != 3) { cli_usage_out (word->pattern); parse_error = 1; goto out; } proc = &cli_rpc_prog->proctable[GLUSTER_CLI_UUID_RESET]; this = THIS; frame = create_frame (this, this->ctx->pool); if (!frame) goto out; dict = dict_new (); if (!dict) { ret = -1; goto out; } CLI_LOCAL_INIT (local, words, frame, dict); answer = cli_cmd_get_confirmation (state, question); if (GF_ANSWER_NO == answer) { ret = 0; goto out; } //send NULL as argument since no dictionary is sent to glusterd if (proc->fn) { ret = proc->fn (frame, this, dict); } out: if (ret) { cli_cmd_sent_status_get (&sent); if ((sent == 0) && (parse_error == 0)) cli_out ("uuid reset failed"); } CLI_STACK_DESTROY (frame); return ret; }
STATIC void _robo_xd_init(int unit, xd_t *xd) { static sal_mac_addr_t default_mac_src ={ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05 }; static sal_mac_addr_t default_mac_dst ={ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15 }; /* * First time through, everything 0 (BSS), so set up defaults. */ xd->hdr_mode = 0; xd->xd_unit = unit; xd->xd_init = TRUE; xd->xd_state = XD_IDLE; xd->xd_file = NULL; xd->xd_pkt_len = 68; xd->xd_pat = 0x12345678; xd->xd_pat_inc = 1; SOC_PBMP_ASSIGN(xd->pkt_info.tx_pbmp, PBMP_ALL(unit)); SOC_PBMP_ASSIGN(xd->xd_ppsm_pbm, PBMP_ALL(unit)); xd->xd_vlan = 0x1; xd->xd_prio = 0; xd->xd_ppsm = 0; #if defined(BCM_TB_SUPPORT) || defined(BCM_POLAR_SUPPORT) xd->pkt_info.prio_int = 0; #endif /* BCM_TB_SUPPORT || BCM_POLAR_SUPPORT */ #ifdef BCM_TB_SUPPORT xd->pkt_info.multicast_group= -1; xd->pkt_info.color = bcmColorGreen; xd->pkt_info.flow_id= 0; xd->pkt_info.filter_enable= 0; #endif /* BCM_TB_SUPPORT */ xd->xd_cbk_enable = 0; xd->pkt_info.call_back = NULL; ENET_SET_MACADDR(xd->xd_mac_dst, default_mac_dst); ENET_SET_MACADDR(xd->xd_mac_src, default_mac_src); xd->xd_crc = 1; /* Re-gen CRC by default */ if (xd->pkt_info.pkt_data) { /* Has been setup before */ soc_cm_sfree(unit, xd->pkt_info.alloc_ptr); xd->pkt_info.pkt_data = NULL; } xd->pkt_info.flags = 0; if ((xd->pkt_info.alloc_ptr = (uint8 *)soc_cm_salloc(unit, xd->xd_pkt_len, "TX")) == NULL) { cli_out("WARNING: Could not allocate tx buffer. Memory error.\n"); xd->xd_init = FALSE; xd->pkt_info.pkt_data = NULL; xd->pkt_info._pkt_data.len = 0; } else { xd->pkt_info._pkt_data.data = xd->pkt_info.alloc_ptr; xd->pkt_info.pkt_data = &xd->pkt_info._pkt_data; xd->pkt_info.blk_count = 1; xd->pkt_info._pkt_data.len = xd->xd_pkt_len; } }
int cli_cmd_volume_replace_brick_cbk (struct cli_state *state, struct cli_cmd_word *word, const char **words, int wordcount) { int ret = -1; rpc_clnt_procedure_t *proc = NULL; call_frame_t *frame = NULL; dict_t *options = NULL; int sent = 0; int parse_error = 0; #ifdef GF_SOLARIS_HOST_OS cli_out ("Command not supported on Solaris"); goto out; #endif proc = &cli_rpc_prog->proctable[GLUSTER_CLI_REPLACE_BRICK]; frame = create_frame (THIS, THIS->ctx->pool); if (!frame) goto out; ret = cli_cmd_volume_replace_brick_parse (words, wordcount, &options); if (ret) { cli_usage_out (word->pattern); parse_error = 1; goto out; } if (proc->fn) { ret = proc->fn (frame, THIS, options); } out: if (options) dict_unref (options); if (ret) { cli_cmd_sent_status_get (&sent); if ((sent == 0) && (parse_error == 0)) cli_out ("Volume replace-brick failed"); } return ret; }
static void cli_debug_xid(struct cli *cli, const char * const *av, void *priv) { (void)priv; if (av[2] != NULL) xids = strtoul(av[2], NULL, 0); cli_out(cli, "XID is %u", xids); }
STATIC void _send_echo_pkt_cb(uint8 *pkt, void *cookie, int rv) { _echo_cb_async_t *async_data; if (cookie == NULL) { cli_out("Error in async callback routine; missing data\n"); return; } async_data = (_echo_cb_async_t *)cookie; cli_out("Async callback routine, unit %d\n", async_data->unit); /* Free buffer allocated earlier in _ct_echo() */ sal_dma_free(pkt); sal_free(async_data); }
cmd_result_t cmd_cint(int unit, args_t* a) { char* s; int cmp; int argc = 0; char* argv[16]; cmd_cint_initialize(); s = ARG_CUR(a); if(s) { cmp = sal_strcmp(s, "allow_file_info"); if(!cmp) { argv[argc] = ARG_GET(a); argc++; } } if(ARG_CUR(a)) { /* Load file */ FILE* fp; s = ARG_GET(a); if((fp = sal_fopen(s, "r")) != NULL) { sal_memset(argv, 0, sizeof(argv)); while( (argv[argc] = ARG_GET(a)) ) { argc++; } cint_interpreter_parse(fp, NULL, argc, argv); sal_fclose(fp); } else { cli_out("error: could not open file '%s'\n", s); } } else { cli_out("Entering C Interpreter. Type 'exit;' to quit.\n\n"); cint_interpreter_parse(NULL, "cint> ", argc, argv); } return 0; }
cmd_result_t test_run(int u, args_t *a) /* * Function: test_run * Purpose: Perform "run" command for test. * Parameters: none - Run all selected tests with loaded parameters. * "test [options]" * Returns: Test result. */ { test_t *test; int rv; int loops = -1; if (test_active) { cli_out("%s: Already running: %s\n", ARG_CMD(a), test_active->t_name); return(CMD_FAIL); } else if (!sh_check_attached(ARG_CMD(a), u)) { return(CMD_FAIL); } if (!ARG_CNT(a)) { rv = test_run_selected(u); } else { if (NULL == (test = test_find(ARG_CUR(a)))) { cli_out("%s: Unknown test: %s\n", ARG_CMD(a), ARG_CUR(a)); return(CMD_FAIL); } if (!(test->t_flags & _test_chip(u)) && !(test_options & TEST_O_OVERRIDE)) { cli_out("Error: Test %d (%s) not supported on %s\n" "Error: use \"testmode +override\" to override and run\n", test->t_test, test->t_name, SOC_UNIT_GROUP(u)); return(CMD_FAIL); } ARG_NEXT(a); /* Move arg pointer */ /* If there is an argument which is an integer, it's a loop count */ if (ARG_CUR(a) && isint(ARG_CUR(a))) { loops = strtoul(_ARG_GET(a), NULL, 10); } rv = test_dispatch(u, test, loops, ARG_CNT(a) ? a : NULL); } return(rv == TEST_INTR ? CMD_INTR : rv); }
/* * Function: if_dump_table * Purpose: Dump the interface table. * Parameters: Unit - Strataswitch Unit #. * interface - interface # * Returns: Nothing */ static void if_dump_table(int u, int interface, int all) { int us, ue; int is, ie; char ip_str[SAL_IPADDR_STR_LEN+3]; char mac_str[SAL_MACADDR_STR_LEN]; if_soc_t *ifs; if (SOC_UNIT_VALID(u)) { us = ue = u; } else { us = 0; ue = soc_ndev; } if (interface < 0) { is = 0; ie = MAX_INTERFACE-1; } else { is = interface; ie = interface; } for (u = us; u <= ue; u++) { if (if_table[u] == NULL) { continue; } for (interface = is; interface <= ie; interface++) { ifs = &if_table[u][interface]; if (!all && !ifs->ifs_sal) { continue;; } if (ifs->ifs_sal) { format_ipaddr_mask(ip_str, ifs->ifs_net_ip, ifs->ifs_net_mask); format_macaddr(mac_str, ifs->ifs_net_mac); cli_out("unit %d interface %s%d: mac %s ip %s\n", u, ifs->ifs_net_name, ifs->ifs_net_interface, mac_str, ip_str); } else { cli_out("unit %d interface %d: down\n", u, interface); } } } }
void test_print_header(int status_report) /* * Function: test_print_header * Purpose: Print header string for output. * Parameters: None. * Returns: Nothing */ { if (status_report) { cli_out("-----+----+--- TEST STATUS REPORT ----+" "-----+-----+-----+-----+-----------\n"); } cli_out("U/A/S|Test| Test |Loop | Run |Pass |Fail |" " Arguments\n"); cli_out(" | # | Name |Count|Count|Count|Count|" "\n"); }
cmd_result_t test_mode(int u, args_t *a) /* * Function: test_mode * Purpose: Set test test mode * Parameters: [+/-] "soe" or "stoponerror" * Returns: 0 - success, * -1 - failed. */ { static parse_pm_t options[] = { {"@SOE", TEST_O_SOE}, {"@AOE", TEST_O_AOE}, {"Stoponerror", TEST_O_SOE}, {"Abortonerror",TEST_O_AOE}, {"Quiet", TEST_O_QUIET}, {"Progress", TEST_O_PROGRESS}, {"RANDom", TEST_O_RANDOM}, {"SIlent", TEST_O_SILENT}, {"Run", TEST_O_RUN}, {"Override", TEST_O_OVERRIDE}, {"NoReinit", TEST_O_NO_REINIT}, {NULL, 0} }; char *c; COMPILER_REFERENCE(u); if (0 == ARG_CNT(a)) { cli_out("Test: Options: "); parse_mask_format(80, options, test_options); cli_out("\n"); return(CMD_OK); } while ((c = ARG_GET(a)) != NULL) { if (parse_mask(c, options, &test_options)) { cli_out("%s: Error: invalid option ignored: %s\n", ARG_CMD(a), c); } } return(CMD_OK); }
int cli_cmd_system_help_cbk (struct cli_state *state, struct cli_cmd_word *in_word, const char **words, int wordcount) { struct cli_cmd *cmd = NULL; for (cmd = cli_system_cmds; cmd->pattern; cmd++) cli_out ("%s - %s", cmd->pattern, cmd->desc); return 0; }
static void ccf_debug_vmod(struct cli *cli, const char * const *av, void *priv) { struct vmod *v; (void)av; (void)priv; ASSERT_CLI(); VTAILQ_FOREACH(v, &vmods, list) cli_out(cli, "%5d %s (%s)\n", v->ref, v->nm, v->path); }
STATIC bcm_rx_t robo_eav_cb_handler(int unit, bcm_pkt_t *info, void *cookie) { if (info->flags & BCM_TX_TIME_STAMP_REPORT) { /* Report Egress Transmit time */ cli_out("Receive EAV Egress Time Stamp Packet : tx_port = %d\n", info->rx_port); cli_out("Depature time is 0x%x.\n", info->rx_timestamp); } else if (info->flags & BCM_PKT_F_TIMESYNC) { /* Received Time Sync Packets */ cli_out("Receive EAV Time Sync Packet : rx_port = %d\n", info->rx_port); cli_out("Time is 0x%x.\n", info->rx_timestamp); } else { return BCM_RX_NOT_HANDLED; } return BCM_RX_HANDLED; }
int cli_cmd_volume_rename_cbk (struct cli_state *state, struct cli_cmd_word *word, const char **words, int wordcount) { int ret = -1; rpc_clnt_procedure_t *proc = NULL; call_frame_t *frame = NULL; dict_t *dict = NULL; int sent = 0; int parse_error = 0; frame = create_frame (THIS, THIS->ctx->pool); if (!frame) goto out; dict = dict_new (); if (!dict) goto out; if (wordcount != 4) { cli_usage_out (word->pattern); parse_error = 1; goto out; } ret = dict_set_str (dict, "old-volname", (char *)words[2]); if (ret) goto out; ret = dict_set_str (dict, "new-volname", (char *)words[3]); if (ret) goto out; proc = &cli_rpc_prog->proctable[GLUSTER_CLI_RENAME_VOLUME]; if (proc->fn) { ret = proc->fn (frame, THIS, dict); } out: if (dict) dict_destroy (dict); if (ret) { cli_cmd_sent_status_get (&sent); if ((sent == 0) && (parse_error == 0)) cli_out ("Volume rename on '%s' failed", (char *)words[2]); } return ret; }
/* * Default to seed=1, this is the only seed value POSIXl guarantees will * result in a reproducible random number sequence. */ static void cli_debug_srandom(struct cli *cli, const char * const *av, void *priv) { (void)priv; unsigned seed = 1; if (av[2] != NULL) seed = strtoul(av[2], NULL, 0); srandom(seed); cli_out(cli, "Random(3) seeded with %lu", seed); }
STATIC int _bcm_esw_policer_traverse_print(int unit, bcm_policer_t policer_id, bcm_policer_config_t *cfg, void *user_data) { cli_out("Policer with id %x configuration params are \n",policer_id); cli_out("Policer Type =%d \n",cfg->mode); cli_out("Flag =%d \n",cfg->flags); cli_out("Committed rate =%d \n",cfg->ckbits_sec); cli_out("Committed Burst =%d \n",cfg->ckbits_burst); cli_out("Peak rate =%d \n",cfg->pkbits_sec); cli_out("Peak Burst =%d \n",cfg->pkbits_burst); cli_out("Action ID =%d \n",cfg->action_id); cli_out("Sharing Mode =%d \n",cfg->sharing_mode); return CMD_OK; }
gf_answer_t cli_cmd_get_confirmation (struct cli_state *state, const char *question) { char answer[5] = {'\0', }; char flush = '\0'; int len = 0; if (state->mode & GLUSTER_MODE_SCRIPT) return GF_ANSWER_YES; printf ("%s (y/n) ", question); if (fgets (answer, 4, stdin) == NULL) { cli_out("gluster cli read error"); goto out; } len = strlen (answer); if (answer [len - 1] == '\n'){ answer [--len] = '\0'; } else { do{ flush = getchar (); }while (flush != '\n'); } if (len > 3) goto out; if (!strcasecmp (answer, "y") || !strcasecmp (answer, "yes")) return GF_ANSWER_YES; else if (!strcasecmp (answer, "n") || !strcasecmp (answer, "no")) return GF_ANSWER_NO; out: cli_out ("Invalid input, please enter y/n"); return GF_ANSWER_NO; }
void test_print_separator(void) /* * Function: test_print_header * Purpose: Print header string for output. * Parameters: None. * Returns: Nothing */ { cli_out("-----+----+---------------------------+-----+-----+-----+-----+" "-----------\n"); }
int cli_cmd_global_help_cbk (struct cli_state *state, struct cli_cmd_word *in_word, const char **words, int wordcount) { struct cli_cmd *cmd = NULL; for (cmd = global_cmds; cmd->pattern; cmd++) if (_gf_false == cmd->disable) cli_out ("%s - %s", cmd->pattern, cmd->desc); return 0; }
void test_print_summary(int loops, int runs, int successes, int failures) /* * Function: test_print_summary * Purpose: Print summary values * Parameters: Summary values * Returns: Nothing */ { cli_out(" | | %-26s|%5d|%5d|%5d|%5d|\n", "TOTAL", loops, runs, successes, failures); }
void _ipfix_callback(int unit, bcm_ipfix_data_t *info, void *userdata) { ipfix_report_count[unit]++; if (ipfix_report[unit] & REPORT_COUNT) { cli_out("Export entry #%d.\n", ipfix_report_count[unit]); } if (ipfix_report[unit] & REPORT_DECODE) { bcm_ipfix_dump_export_entry(unit, info); } }
int cli_cmd_volume_remove_brick_cbk (struct cli_state *state, struct cli_cmd_word *word, const char **words, int wordcount) { int ret = -1; rpc_clnt_procedure_t *proc = NULL; call_frame_t *frame = NULL; dict_t *options = NULL; gf_answer_t answer = GF_ANSWER_NO; int sent = 0; int parse_error = 0; const char *question = "Removing brick(s) can result in data loss. " "Do you want to Continue?"; frame = create_frame (THIS, THIS->ctx->pool); if (!frame) goto out; ret = cli_cmd_volume_remove_brick_parse (words, wordcount, &options); if (ret) { cli_usage_out (word->pattern); parse_error = 1; goto out; } answer = cli_cmd_get_confirmation (state, question); if (GF_ANSWER_NO == answer) { ret = 0; goto out; } proc = &cli_rpc_prog->proctable[GLUSTER_CLI_REMOVE_BRICK]; if (proc->fn) { ret = proc->fn (frame, THIS, options); } out: if (ret) { cli_cmd_sent_status_get (&sent); if ((sent == 0) && (parse_error == 0)) cli_out ("Volume remove-brick failed"); } if (options) dict_unref (options); return ret; }
/* * Function: test_test_done * Purpose: Run done scripts and routines for a specified test. * Parameters: u - unit # * test - pointer to test description. * fp - value returned from init function. * Returns: 0 - success * -1 - failed. */ int test_test_done(int u, test_t *test, void *fp) { int rv = 0; if (test->t_done_f) { /* Call done function */ if (test->t_done_f(u, fp)) { cli_out("Test: ERROR: Done function for test %d (%s) failed\n", test->t_test, test->t_name); rv = -1; } } test->t_flags &= ~(T_F_ACTIVE|T_F_STOP|T_F_ERROR); test_active = NULL; test_thread = NULL; if (test_options & TEST_O_RUN) { cli_out("Test %d (%s) Completed\n", test->t_test, test->t_name); } return(rv); }
/* * Function: * Purpose: * Parmameters: * Returns: */ STATIC int robo_eav_control_get(int unit, args_t *args) { char* subcmd = NULL; uint32 control_type, param; int rv = SOC_E_NONE; EAV_GET_NUMB(control_type, subcmd, args); switch (control_type) { case 1: rv = DRV_EAV_CONTROL_GET (unit, DRV_EAV_CONTROL_TIME_STAMP_TO_IMP, ¶m); if (rv == SOC_E_NONE) { cli_out(" Time Stamp to IMP port is "); if (param == 0) { cli_out("Disabled.\n"); } else { cli_out("Enabled.\n"); } } break; case 2: rv = DRV_EAV_CONTROL_GET (unit, DRV_EAV_CONTROL_MAX_AV_SIZE, ¶m); if (rv == SOC_E_NONE) { cli_out(" Max Ethernet AV size is %d\n", param); } break; default: return CMD_USAGE; } if (rv < 0) { cli_out("eav control get : failed with control type = %d\n", control_type); return CMD_FAIL; } return CMD_OK; }
int32_t cli_cmd_log_locate_parse (const char **words, int wordcount, dict_t **options) { dict_t *dict = NULL; char *volname = NULL; char *str = NULL; int ret = -1; char *delimiter = NULL; GF_ASSERT (words); GF_ASSERT (options); GF_ASSERT ((strcmp (words[0], "volume")) == 0); GF_ASSERT ((strcmp (words[1], "log")) == 0); GF_ASSERT ((strcmp (words[2], "locate")) == 0); dict = dict_new (); if (!dict) goto out; volname = (char *)words[3]; GF_ASSERT (volname); ret = dict_set_str (dict, "volname", volname); if (ret) goto out; if (words[4]) { delimiter = strchr (words[4], ':'); if (!delimiter || delimiter == words[4] || *(delimiter+1) != '/') { cli_out ("wrong brick type: %s, use <HOSTNAME>:" "<export-dir-abs-path>", words[4]); ret = -1; goto out; } else { cli_path_strip_trailing_slashes (delimiter + 1); } str = (char *)words[4]; ret = dict_set_str (dict, "brick", str); if (ret) goto out; } *options = dict; out: if (ret && dict) dict_destroy (dict); return ret; }