您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ vty_out函数代码示例

51自学网 2021-06-03 09:49:44
  C++
这篇教程C++ vty_out函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中vty_out函数的典型用法代码示例。如果您正苦于以下问题:C++ vty_out函数的具体用法?C++ vty_out怎么用?C++ vty_out使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了vty_out函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: rip_route_set_add

/* Add rip route map rule. */static intrip_route_set_add (struct vty *vty, struct route_map_index *index,		   const char *command, const char *arg){  int ret;  ret = route_map_add_set (index, command, arg);  if (ret)    {      switch (ret)	{	case RMAP_RULE_MISSING:	  vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);	  return CMD_WARNING;	case RMAP_COMPILE_ERROR:	  /* rip, ripng and other protocols share the set metric command	     but only values from 0 to 16 are valid for rip and ripng	     if metric is out of range for rip and ripng, it is not for	     other protocols. Do not return an error */	  if (strcmp(command, "metric")) {	     vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);	     return CMD_WARNING;	  }	}    }  return CMD_SUCCESS;}
开发者ID:millken,项目名称:zhuxianB30,代码行数:28,


示例2: qos_cos_port_command

/** * Executes the qos_cos_port_command for the given port_name. */static intqos_cos_port_command(const char *port_name,        const char *cos_map_index){    if (port_name == NULL) {        vty_out(vty, "port_name cannot be NULL.%s", VTY_NEWLINE);        return CMD_OVSDB_FAILURE;    }    if (is_member_of_lag(port_name)) {        vty_out(vty, "QoS COS cannot be configured on a member of a LAG.%s",                VTY_NEWLINE);        return CMD_OVSDB_FAILURE;    }    struct ovsrec_port *port_row = port_row_for_name(port_name);    if (port_row == NULL) {        vty_out(vty, "Port %s does not exist.%s", port_name, VTY_NEWLINE);        return CMD_OVSDB_FAILURE;    }    const char *qos_trust_name = qos_trust_port_get_value(port_row);    if (qos_trust_name == NULL || strncmp(qos_trust_name,            QOS_TRUST_NONE_STRING, QOS_CLI_STRING_BUFFER_SIZE) != 0) {        vty_out(vty, "QoS COS override is only allowed/ if the trust mode is 'none'.%s",                VTY_NEWLINE);        return CMD_OVSDB_FAILURE;    }
开发者ID:open-switch,项目名称:ops-classifierd,代码行数:32,


示例3: if_flag_dump_vty

/* Printout flag information into vty */voidif_flag_dump_vty (struct vty *vty, unsigned long flag){  int separator = 0;#define IFF_OUT_VTY(X, Y) /  if ((X) && (flag & (X))) /    { /      if (separator) /	vty_out (vty, ","); /      else /	separator = 1; /      vty_out (vty, Y); /    }  vty_out (vty, "<");  IFF_OUT_VTY (IFF_UP, "UP");  IFF_OUT_VTY (IFF_BROADCAST, "BROADCAST");  IFF_OUT_VTY (IFF_DEBUG, "DEBUG");  IFF_OUT_VTY (IFF_LOOPBACK, "LOOPBACK");  IFF_OUT_VTY (IFF_POINTOPOINT, "POINTOPOINT");  IFF_OUT_VTY (IFF_NOTRAILERS, "NOTRAILERS");  IFF_OUT_VTY (IFF_RUNNING, "RUNNING");  IFF_OUT_VTY (IFF_NOARP, "NOARP");  IFF_OUT_VTY (IFF_PROMISC, "PROMISC");  IFF_OUT_VTY (IFF_ALLMULTI, "ALLMULTI");  IFF_OUT_VTY (IFF_OACTIVE, "OACTIVE");  IFF_OUT_VTY (IFF_SIMPLEX, "SIMPLEX");  IFF_OUT_VTY (IFF_LINK0, "LINK0");  IFF_OUT_VTY (IFF_LINK1, "LINK1");  IFF_OUT_VTY (IFF_LINK2, "LINK2");  IFF_OUT_VTY (IFF_MULTICAST, "MULTICAST");  vty_out (vty, ">");}
开发者ID:AllardJ,项目名称:Tomato,代码行数:35,


示例4: eigrp_route_set_add

/* Add eigrp route map rule. */static int eigrp_route_set_add(struct vty *vty, struct route_map_index *index,			       const char *command, const char *arg){	int ret;	ret = route_map_add_set(index, command, arg);	switch (ret) {	case RMAP_RULE_MISSING:		vty_out(vty, "%% Can't find rule./n");		return CMD_WARNING_CONFIG_FAILED;		break;	case RMAP_COMPILE_ERROR:		/*		 * rip, ripng and other protocols share the set metric command		 * but only values from 0 to 16 are valid for rip and ripng		 * if metric is out of range for rip and ripng, it is		 * not for other protocols. Do not return an error		 */		if (strcmp(command, "metric")) {			vty_out(vty, "%% Argument is malformed./n");			return CMD_WARNING_CONFIG_FAILED;		}		break;	case RMAP_COMPILE_SUCCESS:		break;	}	return CMD_SUCCESS;}
开发者ID:ton31337,项目名称:frr,代码行数:30,


示例5: ospf6_spf_display_subtree

voidospf6_spf_display_subtree (struct vty *vty, const char *prefix, int rest,                           struct ospf6_vertex *v){  struct listnode *node, *nnode;  struct ospf6_vertex *c;  char *next_prefix;  int len;  int restnum;  /* "prefix" is the space prefix of the display line */  vty_out (vty, "%s+-%s [%d]%s", prefix, v->name, v->cost, VNL);  len = strlen (prefix) + 4;  next_prefix = (char *) malloc (len);  if (next_prefix == NULL)    {      vty_out (vty, "malloc failed%s", VNL);      return;    }  snprintf (next_prefix, len, "%s%s", prefix, (rest ? "|  " : "   "));  restnum = listcount (v->child_list);  for (ALL_LIST_ELEMENTS (v->child_list, node, nnode, c))    {      restnum--;      ospf6_spf_display_subtree (vty, next_prefix, restnum, c);    }  free (next_prefix);}
开发者ID:Addision,项目名称:LVS,代码行数:31,


示例6: vty_hello

/* Say hello to vty interface. */voidvty_hello (vty_t *vty){	if (host.motdfile) {		FILE *f;		char buf[4096];		f = fopen(host.motdfile, "r");		if (f) {			while (fgets(buf, sizeof(buf), f)) {				char *s;				/* work backwards to ignore trailling isspace() */				for (s = buf + strlen(buf); (s > buf) && isspace((int)*(s - 1));				     s--);					*s = '/0';				vty_out(vty, "%s%s", buf, VTY_NEWLINE);			}			fclose (f);		} else {			vty_out(vty, "MOTD file not found%s", VTY_NEWLINE);		}	} else if (host.motd) {		vty_out(vty, "%s", host.motd);	}}
开发者ID:Am1GO,项目名称:keepalived,代码行数:26,


示例7: dump_trunk

static void dump_trunk(struct vty *vty, struct mgcp_trunk_config *cfg, int verbose){	int i;	vty_out(vty, "%s trunk nr %d with %d endpoints:%s",		cfg->trunk_type == MGCP_TRUNK_VIRTUAL ? "Virtual" : "E1",		cfg->trunk_nr, cfg->number_endpoints - 1, VTY_NEWLINE);	if (!cfg->endpoints) {		vty_out(vty, "No endpoints allocated yet.%s", VTY_NEWLINE);		return;	}	for (i = 1; i < cfg->number_endpoints; ++i) {		struct mgcp_endpoint *endp = &cfg->endpoints[i];		vty_out(vty,			" Endpoint 0x%.2x: CI: %d net: %u/%u bts: %u/%u on %s "			"traffic received bts: %u  remote: %u transcoder: %u/%u%s",			i, endp->ci,			ntohs(endp->net_end.rtp_port), ntohs(endp->net_end.rtcp_port),			ntohs(endp->bts_end.rtp_port), ntohs(endp->bts_end.rtcp_port),			inet_ntoa(endp->bts_end.addr),			endp->bts_end.packets, endp->net_end.packets,			endp->trans_net.packets, endp->trans_bts.packets,			VTY_NEWLINE);		if (verbose && endp->allocated) {			dump_rtp_end("Net->BTS", vty, &endp->bts_state, &endp->bts_end);			dump_rtp_end("BTS->Net", vty, &endp->net_state, &endp->net_end);		}	}}
开发者ID:unifycore,项目名称:openbsc,代码行数:32,


示例8: bgp_damp_info_vty

voidbgp_damp_info_vty (struct vty *vty, struct bgp_info *binfo)  {  struct bgp_damp_info *bdi;  time_t t_now, t_diff;  char timebuf[BGP_UPTIME_LEN];  int penalty;  if (!binfo->extra)    return;    /* BGP dampening information.  */  bdi = binfo->extra->damp_info;  /* If dampening is not enabled or there is no dampening information,     return immediately.  */  if (! damp || ! bdi)    return;  /* Calculate new penalty.  */  t_now = bgp_clock ();  t_diff = t_now - bdi->t_updated;  penalty = bgp_damp_decay (t_diff, bdi->penalty);  vty_out (vty, "      Dampinfo: penalty %d, flapped %d times in %s",           penalty, bdi->flap,	   peer_uptime (bdi->start_time, timebuf, BGP_UPTIME_LEN));  if (CHECK_FLAG (binfo->flags, BGP_INFO_DAMPED)      && ! CHECK_FLAG (binfo->flags, BGP_INFO_HISTORY))    vty_out (vty, ", reuse in %s",	     bgp_get_reuse_time (penalty, timebuf, BGP_UPTIME_LEN));  vty_out (vty, "%s", VTY_NEWLINE);}
开发者ID:ColinBS,项目名称:quagga-rtrlib,代码行数:35,


示例9: pim_msdp_config_write

/*********************** MSDP feature APIs *********************************/int pim_msdp_config_write(struct pim_instance *pim, struct vty *vty,			  const char *spaces){	struct listnode *mbrnode;	struct pim_msdp_mg_mbr *mbr;	struct pim_msdp_mg *mg = pim->msdp.mg;	char mbr_str[INET_ADDRSTRLEN];	char src_str[INET_ADDRSTRLEN];	int count = 0;	if (!mg) {		return count;	}	if (mg->src_ip.s_addr != INADDR_ANY) {		pim_inet4_dump("<src?>", mg->src_ip, src_str, sizeof(src_str));		vty_out(vty, "%sip msdp mesh-group %s source %s/n", spaces,			mg->mesh_group_name, src_str);		++count;	}	for (ALL_LIST_ELEMENTS_RO(mg->mbr_list, mbrnode, mbr)) {		pim_inet4_dump("<mbr?>", mbr->mbr_ip, mbr_str, sizeof(mbr_str));		vty_out(vty, "%sip msdp mesh-group %s member %s/n", spaces,			mg->mesh_group_name, mbr_str);		++count;	}	return count;}
开发者ID:ton31337,项目名称:frr,代码行数:30,


示例10: vty_dump_sne

static void vty_dump_sne(struct vty *vty, struct gprs_sndcp_entity *sne){	vty_out(vty, " TLLI %08x SAPI=%u NSAPI=%u:%s",		sne->lle->llme->tlli, sne->lle->sapi, sne->nsapi, VTY_NEWLINE);	vty_out(vty, "  Defrag: npdu=%u highest_seg=%u seg_have=0x%08x tot_len=%u%s",		sne->defrag.npdu, sne->defrag.highest_seg, sne->defrag.seg_have,		sne->defrag.tot_len, VTY_NEWLINE);}
开发者ID:DanielFrassinelli,项目名称:openbsc,代码行数:8,


示例11: usage

/* ----- wrong usage ----- */voidusage (struct vty *vty) {  vty_out (vty,"usage: X Y seed [-ll#i -lm#i -cl#i -p -pl#i -pm#i ...]%s",VTY_NEWLINE);  vty_out (vty,"help: -h or -hh%s",VTY_NEWLINE);  if ( np > 0 )    zlog_err ("error in parameter # %d/n/n", np );}
开发者ID:gvsurenderreddy,项目名称:quagga,代码行数:9,


示例12: _vty_output

static void _vty_output(struct log_target *tgt,			unsigned int level, const char *line){	struct vty *vty = tgt->tgt_vty.vty;	vty_out(vty, "%s", line);	/* This is an ugly hack, but there is no easy way... */	if (strchr(line, '/n'))		vty_out(vty, "/r");}
开发者ID:hamxa,项目名称:libosmocore,代码行数:9,


示例13: show_memory_vty

voidshow_memory_vty (struct vty *vty, struct memory_list *list){  struct memory_list *m;  for (m = list; m->index >= 0; m++)    if (m->index == 0)      vty_out (vty, "-----------------------------/r/n");    else      vty_out (vty, "%-22s: %5ld/r/n", m->format, mstat[m->index].alloc);}
开发者ID:antonywcl,项目名称:AR-5315u_PLD,代码行数:11,


示例14: cfc_cf_show_status

u_int32_t cfc_cf_show_status(struct vty *vty, cfc_show_status_info_t* stat_info){    if(CFC_MODULE_INACTIVE == stat_info->module_stat)    {        vty_out(vty, "performance status              off%s", VTY_NEWLINE);    }    else    {        vty_out(vty, "performance status              on%s", VTY_NEWLINE);        vty_out(vty, "performance para                %dM%s", stat_info->tot_flux, VTY_NEWLINE);    }    return ERROR_SUCCESS;    }
开发者ID:millken,项目名称:zhuxianB30,代码行数:13,


示例15: bgp_show_dampening_parameters

intbgp_show_dampening_parameters (struct vty *vty, afi_t afi, safi_t safi){  struct bgp *bgp;  bgp = bgp_get_default();  if (bgp == NULL)    {      vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);      return CMD_WARNING;    }  if (CHECK_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING))    {      vty_out (vty, "Half-life time: %ld min%s",                    damp->half_life / 60, VTY_NEWLINE);      vty_out (vty, "Reuse penalty: %d%s",                    damp->reuse_limit, VTY_NEWLINE);      vty_out (vty, "Suppress penalty: %d%s",                    damp->suppress_value, VTY_NEWLINE);      vty_out (vty, "Max suppress time: %ld min%s",                    damp->max_suppress_time / 60, VTY_NEWLINE);      vty_out (vty, "Max supress penalty: %u%s",                    damp->ceiling, VTY_NEWLINE);      vty_out (vty, "%s", VTY_NEWLINE);    }  else    vty_out (vty, "dampening not enabled for %s%s",                  afi == AFI_IP ? "IPv4" : "IPv6", VTY_NEWLINE);  return CMD_SUCCESS;}
开发者ID:ColinBS,项目名称:quagga-rtrlib,代码行数:32,


