diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-06-21 05:10:57 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-06-29 19:31:28 +0200 |
commit | 96ade3ed7716c89b8047a1c0ab3377985d461cf8 (patch) | |
tree | 1c3061738c2c0027612b6cdb3e5d5eccb08587bf /ldpd | |
parent | lib: add vty_outln() (diff) | |
download | frr-96ade3ed7716c89b8047a1c0ab3377985d461cf8.tar.xz frr-96ade3ed7716c89b8047a1c0ab3377985d461cf8.zip |
*: use vty_outln
Saves 400 lines
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'ldpd')
-rw-r--r-- | ldpd/ldp_debug.c | 50 | ||||
-rw-r--r-- | ldpd/ldp_vty_conf.c | 201 | ||||
-rw-r--r-- | ldpd/ldp_vty_exec.c | 246 |
3 files changed, 232 insertions, 265 deletions
diff --git a/ldpd/ldp_debug.c b/ldpd/ldp_debug.c index 7915fb709..968e6e44c 100644 --- a/ldpd/ldp_debug.c +++ b/ldpd/ldp_debug.c @@ -105,33 +105,29 @@ ldp_vty_debug(struct vty *vty, int disable, const char *type_str, int ldp_vty_show_debugging(struct vty *vty) { - vty_out(vty, "LDP debugging status:%s", VTY_NEWLINE); + vty_outln (vty, "LDP debugging status:"); if (LDP_DEBUG(hello, HELLO_RECV)) - vty_out(vty, " LDP discovery debugging is on (inbound)%s", - VTY_NEWLINE); + vty_outln (vty," LDP discovery debugging is on (inbound)"); if (LDP_DEBUG(hello, HELLO_SEND)) - vty_out(vty, " LDP discovery debugging is on (outbound)%s", - VTY_NEWLINE); + vty_outln (vty," LDP discovery debugging is on (outbound)"); if (LDP_DEBUG(errors, ERRORS)) - vty_out(vty, " LDP errors debugging is on%s", VTY_NEWLINE); + vty_outln (vty, " LDP errors debugging is on"); if (LDP_DEBUG(event, EVENT)) - vty_out(vty, " LDP events debugging is on%s", VTY_NEWLINE); + vty_outln (vty, " LDP events debugging is on"); if (LDP_DEBUG(msg, MSG_RECV_ALL)) - vty_out(vty, " LDP detailed messages debugging is on " - "(inbound)%s", VTY_NEWLINE); + vty_outln (vty, + " LDP detailed messages debugging is on " "(inbound)"); else if (LDP_DEBUG(msg, MSG_RECV)) - vty_out(vty, " LDP messages debugging is on (inbound)%s", - VTY_NEWLINE); + vty_outln (vty," LDP messages debugging is on (inbound)"); if (LDP_DEBUG(msg, MSG_SEND_ALL)) - vty_out(vty, " LDP detailed messages debugging is on " - "(outbound)%s", VTY_NEWLINE); + vty_outln (vty, + " LDP detailed messages debugging is on " "(outbound)"); else if (LDP_DEBUG(msg, MSG_SEND)) - vty_out(vty, " LDP messages debugging is on (outbound)%s", - VTY_NEWLINE); + vty_outln (vty," LDP messages debugging is on (outbound)"); if (LDP_DEBUG(zebra, ZEBRA)) - vty_out(vty, " LDP zebra debugging is on%s", VTY_NEWLINE); - vty_out (vty, "%s", VTY_NEWLINE); + vty_outln (vty, " LDP zebra debugging is on"); + vty_outln (vty, ""); return (CMD_SUCCESS); } @@ -142,45 +138,43 @@ ldp_debug_config_write(struct vty *vty) int write = 0; if (CONF_LDP_DEBUG(hello, HELLO_RECV)) { - vty_out(vty, "debug mpls ldp discovery hello recv%s", - VTY_NEWLINE); + vty_outln (vty,"debug mpls ldp discovery hello recv"); write = 1; } if (CONF_LDP_DEBUG(hello, HELLO_SEND)) { - vty_out(vty, "debug mpls ldp discovery hello sent%s", - VTY_NEWLINE); + vty_outln (vty,"debug mpls ldp discovery hello sent"); write = 1; } if (CONF_LDP_DEBUG(errors, ERRORS)) { - vty_out(vty, "debug mpls ldp errors%s", VTY_NEWLINE); + vty_outln (vty, "debug mpls ldp errors"); write = 1; } if (CONF_LDP_DEBUG(event, EVENT)) { - vty_out(vty, "debug mpls ldp event%s", VTY_NEWLINE); + vty_outln (vty, "debug mpls ldp event"); write = 1; } if (CONF_LDP_DEBUG(msg, MSG_RECV_ALL)) { - vty_out(vty, "debug mpls ldp messages recv all%s", VTY_NEWLINE); + vty_outln (vty, "debug mpls ldp messages recv all"); write = 1; } else if (CONF_LDP_DEBUG(msg, MSG_RECV)) { - vty_out(vty, "debug mpls ldp messages recv%s", VTY_NEWLINE); + vty_outln (vty, "debug mpls ldp messages recv"); write = 1; } if (CONF_LDP_DEBUG(msg, MSG_SEND_ALL)) { - vty_out(vty, "debug mpls ldp messages sent all%s", VTY_NEWLINE); + vty_outln (vty, "debug mpls ldp messages sent all"); write = 1; } else if (CONF_LDP_DEBUG(msg, MSG_SEND)) { - vty_out(vty, "debug mpls ldp messages sent%s", VTY_NEWLINE); + vty_outln (vty, "debug mpls ldp messages sent"); write = 1; } if (CONF_LDP_DEBUG(zebra, ZEBRA)) { - vty_out(vty, "debug mpls ldp zebra%s", VTY_NEWLINE); + vty_outln (vty, "debug mpls ldp zebra"); write = 1; } diff --git a/ldpd/ldp_vty_conf.c b/ldpd/ldp_vty_conf.c index 532c880af..df57c3259 100644 --- a/ldpd/ldp_vty_conf.c +++ b/ldpd/ldp_vty_conf.c @@ -115,17 +115,17 @@ ldp_af_iface_config_write(struct vty *vty, int af) if (!ia->enabled) continue; - vty_out(vty, " !%s", VTY_NEWLINE); - vty_out(vty, " interface %s%s", iface->name, VTY_NEWLINE); + vty_outln (vty, " !"); + vty_outln (vty, " interface %s", iface->name); if (ia->hello_holdtime != LINK_DFLT_HOLDTIME && ia->hello_holdtime != 0) - vty_out(vty, " discovery hello holdtime %u%s", - ia->hello_holdtime, VTY_NEWLINE); + vty_outln (vty, " discovery hello holdtime %u", + ia->hello_holdtime); if (ia->hello_interval != DEFAULT_HELLO_INTERVAL && ia->hello_interval != 0) - vty_out(vty, " discovery hello interval %u%s", - ia->hello_interval, VTY_NEWLINE); + vty_outln (vty, " discovery hello interval %u", + ia->hello_interval); } } @@ -138,41 +138,41 @@ ldp_af_config_write(struct vty *vty, int af, struct ldpd_conf *conf, if (!(af_conf->flags & F_LDPD_AF_ENABLED)) return; - vty_out(vty, " !%s", VTY_NEWLINE); - vty_out(vty, " address-family %s%s", af_name(af), VTY_NEWLINE); + vty_outln (vty, " !"); + vty_outln (vty, " address-family %s", af_name(af)); if (af_conf->lhello_holdtime != LINK_DFLT_HOLDTIME && af_conf->lhello_holdtime != 0 ) - vty_out(vty, " discovery hello holdtime %u%s", - af_conf->lhello_holdtime, VTY_NEWLINE); + vty_outln (vty, " discovery hello holdtime %u", + af_conf->lhello_holdtime); if (af_conf->lhello_interval != DEFAULT_HELLO_INTERVAL && af_conf->lhello_interval != 0) - vty_out(vty, " discovery hello interval %u%s", - af_conf->lhello_interval, VTY_NEWLINE); + vty_outln (vty, " discovery hello interval %u", + af_conf->lhello_interval); if (af_conf->flags & F_LDPD_AF_THELLO_ACCEPT) { vty_out(vty, " discovery targeted-hello accept"); if (af_conf->acl_thello_accept_from[0] != '\0') vty_out(vty, " from %s", af_conf->acl_thello_accept_from); - vty_out(vty, "%s", VTY_NEWLINE); + vty_outln (vty, ""); } if (af_conf->thello_holdtime != TARGETED_DFLT_HOLDTIME && af_conf->thello_holdtime != 0) - vty_out(vty, " discovery targeted-hello holdtime %u%s", - af_conf->thello_holdtime, VTY_NEWLINE); + vty_outln (vty, " discovery targeted-hello holdtime %u", + af_conf->thello_holdtime); if (af_conf->thello_interval != DEFAULT_HELLO_INTERVAL && af_conf->thello_interval != 0) - vty_out(vty, " discovery targeted-hello interval %u%s", - af_conf->thello_interval, VTY_NEWLINE); + vty_outln (vty, " discovery targeted-hello interval %u", + af_conf->thello_interval); if (ldp_addrisset(af, &af_conf->trans_addr)) - vty_out(vty, " discovery transport-address %s%s", - log_addr(af, &af_conf->trans_addr), VTY_NEWLINE); - else - vty_out(vty, " ! Incomplete config, specify a discovery " - "transport-address%s", VTY_NEWLINE); + vty_outln (vty, " discovery transport-address %s", + log_addr(af, &af_conf->trans_addr)); + else + vty_outln (vty, + " ! Incomplete config, specify a discovery " "transport-address"); if ((af_conf->flags & F_LDPD_AF_ALLOCHOSTONLY) || af_conf->acl_label_allocate_for[0] != '\0') { @@ -182,7 +182,7 @@ ldp_af_config_write(struct vty *vty, int af, struct ldpd_conf *conf, else vty_out(vty, " for %s", af_conf->acl_label_allocate_for); - vty_out(vty, "%s", VTY_NEWLINE); + vty_outln (vty, ""); } if (af_conf->acl_label_advertise_for[0] != '\0' || @@ -194,7 +194,7 @@ ldp_af_config_write(struct vty *vty, int af, struct ldpd_conf *conf, if (af_conf->acl_label_advertise_for[0] != '\0') vty_out(vty, " for %s", af_conf->acl_label_advertise_for); - vty_out(vty, "%s", VTY_NEWLINE); + vty_outln (vty, ""); } if (af_conf->flags & F_LDPD_AF_EXPNULL) { @@ -202,7 +202,7 @@ ldp_af_config_write(struct vty *vty, int af, struct ldpd_conf *conf, if (af_conf->acl_label_expnull_for[0] != '\0') vty_out(vty, " for %s", af_conf->acl_label_expnull_for); - vty_out(vty, "%s", VTY_NEWLINE); + vty_outln (vty, ""); } if (af_conf->acl_label_accept_for[0] != '\0' || @@ -214,27 +214,26 @@ ldp_af_config_write(struct vty *vty, int af, struct ldpd_conf *conf, if (af_conf->acl_label_accept_for[0] != '\0') vty_out(vty, " for %s", af_conf->acl_label_accept_for); - vty_out(vty, "%s", VTY_NEWLINE); + vty_outln (vty, ""); } if (af_conf->flags & F_LDPD_AF_NO_GTSM) - vty_out(vty, " ttl-security disable%s", VTY_NEWLINE); + vty_outln (vty, " ttl-security disable"); if (af_conf->keepalive != DEFAULT_KEEPALIVE) - vty_out(vty, " session holdtime %u%s", af_conf->keepalive, - VTY_NEWLINE); + vty_outln (vty, " session holdtime %u",af_conf->keepalive); RB_FOREACH(tnbr, tnbr_head, &ldpd_conf->tnbr_tree) { if (tnbr->af == af) { - vty_out(vty, " !%s", VTY_NEWLINE); - vty_out(vty, " neighbor %s targeted%s", - log_addr(tnbr->af, &tnbr->addr), VTY_NEWLINE); + vty_outln (vty, " !"); + vty_outln (vty, " neighbor %s targeted", + log_addr(tnbr->af, &tnbr->addr)); } } ldp_af_iface_config_write(vty, af); - vty_out(vty, " !%s", VTY_NEWLINE); + vty_outln (vty, " !"); } int @@ -245,64 +244,61 @@ ldp_config_write(struct vty *vty) if (!(ldpd_conf->flags & F_LDPD_ENABLED)) return (0); - vty_out(vty, "mpls ldp%s", VTY_NEWLINE); + vty_outln (vty, "mpls ldp"); if (ldpd_conf->rtr_id.s_addr != 0) - vty_out(vty, " router-id %s%s", - inet_ntoa(ldpd_conf->rtr_id), VTY_NEWLINE); + vty_outln (vty, " router-id %s", + inet_ntoa(ldpd_conf->rtr_id)); if (ldpd_conf->lhello_holdtime != LINK_DFLT_HOLDTIME && ldpd_conf->lhello_holdtime != 0) - vty_out(vty, " discovery hello holdtime %u%s", - ldpd_conf->lhello_holdtime, VTY_NEWLINE); + vty_outln (vty, " discovery hello holdtime %u", + ldpd_conf->lhello_holdtime); if (ldpd_conf->lhello_interval != DEFAULT_HELLO_INTERVAL && ldpd_conf->lhello_interval != 0) - vty_out(vty, " discovery hello interval %u%s", - ldpd_conf->lhello_interval, VTY_NEWLINE); + vty_outln (vty, " discovery hello interval %u", + ldpd_conf->lhello_interval); if (ldpd_conf->thello_holdtime != TARGETED_DFLT_HOLDTIME && ldpd_conf->thello_holdtime != 0) - vty_out(vty, " discovery targeted-hello holdtime %u%s", - ldpd_conf->thello_holdtime, VTY_NEWLINE); + vty_outln (vty, " discovery targeted-hello holdtime %u", + ldpd_conf->thello_holdtime); if (ldpd_conf->thello_interval != DEFAULT_HELLO_INTERVAL && ldpd_conf->thello_interval != 0) - vty_out(vty, " discovery targeted-hello interval %u%s", - ldpd_conf->thello_interval, VTY_NEWLINE); + vty_outln (vty, " discovery targeted-hello interval %u", + ldpd_conf->thello_interval); if (ldpd_conf->trans_pref == DUAL_STACK_LDPOV4) - vty_out(vty, " dual-stack transport-connection prefer ipv4%s", - VTY_NEWLINE); + vty_outln (vty, + " dual-stack transport-connection prefer ipv4"); if (ldpd_conf->flags & F_LDPD_DS_CISCO_INTEROP) - vty_out(vty, " dual-stack cisco-interop%s", VTY_NEWLINE); + vty_outln (vty, " dual-stack cisco-interop"); RB_FOREACH(nbrp, nbrp_head, &ldpd_conf->nbrp_tree) { if (nbrp->flags & F_NBRP_KEEPALIVE) - vty_out(vty, " neighbor %s session holdtime %u%s", - inet_ntoa(nbrp->lsr_id), nbrp->keepalive, - VTY_NEWLINE); + vty_outln (vty, " neighbor %s session holdtime %u", + inet_ntoa(nbrp->lsr_id),nbrp->keepalive); if (nbrp->flags & F_NBRP_GTSM) { if (nbrp->gtsm_enabled) - vty_out(vty, " neighbor %s ttl-security hops " - "%u%s", inet_ntoa(nbrp->lsr_id), - nbrp->gtsm_hops, VTY_NEWLINE); + vty_outln (vty, " neighbor %s ttl-security hops " + "%u", inet_ntoa(nbrp->lsr_id), + nbrp->gtsm_hops); else - vty_out(vty, " neighbor %s ttl-security " - "disable%s", inet_ntoa(nbrp->lsr_id), - VTY_NEWLINE); + vty_outln (vty, " neighbor %s ttl-security " + "disable",inet_ntoa(nbrp->lsr_id)); } if (nbrp->auth.method == AUTH_MD5SIG) - vty_out(vty, " neighbor %s password %s%s", - inet_ntoa(nbrp->lsr_id), nbrp->auth.md5key, - VTY_NEWLINE); + vty_outln (vty, " neighbor %s password %s", + inet_ntoa(nbrp->lsr_id),nbrp->auth.md5key); } ldp_af_config_write(vty, AF_INET, ldpd_conf, &ldpd_conf->ipv4); ldp_af_config_write(vty, AF_INET6, ldpd_conf, &ldpd_conf->ipv6); - vty_out(vty, " !%s", VTY_NEWLINE); - vty_out(vty, "!%s", VTY_NEWLINE); + vty_outln (vty, " !"); + vty_outln (vty, "!"); return (1); } @@ -313,36 +309,34 @@ ldp_l2vpn_pw_config_write(struct vty *vty, struct l2vpn_pw *pw) int missing_lsrid = 0; int missing_pwid = 0; - vty_out(vty, " !%s", VTY_NEWLINE); - vty_out(vty, " member pseudowire %s%s", pw->ifname, VTY_NEWLINE); + vty_outln (vty, " !"); + vty_outln (vty, " member pseudowire %s", pw->ifname); if (pw->lsr_id.s_addr != INADDR_ANY) - vty_out(vty, " neighbor lsr-id %s%s", inet_ntoa(pw->lsr_id), - VTY_NEWLINE); - else - missing_lsrid = 1; + vty_outln (vty, " neighbor lsr-id %s",inet_ntoa(pw->lsr_id)); + else + missing_lsrid = 1; if (pw->flags & F_PW_STATIC_NBR_ADDR) - vty_out(vty, " neighbor address %s%s", log_addr(pw->af, - &pw->addr), VTY_NEWLINE); + vty_outln (vty, " neighbor address %s", + log_addr(pw->af, &pw->addr)); if (pw->pwid != 0) - vty_out(vty, " pw-id %u%s", pw->pwid, VTY_NEWLINE); + vty_outln (vty, " pw-id %u", pw->pwid); else missing_pwid = 1; if (!(pw->flags & F_PW_CWORD_CONF)) - vty_out(vty, " control-word exclude%s", VTY_NEWLINE); + vty_outln (vty, " control-word exclude"); if (!(pw->flags & F_PW_STATUSTLV_CONF)) - vty_out(vty, " pw-status disable%s", VTY_NEWLINE); + vty_outln (vty, " pw-status disable"); if (missing_lsrid) - vty_out(vty, " ! Incomplete config, specify a neighbor " - "lsr-id%s", VTY_NEWLINE); + vty_outln (vty, + " ! Incomplete config, specify a neighbor " "lsr-id"); if (missing_pwid) - vty_out(vty, " ! Incomplete config, specify a pw-id%s", - VTY_NEWLINE); + vty_outln (vty," ! Incomplete config, specify a pw-id"); } int @@ -353,29 +347,27 @@ ldp_l2vpn_config_write(struct vty *vty) struct l2vpn_pw *pw; RB_FOREACH(l2vpn, l2vpn_head, &ldpd_conf->l2vpn_tree) { - vty_out(vty, "l2vpn %s type vpls%s", l2vpn->name, VTY_NEWLINE); + vty_outln (vty, "l2vpn %s type vpls", l2vpn->name); if (l2vpn->pw_type != DEFAULT_PW_TYPE) - vty_out(vty, " vc type ethernet-tagged%s", VTY_NEWLINE); + vty_outln (vty, " vc type ethernet-tagged"); if (l2vpn->mtu != DEFAULT_L2VPN_MTU) - vty_out(vty, " mtu %u%s", l2vpn->mtu, VTY_NEWLINE); + vty_outln (vty, " mtu %u", l2vpn->mtu); if (l2vpn->br_ifname[0] != '\0') - vty_out(vty, " bridge %s%s", l2vpn->br_ifname, - VTY_NEWLINE); + vty_outln (vty, " bridge %s",l2vpn->br_ifname); RB_FOREACH(lif, l2vpn_if_head, &l2vpn->if_tree) - vty_out(vty, " member interface %s%s", lif->ifname, - VTY_NEWLINE); + vty_outln (vty, " member interface %s",lif->ifname); RB_FOREACH(pw, l2vpn_pw_head, &l2vpn->pw_tree) ldp_l2vpn_pw_config_write(vty, pw); RB_FOREACH(pw, l2vpn_pw_head, &l2vpn->pw_inactive_tree) ldp_l2vpn_pw_config_write(vty, pw); - vty_out(vty, " !%s", VTY_NEWLINE); - vty_out(vty, "!%s", VTY_NEWLINE); + vty_outln (vty, " !"); + vty_outln (vty, "!"); } return (0); @@ -481,7 +473,7 @@ ldp_vty_disc_holdtime(struct vty *vty, int disable, const char *hello_type_str, secs = strtol(seconds_str, &ep, 10); if (*ep != '\0' || secs < MIN_HOLDTIME || secs > MAX_HOLDTIME) { - vty_out(vty, "%% Invalid holdtime%s", VTY_NEWLINE); + vty_outln (vty, "%% Invalid holdtime"); return (CMD_WARNING); } @@ -576,7 +568,7 @@ ldp_vty_disc_interval(struct vty *vty, int disable, const char *hello_type_str, secs = strtol(seconds_str, &ep, 10); if (*ep != '\0' || secs < MIN_HELLO_INTERVAL || secs > MAX_HELLO_INTERVAL) { - vty_out(vty, "%% Invalid interval%s", VTY_NEWLINE); + vty_outln (vty, "%% Invalid interval"); return (CMD_WARNING); } @@ -694,13 +686,13 @@ ldp_vty_nbr_session_holdtime(struct vty *vty, int disable, if (inet_pton(AF_INET, lsr_id_str, &lsr_id) != 1 || bad_addr_v4(lsr_id)) { - vty_out(vty, "%% Malformed address%s", VTY_NEWLINE); + vty_outln (vty, "%% Malformed address"); return (CMD_WARNING); } secs = strtol(seconds_str, &ep, 10); if (*ep != '\0' || secs < MIN_KEEPALIVE || secs > MAX_KEEPALIVE) { - vty_out(vty, "%% Invalid holdtime%s", VTY_NEWLINE); + vty_outln (vty, "%% Invalid holdtime"); return (CMD_SUCCESS); } @@ -740,7 +732,7 @@ ldp_vty_af_session_holdtime(struct vty *vty, int disable, secs = strtol(seconds_str, &ep, 10); if (*ep != '\0' || secs < MIN_KEEPALIVE || secs > MAX_KEEPALIVE) { - vty_out(vty, "%% Invalid holdtime%s", VTY_NEWLINE); + vty_outln (vty, "%% Invalid holdtime"); return (CMD_SUCCESS); } @@ -786,8 +778,7 @@ ldp_vty_interface(struct vty *vty, int disable, const char *ifname) if (iface == NULL) { if (ldp_iface_is_configured(vty_conf, ifname)) { - vty_out(vty, "%% Interface is already in use%s", - VTY_NEWLINE); + vty_outln (vty,"%% Interface is already in use"); return (CMD_SUCCESS); } @@ -834,7 +825,7 @@ ldp_vty_trans_addr(struct vty *vty, int disable, const char *addr_str) else { if (inet_pton(af, addr_str, &af_conf->trans_addr) != 1 || bad_addr(af, &af_conf->trans_addr)) { - vty_out(vty, "%% Malformed address%s", VTY_NEWLINE); + vty_outln (vty, "%% Malformed address"); return (CMD_SUCCESS); } } @@ -855,11 +846,11 @@ ldp_vty_neighbor_targeted(struct vty *vty, int disable, const char *addr_str) if (inet_pton(af, addr_str, &addr) != 1 || bad_addr(af, &addr)) { - vty_out(vty, "%% Malformed address%s", VTY_NEWLINE); + vty_outln (vty, "%% Malformed address"); return (CMD_WARNING); } if (af == AF_INET6 && IN6_IS_SCOPE_EMBED(&addr.v6)) { - vty_out(vty, "%% Address can not be link-local%s", VTY_NEWLINE); + vty_outln (vty, "%% Address can not be link-local"); return (CMD_WARNING); } @@ -1031,7 +1022,7 @@ ldp_vty_router_id(struct vty *vty, int disable, const char *addr_str) else { if (inet_pton(AF_INET, addr_str, &vty_conf->rtr_id) != 1 || bad_addr_v4(vty_conf->rtr_id)) { - vty_out(vty, "%% Malformed address%s", VTY_NEWLINE); + vty_outln (vty, "%% Malformed address"); return (CMD_SUCCESS); } } @@ -1077,7 +1068,7 @@ ldp_vty_neighbor_password(struct vty *vty, int disable, const char *lsr_id_str, if (inet_pton(AF_INET, lsr_id_str, &lsr_id) != 1 || bad_addr_v4(lsr_id)) { - vty_out(vty, "%% Malformed address%s", VTY_NEWLINE); + vty_outln (vty, "%% Malformed address"); return (CMD_WARNING); } @@ -1123,14 +1114,14 @@ ldp_vty_neighbor_ttl_security(struct vty *vty, int disable, if (inet_pton(AF_INET, lsr_id_str, &lsr_id) != 1 || bad_addr_v4(lsr_id)) { - vty_out(vty, "%% Malformed address%s", VTY_NEWLINE); + vty_outln (vty, "%% Malformed address"); return (CMD_WARNING); } if (hops_str) { hops = strtol(hops_str, &ep, 10); if (*ep != '\0' || hops < 1 || hops > 254) { - vty_out(vty, "%% Invalid hop count%s", VTY_NEWLINE); + vty_outln (vty, "%% Invalid hop count"); return (CMD_SUCCESS); } } @@ -1235,7 +1226,7 @@ ldp_vty_l2vpn_mtu(struct vty *vty, int disable, const char *mtu_str) mtu = strtol(mtu_str, &ep, 10); if (*ep != '\0' || mtu < MIN_L2VPN_MTU || mtu > MAX_L2VPN_MTU) { - vty_out(vty, "%% Invalid MTU%s", VTY_NEWLINE); + vty_outln (vty, "%% Invalid MTU"); return (CMD_WARNING); } @@ -1295,7 +1286,7 @@ ldp_vty_l2vpn_interface(struct vty *vty, int disable, const char *ifname) return (CMD_SUCCESS); if (ldp_iface_is_configured(vty_conf, ifname)) { - vty_out(vty, "%% Interface is already in use%s", VTY_NEWLINE); + vty_outln (vty, "%% Interface is already in use"); return (CMD_SUCCESS); } @@ -1338,7 +1329,7 @@ ldp_vty_l2vpn_pseudowire(struct vty *vty, int disable, const char *ifname) } if (ldp_iface_is_configured(vty_conf, ifname)) { - vty_out(vty, "%% Interface is already in use%s", VTY_NEWLINE); + vty_outln (vty, "%% Interface is already in use"); return (CMD_SUCCESS); } @@ -1382,7 +1373,7 @@ ldp_vty_l2vpn_pw_nbr_addr(struct vty *vty, int disable, const char *addr_str) if (ldp_get_address(addr_str, &af, &addr) == -1 || bad_addr(af, &addr)) { - vty_out(vty, "%% Malformed address%s", VTY_NEWLINE); + vty_outln (vty, "%% Malformed address"); return (CMD_WARNING); } @@ -1409,7 +1400,7 @@ ldp_vty_l2vpn_pw_nbr_id(struct vty *vty, int disable, const char *lsr_id_str) if (inet_pton(AF_INET, lsr_id_str, &lsr_id) != 1 || bad_addr_v4(lsr_id)) { - vty_out(vty, "%% Malformed address%s", VTY_NEWLINE); + vty_outln (vty, "%% Malformed address"); return (CMD_WARNING); } @@ -1432,7 +1423,7 @@ ldp_vty_l2vpn_pw_pwid(struct vty *vty, int disable, const char *pwid_str) pwid = strtol(pwid_str, &ep, 10); if (*ep != '\0' || pwid < MIN_PWID_ID || pwid > MAX_PWID_ID) { - vty_out(vty, "%% Invalid pw-id%s", VTY_NEWLINE); + vty_outln (vty, "%% Invalid pw-id"); return (CMD_WARNING); } diff --git a/ldpd/ldp_vty_exec.c b/ldpd/ldp_vty_exec.c index 252abd17f..60779c46e 100644 --- a/ldpd/ldp_vty_exec.c +++ b/ldpd/ldp_vty_exec.c @@ -128,14 +128,14 @@ show_interface_msg(struct vty *vty, struct imsg *imsg, snprintf(timers, sizeof(timers), "%u/%u", iface->hello_interval, iface->hello_holdtime); - vty_out(vty, "%-4s %-11s %-6s %-8s %-12s %3u%s", + vty_outln (vty, "%-4s %-11s %-6s %-8s %-12s %3u", af_name(iface->af), iface->name, if_state_name(iface->state), iface->uptime == 0 ? "00:00:00" : log_time(iface->uptime), timers, - iface->adj_cnt, VTY_NEWLINE); + iface->adj_cnt); break; case IMSG_CTL_END: - vty_out(vty, "%s", VTY_NEWLINE); + vty_outln (vty, ""); return (1); default: break; @@ -214,10 +214,10 @@ show_discovery_msg(struct vty *vty, struct imsg *imsg, vty_out(vty, "%s%46s", VTY_NEWLINE, " "); break; } - vty_out(vty, "%9u%s", adj->holdtime, VTY_NEWLINE); + vty_outln (vty, "%9u", adj->holdtime); break; case IMSG_CTL_END: - vty_out(vty, "%s", VTY_NEWLINE); + vty_outln (vty, ""); return (1); default: break; @@ -313,23 +313,20 @@ show_discovery_detail_msg(struct vty *vty, struct imsg *imsg, break; case IMSG_CTL_END: rtr_id.s_addr = ldp_rtr_id_get(ldpd_conf); - vty_out(vty, "Local:%s", VTY_NEWLINE); - vty_out(vty, " LSR Id: %s:0%s", inet_ntoa(rtr_id), - VTY_NEWLINE); + vty_outln (vty, "Local:"); + vty_outln (vty, " LSR Id: %s:0",inet_ntoa(rtr_id)); if (ldpd_conf->ipv4.flags & F_LDPD_AF_ENABLED) - vty_out(vty, " Transport Address (IPv4): %s%s", - log_addr(AF_INET, &ldpd_conf->ipv4.trans_addr), - VTY_NEWLINE); + vty_outln (vty, " Transport Address (IPv4): %s", + log_addr(AF_INET, &ldpd_conf->ipv4.trans_addr)); if (ldpd_conf->ipv6.flags & F_LDPD_AF_ENABLED) - vty_out(vty, " Transport Address (IPv6): %s%s", - log_addr(AF_INET6, &ldpd_conf->ipv6.trans_addr), - VTY_NEWLINE); - vty_out(vty, "Discovery Sources:%s", VTY_NEWLINE); - vty_out(vty, " Interfaces:%s", VTY_NEWLINE); + vty_outln (vty, " Transport Address (IPv6): %s", + log_addr(AF_INET6, &ldpd_conf->ipv6.trans_addr)); + vty_outln (vty, "Discovery Sources:"); + vty_outln (vty, " Interfaces:"); vty_out(vty, "%s", ifaces_buffer); - vty_out(vty, " Targeted Hellos:%s", VTY_NEWLINE); + vty_outln (vty, " Targeted Hellos:"); vty_out(vty, "%s", tnbrs_buffer); - vty_out(vty, "%s", VTY_NEWLINE); + vty_outln (vty, ""); return (1); default: break; @@ -515,7 +512,7 @@ show_nbr_msg(struct vty *vty, struct imsg *imsg, struct show_params *params) nbr_state_name(nbr->nbr_state), addr); if (strlen(addr) > 15) vty_out(vty, "%s%48s", VTY_NEWLINE, " "); - vty_out(vty, " %8s%s", log_time(nbr->uptime), VTY_NEWLINE); + vty_outln (vty, " %8s", log_time(nbr->uptime)); break; case IMSG_CTL_END: return (1); @@ -560,45 +557,42 @@ show_nbr_detail_msg(struct vty *vty, struct imsg *imsg, v4adjs_buffer[0] = '\0'; v6adjs_buffer[0] = '\0'; - vty_out(vty, "Peer LDP Identifier: %s:0%s", inet_ntoa(nbr->id), - VTY_NEWLINE); - vty_out(vty, " TCP connection: %s:%u - %s:%u%s", + vty_outln (vty, "Peer LDP Identifier: %s:0", + inet_ntoa(nbr->id)); + vty_outln (vty, " TCP connection: %s:%u - %s:%u", log_addr(nbr->af, &nbr->laddr), ntohs(nbr->lport), - log_addr(nbr->af, &nbr->raddr), ntohs(nbr->rport), - VTY_NEWLINE); - vty_out(vty, " Authentication: %s%s", - (nbr->auth_method == AUTH_MD5SIG) ? "TCP MD5 Signature" : - "none", VTY_NEWLINE); - vty_out(vty, " Session Holdtime: %u secs; " - "KeepAlive interval: %u secs%s", nbr->holdtime, - nbr->holdtime / KEEPALIVE_PER_PERIOD, VTY_NEWLINE); - vty_out(vty, " State: %s; Downstream-Unsolicited%s", - nbr_state_name(nbr->nbr_state), VTY_NEWLINE); - vty_out(vty, " Up time: %s%s", log_time(nbr->uptime), - VTY_NEWLINE); + log_addr(nbr->af, &nbr->raddr),ntohs(nbr->rport)); + vty_outln (vty, " Authentication: %s", + (nbr->auth_method == AUTH_MD5SIG) ? "TCP MD5 Signature" : "none"); + vty_outln(vty, " Session Holdtime: %u secs; " + "KeepAlive interval: %u secs", nbr->holdtime, + nbr->holdtime / KEEPALIVE_PER_PERIOD); + vty_outln(vty, " State: %s; Downstream-Unsolicited", + nbr_state_name(nbr->nbr_state)); + vty_outln (vty, " Up time: %s",log_time(nbr->uptime)); stats = &nbr->stats; - vty_out(vty, " Messages sent/rcvd:%s", VTY_NEWLINE); - vty_out(vty, " - Keepalive Messages: %u/%u%s", - stats->kalive_sent, stats->kalive_rcvd, VTY_NEWLINE); - vty_out(vty, " - Address Messages: %u/%u%s", - stats->addr_sent, stats->addr_rcvd, VTY_NEWLINE); - vty_out(vty, " - Address Withdraw Messages: %u/%u%s", - stats->addrwdraw_sent, stats->addrwdraw_rcvd, VTY_NEWLINE); - vty_out(vty, " - Notification Messages: %u/%u%s", - stats->notif_sent, stats->notif_rcvd, VTY_NEWLINE); - vty_out(vty, " - Capability Messages: %u/%u%s", - stats->capability_sent, stats->capability_rcvd, VTY_NEWLINE); - vty_out(vty, " - Label Mapping Messages: %u/%u%s", - stats->labelmap_sent, stats->labelmap_rcvd, VTY_NEWLINE); - vty_out(vty, " - Label Request Messages: %u/%u%s", - stats->labelreq_sent, stats->labelreq_rcvd, VTY_NEWLINE); - vty_out(vty, " - Label Withdraw Messages: %u/%u%s", - stats->labelwdraw_sent, stats->labelwdraw_rcvd, VTY_NEWLINE); - vty_out(vty, " - Label Release Messages: %u/%u%s", - stats->labelrel_sent, stats->labelrel_rcvd, VTY_NEWLINE); - vty_out(vty, " - Label Abort Request Messages: %u/%u%s", - stats->labelabreq_sent, stats->labelabreq_rcvd, VTY_NEWLINE); + vty_outln (vty, " Messages sent/rcvd:"); + vty_outln (vty, " - Keepalive Messages: %u/%u", + stats->kalive_sent, stats->kalive_rcvd); + vty_outln (vty, " - Address Messages: %u/%u", + stats->addr_sent, stats->addr_rcvd); + vty_outln (vty, " - Address Withdraw Messages: %u/%u", + stats->addrwdraw_sent, stats->addrwdraw_rcvd); + vty_outln (vty, " - Notification Messages: %u/%u", + stats->notif_sent, stats->notif_rcvd); + vty_outln (vty, " - Capability Messages: %u/%u", + stats->capability_sent, stats->capability_rcvd); + vty_outln (vty, " - Label Mapping Messages: %u/%u", + stats->labelmap_sent, stats->labelmap_rcvd); + vty_outln (vty, " - Label Request Messages: %u/%u", + stats->labelreq_sent, stats->labelreq_rcvd); + vty_outln (vty, " - Label Withdraw Messages: %u/%u", + stats->labelwdraw_sent, stats->labelwdraw_rcvd); + vty_outln (vty, " - Label Release Messages: %u/%u", + stats->labelrel_sent, stats->labelrel_rcvd); + vty_outln (vty, " - Label Abort Request Messages: %u/%u", + stats->labelabreq_sent, stats->labelabreq_rcvd); show_nbr_capabilities(vty, nbr); break; @@ -617,16 +611,16 @@ show_nbr_detail_msg(struct vty *vty, struct imsg *imsg, } break; case IMSG_CTL_SHOW_NBR_END: - vty_out(vty, " LDP Discovery Sources:%s", VTY_NEWLINE); + vty_outln (vty, " LDP Discovery Sources:"); if (v4adjs_buffer[0] != '\0') { - vty_out(vty, " IPv4:%s", VTY_NEWLINE); + vty_outln (vty, " IPv4:"); vty_out(vty, "%s", v4adjs_buffer); } if (v6adjs_buffer[0] != '\0') { - vty_out(vty, " IPv6:%s", VTY_NEWLINE); + vty_outln (vty, " IPv6:"); vty_out(vty, "%s", v6adjs_buffer); } - vty_out(vty, "%s", VTY_NEWLINE); + vty_outln (vty, ""); break; case IMSG_CTL_END: return (1); @@ -875,20 +869,18 @@ show_nbr_detail_msg_json(struct imsg *imsg, struct show_params *params, void show_nbr_capabilities(struct vty *vty, struct ctl_nbr *nbr) { - vty_out(vty, " Capabilities Sent:%s" + vty_outln (vty, " Capabilities Sent:%s" " - Dynamic Announcement (0x0506)%s" " - Typed Wildcard (0x050B)%s" - " - Unrecognized Notification (0x0603)%s", - VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE); - vty_out(vty, " Capabilities Received:%s", VTY_NEWLINE); + " - Unrecognized Notification (0x0603)", + VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE); + vty_outln (vty, " Capabilities Received:"); if (nbr->flags & F_NBR_CAP_DYNAMIC) - vty_out(vty, " - Dynamic Announcement (0x0506)%s", - VTY_NEWLINE); + vty_outln (vty," - Dynamic Announcement (0x0506)"); if (nbr->flags & F_NBR_CAP_TWCARD) - vty_out(vty, " - Typed Wildcard (0x050B)%s", VTY_NEWLINE); + vty_outln (vty, " - Typed Wildcard (0x050B)"); if (nbr->flags & F_NBR_CAP_UNOTIF) - vty_out(vty, " - Unrecognized Notification (0x0603)%s", - VTY_NEWLINE); + vty_outln (vty," - Unrecognized Notification (0x0603)"); } static int @@ -903,13 +895,13 @@ show_nbr_capabilities_msg(struct vty *vty, struct imsg *imsg, struct show_params if (nbr->nbr_state != NBR_STA_OPER) break; - vty_out(vty, "Peer LDP Identifier: %s:0%s", inet_ntoa(nbr->id), - VTY_NEWLINE); + vty_outln (vty, "Peer LDP Identifier: %s:0", + inet_ntoa(nbr->id)); show_nbr_capabilities(vty, nbr); - vty_out(vty, "%s", VTY_NEWLINE); + vty_outln (vty, ""); break; case IMSG_CTL_END: - vty_out(vty, "%s", VTY_NEWLINE); + vty_outln (vty, ""); return (1); default: break; @@ -1030,12 +1022,12 @@ show_lib_msg(struct vty *vty, struct imsg *imsg, struct show_params *params) vty_out(vty, "%-4s %-20s", af_name(rt->af), dstnet); if (strlen(dstnet) > 20) vty_out(vty, "%s%25s", VTY_NEWLINE, " "); - vty_out(vty, " %-15s %-11s %-13s %6s%s", inet_ntoa(rt->nexthop), + vty_outln (vty, " %-15s %-11s %-13s %6s", inet_ntoa(rt->nexthop), log_label(rt->local_label), log_label(rt->remote_label), - rt->in_use ? "yes" : "no", VTY_NEWLINE); + rt->in_use ? "yes" : "no"); break; case IMSG_CTL_END: - vty_out(vty, "%s", VTY_NEWLINE); + vty_outln (vty, ""); return (1); default: break; @@ -1077,9 +1069,9 @@ show_lib_detail_msg(struct vty *vty, struct imsg *imsg, struct show_params *para snprintf(dstnet, sizeof(dstnet), "%s/%d", log_addr(rt->af, &rt->prefix), rt->prefixlen); - vty_out(vty, "%s%s", dstnet, VTY_NEWLINE); - vty_out(vty, "%-8sLocal binding: label: %s%s", "", - log_label(rt->local_label), VTY_NEWLINE); + vty_outln (vty, "%s", dstnet); + vty_outln (vty, "%-8sLocal binding: label: %s", "", + log_label(rt->local_label)); break; case IMSG_CTL_SHOW_LIB_SENT: upstream = 1; @@ -1097,18 +1089,17 @@ show_lib_detail_msg(struct vty *vty, struct imsg *imsg, struct show_params *para break; case IMSG_CTL_SHOW_LIB_END: if (upstream) { - vty_out(vty, "%-8sAdvertised to:%s", "", VTY_NEWLINE); + vty_outln (vty, "%-8sAdvertised to:", ""); vty_out(vty, "%s", sent_buffer); } if (downstream) { - vty_out(vty, "%-8sRemote bindings:%s", "", VTY_NEWLINE); + vty_outln (vty, "%-8sRemote bindings:", ""); vty_out(vty, "%s", rcvd_buffer); } else - vty_out(vty, "%-8sNo remote bindings%s", "", - VTY_NEWLINE); + vty_outln (vty, "%-8sNo remote bindings",""); break; case IMSG_CTL_END: - vty_out(vty, "%s", VTY_NEWLINE); + vty_outln (vty, ""); return (1); default: break; @@ -1244,39 +1235,33 @@ show_l2vpn_binding_msg(struct vty *vty, struct imsg *imsg, case IMSG_CTL_SHOW_L2VPN_BINDING: pw = imsg->data; - vty_out(vty, " Destination Address: %s, VC ID: %u%s", - inet_ntoa(pw->lsr_id), pw->pwid, VTY_NEWLINE); + vty_outln (vty, " Destination Address: %s, VC ID: %u", + inet_ntoa(pw->lsr_id), pw->pwid); /* local binding */ if (pw->local_label != NO_LABEL) { - vty_out(vty, " Local Label: %u%s", pw->local_label, - VTY_NEWLINE); - vty_out(vty, "%-8sCbit: %u, VC Type: %s, " - "GroupID: %u%s", "", pw->local_cword, - pw_type_name(pw->type), pw->local_gid, - VTY_NEWLINE); - vty_out(vty, "%-8sMTU: %u%s", "", pw->local_ifmtu, - VTY_NEWLINE); + vty_outln (vty, " Local Label: %u", + pw->local_label); + vty_outln (vty, "%-8sCbit: %u, VC Type: %s, " + "GroupID: %u", "", pw->local_cword, + pw_type_name(pw->type),pw->local_gid); + vty_outln (vty, "%-8sMTU: %u", "",pw->local_ifmtu); } else - vty_out(vty, " Local Label: unassigned%s", - VTY_NEWLINE); + vty_outln (vty," Local Label: unassigned"); /* remote binding */ if (pw->remote_label != NO_LABEL) { - vty_out(vty, " Remote Label: %u%s", - pw->remote_label, VTY_NEWLINE); - vty_out(vty, "%-8sCbit: %u, VC Type: %s, " - "GroupID: %u%s", "", pw->remote_cword, - pw_type_name(pw->type), pw->remote_gid, - VTY_NEWLINE); - vty_out(vty, "%-8sMTU: %u%s", "", pw->remote_ifmtu, - VTY_NEWLINE); + vty_outln (vty, " Remote Label: %u", + pw->remote_label); + vty_outln (vty, "%-8sCbit: %u, VC Type: %s, " + "GroupID: %u", "", pw->remote_cword, + pw_type_name(pw->type),pw->remote_gid); + vty_outln (vty, "%-8sMTU: %u", "",pw->remote_ifmtu); } else - vty_out(vty, " Remote Label: unassigned%s", - VTY_NEWLINE); + vty_outln (vty," Remote Label: unassigned"); break; case IMSG_CTL_END: - vty_out(vty, "%s", VTY_NEWLINE); + vty_outln (vty, ""); return (1); default: break; @@ -1355,12 +1340,12 @@ show_l2vpn_pw_msg(struct vty *vty, struct imsg *imsg, struct show_params *params case IMSG_CTL_SHOW_L2VPN_PW: pw = imsg->data; - vty_out(vty, "%-9s %-15s %-10u %-16s %-10s%s", pw->ifname, + vty_outln (vty, "%-9s %-15s %-10u %-16s %-10s", pw->ifname, inet_ntoa(pw->lsr_id), pw->pwid, pw->l2vpn_name, - (pw->status ? "UP" : "DOWN"), VTY_NEWLINE); + (pw->status ? "UP" : "DOWN")); break; case IMSG_CTL_END: - vty_out(vty, "%s", VTY_NEWLINE); + vty_outln (vty, ""); return (1); default: break; @@ -1555,8 +1540,8 @@ ldp_vty_dispatch(struct vty *vty, struct imsgbuf *ibuf, enum show_command cmd, done: close(ibuf->fd); if (json) { - vty_out(vty, "%s%s", json_object_to_json_string_ext(json, - JSON_C_TO_STRING_PRETTY), VTY_NEWLINE); + vty_outln (vty, "%s", + json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } @@ -1599,9 +1584,9 @@ ldp_vty_show_binding(struct vty *vty, const char *af_str, int detail, int json) params.json = json; if (!params.detail && !params.json) - vty_out(vty, "%-4s %-20s %-15s %-11s %-13s %6s%s", "AF", + vty_outln (vty, "%-4s %-20s %-15s %-11s %-13s %6s", "AF", "Destination", "Nexthop", "Local Label", "Remote Label", - "In Use", VTY_NEWLINE); + "In Use"); imsg_compose(&ibuf, IMSG_CTL_SHOW_LIB, 0, 0, -1, NULL, 0); return (ldp_vty_dispatch(vty, &ibuf, SHOW_LIB, ¶ms)); @@ -1627,8 +1612,8 @@ ldp_vty_show_discovery(struct vty *vty, const char *af_str, int detail, params.json = json; if (!params.detail && !params.json) - vty_out(vty, "%-4s %-15s %-8s %-15s %9s%s", - "AF", "ID", "Type", "Source", "Holdtime", VTY_NEWLINE); + vty_outln (vty, "%-4s %-15s %-8s %-15s %9s", + "AF", "ID", "Type", "Source", "Holdtime"); if (params.detail) imsg_compose(&ibuf, IMSG_CTL_SHOW_DISCOVERY_DTL, 0, 0, -1, @@ -1658,9 +1643,8 @@ ldp_vty_show_interface(struct vty *vty, const char *af_str, int json) /* header */ if (!params.json) { - vty_out(vty, "%-4s %-11s %-6s %-8s %-12s %3s%s", "AF", - "Interface", "State", "Uptime", "Hello Timers", "ac", - VTY_NEWLINE); + vty_outln (vty, "%-4s %-11s %-6s %-8s %-12s %3s", "AF", + "Interface", "State", "Uptime", "Hello Timers","ac"); } imsg_compose(&ibuf, IMSG_CTL_SHOW_INTERFACE, 0, 0, -1, &ifidx, @@ -1704,18 +1688,18 @@ ldp_vty_show_capabilities(struct vty *vty, int json) "0x0603"); json_object_array_add(json_array, json_cap); - vty_out(vty, "%s%s", json_object_to_json_string_ext(json, - JSON_C_TO_STRING_PRETTY), VTY_NEWLINE); + vty_outln (vty, "%s", + json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); return (0); } - vty_out(vty, + vty_outln (vty, "Supported LDP Capabilities%s" " * Dynamic Announcement (0x0506)%s" " * Typed Wildcard (0x050B)%s" - " * Unrecognized Notification (0x0603)%s%s", VTY_NEWLINE, - VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE); + " * Unrecognized Notification (0x0603)%s", VTY_NEWLINE, + VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE); return (0); } @@ -1738,9 +1722,8 @@ ldp_vty_show_neighbor(struct vty *vty, int capabilities, int detail, int json) params.detail = 1; if (!params.detail && !params.json) - vty_out(vty, "%-4s %-15s %-11s %-15s %8s%s", - "AF", "ID", "State", "Remote Address", "Uptime", - VTY_NEWLINE); + vty_outln (vty, "%-4s %-15s %-11s %-15s %8s", + "AF", "ID", "State", "Remote Address","Uptime"); imsg_compose(&ibuf, IMSG_CTL_SHOW_NBR, 0, 0, -1, NULL, 0); return (ldp_vty_dispatch(vty, &ibuf, SHOW_NBR, ¶ms)); @@ -1776,12 +1759,11 @@ ldp_vty_show_atom_vc(struct vty *vty, int json) if (!params.json) { /* header */ - vty_out(vty, "%-9s %-15s %-10s %-16s %-10s%s", - "Interface", "Peer ID", "VC ID", "Name", "Status", - VTY_NEWLINE); - vty_out(vty, "%-9s %-15s %-10s %-16s %-10s%s", + vty_outln (vty, "%-9s %-15s %-10s %-16s %-10s", + "Interface", "Peer ID", "VC ID", "Name","Status"); + vty_outln (vty, "%-9s %-15s %-10s %-16s %-10s", "---------", "---------------", "----------", - "----------------", "----------", VTY_NEWLINE); + "----------------", "----------"); } imsg_compose(&ibuf, IMSG_CTL_SHOW_L2VPN_PW, 0, 0, -1, NULL, 0); @@ -1798,7 +1780,7 @@ ldp_vty_clear_nbr(struct vty *vty, const char *addr_str) if (addr_str && (ldp_get_address(addr_str, &nbr.af, &nbr.raddr) == -1 || bad_addr(nbr.af, &nbr.raddr))) { - vty_out(vty, "%% Malformed address%s", VTY_NEWLINE); + vty_outln (vty, "%% Malformed address"); return (CMD_WARNING); } |