本文整理汇总了C++中cli_out函数的典型用法代码示例。如果您正苦于以下问题:C++ cli_out函数的具体用法?C++ cli_out怎么用?C++ cli_out使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cli_out函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: cli_cmd_peer_status_cbk
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;
}
开发者ID:mdjunaid,项目名称:glusterfs,代码行数:34,代码来源:cli-cmd-peer.c
示例2: test_print_entry
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)");
}
开发者ID:ariavie,项目名称:bcm,代码行数:25,代码来源:test.c
示例3: cli_cmd_peer_probe_cbk
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;
}
开发者ID:rsevero,项目名称:glusterfs,代码行数:60,代码来源:cli-cmd-peer.c
示例4: sal_if_deconfig
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) */
}
开发者ID:ariavie,项目名称:bcm,代码行数:32,代码来源:if.c
示例5: test_run_selected
/*
* 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);
}
开发者ID:ariavie,项目名称:bcm,代码行数:31,代码来源:test.c
示例6: cli_cmd_uuid_reset_cbk
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;
}
开发者ID:ArikaChen,项目名称:glusterfs,代码行数:60,代码来源:cli-cmd-system.c
示例7: _robo_xd_init
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;
}
}
开发者ID:ariavie,项目名称:bcm,代码行数:60,代码来源:txrx.c
示例8: cli_cmd_volume_replace_brick_cbk
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;
}
开发者ID:pavantc,项目名称:glusterd_scalability,代码行数:47,代码来源:cli-cmd-volume.c
示例9: cli_debug_xid
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);
}
开发者ID:akrito,项目名称:Varnish-Least-Busy-Director,代码行数:8,代码来源:cache_center.c
示例10: _send_echo_pkt_cb
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);
}
开发者ID:ariavie,项目名称:bcm,代码行数:17,代码来源:ctrans.c
示例11: cmd_cint
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;
}
开发者ID:ariavie,项目名称:bcm,代码行数:46,代码来源:cmd_cint.c
示例12: test_run
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);
}
开发者ID:ariavie,项目名称:bcm,代码行数:45,代码来源:test.c
示例13: if_dump_table
/*
* 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);
}
}
}
}
开发者ID:ariavie,项目名称:bcm,代码行数:50,代码来源:if.c
示例14: test_print_header
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");
}
开发者ID:ariavie,项目名称:bcm,代码行数:19,代码来源:test.c
示例15: test_mode
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);
}
开发者ID:ariavie,项目名称:bcm,代码行数:42,代码来源:test.c
示例16: cli_cmd_system_help_cbk
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;
}
开发者ID:ArikaChen,项目名称:glusterfs,代码行数:11,代码来源:cli-cmd-system.c
示例17: ccf_debug_vmod
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);
}
开发者ID:drwilco,项目名称:varnish-cache-old,代码行数:11,代码来源:cache_vrt_vmod.c
示例18: robo_eav_cb_handler
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;
}
开发者ID:ariavie,项目名称:bcm,代码行数:20,代码来源:eav.c
示例19: cli_cmd_volume_rename_cbk
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;
}
开发者ID:pavantc,项目名称:glusterd_scalability,代码行数:54,代码来源:cli-cmd-volume.c
示例20: cli_debug_srandom
/*
* 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);
}
开发者ID:akrito,项目名称:Varnish-Least-Busy-Director,代码行数:15,代码来源:cache_center.c
注:本文中的cli_out函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论