示例16: gbprox_vty_print_peer

static void gbprox_vty_print_peer(struct vty *vty, struct gbproxy_peer *peer){	struct gprs_ra_id raid;	gsm48_parse_ra(&raid, peer->ra);	vty_out(vty, "NSEI %5u, PTP-BVCI %5u, "		"RAI %u-%u-%u-%u",		peer->nsei, peer->bvci,		raid.mcc, raid.mnc, raid.lac, raid.rac);	if (peer->blocked)		vty_out(vty, " [BVC-BLOCKED]");	vty_out(vty, "%s", VTY_NEWLINE);}
开发者ID:unifycore,项目名称:openbsc,代码行数:14,


示例17: bfd_ioctl_peer_info

static intbfd_ioctl_peer_info (struct bfd_nl_peerinfo *peer, struct vty *vty){	char buf1[BUFSIZ], buf2[BUFSIZ];	vty_out (vty, "%s",	    inet_ntop (peer->dst.sa.sa_family,		peer->dst.sa.sa_family == AF_INET ?		(char *) &peer->dst.sin.sin_addr		: (char *) &peer->dst.sin6.sin6_addr, buf1, BUFSIZ));	vty_out (vty, "  %u %u  %s %s%s",	    ntohl (peer->my_disc),	    ntohl (peer->your_disc),	    bfd_state_string[peer->state],	    ifindex2ifname (peer->ifindex), VTY_NEWLINE);	vty_out (vty, "  SrcIP: %s%s",	    inet_ntop (peer->src.sa.sa_family,		peer->src.sa.sa_family == AF_INET ?		(char *) &peer->src.sin.sin_addr		: (char *) &peer->src.sin6.sin6_addr, buf2, BUFSIZ),	    VTY_NEWLINE);	vty_out (vty, "  Packet Rcvd: %llu%s", peer->pkt_in, VTY_NEWLINE);	vty_out (vty, "  Packet Send: %llu%s", peer->pkt_out, VTY_NEWLINE);	vty_out (vty, "  Last UpTime(sysUptime): %u%s", peer->last_up, VTY_NEWLINE);	vty_out (vty, "  Last DownTime(sysUptime): %u%s",	    peer->last_down, VTY_NEWLINE);	vty_out (vty, "  Up Count: %u%s", peer->up_cnt, VTY_NEWLINE);	return 0;}
开发者ID:thehajime,项目名称:zebra-manemo,代码行数:32,


示例18: isis_mpls_te_config_write_router

/* Specific MPLS TE router parameters write function */voidisis_mpls_te_config_write_router (struct vty *vty){  zlog_debug ("ISIS MPLS-TE: Write ISIS router configuration");  if (IS_MPLS_TE(isisMplsTE))    {      vty_out (vty, "  mpls-te on%s", VTY_NEWLINE);      vty_out (vty, "  mpls-te router-address %s%s",               inet_ntoa (isisMplsTE.router_id), VTY_NEWLINE);    }  return;}
开发者ID:KaloNK,项目名称:quagga,代码行数:16,


示例19: ospf6_area_show

voidospf6_area_show (struct vty *vty, struct ospf6_area *oa){  struct listnode *i;  struct ospf6_interface *oi;  vty_out (vty, " Area %s%s", oa->name, VNL);  vty_out (vty, "     Number of Area scoped LSAs is %u%s",           oa->lsdb->count, VNL);  vty_out (vty, "     Interface attached to this area:");  for (ALL_LIST_ELEMENTS_RO (oa->if_list, i, oi))    vty_out (vty, " %s", oi->interface->name);    vty_out (vty, "%s", VNL);}
开发者ID:Addision,项目名称:LVS,代码行数:16,


示例20: router_id_write

voidrouter_id_write (struct vty *vty){  if (rid_user_assigned.u.prefix4.s_addr)    vty_out (vty, "router-id %s%s", inet_ntoa (rid_user_assigned.u.prefix4),	     VTY_NEWLINE);}
开发者ID:Balaji-Parasuram,项目名称:quagga,代码行数:7,


示例21: ospf6_interface_register_metricfunction

static intospf6_interface_register_metricfunction (struct ospf6_interface *oi,					 struct vty *vty){  int err;  struct ospf6_interface_metricfunction *imf;  struct ospf6_interface_neighbor_metric_params nbrmetric_params = {    .name = metricfunction_name,    .delete = ospf6_interface_delete_metricfunction,    .config_write = ospf6_interface_config_write_metricfunction,    .nbrops = {      .create = ospf6_neighbor_create_metricfunction,    },  };  imf = XCALLOC (MTYPE_OSPF6_IF, sizeof (*imf));  nbrmetric_params.data = imf;  err =    ospf6_interface_register_neighbor_metric (oi, &metricfunction_nbrmetric_id,					      &nbrmetric_params, vty);  if (err)    {      vty_out (vty, "could not register neighbor metric %s on interface %s%s",	       nbrmetric_params.name, oi->interface->name, VNL);      XFREE (MTYPE_OSPF6_IF, imf);      return -1;    }  return 0;}
开发者ID:nskeeper,项目名称:ospf-manet-mdr,代码行数:31,


示例22: config_write_agentx

static intconfig_write_agentx (struct vty *vty){    if (agentx_enabled)        vty_out (vty, "agentx%s", VTY_NEWLINE);    return 0;}
开发者ID:nskeeper,项目名称:qpimd,代码行数:7,


示例23: print_acl_horizontal_rule

voidprint_acl_horizontal_rule(void){    vty_out(vty, "%s%s",        "-------------------------------------------------------------------------------",        VTY_NEWLINE);}
开发者ID:open-switch,项目名称:ops-classifierd,代码行数:7,


示例24: eigrp_nbr_hard_restart

/** * @fn eigrp_nbr_hard_restart * * @param[in]		nbr	Neighbor who would receive hard restart * @param[in]		vty Virtual terminal for log output * @return void * * @par * Function used for executing hard restart for neighbor: * Send Hello packet with Peer Termination TLV with * neighbor's address, set it's state to DOWN and delete the neighbor */void eigrp_nbr_hard_restart(struct eigrp_neighbor *nbr, struct vty *vty){	if(nbr == NULL)	{		zlog_err("Nbr Hard restart: Neighbor not specified.");		return;	}	zlog_debug ("Neighbor %s (%s) is down: manually cleared",			inet_ntoa (nbr->src),			ifindex2ifname (nbr->ei->ifp->ifindex));	if(vty != NULL)	{		vty_time_print (vty, 0);		vty_out (vty, "Neighbor %s (%s) is down: manually cleared%s",				inet_ntoa (nbr->src),				ifindex2ifname (nbr->ei->ifp->ifindex),				VTY_NEWLINE);	}	/* send Hello with Peer Termination TLV */	eigrp_hello_send(nbr->ei, EIGRP_HELLO_GRACEFUL_SHUTDOWN_NBR, &(nbr->src));	/* set neighbor to DOWN */	nbr->state = EIGRP_NEIGHBOR_DOWN;	/* delete neighbor */	eigrp_nbr_delete (nbr);}
开发者ID:janovic,项目名称:Quagga-EIGRP,代码行数:39,


示例25: fab_dump_per_route_elem

static voidfab_dump_per_route_elem(void *rt_arg, void *vty){    rt_path_elem_t *rt_elem = rt_arg;    vty_out(vty, "Node(%d):Link(%hu)->", rt_elem->sw_alias, rt_elem->link.la); }
开发者ID:bollaramya,项目名称:mul-cc,代码行数:7,


示例26: ospf6_neighbor_show_drchoice

voidospf6_neighbor_show_drchoice (struct vty *vty, struct ospf6_neighbor *on){  char router_id[16];  char drouter[16], bdrouter[16];  char duration[16];  struct timeval now, res;/*    vty_out (vty, "%-15s %6s/%-11s %-15s %-15s %s[%s]%s",             "RouterID", "State", "Duration", "DR", "BDR", "I/F",             "State", VNL);*/  inet_ntop (AF_INET, &on->router_id, router_id, sizeof (router_id));  inet_ntop (AF_INET, &on->drouter, drouter, sizeof (drouter));  inet_ntop (AF_INET, &on->bdrouter, bdrouter, sizeof (bdrouter));  gettimeofday (&now, NULL);  timersub (&now, &on->last_changed, &res);  timerstring (&res, duration, sizeof (duration));  vty_out (vty, "%-15s %6s/%-11s %-15s %-15s %s[%s]%s",           router_id, ospf6_neighbor_state_str[on->state],           duration, drouter, bdrouter, on->ospf6_if->interface->name,           ospf6_interface_state_str[on->ospf6_if->state],           VNL);}
开发者ID:AllardJ,项目名称:Tomato,代码行数:28,


示例27: ospf6_neighbor_show

/* show neighbor structure */voidospf6_neighbor_show (struct vty *vty, struct ospf6_neighbor *on){  char router_id[16];  char duration[16];  struct timeval now, res;  char nstate[16];  char deadtime[16];  long h, m, s;  /* Router-ID (Name) */  inet_ntop (AF_INET, &on->router_id, router_id, sizeof (router_id));#ifdef HAVE_GETNAMEINFO  {  }#endif /*HAVE_GETNAMEINFO*/  gettimeofday (&now, NULL);  /* Dead time */  h = m = s = 0;  if (on->inactivity_timer)    {      s = on->inactivity_timer->u.sands.tv_sec - now.tv_sec;      h = s / 3600;      s -= h * 3600;      m = s / 60;      s -= m * 60;    }  snprintf (deadtime, sizeof (deadtime), "%02ld:%02ld:%02ld", h, m, s);  /* Neighbor State */  if (if_is_pointopoint (on->ospf6_if->interface))    snprintf (nstate, sizeof (nstate), "PointToPoint");  else    {      if (on->router_id == on->drouter)        snprintf (nstate, sizeof (nstate), "DR");      else if (on->router_id == on->bdrouter)        snprintf (nstate, sizeof (nstate), "BDR");      else        snprintf (nstate, sizeof (nstate), "DROther");    }  /* Duration */  timersub (&now, &on->last_changed, &res);  timerstring (&res, duration, sizeof (duration));  /*  vty_out (vty, "%-15s %3d %11s %6s/%-12s %11s %s[%s]%s",           "Neighbor ID", "Pri", "DeadTime", "State", "", "Duration",           "I/F", "State", VNL);  */  vty_out (vty, "%-15s %3d %11s %6s/%-12s %11s %s[%s]%s",           router_id, on->priority, deadtime,           ospf6_neighbor_state_str[on->state], nstate, duration,           on->ospf6_if->interface->name,           ospf6_interface_state_str[on->ospf6_if->state], VNL);}
开发者ID:AllardJ,项目名称:Tomato,代码行数:61,



注:本文中的vty_out函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ vunmap函数代码示例
C++ vtos函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。