diff options
author | Russ White <russ@riw.us> | 2017-07-14 14:00:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-14 14:00:43 +0200 |
commit | 28bd1c1158c10268655878d12e5d8f17737de1bb (patch) | |
tree | 576ef3527922cd2a0fec59fadf1cff947e8f2079 | |
parent | Merge pull request #762 from bingen/mutiple_nh_recursive_levels (diff) | |
parent | lib, vtysh: remove now-useless newline arg (diff) | |
download | frr-28bd1c1158c10268655878d12e5d8f17737de1bb.tar.xz frr-28bd1c1158c10268655878d12e5d8f17737de1bb.zip |
Merge pull request #813 from opensourcerouting/newline-redux
newline redux
146 files changed, 4947 insertions, 5178 deletions
diff --git a/COMMUNITY.md b/COMMUNITY.md index b0d087c38..8ab6a624e 100644 --- a/COMMUNITY.md +++ b/COMMUNITY.md @@ -401,3 +401,15 @@ maintenance overhead/cost. It is also important to keep in mind, existing code includes code that may reside in private repositories (and is yet to be submitted) or code that has yet to be migrated from Quagga to FRR. + +That said, compatibility measures can (and should) be removed when either: + +* they become a significant burden, e.g. when data structures change and + the compatibility measure would need a complex adaptation layer or becomes + flat-out impossible +* some measure of time (dependent on the specific case) has passed, so that + the compatibility grace period is considered expired. + +In all cases, compatibility pieces should be marked with compiler/preprocessor +annotations to print warnings at compile time, pointing to the appropriate +update path. A `-Werror` build should fail if compatibility bits are used. diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c index d14c4d847..1ae33b3a2 100644 --- a/babeld/babel_interface.c +++ b/babeld/babel_interface.c @@ -290,7 +290,7 @@ DEFUN (babel_network, ret = babel_enable_if_add (argv[1]->arg); if (ret < 0) { - vty_outln (vty, "There is same network configuration %s", + vty_out (vty, "There is same network configuration %s\n", argv[1]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -318,7 +318,7 @@ DEFUN (no_babel_network, ret = babel_enable_if_delete (argv[2]->arg); if (ret < 0) { - vty_outln (vty, "can't find network %s",argv[2]->arg); + vty_out (vty, "can't find network %s\n",argv[2]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -861,31 +861,31 @@ show_babel_interface_sub (struct vty *vty, struct interface *ifp) int is_up; babel_interface_nfo *babel_ifp; - vty_outln (vty, "%s is %s", ifp->name, + vty_out (vty, "%s is %s\n", ifp->name, ((is_up = if_is_operative(ifp)) ? "up" : "down")); - vty_outln (vty, " ifindex %u, MTU %u bytes %s", + vty_out (vty, " ifindex %u, MTU %u bytes %s\n", ifp->ifindex, MIN(ifp->mtu, ifp->mtu6), if_flag_dump(ifp->flags)); if (!IS_ENABLE(ifp)) { - vty_outln (vty, " Babel protocol is not enabled on this interface"); + vty_out (vty, " Babel protocol is not enabled on this interface\n"); return; } if (!is_up) { - vty_outln (vty, - " Babel protocol is enabled, but not running on this interface"); + vty_out (vty, + " Babel protocol is enabled, but not running on this interface\n"); return; } babel_ifp = babel_get_if_nfo (ifp); - vty_outln (vty, " Babel protocol is running on this interface"); - vty_outln (vty, " Operating mode is \"%s\"", + vty_out (vty, " Babel protocol is running on this interface\n"); + vty_out (vty, " Operating mode is \"%s\"\n", CHECK_FLAG(babel_ifp->flags, BABEL_IF_WIRED) ? "wired" : "wireless"); - vty_outln (vty, " Split horizon mode is %s", + vty_out (vty, " Split horizon mode is %s\n", CHECK_FLAG(babel_ifp->flags, BABEL_IF_SPLIT_HORIZON) ? "On" : "Off"); - vty_outln (vty, " Hello interval is %u ms", babel_ifp->hello_interval); - vty_outln (vty, " Update interval is %u ms", babel_ifp->update_interval); - vty_outln (vty, " Rxcost multiplier is %u", babel_ifp->cost); + vty_out (vty, " Hello interval is %u ms\n", babel_ifp->hello_interval); + vty_out (vty, " Update interval is %u ms\n", babel_ifp->update_interval); + vty_out (vty, " Rxcost multiplier is %u\n", babel_ifp->cost); } DEFUN (show_babel_interface, @@ -907,7 +907,7 @@ DEFUN (show_babel_interface, } if ((ifp = if_lookup_by_name (argv[3]->arg, VRF_DEFAULT)) == NULL) { - vty_outln (vty, "No such interface name"); + vty_out (vty, "No such interface name\n"); return CMD_WARNING; } show_babel_interface_sub (vty, ifp); @@ -917,9 +917,9 @@ DEFUN (show_babel_interface, static void show_babel_neighbour_sub (struct vty *vty, struct neighbour *neigh) { - vty_outln (vty, + vty_out (vty, "Neighbour %s dev %s reach %04x rxcost %d txcost %d " - "rtt %s rttcost %d%s.", + "rtt %s rttcost %d%s.\n", format_address(neigh->address), neigh->ifp->name, neigh->reach, @@ -949,7 +949,7 @@ DEFUN (show_babel_neighbour, } if ((ifp = if_lookup_by_name (argv[3]->arg, VRF_DEFAULT)) == NULL) { - vty_outln (vty, "No such interface name"); + vty_out (vty, "No such interface name\n"); return CMD_WARNING; } FOR_ALL_NEIGHBOURS(neigh) { @@ -1009,9 +1009,9 @@ show_babel_routes_sub(struct babel_route *route, struct vty *vty, channels[0] = '\0'; } - vty_outln (vty, + vty_out (vty, "%s metric %d refmetric %d id %s seqno %d%s age %d " - "via %s neigh %s%s%s%s", + "via %s neigh %s%s%s%s\n", format_prefix(route->src->prefix, route->src->plen), route_metric(route), route->refmetric, format_eui64(route->src->id), @@ -1032,7 +1032,7 @@ show_babel_xroutes_sub (struct xroute *xroute, struct vty *vty, if(prefix && !babel_prefix_eq(prefix, xroute->prefix, xroute->plen)) return; - vty_outln (vty, "%s metric %d (exported)", + vty_out (vty, "%s metric %d (exported)\n", format_prefix(xroute->prefix, xroute->plen), xroute->metric); } @@ -1089,7 +1089,7 @@ DEFUN (show_babel_route_prefix, ret = str2prefix(argv[3]->arg, &prefix); if(ret == 0) { - vty_outln (vty, "%% Malformed address"); + vty_out (vty, "%% Malformed address\n"); return CMD_WARNING; } @@ -1138,7 +1138,7 @@ DEFUN (show_babel_route_addr, ret = inet_aton (argv[3]->arg, &addr); if (ret <= 0) { - vty_outln (vty, "%% Malformed address"); + vty_out (vty, "%% Malformed address\n"); return CMD_WARNING; } @@ -1147,7 +1147,7 @@ DEFUN (show_babel_route_addr, ret = str2prefix(buf, &prefix); if (ret == 0) { - vty_outln (vty, "%% Parse error -- this shouldn't happen"); + vty_out (vty, "%% Parse error -- this shouldn't happen\n"); return CMD_WARNING; } @@ -1196,7 +1196,7 @@ DEFUN (show_babel_route_addr6, ret = inet_pton (AF_INET6, argv[3]->arg, &addr); if (ret <= 0) { - vty_outln (vty, "%% Malformed address"); + vty_out (vty, "%% Malformed address\n"); return CMD_WARNING; } @@ -1206,7 +1206,7 @@ DEFUN (show_babel_route_addr6, ret = str2prefix(buf, &prefix); if (ret == 0) { - vty_outln (vty, "%% Parse error -- this shouldn't happen"); + vty_out (vty, "%% Parse error -- this shouldn't happen\n"); return CMD_WARNING; } @@ -1244,9 +1244,9 @@ DEFUN (show_babel_parameters, "Babel information\n" "Configuration information\n") { - vty_outln (vty, " -- Babel running configuration --"); + vty_out (vty, " -- Babel running configuration --\n"); show_babel_main_configuration(vty); - vty_outln (vty, " -- distribution lists --"); + vty_out (vty, " -- distribution lists --\n"); config_show_distribute(vty); return CMD_SUCCESS; @@ -1321,63 +1321,63 @@ interface_config_write (struct vty *vty) int write = 0; for (ALL_LIST_ELEMENTS_RO (vrf_iflist(VRF_DEFAULT), node, ifp)) { - vty_outln (vty, "interface %s",ifp->name); + vty_out (vty, "interface %s\n",ifp->name); if (ifp->desc) - vty_outln (vty, " description %s",ifp->desc); + vty_out (vty, " description %s\n",ifp->desc); babel_interface_nfo *babel_ifp = babel_get_if_nfo (ifp); /* wireless is the default*/ if (CHECK_FLAG (babel_ifp->flags, BABEL_IF_WIRED)) { - vty_outln (vty, " babel wired"); + vty_out (vty, " babel wired\n"); write++; } if (babel_ifp->hello_interval != BABEL_DEFAULT_HELLO_INTERVAL) { - vty_outln (vty, " babel hello-interval %u", + vty_out (vty, " babel hello-interval %u\n", babel_ifp->hello_interval); write++; } if (babel_ifp->update_interval != BABEL_DEFAULT_UPDATE_INTERVAL) { - vty_outln (vty, " babel update-interval %u", + vty_out (vty, " babel update-interval %u\n", babel_ifp->update_interval); write++; } /* Some parameters have different defaults for wired/wireless. */ if (CHECK_FLAG (babel_ifp->flags, BABEL_IF_WIRED)) { if (!CHECK_FLAG (babel_ifp->flags, BABEL_IF_SPLIT_HORIZON)) { - vty_outln (vty, " no babel split-horizon"); + vty_out (vty, " no babel split-horizon\n"); write++; } if (babel_ifp->cost != BABEL_DEFAULT_RXCOST_WIRED) { - vty_outln (vty, " babel rxcost %u", babel_ifp->cost); + vty_out (vty, " babel rxcost %u\n", babel_ifp->cost); write++; } if (babel_ifp->channel == BABEL_IF_CHANNEL_INTERFERING) { - vty_outln (vty, " babel channel interfering"); + vty_out (vty, " babel channel interfering\n"); write++; } else if(babel_ifp->channel != BABEL_IF_CHANNEL_NONINTERFERING) { - vty_outln (vty, " babel channel %d",babel_ifp->channel); + vty_out (vty, " babel channel %d\n",babel_ifp->channel); write++; } } else { if (CHECK_FLAG (babel_ifp->flags, BABEL_IF_SPLIT_HORIZON)) { - vty_outln (vty, " babel split-horizon"); + vty_out (vty, " babel split-horizon\n"); write++; } if (babel_ifp->cost != BABEL_DEFAULT_RXCOST_WIRELESS) { - vty_outln (vty, " babel rxcost %u", babel_ifp->cost); + vty_out (vty, " babel rxcost %u\n", babel_ifp->cost); write++; } if (babel_ifp->channel == BABEL_IF_CHANNEL_NONINTERFERING) { - vty_outln (vty, " babel channel noninterfering"); + vty_out (vty, " babel channel noninterfering\n"); write++; } else if(babel_ifp->channel != BABEL_IF_CHANNEL_INTERFERING) { - vty_outln (vty, " babel channel %d",babel_ifp->channel); + vty_out (vty, " babel channel %d\n",babel_ifp->channel); write++; } } - vty_outln (vty, "!"); + vty_out (vty, "!\n"); write++; } return write; @@ -1393,7 +1393,7 @@ babel_enable_if_config_write (struct vty * vty) for (i = 0; i < vector_active (babel_enable_if); i++) if ((str = vector_slot (babel_enable_if, i)) != NULL) { - vty_outln (vty, " network %s", str); + vty_out (vty, " network %s\n", str); lines++; } return lines; diff --git a/babeld/babel_main.c b/babeld/babel_main.c index eb2909b40..517489f15 100644 --- a/babeld/babel_main.c +++ b/babeld/babel_main.c @@ -377,25 +377,22 @@ babel_save_state_file(void) void show_babel_main_configuration (struct vty *vty) { - vty_outln (vty, - "state file = %s%s" - "configuration file = %s%s" - "protocol informations:%s" - " multicast address = %s%s" - " port = %d%s" - "vty address = %s%s" - "vty port = %d%s" - "id = %s%s" - "kernel_metric = %d", - state_file, VTYNL, + vty_out (vty, + "state file = %s\n" + "configuration file = %s\n" + "protocol informations:\n" + " multicast address = %s\n" + " port = %d\n" + "vty address = %s\n" + "vty port = %d\n" + "id = %s\n" + "kernel_metric = %d\n", + state_file, babel_config_file ? babel_config_file : babel_config_default, - VTYNL, - VTYNL, - format_address(protocol_group), VTYNL, - protocol_port, VTYNL, + format_address(protocol_group), + protocol_port, babel_vty_addr ? babel_vty_addr : "None", - VTYNL, - babel_vty_port, VTYNL, - format_eui64(myid), VTYNL, + babel_vty_port, + format_eui64(myid), kernel_metric); } diff --git a/babeld/babel_zebra.c b/babeld/babel_zebra.c index a3217076f..52d7eaee8 100644 --- a/babeld/babel_zebra.c +++ b/babeld/babel_zebra.c @@ -222,7 +222,7 @@ DEFUN (babel_redistribute_type, type = babel_proto_redistnum(argv[1]->arg); if (type < 0) { - vty_outln (vty, "Invalid type %s", argv[1]->arg); + vty_out (vty, "Invalid type %s\n", argv[1]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -244,7 +244,7 @@ DEFUN (no_babel_redistribute_type, type = babel_proto_redistnum(argv[2]->arg); if (type < 0) { - vty_outln (vty, "Invalid type %s", argv[2]->arg); + vty_out (vty, "Invalid type %s\n", argv[2]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -279,7 +279,7 @@ DEFUN (debug_babel, } } - vty_outln (vty, "Invalid type %s", argv[2]->arg); + vty_out (vty, "Invalid type %s\n", argv[2]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -309,7 +309,7 @@ DEFUN (no_debug_babel, } } - vty_outln (vty, "Invalid type %s", argv[3]->arg); + vty_out (vty, "Invalid type %s\n", argv[3]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -326,7 +326,7 @@ debug_babel_config_write (struct vty * vty) if (debug == BABEL_DEBUG_ALL) { - vty_outln (vty, "debug babel all"); + vty_out (vty, "debug babel all\n"); lines++; } else @@ -337,12 +337,12 @@ debug_babel_config_write (struct vty * vty) && CHECK_FLAG (debug, debug_type[i].type) ) { - vty_outln (vty, "debug babel %s", debug_type[i].str); + vty_out (vty, "debug babel %s\n", debug_type[i].str); lines++; } if (lines) { - vty_outln (vty, "!"); + vty_out (vty, "!\n"); lines++; } return lines; @@ -386,13 +386,13 @@ zebra_config_write (struct vty *vty) { if (! zclient->enable) { - vty_outln (vty, "no router zebra"); + vty_out (vty, "no router zebra\n"); return 1; } else if (! vrf_bitmap_check (zclient->redist[AFI_IP][ZEBRA_ROUTE_BABEL], VRF_DEFAULT)) { - vty_outln (vty, "router zebra"); - vty_outln (vty, " no redistribute babel"); + vty_out (vty, "router zebra\n"); + vty_out (vty, " no redistribute babel\n"); return 1; } return 0; diff --git a/babeld/babeld.c b/babeld/babeld.c index e17e00ca5..b2f8176aa 100644 --- a/babeld/babeld.c +++ b/babeld/babeld.c @@ -83,25 +83,25 @@ babel_config_write (struct vty *vty) if (!babel_routing_process) return lines; - vty_outln (vty, "router babel"); + vty_out (vty, "router babel\n"); if (diversity_kind != DIVERSITY_NONE) { - vty_outln (vty, " babel diversity"); + vty_out (vty, " babel diversity\n"); lines++; } if (diversity_factor != BABEL_DEFAULT_DIVERSITY_FACTOR) { - vty_outln (vty, " babel diversity-factor %d",diversity_factor); + vty_out (vty, " babel diversity-factor %d\n",diversity_factor); lines++; } if (resend_delay != BABEL_DEFAULT_RESEND_DELAY) { - vty_outln (vty, " babel resend-delay %u", resend_delay); + vty_out (vty, " babel resend-delay %u\n", resend_delay); lines++; } if (smoothing_half_life != BABEL_DEFAULT_SMOOTHING_HALF_LIFE) { - vty_outln (vty, " babel smoothing-half-life %u", + vty_out (vty, " babel smoothing-half-life %u\n", smoothing_half_life); lines++; } @@ -112,7 +112,7 @@ babel_config_write (struct vty *vty) if (i != zclient->redist_default && vrf_bitmap_check (zclient->redist[AFI_IP][i], VRF_DEFAULT)) { - vty_outln (vty, " redistribute %s", zebra_route_string(i)); + vty_out (vty, " redistribute %s\n", zebra_route_string(i)); lines++; } diff --git a/bgpd/bgp_aspath.c b/bgpd/bgp_aspath.c index f304b3a1b..95257493b 100644 --- a/bgpd/bgp_aspath.c +++ b/bgpd/bgp_aspath.c @@ -2176,7 +2176,7 @@ aspath_show_all_iterator (struct hash_backet *backet, struct vty *vty) as = (struct aspath *) backet->data; vty_out (vty, "[%p:%u] (%ld) ", (void *)backet, backet->key, as->refcnt); - vty_outln (vty, "%s", as->str); + vty_out (vty, "%s\n", as->str); } /* Print all aspath and hash information. This function is used from diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index 439469d61..0114834c5 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -797,7 +797,7 @@ attr_show_all_iterator (struct hash_backet *backet, struct vty *vty) { struct attr *attr = backet->data; - vty_outln (vty, "attr[%ld] nexthop %s", attr->refcnt, + vty_out (vty, "attr[%ld] nexthop %s\n", attr->refcnt, inet_ntoa(attr->nexthop)); } diff --git a/bgpd/bgp_bfd.c b/bgpd/bgp_bfd.c index 1aa2b93a9..bb0a0fc63 100644 --- a/bgpd/bgp_bfd.c +++ b/bgpd/bgp_bfd.c @@ -526,17 +526,17 @@ bgp_bfd_peer_config_write(struct vty *vty, struct peer *peer, char *addr) bfd_info = (struct bfd_info *)peer->bfd_info; if (CHECK_FLAG (bfd_info->flags, BFD_FLAG_PARAM_CFG)) - vty_outln (vty, " neighbor %s bfd %d %d %d", addr, + vty_out (vty, " neighbor %s bfd %d %d %d\n", addr, bfd_info->detect_mult, bfd_info->required_min_rx, bfd_info->desired_min_tx); if (bfd_info->type != BFD_TYPE_NOT_CONFIGURED) - vty_outln (vty, " neighbor %s bfd %s", addr, + vty_out (vty, " neighbor %s bfd %s\n", addr, (bfd_info->type == BFD_TYPE_MULTIHOP) ? "multihop" : "singlehop"); if (!CHECK_FLAG (bfd_info->flags, BFD_FLAG_PARAM_CFG) && (bfd_info->type == BFD_TYPE_NOT_CONFIGURED)) - vty_outln (vty, " neighbor %s bfd", addr); + vty_out (vty, " neighbor %s bfd\n", addr); } /* diff --git a/bgpd/bgp_damp.c b/bgpd/bgp_damp.c index d5a89c1ff..d276de6eb 100644 --- a/bgpd/bgp_damp.c +++ b/bgpd/bgp_damp.c @@ -525,15 +525,15 @@ bgp_config_write_damp (struct vty *vty) && bgp_damp_cfg.reuse_limit == DEFAULT_REUSE && bgp_damp_cfg.suppress_value == DEFAULT_SUPPRESS && bgp_damp_cfg.max_suppress_time == bgp_damp_cfg.half_life*4) - vty_outln (vty, " bgp dampening"); + vty_out (vty, " bgp dampening\n"); else if (bgp_damp_cfg.half_life != DEFAULT_HALF_LIFE*60 && bgp_damp_cfg.reuse_limit == DEFAULT_REUSE && bgp_damp_cfg.suppress_value == DEFAULT_SUPPRESS && bgp_damp_cfg.max_suppress_time == bgp_damp_cfg.half_life*4) - vty_outln (vty, " bgp dampening %lld", + vty_out (vty, " bgp dampening %lld\n", bgp_damp_cfg.half_life / 60LL); else - vty_outln (vty, " bgp dampening %lld %d %d %lld", + vty_out (vty, " bgp dampening %lld %d %d %lld\n", bgp_damp_cfg.half_life/60LL, bgp_damp_cfg.reuse_limit, bgp_damp_cfg.suppress_value, @@ -652,7 +652,7 @@ bgp_damp_info_vty (struct vty *vty, struct bgp_info *binfo, vty_out (vty, ", reuse in %s", bgp_get_reuse_time (penalty, timebuf, BGP_UPTIME_LEN, 0, json_path)); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } @@ -691,26 +691,26 @@ bgp_show_dampening_parameters (struct vty *vty, afi_t afi, safi_t safi) if (bgp == NULL) { - vty_outln (vty, "No BGP process is configured"); + vty_out (vty, "No BGP process is configured\n"); return CMD_WARNING; } if (CHECK_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING)) { - vty_outln (vty, "Half-life time: %lld min", + vty_out (vty, "Half-life time: %lld min\n", (long long)damp->half_life / 60); - vty_outln (vty, "Reuse penalty: %d", + vty_out (vty, "Reuse penalty: %d\n", damp->reuse_limit); - vty_outln (vty, "Suppress penalty: %d", + vty_out (vty, "Suppress penalty: %d\n", damp->suppress_value); - vty_outln (vty, "Max suppress time: %lld min", + vty_out (vty, "Max suppress time: %lld min\n", (long long)damp->max_suppress_time / 60); - vty_outln (vty, "Max supress penalty: %u", + vty_out (vty, "Max supress penalty: %u\n", damp->ceiling); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } else - vty_outln (vty, "dampening not enabled for %s", + vty_out (vty, "dampening not enabled for %s\n", afi == AFI_IP ? "IPv4" : "IPv6"); return CMD_SUCCESS; diff --git a/bgpd/bgp_debug.c b/bgpd/bgp_debug.c index 78a337bd8..e45b5ab4e 100644 --- a/bgpd/bgp_debug.c +++ b/bgpd/bgp_debug.c @@ -254,7 +254,7 @@ bgp_debug_list_print (struct vty *vty, const char *desc, struct list *list) } } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } /* Print the command to enable the debug for each peer/prefix this debug is @@ -274,14 +274,14 @@ bgp_debug_list_conf_print (struct vty *vty, const char *desc, struct list *list) { if (filter->host) { - vty_outln (vty, "%s %s", desc, filter->host); + vty_out (vty, "%s %s\n", desc, filter->host); write++; } if (filter->p) { - vty_outln (vty, "%s %s/%d", desc, + vty_out (vty, "%s %s/%d\n", desc, inet_ntop (filter->p->family, &filter->p->u.prefix, buf, INET6_ADDRSTRLEN), filter->p->prefixlen); write++; @@ -291,7 +291,7 @@ bgp_debug_list_conf_print (struct vty *vty, const char *desc, struct list *list) if (!write) { - vty_outln (vty, "%s", desc); + vty_out (vty, "%s\n", desc); write++; } @@ -583,7 +583,7 @@ DEFUN (debug_bgp_as4, else { TERM_DEBUG_ON (as4, AS4); - vty_outln (vty, "BGP as4 debugging is on"); + vty_out (vty, "BGP as4 debugging is on\n"); } return CMD_SUCCESS; } @@ -601,7 +601,7 @@ DEFUN (no_debug_bgp_as4, else { TERM_DEBUG_OFF (as4, AS4); - vty_outln (vty, "BGP as4 debugging is off"); + vty_out (vty, "BGP as4 debugging is off\n"); } return CMD_SUCCESS; } @@ -619,7 +619,7 @@ DEFUN (debug_bgp_as4_segment, else { TERM_DEBUG_ON (as4, AS4_SEGMENT); - vty_outln (vty, "BGP as4 segment debugging is on"); + vty_out (vty, "BGP as4 segment debugging is on\n"); } return CMD_SUCCESS; } @@ -638,7 +638,7 @@ DEFUN (no_debug_bgp_as4_segment, else { TERM_DEBUG_OFF (as4, AS4_SEGMENT); - vty_outln (vty, "BGP as4 segment debugging is off"); + vty_out (vty, "BGP as4 segment debugging is off\n"); } return CMD_SUCCESS; } @@ -658,7 +658,7 @@ DEFUN (debug_bgp_neighbor_events, else { TERM_DEBUG_ON (neighbor_events, NEIGHBOR_EVENTS); - vty_outln (vty, "BGP neighbor-events debugging is on"); + vty_out (vty, "BGP neighbor-events debugging is on\n"); } return CMD_SUCCESS; } @@ -681,7 +681,7 @@ DEFUN (debug_bgp_neighbor_events_peer, if (bgp_debug_list_has_entry(bgp_debug_neighbor_events_peers, host, NULL)) { - vty_outln (vty, "BGP neighbor-events debugging is already enabled for %s", + vty_out (vty, "BGP neighbor-events debugging is already enabled for %s\n", host); return CMD_SUCCESS; } @@ -693,7 +693,7 @@ DEFUN (debug_bgp_neighbor_events_peer, else { TERM_DEBUG_ON (neighbor_events, NEIGHBOR_EVENTS); - vty_outln (vty, "BGP neighbor-events debugging is on for %s", host); + vty_out (vty, "BGP neighbor-events debugging is on for %s\n", host); } return CMD_SUCCESS; } @@ -713,7 +713,7 @@ DEFUN (no_debug_bgp_neighbor_events, else { TERM_DEBUG_OFF (neighbor_events, NEIGHBOR_EVENTS); - vty_outln (vty, "BGP neighbor-events debugging is off"); + vty_out (vty, "BGP neighbor-events debugging is off\n"); } return CMD_SUCCESS; } @@ -747,9 +747,9 @@ DEFUN (no_debug_bgp_neighbor_events_peer, } if (found_peer) - vty_outln (vty, "BGP neighbor-events debugging is off for %s", host); + vty_out (vty, "BGP neighbor-events debugging is off for %s\n", host); else - vty_outln (vty, "BGP neighbor-events debugging was not enabled for %s", + vty_out (vty, "BGP neighbor-events debugging was not enabled for %s\n", host); return CMD_SUCCESS; @@ -768,7 +768,7 @@ DEFUN (debug_bgp_nht, else { TERM_DEBUG_ON (nht, NHT); - vty_outln (vty, "BGP nexthop tracking debugging is on"); + vty_out (vty, "BGP nexthop tracking debugging is on\n"); } return CMD_SUCCESS; } @@ -786,7 +786,7 @@ DEFUN (no_debug_bgp_nht, else { TERM_DEBUG_OFF (nht, NHT); - vty_outln (vty, "BGP nexthop tracking debugging is off"); + vty_out (vty, "BGP nexthop tracking debugging is off\n"); } return CMD_SUCCESS; } @@ -806,7 +806,7 @@ DEFUN (debug_bgp_keepalive, else { TERM_DEBUG_ON (keepalive, KEEPALIVE); - vty_outln (vty, "BGP keepalives debugging is on"); + vty_out (vty, "BGP keepalives debugging is on\n"); } return CMD_SUCCESS; } @@ -829,7 +829,7 @@ DEFUN (debug_bgp_keepalive_peer, if (bgp_debug_list_has_entry(bgp_debug_keepalive_peers, host, NULL)) { - vty_outln (vty, "BGP keepalive debugging is already enabled for %s", + vty_out (vty, "BGP keepalive debugging is already enabled for %s\n", host); return CMD_SUCCESS; } @@ -841,7 +841,7 @@ DEFUN (debug_bgp_keepalive_peer, else { TERM_DEBUG_ON (keepalive, KEEPALIVE); - vty_outln (vty, "BGP keepalives debugging is on for %s", host); + vty_out (vty, "BGP keepalives debugging is on for %s\n", host); } return CMD_SUCCESS; } @@ -861,7 +861,7 @@ DEFUN (no_debug_bgp_keepalive, else { TERM_DEBUG_OFF (keepalive, KEEPALIVE); - vty_outln (vty, "BGP keepalives debugging is off"); + vty_out (vty, "BGP keepalives debugging is off\n"); } return CMD_SUCCESS; } @@ -895,9 +895,9 @@ DEFUN (no_debug_bgp_keepalive_peer, } if (found_peer) - vty_outln (vty, "BGP keepalives debugging is off for %s", host); + vty_out (vty, "BGP keepalives debugging is off for %s\n", host); else - vty_outln (vty, "BGP keepalives debugging was not enabled for %s", host); + vty_out (vty, "BGP keepalives debugging was not enabled for %s\n", host); return CMD_SUCCESS; } @@ -922,7 +922,7 @@ DEFPY (debug_bgp_bestpath_prefix, if (bgp_debug_list_has_entry(bgp_debug_bestpath_prefixes, NULL, bestpath)) { - vty_outln (vty, "BGP bestpath debugging is already enabled for %s", bestpath_str); + vty_out (vty, "BGP bestpath debugging is already enabled for %s\n", bestpath_str); return CMD_SUCCESS; } @@ -935,7 +935,7 @@ DEFPY (debug_bgp_bestpath_prefix, else { TERM_DEBUG_ON (bestpath, BESTPATH); - vty_outln (vty, "BGP bestpath debugging is on for %s", bestpath_str); + vty_out (vty, "BGP bestpath debugging is on for %s\n", bestpath_str); } return CMD_SUCCESS; @@ -962,7 +962,7 @@ DEFUN (no_debug_bgp_bestpath_prefix, if (!ret) { prefix_free(argv_p); - vty_outln (vty, "%% Malformed Prefix"); + vty_out (vty, "%% Malformed Prefix\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -979,16 +979,16 @@ DEFUN (no_debug_bgp_bestpath_prefix, else { TERM_DEBUG_OFF (bestpath, BESTPATH); - vty_outln (vty, "BGP bestpath debugging (per prefix) is off"); + vty_out (vty, "BGP bestpath debugging (per prefix) is off\n"); } } } if (found_prefix) - vty_outln (vty, "BGP bestpath debugging is off for %s", + vty_out (vty, "BGP bestpath debugging is off for %s\n", argv[idx_ipv4_ipv6_prefixlen]->arg); else - vty_outln (vty, "BGP bestpath debugging was not enabled for %s", + vty_out (vty, "BGP bestpath debugging was not enabled for %s\n", argv[idx_ipv4_ipv6_prefixlen]->arg); return CMD_SUCCESS; @@ -1009,7 +1009,7 @@ DEFUN (no_debug_bgp_bestpath, else { TERM_DEBUG_OFF (bestpath, BESTPATH); - vty_outln (vty, "BGP bestpath debugging is off"); + vty_out (vty, "BGP bestpath debugging is off\n"); } return CMD_SUCCESS; } @@ -1035,7 +1035,7 @@ DEFUN (debug_bgp_update, { TERM_DEBUG_ON (update, UPDATE_IN); TERM_DEBUG_ON (update, UPDATE_OUT); - vty_outln (vty, "BGP updates debugging is on"); + vty_out (vty, "BGP updates debugging is on\n"); } return CMD_SUCCESS; } @@ -1068,12 +1068,12 @@ DEFUN (debug_bgp_update_direct, if (strncmp ("i", argv[idx_in_out]->arg, 1) == 0) { TERM_DEBUG_ON (update, UPDATE_IN); - vty_outln (vty, "BGP updates debugging is on (inbound)"); + vty_out (vty, "BGP updates debugging is on (inbound)\n"); } else { TERM_DEBUG_ON (update, UPDATE_OUT); - vty_outln (vty, "BGP updates debugging is on (outbound)"); + vty_out (vty, "BGP updates debugging is on (outbound)\n"); } } return CMD_SUCCESS; @@ -1111,7 +1111,7 @@ DEFUN (debug_bgp_update_direct_peer, { if (bgp_debug_list_has_entry(bgp_debug_update_in_peers, host, NULL)) { - vty_outln (vty, "BGP inbound update debugging is already enabled for %s", + vty_out (vty, "BGP inbound update debugging is already enabled for %s\n", host); return CMD_SUCCESS; } @@ -1121,7 +1121,7 @@ DEFUN (debug_bgp_update_direct_peer, { if (bgp_debug_list_has_entry(bgp_debug_update_out_peers, host, NULL)) { - vty_outln (vty, "BGP outbound update debugging is already enabled for %s", + vty_out (vty, "BGP outbound update debugging is already enabled for %s\n", host); return CMD_SUCCESS; } @@ -1166,13 +1166,13 @@ DEFUN (debug_bgp_update_direct_peer, if (inbound) { TERM_DEBUG_ON (update, UPDATE_IN); - vty_outln (vty, "BGP updates debugging is on (inbound) for %s", + vty_out (vty, "BGP updates debugging is on (inbound) for %s\n", argv[idx_peer]->arg); } else { TERM_DEBUG_ON (update, UPDATE_OUT); - vty_outln (vty, "BGP updates debugging is on (outbound) for %s", + vty_out (vty, "BGP updates debugging is on (outbound) for %s\n", argv[idx_peer]->arg); } } @@ -1201,7 +1201,7 @@ DEFUN (no_debug_bgp_update_direct, else { TERM_DEBUG_OFF (update, UPDATE_IN); - vty_outln (vty, "BGP updates debugging is off (inbound)"); + vty_out (vty, "BGP updates debugging is off (inbound)\n"); } } else @@ -1215,7 +1215,7 @@ DEFUN (no_debug_bgp_update_direct, else { TERM_DEBUG_OFF (update, UPDATE_OUT); - vty_outln (vty, "BGP updates debugging is off (outbound)"); + vty_out (vty, "BGP updates debugging is off (outbound)\n"); } } @@ -1258,7 +1258,7 @@ DEFUN (no_debug_bgp_update_direct_peer, else { TERM_DEBUG_OFF (update, UPDATE_IN); - vty_outln (vty, "BGP updates debugging (inbound) is off"); + vty_out (vty, "BGP updates debugging (inbound) is off\n"); } } } @@ -1275,7 +1275,7 @@ DEFUN (no_debug_bgp_update_direct_peer, else { TERM_DEBUG_OFF (update, UPDATE_OUT); - vty_outln (vty, "BGP updates debugging (outbound) is off"); + vty_out (vty, "BGP updates debugging (outbound) is off\n"); } } @@ -1302,16 +1302,16 @@ DEFUN (no_debug_bgp_update_direct_peer, if (found_peer) if (inbound) - vty_outln (vty, "BGP updates debugging (inbound) is off for %s", host); + vty_out (vty, "BGP updates debugging (inbound) is off for %s\n", host); else - vty_outln (vty, "BGP updates debugging (outbound) is off for %s", + vty_out (vty, "BGP updates debugging (outbound) is off for %s\n", host); else if (inbound) - vty_outln (vty, "BGP updates debugging (inbound) was not enabled for %s", + vty_out (vty, "BGP updates debugging (inbound) was not enabled for %s\n", host); else - vty_outln (vty, "BGP updates debugging (outbound) was not enabled for %s", + vty_out (vty, "BGP updates debugging (outbound) was not enabled for %s\n", host); return CMD_SUCCESS; @@ -1337,7 +1337,7 @@ DEFUN (debug_bgp_update_prefix, if (!ret) { prefix_free(argv_p); - vty_outln (vty, "%% Malformed Prefix"); + vty_out (vty, "%% Malformed Prefix\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1347,7 +1347,7 @@ DEFUN (debug_bgp_update_prefix, if (bgp_debug_list_has_entry(bgp_debug_update_prefixes, NULL, argv_p)) { - vty_outln (vty, "BGP updates debugging is already enabled for %s", + vty_out (vty, "BGP updates debugging is already enabled for %s\n", argv[idx_ipv4_ipv6_prefixlen]->arg); return CMD_SUCCESS; } @@ -1361,7 +1361,7 @@ DEFUN (debug_bgp_update_prefix, else { TERM_DEBUG_ON (update, UPDATE_PREFIX); - vty_outln (vty, "BGP updates debugging is on for %s", + vty_out (vty, "BGP updates debugging is on for %s\n", argv[idx_ipv4_ipv6_prefixlen]->arg); } @@ -1390,7 +1390,7 @@ DEFUN (no_debug_bgp_update_prefix, if (!ret) { prefix_free(argv_p); - vty_outln (vty, "%% Malformed Prefix"); + vty_out (vty, "%% Malformed Prefix\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1407,16 +1407,16 @@ DEFUN (no_debug_bgp_update_prefix, else { TERM_DEBUG_OFF (update, UPDATE_PREFIX); - vty_outln (vty, "BGP updates debugging (per prefix) is off"); + vty_out (vty, "BGP updates debugging (per prefix) is off\n"); } } } if (found_prefix) - vty_outln (vty, "BGP updates debugging is off for %s", + vty_out (vty, "BGP updates debugging is off for %s\n", argv[idx_ipv4_ipv6_prefixlen]->arg); else - vty_outln (vty, "BGP updates debugging was not enabled for %s", + vty_out (vty, "BGP updates debugging was not enabled for %s\n", argv[idx_ipv4_ipv6_prefixlen]->arg); return CMD_SUCCESS; @@ -1448,7 +1448,7 @@ DEFUN (no_debug_bgp_update, TERM_DEBUG_OFF (update, UPDATE_IN); TERM_DEBUG_OFF (update, UPDATE_OUT); TERM_DEBUG_OFF (update, UPDATE_PREFIX); - vty_outln (vty, "BGP updates debugging is off"); + vty_out (vty, "BGP updates debugging is off\n"); } return CMD_SUCCESS; } @@ -1466,7 +1466,7 @@ DEFUN (debug_bgp_zebra, else { TERM_DEBUG_ON (zebra, ZEBRA); - vty_outln (vty, "BGP zebra debugging is on"); + vty_out (vty, "BGP zebra debugging is on\n"); } return CMD_SUCCESS; } @@ -1491,7 +1491,7 @@ DEFUN (debug_bgp_zebra_prefix, if (!ret) { prefix_free(argv_p); - vty_outln (vty, "%% Malformed Prefix"); + vty_out (vty, "%% Malformed Prefix\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1500,7 +1500,7 @@ DEFUN (debug_bgp_zebra_prefix, if (bgp_debug_list_has_entry(bgp_debug_zebra_prefixes, NULL, argv_p)) { - vty_outln (vty, "BGP zebra debugging is already enabled for %s", + vty_out (vty, "BGP zebra debugging is already enabled for %s\n", argv[idx_ipv4_ipv6_prefixlen]->arg); return CMD_SUCCESS; } @@ -1512,7 +1512,7 @@ DEFUN (debug_bgp_zebra_prefix, else { TERM_DEBUG_ON (zebra, ZEBRA); - vty_outln (vty, "BGP zebra debugging is on for %s", + vty_out (vty, "BGP zebra debugging is on for %s\n", argv[idx_ipv4_ipv6_prefixlen]->arg); } @@ -1534,7 +1534,7 @@ DEFUN (no_debug_bgp_zebra, else { TERM_DEBUG_OFF (zebra, ZEBRA); - vty_outln (vty, "BGP zebra debugging is off"); + vty_out (vty, "BGP zebra debugging is off\n"); } return CMD_SUCCESS; } @@ -1561,7 +1561,7 @@ DEFUN (no_debug_bgp_zebra_prefix, if (!ret) { prefix_free(argv_p); - vty_outln (vty, "%% Malformed Prefix"); + vty_out (vty, "%% Malformed Prefix\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1576,16 +1576,16 @@ DEFUN (no_debug_bgp_zebra_prefix, else { TERM_DEBUG_OFF (zebra, ZEBRA); - vty_outln (vty, "BGP zebra debugging is off"); + vty_out (vty, "BGP zebra debugging is off\n"); } } } if (found_prefix) - vty_outln (vty, "BGP zebra debugging is off for %s", + vty_out (vty, "BGP zebra debugging is off for %s\n", argv[idx_ipv4_ipv6_prefixlen]->arg); else - vty_outln (vty, "BGP zebra debugging was not enabled for %s", + vty_out (vty, "BGP zebra debugging was not enabled for %s\n", argv[idx_ipv4_ipv6_prefixlen]->arg); return CMD_SUCCESS; @@ -1603,7 +1603,7 @@ DEFUN (debug_bgp_allow_martians, else { TERM_DEBUG_ON (allow_martians, ALLOW_MARTIANS); - vty_outln (vty, "BGP allow_martian next hop debugging is on"); + vty_out (vty, "BGP allow_martian next hop debugging is on\n"); } return CMD_SUCCESS; } @@ -1621,7 +1621,7 @@ DEFUN (no_debug_bgp_allow_martians, else { TERM_DEBUG_OFF (allow_martians, ALLOW_MARTIANS); - vty_outln (vty, "BGP allow martian next hop debugging is off"); + vty_out (vty, "BGP allow martian next hop debugging is off\n"); } return CMD_SUCCESS; } @@ -1640,7 +1640,7 @@ DEFUN (debug_bgp_update_groups, else { TERM_DEBUG_ON (update_groups, UPDATE_GROUPS); - vty_outln (vty, "BGP update-groups debugging is on"); + vty_out (vty, "BGP update-groups debugging is on\n"); } return CMD_SUCCESS; } @@ -1658,7 +1658,7 @@ DEFUN (no_debug_bgp_update_groups, else { TERM_DEBUG_OFF (update_groups, UPDATE_GROUPS); - vty_outln (vty, "BGP update-groups debugging is off"); + vty_out (vty, "BGP update-groups debugging is off\n"); } return CMD_SUCCESS; } @@ -1691,7 +1691,7 @@ DEFUN (no_debug_bgp, TERM_DEBUG_OFF (neighbor_events, NEIGHBOR_EVENTS); TERM_DEBUG_OFF (zebra, ZEBRA); TERM_DEBUG_OFF (allow_martians, ALLOW_MARTIANS); - vty_outln (vty, "All possible debugging has been turned off"); + vty_out (vty, "All possible debugging has been turned off\n"); return CMD_SUCCESS; } @@ -1703,13 +1703,13 @@ DEFUN (show_debugging_bgp, DEBUG_STR BGP_STR) { - vty_outln (vty, "BGP debugging status:"); + vty_out (vty, "BGP debugging status:\n"); if (BGP_DEBUG (as4, AS4)) - vty_outln (vty, " BGP as4 debugging is on"); + vty_out (vty, " BGP as4 debugging is on\n"); if (BGP_DEBUG (as4, AS4_SEGMENT)) - vty_outln (vty, " BGP as4 aspath segment debugging is on"); + vty_out (vty, " BGP as4 aspath segment debugging is on\n"); if (BGP_DEBUG (bestpath, BESTPATH)) bgp_debug_list_print (vty, " BGP bestpath debugging is on", @@ -1724,10 +1724,10 @@ DEFUN (show_debugging_bgp, bgp_debug_neighbor_events_peers); if (BGP_DEBUG (nht, NHT)) - vty_outln (vty, " BGP next-hop tracking debugging is on"); + vty_out (vty, " BGP next-hop tracking debugging is on\n"); if (BGP_DEBUG (update_groups, UPDATE_GROUPS)) - vty_outln (vty, " BGP update-groups debugging is on"); + vty_out (vty, " BGP update-groups debugging is on\n"); if (BGP_DEBUG (update, UPDATE_PREFIX)) bgp_debug_list_print (vty, " BGP updates debugging is on", @@ -1746,8 +1746,8 @@ DEFUN (show_debugging_bgp, bgp_debug_zebra_prefixes); if (BGP_DEBUG (allow_martians, ALLOW_MARTIANS)) - vty_outln (vty, " BGP allow martian next hop debugging is on"); - vty_out (vty, VTYNL); + vty_out (vty, " BGP allow martian next hop debugging is on\n"); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -1802,13 +1802,13 @@ bgp_config_write_debug (struct vty *vty) if (CONF_BGP_DEBUG (as4, AS4)) { - vty_outln (vty, "debug bgp as4"); + vty_out (vty, "debug bgp as4\n"); write++; } if (CONF_BGP_DEBUG (as4, AS4_SEGMENT)) { - vty_outln (vty, "debug bgp as4 segment"); + vty_out (vty, "debug bgp as4 segment\n"); write++; } @@ -1832,13 +1832,13 @@ bgp_config_write_debug (struct vty *vty) if (CONF_BGP_DEBUG (nht, NHT)) { - vty_outln (vty, "debug bgp nht"); + vty_out (vty, "debug bgp nht\n"); write++; } if (CONF_BGP_DEBUG (update_groups, UPDATE_GROUPS)) { - vty_outln (vty, "debug bgp update-groups"); + vty_out (vty, "debug bgp update-groups\n"); write++; } @@ -1864,7 +1864,7 @@ bgp_config_write_debug (struct vty *vty) { if (!bgp_debug_zebra_prefixes || list_isempty(bgp_debug_zebra_prefixes)) { - vty_outln (vty, "debug bgp zebra"); + vty_out (vty, "debug bgp zebra\n"); write++; } else @@ -1876,7 +1876,7 @@ bgp_config_write_debug (struct vty *vty) if (CONF_BGP_DEBUG (allow_martians, ALLOW_MARTIANS)) { - vty_outln (vty, "debug bgp allow-martians"); + vty_out (vty, "debug bgp allow-martians\n"); write++; } diff --git a/bgpd/bgp_dump.c b/bgpd/bgp_dump.c index d63d8209c..5b6b8e137 100644 --- a/bgpd/bgp_dump.c +++ b/bgpd/bgp_dump.c @@ -667,7 +667,7 @@ bgp_dump_set (struct vty *vty, struct bgp_dump *bgp_dump, interval = bgp_dump_parse_time (interval_str); if (interval == 0) { - vty_outln (vty, "Malformed interval string"); + vty_out (vty, "Malformed interval string\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -866,10 +866,10 @@ config_write_bgp_dump (struct vty *vty) type_str = "all-et"; if (bgp_dump_all.interval_str) - vty_outln (vty, "dump bgp %s %s %s", type_str, + vty_out (vty, "dump bgp %s %s %s\n", type_str, bgp_dump_all.filename,bgp_dump_all.interval_str); else - vty_outln (vty, "dump bgp %s %s", type_str, + vty_out (vty, "dump bgp %s %s\n", type_str, bgp_dump_all.filename); } if (bgp_dump_updates.filename) @@ -879,19 +879,19 @@ config_write_bgp_dump (struct vty *vty) type_str = "updates-et"; if (bgp_dump_updates.interval_str) - vty_outln (vty, "dump bgp %s %s %s", type_str, + vty_out (vty, "dump bgp %s %s %s\n", type_str, bgp_dump_updates.filename,bgp_dump_updates.interval_str); else - vty_outln (vty, "dump bgp %s %s", type_str, + vty_out (vty, "dump bgp %s %s\n", type_str, bgp_dump_updates.filename); } if (bgp_dump_routes.filename) { if (bgp_dump_routes.interval_str) - vty_outln (vty, "dump bgp routes-mrt %s %s", + vty_out (vty, "dump bgp routes-mrt %s %s\n", bgp_dump_routes.filename,bgp_dump_routes.interval_str); else - vty_outln (vty, "dump bgp routes-mrt %s", + vty_out (vty, "dump bgp routes-mrt %s\n", bgp_dump_routes.filename); } diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c index d22a07ed3..a76e499f8 100644 --- a/bgpd/bgp_evpn_vty.c +++ b/bgpd/bgp_evpn_vty.c @@ -61,7 +61,7 @@ bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd, bgp = bgp_get_default(); if (bgp == NULL) { if (!use_json) - vty_outln (vty,"No BGP process is configured"); + vty_out (vty,"No BGP process is configured\n"); return CMD_WARNING; } @@ -135,20 +135,19 @@ bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd, } else { if (option == SHOW_DISPLAY_TAGS) - vty_outln(vty, V4_HEADER_TAG); + vty_out(vty, V4_HEADER_TAG); else if (option == SHOW_DISPLAY_OVERLAY) - vty_outln(vty, V4_HEADER_OVERLAY); + vty_out(vty, V4_HEADER_OVERLAY); else { - vty_outln (vty, - "BGP table version is 0, local router ID is %s", + vty_out (vty, + "BGP table version is 0, local router ID is %s\n", inet_ntoa(bgp->router_id)); - vty_outln (vty, - "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal"); - vty_outln (vty, - "Origin codes: i - IGP, e - EGP, ? - incomplete%s", - VTYNL); - vty_outln(vty, V4_HEADER); + vty_out (vty, + "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal\n"); + vty_out (vty, + "Origin codes: i - IGP, e - EGP, ? - incomplete\n\n"); + vty_out(vty, V4_HEADER); } } header = 0; @@ -224,7 +223,7 @@ bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd, ip), rd_ip. val); - vty_outln (vty, VTYNL); + vty_out (vty, "\n\n"); } rd_header = 0; } @@ -253,11 +252,10 @@ bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd, } } if (output_count == 0) - vty_outln (vty, "No prefixes displayed, %ld exist", + vty_out (vty, "No prefixes displayed, %ld exist\n", total_count); else - vty_outln (vty, "%sDisplayed %ld out of %ld total prefixes", - VTYNL, output_count, total_count); + vty_out (vty, "\nDisplayed %ld out of %ld total prefixes\n", output_count, total_count); return CMD_SUCCESS; } @@ -289,7 +287,7 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd, ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd); if (!ret) { - vty_outln (vty, "%% Malformed Route Distinguisher"); + vty_out (vty, "%% Malformed Route Distinguisher\n"); return CMD_WARNING; } return bgp_show_ethernet_vpn(vty, &prd, bgp_show_type_normal, NULL, 0, @@ -330,7 +328,7 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd_tags, ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd); if (!ret) { - vty_outln (vty, "%% Malformed Route Distinguisher"); + vty_out (vty, "%% Malformed Route Distinguisher\n"); return CMD_WARNING; } return bgp_show_ethernet_vpn(vty, &prd, bgp_show_type_normal, NULL, 1, @@ -365,11 +363,11 @@ DEFUN(show_ip_bgp_l2vpn_evpn_all_neighbor_routes, json_no = json_object_new_object(); json_object_string_add(json_no, "warning", "Malformed address"); - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string(json_no)); json_object_free(json_no); } else - vty_outln (vty, "Malformed address: %s", + vty_out (vty, "Malformed address: %s\n", argv[idx_ipv4]->arg); return CMD_WARNING; } @@ -381,12 +379,12 @@ DEFUN(show_ip_bgp_l2vpn_evpn_all_neighbor_routes, json_no = json_object_new_object(); json_object_string_add(json_no, "warning", "No such neighbor or address family"); - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string(json_no)); json_object_free(json_no); } else - vty_outln (vty, - "%% No such neighbor or address family"); + vty_out (vty, + "%% No such neighbor or address family\n"); return CMD_WARNING; } @@ -426,11 +424,11 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd_neighbor_routes, json_no = json_object_new_object(); json_object_string_add(json_no, "warning", "Malformed Route Distinguisher"); - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string(json_no)); json_object_free(json_no); } else - vty_outln (vty,"%% Malformed Route Distinguisher"); + vty_out (vty,"%% Malformed Route Distinguisher\n"); return CMD_WARNING; } @@ -441,11 +439,11 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd_neighbor_routes, json_no = json_object_new_object(); json_object_string_add(json_no, "warning", "Malformed address"); - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string(json_no)); json_object_free(json_no); } else - vty_outln (vty, "Malformed address: %s", + vty_out (vty, "Malformed address: %s\n", argv[idx_ext_community]->arg); return CMD_WARNING; } @@ -457,12 +455,12 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd_neighbor_routes, json_no = json_object_new_object(); json_object_string_add(json_no, "warning", "No such neighbor or address family"); - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string(json_no)); json_object_free(json_no); } else - vty_outln (vty, - "%% No such neighbor or address family"); + vty_out (vty, + "%% No such neighbor or address family\n"); return CMD_WARNING; } @@ -498,11 +496,11 @@ DEFUN(show_ip_bgp_l2vpn_evpn_all_neighbor_advertised_routes, json_no = json_object_new_object(); json_object_string_add(json_no, "warning", "Malformed address"); - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string(json_no)); json_object_free(json_no); } else - vty_outln (vty, "Malformed address: %s", + vty_out (vty, "Malformed address: %s\n", argv[idx_ipv4]->arg); return CMD_WARNING; } @@ -513,12 +511,12 @@ DEFUN(show_ip_bgp_l2vpn_evpn_all_neighbor_advertised_routes, json_no = json_object_new_object(); json_object_string_add(json_no, "warning", "No such neighbor or address family"); - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string(json_no)); json_object_free(json_no); } else - vty_outln (vty, - "%% No such neighbor or address family"); + vty_out (vty, + "%% No such neighbor or address family\n"); return CMD_WARNING; } @@ -557,11 +555,11 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd_neighbor_advertised_routes, json_no = json_object_new_object(); json_object_string_add(json_no, "warning", "Malformed address"); - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string(json_no)); json_object_free(json_no); } else - vty_outln (vty, "Malformed address: %s", + vty_out (vty, "Malformed address: %s\n", argv[idx_ext_community]->arg); return CMD_WARNING; } @@ -572,12 +570,12 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd_neighbor_advertised_routes, json_no = json_object_new_object(); json_object_string_add(json_no, "warning", "No such neighbor or address family"); - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string(json_no)); json_object_free(json_no); } else - vty_outln (vty, - "%% No such neighbor or address family"); + vty_out (vty, + "%% No such neighbor or address family\n"); return CMD_WARNING; } @@ -588,11 +586,11 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd_neighbor_advertised_routes, json_no = json_object_new_object(); json_object_string_add(json_no, "warning", "Malformed Route Distinguisher"); - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string(json_no)); json_object_free(json_no); } else - vty_outln (vty,"%% Malformed Route Distinguisher"); + vty_out (vty,"%% Malformed Route Distinguisher\n"); return CMD_WARNING; } @@ -635,7 +633,7 @@ DEFUN(show_ip_bgp_evpn_rd_overlay, ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd); if (!ret) { - vty_outln (vty, "%% Malformed Route Distinguisher"); + vty_out (vty, "%% Malformed Route Distinguisher\n"); return CMD_WARNING; } return bgp_show_ethernet_vpn(vty, &prd, bgp_show_type_normal, NULL, diff --git a/bgpd/bgp_filter.c b/bgpd/bgp_filter.c index 5fa0372fe..a61321b0e 100644 --- a/bgpd/bgp_filter.c +++ b/bgpd/bgp_filter.c @@ -457,7 +457,7 @@ DEFUN (ip_as_path, regex = bgp_regcomp (regstr); if (!regex) { - vty_outln (vty, "can't compile regexp %s", regstr); + vty_out (vty, "can't compile regexp %s\n", regstr); XFREE (MTYPE_TMP, regstr); return CMD_WARNING_CONFIG_FAILED; } @@ -503,7 +503,7 @@ DEFUN (no_ip_as_path, aslist = as_list_lookup (aslistname); if (aslist == NULL) { - vty_outln (vty, "ip as-path access-list %s doesn't exist",aslistname); + vty_out (vty, "ip as-path access-list %s doesn't exist\n",aslistname); return CMD_WARNING_CONFIG_FAILED; } @@ -514,7 +514,7 @@ DEFUN (no_ip_as_path, type = AS_FILTER_DENY; else { - vty_outln (vty, "filter type must be [permit|deny]"); + vty_out (vty, "filter type must be [permit|deny]\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -525,7 +525,7 @@ DEFUN (no_ip_as_path, regex = bgp_regcomp (regstr); if (!regex) { - vty_outln (vty, "can't compile regexp %s", regstr); + vty_out (vty, "can't compile regexp %s\n", regstr); XFREE (MTYPE_TMP, regstr); return CMD_WARNING_CONFIG_FAILED; } @@ -538,7 +538,7 @@ DEFUN (no_ip_as_path, if (asfilter == NULL) { - vty_outln (vty, "ip as-path access-list doesn't exist"); + vty_out (vty, "\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -562,7 +562,7 @@ DEFUN (no_ip_as_path_all, aslist = as_list_lookup (argv[idx_word]->arg); if (aslist == NULL) { - vty_outln (vty, "ip as-path access-list %s doesn't exist", + vty_out (vty, "ip as-path access-list %s doesn't exist\n", argv[idx_word]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -581,11 +581,11 @@ as_list_show (struct vty *vty, struct as_list *aslist) { struct as_filter *asfilter; - vty_outln (vty, "AS path access list %s", aslist->name); + vty_out (vty, "AS path access list %s\n", aslist->name); for (asfilter = aslist->head; asfilter; asfilter = asfilter->next) { - vty_outln (vty, " %s %s", filter_type_str (asfilter->type), + vty_out (vty, " %s %s\n", filter_type_str (asfilter->type), asfilter->reg_str); } } @@ -598,22 +598,22 @@ as_list_show_all (struct vty *vty) for (aslist = as_list_master.num.head; aslist; aslist = aslist->next) { - vty_outln (vty, "AS path access list %s", aslist->name); + vty_out (vty, "AS path access list %s\n", aslist->name); for (asfilter = aslist->head; asfilter; asfilter = asfilter->next) { - vty_outln (vty, " %s %s", filter_type_str (asfilter->type), + vty_out (vty, " %s %s\n", filter_type_str (asfilter->type), asfilter->reg_str); } } for (aslist = as_list_master.str.head; aslist; aslist = aslist->next) { - vty_outln (vty, "AS path access list %s", aslist->name); + vty_out (vty, "AS path access list %s\n", aslist->name); for (asfilter = aslist->head; asfilter; asfilter = asfilter->next) { - vty_outln (vty, " %s %s", filter_type_str (asfilter->type), + vty_out (vty, " %s %s\n", filter_type_str (asfilter->type), asfilter->reg_str); } } @@ -658,7 +658,7 @@ config_write_as_list (struct vty *vty) for (aslist = as_list_master.num.head; aslist; aslist = aslist->next) for (asfilter = aslist->head; asfilter; asfilter = asfilter->next) { - vty_outln (vty, "ip as-path access-list %s %s %s", + vty_out (vty, "ip as-path access-list %s %s %s\n", aslist->name, filter_type_str (asfilter->type), asfilter->reg_str); write++; @@ -667,7 +667,7 @@ config_write_as_list (struct vty *vty) for (aslist = as_list_master.str.head; aslist; aslist = aslist->next) for (asfilter = aslist->head; asfilter; asfilter = asfilter->next) { - vty_outln (vty, "ip as-path access-list %s %s %s", + vty_out (vty, "ip as-path access-list %s %s %s\n", aslist->name, filter_type_str (asfilter->type), asfilter->reg_str); write++; diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c index b5fbfd8bb..c1db9fed2 100644 --- a/bgpd/bgp_mplsvpn.c +++ b/bgpd/bgp_mplsvpn.c @@ -563,7 +563,7 @@ bgp_show_mpls_vpn (struct vty *vty, afi_t afi, struct prefix_rd *prd, if (bgp == NULL) { if (!use_json) - vty_outln (vty, "No BGP process is configured"); + vty_out (vty, "No BGP process is configured\n"); return CMD_WARNING; } @@ -589,7 +589,7 @@ bgp_show_mpls_vpn (struct vty *vty, afi_t afi, struct prefix_rd *prd, if ((afi != AFI_IP) && (afi != AFI_IP6)) { - vty_outln (vty, "Afi %d not supported", afi); + vty_out (vty, "Afi %d not supported\n", afi); return CMD_WARNING; } @@ -634,16 +634,15 @@ bgp_show_mpls_vpn (struct vty *vty, afi_t afi, struct prefix_rd *prd, else { if (tags) - vty_outln (vty, V4_HEADER_TAG); + vty_out (vty, V4_HEADER_TAG); else { - vty_outln (vty, "BGP table version is 0, local router ID is %s", + vty_out (vty, "BGP table version is 0, local router ID is %s\n", inet_ntoa(bgp->router_id)); - vty_outln (vty, - "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal"); - vty_outln (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete%s", - VTYNL); - vty_outln (vty, V4_HEADER); + vty_out (vty, + "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal\n"); + vty_out (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete\n\n"); + vty_out (vty, V4_HEADER); } } header = 0; @@ -703,7 +702,7 @@ bgp_show_mpls_vpn (struct vty *vty, afi_t afi, struct prefix_rd *prd, rd_vnc_eth.macaddr.octet[4], rd_vnc_eth.macaddr.octet[5]); #endif - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } rd_header = 0; } @@ -740,17 +739,16 @@ bgp_show_mpls_vpn (struct vty *vty, afi_t afi, struct prefix_rd *prd, if (use_json) { json_object_object_add(json, "routes", json_nroute); - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else { if (output_count == 0) - vty_outln (vty, "No prefixes displayed, %ld exist", total_count); + vty_out (vty, "No prefixes displayed, %ld exist\n", total_count); else - vty_outln (vty, "%sDisplayed %ld routes and %ld total paths", - VTYNL, output_count, total_count); + vty_out (vty, "\nDisplayed %ld routes and %ld total paths\n", output_count, total_count); } return CMD_SUCCESS; @@ -781,7 +779,7 @@ DEFUN (show_bgp_ip_vpn_all_rd, ret = str2prefix_rd (argv[idx_rd]->arg, &prd); if (! ret) { - vty_outln (vty, "%% Malformed Route Distinguisher"); + vty_out (vty, "%% Malformed Route Distinguisher\n"); return CMD_WARNING; } return bgp_show_mpls_vpn (vty, afi, &prd, bgp_show_type_normal, NULL, 0, use_json (argc, argv)); @@ -816,7 +814,7 @@ DEFUN (show_ip_bgp_vpn_rd, ret = str2prefix_rd (argv[idx_ext_community]->arg, &prd); if (! ret) { - vty_outln (vty, "%% Malformed Route Distinguisher"); + vty_out (vty, "%% Malformed Route Distinguisher\n"); return CMD_WARNING; } return bgp_show_mpls_vpn (vty, afi, &prd, bgp_show_type_normal, NULL, 0, 0); @@ -881,7 +879,7 @@ DEFUN (show_ip_bgp_vpn_rd_tags, ret = str2prefix_rd (argv[idx_ext_community]->arg, &prd); if (! ret) { - vty_outln (vty, "%% Malformed Route Distinguisher"); + vty_out (vty, "%% Malformed Route Distinguisher\n"); return CMD_WARNING; } return bgp_show_mpls_vpn (vty, afi, &prd, bgp_show_type_normal, NULL, 1, 0); @@ -920,11 +918,11 @@ DEFUN (show_ip_bgp_vpn_all_neighbor_routes, json_object *json_no = NULL; json_no = json_object_new_object(); json_object_string_add(json_no, "warning", "Malformed address"); - vty_outln (vty, "%s", json_object_to_json_string(json_no)); + vty_out (vty, "%s\n", json_object_to_json_string(json_no)); json_object_free(json_no); } else - vty_outln (vty, "Malformed address: %s", argv[idx_ipv4]->arg); + vty_out (vty, "Malformed address: %s\n", argv[idx_ipv4]->arg); return CMD_WARNING; } @@ -936,11 +934,11 @@ DEFUN (show_ip_bgp_vpn_all_neighbor_routes, json_object *json_no = NULL; json_no = json_object_new_object(); json_object_string_add(json_no, "warning", "No such neighbor or address family"); - vty_outln (vty, "%s", json_object_to_json_string(json_no)); + vty_out (vty, "%s\n", json_object_to_json_string(json_no)); json_object_free(json_no); } else - vty_outln (vty, "%% No such neighbor or address family"); + vty_out (vty, "%% No such neighbor or address family\n"); return CMD_WARNING; } @@ -983,11 +981,11 @@ DEFUN (show_ip_bgp_vpn_rd_neighbor_routes, json_object *json_no = NULL; json_no = json_object_new_object(); json_object_string_add(json_no, "warning", "Malformed Route Distinguisher"); - vty_outln (vty, "%s", json_object_to_json_string(json_no)); + vty_out (vty, "%s\n", json_object_to_json_string(json_no)); json_object_free(json_no); } else - vty_outln (vty, "%% Malformed Route Distinguisher"); + vty_out (vty, "%% Malformed Route Distinguisher\n"); return CMD_WARNING; } @@ -999,11 +997,11 @@ DEFUN (show_ip_bgp_vpn_rd_neighbor_routes, json_object *json_no = NULL; json_no = json_object_new_object(); json_object_string_add(json_no, "warning", "Malformed address"); - vty_outln (vty, "%s", json_object_to_json_string(json_no)); + vty_out (vty, "%s\n", json_object_to_json_string(json_no)); json_object_free(json_no); } else - vty_outln (vty, "Malformed address: %s", + vty_out (vty, "Malformed address: %s\n", argv[idx_ext_community]->arg); return CMD_WARNING; } @@ -1016,11 +1014,11 @@ DEFUN (show_ip_bgp_vpn_rd_neighbor_routes, json_object *json_no = NULL; json_no = json_object_new_object(); json_object_string_add(json_no, "warning", "No such neighbor or address family"); - vty_outln (vty, "%s", json_object_to_json_string(json_no)); + vty_out (vty, "%s\n", json_object_to_json_string(json_no)); json_object_free(json_no); } else - vty_outln (vty, "%% No such neighbor or address family"); + vty_out (vty, "%% No such neighbor or address family\n"); return CMD_WARNING; } @@ -1060,11 +1058,11 @@ DEFUN (show_ip_bgp_vpn_all_neighbor_advertised_routes, json_object *json_no = NULL; json_no = json_object_new_object(); json_object_string_add(json_no, "warning", "Malformed address"); - vty_outln (vty, "%s", json_object_to_json_string(json_no)); + vty_out (vty, "%s\n", json_object_to_json_string(json_no)); json_object_free(json_no); } else - vty_outln (vty, "Malformed address: %s", argv[idx_ipv4]->arg); + vty_out (vty, "Malformed address: %s\n", argv[idx_ipv4]->arg); return CMD_WARNING; } peer = peer_lookup (NULL, &su); @@ -1075,11 +1073,11 @@ DEFUN (show_ip_bgp_vpn_all_neighbor_advertised_routes, json_object *json_no = NULL; json_no = json_object_new_object(); json_object_string_add(json_no, "warning", "No such neighbor or address family"); - vty_outln (vty, "%s", json_object_to_json_string(json_no)); + vty_out (vty, "%s\n", json_object_to_json_string(json_no)); json_object_free(json_no); } else - vty_outln (vty, "%% No such neighbor or address family"); + vty_out (vty, "%% No such neighbor or address family\n"); return CMD_WARNING; } return show_adj_route_vpn (vty, peer, NULL, AFI_IP, SAFI_MPLS_VPN, uj); @@ -1121,11 +1119,11 @@ DEFUN (show_ip_bgp_vpn_rd_neighbor_advertised_routes, json_object *json_no = NULL; json_no = json_object_new_object(); json_object_string_add(json_no, "warning", "Malformed address"); - vty_outln (vty, "%s", json_object_to_json_string(json_no)); + vty_out (vty, "%s\n", json_object_to_json_string(json_no)); json_object_free(json_no); } else - vty_outln (vty, "Malformed address: %s", + vty_out (vty, "Malformed address: %s\n", argv[idx_ext_community]->arg); return CMD_WARNING; } @@ -1137,11 +1135,11 @@ DEFUN (show_ip_bgp_vpn_rd_neighbor_advertised_routes, json_object *json_no = NULL; json_no = json_object_new_object(); json_object_string_add(json_no, "warning", "No such neighbor or address family"); - vty_outln (vty, "%s", json_object_to_json_string(json_no)); + vty_out (vty, "%s\n", json_object_to_json_string(json_no)); json_object_free(json_no); } else - vty_outln (vty, "%% No such neighbor or address family"); + vty_out (vty, "%% No such neighbor or address family\n"); return CMD_WARNING; } @@ -1153,11 +1151,11 @@ DEFUN (show_ip_bgp_vpn_rd_neighbor_advertised_routes, json_object *json_no = NULL; json_no = json_object_new_object(); json_object_string_add(json_no, "warning", "Malformed Route Distinguisher"); - vty_outln (vty, "%s", json_object_to_json_string(json_no)); + vty_out (vty, "%s\n", json_object_to_json_string(json_no)); json_object_free(json_no); } else - vty_outln (vty, "%% Malformed Route Distinguisher"); + vty_out (vty, "%% Malformed Route Distinguisher\n"); return CMD_WARNING; } diff --git a/bgpd/bgp_mplsvpn.h b/bgpd/bgp_mplsvpn.h index 4ba4597d0..98806abc3 100644 --- a/bgpd/bgp_mplsvpn.h +++ b/bgpd/bgp_mplsvpn.h @@ -68,11 +68,11 @@ typedef enum { "Address Family\n" #define V4_HEADER \ - " Network Next Hop Metric LocPrf Weight Path" + " Network Next Hop Metric LocPrf Weight Path\n" #define V4_HEADER_TAG \ - " Network Next Hop In tag/Out tag" + " Network Next Hop In tag/Out tag\n" #define V4_HEADER_OVERLAY \ - " Network Next Hop EthTag Overlay Index RouterMac" + " Network Next Hop EthTag Overlay Index RouterMac\n" struct rd_as { diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c index d0c4d2c94..45ccb3743 100644 --- a/bgpd/bgp_nexthop.c +++ b/bgpd/bgp_nexthop.c @@ -387,7 +387,7 @@ bgp_show_nexthops (struct vty *vty, struct bgp *bgp, int detail) time_t tbuf; afi_t afi; - vty_outln (vty, "Current BGP nexthop cache:"); + vty_out (vty, "Current BGP nexthop cache:\n"); for (afi = AFI_IP ; afi < AFI_MAX ; afi++) { if (!bgp->nexthop_cache_table[afi]) @@ -399,7 +399,7 @@ bgp_show_nexthops (struct vty *vty, struct bgp *bgp, int detail) { if (CHECK_FLAG(bnc->flags, BGP_NEXTHOP_VALID)) { - vty_outln (vty, " %s valid [IGP metric %d], #paths %d", + vty_out (vty, " %s valid [IGP metric %d], #paths %d\n", inet_ntop (rn->p.family, &rn->p.u.prefix, buf, sizeof (buf)), bnc->metric, bnc->path_count); if (detail) @@ -407,44 +407,44 @@ bgp_show_nexthops (struct vty *vty, struct bgp *bgp, int detail) switch (nexthop->type) { case NEXTHOP_TYPE_IPV6: - vty_outln (vty, " gate %s", + vty_out (vty, " gate %s\n", inet_ntop(AF_INET6, &nexthop->gate.ipv6, buf, sizeof(buf))); break; case NEXTHOP_TYPE_IPV6_IFINDEX: - vty_outln (vty, " gate %s, if %s", + vty_out (vty, " gate %s, if %s\n", inet_ntop(AF_INET6, &nexthop->gate.ipv6, buf, sizeof (buf)), ifindex2ifname(nexthop->ifindex, bgp->vrf_id)); break; case NEXTHOP_TYPE_IPV4: - vty_outln (vty, " gate %s", + vty_out (vty, " gate %s\n", inet_ntop(AF_INET, &nexthop->gate.ipv4, buf, sizeof(buf))); break; case NEXTHOP_TYPE_IFINDEX: - vty_outln (vty, " if %s", + vty_out (vty, " if %s\n", ifindex2ifname(nexthop->ifindex, bgp->vrf_id)); break; case NEXTHOP_TYPE_IPV4_IFINDEX: - vty_outln (vty, " gate %s, if %s", + vty_out (vty, " gate %s, if %s\n", inet_ntop(AF_INET, &nexthop->gate.ipv4, buf, sizeof (buf)), ifindex2ifname(nexthop->ifindex, bgp->vrf_id)); break; default: - vty_outln (vty, " invalid nexthop type %u", + vty_out (vty, " invalid nexthop type %u\n", nexthop->type); } } else { - vty_outln (vty, " %s invalid", + vty_out (vty, " %s invalid\n", inet_ntop(rn->p.family, &rn->p.u.prefix, buf, sizeof(buf))); if (CHECK_FLAG(bnc->flags, BGP_NEXTHOP_CONNECTED)) - vty_outln (vty, " Must be Connected"); + vty_out (vty, " Must be Connected\n"); } tbuf = time(NULL) - (bgp_clock() - bnc->last_update); vty_out (vty, " Last update: %s", ctime(&tbuf)); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } } @@ -461,7 +461,7 @@ show_ip_bgp_nexthop_table (struct vty *vty, const char *name, int detail) bgp = bgp_get_default (); if (!bgp) { - vty_outln (vty, "%% No such BGP instance exist"); + vty_out (vty, "%% No such BGP instance exist\n"); return CMD_WARNING; } @@ -478,8 +478,7 @@ bgp_show_all_instances_nexthops_vty (struct vty *vty) for (ALL_LIST_ELEMENTS (bm->bgp, node, nnode, bgp)) { - vty_outln (vty, "%sInstance %s:", - VTYNL, + vty_out (vty, "\nInstance %s:\n", (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT) ? "Default" : bgp->name); bgp_show_nexthops (vty, bgp, 0); } diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c index 86befd3e8..d6ed441df 100644 --- a/bgpd/bgp_open.c +++ b/bgpd/bgp_open.c @@ -167,7 +167,7 @@ bgp_capability_vty_out (struct vty *vty, struct peer *peer, u_char use_json, jso vty_out (vty, "SAFI Unknown %d ", mpc.safi); break; } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } else if (hdr->code >= 128) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 6b38ba685..c2694b82b 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -4273,12 +4273,12 @@ bgp_static_set (struct vty *vty, const char *ip_str, ret = str2prefix (ip_str, &p); if (! ret) { - vty_outln (vty, "%% Malformed prefix"); + vty_out (vty, "%% Malformed prefix\n"); return CMD_WARNING_CONFIG_FAILED; } if (afi == AFI_IP6 && IN6_IS_ADDR_LINKLOCAL (&p.u.prefix6)) { - vty_outln (vty,"%% Malformed prefix (link-local address)"); + vty_out (vty,"%% Malformed prefix (link-local address)\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -4295,7 +4295,7 @@ bgp_static_set (struct vty *vty, const char *ip_str, /* Label index cannot be changed. */ if (bgp_static->label_index != label_index) { - vty_outln (vty, "%% Label index cannot be changed"); + vty_out (vty, "%% Label index cannot be changed\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -4367,12 +4367,12 @@ bgp_static_unset (struct vty *vty, const char *ip_str, ret = str2prefix (ip_str, &p); if (! ret) { - vty_outln (vty, "%% Malformed prefix"); + vty_out (vty, "%% Malformed prefix\n"); return CMD_WARNING_CONFIG_FAILED; } if (afi == AFI_IP6 && IN6_IS_ADDR_LINKLOCAL (&p.u.prefix6)) { - vty_outln (vty,"%% Malformed prefix (link-local address)"); + vty_out (vty,"%% Malformed prefix (link-local address)\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -4381,7 +4381,7 @@ bgp_static_unset (struct vty *vty, const char *ip_str, rn = bgp_node_lookup (bgp->route[afi][safi], &p); if (! rn) { - vty_outln (vty,"%% Can't find specified static route configuration."); + vty_out (vty,"%% Can't find specified static route configuration.\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -4579,21 +4579,21 @@ bgp_static_set_safi (afi_t afi, safi_t safi, struct vty *vty, const char *ip_str ret = str2prefix (ip_str, &p); if (! ret) { - vty_outln (vty, "%% Malformed prefix"); + vty_out (vty, "%% Malformed prefix\n"); return CMD_WARNING_CONFIG_FAILED; } apply_mask (&p); if ( (afi == AFI_L2VPN) && (bgp_build_evpn_prefix ( evpn_type, ethtag!=NULL?atol(ethtag):0, &p))) { - vty_outln (vty, "%% L2VPN prefix could not be forged"); + vty_out (vty, "%% L2VPN prefix could not be forged\n"); return CMD_WARNING_CONFIG_FAILED; } ret = str2prefix_rd (rd_str, &prd); if (! ret) { - vty_outln (vty, "%% Malformed rd"); + vty_out (vty, "%% Malformed rd\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -4608,12 +4608,12 @@ bgp_static_set_safi (afi_t afi, safi_t safi, struct vty *vty, const char *ip_str { if( esi && str2esi (esi, NULL) == 0) { - vty_outln (vty, "%% Malformed ESI"); + vty_out (vty, "%% Malformed ESI\n"); return CMD_WARNING_CONFIG_FAILED; } if( routermac && prefix_str2mac (routermac, NULL) == 0) { - vty_outln (vty, "%% Malformed Router MAC"); + vty_out (vty, "%% Malformed Router MAC\n"); return CMD_WARNING_CONFIG_FAILED; } if (gwip) @@ -4622,7 +4622,7 @@ bgp_static_set_safi (afi_t afi, safi_t safi, struct vty *vty, const char *ip_str ret = str2prefix (gwip, &gw_ip); if (! ret) { - vty_outln (vty, "%% Malformed GatewayIp"); + vty_out (vty, "%% Malformed GatewayIp\n"); return CMD_WARNING_CONFIG_FAILED; } if((gw_ip.family == AF_INET && @@ -4630,7 +4630,7 @@ bgp_static_set_safi (afi_t afi, safi_t safi, struct vty *vty, const char *ip_str (gw_ip.family == AF_INET6 && IS_EVPN_PREFIX_IPADDR_V4((struct prefix_evpn *)&p))) { - vty_outln (vty, "%% GatewayIp family differs with IP prefix"); + vty_out (vty, "%% GatewayIp family differs with IP prefix\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -4647,7 +4647,7 @@ bgp_static_set_safi (afi_t afi, safi_t safi, struct vty *vty, const char *ip_str if (rn->info) { - vty_outln (vty, "%% Same network configuration exists"); + vty_out (vty, "%% Same network configuration exists\n"); bgp_unlock_node (rn); } else @@ -4713,20 +4713,20 @@ bgp_static_unset_safi(afi_t afi, safi_t safi, struct vty *vty, const char *ip_st ret = str2prefix (ip_str, &p); if (! ret) { - vty_outln (vty, "%% Malformed prefix"); + vty_out (vty, "%% Malformed prefix\n"); return CMD_WARNING_CONFIG_FAILED; } apply_mask (&p); if ( (afi == AFI_L2VPN) && (bgp_build_evpn_prefix ( evpn_type, ethtag!=NULL?atol(ethtag):0, &p))) { - vty_outln (vty, "%% L2VPN prefix could not be forged"); + vty_out (vty, "%% L2VPN prefix could not be forged\n"); return CMD_WARNING_CONFIG_FAILED; } ret = str2prefix_rd (rd_str, &prd); if (! ret) { - vty_outln (vty, "%% Malformed rd"); + vty_out (vty, "%% Malformed rd\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -4758,7 +4758,7 @@ bgp_static_unset_safi(afi_t afi, safi_t safi, struct vty *vty, const char *ip_st bgp_unlock_node (rn); } else - vty_outln (vty, "%% Can't find the route"); + vty_out (vty, "%% Can't find the route\n"); return CMD_SUCCESS; } @@ -4816,7 +4816,7 @@ bgp_config_write_table_map (struct vty *vty, struct bgp *bgp, afi_t afi, if (bgp->table_map[afi][safi].name) { bgp_config_write_family_header (vty, afi, safi, write); - vty_outln (vty, " table-map %s", + vty_out (vty, " table-map %s\n", bgp->table_map[afi][safi].name); } @@ -4900,7 +4900,7 @@ DEFUN (bgp_network_mask, ret = netmask_str2prefix_str (argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, prefix_str); if (! ret) { - vty_outln (vty, "%% Inconsistent address and mask"); + vty_out (vty, "%% Inconsistent address and mask\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -4927,7 +4927,7 @@ DEFUN (bgp_network_mask_route_map, ret = netmask_str2prefix_str (argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, prefix_str); if (! ret) { - vty_outln (vty, "%% Inconsistent address and mask"); + vty_out (vty, "%% Inconsistent address and mask\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -4952,7 +4952,7 @@ DEFUN (bgp_network_mask_backdoor, ret = netmask_str2prefix_str (argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, prefix_str); if (! ret) { - vty_outln (vty, "%% Inconsistent address and mask"); + vty_out (vty, "%% Inconsistent address and mask\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -4974,7 +4974,7 @@ DEFUN (bgp_network_mask_natural, ret = netmask_str2prefix_str (argv[idx_ipv4]->arg, NULL, prefix_str); if (! ret) { - vty_outln (vty, "%% Inconsistent address and mask"); + vty_out (vty, "%% Inconsistent address and mask\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -4999,7 +4999,7 @@ DEFUN (bgp_network_mask_natural_route_map, ret = netmask_str2prefix_str (argv[idx_ipv4]->arg, NULL, prefix_str); if (! ret) { - vty_outln (vty, "%% Inconsistent address and mask"); + vty_out (vty, "%% Inconsistent address and mask\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -5022,7 +5022,7 @@ DEFUN (bgp_network_mask_natural_backdoor, ret = netmask_str2prefix_str (argv[idx_ipv4]->arg, NULL, prefix_str); if (! ret) { - vty_outln (vty, "%% Inconsistent address and mask"); + vty_out (vty, "%% Inconsistent address and mask\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -5097,7 +5097,7 @@ DEFUN (no_bgp_network_mask, ret = netmask_str2prefix_str (argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, prefix_str); if (! ret) { - vty_outln (vty, "%% Inconsistent address and mask"); + vty_out (vty, "%% Inconsistent address and mask\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -5122,7 +5122,7 @@ DEFUN (no_bgp_network_mask_natural, ret = netmask_str2prefix_str (argv[idx_ipv4]->arg, NULL, prefix_str); if (! ret) { - vty_outln (vty, "%% Inconsistent address and mask"); + vty_out (vty, "%% Inconsistent address and mask\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -5756,7 +5756,7 @@ bgp_aggregate_unset (struct vty *vty, const char *prefix_str, ret = str2prefix (prefix_str, &p); if (!ret) { - vty_outln (vty, "Malformed prefix"); + vty_out (vty, "Malformed prefix\n"); return CMD_WARNING_CONFIG_FAILED; } apply_mask (&p); @@ -5765,7 +5765,7 @@ bgp_aggregate_unset (struct vty *vty, const char *prefix_str, rn = bgp_node_lookup (bgp->aggregate[afi][safi], &p); if (! rn) { - vty_outln (vty,"%% There is no aggregate-address configuration."); + vty_out (vty,"%% There is no aggregate-address configuration.\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -5801,7 +5801,7 @@ bgp_aggregate_set (struct vty *vty, const char *prefix_str, ret = str2prefix (prefix_str, &p); if (!ret) { - vty_outln (vty, "Malformed prefix"); + vty_out (vty, "Malformed prefix\n"); return CMD_WARNING_CONFIG_FAILED; } apply_mask (&p); @@ -5811,12 +5811,12 @@ bgp_aggregate_set (struct vty *vty, const char *prefix_str, if (rn->info) { - vty_outln (vty, "There is already same aggregate network."); + vty_out (vty, "There is already same aggregate network.\n"); /* try to remove the old entry */ ret = bgp_aggregate_unset (vty, prefix_str, afi, safi); if (ret) { - vty_outln (vty, "Error deleting aggregate."); + vty_out (vty, "Error deleting aggregate.\n"); bgp_unlock_node (rn); return CMD_WARNING_CONFIG_FAILED; } @@ -5884,7 +5884,7 @@ DEFUN (aggregate_address_mask, if (! ret) { - vty_outln (vty, "%% Inconsistent address and mask"); + vty_out (vty, "%% Inconsistent address and mask\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -5930,7 +5930,7 @@ DEFUN (no_aggregate_address_mask, if (! ret) { - vty_outln (vty, "%% Inconsistent address and mask"); + vty_out (vty, "%% Inconsistent address and mask\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -6191,7 +6191,7 @@ route_vty_out_route (struct prefix *p, struct vty *vty) len = 17 - len; if (len < 1) - vty_out (vty, "%s%*s", VTYNL, 20, " "); + vty_out (vty, "\n%*s", 20, " "); else vty_out (vty, "%*s", len, " "); } @@ -6415,7 +6415,7 @@ route_vty_out (struct vty *vty, struct prefix *p, len = 7 - len; /* len of IPv6 addr + max len of def ifname */ if (len < 1) - vty_out (vty, "%s%*s", VTYNL, 45, " "); + vty_out (vty, "\n%*s", 45, " "); else vty_out (vty, "%*s", len, " "); } @@ -6428,7 +6428,7 @@ route_vty_out (struct vty *vty, struct prefix *p, len = 16 - len; if (len < 1) - vty_out (vty, "%s%*s", VTYNL, 36, " "); + vty_out (vty, "\n%*s", 36, " "); else vty_out (vty, "%*s", len, " "); } @@ -6442,7 +6442,7 @@ route_vty_out (struct vty *vty, struct prefix *p, len = 16 - len; if (len < 1) - vty_out (vty, "%s%*s", VTYNL, 36, " "); + vty_out (vty, "\n%*s", 36, " "); else vty_out (vty, "%*s", len, " "); } @@ -6504,7 +6504,7 @@ route_vty_out (struct vty *vty, struct prefix *p, if (json_paths) json_object_string_add(json_path, "alert", "No attributes"); else - vty_outln (vty, "No attributes to print"); + vty_out (vty, "No attributes to print\n"); } if (json_paths) @@ -6526,7 +6526,7 @@ route_vty_out (struct vty *vty, struct prefix *p, } else { - vty_out (vty, VTYNL); + vty_out (vty, "\n"); #if ENABLE_BGP_VNC /* prints an additional line, indented, with VNC info, if present */ if ((safi == SAFI_MPLS_VPN) || (safi == SAFI_ENCAP)) @@ -6630,7 +6630,7 @@ route_vty_out_tmp (struct vty *vty, struct prefix *p, struct attr *attr, safi_t buf, BUFSIZ)); len = 16 - len; if (len < 1) - vty_out (vty, "%s%*s", VTYNL, 36, " "); + vty_out (vty, "\n%*s", 36, " "); else vty_out (vty, "%*s", len, " "); } @@ -6663,7 +6663,7 @@ route_vty_out_tmp (struct vty *vty, struct prefix *p, struct attr *attr, safi_t json_object_object_add(json_ar, inet_ntop (p->family, &p->u.prefix, buf_cut, BUFSIZ), json_net); } else - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } void @@ -6767,7 +6767,7 @@ route_vty_out_tag (struct vty *vty, struct prefix *p, else { vty_out (vty, "notag/%d", label); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } } @@ -6855,7 +6855,7 @@ route_vty_out_overlay (struct vty *vty, struct prefix *p, } } } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } /* dampening route */ @@ -6884,7 +6884,7 @@ damp_route_vty_out (struct vty *vty, struct prefix *p, struct bgp_info *binfo, if (len < 1) { if (!use_json) - vty_out (vty, "%s%*s", VTYNL, 34, " "); + vty_out (vty, "\n%*s", 34, " "); } else { @@ -6919,7 +6919,7 @@ damp_route_vty_out (struct vty *vty, struct prefix *p, struct bgp_info *binfo, vty_out (vty, "%s", bgp_origin_str[attr->origin]); } if (!use_json) - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } /* flap route */ @@ -6954,7 +6954,7 @@ flap_route_vty_out (struct vty *vty, struct prefix *p, struct bgp_info *binfo, if (len < 1) { if (!use_json) - vty_out (vty, "%s%*s", VTYNL, 33, " "); + vty_out (vty, "\n%*s", 33, " "); } else { @@ -7019,7 +7019,7 @@ flap_route_vty_out (struct vty *vty, struct prefix *p, struct bgp_info *binfo, vty_out (vty, "%s", bgp_origin_str[attr->origin]); } if (!use_json) - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } static void @@ -7193,7 +7193,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p, } if (!json_paths) - vty_out (vty, VTYNL); + vty_out (vty, "\n"); /* Line2 display Next-hop, Neighbor, Router-id */ /* Display the nexthop */ @@ -7343,7 +7343,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p, } if (!json_paths) - vty_out (vty, VTYNL); + vty_out (vty, "\n"); /* display the link-local nexthop */ if (attr->extra && attr->extra->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL) @@ -7366,7 +7366,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p, } else { - vty_outln (vty, " (%s) %s", + vty_out (vty, " (%s) %s\n", inet_ntop (AF_INET6, &attr->extra->mp_nexthop_local, buf, INET6_ADDRSTRLEN), attr->extra->mp_nexthop_prefer_global ? "(prefer-global)" : "(used)"); @@ -7562,7 +7562,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p, json_object_object_add(json_path, "bestpath", json_bestpath); if (!json_paths) - vty_out (vty, VTYNL); + vty_out (vty, "\n"); /* Line 4 display Community */ if (attr->community) @@ -7574,7 +7574,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p, } else { - vty_outln (vty, " Community: %s",attr->community->str); + vty_out (vty, " Community: %s\n",attr->community->str); } } @@ -7589,14 +7589,14 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p, } else { - vty_outln (vty, " Extended Community: %s", + vty_out (vty, " Extended Community: %s\n", attr->extra->ecommunity->str); } } /* Line 6 display Large community */ if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES)) - vty_outln (vty, " Large Community: %s", + vty_out (vty, " Large Community: %s\n", attr->extra->lcommunity->str); /* Line 7 display Originator, Cluster-id */ @@ -7649,7 +7649,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p, } if (!json_paths) - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } if (binfo->extra && binfo->extra->damp_info) @@ -7662,7 +7662,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p, if (json_paths) json_object_int_add(json_path, "remoteLabel", label); else - vty_outln (vty, " Remote label: %d", label); + vty_out (vty, " Remote label: %d\n", label); } /* Label Index */ @@ -7671,7 +7671,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p, if (json_paths) json_object_int_add(json_path, "labelIndex", attr->extra->label_index); else - vty_outln (vty, " Label Index: %d", + vty_out (vty, " Label Index: %d\n", attr->extra->label_index); } @@ -7685,7 +7685,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p, } else { - vty_outln (vty, " AddPath ID: RX %u, TX %u", + vty_out (vty, " AddPath ID: RX %u, TX %u\n", binfo->addpath_rx_id,binfo->addpath_tx_id); } } @@ -7724,7 +7724,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p, { if (!first) { - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } } @@ -7764,12 +7764,12 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p, json_object_array_add(json_paths, json_path); } else - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } #define BGP_SHOW_HEADER_CSV "Flags, Network, Next Hop, Metric, LocPrf, Weight, Path" -#define BGP_SHOW_DAMP_HEADER " Network From Reuse Path" -#define BGP_SHOW_FLAP_HEADER " Network From Flaps Duration Reuse Path" +#define BGP_SHOW_DAMP_HEADER " Network From Reuse Path\n" +#define BGP_SHOW_FLAP_HEADER " Network From Flaps Duration Reuse Path\n" static int bgp_show_prefix_list (struct vty *vty, struct bgp *bgp, @@ -7986,18 +7986,18 @@ bgp_show_table (struct vty *vty, struct bgp *bgp, struct bgp_table *table, if (!use_json && header) { - vty_outln (vty, "BGP table version is %" PRIu64 ", local router ID is %s", table->version, + vty_out (vty, "BGP table version is %" PRIu64 ", local router ID is %s\n", table->version, inet_ntoa(bgp->router_id)); - vty_outln (vty, BGP_SHOW_SCODE_HEADER, VTYNL); - vty_outln (vty, BGP_SHOW_OCODE_HEADER, VTYNL); + vty_out (vty, BGP_SHOW_SCODE_HEADER); + vty_out (vty, BGP_SHOW_OCODE_HEADER); if (type == bgp_show_type_dampend_paths || type == bgp_show_type_damp_neighbor) - vty_outln (vty, BGP_SHOW_DAMP_HEADER); + vty_out (vty, BGP_SHOW_DAMP_HEADER); else if (type == bgp_show_type_flap_statistics || type == bgp_show_type_flap_neighbor) - vty_outln (vty, BGP_SHOW_FLAP_HEADER); + vty_out (vty, BGP_SHOW_FLAP_HEADER); else - vty_outln (vty, BGP_SHOW_HEADER); + vty_out (vty, BGP_SHOW_HEADER); header = 0; } @@ -8031,7 +8031,7 @@ bgp_show_table (struct vty *vty, struct bgp *bgp, struct bgp_table *table, if (use_json) { json_object_free (json_paths); - vty_outln (vty, " } }"); + vty_out (vty, " } }\n"); } else { @@ -8039,12 +8039,11 @@ bgp_show_table (struct vty *vty, struct bgp *bgp, struct bgp_table *table, if (output_count == 0) { if (type == bgp_show_type_normal) - vty_outln (vty, "No BGP prefixes displayed, %ld exist", + vty_out (vty, "No BGP prefixes displayed, %ld exist\n", total_count); } else - vty_outln (vty, "%sDisplayed %ld routes and %ld total paths", - VTYNL, output_count, total_count); + vty_out (vty, "\nDisplayed %ld routes and %ld total paths\n", output_count, total_count); } return CMD_SUCCESS; @@ -8064,7 +8063,7 @@ bgp_show (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi, if (bgp == NULL) { if (!use_json) - vty_outln (vty, "No BGP process is configured"); + vty_out (vty, "No BGP process is configured\n"); return CMD_WARNING; } @@ -8093,14 +8092,14 @@ bgp_show_all_instances_routes_vty (struct vty *vty, afi_t afi, safi_t safi, int is_first = 1; if (use_json) - vty_outln (vty, "{"); + vty_out (vty, "{\n"); for (ALL_LIST_ELEMENTS (bm->bgp, node, nnode, bgp)) { if (use_json) { if (! is_first) - vty_outln (vty, ","); + vty_out (vty, ",\n"); else is_first = 0; @@ -8109,8 +8108,7 @@ bgp_show_all_instances_routes_vty (struct vty *vty, afi_t afi, safi_t safi, } else { - vty_outln (vty, "%sInstance %s:", - VTYNL, + vty_out (vty, "\nInstance %s:\n", (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT) ? "Default" : bgp->name); } bgp_show (vty, bgp, afi, safi, bgp_show_type_normal, NULL, use_json); @@ -8118,7 +8116,7 @@ bgp_show_all_instances_routes_vty (struct vty *vty, afi_t afi, safi_t safi, } if (use_json) - vty_outln (vty, "}"); + vty_out (vty, "}\n"); } /* Header of detailed BGP route information */ @@ -8165,7 +8163,7 @@ route_vty_out_detail_header (struct vty *vty, struct bgp *bgp, prefix2str (p, buf2, INET6_ADDRSTRLEN); else inet_ntop (p->family, &p->u.prefix, buf2, INET6_ADDRSTRLEN); - vty_outln (vty, "BGP routing table entry for %s%s%s/%d", + vty_out (vty, "BGP routing table entry for %s%s%s/%d\n", ((safi == SAFI_MPLS_VPN || safi == SAFI_ENCAP || safi == SAFI_EVPN) ? prefix_rd2str (prd, buf1, RD_ADDRSTRLEN) : ""), ((safi == SAFI_MPLS_VPN) || (safi == SAFI_EVPN)) ? ":" : "", @@ -8173,9 +8171,9 @@ route_vty_out_detail_header (struct vty *vty, struct bgp *bgp, p->prefixlen); if (has_valid_label) - vty_outln (vty, "Local label: %d", label); + vty_out (vty, "Local label: %d\n", label); else if (bgp_labeled_safi(safi)) - vty_outln (vty, "Local label: not allocated"); + vty_out (vty, "Local label: not allocated\n"); } for (ri = rn->info; ri; ri = ri->next) @@ -8221,7 +8219,7 @@ route_vty_out_detail_header (struct vty *vty, struct bgp *bgp, if (suppress) vty_out (vty, ", Advertisements suppressed by an aggregate."); - vty_outln (vty, ")"); + vty_out (vty, ")\n"); } /* If we are not using addpath then we can display Advertised to and that will @@ -8253,7 +8251,7 @@ route_vty_out_detail_header (struct vty *vty, struct bgp *bgp, { if (first) vty_out (vty, " Not advertised to any peer"); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } } @@ -8281,7 +8279,7 @@ bgp_show_route_in_table (struct vty *vty, struct bgp *bgp, ret = str2prefix (ip_str, &match); if (! ret) { - vty_outln (vty, "address is malformed"); + vty_out (vty, "address is malformed\n"); return CMD_WARNING; } @@ -8368,7 +8366,7 @@ bgp_show_route_in_table (struct vty *vty, struct bgp *bgp, if (display) json_object_object_add(json, "paths", json_paths); - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } @@ -8376,7 +8374,7 @@ bgp_show_route_in_table (struct vty *vty, struct bgp *bgp, { if (!display) { - vty_outln (vty, "%% Network not in table"); + vty_out (vty, "%% Network not in table\n"); return CMD_WARNING; } } @@ -8436,7 +8434,7 @@ bgp_show_lcommunity (struct vty *vty, struct bgp *bgp, int argc, XFREE (MTYPE_TMP, str); if (! lcom) { - vty_outln (vty, "%% Large-community malformed"); + vty_out (vty, "%% Large-community malformed\n"); return CMD_WARNING; } @@ -8452,7 +8450,7 @@ bgp_show_lcommunity_list (struct vty *vty, struct bgp *bgp, const char *lcom, list = community_list_lookup (bgp_clist, lcom, LARGE_COMMUNITY_LIST_MASTER); if (list == NULL) { - vty_outln (vty, "%% %s is not a valid large-community-list name",lcom); + vty_out (vty, "%% %s is not a valid large-community-list name\n",lcom); return CMD_WARNING; } @@ -8494,7 +8492,7 @@ DEFUN (show_ip_bgp_large_community_list, struct bgp *bgp = bgp_lookup_by_name (vrf); if (bgp == NULL) { - vty_outln (vty, "Can't find BGP instance %s", vrf); + vty_out (vty, "Can't find BGP instance %s\n", vrf); return CMD_WARNING; } @@ -8535,7 +8533,7 @@ DEFUN (show_ip_bgp_large_community, struct bgp *bgp = bgp_lookup_by_name (vrf); if (bgp == NULL) { - vty_outln (vty, "Can't find BGP instance %s", vrf); + vty_out (vty, "Can't find BGP instance %s\n", vrf); return CMD_WARNING; } @@ -8704,8 +8702,8 @@ DEFUN (show_ip_bgp_route, if (!bgp) { - vty_outln (vty, - "Specified 'all' vrf's but this command currently only works per view/vrf"); + vty_out (vty, + "Specified 'all' vrf's but this command currently only works per view/vrf\n"); return CMD_WARNING; } @@ -8717,14 +8715,14 @@ DEFUN (show_ip_bgp_route, if ((argv[idx]->type == IPV6_TKN || argv[idx]->type == IPV6_PREFIX_TKN) && afi != AFI_IP6) { - vty_outln (vty, - "%% Cannot specify IPv6 address or prefix with IPv4 AFI"); + vty_out (vty, + "%% Cannot specify IPv6 address or prefix with IPv4 AFI\n"); return CMD_WARNING; } if ((argv[idx]->type == IPV4_TKN || argv[idx]->type == IPV4_PREFIX_TKN) && afi != AFI_IP) { - vty_outln (vty, - "%% Cannot specify IPv4 address or prefix with IPv6 AFI"); + vty_out (vty, + "%% Cannot specify IPv4 address or prefix with IPv6 AFI\n"); return CMD_WARNING; } @@ -8809,7 +8807,7 @@ bgp_show_regexp (struct vty *vty, const char *regstr, afi_t afi, regex = bgp_regcomp (regstr); if (! regex) { - vty_outln (vty, "Can't compile regexp %s", regstr); + vty_out (vty, "Can't compile regexp %s\n", regstr); return CMD_WARNING; } @@ -8828,7 +8826,7 @@ bgp_show_prefix_list (struct vty *vty, struct bgp *bgp, plist = prefix_list_lookup (afi, prefix_list_str); if (plist == NULL) { - vty_outln (vty, "%% %s is not a valid prefix-list name", + vty_out (vty, "%% %s is not a valid prefix-list name\n", prefix_list_str); return CMD_WARNING; } @@ -8846,7 +8844,7 @@ bgp_show_filter_list (struct vty *vty, struct bgp *bgp, as_list = as_list_lookup (filter); if (as_list == NULL) { - vty_outln (vty, "%% %s is not a valid AS-path access-list name", + vty_out (vty, "%% %s is not a valid AS-path access-list name\n", filter); return CMD_WARNING; } @@ -8864,7 +8862,7 @@ bgp_show_route_map (struct vty *vty, struct bgp *bgp, rmap = route_map_lookup_by_name (rmap_str); if (! rmap) { - vty_outln (vty, "%% %s is not a valid route-map name", + vty_out (vty, "%% %s is not a valid route-map name\n", rmap_str); return CMD_WARNING; } @@ -8906,7 +8904,7 @@ bgp_show_community (struct vty *vty, struct bgp *bgp, int argc, XFREE (MTYPE_TMP, str); if (! com) { - vty_outln (vty, "%% Community malformed: "); + vty_out (vty, "%% Community malformed: \n"); return CMD_WARNING; } @@ -8928,7 +8926,7 @@ bgp_show_community_list (struct vty *vty, struct bgp *bgp, list = community_list_lookup (bgp_clist, com, COMMUNITY_LIST_MASTER); if (list == NULL) { - vty_outln (vty, "%% %s is not a valid community-list name",com); + vty_out (vty, "%% %s is not a valid community-list name\n",com); return CMD_WARNING; } @@ -8950,7 +8948,7 @@ bgp_show_prefix_longer (struct vty *vty, struct bgp *bgp, ret = str2prefix (prefix, p); if (! ret) { - vty_outln (vty, "%% Malformed Prefix"); + vty_out (vty, "%% Malformed Prefix\n"); return CMD_WARNING; } @@ -8983,11 +8981,11 @@ peer_lookup_in_view (struct vty *vty, struct bgp *bgp, json_object *json_no = NULL; json_no = json_object_new_object(); json_object_string_add(json_no, "malformedAddressOrName", ip_str); - vty_outln (vty, "%s", json_object_to_json_string(json_no)); + vty_out (vty, "%s\n", json_object_to_json_string(json_no)); json_object_free(json_no); } else - vty_outln (vty, "%% Malformed address or name: %s", ip_str); + vty_out (vty, "%% Malformed address or name: %s\n", ip_str); return NULL; } } @@ -9003,11 +9001,11 @@ peer_lookup_in_view (struct vty *vty, struct bgp *bgp, json_object *json_no = NULL; json_no = json_object_new_object(); json_object_string_add(json_no, "warning","No such neighbor"); - vty_outln (vty, "%s", json_object_to_json_string(json_no)); + vty_out (vty, "%s\n", json_object_to_json_string(json_no)); json_object_free(json_no); } else - vty_outln (vty, "No such neighbor"); + vty_out (vty, "No such neighbor\n"); return NULL; } @@ -9185,13 +9183,13 @@ bgp_table_stats (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi) if (!bgp->rib[afi][safi]) { - vty_outln (vty, "%% No RIB exist's for the AFI(%d)/SAFI(%d)", + vty_out (vty, "%% No RIB exist's for the AFI(%d)/SAFI(%d)\n", afi, safi); return CMD_WARNING; } - vty_outln (vty, "BGP %s RIB statistics%s", - afi_safi_print (afi, safi), VTYNL); + vty_out (vty, "BGP %s RIB statistics\n", + afi_safi_print (afi, safi)); /* labeled-unicast routes live in the unicast table */ if (safi == SAFI_LABELED_UNICAST) @@ -9236,14 +9234,14 @@ bgp_table_stats (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi) break; case BGP_STATS_SPACE: vty_out (vty, "%-30s: ", table_stats_strs[i]); - vty_outln (vty, "%12llu", ts.counts[i]); + vty_out (vty, "%12llu\n", ts.counts[i]); if (ts.counts[BGP_STATS_MAXBITLEN] < 9) break; vty_out (vty, "%30s: ", "%% announced "); - vty_outln (vty, "%12.2f", + vty_out (vty, "%12.2f\n", 100 * (float)ts.counts[BGP_STATS_SPACE] / (float)((uint64_t)1UL << ts.counts[BGP_STATS_MAXBITLEN])); vty_out (vty, "%30s: ", "/8 equivalent "); - vty_outln (vty, "%12.2f", + vty_out (vty, "%12.2f\n", (float)ts.counts[BGP_STATS_SPACE] / (float)(1UL << (ts.counts[BGP_STATS_MAXBITLEN] - 8))); if (ts.counts[BGP_STATS_MAXBITLEN] < 25) break; @@ -9257,7 +9255,7 @@ bgp_table_stats (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi) vty_out (vty, "%12llu", ts.counts[i]); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } return CMD_SUCCESS; } @@ -9381,11 +9379,11 @@ bgp_peer_counts (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, u_c if (use_json) { json_object_string_add(json, "warning", "No such neighbor or address family"); - vty_outln (vty, "%s", json_object_to_json_string(json)); + vty_out (vty, "%s\n", json_object_to_json_string(json)); json_object_free(json); } else - vty_outln (vty, "%% No such neighbor or address family"); + vty_out (vty, "%% No such neighbor or address family\n"); return CMD_WARNING; } @@ -9416,7 +9414,7 @@ bgp_peer_counts (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, u_c json_object_string_add(json, "pfxctDriftFor", peer->host); json_object_string_add(json, "recommended", "Please report this bug, with the above command output"); } - vty_outln (vty, "%s", json_object_to_json_string(json)); + vty_out (vty, "%s\n", json_object_to_json_string(json)); json_object_free(json); } else @@ -9424,28 +9422,27 @@ bgp_peer_counts (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, u_c if (peer->hostname && bgp_flag_check(peer->bgp, BGP_FLAG_SHOW_HOSTNAME)) { - vty_outln (vty, "Prefix counts for %s/%s, %s", + vty_out (vty, "Prefix counts for %s/%s, %s\n", peer->hostname, peer->host,afi_safi_print(afi, safi)); } else { - vty_outln (vty, "Prefix counts for %s, %s", + vty_out (vty, "Prefix counts for %s, %s\n", peer->host, afi_safi_print(afi, safi)); } - vty_outln (vty, "PfxCt: %ld", peer->pcount[afi][safi]); - vty_outln (vty, "%sCounts from RIB table walk:%s", - VTYNL, VTYNL); + vty_out (vty, "PfxCt: %ld\n", peer->pcount[afi][safi]); + vty_out (vty, "\nCounts from RIB table walk:\n\n"); for (i = 0; i < PCOUNT_MAX; i++) - vty_outln (vty, "%20s: %-10d", pcount_strs[i], pcounts.count[i]); + vty_out (vty, "%20s: %-10d\n", pcount_strs[i], pcounts.count[i]); if (pcounts.count[PCOUNT_PFCNT] != peer->pcount[afi][safi]) { - vty_outln (vty, "%s [pcount] PfxCt drift!", + vty_out (vty, "%s [pcount] PfxCt drift!\n", peer->host); - vty_outln (vty, - "Please report this bug, with the above command output"); + vty_out (vty, + "Please report this bug, with the above command output\n"); } } @@ -9534,7 +9531,7 @@ DEFUN (show_ip_bgp_vpn_all_route_prefix, struct bgp *bgp = bgp_get_default(); if (!bgp) { - vty_outln (vty, "Can't find default instance"); + vty_out (vty, "Can't find default instance\n"); return CMD_WARNING; } @@ -9544,7 +9541,7 @@ DEFUN (show_ip_bgp_vpn_all_route_prefix, network = argv[idx]->arg; else { - vty_outln (vty, "Unable to figure out Network"); + vty_out (vty, "Unable to figure out Network\n"); return CMD_WARNING; } @@ -9574,7 +9571,7 @@ DEFUN (show_ip_bgp_l2vpn_evpn_all_route_prefix, network = argv[idx]->arg; else { - vty_outln (vty, "Unable to figure out Network"); + vty_out (vty, "Unable to figure out Network\n"); return CMD_WARNING; } return bgp_show_route (vty, NULL, network, AFI_L2VPN, SAFI_EVPN, NULL, 0, BGP_PATH_ALL, use_json(argc, argv)); @@ -9631,11 +9628,11 @@ show_adj_route (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, if (use_json) { json_object_string_add(json, "alert", "no BGP"); - vty_outln (vty, "%s", json_object_to_json_string(json)); + vty_out (vty, "%s\n", json_object_to_json_string(json)); json_object_free(json); } else - vty_outln (vty, "%% No bgp"); + vty_out (vty, "%% No bgp\n"); return; } @@ -9656,13 +9653,12 @@ show_adj_route (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, } else { - vty_outln (vty, "BGP table version is %" PRIu64 ", local router ID is %s", table->version, + vty_out (vty, "BGP table version is %" PRIu64 ", local router ID is %s\n", table->version, inet_ntoa(bgp->router_id)); - vty_outln (vty, BGP_SHOW_SCODE_HEADER, VTYNL); - vty_outln (vty, BGP_SHOW_OCODE_HEADER, VTYNL); + vty_out (vty, BGP_SHOW_SCODE_HEADER); + vty_out (vty, BGP_SHOW_OCODE_HEADER); - vty_outln (vty, "Originating default network 0.0.0.0%s", - VTYNL); + vty_out (vty, "Originating default network 0.0.0.0\n\n"); } header1 = 0; } @@ -9687,17 +9683,17 @@ show_adj_route (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, } else { - vty_outln (vty, "BGP table version is 0, local router ID is %s", + vty_out (vty, "BGP table version is 0, local router ID is %s\n", inet_ntoa(bgp->router_id)); - vty_outln (vty, BGP_SHOW_SCODE_HEADER, VTYNL); - vty_outln (vty, BGP_SHOW_OCODE_HEADER, VTYNL); + vty_out (vty, BGP_SHOW_SCODE_HEADER); + vty_out (vty, BGP_SHOW_OCODE_HEADER); } header1 = 0; } if (header2) { if (!use_json) - vty_outln (vty, BGP_SHOW_HEADER); + vty_out (vty, BGP_SHOW_HEADER); header2 = 0; } if (ain->attr) @@ -9731,10 +9727,10 @@ show_adj_route (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, } else { - vty_outln (vty, "BGP table version is %" PRIu64 ", local router ID is %s", table->version, + vty_out (vty, "BGP table version is %" PRIu64 ", local router ID is %s\n", table->version, inet_ntoa(bgp->router_id)); - vty_outln (vty, BGP_SHOW_SCODE_HEADER, VTYNL); - vty_outln (vty, BGP_SHOW_OCODE_HEADER, VTYNL); + vty_out (vty, BGP_SHOW_SCODE_HEADER); + vty_out (vty, BGP_SHOW_OCODE_HEADER); } header1 = 0; } @@ -9742,7 +9738,7 @@ show_adj_route (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, if (header2) { if (!use_json) - vty_outln (vty, BGP_SHOW_HEADER); + vty_out (vty, BGP_SHOW_HEADER); header2 = 0; } @@ -9769,12 +9765,11 @@ show_adj_route (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, if (use_json) json_object_int_add(json, "totalPrefixCounter", output_count); else - vty_outln (vty, "%sTotal number of prefixes %ld", - VTYNL, output_count); + vty_out (vty, "\nTotal number of prefixes %ld\n", output_count); } if (use_json) { - vty_outln (vty, "%s", json_object_to_json_string(json)); + vty_out (vty, "%s\n", json_object_to_json_string(json)); json_object_free(json); } @@ -9798,11 +9793,11 @@ peer_adj_routes (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, if (use_json) { json_object_string_add(json, "warning", "No such neighbor or address family"); - vty_outln (vty, "%s", json_object_to_json_string(json)); + vty_out (vty, "%s\n", json_object_to_json_string(json)); json_object_free(json); } else - vty_outln (vty, "%% No such neighbor or address family"); + vty_out (vty, "%% No such neighbor or address family\n"); return CMD_WARNING; } @@ -9812,11 +9807,11 @@ peer_adj_routes (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, if (use_json) { json_object_string_add(json, "warning", "Inbound soft reconfiguration not enabled"); - vty_outln (vty, "%s", json_object_to_json_string(json)); + vty_out (vty, "%s\n", json_object_to_json_string(json)); json_object_free(json); } else - vty_outln (vty, "%% Inbound soft reconfiguration not enabled"); + vty_out (vty, "%% Inbound soft reconfiguration not enabled\n"); return CMD_WARNING; } @@ -9930,9 +9925,9 @@ DEFUN (show_ip_bgp_neighbor_received_prefix_filter, if (! peer) { if (uj) - vty_outln (vty, "{}"); + vty_out (vty, "{}\n"); else - vty_outln (vty, "%% Malformed address or name: %s", peerstr); + vty_out (vty, "%% Malformed address or name: %s\n", peerstr); return CMD_WARNING; } } @@ -9942,9 +9937,9 @@ DEFUN (show_ip_bgp_neighbor_received_prefix_filter, if (! peer) { if (uj) - vty_outln (vty, "{}"); + vty_out (vty, "{}\n"); else - vty_outln (vty, "No peer"); + vty_out (vty, "No peer\n"); return CMD_WARNING; } } @@ -9954,15 +9949,15 @@ DEFUN (show_ip_bgp_neighbor_received_prefix_filter, if (count) { if (!uj) - vty_outln (vty, "Address Family: %s", afi_safi_print(afi, safi)); + vty_out (vty, "Address Family: %s\n", afi_safi_print(afi, safi)); prefix_bgp_show_prefix_list (vty, afi, name, uj); } else { if (uj) - vty_outln (vty, "{}"); + vty_out (vty, "{}\n"); else - vty_outln (vty, "No functional output"); + vty_out (vty, "No functional output\n"); } return CMD_SUCCESS; @@ -9979,11 +9974,11 @@ bgp_show_neighbor_route (struct vty *vty, struct peer *peer, afi_t afi, json_object *json_no = NULL; json_no = json_object_new_object(); json_object_string_add(json_no, "warning", "No such neighbor or address family"); - vty_outln (vty, "%s", json_object_to_json_string(json_no)); + vty_out (vty, "%s\n", json_object_to_json_string(json_no)); json_object_free(json_no); } else - vty_outln (vty, "%% No such neighbor or address family"); + vty_out (vty, "%% No such neighbor or address family\n"); return CMD_WARNING; } @@ -10036,7 +10031,7 @@ DEFUN (show_ip_bgp_neighbor_routes, peer = peer_lookup_in_view (vty, bgp, peerstr, uj); if (! peer) { - vty_outln (vty, "No such neighbor"); + vty_out (vty, "No such neighbor\n"); return CMD_WARNING; } @@ -10083,7 +10078,7 @@ DEFUN (show_bgp_afi_vpn_rd_route, ret = str2prefix_rd (argv[5]->arg, &prd); if (! ret) { - vty_outln (vty, "%% Malformed Route Distinguisher"); + vty_out (vty, "%% Malformed Route Distinguisher\n"); return CMD_WARNING; } return bgp_show_route (vty, NULL, argv[6]->arg, afi, SAFI_MPLS_VPN, &prd, 0, BGP_PATH_ALL, use_json (argc, argv)); @@ -10119,7 +10114,7 @@ bgp_distance_set (struct vty *vty, const char *distance_str, ret = str2prefix (ip_str, &p); if (ret == 0) { - vty_outln (vty, "Malformed prefix"); + vty_out (vty, "Malformed prefix\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -10171,14 +10166,14 @@ bgp_distance_unset (struct vty *vty, const char *distance_str, ret = str2prefix (ip_str, &p); if (ret == 0) { - vty_outln (vty, "Malformed prefix"); + vty_out (vty, "Malformed prefix\n"); return CMD_WARNING_CONFIG_FAILED; } rn = bgp_node_lookup (bgp_distance_table[afi][safi], (struct prefix *)&p); if (! rn) { - vty_outln (vty, "Can't find specified prefix"); + vty_out (vty, "Can't find specified prefix\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -10187,7 +10182,7 @@ bgp_distance_unset (struct vty *vty, const char *distance_str, if (bdistance->distance != distance) { - vty_outln (vty, "Distance does not match configured"); + vty_out (vty, "Distance does not match configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -10457,7 +10452,7 @@ DEFUN (bgp_damp_set, if (suppress < reuse) { - vty_outln (vty,"Suppress value cannot be less than reuse value "); + vty_out (vty,"Suppress value cannot be less than reuse value \n"); return 0; } @@ -10501,7 +10496,7 @@ bgp_clear_damp_route (struct vty *vty, const char *view_name, bgp = bgp_lookup_by_name (view_name); if (bgp == NULL) { - vty_outln (vty, "%% Can't find BGP instance %s", view_name); + vty_out (vty, "%% Can't find BGP instance %s\n", view_name); return CMD_WARNING; } } @@ -10510,7 +10505,7 @@ bgp_clear_damp_route (struct vty *vty, const char *view_name, bgp = bgp_get_default (); if (bgp == NULL) { - vty_outln (vty, "%% No BGP process is configured"); + vty_out (vty, "%% No BGP process is configured\n"); return CMD_WARNING; } } @@ -10519,7 +10514,7 @@ bgp_clear_damp_route (struct vty *vty, const char *view_name, ret = str2prefix (ip_str, &match); if (! ret) { - vty_outln (vty, "%% address is malformed"); + vty_out (vty, "%% address is malformed\n"); return CMD_WARNING; } @@ -10640,7 +10635,7 @@ DEFUN (clear_ip_bgp_dampening_address_mask, ret = netmask_str2prefix_str (argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, prefix_str); if (! ret) { - vty_outln (vty, "%% Inconsistent address and mask"); + vty_out (vty, "%% Inconsistent address and mask\n"); return CMD_WARNING; } @@ -10692,7 +10687,7 @@ bgp_config_write_network_vpn (struct vty *vty, struct bgp *bgp, if (bgp_static->backdoor) vty_out (vty, " backdoor"); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } return 0; } @@ -10739,7 +10734,7 @@ bgp_config_write_network_evpn (struct vty *vty, struct bgp *bgp, vty_out (vty, " network %s rd %s ethtag %u tag %u esi %s gwip %s routermac %s", buf, rdbuf, p->u.prefix_evpn.eth_tag, decode_label (&bgp_static->label), esi, buf2 , macrouter); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); if (macrouter) XFREE (MTYPE_TMP, macrouter); if (esi) @@ -10814,7 +10809,7 @@ bgp_config_write_network (struct vty *vty, struct bgp *bgp, vty_out (vty, " backdoor"); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } /* Aggregate-address configuration. */ @@ -10848,7 +10843,7 @@ bgp_config_write_network (struct vty *vty, struct bgp *bgp, if (bgp_aggregate->summary_only) vty_out (vty, " summary-only"); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } return 0; @@ -10870,7 +10865,7 @@ bgp_config_write_distance (struct vty *vty, struct bgp *bgp, afi_t afi, || bgp->distance_local[afi][safi] != ZEBRA_IBGP_DISTANCE_DEFAULT)) { bgp_config_write_family_header (vty, afi, safi, write); - vty_outln (vty, " distance bgp %d %d %d", + vty_out (vty, " distance bgp %d %d %d\n", bgp->distance_ebgp[afi][safi], bgp->distance_ibgp[afi][safi], bgp->distance_local[afi][safi]); } @@ -10882,7 +10877,7 @@ bgp_config_write_distance (struct vty *vty, struct bgp *bgp, afi_t afi, char buf[PREFIX_STRLEN]; bgp_config_write_family_header (vty, afi, safi, write); - vty_outln (vty, " distance %d %s %s", bdistance->distance, + vty_out (vty, " distance %d %s %s\n", bdistance->distance, prefix2str (&rn->p, buf, sizeof (buf)), bdistance->access_list ? bdistance->access_list : ""); } diff --git a/bgpd/bgp_route.h b/bgpd/bgp_route.h index 0c77cc1ee..54a56456d 100644 --- a/bgpd/bgp_route.h +++ b/bgpd/bgp_route.h @@ -53,10 +53,10 @@ enum bgp_show_type #define BGP_SHOW_SCODE_HEADER "Status codes: s suppressed, d damped, "\ - "h history, * valid, > best, = multipath,%s"\ - " i internal, r RIB-failure, S Stale, R Removed" -#define BGP_SHOW_OCODE_HEADER "Origin codes: i - IGP, e - EGP, ? - incomplete%s" -#define BGP_SHOW_HEADER " Network Next Hop Metric LocPrf Weight Path" + "h history, * valid, > best, = multipath,\n"\ + " i internal, r RIB-failure, S Stale, R Removed\n" +#define BGP_SHOW_OCODE_HEADER "Origin codes: i - IGP, e - EGP, ? - incomplete\n\n" +#define BGP_SHOW_HEADER " Network Next Hop Metric LocPrf Weight Path\n" /* Ancillary information to struct bgp_info, * used for uncommonly used data (aggregation, MPLS, etc.) diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index dcc58dc54..140c58f37 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -2851,10 +2851,10 @@ bgp_route_match_add (struct vty *vty, switch (ret) { case RMAP_RULE_MISSING: - vty_outln (vty, "%% BGP Can't find rule."); + vty_out (vty, "%% BGP Can't find rule.\n"); return CMD_WARNING_CONFIG_FAILED; case RMAP_COMPILE_ERROR: - vty_outln (vty, "%% BGP Argument is malformed."); + vty_out (vty, "%% BGP Argument is malformed.\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -2900,10 +2900,10 @@ bgp_route_match_delete (struct vty *vty, switch (ret) { case RMAP_RULE_MISSING: - vty_outln (vty, "%% BGP Can't find rule."); + vty_out (vty, "%% BGP Can't find rule.\n"); break; case RMAP_COMPILE_ERROR: - vty_outln (vty, "%% BGP Argument is malformed."); + vty_out (vty, "%% BGP Argument is malformed.\n"); break; } if (dep_name) @@ -3592,7 +3592,7 @@ DEFUN (match_origin, return bgp_route_match_add (vty, "origin", "incomplete", RMAP_EVENT_MATCH_ADDED); - vty_outln (vty, "%% Invalid match origin type"); + vty_out (vty, "%% Invalid match origin type\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3887,7 +3887,7 @@ DEFUN (set_community, /* Can't compile user input into communities attribute. */ if (! com) { - vty_outln (vty, "%% Malformed communities attribute"); + vty_out (vty, "%% Malformed communities attribute\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -4153,7 +4153,7 @@ DEFUN (set_origin, return generic_set_add (vty, VTY_GET_CONTEXT(route_map_index), "origin", "incomplete"); - vty_outln (vty, "%% Invalid set origin type"); + vty_out (vty, "%% Invalid set origin type\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -4212,7 +4212,7 @@ DEFUN (set_aggregator_as, ret = inet_aton (argv[idx_ipv4]->arg, &address); if (ret == 0) { - vty_outln (vty, "Aggregator IP address is invalid"); + vty_out (vty, "Aggregator IP address is invalid\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -4253,7 +4253,7 @@ DEFUN (no_set_aggregator_as, ret = inet_aton (argv[idx_ip]->arg, &address); if (ret == 0) { - vty_outln (vty, "Aggregator IP address is invalid"); + vty_out (vty, "Aggregator IP address is invalid\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -4364,7 +4364,7 @@ DEFUN (set_ipv6_nexthop_global, ret = inet_pton (AF_INET6, argv[idx_ipv6]->arg, &addr); if (!ret) { - vty_outln (vty, "%% Malformed nexthop address"); + vty_out (vty, "%% Malformed nexthop address\n"); return CMD_WARNING_CONFIG_FAILED; } if (IN6_IS_ADDR_UNSPECIFIED(&addr) || @@ -4372,7 +4372,7 @@ DEFUN (set_ipv6_nexthop_global, IN6_IS_ADDR_MULTICAST(&addr) || IN6_IS_ADDR_LINKLOCAL(&addr)) { - vty_outln (vty, "%% Invalid global nexthop address"); + vty_out (vty, "%% Invalid global nexthop address\n"); return CMD_WARNING_CONFIG_FAILED; } diff --git a/bgpd/bgp_updgrp.c b/bgpd/bgp_updgrp.c index 722eed91c..b8971dcd6 100644 --- a/bgpd/bgp_updgrp.c +++ b/bgpd/bgp_updgrp.c @@ -564,17 +564,17 @@ update_group_show_walkcb (struct update_group *updgrp, void *arg) vty = ctx->vty; - vty_outln (vty, "Update-group %" PRIu64 ":", updgrp->id); + vty_out (vty, "Update-group %" PRIu64 ":\n", updgrp->id); vty_out (vty, " Created: %s", timestamp_string (updgrp->uptime)); filter = &updgrp->conf->filter[updgrp->afi][updgrp->safi]; if (filter->map[RMAP_OUT].name) - vty_outln (vty, " Outgoing route map: %s%s", + vty_out (vty, " Outgoing route map: %s%s\n", filter->map[RMAP_OUT].map ? "X" : "", filter->map[RMAP_OUT].name); - vty_outln (vty, " MRAI value (seconds): %d", + vty_out (vty, " MRAI value (seconds): %d\n", updgrp->conf->v_routeadv); if (updgrp->conf->change_local_as) - vty_outln (vty, " Local AS %u%s%s", + vty_out (vty, " Local AS %u%s%s\n", updgrp->conf->change_local_as, CHECK_FLAG (updgrp->conf->flags, PEER_FLAG_LOCAL_AS_NO_PREPEND) ? " no-prepend" : "", @@ -584,49 +584,49 @@ update_group_show_walkcb (struct update_group *updgrp, void *arg) { if (ctx->subgrp_id && (ctx->subgrp_id != subgrp->id)) continue; - vty_out (vty, VTYNL); - vty_outln (vty, " Update-subgroup %" PRIu64 ":", subgrp->id); + vty_out (vty, "\n"); + vty_out (vty, " Update-subgroup %" PRIu64 ":\n", subgrp->id); vty_out (vty, " Created: %s", timestamp_string (subgrp->uptime)); if (subgrp->split_from.update_group_id || subgrp->split_from.subgroup_id) { - vty_outln (vty, " Split from group id: %" PRIu64 "", + vty_out (vty, " Split from group id: %" PRIu64 "\n", subgrp->split_from.update_group_id); - vty_outln (vty, " Split from subgroup id: %" PRIu64 "", + vty_out (vty, " Split from subgroup id: %" PRIu64 "\n", subgrp->split_from.subgroup_id); } - vty_outln (vty, " Join events: %u", subgrp->join_events); - vty_outln (vty, " Prune events: %u", + vty_out (vty, " Join events: %u\n", subgrp->join_events); + vty_out (vty, " Prune events: %u\n", subgrp->prune_events); - vty_outln (vty, " Merge events: %u", + vty_out (vty, " Merge events: %u\n", subgrp->merge_events); - vty_outln (vty, " Split events: %u", + vty_out (vty, " Split events: %u\n", subgrp->split_events); - vty_outln (vty, " Update group switch events: %u", + vty_out (vty, " Update group switch events: %u\n", subgrp->updgrp_switch_events); - vty_outln (vty, " Peer refreshes combined: %u", + vty_out (vty, " Peer refreshes combined: %u\n", subgrp->peer_refreshes_combined); - vty_outln (vty, " Merge checks triggered: %u", + vty_out (vty, " Merge checks triggered: %u\n", subgrp->merge_checks_triggered); - vty_outln (vty, " Version: %" PRIu64 "", subgrp->version); - vty_outln (vty, " Packet queue length: %d", + vty_out (vty, " Version: %" PRIu64 "\n", subgrp->version); + vty_out (vty, " Packet queue length: %d\n", bpacket_queue_length(SUBGRP_PKTQ(subgrp))); - vty_outln (vty, " Total packets enqueued: %u", + vty_out (vty, " Total packets enqueued: %u\n", subgroup_total_packets_enqueued(subgrp)); - vty_outln (vty, " Packet queue high watermark: %d", + vty_out (vty, " Packet queue high watermark: %d\n", bpacket_queue_hwm_length(SUBGRP_PKTQ(subgrp))); - vty_outln (vty, " Adj-out list count: %u", + vty_out (vty, " Adj-out list count: %u\n", subgrp->adj_count); - vty_outln (vty, " Advertise list: %s", + vty_out (vty, " Advertise list: %s\n", advertise_list_is_empty(subgrp) ? "empty" : "not empty"); - vty_outln (vty, " Flags: %s", + vty_out (vty, " Flags: %s\n", CHECK_FLAG(subgrp->flags, SUBGRP_FLAG_NEEDS_REFRESH) ? "R" : ""); if (subgrp->peer_count > 0) { - vty_outln (vty, " Peers:"); + vty_out (vty, " Peers:\n"); SUBGRP_FOREACH_PEER (subgrp, paf) - vty_outln (vty, " - %s", paf->peer->host); + vty_out (vty, " - %s\n", paf->peer->host); } } return UPDWALK_CONTINUE; @@ -648,7 +648,7 @@ updgrp_show_packet_queue_walkcb (struct update_group *updgrp, void *arg) { if (ctx->subgrp_id && (ctx->subgrp_id != subgrp->id)) continue; - vty_outln (vty, "update group %" PRIu64 ", subgroup %" PRIu64 "", updgrp->id, + vty_out (vty, "update group %" PRIu64 ", subgroup %" PRIu64 "\n", updgrp->id, subgrp->id); bpacket_queue_show_vty (SUBGRP_PKTQ (subgrp), vty); } @@ -1597,27 +1597,27 @@ update_group_show (struct bgp *bgp, afi_t afi, safi_t safi, struct vty *vty, void update_group_show_stats (struct bgp *bgp, struct vty *vty) { - vty_outln (vty, "Update groups created: %u", + vty_out (vty, "Update groups created: %u\n", bgp->update_group_stats.updgrps_created); - vty_outln (vty, "Update groups deleted: %u", + vty_out (vty, "Update groups deleted: %u\n", bgp->update_group_stats.updgrps_deleted); - vty_outln (vty, "Update subgroups created: %u", + vty_out (vty, "Update subgroups created: %u\n", bgp->update_group_stats.subgrps_created); - vty_outln (vty, "Update subgroups deleted: %u", + vty_out (vty, "Update subgroups deleted: %u\n", bgp->update_group_stats.subgrps_deleted); - vty_outln (vty, "Join events: %u", + vty_out (vty, "Join events: %u\n", bgp->update_group_stats.join_events); - vty_outln (vty, "Prune events: %u", + vty_out (vty, "Prune events: %u\n", bgp->update_group_stats.prune_events); - vty_outln (vty, "Merge events: %u", + vty_out (vty, "Merge events: %u\n", bgp->update_group_stats.merge_events); - vty_outln (vty, "Split events: %u", + vty_out (vty, "Split events: %u\n", bgp->update_group_stats.split_events); - vty_outln (vty, "Update group switch events: %u", + vty_out (vty, "Update group switch events: %u\n", bgp->update_group_stats.updgrp_switch_events); - vty_outln (vty, "Peer route refreshes combined: %u", + vty_out (vty, "Peer route refreshes combined: %u\n", bgp->update_group_stats.peer_refreshes_combined); - vty_outln (vty, "Merge checks triggered: %u", + vty_out (vty, "Merge checks triggered: %u\n", bgp->update_group_stats.merge_checks_triggered); } diff --git a/bgpd/bgp_updgrp_adv.c b/bgpd/bgp_updgrp_adv.c index c4cb8ae1b..6524e8435 100644 --- a/bgpd/bgp_updgrp_adv.c +++ b/bgpd/bgp_updgrp_adv.c @@ -226,16 +226,16 @@ subgrp_show_adjq_vty (struct update_subgroup *subgrp, struct vty *vty, { if (header1) { - vty_outln (vty, - "BGP table version is %" PRIu64 ", local router ID is %s", + vty_out (vty, + "BGP table version is %" PRIu64 ", local router ID is %s\n", table->version,inet_ntoa(bgp->router_id)); - vty_outln (vty, BGP_SHOW_SCODE_HEADER, VTYNL); - vty_outln (vty, BGP_SHOW_OCODE_HEADER, VTYNL); + vty_out (vty, BGP_SHOW_SCODE_HEADER); + vty_out (vty, BGP_SHOW_OCODE_HEADER); header1 = 0; } if (header2) { - vty_outln (vty, BGP_SHOW_HEADER); + vty_out (vty, BGP_SHOW_HEADER); header2 = 0; } if ((flags & UPDWALK_FLAGS_ADVQUEUE) && adj->adv && adj->adv->baa) @@ -250,8 +250,7 @@ subgrp_show_adjq_vty (struct update_subgroup *subgrp, struct vty *vty, } } if (output_count != 0) - vty_outln (vty, "%sTotal number of prefixes %ld", - VTYNL, output_count); + vty_out (vty, "\nTotal number of prefixes %ld\n", output_count); } static int @@ -266,7 +265,7 @@ updgrp_show_adj_walkcb (struct update_group *updgrp, void *arg) { if (ctx->subgrp_id && (ctx->subgrp_id != subgrp->id)) continue; - vty_outln (vty, "update group %" PRIu64 ", subgroup %" PRIu64 "", updgrp->id, + vty_out (vty, "update group %" PRIu64 ", subgroup %" PRIu64 "\n", updgrp->id, subgrp->id); subgrp_show_adjq_vty (subgrp, vty, ctx->flags); } diff --git a/bgpd/bgp_updgrp_packet.c b/bgpd/bgp_updgrp_packet.c index dff46a946..69debf7a4 100644 --- a/bgpd/bgp_updgrp_packet.c +++ b/bgpd/bgp_updgrp_packet.c @@ -392,12 +392,12 @@ bpacket_queue_show_vty (struct bpacket_queue *q, struct vty *vty) pkt = bpacket_queue_first (q); while (pkt) { - vty_outln (vty, " Packet %p ver %u buffer %p", pkt, pkt->ver, + vty_out (vty, " Packet %p ver %u buffer %p\n", pkt, pkt->ver, pkt->buffer); LIST_FOREACH (paf, &(pkt->peers), pkt_train) { - vty_outln (vty, " - %s", paf->peer->host); + vty_out (vty, " - %s\n", paf->peer->host); } pkt = bpacket_next (pkt); } diff --git a/bgpd/bgp_vpn.c b/bgpd/bgp_vpn.c index 3e6224395..c7f8ae3c0 100644 --- a/bgpd/bgp_vpn.c +++ b/bgpd/bgp_vpn.c @@ -51,7 +51,7 @@ show_adj_route_vpn (struct vty *vty, struct peer *peer, struct prefix_rd *prd, if (bgp == NULL) { if (!use_json) - vty_outln (vty, "No BGP process is configured"); + vty_out (vty, "No BGP process is configured\n"); return CMD_WARNING; } @@ -104,13 +104,12 @@ show_adj_route_vpn (struct vty *vty, struct peer *peer, struct prefix_rd *prd, } else { - vty_outln (vty, "BGP table version is 0, local router ID is %s", + vty_out (vty, "BGP table version is 0, local router ID is %s\n", inet_ntoa(bgp->router_id)); - vty_outln (vty, - "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal"); - vty_outln (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete%s", - VTYNL); - vty_outln (vty, V4_HEADER); + vty_out (vty, + "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal\n"); + vty_out (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete\n\n"); + vty_out (vty, V4_HEADER); } header = 0; } @@ -170,7 +169,7 @@ show_adj_route_vpn (struct vty *vty, struct peer *peer, struct prefix_rd *prd, rd_vnc_eth.macaddr.octet[5]); #endif - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } rd_header = 0; } @@ -191,7 +190,7 @@ show_adj_route_vpn (struct vty *vty, struct peer *peer, struct prefix_rd *prd, if (use_json) { json_object_object_add(json, "routes", json_routes); - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 42db38f40..903793624 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -308,7 +308,7 @@ bgp_vty_find_and_parse_afi_safi_bgp (struct vty *vty, struct cmd_token **argv, i *bgp = bgp_lookup_by_name (vrf_name); if (!*bgp) { - vty_out (vty, "View/Vrf specified is unknown: %s%s", vrf_name, VTYNL); + vty_out (vty, "View/Vrf specified is unknown: %s\n", vrf_name); *idx = 0; return 0; } @@ -319,7 +319,7 @@ bgp_vty_find_and_parse_afi_safi_bgp (struct vty *vty, struct cmd_token **argv, i *bgp = bgp_get_default (); if (!*bgp) { - vty_out (vty, "Unable to find default BGP instance%s", VTYNL); + vty_out (vty, "Unable to find default BGP instance\n"); *idx = 0; return 0; } @@ -373,7 +373,7 @@ peer_lookup_vty (struct vty *vty, const char *ip_str) { if ((peer = peer_lookup_by_hostname(bgp, ip_str)) == NULL) { - vty_out (vty, "%% Malformed address or name: %s%s", ip_str, VTYNL); + vty_out (vty, "%% Malformed address or name: %s\n", ip_str); return NULL; } } @@ -383,14 +383,12 @@ peer_lookup_vty (struct vty *vty, const char *ip_str) peer = peer_lookup (bgp, &su); if (! peer) { - vty_out (vty, "%% Specify remote-as or peer-group commands first%s", - VTYNL); + vty_out (vty, "%% Specify remote-as or peer-group commands first\n"); return NULL; } if (peer_dynamic_neighbor (peer)) { - vty_out (vty, "%% Operation not allowed on a dynamic neighbor%s", - VTYNL); + vty_out (vty, "%% Operation not allowed on a dynamic neighbor\n"); return NULL; } @@ -433,8 +431,7 @@ peer_and_group_lookup_vty (struct vty *vty, const char *peer_str) { if (peer_dynamic_neighbor (peer)) { - vty_out (vty, "%% Operation not allowed on a dynamic neighbor%s", - VTYNL); + vty_out (vty, "%% Operation not allowed on a dynamic neighbor\n"); return NULL; } @@ -444,8 +441,7 @@ peer_and_group_lookup_vty (struct vty *vty, const char *peer_str) if (group) return group->conf; - vty_out (vty, "%% Specify remote-as or peer-group commands first%s", - VTYNL); + vty_out (vty, "%% Specify remote-as or peer-group commands first\n"); return NULL; } @@ -523,7 +519,7 @@ bgp_vty_return (struct vty *vty, int ret) } if (str) { - vty_out (vty, "%% %s%s", str, VTYNL); + vty_out (vty, "%% %s\n", str); return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -547,11 +543,11 @@ bgp_clear_vty_error (struct vty *vty, struct peer *peer, afi_t afi, { case BGP_ERR_AF_UNCONFIGURED: vty_out (vty, - "%%BGP: Enable %s address family for the neighbor %s%s", - afi_safi_print(afi, safi), peer->host, VTYNL); + "%%BGP: Enable %s address family for the neighbor %s\n", + afi_safi_print(afi, safi), peer->host); break; case BGP_ERR_SOFT_RECONFIG_UNCONFIGURED: - vty_out (vty, "%%BGP: Inbound soft reconfig for %s not possible as it%s has neither refresh capability, nor inbound soft reconfig%s", peer->host, VTYNL, VTYNL); + vty_out (vty, "%%BGP: Inbound soft reconfig for %s not possible as it\n has neither refresh capability, nor inbound soft reconfig\n", peer->host); break; default: break; @@ -610,7 +606,7 @@ bgp_clear (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi, peer = peer_lookup_by_hostname(bgp, arg); if (!peer) { - vty_out (vty, "Malformed address or name: %s%s", arg, VTYNL); + vty_out (vty, "Malformed address or name: %s\n", arg); return CMD_WARNING; } } @@ -620,7 +616,7 @@ bgp_clear (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi, peer = peer_lookup (bgp, &su); if (! peer) { - vty_out (vty, "%%BGP: Unknown neighbor - \"%s\"%s", arg, VTYNL); + vty_out (vty, "%%BGP: Unknown neighbor - \"%s\"\n", arg); return CMD_WARNING; } } @@ -644,7 +640,7 @@ bgp_clear (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi, group = peer_group_lookup (bgp, arg); if (! group) { - vty_out (vty, "%%BGP: No such peer-group %s%s", arg, VTYNL); + vty_out (vty, "%%BGP: No such peer-group %s\n", arg); return CMD_WARNING; } @@ -707,8 +703,7 @@ bgp_clear (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi, bgp_clear_vty_error (vty, peer, afi, safi, ret); } if (! find) - vty_out (vty, "%%BGP: No peer is configured with AS %s%s", arg, - VTYNL); + vty_out (vty, "%%BGP: No peer is configured with AS %s\n", arg); return CMD_SUCCESS; } @@ -728,7 +723,7 @@ bgp_clear_vty (struct vty *vty, const char *name, afi_t afi, safi_t safi, bgp = bgp_lookup_by_name (name); if (bgp == NULL) { - vty_out (vty, "Can't find BGP instance %s%s", name, VTYNL); + vty_out (vty, "Can't find BGP instance %s\n", name); return CMD_WARNING; } } @@ -737,7 +732,7 @@ bgp_clear_vty (struct vty *vty, const char *name, afi_t afi, safi_t safi, bgp = bgp_get_default (); if (bgp == NULL) { - vty_out (vty, "No BGP process is configured%s", VTYNL); + vty_out (vty, "No BGP process is configured\n"); return CMD_WARNING; } } @@ -794,7 +789,7 @@ DEFUN (no_bgp_multiple_instance, ret = bgp_option_unset (BGP_OPT_MULTIPLE_INSTANCE); if (ret < 0) { - vty_out (vty, "%% There are more than two BGP instances%s", VTYNL); + vty_out (vty, "%% There are more than two BGP instances\n"); return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -875,13 +870,13 @@ DEFUN_NOSH (router_bgp, if (bgp == NULL) { - vty_out (vty, "%% No BGP process is configured%s", VTYNL); + vty_out (vty, "%% No BGP process is configured\n"); return CMD_WARNING_CONFIG_FAILED; } if (listcount(bm->bgp) > 1) { - vty_out (vty, "%% Multiple BGP processes are configured%s", VTYNL); + vty_out (vty, "%% Multiple BGP processes are configured\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -906,16 +901,15 @@ DEFUN_NOSH (router_bgp, switch (ret) { case BGP_ERR_MULTIPLE_INSTANCE_NOT_SET: - vty_out (vty, "Please specify 'bgp multiple-instance' first%s", - VTYNL); + vty_out (vty, "Please specify 'bgp multiple-instance' first\n"); return CMD_WARNING_CONFIG_FAILED; case BGP_ERR_AS_MISMATCH: - vty_out (vty, "BGP is already running; AS is %u%s", as, VTYNL); + vty_out (vty, "BGP is already running; AS is %u\n", as); return CMD_WARNING_CONFIG_FAILED; case BGP_ERR_INSTANCE_MISMATCH: - vty_out (vty, "BGP instance name and AS number mismatch%s", VTYNL); - vty_out (vty, "BGP instance is already running; AS is %u%s", - as, VTYNL); + vty_out (vty, "BGP instance name and AS number mismatch\n"); + vty_out (vty, "BGP instance is already running; AS is %u\n", + as); return CMD_WARNING_CONFIG_FAILED; } @@ -951,13 +945,13 @@ DEFUN (no_router_bgp, if (bgp == NULL) { - vty_out (vty, "%% No BGP process is configured%s", VTYNL); + vty_out (vty, "%% No BGP process is configured\n"); return CMD_WARNING_CONFIG_FAILED; } if (listcount(bm->bgp) > 1) { - vty_out (vty, "%% Multiple BGP processes are configured%s", VTYNL); + vty_out (vty, "%% Multiple BGP processes are configured\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -972,7 +966,7 @@ DEFUN (no_router_bgp, bgp = bgp_lookup (as, name); if (! bgp) { - vty_out (vty, "%% Can't find BGP instance%s", VTYNL); + vty_out (vty, "%% Can't find BGP instance\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -1012,7 +1006,7 @@ DEFPY (no_bgp_router_id, { if (! IPV4_ADDR_SAME (&bgp->router_id_static, &router_id)) { - vty_outln (vty, "%% BGP router-id doesn't match"); + vty_out (vty, "%% BGP router-id doesn't match\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -1041,7 +1035,7 @@ DEFUN (bgp_cluster_id, ret = inet_aton (argv[idx_ipv4]->arg, &cluster); if (! ret) { - vty_out (vty, "%% Malformed bgp cluster identifier%s", VTYNL); + vty_out (vty, "%% Malformed bgp cluster identifier\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1120,8 +1114,7 @@ DEFUN (bgp_confederation_peers, if (bgp->as == as) { - vty_out (vty, "%% Local member-AS not allowed in confed peer list%s", - VTYNL); + vty_out (vty, "%% Local member-AS not allowed in confed peer list\n"); continue; } @@ -1189,10 +1182,10 @@ bgp_maxpaths_config_vty (struct vty *vty, int peer_type, const char *mpaths, if (ret < 0) { vty_out (vty, - "%% Failed to %sset maximum-paths %s %u for afi %u, safi %u%s", + "%% Failed to %sset maximum-paths %s %u for afi %u, safi %u\n", (set == 1) ? "" : "un", (peer_type == BGP_PEER_EBGP) ? "ebgp" : "ibgp", - maxpaths, afi, safi, VTYNL); + maxpaths, afi, safi); return CMD_WARNING_CONFIG_FAILED; } @@ -1326,8 +1319,7 @@ bgp_update_delay_config_vty (struct vty *vty, const char *delay, establish_wait = atoi (wait); if (update_delay < establish_wait) { - vty_out (vty, "%%Failed: update-delay less than the establish-wait!%s", - VTYNL); + vty_out (vty, "%%Failed: update-delay less than the establish-wait!\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1356,7 +1348,7 @@ bgp_config_write_update_delay (struct vty *vty, struct bgp *bgp) vty_out (vty, " update-delay %d", bgp->v_update_delay); if (bgp->v_update_delay != bgp->v_establish_wait) vty_out (vty, " %d", bgp->v_establish_wait); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } return 0; @@ -1416,8 +1408,8 @@ int bgp_config_write_wpkt_quanta (struct vty *vty, struct bgp *bgp) { if (bgp->wpkt_quanta != BGP_WRITE_PACKET_MAX) - vty_out (vty, " write-quanta %d%s", - bgp->wpkt_quanta, VTYNL); + vty_out (vty, " write-quanta %d\n", + bgp->wpkt_quanta); return 0; } @@ -1450,8 +1442,8 @@ int bgp_config_write_coalesce_time (struct vty *vty, struct bgp *bgp) { if (bgp->coalesce_time != BGP_DEFAULT_SUBGROUP_COALESCE_TIME) - vty_out (vty, " coalesce-time %u%s", - bgp->coalesce_time, VTYNL); + vty_out (vty, " coalesce-time %u\n", + bgp->coalesce_time); return 0; } @@ -1585,8 +1577,8 @@ bgp_config_write_maxpaths (struct vty *vty, struct bgp *bgp, afi_t afi, if (bgp->maxpaths[afi][safi].maxpaths_ebgp != MULTIPATH_NUM) { bgp_config_write_family_header (vty, afi, safi, write); - vty_out (vty, " maximum-paths %d%s", - bgp->maxpaths[afi][safi].maxpaths_ebgp, VTYNL); + vty_out (vty, " maximum-paths %d\n", + bgp->maxpaths[afi][safi].maxpaths_ebgp); } if (bgp->maxpaths[afi][safi].maxpaths_ibgp != MULTIPATH_NUM) @@ -1597,7 +1589,7 @@ bgp_config_write_maxpaths (struct vty *vty, struct bgp *bgp, afi_t afi, if (CHECK_FLAG (bgp->maxpaths[afi][safi].ibgp_flags, BGP_FLAG_IBGP_MULTIPATH_SAME_CLUSTERLEN)) vty_out (vty, " equal-cluster-length"); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } return 0; @@ -1625,8 +1617,7 @@ DEFUN (bgp_timers, /* Holdtime value check. */ if (holdtime < 3 && holdtime != 0) { - vty_out (vty, "%% hold time value must be either 0 or greater than 3%s", - VTYNL); + vty_out (vty, "%% hold time value must be either 0 or greater than 3\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1760,8 +1751,7 @@ DEFUN (no_bgp_deterministic_med, if (bestpath_per_as_used) { - vty_out (vty, "bgp deterministic-med cannot be disabled while addpath-tx-bestpath-per-AS is in use%s", - VTYNL); + vty_out (vty, "bgp deterministic-med cannot be disabled while addpath-tx-bestpath-per-AS is in use\n"); return CMD_WARNING_CONFIG_FAILED; } else @@ -2454,7 +2444,7 @@ DEFUN (bgp_listen_range, ret = str2prefix (prefix, &range); if (! ret) { - vty_out (vty, "%% Malformed listen range%s", VTYNL); + vty_out (vty, "%% Malformed listen range\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2462,8 +2452,7 @@ DEFUN (bgp_listen_range, if (afi == AFI_IP6 && IN6_IS_ADDR_LINKLOCAL (&range.u.prefix6)) { - vty_out (vty, "%% Malformed listen range (link-local address)%s", - VTYNL); + vty_out (vty, "%% Malformed listen range (link-local address)\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2477,8 +2466,8 @@ DEFUN (bgp_listen_range, return CMD_SUCCESS; else { - vty_out (vty, "%% Same listen range is attached to peer-group %s%s", - existing_group->name, VTYNL); + vty_out (vty, "%% Same listen range is attached to peer-group %s\n", + existing_group->name); return CMD_WARNING_CONFIG_FAILED; } } @@ -2486,15 +2475,14 @@ DEFUN (bgp_listen_range, /* Check if an overlapping listen range exists. */ if (listen_range_exists (bgp, &range, 0)) { - vty_out (vty, "%% Listen range overlaps with existing listen range%s", - VTYNL); + vty_out (vty, "%% Listen range overlaps with existing listen range\n"); return CMD_WARNING_CONFIG_FAILED; } group = peer_group_lookup (bgp, peergroup); if (! group) { - vty_out (vty, "%% Configure the peer-group first%s", VTYNL); + vty_out (vty, "%% Configure the peer-group first\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2530,7 +2518,7 @@ DEFUN (no_bgp_listen_range, ret = str2prefix (prefix, &range); if (! ret) { - vty_out (vty, "%% Malformed listen range%s", VTYNL); + vty_out (vty, "%% Malformed listen range\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2538,8 +2526,7 @@ DEFUN (no_bgp_listen_range, if (afi == AFI_IP6 && IN6_IS_ADDR_LINKLOCAL (&range.u.prefix6)) { - vty_out (vty, "%% Malformed listen range (link-local address)%s", - VTYNL); + vty_out (vty, "%% Malformed listen range (link-local address)\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2548,7 +2535,7 @@ DEFUN (no_bgp_listen_range, group = peer_group_lookup (bgp, peergroup); if (! group) { - vty_out (vty, "%% Peer-group does not exist%s", VTYNL); + vty_out (vty, "%% Peer-group does not exist\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2566,8 +2553,8 @@ bgp_config_write_listen (struct vty *vty, struct bgp *bgp) char buf[PREFIX2STR_BUFFER]; if (bgp->dynamic_neighbors_limit != BGP_DYNAMIC_NEIGHBORS_LIMIT_DEFAULT) - vty_out (vty, " bgp listen limit %d%s", - bgp->dynamic_neighbors_limit, VTYNL); + vty_out (vty, " bgp listen limit %d\n", + bgp->dynamic_neighbors_limit); for (ALL_LIST_ELEMENTS (bgp->group, node, nnode, group)) { @@ -2576,8 +2563,8 @@ bgp_config_write_listen (struct vty *vty, struct bgp *bgp) for (ALL_LIST_ELEMENTS (group->listen_range[afi], rnode, nrnode, range)) { prefix2str(range, buf, sizeof(buf)); - vty_out(vty, " bgp listen range %s peer-group %s%s", - buf, group->name, VTYNL); + vty_out(vty, " bgp listen range %s peer-group %s\n", + buf, group->name); } } } @@ -2651,8 +2638,7 @@ peer_remote_as_vty (struct vty *vty, const char *peer_str, ret = peer_group_remote_as (bgp, peer_str, &as, as_type); if (ret < 0) { - vty_out (vty, "%% Create the peer-group or interface first%s", - VTYNL); + vty_out (vty, "%% Create the peer-group or interface first\n"); return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -2662,8 +2648,7 @@ peer_remote_as_vty (struct vty *vty, const char *peer_str, { if (peer_address_self_check (bgp, &su)) { - vty_out (vty, "%% Can not configure the local system as neighbor%s", - VTYNL); + vty_out (vty, "%% Can not configure the local system as neighbor\n"); return CMD_WARNING_CONFIG_FAILED; } ret = peer_remote_as (bgp, &su, NULL, &as, as_type, afi, safi); @@ -2673,10 +2658,10 @@ peer_remote_as_vty (struct vty *vty, const char *peer_str, switch (ret) { case BGP_ERR_PEER_GROUP_MEMBER: - vty_out (vty, "%% Peer-group AS %u. Cannot configure remote-as for member%s", as, VTYNL); + vty_out (vty, "%% Peer-group AS %u. Cannot configure remote-as for member\n", as); return CMD_WARNING_CONFIG_FAILED; case BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT: - vty_out (vty, "%% The AS# can not be changed from %u to %s, peer-group members must be all internal or all external%s", as, as_str, VTYNL); + vty_out (vty, "%% The AS# can not be changed from %u to %s, peer-group members must be all internal or all external\n", as, as_str); return CMD_WARNING_CONFIG_FAILED; } return bgp_vty_return (vty, ret); @@ -2714,7 +2699,7 @@ peer_conf_interface_get (struct vty *vty, const char *conf_if, afi_t afi, if (group) { - vty_out (vty, "%% Name conflict with peer-group %s", VTYNL); + vty_out (vty, "%% Name conflict with peer-group \n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2754,7 +2739,7 @@ peer_conf_interface_get (struct vty *vty, const char *conf_if, afi_t afi, if (!peer) { - vty_outln (vty, "%% BGP failed to create peer"); + vty_out (vty, "%% BGP failed to create peer\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2797,7 +2782,7 @@ peer_conf_interface_get (struct vty *vty, const char *conf_if, afi_t afi, group = peer_group_lookup (bgp, peer_group_name); if (! group) { - vty_out (vty, "%% Configure the peer-group first%s", VTYNL); + vty_out (vty, "%% Configure the peer-group first\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2899,14 +2884,14 @@ DEFUN (neighbor_peer_group, peer = peer_lookup_by_conf_if (bgp, argv[idx_word]->arg); if (peer) { - vty_out (vty, "%% Name conflict with interface: %s", VTYNL); + vty_out (vty, "%% Name conflict with interface: \n"); return CMD_WARNING_CONFIG_FAILED; } group = peer_group_get (bgp, argv[idx_word]->arg); if (! group) { - vty_outln (vty, "%% BGP failed to find or create peer-group"); + vty_out (vty, "%% BGP failed to find or create peer-group\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2951,7 +2936,7 @@ DEFUN (no_neighbor, peer_group_delete (group); else { - vty_out (vty, "%% Create the peer-group first%s", VTYNL); + vty_out (vty, "%% Create the peer-group first\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -2962,8 +2947,7 @@ DEFUN (no_neighbor, { if (peer_dynamic_neighbor (peer)) { - vty_out (vty, "%% Operation not allowed on a dynamic neighbor%s", - VTYNL); + vty_out (vty, "%% Operation not allowed on a dynamic neighbor\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3007,7 +2991,7 @@ DEFUN (no_neighbor_interface_config, } else { - vty_out (vty, "%% Create the bgp interface first%s", VTYNL); + vty_out (vty, "%% Create the bgp interface first\n"); return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -3030,7 +3014,7 @@ DEFUN (no_neighbor_peer_group, peer_group_delete (group); else { - vty_out (vty, "%% Create the peer-group first%s", VTYNL); + vty_out (vty, "%% Create the peer-group first\n"); return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -3065,7 +3049,7 @@ DEFUN (no_neighbor_interface_peer_group_remote_as, peer_group_remote_as_delete (group); else { - vty_out (vty, "%% Create the peer-group or interface first%s", VTYNL); + vty_out (vty, "%% Create the peer-group or interface first\n"); return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -3331,7 +3315,7 @@ DEFUN (neighbor_set_peer_group, peer = peer_lookup_by_conf_if (bgp, argv[idx_peer]->arg); if (!peer) { - vty_out (vty, "%% Malformed address or name: %s%s", argv[idx_peer]->arg, VTYNL); + vty_out (vty, "%% Malformed address or name: %s\n", argv[idx_peer]->arg); return CMD_WARNING_CONFIG_FAILED; } } @@ -3339,8 +3323,7 @@ DEFUN (neighbor_set_peer_group, { if (peer_address_self_check (bgp, &su)) { - vty_out (vty, "%% Can not configure the local system as neighbor%s", - VTYNL); + vty_out (vty, "%% Can not configure the local system as neighbor\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3348,8 +3331,7 @@ DEFUN (neighbor_set_peer_group, peer = peer_lookup (bgp, &su); if (peer && peer_dynamic_neighbor (peer)) { - vty_out (vty, "%% Operation not allowed on a dynamic neighbor%s", - VTYNL); + vty_out (vty, "%% Operation not allowed on a dynamic neighbor\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -3357,7 +3339,7 @@ DEFUN (neighbor_set_peer_group, group = peer_group_lookup (bgp, argv[idx_word]->arg); if (! group) { - vty_out (vty, "%% Configure the peer-group first%s", VTYNL); + vty_out (vty, "%% Configure the peer-group first\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3365,7 +3347,7 @@ DEFUN (neighbor_set_peer_group, if (ret == BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT) { - vty_out (vty, "%% Peer with AS %u cannot be in this peer-group, members must be all internal or all external%s", as, VTYNL); + vty_out (vty, "%% Peer with AS %u cannot be in this peer-group, members must be all internal or all external\n", as); return CMD_WARNING_CONFIG_FAILED; } @@ -3403,7 +3385,7 @@ DEFUN (no_neighbor_set_peer_group, group = peer_group_lookup (bgp, argv[idx_word]->arg); if (! group) { - vty_out (vty, "%% Configure the peer-group first%s", VTYNL); + vty_out (vty, "%% Configure the peer-group first\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3438,7 +3420,7 @@ peer_flag_modify_vty (struct vty *vty, const char *ip_str, */ if (peer->conf_if && (flag == PEER_FLAG_DISABLE_CONNECTED_CHECK)) { vty_out (vty, "%s is directly connected peer, cannot accept disable-" - "connected-check%s", ip_str, VTYNL); + "connected-check\n", ip_str); return CMD_WARNING_CONFIG_FAILED; } @@ -3680,7 +3662,7 @@ DEFUN (neighbor_capability_orf_prefix, flag = PEER_FLAG_ORF_PREFIX_SM|PEER_FLAG_ORF_PREFIX_RM; else { - vty_outln (vty, "%% BGP invalid orf prefix-list option"); + vty_out (vty, "%% BGP invalid orf prefix-list option\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3725,7 +3707,7 @@ DEFUN (no_neighbor_capability_orf_prefix, flag = PEER_FLAG_ORF_PREFIX_SM|PEER_FLAG_ORF_PREFIX_RM; else { - vty_outln (vty, "%% BGP invalid orf prefix-list option"); + vty_out (vty, "%% BGP invalid orf prefix-list option\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -4649,8 +4631,7 @@ peer_update_source_vty (struct vty *vty, const char *peer_str, { if (str2prefix (source_str, &p)) { - vty_out (vty, "%% Invalid update-source, remove prefix length %s", - VTYNL); + vty_out (vty, "%% Invalid update-source, remove prefix length \n"); return CMD_WARNING_CONFIG_FAILED; } else @@ -5178,7 +5159,7 @@ DEFUN (bgp_set_route_map_delay_timer, } else { - vty_outln (vty, "%% BGP invalid route-map delay-timer"); + vty_out (vty, "%% BGP invalid route-map delay-timer\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -5208,7 +5189,7 @@ peer_interface_vty (struct vty *vty, const char *ip_str, const char *str) peer = peer_lookup_vty (vty, ip_str); if (! peer || peer->conf_if) { - vty_outln (vty, "%% BGP invalid peer %s", ip_str); + vty_out (vty, "%% BGP invalid peer %s\n", ip_str); return CMD_WARNING_CONFIG_FAILED; } @@ -6067,8 +6048,8 @@ DEFUN (neighbor_ttl_security, * we should not accept a ttl-security hops value greater than 1. */ if (peer->conf_if && (gtsm_hops > 1)) { - vty_out (vty, "%s is directly connected peer, hops cannot exceed 1%s", - argv[idx_peer]->arg, VTYNL); + vty_out (vty, "%s is directly connected peer, hops cannot exceed 1\n", + argv[idx_peer]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -6300,7 +6281,7 @@ bgp_clear_prefix (struct vty *vty, const char *view_name, const char *ip_str, bgp = bgp_lookup_by_name (view_name); if (bgp == NULL) { - vty_out (vty, "%% Can't find BGP instance %s%s", view_name, VTYNL); + vty_out (vty, "%% Can't find BGP instance %s\n", view_name); return CMD_WARNING; } } @@ -6309,7 +6290,7 @@ bgp_clear_prefix (struct vty *vty, const char *view_name, const char *ip_str, bgp = bgp_get_default (); if (bgp == NULL) { - vty_out (vty, "%% No BGP process is configured%s", VTYNL); + vty_out (vty, "%% No BGP process is configured\n"); return CMD_WARNING; } } @@ -6318,7 +6299,7 @@ bgp_clear_prefix (struct vty *vty, const char *view_name, const char *ip_str, ret = str2prefix (ip_str, &match); if (! ret) { - vty_out (vty, "%% address is malformed%s", VTYNL); + vty_out (vty, "%% address is malformed\n"); return CMD_WARNING; } @@ -6544,19 +6525,19 @@ DEFUN (show_bgp_views, if (!bgp_option_check (BGP_OPT_MULTIPLE_INSTANCE)) { - vty_out (vty, "BGP Multiple Instance is not enabled%s", VTYNL); + vty_out (vty, "BGP Multiple Instance is not enabled\n"); return CMD_WARNING; } - vty_out (vty, "Defined BGP views:%s", VTYNL); + vty_out (vty, "Defined BGP views:\n"); for (ALL_LIST_ELEMENTS_RO(inst, node, bgp)) { /* Skip VRFs. */ if (bgp->inst_type == BGP_INSTANCE_TYPE_VRF) continue; - vty_out (vty, "\t%s (AS%u)%s", + vty_out (vty, "\t%s (AS%u)\n", bgp->name ? bgp->name : "(null)", - bgp->as, VTYNL); + bgp->as); } return CMD_SUCCESS; @@ -6582,7 +6563,7 @@ DEFUN (show_bgp_vrfs, if (!bgp_option_check (BGP_OPT_MULTIPLE_INSTANCE)) { - vty_out (vty, "BGP Multiple Instance is not enabled%s", VTYNL); + vty_out (vty, "BGP Multiple Instance is not enabled\n"); return CMD_WARNING; } @@ -6607,7 +6588,7 @@ DEFUN (show_bgp_vrfs, count++; if (!uj && count == 1) - vty_out (vty, "%s%s", header, VTYNL); + vty_out (vty, "%s\n", header); peers_cfg = peers_estb = 0; if (uj) @@ -6646,10 +6627,9 @@ DEFUN (show_bgp_vrfs, json_object_object_add(json_vrfs, name, json_vrf); } else - vty_out (vty, "%4s %-5d %-16s %9u %10u %s%s", + vty_out (vty, "%4s %-5d %-16s %9u %10u %s\n", type, vrf_id_ui, inet_ntoa (bgp->router_id), - peers_cfg, peers_estb, name, - VTYNL); + peers_cfg, peers_estb, name); } if (uj) @@ -6658,14 +6638,13 @@ DEFUN (show_bgp_vrfs, json_object_int_add(json, "totalVrfs", count); - vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL); + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else { if (count) - vty_out (vty, "%sTotal number of VRFs (including default): %d%s", - VTYNL, count, VTYNL); + vty_out (vty, "\nTotal number of VRFs (including default): %d\n", count); } return CMD_SUCCESS; @@ -6684,139 +6663,117 @@ DEFUN (show_bgp_memory, /* RIB related usage stats */ count = mtype_stats_alloc (MTYPE_BGP_NODE); - vty_out (vty, "%ld RIB nodes, using %s of memory%s", count, + vty_out (vty, "%ld RIB nodes, using %s of memory\n", count, mtype_memstr (memstrbuf, sizeof (memstrbuf), - count * sizeof (struct bgp_node)), - VTYNL); + count * sizeof (struct bgp_node))); count = mtype_stats_alloc (MTYPE_BGP_ROUTE); - vty_out (vty, "%ld BGP routes, using %s of memory%s", count, + vty_out (vty, "%ld BGP routes, using %s of memory\n", count, mtype_memstr (memstrbuf, sizeof (memstrbuf), - count * sizeof (struct bgp_info)), - VTYNL); + count * sizeof (struct bgp_info))); if ((count = mtype_stats_alloc (MTYPE_BGP_ROUTE_EXTRA))) - vty_out (vty, "%ld BGP route ancillaries, using %s of memory%s", count, + vty_out (vty, "%ld BGP route ancillaries, using %s of memory\n", count, mtype_memstr (memstrbuf, sizeof (memstrbuf), - count * sizeof (struct bgp_info_extra)), - VTYNL); + count * sizeof (struct bgp_info_extra))); if ((count = mtype_stats_alloc (MTYPE_BGP_STATIC))) - vty_out (vty, "%ld Static routes, using %s of memory%s", count, + vty_out (vty, "%ld Static routes, using %s of memory\n", count, mtype_memstr (memstrbuf, sizeof (memstrbuf), - count * sizeof (struct bgp_static)), - VTYNL); + count * sizeof (struct bgp_static))); if ((count = mtype_stats_alloc (MTYPE_BGP_PACKET))) - vty_out (vty, "%ld Packets, using %s of memory%s", count, + vty_out (vty, "%ld Packets, using %s of memory\n", count, mtype_memstr (memstrbuf, sizeof (memstrbuf), - count * sizeof (struct bpacket)), - VTYNL); + count * sizeof (struct bpacket))); /* Adj-In/Out */ if ((count = mtype_stats_alloc (MTYPE_BGP_ADJ_IN))) - vty_out (vty, "%ld Adj-In entries, using %s of memory%s", count, + vty_out (vty, "%ld Adj-In entries, using %s of memory\n", count, mtype_memstr (memstrbuf, sizeof (memstrbuf), - count * sizeof (struct bgp_adj_in)), - VTYNL); + count * sizeof (struct bgp_adj_in))); if ((count = mtype_stats_alloc (MTYPE_BGP_ADJ_OUT))) - vty_out (vty, "%ld Adj-Out entries, using %s of memory%s", count, + vty_out (vty, "%ld Adj-Out entries, using %s of memory\n", count, mtype_memstr (memstrbuf, sizeof (memstrbuf), - count * sizeof (struct bgp_adj_out)), - VTYNL); + count * sizeof (struct bgp_adj_out))); if ((count = mtype_stats_alloc (MTYPE_BGP_NEXTHOP_CACHE))) - vty_out (vty, "%ld Nexthop cache entries, using %s of memory%s", count, + vty_out (vty, "%ld Nexthop cache entries, using %s of memory\n", count, mtype_memstr (memstrbuf, sizeof (memstrbuf), - count * sizeof (struct bgp_nexthop_cache)), - VTYNL); + count * sizeof (struct bgp_nexthop_cache))); if ((count = mtype_stats_alloc (MTYPE_BGP_DAMP_INFO))) - vty_out (vty, "%ld Dampening entries, using %s of memory%s", count, + vty_out (vty, "%ld Dampening entries, using %s of memory\n", count, mtype_memstr (memstrbuf, sizeof (memstrbuf), - count * sizeof (struct bgp_damp_info)), - VTYNL); + count * sizeof (struct bgp_damp_info))); /* Attributes */ count = attr_count(); - vty_out (vty, "%ld BGP attributes, using %s of memory%s", count, + vty_out (vty, "%ld BGP attributes, using %s of memory\n", count, mtype_memstr (memstrbuf, sizeof (memstrbuf), - count * sizeof(struct attr)), - VTYNL); + count * sizeof(struct attr))); if ((count = mtype_stats_alloc (MTYPE_ATTR_EXTRA))) - vty_out (vty, "%ld BGP extra attributes, using %s of memory%s", count, + vty_out (vty, "%ld BGP extra attributes, using %s of memory\n", count, mtype_memstr (memstrbuf, sizeof (memstrbuf), - count * sizeof(struct attr_extra)), - VTYNL); + count * sizeof(struct attr_extra))); if ((count = attr_unknown_count())) - vty_out (vty, "%ld unknown attributes%s", count, VTYNL); + vty_out (vty, "%ld unknown attributes\n", count); /* AS_PATH attributes */ count = aspath_count (); - vty_out (vty, "%ld BGP AS-PATH entries, using %s of memory%s", count, + vty_out (vty, "%ld BGP AS-PATH entries, using %s of memory\n", count, mtype_memstr (memstrbuf, sizeof (memstrbuf), - count * sizeof (struct aspath)), - VTYNL); + count * sizeof (struct aspath))); count = mtype_stats_alloc (MTYPE_AS_SEG); - vty_out (vty, "%ld BGP AS-PATH segments, using %s of memory%s", count, + vty_out (vty, "%ld BGP AS-PATH segments, using %s of memory\n", count, mtype_memstr (memstrbuf, sizeof (memstrbuf), - count * sizeof (struct assegment)), - VTYNL); + count * sizeof (struct assegment))); /* Other attributes */ if ((count = community_count ())) - vty_out (vty, "%ld BGP community entries, using %s of memory%s", count, + vty_out (vty, "%ld BGP community entries, using %s of memory\n", count, mtype_memstr (memstrbuf, sizeof (memstrbuf), - count * sizeof (struct community)), - VTYNL); + count * sizeof (struct community))); if ((count = mtype_stats_alloc (MTYPE_ECOMMUNITY))) - vty_out (vty, "%ld BGP community entries, using %s of memory%s", count, + vty_out (vty, "%ld BGP community entries, using %s of memory\n", count, mtype_memstr (memstrbuf, sizeof (memstrbuf), - count * sizeof (struct ecommunity)), - VTYNL); + count * sizeof (struct ecommunity))); if ((count = mtype_stats_alloc (MTYPE_LCOMMUNITY))) - vty_out (vty, "%ld BGP large-community entries, using %s of memory%s", + vty_out (vty, "%ld BGP large-community entries, using %s of memory\n", count, mtype_memstr (memstrbuf, sizeof (memstrbuf), - count * sizeof (struct lcommunity)), - VTYNL); + count * sizeof (struct lcommunity))); if ((count = mtype_stats_alloc (MTYPE_CLUSTER))) - vty_out (vty, "%ld Cluster lists, using %s of memory%s", count, + vty_out (vty, "%ld Cluster lists, using %s of memory\n", count, mtype_memstr (memstrbuf, sizeof (memstrbuf), - count * sizeof (struct cluster_list)), - VTYNL); + count * sizeof (struct cluster_list))); /* Peer related usage */ count = mtype_stats_alloc (MTYPE_BGP_PEER); - vty_out (vty, "%ld peers, using %s of memory%s", count, + vty_out (vty, "%ld peers, using %s of memory\n", count, mtype_memstr (memstrbuf, sizeof (memstrbuf), - count * sizeof (struct peer)), - VTYNL); + count * sizeof (struct peer))); if ((count = mtype_stats_alloc (MTYPE_PEER_GROUP))) - vty_out (vty, "%ld peer groups, using %s of memory%s", count, + vty_out (vty, "%ld peer groups, using %s of memory\n", count, mtype_memstr (memstrbuf, sizeof (memstrbuf), - count * sizeof (struct peer_group)), - VTYNL); + count * sizeof (struct peer_group))); /* Other */ if ((count = mtype_stats_alloc (MTYPE_HASH))) - vty_out (vty, "%ld hash tables, using %s of memory%s", count, + vty_out (vty, "%ld hash tables, using %s of memory\n", count, mtype_memstr (memstrbuf, sizeof (memstrbuf), - count * sizeof (struct hash)), - VTYNL); + count * sizeof (struct hash))); if ((count = mtype_stats_alloc (MTYPE_HASH_BACKET))) - vty_out (vty, "%ld hash buckets, using %s of memory%s", count, + vty_out (vty, "%ld hash buckets, using %s of memory\n", count, mtype_memstr (memstrbuf, sizeof (memstrbuf), - count * sizeof (struct hash_backet)), - VTYNL); + count * sizeof (struct hash_backet))); if ((count = mtype_stats_alloc (MTYPE_BGP_REGEXP))) - vty_out (vty, "%ld compiled regexes, using %s of memory%s", count, + vty_out (vty, "%ld compiled regexes, using %s of memory\n", count, mtype_memstr (memstrbuf, sizeof (memstrbuf), - count * sizeof (regex_t)), - VTYNL); + count * sizeof (regex_t))); return CMD_SUCCESS; } @@ -6917,7 +6874,7 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi, vty_out (vty, "BGP router identifier %s, local AS number %u vrf-id %d", inet_ntoa (bgp->router_id), bgp->as, vrf_id_ui); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } if (bgp_update_delay_configured(bgp)) @@ -6951,30 +6908,30 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi, } else { - vty_out (vty, "Read-only mode update-delay limit: %d seconds%s", - bgp->v_update_delay, VTYNL); + vty_out (vty, "Read-only mode update-delay limit: %d seconds\n", + bgp->v_update_delay); if (bgp->v_update_delay != bgp->v_establish_wait) - vty_out (vty, " Establish wait: %d seconds%s", - bgp->v_establish_wait, VTYNL); + vty_out (vty, " Establish wait: %d seconds\n", + bgp->v_establish_wait); if (bgp_update_delay_active(bgp)) { - vty_out (vty, " First neighbor established: %s%s", - bgp->update_delay_begin_time, VTYNL); - vty_out (vty, " Delay in progress%s", VTYNL); + vty_out (vty, " First neighbor established: %s\n", + bgp->update_delay_begin_time); + vty_out (vty, " Delay in progress\n"); } else { if (bgp->update_delay_over) { - vty_out (vty, " First neighbor established: %s%s", - bgp->update_delay_begin_time, VTYNL); - vty_out (vty, " Best-paths resumed: %s%s", - bgp->update_delay_end_time, VTYNL); - vty_out (vty, " zebra update resumed: %s%s", - bgp->update_delay_zebra_resume_time, VTYNL); - vty_out (vty, " peers update resumed: %s%s", - bgp->update_delay_peers_resume_time, VTYNL); + vty_out (vty, " First neighbor established: %s\n", + bgp->update_delay_begin_time); + vty_out (vty, " Best-paths resumed: %s\n", + bgp->update_delay_end_time); + vty_out (vty, " zebra update resumed: %s\n", + bgp->update_delay_zebra_resume_time); + vty_out (vty, " peers update resumed: %s\n", + bgp->update_delay_peers_resume_time); } } } @@ -7009,41 +6966,38 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi, else { if (bgp_maxmed_onstartup_configured(bgp) && bgp->maxmed_active) - vty_out (vty, "Max-med on-startup active%s", VTYNL); + vty_out (vty, "Max-med on-startup active\n"); if (bgp->v_maxmed_admin) - vty_out (vty, "Max-med administrative active%s", VTYNL); + vty_out (vty, "Max-med administrative active\n"); - vty_out(vty, "BGP table version %" PRIu64 "%s", - bgp_table_version(bgp->rib[afi][safi]), VTYNL); + vty_out(vty, "BGP table version %" PRIu64 "\n", + bgp_table_version(bgp->rib[afi][safi])); ents = bgp_table_count (bgp->rib[afi][safi]); - vty_out (vty, "RIB entries %ld, using %s of memory%s", ents, + vty_out (vty, "RIB entries %ld, using %s of memory\n", ents, mtype_memstr (memstrbuf, sizeof (memstrbuf), - ents * sizeof (struct bgp_node)), - VTYNL); + ents * sizeof (struct bgp_node))); /* Peer related usage */ ents = listcount (bgp->peer); - vty_out (vty, "Peers %ld, using %s of memory%s", + vty_out (vty, "Peers %ld, using %s of memory\n", ents, mtype_memstr (memstrbuf, sizeof (memstrbuf), - ents * sizeof (struct peer)), - VTYNL); + ents * sizeof (struct peer))); if ((ents = listcount (bgp->group))) - vty_out (vty, "Peer groups %ld, using %s of memory%s", ents, + vty_out (vty, "Peer groups %ld, using %s of memory\n", ents, mtype_memstr (memstrbuf, sizeof (memstrbuf), - ents * sizeof (struct peer_group)), - VTYNL); + ents * sizeof (struct peer_group))); if (CHECK_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING)) - vty_out (vty, "Dampening enabled.%s", VTYNL); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "Dampening enabled.\n"); + vty_out (vty, "\n"); /* Subtract 8 here because 'Neighbor' is 8 characters */ vty_out (vty, "Neighbor"); vty_out (vty, "%*s", max_neighbor_width - 8, " "); - vty_out (vty, "V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd%s", VTYNL); + vty_out (vty, "V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd\n"); } } @@ -7138,7 +7092,7 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi, else vty_out (vty, " %12s", lookup_msg(bgp_status_msg, peer->status, NULL)); } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } } } @@ -7150,30 +7104,30 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi, json_object_int_add(json, "totalPeers", count); json_object_int_add(json, "dynamicPeers", dn_count); - vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL); + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else { if (count) - vty_out (vty, "%sTotal number of neighbors %d%s", VTYNL, - count, VTYNL); + vty_out (vty, "\nTotal number of neighbors %d\n", + count); else { if (use_json) - vty_out(vty, "{\"error\": {\"message\": \"No %s neighbor configured\"}}%s", - afi_safi_print(afi, safi), VTYNL); + vty_out(vty, "{\"error\": {\"message\": \"No %s neighbor configured\"}}\n", + afi_safi_print(afi, safi)); else - vty_out (vty, "No %s neighbor is configured%s", - afi_safi_print(afi, safi), VTYNL); + vty_out (vty, "No %s neighbor is configured\n", + afi_safi_print(afi, safi)); } if (dn_count && ! use_json) { - vty_out(vty, "* - dynamic neighbor%s", VTYNL); + vty_out(vty, "* - dynamic neighbor\n"); vty_out(vty, - "%d dynamic neighbor(s), limit %d%s", - dn_count, bgp->dynamic_neighbors_limit, VTYNL); + "%d dynamic neighbor(s), limit %d\n", + dn_count, bgp->dynamic_neighbors_limit); } } @@ -7212,7 +7166,7 @@ bgp_show_summary_afi_safi (struct vty *vty, struct bgp *bgp, int afi, int safi, bool json_output = false; if (use_json && is_wildcard) - vty_out (vty, "{%s", VTYNL); + vty_out (vty, "{\n"); if (afi_wildcard) afi = 1; /* AFI_IP */ while (afi < AFI_MAX) @@ -7235,7 +7189,7 @@ bgp_show_summary_afi_safi (struct vty *vty, struct bgp *bgp, int afi, int safi, json = json_object_new_object(); if (! is_first) - vty_out (vty, ",%s", VTYNL); + vty_out (vty, ",\n"); else is_first = 0; @@ -7243,8 +7197,7 @@ bgp_show_summary_afi_safi (struct vty *vty, struct bgp *bgp, int afi, int safi, } else { - vty_out (vty, "%s%s Summary:%s", - VTYNL, afi_safi_print(afi, safi), VTYNL); + vty_out (vty, "\n%s Summary:\n", afi_safi_print(afi, safi)); } } bgp_show_summary (vty, bgp, afi, safi, use_json, json); @@ -7263,9 +7216,9 @@ bgp_show_summary_afi_safi (struct vty *vty, struct bgp *bgp, int afi, int safi, } if (use_json && is_wildcard) - vty_out (vty, "}%s", VTYNL); + vty_out (vty, "}\n"); else if (use_json && !json_output) - vty_out (vty, "{}%s", VTYNL); + vty_out (vty, "{}\n"); } static void @@ -7278,7 +7231,7 @@ bgp_show_all_instances_summary_vty (struct vty *vty, afi_t afi, safi_t safi, int is_first = 1; if (use_json) - vty_out (vty, "{%s", VTYNL); + vty_out (vty, "{\n"); for (ALL_LIST_ELEMENTS (bm->bgp, node, nnode, bgp)) { @@ -7287,7 +7240,7 @@ bgp_show_all_instances_summary_vty (struct vty *vty, afi_t afi, safi_t safi, json = json_object_new_object(); if (! is_first) - vty_out (vty, ",%s", VTYNL); + vty_out (vty, ",\n"); else is_first = 0; @@ -7296,16 +7249,15 @@ bgp_show_all_instances_summary_vty (struct vty *vty, afi_t afi, safi_t safi, } else { - vty_out (vty, "%sInstance %s:%s", - VTYNL, + vty_out (vty, "\nInstance %s:\n", (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT) - ? "Default" : bgp->name, VTYNL); + ? "Default" : bgp->name); } bgp_show_summary_afi_safi (vty, bgp, afi, safi, use_json, json); } if (use_json) - vty_out (vty, "}%s", VTYNL); + vty_out (vty, "}\n"); } @@ -7329,9 +7281,9 @@ bgp_show_summary_vty (struct vty *vty, const char *name, if (! bgp) { if (use_json) - vty_out (vty, "{}%s", VTYNL); + vty_out (vty, "{}\n"); else - vty_out (vty, "%% No such BGP instance exist%s", VTYNL); + vty_out (vty, "%% No such BGP instance exist\n"); return CMD_WARNING; } @@ -7482,7 +7434,7 @@ bgp_show_peer_afi_orf_cap (struct vty *vty, struct peer *p, afi_t afi, safi_t sa vty_out (vty, "%sreceived", CHECK_FLAG (p->af_cap[afi][safi], adv_smcap) ? ", " : ""); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } } @@ -7508,7 +7460,7 @@ bgp_show_peer_afi_orf_cap (struct vty *vty, struct peer *p, afi_t afi, safi_t sa vty_out (vty, "%sreceived", CHECK_FLAG (p->af_cap[afi][safi], adv_rmcap) ? ", " : ""); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } } } @@ -7713,23 +7665,22 @@ bgp_show_peer_afi (struct vty *vty, struct peer *p, afi_t afi, safi_t safi, { filter = &p->filter[afi][safi]; - vty_out (vty, " For address family: %s%s", afi_safi_print (afi, safi), - VTYNL); + vty_out (vty, " For address family: %s\n", afi_safi_print (afi, safi)); if (peer_group_active(p)) - vty_out (vty, " %s peer-group member%s", p->group->name, VTYNL); + vty_out (vty, " %s peer-group member\n", p->group->name); paf = peer_af_find(p, afi, safi); if (paf && PAF_SUBGRP(paf)) { - vty_out (vty, " Update group %" PRIu64 ", subgroup %" PRIu64 "%s", - PAF_UPDGRP(paf)->id, PAF_SUBGRP(paf)->id, VTYNL); - vty_out (vty, " Packet Queue length %d%s", - bpacket_queue_virtual_length(paf), VTYNL); + vty_out (vty, " Update group %" PRIu64 ", subgroup %" PRIu64 "\n", + PAF_UPDGRP(paf)->id, PAF_SUBGRP(paf)->id); + vty_out (vty, " Packet Queue length %d\n", + bpacket_queue_virtual_length(paf)); } else { - vty_out(vty, " Not part of any update group%s", VTYNL); + vty_out(vty, " Not part of any update group\n"); } if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_ADV) || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_RCV) @@ -7737,15 +7688,15 @@ bgp_show_peer_afi (struct vty *vty, struct peer *p, afi_t afi, safi_t safi, || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_ADV) || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_RCV) || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_OLD_RCV)) - vty_out (vty, " AF-dependant capabilities:%s", VTYNL); + vty_out (vty, " AF-dependant capabilities:\n"); if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_ADV) || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_RCV) || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_ADV) || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_RCV)) { - vty_out (vty, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s", - ORF_TYPE_PREFIX, VTYNL); + vty_out (vty, " Outbound Route Filter (ORF) type (%d) Prefix-list:\n", + ORF_TYPE_PREFIX); bgp_show_peer_afi_orf_cap (vty, p, afi, safi, PEER_CAP_ORF_PREFIX_SM_ADV, PEER_CAP_ORF_PREFIX_RM_ADV, @@ -7757,8 +7708,8 @@ bgp_show_peer_afi (struct vty *vty, struct peer *p, afi_t afi, safi_t safi, || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_ADV) || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_OLD_RCV)) { - vty_out (vty, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s", - ORF_TYPE_PREFIX_OLD, VTYNL); + vty_out (vty, " Outbound Route Filter (ORF) type (%d) Prefix-list:\n", + ORF_TYPE_PREFIX_OLD); bgp_show_peer_afi_orf_cap (vty, p, afi, safi, PEER_CAP_ORF_PREFIX_SM_ADV, PEER_CAP_ORF_PREFIX_RM_ADV, @@ -7777,45 +7728,45 @@ bgp_show_peer_afi (struct vty *vty, struct peer *p, afi_t afi, safi_t safi, vty_out (vty, " sent;"); if (orf_pfx_count) vty_out (vty, " received (%d entries)", orf_pfx_count); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_ORF_WAIT_REFRESH)) - vty_out (vty, " First update is deferred until ORF or ROUTE-REFRESH is received%s", VTYNL); + vty_out (vty, " First update is deferred until ORF or ROUTE-REFRESH is received\n"); if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_REFLECTOR_CLIENT)) - vty_out (vty, " Route-Reflector Client%s", VTYNL); + vty_out (vty, " Route-Reflector Client\n"); if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_RSERVER_CLIENT)) - vty_out (vty, " Route-Server Client%s", VTYNL); + vty_out (vty, " Route-Server Client\n"); if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SOFT_RECONFIG)) - vty_out (vty, " Inbound soft reconfiguration allowed%s", VTYNL); + vty_out (vty, " Inbound soft reconfiguration allowed\n"); if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_REMOVE_PRIVATE_AS_ALL_REPLACE)) - vty_out (vty, " Private AS numbers (all) replaced in updates to this neighbor%s", VTYNL); + vty_out (vty, " Private AS numbers (all) replaced in updates to this neighbor\n"); else if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE)) - vty_out (vty, " Private AS numbers replaced in updates to this neighbor%s", VTYNL); + vty_out (vty, " Private AS numbers replaced in updates to this neighbor\n"); else if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_REMOVE_PRIVATE_AS_ALL)) - vty_out (vty, " Private AS numbers (all) removed in updates to this neighbor%s", VTYNL); + vty_out (vty, " Private AS numbers (all) removed in updates to this neighbor\n"); else if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_REMOVE_PRIVATE_AS)) - vty_out (vty, " Private AS numbers removed in updates to this neighbor%s", VTYNL); + vty_out (vty, " Private AS numbers removed in updates to this neighbor\n"); if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_ADDPATH_TX_ALL_PATHS)) - vty_out (vty, " Advertise all paths via addpath%s", VTYNL); + vty_out (vty, " Advertise all paths via addpath\n"); if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_ADDPATH_TX_BESTPATH_PER_AS)) - vty_out (vty, " Advertise bestpath per AS via addpath%s", VTYNL); + vty_out (vty, " Advertise bestpath per AS via addpath\n"); if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_AS_OVERRIDE)) - vty_out (vty, " Override ASNs in outbound updates if aspath equals remote-as%s", VTYNL); + vty_out (vty, " Override ASNs in outbound updates if aspath equals remote-as\n"); if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_NEXTHOP_SELF) || CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_FORCE_NEXTHOP_SELF)) - vty_out (vty, " NEXT_HOP is always this router%s", VTYNL); + vty_out (vty, " NEXT_HOP is always this router\n"); if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_AS_PATH_UNCHANGED)) - vty_out (vty, " AS_PATH is propagated unchanged to this neighbor%s", VTYNL); + vty_out (vty, " AS_PATH is propagated unchanged to this neighbor\n"); if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_NEXTHOP_UNCHANGED)) - vty_out (vty, " NEXT_HOP is propagated unchanged to this neighbor%s", VTYNL); + vty_out (vty, " NEXT_HOP is propagated unchanged to this neighbor\n"); if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_MED_UNCHANGED)) - vty_out (vty, " MED is propagated unchanged to this neighbor%s", VTYNL); + vty_out (vty, " MED is propagated unchanged to this neighbor\n"); if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_COMMUNITY) || CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_EXT_COMMUNITY) || CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_LARGE_COMMUNITY)) @@ -7824,13 +7775,13 @@ bgp_show_peer_afi (struct vty *vty, struct peer *p, afi_t afi, safi_t safi, if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_COMMUNITY) && CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_EXT_COMMUNITY) && CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_LARGE_COMMUNITY)) - vty_out (vty, "(all)%s", VTYNL); + vty_out (vty, "(all)\n"); else if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_LARGE_COMMUNITY)) - vty_out (vty, "(large)%s", VTYNL); + vty_out (vty, "(large)\n"); else if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_EXT_COMMUNITY)) - vty_out (vty, "(extended)%s", VTYNL); + vty_out (vty, "(extended)\n"); else - vty_out (vty, "(standard)%s", VTYNL); + vty_out (vty, "(standard)\n"); } if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_DEFAULT_ORIGINATE)) { @@ -7841,94 +7792,86 @@ bgp_show_peer_afi (struct vty *vty, struct peer *p, afi_t afi, safi_t safi, p->default_rmap[afi][safi].map ? "*" : "", p->default_rmap[afi][safi].name); if (paf && PAF_SUBGRP(paf) && CHECK_FLAG(PAF_SUBGRP(paf)->sflags, SUBGRP_STATUS_DEFAULT_ORIGINATE)) - vty_out (vty, " default sent%s", VTYNL); + vty_out (vty, " default sent\n"); else - vty_out (vty, " default not sent%s", VTYNL); + vty_out (vty, " default not sent\n"); } if (filter->plist[FILTER_IN].name || filter->dlist[FILTER_IN].name || filter->aslist[FILTER_IN].name || filter->map[RMAP_IN].name) - vty_out (vty, " Inbound path policy configured%s", VTYNL); + vty_out (vty, " Inbound path policy configured\n"); if (filter->plist[FILTER_OUT].name || filter->dlist[FILTER_OUT].name || filter->aslist[FILTER_OUT].name || filter->map[RMAP_OUT].name || filter->usmap.name) - vty_out (vty, " Outbound path policy configured%s", VTYNL); + vty_out (vty, " Outbound path policy configured\n"); /* prefix-list */ if (filter->plist[FILTER_IN].name) - vty_out (vty, " Incoming update prefix filter list is %s%s%s", + vty_out (vty, " Incoming update prefix filter list is %s%s\n", filter->plist[FILTER_IN].plist ? "*" : "", - filter->plist[FILTER_IN].name, - VTYNL); + filter->plist[FILTER_IN].name); if (filter->plist[FILTER_OUT].name) - vty_out (vty, " Outgoing update prefix filter list is %s%s%s", + vty_out (vty, " Outgoing update prefix filter list is %s%s\n", filter->plist[FILTER_OUT].plist ? "*" : "", - filter->plist[FILTER_OUT].name, - VTYNL); + filter->plist[FILTER_OUT].name); /* distribute-list */ if (filter->dlist[FILTER_IN].name) - vty_out (vty, " Incoming update network filter list is %s%s%s", + vty_out (vty, " Incoming update network filter list is %s%s\n", filter->dlist[FILTER_IN].alist ? "*" : "", - filter->dlist[FILTER_IN].name, - VTYNL); + filter->dlist[FILTER_IN].name); if (filter->dlist[FILTER_OUT].name) - vty_out (vty, " Outgoing update network filter list is %s%s%s", + vty_out (vty, " Outgoing update network filter list is %s%s\n", filter->dlist[FILTER_OUT].alist ? "*" : "", - filter->dlist[FILTER_OUT].name, - VTYNL); + filter->dlist[FILTER_OUT].name); /* filter-list. */ if (filter->aslist[FILTER_IN].name) - vty_out (vty, " Incoming update AS path filter list is %s%s%s", + vty_out (vty, " Incoming update AS path filter list is %s%s\n", filter->aslist[FILTER_IN].aslist ? "*" : "", - filter->aslist[FILTER_IN].name, - VTYNL); + filter->aslist[FILTER_IN].name); if (filter->aslist[FILTER_OUT].name) - vty_out (vty, " Outgoing update AS path filter list is %s%s%s", + vty_out (vty, " Outgoing update AS path filter list is %s%s\n", filter->aslist[FILTER_OUT].aslist ? "*" : "", - filter->aslist[FILTER_OUT].name, - VTYNL); + filter->aslist[FILTER_OUT].name); /* route-map. */ if (filter->map[RMAP_IN].name) - vty_out (vty, " Route map for incoming advertisements is %s%s%s", + vty_out (vty, " Route map for incoming advertisements is %s%s\n", filter->map[RMAP_IN].map ? "*" : "", - filter->map[RMAP_IN].name, - VTYNL); + filter->map[RMAP_IN].name); if (filter->map[RMAP_OUT].name) - vty_out (vty, " Route map for outgoing advertisements is %s%s%s", + vty_out (vty, " Route map for outgoing advertisements is %s%s\n", filter->map[RMAP_OUT].map ? "*" : "", - filter->map[RMAP_OUT].name, - VTYNL); + filter->map[RMAP_OUT].name); /* unsuppress-map */ if (filter->usmap.name) - vty_out (vty, " Route map for selective unsuppress is %s%s%s", + vty_out (vty, " Route map for selective unsuppress is %s%s\n", filter->usmap.map ? "*" : "", - filter->usmap.name, VTYNL); + filter->usmap.name); /* Receive prefix count */ - vty_out (vty, " %ld accepted prefixes%s", p->pcount[afi][safi], VTYNL); + vty_out (vty, " %ld accepted prefixes\n", p->pcount[afi][safi]); /* Maximum prefix */ if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX)) { - vty_out (vty, " Maximum prefixes allowed %ld%s%s", p->pmax[afi][safi], + vty_out (vty, " Maximum prefixes allowed %ld%s\n", p->pmax[afi][safi], CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX_WARNING) - ? " (warning-only)" : "", VTYNL); + ? " (warning-only)" : ""); vty_out (vty, " Threshold for warning message %d%%", p->pmax_threshold[afi][safi]); if (p->pmax_restart[afi][safi]) vty_out (vty, ", restart interval %d min", p->pmax_restart[afi][safi]); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } } @@ -8015,9 +7958,9 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js else { if (CHECK_FLAG(bgp->config, BGP_CONFIG_CONFEDERATION)) - vty_out (vty, "confed-internal link%s", VTYNL); + vty_out (vty, "confed-internal link\n"); else - vty_out (vty, "internal link%s", VTYNL); + vty_out (vty, "internal link\n"); } } else @@ -8032,9 +7975,9 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js else { if (bgp_confederation_peers_check(bgp, p->as)) - vty_out (vty, "confed-external link%s", VTYNL); + vty_out (vty, "confed-external link\n"); else - vty_out (vty, "external link%s", VTYNL); + vty_out (vty, "external link\n"); } } @@ -8044,7 +7987,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js if (use_json) json_object_string_add(json_neigh, "nbrDesc", p->desc); else - vty_out (vty, " Description: %s%s", p->desc, VTYNL); + vty_out (vty, " Description: %s\n", p->desc); } if (p->hostname) @@ -8060,10 +8003,9 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js else { if (p->domainname && (p->domainname[0] != '\0')) - vty_out(vty, "Hostname: %s.%s%s", p->hostname, p->domainname, - VTYNL); + vty_out(vty, "Hostname: %s.%s\n", p->hostname, p->domainname); else - vty_out(vty, "Hostname: %s%s", p->hostname, VTYNL); + vty_out(vty, "Hostname: %s\n", p->hostname); } } @@ -8091,8 +8033,8 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js } else { - vty_out (vty, " Member of peer-group %s for session parameters%s", - p->group->name, VTYNL); + vty_out (vty, " Member of peer-group %s for session parameters\n", + p->group->name); if (dn_flag[0]) { @@ -8104,7 +8046,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js if (range) { prefix2str(range, buf1, sizeof(buf1)); - vty_out (vty, " Belongs to the subnet range group: %s%s", buf1, VTYNL); + vty_out (vty, " Belongs to the subnet range group: %s\n", buf1); } } } @@ -8185,18 +8127,17 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js { /* Administrative shutdown. */ if (CHECK_FLAG (p->flags, PEER_FLAG_SHUTDOWN)) - vty_out (vty, " Administratively shut down%s", VTYNL); + vty_out (vty, " Administratively shut down\n"); /* BGP Version. */ vty_out (vty, " BGP version 4"); - vty_out (vty, ", remote router ID %s%s", - inet_ntop (AF_INET, &p->remote_id, buf1, sizeof(buf1)), - VTYNL); + vty_out (vty, ", remote router ID %s\n", + inet_ntop (AF_INET, &p->remote_id, buf1, sizeof(buf1))); /* Confederation */ if (CHECK_FLAG (bgp->config, BGP_CONFIG_CONFEDERATION) && bgp_confederation_peers_check (bgp, p->as)) - vty_out (vty, " Neighbor under common administration%s", VTYNL); + vty_out (vty, " Neighbor under common administration\n"); /* Status. */ vty_out (vty, " BGP state = %s", lookup_msg(bgp_status_msg, p->status, NULL)); @@ -8211,21 +8152,21 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js else if (CHECK_FLAG (p->sflags, PEER_STATUS_NSF_WAIT)) vty_out (vty, " (NSF passive)"); } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); /* read timer */ vty_out (vty, " Last read %s", peer_uptime (p->readtime, timebuf, BGP_UPTIME_LEN, 0, NULL)); - vty_out (vty, ", Last write %s%s", - peer_uptime (p->last_write, timebuf, BGP_UPTIME_LEN, 0, NULL), VTYNL); + vty_out (vty, ", Last write %s\n", + peer_uptime (p->last_write, timebuf, BGP_UPTIME_LEN, 0, NULL)); /* Configured timer values. */ - vty_out (vty, " Hold time is %d, keepalive interval is %d seconds%s", - p->v_holdtime, p->v_keepalive, VTYNL); + vty_out (vty, " Hold time is %d, keepalive interval is %d seconds\n", + p->v_holdtime, p->v_keepalive); if (CHECK_FLAG (p->config, PEER_CONFIG_TIMER)) { vty_out (vty, " Configured hold time is %d", p->holdtime); - vty_out (vty, ", keepalive interval is %d seconds%s", - p->keepalive, VTYNL); + vty_out (vty, ", keepalive interval is %d seconds\n", + p->keepalive); } } /* Capability. */ @@ -8457,7 +8398,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js } else { - vty_out (vty, " Neighbor capabilities:%s", VTYNL); + vty_out (vty, " Neighbor capabilities:\n"); /* AS4 */ if (CHECK_FLAG (p->cap, PEER_CAP_AS4_RCV) @@ -8469,14 +8410,14 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js if (CHECK_FLAG (p->cap, PEER_CAP_AS4_RCV)) vty_out (vty, " %sreceived", CHECK_FLAG (p->cap, PEER_CAP_AS4_ADV) ? "and " : ""); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } /* AddPath */ if (CHECK_FLAG (p->cap, PEER_CAP_ADDPATH_RCV) || CHECK_FLAG (p->cap, PEER_CAP_ADDPATH_ADV)) { - vty_out (vty, " AddPath:%s", VTYNL); + vty_out (vty, " AddPath:\n"); for (afi = AFI_IP ; afi < AFI_MAX ; afi++) for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++) @@ -8492,7 +8433,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ADDPATH_AF_TX_RCV)) vty_out (vty, "%sreceived", CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ADDPATH_AF_TX_ADV) ? " and " : "" ); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ADDPATH_AF_RX_ADV) || @@ -8506,7 +8447,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ADDPATH_AF_RX_RCV)) vty_out (vty, "%sreceived", CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ADDPATH_AF_RX_ADV) ? " and " : "" ); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } } } @@ -8521,7 +8462,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js if (CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_RCV)) vty_out (vty, " %sreceived", CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_ADV) ? "and " : ""); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } /* Extended nexthop */ @@ -8534,15 +8475,15 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js if (CHECK_FLAG (p->cap, PEER_CAP_ENHE_RCV)) vty_out (vty, " %sreceived", CHECK_FLAG (p->cap, PEER_CAP_ENHE_ADV) ? "and " : ""); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); if (CHECK_FLAG (p->cap, PEER_CAP_ENHE_RCV)) { - vty_out (vty, " Address families by peer:%s ", VTYNL); + vty_out (vty, " Address families by peer:\n "); for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++) if (CHECK_FLAG (p->af_cap[AFI_IP][safi], PEER_CAP_ENHE_AF_RCV)) - vty_out (vty, " %s%s", - afi_safi_print (AFI_IP, safi), VTYNL); + vty_out (vty, " %s\n", + afi_safi_print (AFI_IP, safi)); } } @@ -8562,7 +8503,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js && CHECK_FLAG (p->cap, PEER_CAP_REFRESH_NEW_RCV)) ? "old & new" : CHECK_FLAG (p->cap, PEER_CAP_REFRESH_OLD_RCV) ? "old" : "new"); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } /* Multiprotocol Extensions */ @@ -8575,7 +8516,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js vty_out (vty, " advertised"); if (p->afc_recv[afi][safi]) vty_out (vty, " %sreceived", p->afc_adv[afi][safi] ? "and " : ""); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } /* Hostname capability */ @@ -8588,7 +8529,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js if (CHECK_FLAG (p->cap, PEER_CAP_HOSTNAME_RCV)) vty_out (vty, " %sreceived", CHECK_FLAG (p->cap, PEER_CAP_HOSTNAME_ADV) ? "and " : ""); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } /* Gracefull Restart */ @@ -8601,15 +8542,15 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_RCV)) vty_out (vty, " %sreceived", CHECK_FLAG (p->cap, PEER_CAP_RESTART_ADV) ? "and " : ""); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_RCV)) { int restart_af_count = 0; - vty_out (vty, " Remote Restart timer is %d seconds%s", - p->v_gr_restart, VTYNL); - vty_out (vty, " Address families by peer:%s ", VTYNL); + vty_out (vty, " Remote Restart timer is %d seconds\n", + p->v_gr_restart); + vty_out (vty, " Address families by peer:\n "); for (afi = AFI_IP ; afi < AFI_MAX ; afi++) for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++) @@ -8623,7 +8564,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js } if (! restart_af_count) vty_out (vty, "none"); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } } } @@ -8686,7 +8627,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js } else { - vty_out (vty, " Graceful restart informations:%s", VTYNL); + vty_out (vty, " Graceful restart informations:\n"); if (p->status == Established) { vty_out (vty, " End-of-RIB send: "); @@ -8702,7 +8643,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js } } } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); vty_out (vty, " End-of-RIB received: "); for (afi = AFI_IP ; afi < AFI_MAX ; afi++) { @@ -8716,16 +8657,16 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js } } } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } if (p->t_gr_restart) - vty_out (vty, " The remaining time of restart timer is %ld%s", - thread_timer_remain_second (p->t_gr_restart), VTYNL); + vty_out (vty, " The remaining time of restart timer is %ld\n", + thread_timer_remain_second (p->t_gr_restart)); if (p->t_gr_stale) - vty_out (vty, " The remaining time of stalepath timer is %ld%s", - thread_timer_remain_second (p->t_gr_stale), VTYNL); + vty_out (vty, " The remaining time of stalepath timer is %ld\n", + thread_timer_remain_second (p->t_gr_stale)); } } if (use_json) @@ -8754,20 +8695,20 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js else { /* Packet counts. */ - vty_out (vty, " Message statistics:%s", VTYNL); - vty_out (vty, " Inq depth is 0%s", VTYNL); - vty_out (vty, " Outq depth is %lu%s", (unsigned long) p->obuf->count, VTYNL); - vty_out (vty, " Sent Rcvd%s", VTYNL); - vty_out (vty, " Opens: %10d %10d%s", p->open_out, p->open_in, VTYNL); - vty_out (vty, " Notifications: %10d %10d%s", p->notify_out, p->notify_in, VTYNL); - vty_out (vty, " Updates: %10d %10d%s", p->update_out, p->update_in, VTYNL); - vty_out (vty, " Keepalives: %10d %10d%s", p->keepalive_out, p->keepalive_in, VTYNL); - vty_out (vty, " Route Refresh: %10d %10d%s", p->refresh_out, p->refresh_in, VTYNL); - vty_out (vty, " Capability: %10d %10d%s", p->dynamic_cap_out, p->dynamic_cap_in, VTYNL); - vty_out (vty, " Total: %10d %10d%s", p->open_out + p->notify_out + + vty_out (vty, " Message statistics:\n"); + vty_out (vty, " Inq depth is 0\n"); + vty_out (vty, " Outq depth is %lu\n", (unsigned long) p->obuf->count); + vty_out (vty, " Sent Rcvd\n"); + vty_out (vty, " Opens: %10d %10d\n", p->open_out, p->open_in); + vty_out (vty, " Notifications: %10d %10d\n", p->notify_out, p->notify_in); + vty_out (vty, " Updates: %10d %10d\n", p->update_out, p->update_in); + vty_out (vty, " Keepalives: %10d %10d\n", p->keepalive_out, p->keepalive_in); + vty_out (vty, " Route Refresh: %10d %10d\n", p->refresh_out, p->refresh_in); + vty_out (vty, " Capability: %10d %10d\n", p->dynamic_cap_out, p->dynamic_cap_in); + vty_out (vty, " Total: %10d %10d\n", p->open_out + p->notify_out + p->update_out + p->keepalive_out + p->refresh_out + p->dynamic_cap_out, p->open_in + p->notify_in + p->update_in + p->keepalive_in + p->refresh_in + - p->dynamic_cap_in, VTYNL); + p->dynamic_cap_in); } if (use_json) @@ -8787,8 +8728,8 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js else { /* advertisement-interval */ - vty_out (vty, " Minimum time between advertisement runs is %d seconds%s", - p->v_routeadv, VTYNL); + vty_out (vty, " Minimum time between advertisement runs is %d seconds\n", + p->v_routeadv); /* Update-source. */ if (p->update_if || p->update_source) @@ -8798,10 +8739,10 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js vty_out (vty, "%s", p->update_if); else if (p->update_source) vty_out (vty, "%s", sockunion2str (p->update_source, buf1, SU_ADDRSTRLEN)); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } /* Address Family Information */ @@ -8822,15 +8763,14 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js json_object_int_add(json_neigh, "connectionsDropped", p->dropped); } else - vty_out (vty, " Connections established %d; dropped %d%s", p->established, p->dropped, - VTYNL); + vty_out (vty, " Connections established %d; dropped %d\n", p->established, p->dropped); if (! p->last_reset) { if (use_json) json_object_string_add(json_neigh, "lastReset", "never"); else - vty_out (vty, " Last reset never%s", VTYNL); + vty_out (vty, " Last reset never\n"); } else { @@ -8883,9 +8823,9 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js { code_str = bgp_notify_code_str(p->notify.code); subcode_str = bgp_notify_subcode_str(p->notify.code, p->notify.subcode); - vty_out (vty, "due to NOTIFICATION %s (%s%s)%s", + vty_out (vty, "due to NOTIFICATION %s (%s%s)\n", p->last_reset == PEER_DOWN_NOTIFY_SEND ? "sent" : "received", - code_str, subcode_str, VTYNL); + code_str, subcode_str); if (p->last_reset == PEER_DOWN_NOTIFY_RECEIVED && p->notify.code == BGP_NOTIFY_CEASE && (p->notify.subcode == BGP_NOTIFY_CEASE_ADMIN_SHUTDOWN @@ -8898,19 +8838,19 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js msg_str = bgp_notify_admin_message(msgbuf, sizeof(msgbuf), (u_char*)p->notify.data, p->notify.length); if (msg_str) - vty_out (vty, " Message: \"%s\"%s", msg_str, VTYNL); + vty_out (vty, " Message: \"%s\"\n", msg_str); } } else { - vty_out (vty, "due to %s%s", - peer_down_str[(int) p->last_reset], VTYNL); + vty_out (vty, "due to %s\n", + peer_down_str[(int) p->last_reset]); } if (p->last_reset_cause_size) { msg = p->last_reset_cause; - vty_out(vty, " Message received that caused BGP to send a NOTIFICATION:%s ", VTYNL); + vty_out(vty, " Message received that caused BGP to send a NOTIFICATION:\n "); for (i = 1; i <= p->last_reset_cause_size; i++) { vty_out(vty, "%02X", *msg++); @@ -8919,7 +8859,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js { if (i % 16 == 0) { - vty_out(vty, "%s ", VTYNL); + vty_out(vty, "\n "); } else if (i % 4 == 0) { @@ -8927,7 +8867,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js } } } - vty_out(vty, "%s", VTYNL); + vty_out(vty, "\n"); } } } @@ -8937,7 +8877,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js if (use_json) json_object_boolean_true_add(json_neigh, "prefixesConfigExceedMax"); else - vty_out (vty, " Peer had exceeded the max. no. of prefixes configured.%s", VTYNL); + vty_out (vty, " Peer had exceeded the max. no. of prefixes configured.\n"); if (p->t_pmax_restart) { @@ -8947,17 +8887,16 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js json_object_int_add(json_neigh, "restartInTimerMsec", thread_timer_remain_second (p->t_pmax_restart) * 1000); } else - vty_out (vty, " Reduce the no. of prefix from %s, will restart in %ld seconds%s", - p->host, thread_timer_remain_second (p->t_pmax_restart), - VTYNL); + vty_out (vty, " Reduce the no. of prefix from %s, will restart in %ld seconds\n", + p->host, thread_timer_remain_second (p->t_pmax_restart)); } else { if (use_json) json_object_boolean_true_add(json_neigh, "reducePrefixNumAndClearIpBgp"); else - vty_out (vty, " Reduce the no. of prefix and clear ip bgp %s to restore peering%s", - p->host, VTYNL); + vty_out (vty, " Reduce the no. of prefix and clear ip bgp %s to restore peering\n", + p->host); } } @@ -8974,11 +8913,11 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js else { if (p->gtsm_hops > 0) - vty_out (vty, " External BGP neighbor may be up to %d hops away.%s", - p->gtsm_hops, VTYNL); + vty_out (vty, " External BGP neighbor may be up to %d hops away.\n", + p->gtsm_hops); else if (p->ttl > 1) - vty_out (vty, " External BGP neighbor may be up to %d hops away.%s", - p->ttl, VTYNL); + vty_out (vty, " External BGP neighbor may be up to %d hops away.\n", + p->ttl); } } else @@ -8988,8 +8927,8 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js if (use_json) json_object_int_add(json_neigh, "internalBgpNbrMaxHopsAway", p->gtsm_hops); else - vty_out (vty, " Internal BGP neighbor may be up to %d hops away.%s", - p->gtsm_hops, VTYNL); + vty_out (vty, " Internal BGP neighbor may be up to %d hops away.\n", + p->gtsm_hops); } } @@ -9002,10 +8941,9 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js json_object_int_add(json_neigh, "portLocal", ntohs (p->su_local->sin.sin_port)); } else - vty_out (vty, "Local host: %s, Local port: %d%s", + vty_out (vty, "Local host: %s, Local port: %d\n", sockunion2str (p->su_local, buf1, SU_ADDRSTRLEN), - ntohs (p->su_local->sin.sin_port), - VTYNL); + ntohs (p->su_local->sin.sin_port)); } /* Remote address. */ @@ -9017,10 +8955,9 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js json_object_int_add(json_neigh, "portForeign", ntohs (p->su_remote->sin.sin_port)); } else - vty_out (vty, "Foreign host: %s, Foreign port: %d%s", + vty_out (vty, "Foreign host: %s, Foreign port: %d\n", sockunion2str (p->su_remote, buf1, SU_ADDRSTRLEN), - ntohs (p->su_remote->sin.sin_port), - VTYNL); + ntohs (p->su_remote->sin.sin_port)); } /* Nexthop display. */ @@ -9041,18 +8978,14 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js } else { - vty_out (vty, "Nexthop: %s%s", - inet_ntop (AF_INET, &p->nexthop.v4, buf1, sizeof(buf1)), - VTYNL); - vty_out (vty, "Nexthop global: %s%s", - inet_ntop (AF_INET6, &p->nexthop.v6_global, buf1, sizeof(buf1)), - VTYNL); - vty_out (vty, "Nexthop local: %s%s", - inet_ntop (AF_INET6, &p->nexthop.v6_local, buf1, sizeof(buf1)), - VTYNL); - vty_out (vty, "BGP connection: %s%s", - p->shared_network ? "shared network" : "non shared network", - VTYNL); + vty_out (vty, "Nexthop: %s\n", + inet_ntop (AF_INET, &p->nexthop.v4, buf1, sizeof(buf1))); + vty_out (vty, "Nexthop global: %s\n", + inet_ntop (AF_INET6, &p->nexthop.v6_global, buf1, sizeof(buf1))); + vty_out (vty, "Nexthop local: %s\n", + inet_ntop (AF_INET6, &p->nexthop.v6_local, buf1, sizeof(buf1))); + vty_out (vty, "BGP connection: %s\n", + p->shared_network ? "shared network" : "non shared network"); } } @@ -9085,28 +9018,26 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js } else { - vty_out (vty, "BGP Connect Retry Timer in Seconds: %d%s", - p->v_connect, VTYNL); + vty_out (vty, "BGP Connect Retry Timer in Seconds: %d\n", + p->v_connect); if (p->status == Established && p->rtt) - vty_out (vty, "Estimated round trip time: %d ms%s", - p->rtt, VTYNL); + vty_out (vty, "Estimated round trip time: %d ms\n", + p->rtt); if (p->t_start) - vty_out (vty, "Next start timer due in %ld seconds%s", - thread_timer_remain_second (p->t_start), VTYNL); + vty_out (vty, "Next start timer due in %ld seconds\n", + thread_timer_remain_second (p->t_start)); if (p->t_connect) - vty_out (vty, "Next connect timer due in %ld seconds%s", - thread_timer_remain_second (p->t_connect), VTYNL); + vty_out (vty, "Next connect timer due in %ld seconds\n", + thread_timer_remain_second (p->t_connect)); if (p->t_routeadv) - vty_out (vty, "MRAI (interval %u) timer expires in %ld seconds%s", - p->v_routeadv, thread_timer_remain_second (p->t_routeadv), - VTYNL); + vty_out (vty, "MRAI (interval %u) timer expires in %ld seconds\n", + p->v_routeadv, thread_timer_remain_second (p->t_routeadv)); if (p->password) - vty_out (vty, "Peer Authentication Enabled%s", VTYNL); + vty_out (vty, "Peer Authentication Enabled\n"); - vty_out (vty, "Read thread: %s Write thread: %s%s", + vty_out (vty, "Read thread: %s Write thread: %s\n", p->t_read ? "on" : "off", - p->t_write ? "on" : "off", - VTYNL); + p->t_write ? "on" : "off"); } if (p->notify.code == BGP_NOTIFY_OPEN_ERR @@ -9114,7 +9045,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js bgp_capability_vty_out (vty, p, use_json, json_neigh); if (!use_json) - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); /* BFD information. */ bgp_bfd_show_info(vty, p, use_json, json_neigh); @@ -9173,17 +9104,17 @@ bgp_show_neighbor (struct vty *vty, struct bgp *bgp, enum show_type type, if (use_json) json_object_boolean_true_add(json, "bgpNoSuchNeighbor"); else - vty_out (vty, "%% No such neighbor%s", VTYNL); + vty_out (vty, "%% No such neighbor\n"); } if (use_json) { - vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL); + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else { - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } return CMD_SUCCESS; @@ -9198,7 +9129,7 @@ bgp_show_all_instances_neighbors_vty (struct vty *vty, u_char use_json) int is_first = 1; if (use_json) - vty_out (vty, "{%s", VTYNL); + vty_out (vty, "{\n"); for (ALL_LIST_ELEMENTS (bm->bgp, node, nnode, bgp)) { @@ -9208,8 +9139,7 @@ bgp_show_all_instances_neighbors_vty (struct vty *vty, u_char use_json) { zlog_err("Unable to allocate memory for JSON object"); vty_out (vty, - "{\"error\": {\"message:\": \"Unable to allocate memory for JSON object\"}}}%s", - VTYNL); + "{\"error\": {\"message:\": \"Unable to allocate memory for JSON object\"}}}\n"); return; } @@ -9221,7 +9151,7 @@ bgp_show_all_instances_neighbors_vty (struct vty *vty, u_char use_json) ? "Default" : bgp->name); if (! is_first) - vty_out (vty, ",%s", VTYNL); + vty_out (vty, ",\n"); else is_first = 0; @@ -9230,17 +9160,15 @@ bgp_show_all_instances_neighbors_vty (struct vty *vty, u_char use_json) } else { - vty_out (vty, "%sInstance %s:%s", - VTYNL, + vty_out (vty, "\nInstance %s:\n", (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT) - ? "Default" : bgp->name, - VTYNL); + ? "Default" : bgp->name); } bgp_show_neighbor (vty, bgp, show_all, NULL, NULL, use_json, json); } if (use_json) - vty_out (vty, "}%s", VTYNL); + vty_out (vty, "}\n"); } static int @@ -9268,11 +9196,11 @@ bgp_show_neighbor_vty (struct vty *vty, const char *name, { json = json_object_new_object(); json_object_boolean_true_add(json, "bgpNoSuchInstance"); - vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL); + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else - vty_out (vty, "%% No such BGP instance exist%s", VTYNL); + vty_out (vty, "%% No such BGP instance exist\n"); return CMD_WARNING; } @@ -9362,7 +9290,7 @@ DEFUN (show_ip_bgp_paths, BGP_SAFI_HELP_STR "Path information\n") { - vty_out (vty, "Address Refcnt Path%s", VTYNL); + vty_out (vty, "Address Refcnt Path\n"); aspath_print_all_vty (vty); return CMD_SUCCESS; } @@ -9375,8 +9303,8 @@ community_show_all_iterator (struct hash_backet *backet, struct vty *vty) struct community *com; com = (struct community *) backet->data; - vty_out (vty, "[%p] (%ld) %s%s", (void *)backet, com->refcnt, - community_str (com), VTYNL); + vty_out (vty, "[%p] (%ld) %s\n", (void *)backet, com->refcnt, + community_str (com)); } /* Show BGP's community internal data. */ @@ -9388,7 +9316,7 @@ DEFUN (show_ip_bgp_community_info, BGP_STR "List all bgp community information\n") { - vty_out (vty, "Address Refcnt Community%s", VTYNL); + vty_out (vty, "Address Refcnt Community\n"); hash_iterate (community_hash (), (void (*) (struct hash_backet *, void *)) @@ -9404,8 +9332,8 @@ lcommunity_show_all_iterator (struct hash_backet *backet, struct vty *vty) struct lcommunity *lcom; lcom = (struct lcommunity *) backet->data; - vty_out (vty, "[%p] (%ld) %s%s", (void *)backet, lcom->refcnt, - lcommunity_str (lcom), VTYNL); + vty_out (vty, "[%p] (%ld) %s\n", (void *)backet, lcom->refcnt, + lcommunity_str (lcom)); } /* Show BGP's community internal data. */ @@ -9417,7 +9345,7 @@ DEFUN (show_ip_bgp_lcommunity_info, BGP_STR "List all bgp large-community information\n") { - vty_out (vty, "Address Refcnt Large-community%s", VTYNL); + vty_out (vty, "Address Refcnt Large-community\n"); hash_iterate (lcommunity_hash (), (void (*) (struct hash_backet *, void *)) @@ -9448,10 +9376,8 @@ bgp_show_all_instances_updgrps_vty (struct vty *vty, afi_t afi, safi_t safi) for (ALL_LIST_ELEMENTS (bm->bgp, node, nnode, bgp)) { - vty_out (vty, "%sInstance %s:%s", - VTYNL, - (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT) ? "Default" : bgp->name, - VTYNL); + vty_out (vty, "\nInstance %s:\n", + (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT) ? "Default" : bgp->name); update_group_show(bgp, afi, safi, vty, 0); } } @@ -9834,20 +9760,17 @@ bgp_show_one_peer_group (struct vty *vty, struct peer_group *group) if (conf->as_type == AS_SPECIFIED || conf->as_type == AS_EXTERNAL) { - vty_out (vty, "%sBGP peer-group %s, remote AS %d%s", - VTYNL, group->name, conf->as, VTYNL); + vty_out (vty, "\nBGP peer-group %s, remote AS %d\n", group->name, conf->as); } else if (conf->as_type == AS_INTERNAL) { - vty_out (vty, "%sBGP peer-group %s, remote AS %d%s", - VTYNL, group->name, group->bgp->as, VTYNL); + vty_out (vty, "\nBGP peer-group %s, remote AS %d\n", group->name, group->bgp->as); } else { - vty_out (vty, "%sBGP peer-group %s%s", - VTYNL, group->name, VTYNL); + vty_out (vty, "\nBGP peer-group %s\n", group->name); } if ((group->bgp->as == conf->as) || (conf->as_type == AS_INTERNAL)) - vty_out (vty, " Peer-group type is internal%s", VTYNL); + vty_out (vty, " Peer-group type is internal\n"); else - vty_out (vty, " Peer-group type is external%s", VTYNL); + vty_out (vty, " Peer-group type is external\n"); /* Display AFs configured. */ vty_out (vty, " Configured address-families:"); @@ -9861,9 +9784,9 @@ bgp_show_one_peer_group (struct vty *vty, struct peer_group *group) } } if (!af_cfgd) - vty_out (vty, " none%s", VTYNL); + vty_out (vty, " none\n"); else - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); /* Display listen ranges (for dynamic neighbors), if any */ for (afi = AFI_IP; afi < AFI_MAX; afi++) @@ -9878,15 +9801,15 @@ bgp_show_one_peer_group (struct vty *vty, struct peer_group *group) if (lr_count) { vty_out(vty, - " %d %s listen range(s)%s", - lr_count, af_str, VTYNL); + " %d %s listen range(s)\n", + lr_count, af_str); for (ALL_LIST_ELEMENTS (group->listen_range[afi], node, nnode, range)) { prefix2str(range, buf, sizeof(buf)); - vty_out(vty, " %s%s", buf, VTYNL); + vty_out(vty, " %s\n", buf); } } } @@ -9894,7 +9817,7 @@ bgp_show_one_peer_group (struct vty *vty, struct peer_group *group) /* Display group members and their status */ if (listcount(group->peer)) { - vty_out (vty, " Peer-group members:%s", VTYNL); + vty_out (vty, " Peer-group members:\n"); for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer)) { if (CHECK_FLAG (peer->flags, PEER_FLAG_SHUTDOWN)) @@ -9905,9 +9828,9 @@ bgp_show_one_peer_group (struct vty *vty, struct peer_group *group) peer_status = lookup_msg(bgp_status_msg, peer->status, NULL); dynamic = peer_dynamic_neighbor(peer); - vty_out (vty, " %s %s %s %s", + vty_out (vty, " %s %s %s \n", peer->host, dynamic ? "(dynamic)" : "", - peer_status, VTYNL); + peer_status); } } @@ -9947,7 +9870,7 @@ bgp_show_peer_group (struct vty *vty, struct bgp *bgp, } if (type == show_peer_group && ! find) - vty_out (vty, "%% No such peer-group%s", VTYNL); + vty_out (vty, "%% No such peer-group\n"); return CMD_SUCCESS; } @@ -9966,7 +9889,7 @@ bgp_show_peer_group_vty (struct vty *vty, const char *name, if (! bgp) { - vty_out (vty, "%% No such BGP instance exist%s", VTYNL); + vty_out (vty, "%% No such BGP instance exist\n"); return CMD_WARNING; } @@ -10011,7 +9934,7 @@ DEFUN (bgp_redistribute_ipv4, type = proto_redistnum (AFI_IP, argv[idx_protocol]->text); if (type < 0) { - vty_out (vty, "%% Invalid route type%s", VTYNL); + vty_out (vty, "%% Invalid route type\n"); return CMD_WARNING_CONFIG_FAILED; } bgp_redist_add(bgp, AFI_IP, type, 0); @@ -10041,7 +9964,7 @@ DEFUN (bgp_redistribute_ipv4_rmap, type = proto_redistnum (AFI_IP, argv[idx_protocol]->text); if (type < 0) { - vty_out (vty, "%% Invalid route type%s", VTYNL); + vty_out (vty, "%% Invalid route type\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -10076,7 +9999,7 @@ DEFUN (bgp_redistribute_ipv4_metric, type = proto_redistnum (AFI_IP, argv[idx_protocol]->text); if (type < 0) { - vty_out (vty, "%% Invalid route type%s", VTYNL); + vty_out (vty, "%% Invalid route type\n"); return CMD_WARNING_CONFIG_FAILED; } metric = strtoul(argv[idx_number]->arg, NULL, 10); @@ -10115,7 +10038,7 @@ DEFUN (bgp_redistribute_ipv4_rmap_metric, type = proto_redistnum (AFI_IP, argv[idx_protocol]->text); if (type < 0) { - vty_out (vty, "%% Invalid route type%s", VTYNL); + vty_out (vty, "%% Invalid route type\n"); return CMD_WARNING_CONFIG_FAILED; } metric = strtoul(argv[idx_number]->arg, NULL, 10); @@ -10157,7 +10080,7 @@ DEFUN (bgp_redistribute_ipv4_metric_rmap, type = proto_redistnum (AFI_IP, argv[idx_protocol]->text); if (type < 0) { - vty_out (vty, "%% Invalid route type%s", VTYNL); + vty_out (vty, "%% Invalid route type\n"); return CMD_WARNING_CONFIG_FAILED; } metric = strtoul(argv[idx_number]->arg, NULL, 10); @@ -10447,7 +10370,7 @@ DEFUN (no_bgp_redistribute_ipv4, type = proto_redistnum (AFI_IP, argv[idx_protocol]->text); if (type < 0) { - vty_out (vty, "%% Invalid route type%s", VTYNL); + vty_out (vty, "%% Invalid route type\n"); return CMD_WARNING_CONFIG_FAILED; } return bgp_redistribute_unset (bgp, AFI_IP, type, 0); @@ -10477,7 +10400,7 @@ DEFUN (bgp_redistribute_ipv6, type = proto_redistnum (AFI_IP6, argv[idx_protocol]->text); if (type < 0) { - vty_out (vty, "%% Invalid route type%s", VTYNL); + vty_out (vty, "%% Invalid route type\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -10502,7 +10425,7 @@ DEFUN (bgp_redistribute_ipv6_rmap, type = proto_redistnum (AFI_IP6, argv[idx_protocol]->text); if (type < 0) { - vty_out (vty, "%% Invalid route type%s", VTYNL); + vty_out (vty, "%% Invalid route type\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -10529,7 +10452,7 @@ DEFUN (bgp_redistribute_ipv6_metric, type = proto_redistnum (AFI_IP6, argv[idx_protocol]->text); if (type < 0) { - vty_out (vty, "%% Invalid route type%s", VTYNL); + vty_out (vty, "%% Invalid route type\n"); return CMD_WARNING_CONFIG_FAILED; } metric = strtoul(argv[idx_number]->arg, NULL, 10); @@ -10560,7 +10483,7 @@ DEFUN (bgp_redistribute_ipv6_rmap_metric, type = proto_redistnum (AFI_IP6, argv[idx_protocol]->text); if (type < 0) { - vty_out (vty, "%% Invalid route type%s", VTYNL); + vty_out (vty, "%% Invalid route type\n"); return CMD_WARNING_CONFIG_FAILED; } metric = strtoul(argv[idx_number]->arg, NULL, 10); @@ -10592,7 +10515,7 @@ DEFUN (bgp_redistribute_ipv6_metric_rmap, type = proto_redistnum (AFI_IP6, argv[idx_protocol]->text); if (type < 0) { - vty_out (vty, "%% Invalid route type%s", VTYNL); + vty_out (vty, "%% Invalid route type\n"); return CMD_WARNING_CONFIG_FAILED; } metric = strtoul(argv[idx_number]->arg, NULL, 10); @@ -10621,7 +10544,7 @@ DEFUN (no_bgp_redistribute_ipv6, type = proto_redistnum (AFI_IP6, argv[idx_protocol]->text); if (type < 0) { - vty_out (vty, "%% Invalid route type%s", VTYNL); + vty_out (vty, "%% Invalid route type\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -10664,7 +10587,7 @@ bgp_config_write_redistribute (struct vty *vty, struct bgp *bgp, afi_t afi, vty_out (vty, " metric %u", red->redist_metric); if (red->rmap.name) vty_out (vty, " route-map %s", red->rmap.name); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } } } @@ -11828,16 +11751,16 @@ community_list_perror (struct vty *vty, int ret) switch (ret) { case COMMUNITY_LIST_ERR_CANT_FIND_LIST: - vty_out (vty, "%% Can't find community-list%s", VTYNL); + vty_out (vty, "%% Can't find community-list\n"); break; case COMMUNITY_LIST_ERR_MALFORMED_VAL: - vty_out (vty, "%% Malformed community-list value%s", VTYNL); + vty_out (vty, "%% Malformed community-list value\n"); break; case COMMUNITY_LIST_ERR_STANDARD_CONFLICT: - vty_out (vty, "%% Community name conflict, previously defined as standard community%s", VTYNL); + vty_out (vty, "%% Community name conflict, previously defined as standard community\n"); break; case COMMUNITY_LIST_ERR_EXPANDED_CONFLICT: - vty_out (vty, "%% Community name conflict, previously defined as expanded community%s", VTYNL); + vty_out (vty, "%% Community name conflict, previously defined as expanded community\n"); break; } } @@ -12014,25 +11937,24 @@ community_list_show (struct vty *vty, struct community_list *list) if (entry == list->head) { if (all_digit (list->name)) - vty_out (vty, "Community %s list %s%s", + vty_out (vty, "Community %s list %s\n", entry->style == COMMUNITY_LIST_STANDARD ? "standard" : "(expanded) access", - list->name, VTYNL); + list->name); else - vty_out (vty, "Named Community %s list %s%s", + vty_out (vty, "Named Community %s list %s\n", entry->style == COMMUNITY_LIST_STANDARD ? "standard" : "expanded", - list->name, VTYNL); + list->name); } if (entry->any) - vty_out (vty, " %s%s", - community_direct_str (entry->direct), VTYNL); + vty_out (vty, " %s\n", + community_direct_str (entry->direct)); else - vty_out (vty, " %s %s%s", + vty_out (vty, " %s %s\n", community_direct_str (entry->direct), entry->style == COMMUNITY_LIST_STANDARD - ? community_str (entry->u.com) : entry->config, - VTYNL); + ? community_str (entry->u.com) : entry->config); } } @@ -12074,7 +11996,7 @@ DEFUN (show_ip_community_list_arg, list = community_list_lookup (bgp_clist, argv[idx_comm_list]->arg, COMMUNITY_LIST_MASTER); if (! list) { - vty_out (vty, "%% Can't find community-list%s", VTYNL); + vty_out (vty, "%% Can't find community-list\n"); return CMD_WARNING; } @@ -12106,7 +12028,7 @@ lcommunity_list_set_vty (struct vty *vty, int argc, struct cmd_token **argv, cl_name = argv[idx]->arg; if (reject_all_digit_name && all_digit (cl_name)) { - vty_out (vty, "%% Community name cannot have all digits%s", VTYNL); + vty_out (vty, "%% Community name cannot have all digits\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -12359,25 +12281,24 @@ lcommunity_list_show (struct vty *vty, struct community_list *list) if (entry == list->head) { if (all_digit (list->name)) - vty_out (vty, "Large community %s list %s%s", + vty_out (vty, "Large community %s list %s\n", entry->style == EXTCOMMUNITY_LIST_STANDARD ? "standard" : "(expanded) access", - list->name, VTYNL); + list->name); else - vty_out (vty, "Named large community %s list %s%s", + vty_out (vty, "Named large community %s list %s\n", entry->style == EXTCOMMUNITY_LIST_STANDARD ? "standard" : "expanded", - list->name, VTYNL); + list->name); } if (entry->any) - vty_out (vty, " %s%s", - community_direct_str (entry->direct), VTYNL); + vty_out (vty, " %s\n", + community_direct_str (entry->direct)); else - vty_out (vty, " %s %s%s", + vty_out (vty, " %s %s\n", community_direct_str (entry->direct), entry->style == EXTCOMMUNITY_LIST_STANDARD ? - entry->u.ecom->str : entry->config, - VTYNL); + entry->u.ecom->str : entry->config); } } @@ -12418,7 +12339,7 @@ DEFUN (show_ip_lcommunity_list_arg, list = community_list_lookup (bgp_clist, argv[3]->arg, LARGE_COMMUNITY_LIST_MASTER); if (! list) { - vty_out (vty, "%% Can't find extcommunity-list%s", VTYNL); + vty_out (vty, "%% Can't find extcommunity-list\n"); return CMD_WARNING; } @@ -12595,25 +12516,24 @@ extcommunity_list_show (struct vty *vty, struct community_list *list) if (entry == list->head) { if (all_digit (list->name)) - vty_out (vty, "Extended community %s list %s%s", + vty_out (vty, "Extended community %s list %s\n", entry->style == EXTCOMMUNITY_LIST_STANDARD ? "standard" : "(expanded) access", - list->name, VTYNL); + list->name); else - vty_out (vty, "Named extended community %s list %s%s", + vty_out (vty, "Named extended community %s list %s\n", entry->style == EXTCOMMUNITY_LIST_STANDARD ? "standard" : "expanded", - list->name, VTYNL); + list->name); } if (entry->any) - vty_out (vty, " %s%s", - community_direct_str (entry->direct), VTYNL); + vty_out (vty, " %s\n", + community_direct_str (entry->direct)); else - vty_out (vty, " %s %s%s", + vty_out (vty, " %s %s\n", community_direct_str (entry->direct), entry->style == EXTCOMMUNITY_LIST_STANDARD ? - entry->u.ecom->str : entry->config, - VTYNL); + entry->u.ecom->str : entry->config); } } @@ -12655,7 +12575,7 @@ DEFUN (show_ip_extcommunity_list_arg, list = community_list_lookup (bgp_clist, argv[idx_comm_list]->arg, EXTCOMMUNITY_LIST_MASTER); if (! list) { - vty_out (vty, "%% Can't find extcommunity-list%s", VTYNL); + vty_out (vty, "%% Can't find extcommunity-list\n"); return CMD_WARNING; } @@ -12697,21 +12617,19 @@ community_list_config_write (struct vty *vty) for (list = cm->num.head; list; list = list->next) for (entry = list->head; entry; entry = entry->next) { - vty_out (vty, "ip community-list %s %s %s%s", + vty_out (vty, "ip community-list %s %s %s\n", list->name, community_direct_str (entry->direct), - community_list_config_str (entry), - VTYNL); + community_list_config_str (entry)); write++; } for (list = cm->str.head; list; list = list->next) for (entry = list->head; entry; entry = entry->next) { - vty_out (vty, "ip community-list %s %s %s %s%s", + vty_out (vty, "ip community-list %s %s %s %s\n", entry->style == COMMUNITY_LIST_STANDARD ? "standard" : "expanded", list->name, community_direct_str (entry->direct), - community_list_config_str (entry), - VTYNL); + community_list_config_str (entry)); write++; } @@ -12721,19 +12639,19 @@ community_list_config_write (struct vty *vty) for (list = cm->num.head; list; list = list->next) for (entry = list->head; entry; entry = entry->next) { - vty_out (vty, "ip extcommunity-list %s %s %s%s", + vty_out (vty, "ip extcommunity-list %s %s %s\n", list->name, community_direct_str (entry->direct), - community_list_config_str (entry), VTYNL); + community_list_config_str (entry)); write++; } for (list = cm->str.head; list; list = list->next) for (entry = list->head; entry; entry = entry->next) { - vty_out (vty, "ip extcommunity-list %s %s %s %s%s", + vty_out (vty, "ip extcommunity-list %s %s %s %s\n", entry->style == EXTCOMMUNITY_LIST_STANDARD ? "standard" : "expanded", list->name, community_direct_str (entry->direct), - community_list_config_str (entry), VTYNL); + community_list_config_str (entry)); write++; } @@ -12744,19 +12662,19 @@ community_list_config_write (struct vty *vty) for (list = cm->num.head; list; list = list->next) for (entry = list->head; entry; entry = entry->next) { - vty_out (vty, "ip large-community-list %s %s %s%s", + vty_out (vty, "ip large-community-list %s %s %s\n", list->name, community_direct_str (entry->direct), - community_list_config_str (entry), VTYNL); + community_list_config_str (entry)); write++; } for (list = cm->str.head; list; list = list->next) for (entry = list->head; entry; entry = entry->next) { - vty_out (vty, "ip large-community-list %s %s %s %s%s", + vty_out (vty, "ip large-community-list %s %s %s %s\n", entry->style == LARGE_COMMUNITY_LIST_STANDARD ? "standard" : "expanded", list->name, community_direct_str (entry->direct), - community_list_config_str (entry), VTYNL); + community_list_config_str (entry)); write++; } diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 0bde8ca11..a0a86136f 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -6502,15 +6502,15 @@ bgp_config_write_filter (struct vty *vty, struct peer *peer, || strcmp (filter->dlist[in].name, gfilter->dlist[in].name) != 0) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s distribute-list %s in%s", - addr, filter->dlist[in].name, VTYNL); + " neighbor %s distribute-list %s in\n", + addr, filter->dlist[in].name); } if (filter->dlist[out].name && ! gfilter) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s distribute-list %s out%s", - addr, filter->dlist[out].name, VTYNL); + " neighbor %s distribute-list %s out\n", + addr, filter->dlist[out].name); } /* prefix-list. */ @@ -6519,15 +6519,15 @@ bgp_config_write_filter (struct vty *vty, struct peer *peer, || strcmp (filter->plist[in].name, gfilter->plist[in].name) != 0) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s prefix-list %s in%s", - addr, filter->plist[in].name, VTYNL); + " neighbor %s prefix-list %s in\n", + addr, filter->plist[in].name); } if (filter->plist[out].name && ! gfilter) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s prefix-list %s out%s", - addr, filter->plist[out].name, VTYNL); + " neighbor %s prefix-list %s out\n", + addr, filter->plist[out].name); } /* route-map. */ @@ -6536,8 +6536,8 @@ bgp_config_write_filter (struct vty *vty, struct peer *peer, || strcmp (filter->map[RMAP_IN].name, gfilter->map[RMAP_IN].name) != 0) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s route-map %s in%s", - addr, filter->map[RMAP_IN].name, VTYNL); + " neighbor %s route-map %s in\n", + addr, filter->map[RMAP_IN].name); } if (filter->map[RMAP_OUT].name) @@ -6545,16 +6545,16 @@ bgp_config_write_filter (struct vty *vty, struct peer *peer, || strcmp (filter->map[RMAP_OUT].name, gfilter->map[RMAP_OUT].name) != 0) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s route-map %s out%s", - addr, filter->map[RMAP_OUT].name, VTYNL); + " neighbor %s route-map %s out\n", + addr, filter->map[RMAP_OUT].name); } /* unsuppress-map */ if (filter->usmap.name && ! gfilter) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s unsuppress-map %s%s", - addr, filter->usmap.name, VTYNL); + " neighbor %s unsuppress-map %s\n", + addr, filter->usmap.name); } /* filter-list. */ @@ -6563,15 +6563,15 @@ bgp_config_write_filter (struct vty *vty, struct peer *peer, || strcmp (filter->aslist[in].name, gfilter->aslist[in].name) != 0) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s filter-list %s in%s", - addr, filter->aslist[in].name, VTYNL); + " neighbor %s filter-list %s in\n", + addr, filter->aslist[in].name); } if (filter->aslist[out].name && ! gfilter) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s filter-list %s out%s", - addr, filter->aslist[out].name, VTYNL); + " neighbor %s filter-list %s out\n", + addr, filter->aslist[out].name); } } @@ -6626,7 +6626,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp, if_ras_printed = TRUE; } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } /* remote-as and peer-group */ @@ -6639,22 +6639,22 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp, { if (peer->as_type == AS_SPECIFIED) { - vty_outln (vty, " neighbor %s remote-as %u", addr,peer->as); + vty_out (vty, " neighbor %s remote-as %u\n", addr,peer->as); } else if (peer->as_type == AS_INTERNAL) { - vty_outln (vty, " neighbor %s remote-as internal", addr); + vty_out (vty, " neighbor %s remote-as internal\n", addr); } else if (peer->as_type == AS_EXTERNAL) { - vty_outln (vty, " neighbor %s remote-as external", addr); + vty_out (vty, " neighbor %s remote-as external\n", addr); } } /* For swpX peers we displayed the peer-group * via 'neighbor swpX interface peer-group WORD' */ if (!if_pg_printed) - vty_outln (vty, " neighbor %s peer-group %s", addr, + vty_out (vty, " neighbor %s peer-group %s\n", addr, peer->group->name); } @@ -6664,22 +6664,22 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp, /* peer is a peer-group, declare the peer-group */ if (CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP)) { - vty_outln (vty, " neighbor %s peer-group",addr); + vty_out (vty, " neighbor %s peer-group\n",addr); } if (!if_ras_printed) { if (peer->as_type == AS_SPECIFIED) { - vty_outln (vty, " neighbor %s remote-as %u", addr,peer->as); + vty_out (vty, " neighbor %s remote-as %u\n", addr,peer->as); } else if (peer->as_type == AS_INTERNAL) { - vty_outln (vty, " neighbor %s remote-as internal", addr); + vty_out (vty, " neighbor %s remote-as internal\n", addr); } else if (peer->as_type == AS_EXTERNAL) { - vty_outln (vty, " neighbor %s remote-as external", addr); + vty_out (vty, " neighbor %s remote-as external\n", addr); } } } @@ -6694,7 +6694,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp, || (CHECK_FLAG (peer->flags, PEER_FLAG_LOCAL_AS_REPLACE_AS) != CHECK_FLAG (g_peer->flags, PEER_FLAG_LOCAL_AS_REPLACE_AS))) { - vty_outln (vty, " neighbor %s local-as %u%s%s", addr, + vty_out (vty, " neighbor %s local-as %u%s%s\n", addr, peer->change_local_as, CHECK_FLAG (peer->flags, PEER_FLAG_LOCAL_AS_NO_PREPEND) ? " no-prepend" : "", @@ -6705,7 +6705,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp, /* description */ if (peer->desc) { - vty_outln (vty, " neighbor %s description %s", addr,peer->desc); + vty_out (vty, " neighbor %s description %s\n", addr,peer->desc); } /* shutdown */ @@ -6716,10 +6716,10 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp, peer->tx_shutdown_message) { if (peer->tx_shutdown_message) - vty_outln (vty, " neighbor %s shutdown message %s", addr, + vty_out (vty, " neighbor %s shutdown message %s\n", addr, peer->tx_shutdown_message); else - vty_outln (vty, " neighbor %s shutdown", addr); + vty_out (vty, " neighbor %s shutdown\n", addr); } } @@ -6739,7 +6739,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp, || ! g_peer->password || strcmp (peer->password, g_peer->password) != 0) { - vty_outln (vty, " neighbor %s password %s", addr,peer->password); + vty_out (vty, " neighbor %s password %s\n", addr,peer->password); } } @@ -6748,20 +6748,20 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp, { if (!peer_group_active (peer)) { - vty_outln (vty, " neighbor %s solo", addr); + vty_out (vty, " neighbor %s solo\n", addr); } } /* BGP port */ if (peer->port != BGP_PORT_DEFAULT) { - vty_outln (vty, " neighbor %s port %d", addr,peer->port); + vty_out (vty, " neighbor %s port %d\n", addr,peer->port); } /* Local interface name */ if (peer->ifname) { - vty_outln (vty, " neighbor %s interface %s", addr,peer->ifname); + vty_out (vty, " neighbor %s interface %s\n", addr,peer->ifname); } /* passive */ @@ -6770,7 +6770,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp, if (! peer_group_active (peer) || ! CHECK_FLAG (g_peer->flags, PEER_FLAG_PASSIVE)) { - vty_outln (vty, " neighbor %s passive", addr); + vty_out (vty, " neighbor %s passive\n", addr); } } @@ -6780,7 +6780,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp, { if (! peer_group_active (peer) || g_peer->ttl != peer->ttl) { - vty_outln (vty, " neighbor %s ebgp-multihop %d", addr,peer->ttl); + vty_out (vty, " neighbor %s ebgp-multihop %d\n", addr,peer->ttl); } } @@ -6789,7 +6789,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp, { if (! peer_group_active (peer) || g_peer->gtsm_hops != peer->gtsm_hops) { - vty_outln (vty, " neighbor %s ttl-security hops %d", addr, + vty_out (vty, " neighbor %s ttl-security hops %d\n", addr, peer->gtsm_hops); } } @@ -6800,7 +6800,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp, if (! peer_group_active (peer) || ! CHECK_FLAG (g_peer->flags, PEER_FLAG_DISABLE_CONNECTED_CHECK)) { - vty_outln (vty, " neighbor %s disable-connected-check", addr); + vty_out (vty, " neighbor %s disable-connected-check\n", addr); } } @@ -6810,7 +6810,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp, if (! peer_group_active (peer) || ! g_peer->update_if || strcmp (g_peer->update_if, peer->update_if) != 0) { - vty_outln (vty, " neighbor %s update-source %s", addr, + vty_out (vty, " neighbor %s update-source %s\n", addr, peer->update_if); } } @@ -6820,7 +6820,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp, || sockunion_cmp (g_peer->update_source, peer->update_source) != 0) { - vty_outln (vty, " neighbor %s update-source %s", addr, + vty_out (vty, " neighbor %s update-source %s\n", addr, sockunion2str(peer->update_source, buf, SU_ADDRSTRLEN)); } } @@ -6830,7 +6830,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp, ((! peer_group_active (peer) && peer->v_routeadv != BGP_DEFAULT_EBGP_ROUTEADV) || (peer_group_active (peer) && peer->v_routeadv != g_peer->v_routeadv))) { - vty_outln (vty, " neighbor %s advertisement-interval %u", + vty_out (vty, " neighbor %s advertisement-interval %u\n", addr, peer->v_routeadv); } @@ -6839,7 +6839,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp, ((! peer_group_active (peer) && (peer->keepalive != BGP_DEFAULT_KEEPALIVE || peer->holdtime != BGP_DEFAULT_HOLDTIME)) || (peer_group_active (peer) && (peer->keepalive != g_peer->keepalive || peer->holdtime != g_peer->holdtime)))) { - vty_outln (vty, " neighbor %s timers %u %u", addr, + vty_out (vty, " neighbor %s timers %u %u\n", addr, peer->keepalive, peer->holdtime); } @@ -6848,7 +6848,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp, (peer_group_active (peer) && peer->connect != g_peer->connect))) { - vty_outln (vty, " neighbor %s timers connect %u", addr, + vty_out (vty, " neighbor %s timers connect %u\n", addr, peer->connect); } @@ -6858,7 +6858,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp, if (! peer_group_active (peer) || ! CHECK_FLAG (g_peer->flags, PEER_FLAG_DYNAMIC_CAPABILITY)) { - vty_outln (vty, " neighbor %s capability dynamic",addr); + vty_out (vty, " neighbor %s capability dynamic\n",addr); } } @@ -6868,7 +6868,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp, if (! peer_group_active (peer) || ! CHECK_FLAG (g_peer->flags, PEER_FLAG_CAPABILITY_ENHE)) { - vty_outln (vty, " no neighbor %s capability extended-nexthop", + vty_out (vty, " no neighbor %s capability extended-nexthop\n", addr); } } @@ -6878,7 +6878,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp, if (! peer_group_active (peer) || ! CHECK_FLAG (g_peer->flags, PEER_FLAG_CAPABILITY_ENHE)) { - vty_outln (vty, " neighbor %s capability extended-nexthop",addr); + vty_out (vty, " neighbor %s capability extended-nexthop\n",addr); } } @@ -6888,7 +6888,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp, if (! peer_group_active (peer) || ! CHECK_FLAG (g_peer->flags, PEER_FLAG_DONT_CAPABILITY)) { - vty_outln (vty, " neighbor %s dont-capability-negotiate",addr); + vty_out (vty, " neighbor %s dont-capability-negotiate\n",addr); } } @@ -6898,7 +6898,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp, if (! peer_group_active (peer) || ! CHECK_FLAG (g_peer->flags, PEER_FLAG_OVERRIDE_CAPABILITY)) { - vty_outln (vty, " neighbor %s override-capability",addr); + vty_out (vty, " neighbor %s override-capability\n",addr); } } @@ -6908,7 +6908,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp, if (! peer_group_active (peer) || ! CHECK_FLAG (g_peer->flags, PEER_FLAG_STRICT_CAP_MATCH)) { - vty_outln (vty, " neighbor %s strict-capability-match",addr); + vty_out (vty, " neighbor %s strict-capability-match\n",addr); } } } @@ -6942,16 +6942,16 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp, if (g_peer->afc[afi][safi] && !peer->afc[afi][safi]) { afi_header_vty_out (vty, afi, safi, write, - " no neighbor %s activate%s", - addr, VTYNL); + " no neighbor %s activate\n", + addr); } /* If the peer-group is not active but peer is, print an 'activate' */ else if (!g_peer->afc[afi][safi] && peer->afc[afi][safi]) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s activate%s", - addr, VTYNL); + " neighbor %s activate\n", + addr); } } else @@ -6963,14 +6963,14 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp, if (bgp_flag_check (bgp, BGP_FLAG_NO_DEFAULT_IPV4)) { afi_header_vty_out(vty, afi, safi, write, - " neighbor %s activate%s", - addr, VTYNL); + " neighbor %s activate\n", + addr); } } else afi_header_vty_out (vty, afi, safi, write, - " neighbor %s activate%s", - addr, VTYNL); + " neighbor %s activate\n", + addr); } else { @@ -6979,8 +6979,8 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp, if (!bgp_flag_check (bgp, BGP_FLAG_NO_DEFAULT_IPV4)) { afi_header_vty_out (vty, afi, safi, write, - " no neighbor %s activate%s", - addr, VTYNL); + " no neighbor %s activate\n", + addr); } } } @@ -6990,15 +6990,15 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp, if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_ADDPATH_TX_ALL_PATHS)) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s addpath-tx-all-paths%s", - addr, VTYNL); + " neighbor %s addpath-tx-all-paths\n", + addr); } if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_ADDPATH_TX_BESTPATH_PER_AS)) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s addpath-tx-bestpath-per-AS%s", - addr, VTYNL); + " neighbor %s addpath-tx-bestpath-per-AS\n", + addr); } /* ORF capability. */ @@ -7016,68 +7016,68 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp, vty_out (vty, " send"); else vty_out (vty, " receive"); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } /* Route reflector client. */ if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_REFLECTOR_CLIENT)) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s route-reflector-client%s", - addr, VTYNL); + " neighbor %s route-reflector-client\n", + addr); } /* next-hop-self force */ if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_FORCE_NEXTHOP_SELF)) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s next-hop-self force%s", - addr, VTYNL); + " neighbor %s next-hop-self force\n", + addr); } /* next-hop-self */ if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_NEXTHOP_SELF)) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s next-hop-self%s", - addr, VTYNL); + " neighbor %s next-hop-self\n", + addr); } /* remove-private-AS */ if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_REMOVE_PRIVATE_AS_ALL_REPLACE)) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s remove-private-AS all replace-AS%s", - addr, VTYNL); + " neighbor %s remove-private-AS all replace-AS\n", + addr); } else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE)) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s remove-private-AS replace-AS%s", - addr, VTYNL); + " neighbor %s remove-private-AS replace-AS\n", + addr); } else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_REMOVE_PRIVATE_AS_ALL)) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s remove-private-AS all%s", - addr, VTYNL); + " neighbor %s remove-private-AS all\n", + addr); } else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_REMOVE_PRIVATE_AS)) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s remove-private-AS%s", - addr, VTYNL); + " neighbor %s remove-private-AS\n", + addr); } /* as-override */ if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_AS_OVERRIDE)) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s as-override%s", - addr, VTYNL); + " neighbor %s as-override\n", + addr); } /* send-community print. */ @@ -7088,26 +7088,26 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp, && peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_SEND_LARGE_COMMUNITY)) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s send-community all%s", - addr, VTYNL); + " neighbor %s send-community all\n", + addr); } else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_SEND_LARGE_COMMUNITY)) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s send-community large%s", - addr, VTYNL); + " neighbor %s send-community large\n", + addr); } else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_SEND_EXT_COMMUNITY)) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s send-community extended%s", - addr, VTYNL); + " neighbor %s send-community extended\n", + addr); } else if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_SEND_COMMUNITY)) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s send-community%s", - addr, VTYNL); + " neighbor %s send-community\n", + addr); } } else @@ -7120,8 +7120,8 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp, (!g_peer || peer_af_flag_check (g_peer, afi, safi, PEER_FLAG_SEND_LARGE_COMMUNITY))) { afi_header_vty_out (vty, afi, safi, write, - " no neighbor %s send-community all%s", - addr, VTYNL); + " no neighbor %s send-community all\n", + addr); } else { @@ -7129,24 +7129,24 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp, (!g_peer || peer_af_flag_check (g_peer, afi, safi, PEER_FLAG_SEND_LARGE_COMMUNITY))) { afi_header_vty_out (vty, afi, safi, write, - " no neighbor %s send-community large%s", - addr, VTYNL); + " no neighbor %s send-community large\n", + addr); } if (!peer_af_flag_check (peer, afi, safi, PEER_FLAG_SEND_EXT_COMMUNITY) && (!g_peer || peer_af_flag_check (g_peer, afi, safi, PEER_FLAG_SEND_EXT_COMMUNITY))) { afi_header_vty_out (vty, afi, safi, write, - " no neighbor %s send-community extended%s", - addr, VTYNL); + " no neighbor %s send-community extended\n", + addr); } if (!peer_af_flag_check (peer, afi, safi, PEER_FLAG_SEND_COMMUNITY) && (!g_peer || peer_af_flag_check (g_peer, afi, safi, PEER_FLAG_SEND_COMMUNITY))) { afi_header_vty_out (vty, afi, safi, write, - " no neighbor %s send-community%s", - addr, VTYNL); + " no neighbor %s send-community\n", + addr); } } } @@ -7163,15 +7163,15 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp, " neighbor %s default-originate", addr); if (peer->default_rmap[afi][safi].name) vty_out (vty, " route-map %s", peer->default_rmap[afi][safi].name); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } /* Soft reconfiguration inbound. */ if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_SOFT_RECONFIG)) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s soft-reconfiguration inbound%s", - addr, VTYNL); + " neighbor %s soft-reconfiguration inbound\n", + addr); } /* maximum-prefix. */ @@ -7191,23 +7191,23 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp, vty_out (vty, " warning-only"); if (peer->pmax_restart[afi][safi]) vty_out (vty, " restart %u", peer->pmax_restart[afi][safi]); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } /* Route server client. */ if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_RSERVER_CLIENT)) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s route-server-client%s", - addr, VTYNL); + " neighbor %s route-server-client\n", + addr); } /* Nexthop-local unchanged. */ if (peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED)) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s nexthop-local unchanged%s", - addr, VTYNL); + " neighbor %s nexthop-local unchanged\n", + addr); } /* allowas-in <1-10> */ @@ -7220,14 +7220,14 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp, if (peer->allowas_in[afi][safi] == 3) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s allowas-in%s", - addr, VTYNL); + " neighbor %s allowas-in\n", + addr); } else { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s allowas-in %d%s", - addr, peer->allowas_in[afi][safi], VTYNL); + " neighbor %s allowas-in %d\n", + addr, peer->allowas_in[afi][safi]); } } } @@ -7239,8 +7239,8 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp, || ! peer_af_flag_check (g_peer, afi, safi, PEER_FLAG_ALLOWAS_IN_ORIGIN)) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s allowas-in origin%s", - addr, VTYNL); + " neighbor %s allowas-in origin\n", + addr); } } @@ -7253,8 +7253,8 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp, if (peer->weight[afi][safi]) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s weight %lu%s", - addr, peer->weight[afi][safi], VTYNL); + " neighbor %s weight %lu\n", + addr, peer->weight[afi][safi]); } } @@ -7271,19 +7271,19 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp, && peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_MED_UNCHANGED)) { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s attribute-unchanged%s", - addr, VTYNL); + " neighbor %s attribute-unchanged\n", + addr); } else { afi_header_vty_out (vty, afi, safi, write, - " neighbor %s attribute-unchanged%s%s%s%s", addr, + " neighbor %s attribute-unchanged%s%s%s\n", addr, peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_AS_PATH_UNCHANGED) ? " as-path" : "", peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_NEXTHOP_UNCHANGED) ? " next-hop" : "", peergroup_af_flag_check (peer, afi, safi, PEER_FLAG_MED_UNCHANGED) ? - " med" : "", VTYNL); + " med" : ""); } } } @@ -7296,7 +7296,7 @@ bgp_config_write_family_header (struct vty *vty, afi_t afi, safi_t safi, if (*write) return; - vty_out (vty, " !%s address-family ", VTYNL); + vty_out (vty, " !\n address-family "); if (afi == AFI_IP) { @@ -7329,7 +7329,7 @@ bgp_config_write_family_header (struct vty *vty, afi_t afi, safi_t safi, if (safi == SAFI_EVPN) vty_out (vty, "l2vpn evpn"); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); *write = 1; } @@ -7368,7 +7368,7 @@ bgp_config_write_family (struct vty *vty, struct bgp *bgp, afi_t afi, bgp_config_write_table_map (vty, bgp, afi, safi, &write); if (write) - vty_outln (vty, " exit-address-family"); + vty_out (vty, " exit-address-family\n"); return write; } @@ -7386,25 +7386,25 @@ bgp_config_write (struct vty *vty) /* BGP Multiple instance. */ if (!bgp_option_check (BGP_OPT_MULTIPLE_INSTANCE)) { - vty_outln (vty, "no bgp multiple-instance"); + vty_out (vty, "no bgp multiple-instance\n"); write++; } /* BGP Config type. */ if (bgp_option_check (BGP_OPT_CONFIG_CISCO)) { - vty_outln (vty, "bgp config-type cisco"); + vty_out (vty, "bgp config-type cisco\n"); write++; } if (bm->rmap_update_timer != RMAP_DEFAULT_UPDATE_TIMER) - vty_outln (vty, "bgp route-map delay-timer %u",bm->rmap_update_timer); + vty_out (vty, "bgp route-map delay-timer %u\n",bm->rmap_update_timer); /* BGP configuration. */ for (ALL_LIST_ELEMENTS (bm->bgp, mnode, mnnode, bgp)) { if (write) - vty_outln (vty, "!"); + vty_out (vty, "!\n"); /* Router bgp ASN */ vty_out (vty, "router bgp %u", bgp->as); @@ -7416,66 +7416,66 @@ bgp_config_write (struct vty *vty) (bgp->inst_type == BGP_INSTANCE_TYPE_VIEW) ? "view" : "vrf", bgp->name); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); /* No Synchronization */ if (bgp_option_check (BGP_OPT_CONFIG_CISCO)) - vty_outln (vty, " no synchronization"); + vty_out (vty, " no synchronization\n"); /* BGP fast-external-failover. */ if (CHECK_FLAG (bgp->flags, BGP_FLAG_NO_FAST_EXT_FAILOVER)) - vty_outln (vty, " no bgp fast-external-failover"); + vty_out (vty, " no bgp fast-external-failover\n"); /* BGP router ID. */ if (bgp->router_id_static.s_addr != 0) - vty_outln (vty, " bgp router-id %s", + vty_out (vty, " bgp router-id %s\n", inet_ntoa(bgp->router_id_static)); /* BGP log-neighbor-changes. */ if (!!bgp_flag_check (bgp, BGP_FLAG_LOG_NEIGHBOR_CHANGES) != DFLT_BGP_LOG_NEIGHBOR_CHANGES) - vty_outln (vty, " %sbgp log-neighbor-changes", + vty_out (vty, " %sbgp log-neighbor-changes\n", bgp_flag_check(bgp, BGP_FLAG_LOG_NEIGHBOR_CHANGES) ? "" : "no "); /* BGP configuration. */ if (bgp_flag_check (bgp, BGP_FLAG_ALWAYS_COMPARE_MED)) - vty_outln (vty, " bgp always-compare-med"); + vty_out (vty, " bgp always-compare-med\n"); /* BGP default ipv4-unicast. */ if (bgp_flag_check (bgp, BGP_FLAG_NO_DEFAULT_IPV4)) - vty_outln (vty, " no bgp default ipv4-unicast"); + vty_out (vty, " no bgp default ipv4-unicast\n"); /* BGP default local-preference. */ if (bgp->default_local_pref != BGP_DEFAULT_LOCAL_PREF) - vty_outln (vty, " bgp default local-preference %u", + vty_out (vty, " bgp default local-preference %u\n", bgp->default_local_pref); /* BGP default show-hostname */ if (!!bgp_flag_check(bgp, BGP_FLAG_SHOW_HOSTNAME) != DFLT_BGP_SHOW_HOSTNAME) - vty_outln (vty, " %sbgp default show-hostname", + vty_out (vty, " %sbgp default show-hostname\n", bgp_flag_check(bgp, BGP_FLAG_SHOW_HOSTNAME) ? "" : "no "); /* BGP default subgroup-pkt-queue-max. */ if (bgp->default_subgroup_pkt_queue_max != BGP_DEFAULT_SUBGROUP_PKT_QUEUE_MAX) - vty_outln (vty, " bgp default subgroup-pkt-queue-max %u", + vty_out (vty, " bgp default subgroup-pkt-queue-max %u\n", bgp->default_subgroup_pkt_queue_max); /* BGP client-to-client reflection. */ if (bgp_flag_check (bgp, BGP_FLAG_NO_CLIENT_TO_CLIENT)) - vty_outln (vty, " no bgp client-to-client reflection"); + vty_out (vty, " no bgp client-to-client reflection\n"); /* BGP cluster ID. */ if (CHECK_FLAG (bgp->config, BGP_CONFIG_CLUSTER_ID)) - vty_outln (vty, " bgp cluster-id %s",inet_ntoa(bgp->cluster_id)); + vty_out (vty, " bgp cluster-id %s\n",inet_ntoa(bgp->cluster_id)); /* Disable ebgp connected nexthop check */ if (bgp_flag_check (bgp, BGP_FLAG_DISABLE_NH_CONNECTED_CHK)) - vty_outln (vty, " bgp disable-ebgp-connected-route-check"); + vty_out (vty, " bgp disable-ebgp-connected-route-check\n"); /* Confederation identifier*/ if (CHECK_FLAG (bgp->config, BGP_CONFIG_CONFEDERATION)) - vty_outln (vty, " bgp confederation identifier %i",bgp->confed_id); + vty_out (vty, " bgp confederation identifier %i\n",bgp->confed_id); /* Confederation peer */ if (bgp->confed_peers_cnt > 0) @@ -7487,17 +7487,17 @@ bgp_config_write (struct vty *vty) for (i = 0; i < bgp->confed_peers_cnt; i++) vty_out(vty, " %u", bgp->confed_peers[i]); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } /* BGP enforce-first-as. */ if (bgp_flag_check (bgp, BGP_FLAG_ENFORCE_FIRST_AS)) - vty_outln (vty, " bgp enforce-first-as"); + vty_out (vty, " bgp enforce-first-as\n"); /* BGP deterministic-med. */ if (!!bgp_flag_check (bgp, BGP_FLAG_DETERMINISTIC_MED) != DFLT_BGP_DETERMINISTIC_MED) - vty_outln (vty, " %sbgp deterministic-med", + vty_out (vty, " %sbgp deterministic-med\n", bgp_flag_check(bgp, BGP_FLAG_DETERMINISTIC_MED) ? "" : "no "); /* BGP update-delay. */ @@ -7508,14 +7508,14 @@ bgp_config_write (struct vty *vty) vty_out (vty, " bgp max-med on-startup %u", bgp->v_maxmed_onstartup); if (bgp->maxmed_onstartup_value != BGP_MAXMED_VALUE_DEFAULT) vty_out (vty, " %u", bgp->maxmed_onstartup_value); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } if (bgp->v_maxmed_admin != BGP_MAXMED_ADMIN_UNCONFIGURED) { vty_out (vty, " bgp max-med administrative"); if (bgp->maxmed_admin_value != BGP_MAXMED_VALUE_DEFAULT) vty_out (vty, " %u", bgp->maxmed_admin_value); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } /* write quanta */ @@ -7526,42 +7526,42 @@ bgp_config_write (struct vty *vty) /* BGP graceful-restart. */ if (bgp->stalepath_time != BGP_DEFAULT_STALEPATH_TIME) - vty_outln (vty, " bgp graceful-restart stalepath-time %u", + vty_out (vty, " bgp graceful-restart stalepath-time %u\n", bgp->stalepath_time); if (bgp->restart_time != BGP_DEFAULT_RESTART_TIME) - vty_outln (vty, " bgp graceful-restart restart-time %u", + vty_out (vty, " bgp graceful-restart restart-time %u\n", bgp->restart_time); if (bgp_flag_check (bgp, BGP_FLAG_GRACEFUL_RESTART)) - vty_outln (vty, " bgp graceful-restart"); + vty_out (vty, " bgp graceful-restart\n"); /* BGP graceful-restart Preserve State F bit. */ if (bgp_flag_check (bgp, BGP_FLAG_GR_PRESERVE_FWD)) - vty_outln (vty, " bgp graceful-restart preserve-fw-state"); + vty_out (vty, " bgp graceful-restart preserve-fw-state\n"); /* BGP bestpath method. */ if (bgp_flag_check (bgp, BGP_FLAG_ASPATH_IGNORE)) - vty_outln (vty, " bgp bestpath as-path ignore"); + vty_out (vty, " bgp bestpath as-path ignore\n"); if (bgp_flag_check (bgp, BGP_FLAG_ASPATH_CONFED)) - vty_outln (vty, " bgp bestpath as-path confed"); + vty_out (vty, " bgp bestpath as-path confed\n"); if (bgp_flag_check (bgp, BGP_FLAG_ASPATH_MULTIPATH_RELAX)) { if (bgp_flag_check (bgp, BGP_FLAG_MULTIPATH_RELAX_AS_SET)) { - vty_outln (vty, - " bgp bestpath as-path multipath-relax as-set"); + vty_out (vty, + " bgp bestpath as-path multipath-relax as-set\n"); } else { - vty_outln (vty, " bgp bestpath as-path multipath-relax"); + vty_out (vty, " bgp bestpath as-path multipath-relax\n"); } } if (bgp_flag_check (bgp, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY)) { - vty_outln (vty," bgp route-reflector allow-outbound-policy"); + vty_out (vty," bgp route-reflector allow-outbound-policy\n"); } if (bgp_flag_check (bgp, BGP_FLAG_COMPARE_ROUTER_ID)) - vty_outln (vty, " bgp bestpath compare-routerid"); + vty_out (vty, " bgp bestpath compare-routerid\n"); if (bgp_flag_check (bgp, BGP_FLAG_MED_CONFED) || bgp_flag_check (bgp, BGP_FLAG_MED_MISSING_AS_WORST)) { @@ -7570,13 +7570,13 @@ bgp_config_write (struct vty *vty) vty_out (vty, " confed"); if (bgp_flag_check (bgp, BGP_FLAG_MED_MISSING_AS_WORST)) vty_out (vty, " missing-as-worst"); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } /* BGP network import check. */ if (!!bgp_flag_check (bgp, BGP_FLAG_IMPORT_CHECK) != DFLT_BGP_IMPORT_CHECK) - vty_outln (vty, " %sbgp network import-check", + vty_out (vty, " %sbgp network import-check\n", bgp_flag_check(bgp, BGP_FLAG_IMPORT_CHECK) ? "" : "no "); /* BGP flag dampening. */ @@ -7587,7 +7587,7 @@ bgp_config_write (struct vty *vty) /* BGP timers configuration. */ if (bgp->default_keepalive != BGP_DEFAULT_KEEPALIVE && bgp->default_holdtime != BGP_DEFAULT_HOLDTIME) - vty_outln (vty, " timers bgp %u %u", bgp->default_keepalive, + vty_out (vty, " timers bgp %u %u\n", bgp->default_keepalive, bgp->default_holdtime); /* peer-group */ @@ -7608,7 +7608,7 @@ bgp_config_write (struct vty *vty) /* No auto-summary */ if (bgp_option_check (BGP_OPT_CONFIG_CISCO)) - vty_outln (vty, " no auto-summary"); + vty_out (vty, " no auto-summary\n"); /* IPv4 unicast configuration. */ write += bgp_config_write_family (vty, bgp, AFI_IP, SAFI_UNICAST); diff --git a/bgpd/rfapi/bgp_rfapi_cfg.c b/bgpd/rfapi/bgp_rfapi_cfg.c index 4a2cea480..d04b186df 100644 --- a/bgpd/rfapi/bgp_rfapi_cfg.c +++ b/bgpd/rfapi/bgp_rfapi_cfg.c @@ -299,7 +299,7 @@ DEFUN (vnc_advertise_un_method, if (!bgp->rfapi_cfg) { - vty_outln (vty, "VNC not configured"); + vty_out (vty, "VNC not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -345,7 +345,7 @@ set_ecom_list ( ecomadd = ecommunity_str2com (argv[0]->arg, ECOMMUNITY_ROUTE_TARGET, 0); if (!ecomadd) { - vty_outln (vty, "Malformed community-list value"); + vty_out (vty, "Malformed community-list value\n"); if (ecom) ecommunity_free (&ecom); return CMD_WARNING_CONFIG_FAILED; @@ -435,12 +435,12 @@ DEFUN (vnc_defaults_rd, if (!argv[1]->arg[8] || *end) { - vty_outln (vty, "%% Malformed rd"); + vty_out (vty, "%% Malformed rd\n"); return CMD_WARNING_CONFIG_FAILED; } if (value32 > 0xffff) { - vty_outln (vty, "%% Malformed rd (must be less than %u", + vty_out (vty, "%% Malformed rd (must be less than %u\n", 0x0ffff); return CMD_WARNING_CONFIG_FAILED; } @@ -460,7 +460,7 @@ DEFUN (vnc_defaults_rd, ret = str2prefix_rd (argv[1]->arg, &prd); if (!ret) { - vty_outln (vty, "%% Malformed rd"); + vty_out (vty, "%% Malformed rd\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -491,13 +491,13 @@ DEFUN (vnc_defaults_l2rd, value = value_l & 0xff; if (!argv[1]->arg[0] || *end) { - vty_outln (vty, "%% Malformed l2 nve ID \"%s\"",argv[1]->arg); + vty_out (vty, "%% Malformed l2 nve ID \"%s\"\n",argv[1]->arg); return CMD_WARNING_CONFIG_FAILED; } if ((value_l < 1) || (value_l > 0xff)) { - vty_outln (vty, - "%% Malformed l2 nve id (must be greater than 0 and less than %u", + vty_out (vty, + "%% Malformed l2 nve id (must be greater than 0 and less than %u\n", 0x100); return CMD_WARNING_CONFIG_FAILED; } @@ -800,20 +800,20 @@ DEFUN (vnc_redistribute_rh_roo_localadmin, if (!bgp->rfapi_cfg) { - vty_outln (vty, "RFAPI not configured"); + vty_out (vty, "RFAPI not configured\n"); return CMD_WARNING_CONFIG_FAILED; } localadmin = strtoul (argv[4]->arg, &endptr, 0); if (!argv[4]->arg[0] || *endptr) { - vty_outln (vty, "%% Malformed value"); + vty_out (vty, "%% Malformed value\n"); return CMD_WARNING_CONFIG_FAILED; } if (localadmin > 0xffff) { - vty_outln (vty, "%% Value out of range (0-%d)", 0xffff); + vty_out (vty, "%% Value out of range (0-%d)\n", 0xffff); return CMD_WARNING_CONFIG_FAILED; } @@ -856,7 +856,7 @@ DEFUN (vnc_redistribute_mode, if (!bgp->rfapi_cfg) { - vty_outln (vty, "RFAPI not configured"); + vty_out (vty, "RFAPI not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -876,7 +876,7 @@ DEFUN (vnc_redistribute_mode, break; default: - vty_outln (vty, "unknown redistribute mode"); + vty_out (vty, "unknown redistribute mode\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -911,13 +911,13 @@ DEFUN (vnc_redistribute_protocol, if (!bgp->rfapi_cfg) { - vty_outln (vty, "RFAPI not configured"); + vty_out (vty, "RFAPI not configured\n"); return CMD_WARNING_CONFIG_FAILED; } if (rfapi_str2route_type (argv[2]->arg, argv[3]->arg, &afi, &type)) { - vty_outln (vty, "%% Invalid route type"); + vty_out (vty, "%% Invalid route type\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -959,13 +959,13 @@ DEFUN (vnc_no_redistribute_protocol, if (!bgp->rfapi_cfg) { - vty_outln (vty, "RFAPI not configured"); + vty_out (vty, "RFAPI not configured\n"); return CMD_WARNING_CONFIG_FAILED; } if (rfapi_str2route_type (argv[3]->arg, argv[4]->arg, &afi, &type)) { - vty_outln (vty, "%% Invalid route type"); + vty_out (vty, "%% Invalid route type\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1000,13 +1000,13 @@ DEFUN (vnc_redistribute_bgp_exterior, if (!bgp->rfapi_cfg) { - vty_outln (vty, "RFAPI not configured"); + vty_out (vty, "RFAPI not configured\n"); return CMD_WARNING_CONFIG_FAILED; } if (rfapi_str2route_type (argv[2]->arg, "bgp-direct-to-nve-groups", &afi, &type)) { - vty_outln (vty, "%% Invalid route type"); + vty_out (vty, "%% Invalid route type\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1032,7 +1032,7 @@ DEFUN (vnc_redistribute_nvegroup, if (!bgp->rfapi_cfg) { - vty_outln (vty, "rfapi not configured"); + vty_out (vty, "rfapi not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1065,7 +1065,7 @@ DEFUN (vnc_redistribute_no_nvegroup, if (!bgp->rfapi_cfg) { - vty_outln (vty, "rfapi not configured"); + vty_out (vty, "rfapi not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1095,7 +1095,7 @@ DEFUN (vnc_redistribute_lifetime, if (!bgp->rfapi_cfg) { - vty_outln (vty, "rfapi not configured"); + vty_out (vty, "rfapi not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1135,7 +1135,7 @@ DEFUN (vnc_redist_bgpdirect_no_prefixlist, if (!(hc = bgp->rfapi_cfg)) { - vty_outln (vty, "rfapi not configured"); + vty_out (vty, "rfapi not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1188,7 +1188,7 @@ DEFUN (vnc_redist_bgpdirect_prefixlist, if (!(hc = bgp->rfapi_cfg)) { - vty_outln (vty, "rfapi not configured"); + vty_out (vty, "rfapi not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1238,7 +1238,7 @@ DEFUN (vnc_redist_bgpdirect_no_routemap, if (!(hc = bgp->rfapi_cfg)) { - vty_outln (vty, "rfapi not configured"); + vty_out (vty, "rfapi not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1278,7 +1278,7 @@ DEFUN (vnc_redist_bgpdirect_routemap, if (!(hc = bgp->rfapi_cfg)) { - vty_outln (vty, "rfapi not configured"); + vty_out (vty, "rfapi not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1323,7 +1323,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_no_prefixlist, if (!bgp->rfapi_cfg) { - vty_outln (vty, "rfapi not configured"); + vty_out (vty, "rfapi not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1331,7 +1331,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_no_prefixlist, if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current NVE group no longer exists"); + vty_out (vty, "Current NVE group no longer exists\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1372,7 +1372,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_prefixlist, if (!bgp->rfapi_cfg) { - vty_outln (vty, "rfapi not configured"); + vty_out (vty, "rfapi not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1380,7 +1380,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_prefixlist, if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current NVE group no longer exists"); + vty_out (vty, "Current NVE group no longer exists\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1419,7 +1419,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_no_routemap, if (!bgp->rfapi_cfg) { - vty_outln (vty, "rfapi not configured"); + vty_out (vty, "rfapi not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1427,7 +1427,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_no_routemap, if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current NVE group no longer exists"); + vty_out (vty, "Current NVE group no longer exists\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1455,7 +1455,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_routemap, if (!bgp->rfapi_cfg) { - vty_outln (vty, "rfapi not configured"); + vty_out (vty, "rfapi not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1463,7 +1463,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_routemap, if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current NVE group no longer exists"); + vty_out (vty, "Current NVE group no longer exists\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1504,7 +1504,7 @@ DEFUN (vnc_export_mode, if (!bgp->rfapi_cfg) { - vty_outln (vty, "VNC not configured"); + vty_out (vty, "VNC not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1526,13 +1526,13 @@ DEFUN (vnc_export_mode, newmode = BGP_VNC_CONFIG_EXPORT_BGP_MODE_RH; break; default: - vty_outln (vty, "Invalid mode specified"); + vty_out (vty, "Invalid mode specified\n"); return CMD_WARNING_CONFIG_FAILED; } if (newmode == oldmode) { - vty_outln (vty, "Mode unchanged"); + vty_out (vty, "Mode unchanged\n"); return CMD_SUCCESS; } @@ -1550,7 +1550,7 @@ DEFUN (vnc_export_mode, /* * export to zebra with RH mode is not yet implemented */ - vty_outln (vty,"Changing modes for zebra export not implemented yet"); + vty_out (vty,"Changing modes for zebra export not implemented yet\n"); return CMD_WARNING_CONFIG_FAILED; oldmode = bgp->rfapi_cfg->flags & BGP_VNC_CONFIG_EXPORT_ZEBRA_MODE_BITS; @@ -1590,7 +1590,7 @@ DEFUN (vnc_export_mode, } break; default: - vty_outln (vty, "Invalid mode"); + vty_out (vty, "Invalid mode\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -1625,7 +1625,7 @@ DEFUN (vnc_export_nvegroup, if (!bgp->rfapi_cfg) { - vty_outln (vty, "rfapi not configured"); + vty_out (vty, "rfapi not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1727,7 +1727,7 @@ DEFUN (vnc_no_export_nvegroup, if (!bgp->rfapi_cfg) { - vty_outln (vty, "rfapi not configured"); + vty_out (vty, "rfapi not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1788,7 +1788,7 @@ DEFUN (vnc_nve_group_export_no_prefixlist, if (!bgp->rfapi_cfg) { - vty_outln (vty, "rfapi not configured"); + vty_out (vty, "rfapi not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1796,7 +1796,7 @@ DEFUN (vnc_nve_group_export_no_prefixlist, if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current NVE group no longer exists"); + vty_out (vty, "Current NVE group no longer exists\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1857,7 +1857,7 @@ DEFUN (vnc_nve_group_export_prefixlist, if (!bgp->rfapi_cfg) { - vty_outln (vty, "rfapi not configured"); + vty_out (vty, "rfapi not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1865,7 +1865,7 @@ DEFUN (vnc_nve_group_export_prefixlist, if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current NVE group no longer exists"); + vty_out (vty, "Current NVE group no longer exists\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1914,7 +1914,7 @@ DEFUN (vnc_nve_group_export_no_routemap, if (!bgp->rfapi_cfg) { - vty_outln (vty, "rfapi not configured"); + vty_out (vty, "rfapi not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1922,7 +1922,7 @@ DEFUN (vnc_nve_group_export_no_routemap, if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current NVE group no longer exists"); + vty_out (vty, "Current NVE group no longer exists\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1973,7 +1973,7 @@ DEFUN (vnc_nve_group_export_routemap, if (!bgp->rfapi_cfg) { - vty_outln (vty, "rfapi not configured"); + vty_out (vty, "rfapi not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1981,7 +1981,7 @@ DEFUN (vnc_nve_group_export_routemap, if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current NVE group no longer exists"); + vty_out (vty, "Current NVE group no longer exists\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2024,7 +2024,7 @@ DEFUN (vnc_nve_export_no_prefixlist, if (!(hc = bgp->rfapi_cfg)) { - vty_outln (vty, "rfapi not configured"); + vty_out (vty, "rfapi not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2085,7 +2085,7 @@ DEFUN (vnc_nve_export_prefixlist, if (!(hc = bgp->rfapi_cfg)) { - vty_outln (vty, "rfapi not configured"); + vty_out (vty, "rfapi not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2132,7 +2132,7 @@ DEFUN (vnc_nve_export_no_routemap, if (!(hc = bgp->rfapi_cfg)) { - vty_outln (vty, "rfapi not configured"); + vty_out (vty, "rfapi not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2183,7 +2183,7 @@ DEFUN (vnc_nve_export_routemap, if (!(hc = bgp->rfapi_cfg)) { - vty_outln (vty, "rfapi not configured"); + vty_out (vty, "rfapi not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2430,7 +2430,7 @@ DEFUN_NOSH (vnc_nve_group, if (!rfg) { /* Error out of memory */ - vty_out (vty, "Can't allocate memory for NVE group%s", VTYNL); + vty_out (vty, "Can't allocate memory for NVE group\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2606,7 +2606,7 @@ bgp_rfapi_delete_nve_group ( vty_out (vty, " un="); rfapiPrintRfapiIpAddr (vty, &rfd->un_addr); if (vty) - vty_outln (vty, " to new group \"%s\"",rfd->rfg->name); + vty_out (vty, " to new group \"%s\"\n",rfd->rfg->name); } } @@ -2620,7 +2620,7 @@ bgp_rfapi_delete_nve_group ( vty_out (vty, " un="); rfapiPrintRfapiIpAddr (vty, &rfd->un_addr); if (vty) - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } list_delete (orphaned_nves); } @@ -2644,7 +2644,7 @@ bgp_rfapi_delete_named_nve_group ( if (!rfg) { if (vty) - vty_outln (vty, "No NVE group named \"%s\"",rfg_name); + vty_out (vty, "No NVE group named \"%s\"\n",rfg_name); return CMD_WARNING_CONFIG_FAILED; } } @@ -2734,20 +2734,20 @@ DEFUN (vnc_nve_group_prefix, if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current NVE group no longer exists"); + vty_out (vty, "Current NVE group no longer exists\n"); return CMD_WARNING_CONFIG_FAILED; } if (!str2prefix (argv[2]->arg, &p)) { - vty_outln (vty, "Malformed prefix \"%s\"", argv[2]->arg); + vty_out (vty, "Malformed prefix \"%s\"\n", argv[2]->arg); return CMD_WARNING_CONFIG_FAILED; } afi = family2afi (p.family); if (!afi) { - vty_outln (vty, "Unsupported address family"); + vty_out (vty, "Unsupported address family\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2773,7 +2773,7 @@ DEFUN (vnc_nve_group_prefix, /* * different group name: fail */ - vty_outln (vty, "nve group \"%s\" already has \"%s\" prefix %s", + vty_out (vty, "nve group \"%s\" already has \"%s\" prefix %s\n", ((struct rfapi_nve_group_cfg *) (rn->info))->name, argv[1]->arg, argv[2]->arg); return CMD_WARNING_CONFIG_FAILED; @@ -2853,7 +2853,7 @@ DEFUN (vnc_nve_group_rt_import, if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current NVE group no longer exists"); + vty_out (vty, "Current NVE group no longer exists\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2919,7 +2919,7 @@ DEFUN (vnc_nve_group_rt_export, if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current NVE group no longer exists"); + vty_out (vty, "Current NVE group no longer exists\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2957,7 +2957,7 @@ DEFUN (vnc_nve_group_rt_both, if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current NVE group no longer exists"); + vty_out (vty, "Current NVE group no longer exists\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3038,7 +3038,7 @@ DEFUN (vnc_nve_group_l2rd, if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current NVE group no longer exists"); + vty_out (vty, "Current NVE group no longer exists\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3054,13 +3054,13 @@ DEFUN (vnc_nve_group_l2rd, if (!argv[1]->arg[0] || *end) { - vty_outln (vty, "%% Malformed l2 nve ID \"%s\"",argv[1]->arg); + vty_out (vty, "%% Malformed l2 nve ID \"%s\"\n",argv[1]->arg); return CMD_WARNING_CONFIG_FAILED; } if ((value_l < 1) || (value_l > 0xff)) { - vty_outln (vty, - "%% Malformed l2 nve id (must be greater than 0 and less than %u", + vty_out (vty, + "%% Malformed l2 nve id (must be greater than 0 and less than %u\n", 0x100); return CMD_WARNING_CONFIG_FAILED; } @@ -3085,7 +3085,7 @@ DEFUN (vnc_nve_group_no_l2rd, if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current NVE group no longer exists"); + vty_out (vty, "Current NVE group no longer exists\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3110,7 +3110,7 @@ DEFUN (vnc_nve_group_rd, if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current NVE group no longer exists"); + vty_out (vty, "Current NVE group no longer exists\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3126,12 +3126,12 @@ DEFUN (vnc_nve_group_rd, if (!argv[1]->arg[8] || *end) { - vty_outln (vty, "%% Malformed rd"); + vty_out (vty, "%% Malformed rd\n"); return CMD_WARNING_CONFIG_FAILED; } if (value32 > 0xffff) { - vty_outln (vty, "%% Malformed rd (must be less than %u", + vty_out (vty, "%% Malformed rd (must be less than %u\n", 0x0ffff); return CMD_WARNING_CONFIG_FAILED; } @@ -3151,7 +3151,7 @@ DEFUN (vnc_nve_group_rd, ret = str2prefix_rd (argv[1]->arg, &prd); if (!ret) { - vty_outln (vty, "%% Malformed rd"); + vty_out (vty, "%% Malformed rd\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -3186,7 +3186,7 @@ DEFUN (vnc_nve_group_responselifetime, if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current NVE group no longer exists"); + vty_out (vty, "Current NVE group no longer exists\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3255,7 +3255,7 @@ DEFUN_NOSH (vnc_vrf_policy, if (!bgp) { - vty_out (vty, "No BGP process is configured%s", VTYNL); + vty_out (vty, "No BGP process is configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3268,7 +3268,7 @@ DEFUN_NOSH (vnc_vrf_policy, if (!rfg) { /* Error out of memory */ - vty_out (vty, "Can't allocate memory for NVE group%s", VTYNL); + vty_out (vty, "Can't allocate memory for NVE group\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -3292,7 +3292,7 @@ DEFUN (vnc_no_vrf_policy, if (!bgp) { - vty_outln (vty, "No BGP process is configured"); + vty_out (vty, "No BGP process is configured\n"); return CMD_WARNING_CONFIG_FAILED; } return bgp_rfapi_delete_named_nve_group (vty, bgp, argv[2]->arg, RFAPI_GROUP_CFG_VRF); @@ -3311,7 +3311,7 @@ DEFUN (vnc_vrf_policy_label, if (!bgp) { - vty_outln (vty, "No BGP process is configured"); + vty_out (vty, "No BGP process is configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3319,7 +3319,7 @@ DEFUN (vnc_vrf_policy_label, if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current NVE group no longer exists"); + vty_out (vty, "Current NVE group no longer exists\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3352,7 +3352,7 @@ DEFUN (vnc_vrf_policy_no_label, if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current VRF group no longer exists"); + vty_out (vty, "Current VRF group no longer exists\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3387,7 +3387,7 @@ DEFUN (vnc_vrf_policy_nexthop, if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current VRF no longer exists"); + vty_out (vty, "Current VRF no longer exists\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3398,7 +3398,7 @@ DEFUN (vnc_vrf_policy_nexthop, if (!str2prefix (argv[1]->arg, &p) && p.family) { - //vty_out (vty, "Nexthop set to self%s", VTYNL); + //vty_out (vty, "Nexthop set to self\n"); SET_FLAG (rfg->flags, RFAPI_RFG_VPN_NH_SELF); memset(&rfg->vn_prefix, 0, sizeof(struct prefix)); } @@ -3437,7 +3437,7 @@ DEFUN (vnc_vrf_policy_rt_import, if (!bgp) { - vty_outln (vty, "No BGP process is configured"); + vty_out (vty, "No BGP process is configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3445,7 +3445,7 @@ DEFUN (vnc_vrf_policy_rt_import, if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current NVE group no longer exists"); + vty_out (vty, "Current NVE group no longer exists\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3509,7 +3509,7 @@ DEFUN (vnc_vrf_policy_rt_export, if (!bgp) { - vty_outln (vty, "No BGP process is configured"); + vty_out (vty, "No BGP process is configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3517,7 +3517,7 @@ DEFUN (vnc_vrf_policy_rt_export, if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current NVE group no longer exists"); + vty_out (vty, "Current NVE group no longer exists\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3553,7 +3553,7 @@ DEFUN (vnc_vrf_policy_rt_both, if (!bgp) { - vty_outln (vty, "No BGP process is configured"); + vty_out (vty, "No BGP process is configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3561,7 +3561,7 @@ DEFUN (vnc_vrf_policy_rt_both, if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current NVE group no longer exists"); + vty_out (vty, "Current NVE group no longer exists\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3641,7 +3641,7 @@ DEFUN (vnc_vrf_policy_rd, if (!bgp) { - vty_outln (vty, "No BGP process is configured"); + vty_out (vty, "No BGP process is configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3649,7 +3649,7 @@ DEFUN (vnc_vrf_policy_rd, if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current NVE group no longer exists"); + vty_out (vty, "Current NVE group no longer exists\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3665,12 +3665,12 @@ DEFUN (vnc_vrf_policy_rd, if (!*(argv[1]->arg + 5) || *end) { - vty_outln (vty, "%% Malformed rd"); + vty_out (vty, "%% Malformed rd\n"); return CMD_WARNING_CONFIG_FAILED; } if (value32 > 0xffff) { - vty_outln (vty, "%% Malformed rd (must be less than %u", + vty_out (vty, "%% Malformed rd (must be less than %u\n", 0x0ffff); return CMD_WARNING_CONFIG_FAILED; } @@ -3690,7 +3690,7 @@ DEFUN (vnc_vrf_policy_rd, ret = str2prefix_rd (argv[1]->arg, &prd); if (!ret) { - vty_outln (vty, "%% Malformed rd"); + vty_out (vty, "%% Malformed rd\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -3742,7 +3742,7 @@ DEFUN_NOSH (vnc_l2_group, if (!bgp) { - vty_out (vty, "No BGP process is configured%s", VTYNL); + vty_out (vty, "No BGP process is configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3755,7 +3755,7 @@ DEFUN_NOSH (vnc_l2_group, if (!rfg) { /* Error out of memory */ - vty_out (vty, "Can't allocate memory for L2 group%s", VTYNL); + vty_out (vty, "Can't allocate memory for L2 group\n"); return CMD_WARNING_CONFIG_FAILED; } rfg->name = strdup (argv[1]->arg); @@ -3808,7 +3808,7 @@ bgp_rfapi_delete_named_l2_group ( if (!rfg) { if (vty) - vty_outln (vty, "No L2 group named \"%s\"",rfg_name); + vty_out (vty, "No L2 group named \"%s\"\n",rfg_name); return CMD_WARNING_CONFIG_FAILED; } } @@ -3833,7 +3833,7 @@ DEFUN (vnc_no_l2_group, if (!bgp) { - vty_outln (vty, "No BGP process is configured"); + vty_out (vty, "No BGP process is configured\n"); return CMD_WARNING_CONFIG_FAILED; } return bgp_rfapi_delete_named_l2_group (vty, bgp, argv[3]->arg); @@ -3851,7 +3851,7 @@ DEFUN (vnc_l2_group_lni, if (!bgp) { - vty_outln (vty, "No BGP process is configured"); + vty_out (vty, "No BGP process is configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3859,7 +3859,7 @@ DEFUN (vnc_l2_group_lni, if (!listnode_lookup (bgp->rfapi_cfg->l2_groups, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current L2 group no longer exists"); + vty_out (vty, "Current L2 group no longer exists\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3880,7 +3880,7 @@ DEFUN (vnc_l2_group_labels, if (!bgp) { - vty_outln (vty, "No BGP process is configured"); + vty_out (vty, "No BGP process is configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3888,7 +3888,7 @@ DEFUN (vnc_l2_group_labels, if (!listnode_lookup (bgp->rfapi_cfg->l2_groups, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current L2 group no longer exists"); + vty_out (vty, "Current L2 group no longer exists\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3924,7 +3924,7 @@ DEFUN (vnc_l2_group_no_labels, if (!bgp) { - vty_outln (vty, "No BGP process is configured"); + vty_out (vty, "No BGP process is configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3932,14 +3932,14 @@ DEFUN (vnc_l2_group_no_labels, if (!listnode_lookup (bgp->rfapi_cfg->l2_groups, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current L2 group no longer exists"); + vty_out (vty, "Current L2 group no longer exists\n"); return CMD_WARNING_CONFIG_FAILED; } ll = rfg->labels; if (ll == NULL) { - vty_outln (vty, "Label no longer associated with group"); + vty_out (vty, "Label no longer associated with group\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3981,13 +3981,13 @@ DEFUN (vnc_l2_group_rt, do_export = 1; break; default: - vty_outln (vty, "Unknown option, %s", argv[1]->arg); + vty_out (vty, "Unknown option, %s\n", argv[1]->arg); return CMD_ERR_NO_MATCH; } if (!bgp) { - vty_outln (vty, "No BGP process is configured"); + vty_out (vty, "No BGP process is configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3995,7 +3995,7 @@ DEFUN (vnc_l2_group_rt, if (!listnode_lookup (bgp->rfapi_cfg->l2_groups, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current L2 group no longer exists"); + vty_out (vty, "Current L2 group no longer exists\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -4271,20 +4271,20 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) if (bgp->rfapi == NULL || hc == NULL) return write; - vty_outln (vty, "!"); + vty_out (vty, "!\n"); for (ALL_LIST_ELEMENTS (hc->nve_groups_sequential, node, nnode, rfg)) if (rfg->type == RFAPI_GROUP_CFG_VRF) { ++write; - vty_outln (vty, " vrf-policy %s", rfg->name); + vty_out (vty, " vrf-policy %s\n", rfg->name); if (rfg->label <= MPLS_LABEL_MAX) { - vty_outln (vty, " label %u", rfg->label); + vty_out (vty, " label %u\n", rfg->label); } if (CHECK_FLAG (rfg->flags, RFAPI_RFG_VPN_NH_SELF)) { - vty_outln (vty, " nexthop self"); + vty_out (vty, " nexthop self\n"); } else @@ -4296,11 +4296,11 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) inet_ntop(rfg->vn_prefix.family, &rfg->vn_prefix.u.prefix, buf, sizeof(buf)); if (!buf[0] || buf[BUFSIZ - 1]) { - //vty_out (vty, "nexthop self%s", VTYNL); + //vty_out (vty, "nexthop self\n"); } else { - vty_outln (vty, " nexthop %s", buf); + vty_out (vty, " nexthop %s\n", buf); } } } @@ -4318,7 +4318,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) value = ((rfg->rd.val[6] << 8) & 0x0ff00) | (rfg->rd.val[7] & 0x0ff); - vty_outln (vty, " rd auto:nh:%d", value); + vty_out (vty, " rd auto:nh:%d\n", value); } else @@ -4328,11 +4328,11 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) !buf[0] || buf[BUFSIZ - 1]) { - vty_outln (vty, "!Error: Can't convert rd"); + vty_out (vty, "!Error: Can't convert rd\n"); } else { - vty_outln (vty, " rd %s", buf); + vty_out (vty, " rd %s\n", buf); } } } @@ -4342,7 +4342,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) { char *b = ecommunity_ecom2str (rfg->rt_import_list, ECOMMUNITY_FORMAT_ROUTE_MAP, ECOMMUNITY_ROUTE_TARGET); - vty_outln (vty, " rt both %s", b); + vty_out (vty, " rt both %s\n", b); XFREE (MTYPE_ECOMMUNITY_STR, b); } else @@ -4351,14 +4351,14 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) { char *b = ecommunity_ecom2str (rfg->rt_import_list, ECOMMUNITY_FORMAT_ROUTE_MAP, ECOMMUNITY_ROUTE_TARGET); - vty_outln (vty, " rt import %s", b); + vty_out (vty, " rt import %s\n", b); XFREE (MTYPE_ECOMMUNITY_STR, b); } if (rfg->rt_export_list) { char *b = ecommunity_ecom2str (rfg->rt_export_list, ECOMMUNITY_FORMAT_ROUTE_MAP, ECOMMUNITY_ROUTE_TARGET); - vty_outln (vty, " rt export %s", b); + vty_out (vty, " rt export %s\n", b); XFREE (MTYPE_ECOMMUNITY_STR, b); } } @@ -4373,12 +4373,12 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) if (rfg->plist_export_bgp_name[afi]) { - vty_outln (vty, " export bgp %s prefix-list %s", + vty_out (vty, " export bgp %s prefix-list %s\n", afistr,rfg->plist_export_bgp_name[afi]); } if (rfg->plist_export_zebra_name[afi]) { - vty_outln (vty, " export zebra %s prefix-list %s", + vty_out (vty, " export zebra %s prefix-list %s\n", afistr,rfg->plist_export_zebra_name[afi]); } /* @@ -4388,14 +4388,14 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) */ if (rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT][afi]) { - vty_outln (vty, " redistribute bgp-direct %s prefix-list %s", + vty_out (vty, " redistribute bgp-direct %s prefix-list %s\n", afistr, rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT][afi]); } if (rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT][afi]) { - vty_outln (vty, - " redistribute bgp-direct-to-nve-groups %s prefix-list %s", + vty_out (vty, + " redistribute bgp-direct-to-nve-groups %s prefix-list %s\n", afistr, rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT][afi]); } @@ -4403,31 +4403,31 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) if (rfg->routemap_export_bgp_name) { - vty_outln (vty, " export bgp route-map %s", + vty_out (vty, " export bgp route-map %s\n", rfg->routemap_export_bgp_name); } if (rfg->routemap_export_zebra_name) { - vty_outln (vty, " export zebra route-map %s", + vty_out (vty, " export zebra route-map %s\n", rfg->routemap_export_zebra_name); } if (rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT]) { - vty_outln (vty, " redistribute bgp-direct route-map %s", + vty_out (vty, " redistribute bgp-direct route-map %s\n", rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT]); } if (rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT]) { - vty_outln (vty, - " redistribute bgp-direct-to-nve-groups route-map %s", + vty_out (vty, + " redistribute bgp-direct-to-nve-groups route-map %s\n", rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT]); } - vty_outln (vty, " exit-vrf-policy"); - vty_outln (vty, "!"); + vty_out (vty, " exit-vrf-policy\n"); + vty_out (vty, "!\n"); } if (hc->flags & BGP_VNC_CONFIG_ADV_UN_METHOD_ENCAP) { - vty_outln (vty, " vnc advertise-un-method encap-safi"); + vty_out (vty, " vnc advertise-un-method encap-safi\n"); write++; } @@ -4437,7 +4437,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) write += (bgp->rfapi->rfp_methods.cfg_cb) (vty, bgp->rfapi->rfp); if (write) - vty_outln (vty, "!"); + vty_out (vty, "!\n"); if (hc->l2_groups) { @@ -4448,9 +4448,9 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) struct listnode *lnode; void *data; ++write; - vty_outln (vty, " vnc l2-group %s", rfg->name); + vty_out (vty, " vnc l2-group %s\n", rfg->name); if (rfg->logical_net_id != 0) - vty_outln (vty, " logical-network-id %u", + vty_out (vty, " logical-network-id %u\n", rfg->logical_net_id); if (rfg->labels != NULL && listhead (rfg->labels) != NULL) { @@ -4459,7 +4459,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) { vty_out (vty, "%hu ", (uint16_t) ((uintptr_t) data)); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } if (rfg->rt_import_list && rfg->rt_export_list && @@ -4467,7 +4467,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) { char *b = ecommunity_ecom2str (rfg->rt_import_list, ECOMMUNITY_FORMAT_ROUTE_MAP, ECOMMUNITY_ROUTE_TARGET); - vty_outln (vty, " rt both %s", b); + vty_out (vty, " rt both %s\n", b); XFREE (MTYPE_ECOMMUNITY_STR, b); } else @@ -4476,14 +4476,14 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) { char *b = ecommunity_ecom2str (rfg->rt_import_list, ECOMMUNITY_FORMAT_ROUTE_MAP, ECOMMUNITY_ROUTE_TARGET); - vty_outln (vty, " rt import %s", b); + vty_out (vty, " rt import %s\n", b); XFREE (MTYPE_ECOMMUNITY_STR, b); } if (rfg->rt_export_list) { char *b = ecommunity_ecom2str (rfg->rt_export_list, ECOMMUNITY_FORMAT_ROUTE_MAP, ECOMMUNITY_ROUTE_TARGET); - vty_outln (vty, " rt export %s", b); + vty_out (vty, " rt export %s\n", b); XFREE (MTYPE_ECOMMUNITY_STR, b); } } @@ -4494,8 +4494,8 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) RFAPI_RFP_CFG_GROUP_L2, rfg->name, rfg->rfp_cfg); - vty_outln (vty, " exit-vnc"); - vty_outln (vty, "!"); + vty_out (vty, " exit-vnc\n"); + vty_out (vty, "!\n"); } } @@ -4507,7 +4507,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) ++write; - vty_outln (vty, " vnc defaults"); + vty_out (vty, " vnc defaults\n"); if (hc->default_rd.prefixlen) { @@ -4521,7 +4521,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) value = ((hc->default_rd.val[6] << 8) & 0x0ff00) | (hc->default_rd.val[7] & 0x0ff); - vty_outln (vty, " rd auto:vn:%d", value); + vty_out (vty, " rd auto:vn:%d\n", value); } else @@ -4531,11 +4531,11 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) !buf[0] || buf[BUFSIZ - 1]) { - vty_outln (vty, "!Error: Can't convert rd"); + vty_out (vty, "!Error: Can't convert rd\n"); } else { - vty_outln (vty, " rd %s", buf); + vty_out (vty, " rd %s\n", buf); } } } @@ -4546,7 +4546,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) vty_out (vty, "%d", hc->default_response_lifetime); else vty_out (vty, "infinite"); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } if (hc->default_rt_import_list && hc->default_rt_export_list && ecommunity_cmp (hc->default_rt_import_list, @@ -4554,7 +4554,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) { char *b = ecommunity_ecom2str (hc->default_rt_import_list, ECOMMUNITY_FORMAT_ROUTE_MAP, ECOMMUNITY_ROUTE_TARGET); - vty_outln (vty, " rt both %s", b); + vty_out (vty, " rt both %s\n", b); XFREE (MTYPE_ECOMMUNITY_STR, b); } else @@ -4563,14 +4563,14 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) { char *b = ecommunity_ecom2str (hc->default_rt_import_list, ECOMMUNITY_FORMAT_ROUTE_MAP, ECOMMUNITY_ROUTE_TARGET); - vty_outln (vty, " rt import %s", b); + vty_out (vty, " rt import %s\n", b); XFREE (MTYPE_ECOMMUNITY_STR, b); } if (hc->default_rt_export_list) { char *b = ecommunity_ecom2str (hc->default_rt_export_list, ECOMMUNITY_FORMAT_ROUTE_MAP, ECOMMUNITY_ROUTE_TARGET); - vty_outln (vty, " rt export %s", b); + vty_out (vty, " rt export %s\n", b); XFREE (MTYPE_ECOMMUNITY_STR, b); } } @@ -4581,15 +4581,15 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) RFAPI_RFP_CFG_GROUP_DEFAULT, NULL, bgp->rfapi_cfg->default_rfp_cfg); - vty_outln (vty, " exit-vnc"); - vty_outln (vty, "!"); + vty_out (vty, " exit-vnc\n"); + vty_out (vty, "!\n"); } for (ALL_LIST_ELEMENTS (hc->nve_groups_sequential, node, nnode, rfg)) if (rfg->type == RFAPI_GROUP_CFG_NVE) { ++write; - vty_outln (vty, " vnc nve-group %s", rfg->name); + vty_out (vty, " vnc nve-group %s\n", rfg->name); if (rfg->vn_prefix.family && rfg->vn_node) { @@ -4599,11 +4599,11 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) prefix2str (&rfg->vn_prefix, buf, BUFSIZ); if (!buf[0] || buf[BUFSIZ - 1]) { - vty_outln (vty, "!Error: Can't convert prefix"); + vty_out (vty, "!Error: Can't convert prefix\n"); } else { - vty_outln (vty, " prefix %s %s", "vn", buf); + vty_out (vty, " prefix %s %s\n", "vn", buf); } } @@ -4614,11 +4614,11 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) prefix2str (&rfg->un_prefix, buf, BUFSIZ); if (!buf[0] || buf[BUFSIZ - 1]) { - vty_outln (vty, "!Error: Can't convert prefix"); + vty_out (vty, "!Error: Can't convert prefix\n"); } else { - vty_outln (vty, " prefix %s %s", "un", buf); + vty_out (vty, " prefix %s %s\n", "un", buf); } } @@ -4636,7 +4636,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) value = ((rfg->rd.val[6] << 8) & 0x0ff00) | (rfg->rd.val[7] & 0x0ff); - vty_outln (vty, " rd auto:vn:%d", value); + vty_out (vty, " rd auto:vn:%d\n", value); } else @@ -4646,11 +4646,11 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) !buf[0] || buf[BUFSIZ - 1]) { - vty_outln (vty, "!Error: Can't convert rd"); + vty_out (vty, "!Error: Can't convert rd\n"); } else { - vty_outln (vty, " rd %s", buf); + vty_out (vty, " rd %s\n", buf); } } } @@ -4661,7 +4661,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) vty_out (vty, "%d", rfg->response_lifetime); else vty_out (vty, "infinite"); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } if (rfg->rt_import_list && rfg->rt_export_list && @@ -4670,7 +4670,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) char *b = ecommunity_ecom2str (rfg->rt_import_list, ECOMMUNITY_FORMAT_ROUTE_MAP, ECOMMUNITY_ROUTE_TARGET); - vty_outln (vty, " rt both %s", b); + vty_out (vty, " rt both %s\n", b); XFREE (MTYPE_ECOMMUNITY_STR, b); } else @@ -4680,14 +4680,14 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) char *b = ecommunity_ecom2str (rfg->rt_import_list, ECOMMUNITY_FORMAT_ROUTE_MAP, ECOMMUNITY_ROUTE_TARGET); - vty_outln (vty, " rt import %s", b); + vty_out (vty, " rt import %s\n", b); XFREE (MTYPE_ECOMMUNITY_STR, b); } if (rfg->rt_export_list) { char *b = ecommunity_ecom2str (rfg->rt_export_list, ECOMMUNITY_FORMAT_ROUTE_MAP, ECOMMUNITY_ROUTE_TARGET); - vty_outln (vty, " rt export %s", b); + vty_out (vty, " rt export %s\n", b); XFREE (MTYPE_ECOMMUNITY_STR, b); } } @@ -4702,12 +4702,12 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) if (rfg->plist_export_bgp_name[afi]) { - vty_outln (vty, " export bgp %s prefix-list %s", + vty_out (vty, " export bgp %s prefix-list %s\n", afistr,rfg->plist_export_bgp_name[afi]); } if (rfg->plist_export_zebra_name[afi]) { - vty_outln (vty, " export zebra %s prefix-list %s", + vty_out (vty, " export zebra %s prefix-list %s\n", afistr,rfg->plist_export_zebra_name[afi]); } /* @@ -4717,14 +4717,14 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) */ if (rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT][afi]) { - vty_outln (vty, " redistribute bgp-direct %s prefix-list %s", + vty_out (vty, " redistribute bgp-direct %s prefix-list %s\n", afistr, rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT][afi]); } if (rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT][afi]) { - vty_outln (vty, - " redistribute bgp-direct-to-nve-groups %s prefix-list %s", + vty_out (vty, + " redistribute bgp-direct-to-nve-groups %s prefix-list %s\n", afistr, rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT][afi]); } @@ -4732,23 +4732,23 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) if (rfg->routemap_export_bgp_name) { - vty_outln (vty, " export bgp route-map %s", + vty_out (vty, " export bgp route-map %s\n", rfg->routemap_export_bgp_name); } if (rfg->routemap_export_zebra_name) { - vty_outln (vty, " export zebra route-map %s", + vty_out (vty, " export zebra route-map %s\n", rfg->routemap_export_zebra_name); } if (rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT]) { - vty_outln (vty, " redistribute bgp-direct route-map %s", + vty_out (vty, " redistribute bgp-direct route-map %s\n", rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT]); } if (rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT]) { - vty_outln (vty, - " redistribute bgp-direct-to-nve-groups route-map %s", + vty_out (vty, + " redistribute bgp-direct-to-nve-groups route-map %s\n", rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT]); } if (bgp->rfapi->rfp_methods.cfg_group_cb) @@ -4757,8 +4757,8 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) bgp->rfapi->rfp, RFAPI_RFP_CFG_GROUP_NVE, rfg->name, rfg->rfp_cfg); - vty_outln (vty, " exit-vnc"); - vty_outln (vty, "!"); + vty_out (vty, " exit-vnc\n"); + vty_out (vty, "!\n"); } } /* have listen ports */ @@ -4767,24 +4767,24 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) */ if (VNC_EXPORT_BGP_GRP_ENABLED (hc)) { - vty_outln (vty, " vnc export bgp mode group-nve"); + vty_out (vty, " vnc export bgp mode group-nve\n"); } else if (VNC_EXPORT_BGP_RH_ENABLED (hc)) { - vty_outln (vty, " vnc export bgp mode registering-nve"); + vty_out (vty, " vnc export bgp mode registering-nve\n"); } else if (VNC_EXPORT_BGP_CE_ENABLED (hc)) { - vty_outln (vty, " vnc export bgp mode ce"); + vty_out (vty, " vnc export bgp mode ce\n"); } if (VNC_EXPORT_ZEBRA_GRP_ENABLED (hc)) { - vty_outln (vty, " vnc export zebra mode group-nve"); + vty_out (vty, " vnc export zebra mode group-nve\n"); } else if (VNC_EXPORT_ZEBRA_RH_ENABLED (hc)) { - vty_outln (vty, " vnc export zebra mode registering-nve"); + vty_out (vty, " vnc export zebra mode registering-nve\n"); } if (hc->rfg_export_direct_bgp_l) @@ -4792,7 +4792,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) for (ALL_LIST_ELEMENTS (hc->rfg_export_direct_bgp_l, node, nnode, rfgn)) { - vty_outln (vty, " vnc export bgp group-nve group %s", + vty_out (vty, " vnc export bgp group-nve group %s\n", rfgn->name); } } @@ -4802,7 +4802,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) for (ALL_LIST_ELEMENTS (hc->rfg_export_zebra_l, node, nnode, rfgn)) { - vty_outln (vty, " vnc export zebra group-nve group %s", + vty_out (vty, " vnc export zebra group-nve group %s\n", rfgn->name); } } @@ -4810,19 +4810,19 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) if (hc->rfg_redist_name) { - vty_outln (vty, " vnc redistribute nve-group %s", + vty_out (vty, " vnc redistribute nve-group %s\n", hc->rfg_redist_name); } if (hc->redist_lifetime) { - vty_outln (vty, " vnc redistribute lifetime %d", + vty_out (vty, " vnc redistribute lifetime %d\n", hc->redist_lifetime); } if (hc->resolve_nve_roo_local_admin != BGP_VNC_CONFIG_RESOLVE_NVE_ROO_LOCAL_ADMIN_DEFAULT) { - vty_outln (vty, " vnc redistribute resolve-nve roo-ec-local-admin %d", + vty_out (vty, " vnc redistribute resolve-nve roo-ec-local-admin %d\n", hc->resolve_nve_roo_local_admin); } @@ -4844,7 +4844,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) } if (s) { - vty_outln (vty, " vnc redistribute mode %s", s); + vty_out (vty, " vnc redistribute mode %s\n", s); } } @@ -4858,34 +4858,34 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) if (hc->plist_export_bgp_name[afi]) { - vty_outln (vty, " vnc export bgp %s prefix-list %s", + vty_out (vty, " vnc export bgp %s prefix-list %s\n", afistr, hc->plist_export_bgp_name[afi]); } if (hc->plist_export_zebra_name[afi]) { - vty_outln (vty, " vnc export zebra %s prefix-list %s", + vty_out (vty, " vnc export zebra %s prefix-list %s\n", afistr, hc->plist_export_zebra_name[afi]); } if (hc->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT][afi]) { - vty_outln (vty, " vnc redistribute bgp-direct %s prefix-list %s", + vty_out (vty, " vnc redistribute bgp-direct %s prefix-list %s\n", afistr,hc->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT][afi]); } } if (hc->routemap_export_bgp_name) { - vty_outln (vty, " vnc export bgp route-map %s", + vty_out (vty, " vnc export bgp route-map %s\n", hc->routemap_export_bgp_name); } if (hc->routemap_export_zebra_name) { - vty_outln (vty, " vnc export zebra route-map %s", + vty_out (vty, " vnc export zebra route-map %s\n", hc->routemap_export_zebra_name); } if (hc->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT]) { - vty_outln (vty, " vnc redistribute bgp-direct route-map %s", + vty_out (vty, " vnc redistribute bgp-direct route-map %s\n", hc->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT]); } @@ -4898,14 +4898,14 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) if (type == ZEBRA_ROUTE_BGP_DIRECT_EXT && hc->redist_bgp_exterior_view_name) { - vty_outln (vty, " vnc redistribute %s %s view %s", + vty_out (vty, " vnc redistribute %s %s view %s\n", ((afi == AFI_IP) ? "ipv4" : "ipv6"), zebra_route_string (type), hc->redist_bgp_exterior_view_name); } else { - vty_outln (vty, " vnc redistribute %s %s", + vty_out (vty, " vnc redistribute %s %s\n", ((afi == AFI_IP) ? "ipv4" : "ipv6"), zebra_route_string(type)); } @@ -4924,7 +4924,7 @@ bgp_rfapi_show_summary (struct bgp *bgp, struct vty *vty) if (hc == NULL) return; - vty_outln (vty, "%-39s %-19s %s", "VNC Advertise method:", + vty_out (vty, "%-39s %-19s %s\n", "VNC Advertise method:", (hc->flags & BGP_VNC_CONFIG_ADV_UN_METHOD_ENCAP ? "Encapsulation SAFI" : "Tunnel Encap attribute"), ((hc->flags & BGP_VNC_CONFIG_ADV_UN_METHOD_ENCAP) == (BGP_VNC_CONFIG_ADV_UN_METHOD_ENCAP & BGP_VNC_CONFIG_FLAGS_DEFAULT) ? "(default)" : "")); @@ -4991,7 +4991,7 @@ bgp_rfapi_show_summary (struct bgp *bgp, struct vty *vty) vty_out (vty, "%sToZebra {Registering NVE}", (redist == 1 ? "" : " ")); /* note filters, route-maps not shown */ } - vty_outln (vty, "%-19s %s", (redist ? "" : "Off"), + vty_out (vty, "%-19s %s\n", (redist ? "" : "Off"), (redist ? "" : "(default)")); /* Redistribution */ @@ -5010,28 +5010,28 @@ bgp_rfapi_show_summary (struct bgp *bgp, struct vty *vty) } } } - vty_outln (vty, "%-19s %s", (redist ? "" : "Off"), + vty_out (vty, "%-19s %s\n", (redist ? "" : "Off"), (redist ? "" : "(default)")); - vty_outln (vty, "%-39s %3u%-16s %s", "RFP Registration Hold-Down Factor:", + vty_out (vty, "%-39s %3u%-16s %s\n", "RFP Registration Hold-Down Factor:", hc->rfp_cfg.holddown_factor, "%", (hc->rfp_cfg.holddown_factor == RFAPI_RFP_CFG_DEFAULT_HOLDDOWN_FACTOR ? "(default)" : "")); - vty_outln (vty, "%-39s %-19s %s", "RFP Updated responses:", + vty_out (vty, "%-39s %-19s %s\n", "RFP Updated responses:", (hc->rfp_cfg.use_updated_response == 0 ? "Off" : "On"), (hc->rfp_cfg.use_updated_response == 0 ? "(default)" : "")); - vty_outln (vty, "%-39s %-19s %s", "RFP Removal responses:", + vty_out (vty, "%-39s %-19s %s\n", "RFP Removal responses:", (hc->rfp_cfg.use_removes == 0 ? "Off" : "On"), (hc->rfp_cfg.use_removes == 0 ? "(default)" : "")); - vty_outln (vty, "%-39s %-19s %s", "RFP Full table download:", + vty_out (vty, "%-39s %-19s %s\n", "RFP Full table download:", (hc->rfp_cfg.download_type == RFAPI_RFP_DOWNLOAD_FULL ? "On" : "Off"), (hc->rfp_cfg.download_type == RFAPI_RFP_DOWNLOAD_PARTIAL ? "(default)" : "")); sprintf (tmp, "%u seconds", hc->rfp_cfg.ftd_advertisement_interval); - vty_outln (vty, "%-39s %-19s %s", " Advertisement Interval:", tmp, + vty_out (vty, "%-39s %-19s %s\n", " Advertisement Interval:", tmp, (hc->rfp_cfg.ftd_advertisement_interval == RFAPI_RFP_CFG_DEFAULT_FTD_ADVERTISEMENT_INTERVAL ? "(default)" : "")); - vty_outln (vty, "%-39s %d seconds", "Default RFP response lifetime:", + vty_out (vty, "%-39s %d seconds\n", "Default RFP response lifetime:", hc->default_response_lifetime); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return; } diff --git a/bgpd/rfapi/rfapi.c b/bgpd/rfapi/rfapi.c index 1ea8004e2..89f69637f 100644 --- a/bgpd/rfapi/rfapi.c +++ b/bgpd/rfapi/rfapi.c @@ -3101,12 +3101,12 @@ DEFUN ( if (!str2prefix (argv[5]->arg, &pfx)) { - vty_outln (vty, "Malformed address \"%s\"", argv[5]->arg); + vty_out (vty, "Malformed address \"%s\"\n", argv[5]->arg); return CMD_WARNING_CONFIG_FAILED; } if (pfx.family != AF_INET && pfx.family != AF_INET6) { - vty_outln (vty, "Invalid address \"%s\"", argv[5]->arg); + vty_out (vty, "Invalid address \"%s\"\n", argv[5]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -3144,7 +3144,7 @@ test_nexthops_callback ( fp (out, "Nexthops Callback, Target=("); //rfapiPrintRfapiIpAddr(stream, target); - fp (out, ")%s", VTYNL); + fp (out, ")\n"); rfapiPrintNhl (stream, next_hops); @@ -3185,12 +3185,12 @@ DEFUN (debug_rfapi_open, rc = rfapi_open (rfapi_get_rfp_start_val_by_bgp (bgp_get_default ()), &vn, &un, /*&uo */ NULL, &lifetime, NULL, &handle); - vty_outln (vty, "rfapi_open: status %d, handle %p, lifetime %d", + vty_out (vty, "rfapi_open: status %d, handle %p, lifetime %d\n", rc, handle, lifetime); rc = rfapi_set_response_cb (handle, test_nexthops_callback); - vty_outln (vty, "rfapi_set_response_cb: status %d", rc); + vty_out (vty, "rfapi_set_response_cb: status %d\n", rc); return CMD_SUCCESS; } @@ -3230,14 +3230,14 @@ DEFUN (debug_rfapi_close_vn_un, if (rfapi_find_handle_vty (vty, &vn, &un, &handle)) { - vty_outln (vty, "can't locate handle matching vn=%s, un=%s", + vty_out (vty, "can't locate handle matching vn=%s, un=%s\n", argv[4]->arg, argv[6]->arg); return CMD_WARNING_CONFIG_FAILED; } rc = rfapi_close (handle); - vty_outln (vty, "rfapi_close(handle=%p): status %d", handle,rc); + vty_out (vty, "rfapi_close(handle=%p): status %d\n", handle,rc); return CMD_SUCCESS; } @@ -3258,13 +3258,13 @@ DEFUN (debug_rfapi_close_rfd, if (*endptr != '\0' || (uintptr_t) handle == UINTPTR_MAX) { - vty_outln (vty, "Invalid value: %s", argv[4]->arg); + vty_out (vty, "Invalid value: %s\n", argv[4]->arg); return CMD_WARNING_CONFIG_FAILED; } rc = rfapi_close (handle); - vty_outln (vty, "rfapi_close(handle=%p): status %d", handle,rc); + vty_out (vty, "rfapi_close(handle=%p): status %d\n", handle,rc); return CMD_SUCCESS; } @@ -3311,7 +3311,7 @@ DEFUN (debug_rfapi_register_vn_un, if (rfapi_find_handle_vty (vty, &vn, &un, &handle)) { - vty_outln (vty, "can't locate handle matching vn=%s, un=%s", + vty_out (vty, "can't locate handle matching vn=%s, un=%s\n", argv[4]->arg, argv[6]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -3321,12 +3321,12 @@ DEFUN (debug_rfapi_register_vn_un, */ if (!str2prefix (argv[8]->arg, &pfx)) { - vty_outln (vty, "Malformed prefix \"%s\"", argv[8]->arg); + vty_out (vty, "Malformed prefix \"%s\"\n", argv[8]->arg); return CMD_WARNING_CONFIG_FAILED; } if (pfx.family != AF_INET && pfx.family != AF_INET6) { - vty_outln (vty, "Bad family for prefix \"%s\"", argv[8]->arg); + vty_out (vty, "Bad family for prefix \"%s\"\n", argv[8]->arg); return CMD_WARNING_CONFIG_FAILED; } rfapiQprefix2Rprefix (&pfx, &hpfx); @@ -3344,7 +3344,7 @@ DEFUN (debug_rfapi_register_vn_un, rc = rfapi_register (handle, &hpfx, lifetime, NULL, NULL, 0); if (rc) { - vty_outln (vty, "rfapi_register failed with rc=%d (%s)", rc, + vty_out (vty, "rfapi_register failed with rc=%d (%s)\n", rc, strerror(rc)); } @@ -3400,7 +3400,7 @@ DEFUN (debug_rfapi_register_vn_un_l2o, if (rfapi_find_handle_vty (vty, &vn, &un, &handle)) { - vty_outln (vty, "can't locate handle matching vn=%s, un=%s", + vty_out (vty, "can't locate handle matching vn=%s, un=%s\n", argv[4]->arg, argv[6]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -3410,12 +3410,12 @@ DEFUN (debug_rfapi_register_vn_un_l2o, */ if (!str2prefix (argv[8]->arg, &pfx)) { - vty_outln (vty, "Malformed prefix \"%s\"", argv[8]->arg); + vty_out (vty, "Malformed prefix \"%s\"\n", argv[8]->arg); return CMD_WARNING_CONFIG_FAILED; } if (pfx.family != AF_INET && pfx.family != AF_INET6) { - vty_outln (vty, "Bad family for prefix \"%s\"", argv[8]->arg); + vty_out (vty, "Bad family for prefix \"%s\"\n", argv[8]->arg); return CMD_WARNING_CONFIG_FAILED; } rfapiQprefix2Rprefix (&pfx, &hpfx); @@ -3434,7 +3434,7 @@ DEFUN (debug_rfapi_register_vn_un_l2o, optary[opt_next].v.l2addr.logical_net_id = strtoul(argv[14]->arg, NULL, 10); if ((rc = rfapiStr2EthAddr (argv[12]->arg, &optary[opt_next].v.l2addr.macaddr))) { - vty_outln (vty, "Bad mac address \"%s\"", argv[12]->arg); + vty_out (vty, "Bad mac address \"%s\"\n", argv[12]->arg); return CMD_WARNING_CONFIG_FAILED; } optary[opt_next].type = RFAPI_VN_OPTION_TYPE_L2ADDR; @@ -3453,7 +3453,7 @@ DEFUN (debug_rfapi_register_vn_un_l2o, rc = rfapi_register (handle, &hpfx, lifetime, NULL /* &uo */ , opt, 0); if (rc) { - vty_outln (vty, "rfapi_register failed with rc=%d (%s)", rc, + vty_out (vty, "rfapi_register failed with rc=%d (%s)\n", rc, strerror(rc)); } @@ -3496,7 +3496,7 @@ DEFUN (debug_rfapi_unregister_vn_un, if (rfapi_find_handle_vty (vty, &vn, &un, &handle)) { - vty_outln (vty, "can't locate handle matching vn=%s, un=%s", + vty_out (vty, "can't locate handle matching vn=%s, un=%s\n", argv[4]->arg, argv[6]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -3506,12 +3506,12 @@ DEFUN (debug_rfapi_unregister_vn_un, */ if (!str2prefix (argv[8]->arg, &pfx)) { - vty_outln (vty, "Malformed prefix \"%s\"", argv[8]->arg); + vty_out (vty, "Malformed prefix \"%s\"\n", argv[8]->arg); return CMD_WARNING_CONFIG_FAILED; } if (pfx.family != AF_INET && pfx.family != AF_INET6) { - vty_outln (vty, "Bad family for prefix \"%s\"", argv[8]->arg); + vty_out (vty, "Bad family for prefix \"%s\"\n", argv[8]->arg); return CMD_WARNING_CONFIG_FAILED; } rfapiQprefix2Rprefix (&pfx, &hpfx); @@ -3567,7 +3567,7 @@ DEFUN (debug_rfapi_query_vn_un, if (rfapi_find_handle_vty (vty, &vn, &un, &handle)) { - vty_outln (vty, "can't locate handle matching vn=%s, un=%s", + vty_out (vty, "can't locate handle matching vn=%s, un=%s\n", argv[4]->arg, argv[6]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -3579,7 +3579,7 @@ DEFUN (debug_rfapi_query_vn_un, if (rc) { - vty_outln (vty, "rfapi_query failed with rc=%d (%s)", rc, + vty_out (vty, "rfapi_query failed with rc=%d (%s)\n", rc, strerror(rc)); } else @@ -3642,13 +3642,13 @@ DEFUN (debug_rfapi_query_vn_un_l2o, if ((rc = rfapiCliGetRfapiIpAddr (vty, argv[2], &target))) return rc; #else - vty_outln (vty, "%% This command is broken."); + vty_out (vty, "%% This command is broken.\n"); return CMD_WARNING_CONFIG_FAILED; #endif if (rfapi_find_handle_vty (vty, &vn, &un, &handle)) { - vty_outln (vty, "can't locate handle matching vn=%s, un=%s", + vty_out (vty, "can't locate handle matching vn=%s, un=%s\n", argv[4]->arg, argv[6]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -3659,7 +3659,7 @@ DEFUN (debug_rfapi_query_vn_un_l2o, memset (&l2o_buf, 0, sizeof (l2o_buf)); if (rfapiStr2EthAddr (argv[10]->arg, &l2o_buf.macaddr)) { - vty_outln (vty, "Bad mac address \"%s\"", argv[10]->arg); + vty_out (vty, "Bad mac address \"%s\"\n", argv[10]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -3688,7 +3688,7 @@ DEFUN (debug_rfapi_query_vn_un_l2o, if (rc) { - vty_outln (vty, "rfapi_query failed with rc=%d (%s)", rc, + vty_out (vty, "rfapi_query failed with rc=%d (%s)\n", rc, strerror(rc)); } else @@ -3750,7 +3750,7 @@ DEFUN (debug_rfapi_query_done_vn_un, if (rfapi_find_handle_vty (vty, &vn, &un, &handle)) { - vty_outln (vty, "can't locate handle matching vn=%s, un=%s", + vty_out (vty, "can't locate handle matching vn=%s, un=%s\n", argv[5]->arg, argv[7]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -3760,7 +3760,7 @@ DEFUN (debug_rfapi_query_done_vn_un, */ rc = rfapi_query_done (handle, &target); - vty_outln (vty, "rfapi_query_done returned %d", rc); + vty_out (vty, "rfapi_query_done returned %d\n", rc); return CMD_SUCCESS; } @@ -3786,14 +3786,14 @@ DEFUN (debug_rfapi_show_import, bgp = bgp_get_default (); /* assume 1 instance for now */ if (!bgp) { - vty_outln (vty, "No BGP instance"); + vty_out (vty, "No BGP instance\n"); return CMD_WARNING_CONFIG_FAILED; } h = bgp->rfapi; if (!h) { - vty_outln (vty, "No RFAPI instance"); + vty_out (vty, "No RFAPI instance\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3807,7 +3807,7 @@ DEFUN (debug_rfapi_show_import, { s = ecommunity_ecom2str (it->rt_import_list, ECOMMUNITY_FORMAT_ROUTE_MAP, 0); - vty_outln (vty, "Import Table %p, RTs: %s", it, s); + vty_out (vty, "Import Table %p, RTs: %s\n", it, s); XFREE (MTYPE_ECOMMUNITY_STR, s); rfapiShowImportTable (vty, "IP VPN", it->imported_vpn[AFI_IP], 1); @@ -3837,8 +3837,7 @@ DEFUN (debug_rfapi_show_import, lni = lni_as_ptr; if (first_l2) { - vty_outln (vty, "%sLNI-based Ethernet Tables:", - VTYNL); + vty_out (vty, "\nLNI-based Ethernet Tables:\n"); first_l2 = 0; } snprintf (buf, BUFSIZ, "L2VPN LNI=%u", lni); @@ -3889,7 +3888,7 @@ DEFUN (debug_rfapi_show_import_vn_un, if (rfapi_find_handle_vty (vty, &vn, &un, &handle)) { - vty_outln (vty, "can't locate handle matching vn=%s, un=%s", + vty_out (vty, "can't locate handle matching vn=%s, un=%s\n", argv[5]->arg, argv[7]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -3920,12 +3919,12 @@ DEFUN (debug_rfapi_response_omit_self, if (!bgp) { - vty_outln (vty, "No BGP process is configured"); + vty_out (vty, "No BGP process is configured\n"); return CMD_WARNING_CONFIG_FAILED; } if (!bgp->rfapi_cfg) { - vty_outln (vty, "VNC not configured"); + vty_out (vty, "VNC not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -4191,7 +4190,7 @@ rfapi_rfp_get_or_init_group_config_nve ( if (!rfg || !listnode_lookup (rfc->nve_groups_sequential, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current NVE group no longer exists"); + vty_out (vty, "Current NVE group no longer exists\n"); return NULL; } @@ -4216,7 +4215,7 @@ rfapi_rfp_get_or_init_group_config_l2 ( if (!rfg || !listnode_lookup (rfc->l2_groups, rfg)) { /* Not in list anymore */ - vty_outln (vty, "Current L2 group no longer exists"); + vty_out (vty, "Current L2 group no longer exists\n"); return NULL; } if (rfg->rfp_cfg == NULL && size > 0) diff --git a/bgpd/rfapi/rfapi_rib.c b/bgpd/rfapi/rfapi_rib.c index 5c3976a0c..380b04757 100644 --- a/bgpd/rfapi/rfapi_rib.c +++ b/bgpd/rfapi/rfapi_rib.c @@ -2294,7 +2294,7 @@ rfapiRibShowResponsesSummary (void *stream) fp (out, "%-24s ", "Responses: (Prefixes)"); fp (out, "%-8s %-8u ", "Active:", bgp->rfapi->rib_prefix_count_total); fp (out, "%-8s %-8u", "Maximum:", bgp->rfapi->rib_prefix_count_total_max); - fp (out, "%s", VTYNL); + fp (out, "\n"); fp (out, "%-24s ", " (Updated)"); fp (out, "%-8s %-8u ", "Update:", @@ -2304,7 +2304,7 @@ rfapiRibShowResponsesSummary (void *stream) fp (out, "%-8s %-8u", "Total:", bgp->rfapi->stat.count_updated_response_updates + bgp->rfapi->stat.count_updated_response_deletes); - fp (out, "%s", VTYNL); + fp (out, "\n"); fp (out, "%-24s ", " (NVEs)"); for (ALL_LIST_ELEMENTS_RO (&bgp->rfapi->descriptors, node, rfd)) @@ -2315,7 +2315,7 @@ rfapiRibShowResponsesSummary (void *stream) } fp (out, "%-8s %-8u ", "Active:", nves_with_nonempty_ribs); fp (out, "%-8s %-8u", "Total:", nves); - fp (out, "%s", VTYNL); + fp (out, "\n"); } @@ -2385,10 +2385,10 @@ print_rib_sl ( prefix_rd2str(&ri->rk.rd, str_rd+1, BUFSIZ-1); #endif - fp (out, " %c %-20s %-15s %-15s %-4u %-8s %-8s%s%s", + fp (out, " %c %-20s %-15s %-15s %-4u %-8s %-8s%s\n", deleted ? 'r' : ' ', *printedprefix ? "" : str_pfx, - str_vn, str_un, ri->cost, str_lifetime, str_age, str_rd, VTYNL); + str_vn, str_un, ri->cost, str_lifetime, str_age, str_rd); if (!*printedprefix) *printedprefix = 1; @@ -2500,20 +2500,18 @@ rfapiRibShowResponses ( { ++printedheader; - fp (out, "%s[%s]%s", - VTYNL, - show_removed ? "Removed" : "Active", VTYNL); - fp (out, "%-15s %-15s%s", "Querying VN", "Querying UN", - VTYNL); - fp (out, " %-20s %-15s %-15s %4s %-8s %-8s%s", + fp (out, "\n[%s]\n", + show_removed ? "Removed" : "Active"); + fp (out, "%-15s %-15s\n", "Querying VN", "Querying UN"); + fp (out, " %-20s %-15s %-15s %4s %-8s %-8s\n", "Prefix", "Registered VN", "Registered UN", "Cost", "Lifetime", #if RFAPI_REGISTRATIONS_REPORT_AGE - "Age", + "Age" #else - "Remaining", + "Remaining" #endif - VTYNL); + ); } if (!printednve) { @@ -2523,14 +2521,13 @@ rfapiRibShowResponses ( ++printednve; ++nves_displayed; - fp (out, "%-15s %-15s%s", + fp (out, "%-15s %-15s\n", rfapiRfapiIpAddr2Str (&rfd->vn_addr, str_vn, BUFSIZ), - rfapiRfapiIpAddr2Str (&rfd->un_addr, str_un, BUFSIZ), - VTYNL); + rfapiRfapiIpAddr2Str (&rfd->un_addr, str_un, BUFSIZ)); } prefix2str (&rn->p, str_pfx, BUFSIZ); - //fp(out, " %s%s", buf, VTYNL); /* prefix */ + //fp(out, " %s\n", buf); /* prefix */ routes_displayed++; nhs_displayed += print_rib_sl (fp, vty, out, sl, @@ -2542,12 +2539,12 @@ rfapiRibShowResponses ( if (routes_total) { - fp (out, "%s", VTYNL); + fp (out, "\n"); fp (out, "Displayed %u NVEs, and %u out of %u %s prefixes", nves_displayed, routes_displayed, routes_total, show_removed ? "removed" : "active"); if (nhs_displayed != routes_displayed || nhs_total != routes_total) fp (out, " with %u out of %u next hops", nhs_displayed, nhs_total); - fp (out, "%s", VTYNL); + fp (out, "\n"); } } diff --git a/bgpd/rfapi/rfapi_vty.c b/bgpd/rfapi/rfapi_vty.c index ef08699f7..3b7d08f91 100644 --- a/bgpd/rfapi/rfapi_vty.c +++ b/bgpd/rfapi/rfapi_vty.c @@ -385,14 +385,14 @@ rfapiStdioPrintf (void *stream, const char *format, ...) /* Fake out for debug logging */ static struct vty vty_dummy_zlog; static struct vty vty_dummy_stdio; -#define HVTYNL ((vty == &vty_dummy_zlog)? "": VTYNL) +#define HVTYNL ((vty == &vty_dummy_zlog)? "": "\n") static const char * str_vty_newline (struct vty *vty) { if (vty == &vty_dummy_zlog) return ""; - return VTYNL; + return "\n"; } int @@ -939,14 +939,14 @@ rfapiShowVncQueries (void *stream, struct prefix *pfx_match) bgp = bgp_get_default (); /* assume 1 instance for now */ if (!bgp) { - vty_outln (vty, "No BGP instance"); + vty_out (vty, "No BGP instance\n"); return CMD_WARNING; } h = bgp->rfapi; if (!h) { - vty_outln (vty, "No RFAPI instance"); + vty_out (vty, "No RFAPI instance\n"); return CMD_WARNING; } @@ -995,10 +995,10 @@ rfapiShowVncQueries (void *stream, struct prefix *pfx_match) if (!printedheader) { ++printedheader; - fp (out, "%s", VTYNL); - fp (out, "%-15s %-15s %-15s %-10s%s", + fp (out, "\n"); + fp (out, "%-15s %-15s %-15s %-10s\n", "VN Address", "UN Address", - "Target", "Remaining", VTYNL); + "Target", "Remaining"); } if (!printedquerier) @@ -1022,9 +1022,9 @@ rfapiShowVncQueries (void *stream, struct prefix *pfx_match) rfapiFormatSeconds (thread_timer_remain_second (m->timer), buf_remain, BUFSIZ); } - fp (out, " %-15s %-10s%s", + fp (out, " %-15s %-10s\n", inet_ntop (m->p.family, &m->p.u.prefix, buf_pfx, BUFSIZ), - buf_remain, VTYNL); + buf_remain); } } @@ -1070,10 +1070,10 @@ rfapiShowVncQueries (void *stream, struct prefix *pfx_match) if (!printedheader) { ++printedheader; - fp (out, "%s", VTYNL); - fp (out, "%-15s %-15s %-17s %10s %-10s%s", + fp (out, "\n"); + fp (out, "%-15s %-15s %-17s %10s %-10s\n", "VN Address", "UN Address", - "Target", "LNI", "Remaining", VTYNL); + "Target", "LNI", "Remaining"); } if (!printedquerier) @@ -1097,19 +1097,18 @@ rfapiShowVncQueries (void *stream, struct prefix *pfx_match) rfapiFormatSeconds (thread_timer_remain_second (mon_eth->timer), buf_remain, BUFSIZ); } - fp (out, " %-17s %10d %-10s%s", + fp (out, " %-17s %10d %-10s\n", rfapi_ntop (pfx_mac.family, &pfx_mac.u.prefix, buf_pfx, - BUFSIZ), mon_eth->logical_net_id, buf_remain, - VTYNL); + BUFSIZ), mon_eth->logical_net_id, buf_remain); } } } if (queries_total) { - fp (out, "%s", VTYNL); - fp (out, "Displayed %d out of %d total queries%s", - queries_displayed, queries_total, VTYNL); + fp (out, "\n"); + fp (out, "Displayed %d out of %d total queries\n", + queries_displayed, queries_total); } return CMD_SUCCESS; } @@ -2221,7 +2220,7 @@ register_add ( if (!bgp) { if (vty) - vty_outln (vty, "BGP not configured"); + vty_out (vty, "BGP not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2230,7 +2229,7 @@ register_add ( if (!h || !rfapi_cfg) { if (vty) - vty_outln (vty, "RFAPI not configured"); + vty_out (vty, "RFAPI not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2240,12 +2239,12 @@ register_add ( { if (arg_lnh) { - vty_outln (vty,"local-next-hop specified more than once"); + vty_out (vty,"local-next-hop specified more than once\n"); return CMD_WARNING_CONFIG_FAILED; } if (argc <= 1) { - vty_outln (vty,"Missing parameter for local-next-hop"); + vty_out (vty,"Missing parameter for local-next-hop\n"); return CMD_WARNING_CONFIG_FAILED; } ++argv, --argc; @@ -2255,12 +2254,12 @@ register_add ( { if (arg_lnh_cost) { - vty_outln (vty,"local-cost specified more than once"); + vty_out (vty,"local-cost specified more than once\n"); return CMD_WARNING_CONFIG_FAILED; } if (argc <= 1) { - vty_outln (vty,"Missing parameter for local-cost"); + vty_out (vty,"Missing parameter for local-cost\n"); return CMD_WARNING_CONFIG_FAILED; } ++argv, --argc; @@ -2288,7 +2287,7 @@ register_add ( arg_prefix = "0::0/128"; break; default: - vty_outln (vty,"Internal error, unknown VN address family"); + vty_out (vty,"Internal error, unknown VN address family\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2296,13 +2295,13 @@ register_add ( if (!str2prefix (arg_prefix, &pfx)) { - vty_outln (vty, "Malformed prefix \"%s\"",arg_prefix); + vty_out (vty, "Malformed prefix \"%s\"\n",arg_prefix); goto fail; } if (pfx.family != AF_INET && pfx.family != AF_INET6) { - vty_outln (vty, "prefix \"%s\" has invalid address family", + vty_out (vty, "prefix \"%s\" has invalid address family\n", arg_prefix); goto fail; } @@ -2316,7 +2315,7 @@ register_add ( cost = strtoul (arg_cost, &endptr, 10); if (*endptr != '\0' || cost > 255) { - vty_outln (vty, "%% Invalid %s value", "cost"); + vty_out (vty, "%% Invalid %s value\n", "cost"); goto fail; } } @@ -2337,7 +2336,7 @@ register_add ( lifetime = strtoul (arg_lifetime, &endptr, 10); if (*endptr != '\0') { - vty_outln (vty, "%% Invalid %s value","lifetime"); + vty_out (vty, "%% Invalid %s value\n","lifetime"); goto fail; } } @@ -2351,8 +2350,8 @@ register_add ( { if (!arg_lnh) { - vty_outln (vty, - "%% %s may only be specified with local-next-hop", + vty_out (vty, + "%% %s may only be specified with local-next-hop\n", "local-cost"); goto fail; } @@ -2360,7 +2359,7 @@ register_add ( lnh_cost = strtoul (arg_lnh_cost, &endptr, 10); if (*endptr != '\0' || lnh_cost > 255) { - vty_outln (vty, "%% Invalid %s value","local-cost"); + vty_out (vty, "%% Invalid %s value\n","local-cost"); goto fail; } } @@ -2373,7 +2372,7 @@ register_add ( { if (!arg_prefix) { - vty_outln (vty, "%% %s may only be specified with prefix", + vty_out (vty, "%% %s may only be specified with prefix\n", "local-next-hop"); goto fail; } @@ -2401,7 +2400,7 @@ register_add ( if (arg_vni && !arg_macaddr) { - vty_outln (vty, "%% %s may only be specified with mac address", + vty_out (vty, "%% %s may only be specified with mac address\n", "virtual-network-identifier"); goto fail; } @@ -2410,8 +2409,8 @@ register_add ( { if (!arg_vni) { - vty_outln (vty, - "Missing \"vni\" parameter (mandatory with mac)"); + vty_out (vty, + "Missing \"vni\" parameter (mandatory with mac)\n"); return CMD_WARNING_CONFIG_FAILED; } optary[opt_next].v.l2addr.logical_net_id = strtoul(arg_vni, NULL, @@ -2420,7 +2419,7 @@ register_add ( if ((rc = rfapiStr2EthAddr (arg_macaddr, &optary[opt_next].v.l2addr.macaddr))) { - vty_outln (vty, "Invalid %s value","mac address"); + vty_out (vty, "Invalid %s value\n","mac address"); goto fail; } /* TBD label, NVE ID */ @@ -2472,7 +2471,7 @@ register_add ( &rfd); if (rc) { - vty_outln (vty, "Can't open session for this NVE: %s", + vty_out (vty, "Can't open session for this NVE: %s\n", rfapi_error_str(rc)); rc = CMD_WARNING_CONFIG_FAILED; goto fail; @@ -2480,7 +2479,7 @@ register_add ( } else { - vty_outln (vty, "Can't find session for this NVE: %s", + vty_out (vty, "Can't find session for this NVE: %s\n", rfapi_error_str(rc)); goto fail; } @@ -2516,10 +2515,10 @@ register_add ( } vnc_zlog_debug_verbose ("%s: rfapi_register failed", __func__); - vty_out (vty, VTYNL); - vty_outln (vty, "Registration failed."); - vty_outln (vty, - "Confirm that either the VN or UN address matches a configured NVE group."); + vty_out (vty, "\n"); + vty_out (vty, "Registration failed.\n"); + vty_out (vty, + "Confirm that either the VN or UN address matches a configured NVE group.\n"); return CMD_WARNING_CONFIG_FAILED; fail: @@ -3129,7 +3128,7 @@ parse_deleter_args ( if (!str2prefix (arg_prefix, &rcdarg->prefix)) { - vty_outln (vty, "Malformed prefix \"%s\"", arg_prefix); + vty_out (vty, "Malformed prefix \"%s\"\n", arg_prefix); return rc; } } @@ -3138,14 +3137,14 @@ parse_deleter_args ( { if (!arg_vni) { - vty_outln (vty, "Missing VNI"); + vty_out (vty, "Missing VNI\n"); return rc; } if (strcmp (arg_l2addr, "*")) { if ((rc = rfapiStr2EthAddr (arg_l2addr, &rcdarg->l2o.o.macaddr))) { - vty_outln (vty, "Malformed L2 Address \"%s\"", + vty_out (vty, "Malformed L2 Address \"%s\"\n", arg_l2addr); return rc; } @@ -3161,7 +3160,7 @@ parse_deleter_args ( { if (!str2prefix_rd (arg_rd, &rcdarg->rd)) { - vty_outln (vty, "Malformed RD \"%s\"", + vty_out (vty, "Malformed RD \"%s\"\n", arg_rd); return rc; } @@ -3705,12 +3704,12 @@ print_cleared_stats (struct rfapi_local_reg_delete_arg *cda) cda->nves = NULL; } if (cda->failed_pfx_count) - vty_outln (vty, "Failed to delete %d prefixes", + vty_out (vty, "Failed to delete %d prefixes\n", cda->failed_pfx_count); /* left as "prefixes" even in single case for ease of machine parsing */ - vty_outln (vty, - "[Local] Cleared %u registrations, %u prefixes, %u responses from %d NVEs", + vty_out (vty, + "[Local] Cleared %u registrations, %u prefixes, %u responses from %d NVEs\n", cda->reg_count, cda->pfx_count, cda->query_count,cda->nve_count); /* @@ -3718,7 +3717,7 @@ print_cleared_stats (struct rfapi_local_reg_delete_arg *cda) * the command line */ - vty_outln (vty, "[Holddown] Cleared %u prefixes from %u NVEs", + vty_out (vty, "[Holddown] Cleared %u prefixes from %u NVEs\n", cda->remote_holddown_pfx_count,cda->remote_holddown_nve_count); } @@ -4395,8 +4394,8 @@ check_and_display_is_vnc_running (struct vty *vty) if (vty) { - vty_outln (vty, - "VNC is not configured. (There are no configured BGP VPN SAFI peers.)"); + vty_out (vty, + "VNC is not configured. (There are no configured BGP VPN SAFI peers.)\n"); } return 0; /* not running */ } @@ -4459,10 +4458,10 @@ rfapi_vty_show_nve_summary (struct vty *vty, show_nve_summary_t show_type) h->stat.count_registrations_failed); vty_out (vty, "%-8s %-8u", "Total:", h->stat.count_registrations); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } vty_out (vty, "%-24s ", "Prefixes registered:"); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); rfapiCountAllItRoutes (&active_local_routes, &active_remote_routes, @@ -4474,16 +4473,16 @@ rfapi_vty_show_nve_summary (struct vty *vty, show_nve_summary_t show_type) { vty_out (vty, " %-20s ", "Locally:"); vty_out (vty, "%-8s %-8u ", "Active:", active_local_routes); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } vty_out (vty, " %-20s ", "Remotely:"); vty_out (vty, "%-8s %-8u", "Active:", active_remote_routes); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); vty_out (vty, " %-20s ", "In Holddown:"); vty_out (vty, "%-8s %-8u", "Active:", holddown_remote_routes); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); vty_out (vty, " %-20s ", "Imported:"); vty_out (vty, "%-8s %-8u", "Active:", imported_remote_routes); break; @@ -4502,12 +4501,12 @@ rfapi_vty_show_nve_summary (struct vty *vty, show_nve_summary_t show_type) default: break; } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } return 0; notcfg: - vty_outln (vty, "VNC is not configured."); + vty_out (vty, "VNC is not configured.\n"); return CMD_WARNING; } @@ -4574,9 +4573,9 @@ rfapi_show_nves ( if (!printed) { /* print out a header */ - vty_outln (vty, - " " "Active Next Hops"); - vty_outln (vty, "%-15s %-15s %-5s %-5s %-6s %-6s %s", + vty_out (vty, + " Active Next Hops\n"); + vty_out (vty, "%-15s %-15s %-5s %-5s %-6s %-6s %s\n", "VN Address", "UN Address", "Regis", "Resps", "Reach", "Remove", "Age"); @@ -4584,7 +4583,7 @@ rfapi_show_nves ( ++printed; - vty_outln (vty, "%-15s %-15s %-5u %-5u %-6u %-6u %s", + vty_out (vty, "%-15s %-15s %-5u %-5u %-6u %-6u %s\n", vn_addr_buf, un_addr_buf, rfapiApCount (rfd), @@ -4595,13 +4594,13 @@ rfapi_show_nves ( } if (printed > 0 || vn_prefix || un_prefix) - vty_outln (vty, "Displayed %d out of %d active NVEs", + vty_out (vty, "Displayed %d out of %d active NVEs\n", printed, total); return 0; notcfg: - vty_outln (vty, "VNC is not configured."); + vty_out (vty, "VNC is not configured.\n"); return CMD_WARNING; } @@ -4616,7 +4615,7 @@ DEFUN (vnc_show_summary, if (!check_and_display_is_vnc_running (vty)) return CMD_SUCCESS; bgp_rfapi_show_summary (bgp_get_default (), vty); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); rfapi_vty_show_nve_summary (vty, SHOW_NVE_SUMMARY_ACTIVE_NVES); rfapi_vty_show_nve_summary (vty, SHOW_NVE_SUMMARY_QUERIES); rfapi_vty_show_nve_summary (vty, SHOW_NVE_SUMMARY_RESPONSES); @@ -4653,12 +4652,12 @@ DEFUN (vnc_show_nves_ptct, if (!str2prefix (argv[4]->arg, &pfx)) { - vty_outln (vty, "Malformed address \"%s\"", argv[4]->arg); + vty_out (vty, "Malformed address \"%s\"\n", argv[4]->arg); return CMD_WARNING; } if (pfx.family != AF_INET && pfx.family != AF_INET6) { - vty_outln (vty, "Invalid address \"%s\"", argv[4]->arg); + vty_out (vty, "Invalid address \"%s\"\n", argv[4]->arg); return CMD_WARNING; } @@ -4713,7 +4712,7 @@ rfapi_show_registrations ( } if (!printed) { - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } @@ -4734,7 +4733,7 @@ DEFUN (vnc_show_registrations_pfx, { if (!str2prefix (argv[3]->arg, &p)) { - vty_outln (vty, "Invalid prefix: %s", argv[3]->arg); + vty_out (vty, "Invalid prefix: %s\n", argv[3]->arg); return CMD_SUCCESS; } else @@ -4774,7 +4773,7 @@ DEFUN (vnc_show_registrations_some_pfx, { if (!str2prefix (argv[4]->arg, &p)) { - vty_outln (vty, "Invalid prefix: %s", argv[4]->arg); + vty_out (vty, "Invalid prefix: %s\n", argv[4]->arg); return CMD_SUCCESS; } else @@ -4831,7 +4830,7 @@ DEFUN (vnc_show_responses_pfx, { if (!str2prefix (argv[3]->arg, &p)) { - vty_outln (vty, "Invalid prefix: %s", argv[3]->arg); + vty_out (vty, "Invalid prefix: %s\n", argv[3]->arg); return CMD_SUCCESS; } else @@ -4874,7 +4873,7 @@ DEFUN (vnc_show_responses_some_pfx, { if (!str2prefix (argv[4]->arg, &p)) { - vty_outln (vty, "Invalid prefix: %s", argv[4]->arg); + vty_out (vty, "Invalid prefix: %s\n", argv[4]->arg); return CMD_SUCCESS; } else @@ -4923,7 +4922,7 @@ DEFUN (show_vnc_queries_pfx, { if (!str2prefix (argv[3]->arg, &pfx)) { - vty_outln (vty, "Invalid prefix: %s", argv[3]->arg); + vty_out (vty, "Invalid prefix: %s\n", argv[3]->arg); return CMD_WARNING; } p = &pfx; @@ -4976,7 +4975,7 @@ DEFUN (vnc_clear_counters, return CMD_SUCCESS; notcfg: - vty_outln (vty, "VNC is not configured."); + vty_out (vty, "VNC is not configured.\n"); return CMD_WARNING; } @@ -5006,12 +5005,12 @@ vnc_add_vrf_prefix (struct vty *vty, bgp = bgp_get_default (); /* assume main instance for now */ if (!bgp) { - vty_outln (vty, "No BGP process is configured"); + vty_out (vty, "No BGP process is configured\n"); return CMD_WARNING_CONFIG_FAILED; } if (!bgp->rfapi || !bgp->rfapi_cfg) { - vty_outln (vty, "VRF support not configured"); + vty_out (vty, "VRF support not configured\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -5019,31 +5018,31 @@ vnc_add_vrf_prefix (struct vty *vty, /* arg checks */ if (!rfg) { - vty_outln (vty, "VRF \"%s\" appears not to be configured.", + vty_out (vty, "VRF \"%s\" appears not to be configured.\n", arg_vrf); return CMD_WARNING_CONFIG_FAILED; } if (!rfg->rt_export_list || !rfg->rfapi_import_table) { - vty_outln (vty, "VRF \"%s\" is missing RT import/export RT configuration.", + vty_out (vty, "VRF \"%s\" is missing RT import/export RT configuration.\n", arg_vrf); return CMD_WARNING_CONFIG_FAILED; } if (!rfg->rd.family && !arg_rd) { - vty_outln (vty, "VRF \"%s\" isn't configured with an RD, so RD must be provided.", + vty_out (vty, "VRF \"%s\" isn't configured with an RD, so RD must be provided.\n", arg_vrf); return CMD_WARNING_CONFIG_FAILED; } if (rfg->label > MPLS_LABEL_MAX && !arg_label) { - vty_outln (vty, "VRF \"%s\" isn't configured with a default labels, so a label must be provided.", + vty_out (vty, "VRF \"%s\" isn't configured with a default labels, so a label must be provided.\n", arg_vrf); return CMD_WARNING_CONFIG_FAILED; } if (!str2prefix (arg_prefix, &pfx)) { - vty_outln (vty, "Malformed prefix \"%s\"", + vty_out (vty, "Malformed prefix \"%s\"\n", arg_prefix); return CMD_WARNING_CONFIG_FAILED; } @@ -5057,7 +5056,7 @@ vnc_add_vrf_prefix (struct vty *vty, opt->type = RFAPI_VN_OPTION_TYPE_INTERNAL_RD; if (!str2prefix_rd (arg_rd, &opt->v.internal_rd)) { - vty_outln (vty, "Malformed RD \"%s\"", + vty_out (vty, "Malformed RD \"%s\"\n", arg_rd); return CMD_WARNING_CONFIG_FAILED; } @@ -5085,7 +5084,7 @@ vnc_add_vrf_prefix (struct vty *vty, pref = strtoul (arg_pref, &endptr, 10); if (*endptr != '\0') { - vty_outln (vty, "%% Invalid local-preference value \"%s\"", + vty_out (vty, "%% Invalid local-preference value \"%s\"\n", arg_pref); return CMD_WARNING_CONFIG_FAILED; } @@ -5150,7 +5149,7 @@ vnc_add_vrf_prefix (struct vty *vty, } vnc_zlog_debug_verbose ("%s: rfapi_register failed", __func__); - vty_outln (vty, "Add failed."); + vty_out (vty, "Add failed.\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -5260,19 +5259,19 @@ vnc_clear_vrf (struct vty *vty, bgp = bgp_get_default (); /* assume main instance for now */ if (!bgp) { - vty_outln (vty, "No BGP process is configured"); + vty_out (vty, "No BGP process is configured\n"); return CMD_WARNING; } if (!bgp->rfapi || !bgp->rfapi_cfg) { - vty_outln (vty, "VRF support not configured"); + vty_out (vty, "VRF support not configured\n"); return CMD_WARNING; } rfg = bgp_rfapi_cfg_match_byname (bgp, arg_vrf, RFAPI_GROUP_CFG_VRF); /* arg checks */ if (!rfg) { - vty_outln (vty, "VRF \"%s\" appears not to be configured.", + vty_out (vty, "VRF \"%s\" appears not to be configured.\n", arg_vrf); return CMD_WARNING; } @@ -5284,7 +5283,7 @@ vnc_clear_vrf (struct vty *vty, start_count = rfapi_cfg_group_it_count(rfg); clear_vnc_prefix (&cda); clear_vnc_vrf_closer (rfg); - vty_outln (vty, "Cleared %u out of %d prefixes.", + vty_out (vty, "Cleared %u out of %d prefixes.\n", cda.pfx_count, start_count); return CMD_SUCCESS; } diff --git a/bgpd/rfapi/vnc_debug.c b/bgpd/rfapi/vnc_debug.c index 53669ce3b..1f9e1b10f 100644 --- a/bgpd/rfapi/vnc_debug.c +++ b/bgpd/rfapi/vnc_debug.c @@ -79,13 +79,13 @@ DEFUN (debug_bgp_vnc, else { term_vnc_debug |= vncdebug[i].bit; - vty_outln (vty, "BGP vnc %s debugging is on", + vty_out (vty, "BGP vnc %s debugging is on\n", vncdebug[i].name); } return CMD_SUCCESS; } } - vty_outln (vty, "Unknown debug flag: %s", argv[3]->arg); + vty_out (vty, "Unknown debug flag: %s\n", argv[3]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -118,13 +118,13 @@ DEFUN (no_debug_bgp_vnc, else { term_vnc_debug &= ~vncdebug[i].bit; - vty_outln (vty, "BGP vnc %s debugging is off", + vty_out (vty, "BGP vnc %s debugging is off\n", vncdebug[i].name); } return CMD_SUCCESS; } } - vty_outln (vty, "Unknown debug flag: %s", argv[3]->arg); + vty_out (vty, "Unknown debug flag: %s\n", argv[3]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -144,7 +144,7 @@ DEFUN (no_debug_bgp_vnc_all, VNC_STR) { term_vnc_debug = 0; - vty_outln (vty, "All possible VNC debugging has been turned off"); + vty_out (vty, "All possible VNC debugging has been turned off\n"); return CMD_SUCCESS; } @@ -163,17 +163,17 @@ DEFUN (show_debugging_bgp_vnc, { size_t i; - vty_outln (vty, "BGP VNC debugging status:"); + vty_out (vty, "BGP VNC debugging status:\n"); for (i = 0; i < (sizeof(vncdebug) / sizeof(struct vnc_debug)); ++i) { if (term_vnc_debug & vncdebug[i].bit) { - vty_outln (vty, " BGP VNC %s debugging is on", + vty_out (vty, " BGP VNC %s debugging is on\n", vncdebug[i].name); } } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -187,7 +187,7 @@ bgp_vnc_config_write_debug (struct vty *vty) { if (conf_vnc_debug & vncdebug[i].bit) { - vty_outln (vty, "debug bgp vnc %s", vncdebug[i].name); + vty_out (vty, "debug bgp vnc %s\n", vncdebug[i].name); write++; } } diff --git a/bgpd/rfp-example/librfp/rfp_example.c b/bgpd/rfp-example/librfp/rfp_example.c index a0ba82908..451be7770 100644 --- a/bgpd/rfp-example/librfp/rfp_example.c +++ b/bgpd/rfp-example/librfp/rfp_example.c @@ -197,7 +197,7 @@ rfp_cfg_write_cb (struct vty *vty, void *rfp_start_val) if (rfi->config_var != 0) { vty_out (vty, " rfp example-config-value %u", rfi->config_var); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); write++; } diff --git a/eigrpd/eigrp_dump.c b/eigrpd/eigrp_dump.c index a32ccb58b..9e18c0dca 100644 --- a/eigrpd/eigrp_dump.c +++ b/eigrpd/eigrp_dump.c @@ -84,7 +84,7 @@ config_write_debug (struct vty *vty) if (conf_debug_eigrp_packet[i] == 0 && term_debug_eigrp_packet[i] == 0 ) continue; - vty_outln (vty, "debug eigrp packet %s%s", + vty_out (vty, "debug eigrp packet %s%s\n", type_str[i],detail_str[conf_debug_eigrp_packet[i]]); write = 1; } @@ -210,12 +210,11 @@ void show_ip_eigrp_interface_header (struct vty *vty, struct eigrp *eigrp) { - vty_outln (vty, "%s%s%d%s%s%s %-10s %-10s %-10s %-6s %-12s %-7s %-14s %-12s %-8s %-8s %-8s%s %-39s %-12s %-7s %-14s %-12s %-8s", - VTYNL, - "EIGRP interfaces for AS(",eigrp->AS,")",VTYNL,VTYNL, + vty_out (vty, "\nEIGRP interfaces for AS(%d)\n\n %-10s %-10s %-10s %-6s %-12s %-7s %-14s %-12s %-8s %-8s %-8s\n %-39s %-12s %-7s %-14s %-12s %-8s\n", + eigrp->AS, "Interface", "Bandwidth", "Delay", "Peers", "Xmit Queue", "Mean", "Pacing Time", "Multicast", "Pending", "Hello", "Holdtime", - VTYNL,"","Un/Reliable","SRTT","Un/Reliable","Flow Timer", + "","Un/Reliable","SRTT","Un/Reliable","Flow Timer", "Routes"); } @@ -229,7 +228,7 @@ show_ip_eigrp_interface_sub (struct vty *vty, struct eigrp *eigrp, vty_out (vty, "%-7u", ei->nbrs->count); vty_out (vty, "%u %c %-10u",0,'/', eigrp_neighbor_packet_queue_sum (ei)); vty_out (vty, "%-7u %-14u %-12u %-8u", 0, 0, 0, 0); - vty_outln (vty, "%-8u %-8u ", + vty_out (vty, "%-8u %-8u \n", IF_DEF_PARAMS (ei->ifp)->v_hello, IF_DEF_PARAMS(ei->ifp)->v_wait); } @@ -238,31 +237,30 @@ void show_ip_eigrp_interface_detail (struct vty *vty, struct eigrp *eigrp, struct eigrp_interface *ei) { - vty_outln (vty, "%-2s %s %d %-3s ","","Hello interval is ", 0, " sec"); - vty_outln (vty, "%-2s %s %s ","", "Next xmit serial","<none>"); - vty_outln (vty, "%-2s %s %d %s %d %s %d %s %d ", + vty_out (vty, "%-2s %s %d %-3s \n","","Hello interval is ", 0, " sec"); + vty_out (vty, "%-2s %s %s \n","", "Next xmit serial","<none>"); + vty_out (vty, "%-2s %s %d %s %d %s %d %s %d \n", "", "Un/reliable mcasts: ", 0, "/", 0, "Un/reliable ucasts: ", 0, "/", 0); - vty_outln (vty, "%-2s %s %d %s %d %s %d ", + vty_out (vty, "%-2s %s %d %s %d %s %d \n", "", "Mcast exceptions: ", 0, " CR packets: ", 0, " ACKs supressed: ", 0); - vty_outln (vty, "%-2s %s %d %s %d ", + vty_out (vty, "%-2s %s %d %s %d \n", "", "Retransmissions sent: ", 0, "Out-of-sequence rcvd: ", 0); - vty_outln (vty, "%-2s %s %s %s ", + vty_out (vty, "%-2s %s %s %s \n", "", "Authentication mode is ", "not","set"); - vty_outln (vty, "%-2s %s ", "", "Use multicast"); + vty_out (vty, "%-2s %s \n", "", "Use multicast"); } void show_ip_eigrp_neighbor_header (struct vty *vty, struct eigrp *eigrp) { - vty_outln (vty, "%s%s%d%s%s%s%-3s %-17s %-20s %-6s %-8s %-6s %-5s %-5s %-5s%s %-41s %-6s %-8s %-6s %-4s %-6s %-5s ", - VTYNL, - "EIGRP neighbors for AS(",eigrp->AS,")",VTYNL,VTYNL, + vty_out (vty, "\nEIGRP neighbors for AS(%d)\n\n%-3s %-17s %-20s %-6s %-8s %-6s %-5s %-5s %-5s\n %-41s %-6s %-8s %-6s %-4s %-6s %-5s \n", + eigrp->AS, "H", "Address", "Interface", "Hold", "Uptime", - "SRTT", "RTO", "Q", "Seq", VTYNL - ,"","(sec)","","(ms)","","Cnt","Num"); + "SRTT", "RTO", "Q", "Seq", + "","(sec)","","(ms)","","Cnt","Num"); } void @@ -275,7 +273,7 @@ show_ip_eigrp_neighbor_sub (struct vty *vty, struct eigrp_neighbor *nbr, vty_out (vty,"%-7lu", thread_timer_remain_second (nbr->t_holddown)); vty_out (vty,"%-8u %-6u %-5u", 0, 0, EIGRP_PACKET_RETRANS_TIME); vty_out (vty,"%-7lu", nbr->retrans_queue->count); - vty_outln (vty,"%u", nbr->recv_sequence_number); + vty_out (vty,"%u\n", nbr->recv_sequence_number); if (detail) @@ -285,7 +283,7 @@ show_ip_eigrp_neighbor_sub (struct vty *vty, struct eigrp_neighbor *nbr, nbr->tlv_rel_major, nbr->tlv_rel_minor); vty_out(vty,", Retrans: %lu, Retries: %lu", nbr->retrans_queue->count, 0UL); - vty_outln (vty,", %s", eigrp_nbr_state_str(nbr)); + vty_out (vty,", %s\n", eigrp_nbr_state_str(nbr)); } } @@ -298,11 +296,9 @@ show_ip_eigrp_topology_header (struct vty *vty, struct eigrp *eigrp) struct in_addr router_id; router_id.s_addr = eigrp->router_id; - vty_outln (vty, "%sEIGRP Topology Table for AS(%d)/ID(%s)%s", - VTYNL, eigrp->AS, inet_ntoa(router_id), VTYNL); - vty_outln (vty, "Codes: P - Passive, A - Active, U - Update, Q - Query, " - "R - Reply%s r - reply Status, s - sia Status%s", - VTYNL, VTYNL); + vty_out (vty, "\nEIGRP Topology Table for AS(%d)/ID(%s)\n\n", eigrp->AS, inet_ntoa(router_id)); + vty_out (vty, "Codes: P - Passive, A - Active, U - Update, Q - Query, " + "R - Reply\n r - reply Status, s - sia Status\n\n"); } void @@ -315,7 +311,7 @@ show_ip_eigrp_prefix_entry (struct vty *vty, struct eigrp_prefix_entry *tn) vty_out (vty, "%s/%u, ", inet_ntoa (tn->destination_ipv4->prefix), tn->destination_ipv4->prefixlen); vty_out (vty, "%u successors, ", successors->count); - vty_outln (vty, "FD is %u, serno: %" PRIu64 " ", tn->fdistance, tn->serno); + vty_out (vty, "FD is %u, serno: %" PRIu64 " \n", tn->fdistance, tn->serno); list_delete(successors); } @@ -334,11 +330,11 @@ show_ip_eigrp_neighbor_entry (struct vty *vty, struct eigrp *eigrp, } if (te->adv_router == eigrp->neighbor_self) - vty_outln (vty, "%-7s%s, %s", " ", "via Connected", + vty_out (vty, "%-7s%s, %s\n", " ", "via Connected", eigrp_if_name_string(te->ei)); else { - vty_outln (vty, "%-7s%s%s (%u/%u), %s", + vty_out (vty, "%-7s%s%s (%u/%u), %s\n", " ", "via ", inet_ntoa (te->adv_router->src), te->distance, te->reported_distance, eigrp_if_name_string(te->ei)); @@ -355,11 +351,11 @@ DEFUN (show_debugging_eigrp, { int i; - vty_outln (vty, "EIGRP debugging status:"); + vty_out (vty, "EIGRP debugging status:\n"); /* Show debug status for events. */ if (IS_DEBUG_EIGRP(event,EVENT)) - vty_outln (vty, " EIGRP event debugging is on"); + vty_out (vty, " EIGRP event debugging is on\n"); /* Show debug status for EIGRP Packets. */ for (i = 0; i < 11 ; i++) @@ -369,18 +365,18 @@ DEFUN (show_debugging_eigrp, if (IS_DEBUG_EIGRP_PACKET (i, SEND) && IS_DEBUG_EIGRP_PACKET (i, RECV)) { - vty_outln (vty, " EIGRP packet %s%s debugging is on", + vty_out (vty, " EIGRP packet %s%s debugging is on\n", lookup_msg(eigrp_packet_type_str, i + 1, NULL), IS_DEBUG_EIGRP_PACKET (i, PACKET_DETAIL) ? " detail" : ""); } else { if (IS_DEBUG_EIGRP_PACKET (i, SEND)) - vty_outln (vty, " EIGRP packet %s send%s debugging is on", + vty_out (vty, " EIGRP packet %s send%s debugging is on\n", lookup_msg(eigrp_packet_type_str, i + 1, NULL), IS_DEBUG_EIGRP_PACKET (i, PACKET_DETAIL) ? " detail" : ""); if (IS_DEBUG_EIGRP_PACKET (i, RECV)) - vty_outln (vty, " EIGRP packet %s receive%s debugging is on", + vty_out (vty, " EIGRP packet %s receive%s debugging is on\n", lookup_msg(eigrp_packet_type_str, i + 1, NULL), IS_DEBUG_EIGRP_PACKET (i, PACKET_DETAIL) ? " detail" : ""); } diff --git a/eigrpd/eigrp_neighbor.c b/eigrpd/eigrp_neighbor.c index c0bb2afaf..bf3fc216c 100644 --- a/eigrpd/eigrp_neighbor.c +++ b/eigrpd/eigrp_neighbor.c @@ -366,7 +366,7 @@ void eigrp_nbr_hard_restart(struct eigrp_neighbor *nbr, struct vty *vty) if(vty != NULL) { vty_time_print (vty, 0); - vty_outln (vty, "Neighbor %s (%s) is down: manually cleared", + vty_out (vty, "Neighbor %s (%s) is down: manually cleared\n", inet_ntoa (nbr->src), ifindex2ifname(nbr->ei->ifp->ifindex, VRF_DEFAULT)); } diff --git a/eigrpd/eigrp_routemap.c b/eigrpd/eigrp_routemap.c index 8af8c7010..1d85e7646 100644 --- a/eigrpd/eigrp_routemap.c +++ b/eigrpd/eigrp_routemap.c @@ -154,10 +154,10 @@ eigrp_route_match_add (struct vty *vty, struct route_map_index *index, switch (ret) { case RMAP_RULE_MISSING: - vty_outln (vty, "%% Can't find rule."); + vty_out (vty, "%% Can't find rule.\n"); return CMD_WARNING_CONFIG_FAILED; case RMAP_COMPILE_ERROR: - vty_outln (vty, "%% Argument is malformed."); + vty_out (vty, "%% Argument is malformed.\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -176,10 +176,10 @@ eigrp_route_match_delete (struct vty *vty, struct route_map_index *index, switch (ret) { case RMAP_RULE_MISSING: - vty_outln (vty, "%% Can't find rule."); + vty_out (vty, "%% Can't find rule.\n"); return CMD_WARNING_CONFIG_FAILED; case RMAP_COMPILE_ERROR: - vty_outln (vty, "%% Argument is malformed."); + vty_out (vty, "%% Argument is malformed.\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -199,7 +199,7 @@ eigrp_route_set_add (struct vty *vty, struct route_map_index *index, switch (ret) { case RMAP_RULE_MISSING: - vty_outln (vty, "%% Can't find rule."); + vty_out (vty, "%% Can't find rule.\n"); return CMD_WARNING_CONFIG_FAILED; case RMAP_COMPILE_ERROR: /* rip, ripng and other protocols share the set metric command @@ -207,7 +207,7 @@ eigrp_route_set_add (struct vty *vty, struct route_map_index *index, 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_outln (vty, "%% Argument is malformed."); + vty_out (vty, "%% Argument is malformed.\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -228,10 +228,10 @@ eigrp_route_set_delete (struct vty *vty, struct route_map_index *index, switch (ret) { case RMAP_RULE_MISSING: - vty_outln (vty, "%% Can't find rule."); + vty_out (vty, "%% Can't find rule.\n"); return CMD_WARNING_CONFIG_FAILED; case RMAP_COMPILE_ERROR: - vty_outln (vty, "%% Argument is malformed."); + vty_out (vty, "%% Argument is malformed.\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -1124,7 +1124,7 @@ DEFUN (set_ip_nexthop, ret = str2sockunion (argv[0], &su); if (ret < 0) { - vty_outln (vty, "%% Malformed next-hop address"); + vty_out (vty, "%% Malformed next-hop address\n"); return CMD_WARNING_CONFIG_FAILED; } diff --git a/eigrpd/eigrp_update.c b/eigrpd/eigrp_update.c index 24fd7074f..93b2ceb9d 100644 --- a/eigrpd/eigrp_update.c +++ b/eigrpd/eigrp_update.c @@ -1047,7 +1047,7 @@ eigrp_update_send_GR (struct eigrp_neighbor *nbr, enum GR_type gr_type, struct v if(vty != NULL) { vty_time_print (vty, 0); - vty_outln (vty, "Neighbor %s (%s) is resync: manually cleared", + vty_out (vty, "Neighbor %s (%s) is resync: manually cleared\n", inet_ntoa (nbr->src), ifindex2ifname(nbr->ei->ifp->ifindex, VRF_DEFAULT)); } diff --git a/eigrpd/eigrp_vty.c b/eigrpd/eigrp_vty.c index 5b48ab79b..49fb729ca 100644 --- a/eigrpd/eigrp_vty.c +++ b/eigrpd/eigrp_vty.c @@ -65,18 +65,18 @@ config_write_network (struct vty *vty, struct eigrp *eigrp) if (rn->info) { /* Network print. */ - vty_outln (vty, " network %s/%d ", + vty_out (vty, " network %s/%d \n", inet_ntoa (rn->p.u.prefix4), rn->p.prefixlen); } if (eigrp->max_paths != EIGRP_MAX_PATHS_DEFAULT) - vty_outln (vty, " maximum-paths %d", eigrp->max_paths); + vty_out (vty, " maximum-paths %d\n", eigrp->max_paths); if (eigrp->variance != EIGRP_VARIANCE_DEFAULT) - vty_outln (vty, " variance %d", eigrp->variance); + vty_out (vty, " variance %d\n", eigrp->variance); /*Separate EIGRP configuration from the rest of the config*/ - vty_outln (vty, "!"); + vty_out (vty, "!\n"); return 0; } @@ -89,39 +89,39 @@ config_write_interfaces (struct vty *vty, struct eigrp *eigrp) for (ALL_LIST_ELEMENTS_RO (eigrp->eiflist, node, ei)) { - vty_outln (vty, "interface %s", ei->ifp->name); + vty_out (vty, "interface %s\n", ei->ifp->name); if ((IF_DEF_PARAMS (ei->ifp)->auth_type) == EIGRP_AUTH_TYPE_MD5) { - vty_outln (vty, " ip authentication mode eigrp %d md5", eigrp->AS); + vty_out (vty, " ip authentication mode eigrp %d md5\n", eigrp->AS); } if ((IF_DEF_PARAMS (ei->ifp)->auth_type) == EIGRP_AUTH_TYPE_SHA256) { - vty_outln (vty, " ip authentication mode eigrp %d hmac-sha-256", + vty_out (vty, " ip authentication mode eigrp %d hmac-sha-256\n", eigrp->AS); } if(IF_DEF_PARAMS (ei->ifp)->auth_keychain) { - vty_outln (vty, " ip authentication key-chain eigrp %d %s",eigrp->AS, + vty_out (vty, " ip authentication key-chain eigrp %d %s\n",eigrp->AS, IF_DEF_PARAMS(ei->ifp)->auth_keychain); } if ((IF_DEF_PARAMS (ei->ifp)->v_hello) != EIGRP_HELLO_INTERVAL_DEFAULT) { - vty_outln (vty, " ip hello-interval eigrp %d", + vty_out (vty, " ip hello-interval eigrp %d\n", IF_DEF_PARAMS(ei->ifp)->v_hello); } if ((IF_DEF_PARAMS (ei->ifp)->v_wait) != EIGRP_HOLD_INTERVAL_DEFAULT) { - vty_outln (vty, " ip hold-time eigrp %d", + vty_out (vty, " ip hold-time eigrp %d\n", IF_DEF_PARAMS(ei->ifp)->v_wait); } /*Separate this EIGRP interface configuration from the others*/ - vty_outln (vty, "!"); + vty_out (vty, "!\n"); } return 0; @@ -134,23 +134,23 @@ eigrp_write_interface (struct vty *vty) struct interface *ifp; for (ALL_LIST_ELEMENTS_RO (vrf_iflist(VRF_DEFAULT), node, ifp)) { - vty_outln (vty, "interface %s",ifp->name); + vty_out (vty, "interface %s\n",ifp->name); if (ifp->desc) - vty_outln (vty, " description %s",ifp->desc); + vty_out (vty, " description %s\n",ifp->desc); if (IF_DEF_PARAMS (ifp)->bandwidth != EIGRP_BANDWIDTH_DEFAULT) - vty_outln (vty, " bandwidth %u",IF_DEF_PARAMS(ifp)->bandwidth); + vty_out (vty, " bandwidth %u\n",IF_DEF_PARAMS(ifp)->bandwidth); if (IF_DEF_PARAMS (ifp)->delay != EIGRP_DELAY_DEFAULT) - vty_outln (vty, " delay %u", IF_DEF_PARAMS(ifp)->delay); + vty_out (vty, " delay %u\n", IF_DEF_PARAMS(ifp)->delay); if (IF_DEF_PARAMS (ifp)->v_hello != EIGRP_HELLO_INTERVAL_DEFAULT) - vty_outln (vty, " ip hello-interval eigrp %u", + vty_out (vty, " ip hello-interval eigrp %u\n", IF_DEF_PARAMS(ifp)->v_hello); if (IF_DEF_PARAMS (ifp)->v_wait != EIGRP_HOLD_INTERVAL_DEFAULT) - vty_outln (vty, " ip hold-time eigrp %u", + vty_out (vty, " ip hold-time eigrp %u\n", IF_DEF_PARAMS(ifp)->v_wait); - vty_outln (vty, "!"); + vty_out (vty, "!\n"); } return 0; @@ -179,7 +179,7 @@ config_write_eigrp_router (struct vty *vty, struct eigrp *eigrp) int write=0; /* `router eigrp' print. */ - vty_outln (vty, "router eigrp %d", eigrp->AS); + vty_out (vty, "router eigrp %d\n", eigrp->AS); write++; @@ -191,7 +191,7 @@ config_write_eigrp_router (struct vty *vty, struct eigrp *eigrp) { struct in_addr router_id_static; router_id_static.s_addr = htonl(eigrp->router_id_static); - vty_outln (vty, " eigrp router-id %s", + vty_out (vty, " eigrp router-id %s\n", inet_ntoa(router_id_static)); } @@ -202,7 +202,7 @@ config_write_eigrp_router (struct vty *vty, struct eigrp *eigrp) config_write_eigrp_distribute (vty, eigrp); /*Separate EIGRP configuration from the rest of the config*/ - vty_outln (vty, "!"); + vty_out (vty, "!\n"); return write; } @@ -235,7 +235,7 @@ DEFUN (no_router_eigrp, eigrp = eigrp_lookup (); if (eigrp->AS != atoi (argv[3]->arg)) { - vty_outln (vty,"%% Attempting to deconfigure non-existent AS"); + vty_out (vty,"%% Attempting to deconfigure non-existent AS\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -393,7 +393,7 @@ DEFUN (eigrp_network, if (ret == 0) { - vty_outln (vty, "There is already same network statement."); + vty_out (vty, "There is already same network statement.\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -417,7 +417,7 @@ DEFUN (no_eigrp_network, if (ret == 0) { - vty_outln (vty,"Can't find specified network configuration."); + vty_out (vty,"Can't find specified network configuration.\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -465,7 +465,7 @@ DEFUN (show_ip_eigrp_topology, eigrp = eigrp_lookup (); if (eigrp == NULL) { - vty_outln (vty, " EIGRP Routing Process not enabled"); + vty_out (vty, " EIGRP Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -521,7 +521,7 @@ DEFUN (show_ip_eigrp_interfaces, eigrp = eigrp_lookup (); if (eigrp == NULL) { - vty_outln (vty, "EIGRP Routing Process not enabled"); + vty_out (vty, "EIGRP Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -568,7 +568,7 @@ DEFUN (show_ip_eigrp_neighbors, eigrp = eigrp_lookup (); if (eigrp == NULL) { - vty_outln (vty, " EIGRP Routing Process not enabled"); + vty_out (vty, " EIGRP Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -607,7 +607,7 @@ DEFUN (eigrp_if_delay, eigrp = eigrp_lookup (); if (eigrp == NULL) { - vty_outln (vty, " EIGRP Routing Process not enabled"); + vty_out (vty, " EIGRP Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -633,7 +633,7 @@ DEFUN (no_eigrp_if_delay, eigrp = eigrp_lookup (); if (eigrp == NULL) { - vty_outln (vty, " EIGRP Routing Process not enabled"); + vty_out (vty, " EIGRP Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -658,7 +658,7 @@ DEFUN (eigrp_if_bandwidth, eigrp = eigrp_lookup (); if (eigrp == NULL) { - vty_outln (vty, " EIGRP Routing Process not enabled"); + vty_out (vty, " EIGRP Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -684,7 +684,7 @@ DEFUN (no_eigrp_if_bandwidth, eigrp = eigrp_lookup (); if (eigrp == NULL) { - vty_outln (vty, " EIGRP Routing Process not enabled"); + vty_out (vty, " EIGRP Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -709,7 +709,7 @@ DEFUN (eigrp_if_ip_hellointerval, eigrp = eigrp_lookup (); if (eigrp == NULL) { - vty_outln (vty, " EIGRP Routing Process not enabled"); + vty_out (vty, " EIGRP Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -737,7 +737,7 @@ DEFUN (no_eigrp_if_ip_hellointerval, eigrp = eigrp_lookup (); if (eigrp == NULL) { - vty_outln (vty, " EIGRP Routing Process not enabled"); + vty_out (vty, " EIGRP Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -771,7 +771,7 @@ DEFUN (eigrp_if_ip_holdinterval, eigrp = eigrp_lookup (); if (eigrp == NULL) { - vty_outln (vty, " EIGRP Routing Process not enabled"); + vty_out (vty, " EIGRP Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -798,7 +798,7 @@ DEFUN (eigrp_ip_summary_address, eigrp = eigrp_lookup (); if (eigrp == NULL) { - vty_outln (vty, " EIGRP Routing Process not enabled"); + vty_out (vty, " EIGRP Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -826,7 +826,7 @@ DEFUN (no_eigrp_ip_summary_address, eigrp = eigrp_lookup (); if (eigrp == NULL) { - vty_outln (vty, " EIGRP Routing Process not enabled"); + vty_out (vty, " EIGRP Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -852,7 +852,7 @@ DEFUN (no_eigrp_if_ip_holdinterval, eigrp = eigrp_lookup (); if (eigrp == NULL) { - vty_outln (vty, " EIGRP Routing Process not enabled"); + vty_out (vty, " EIGRP Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -899,7 +899,7 @@ DEFUN (eigrp_authentication_mode, eigrp = eigrp_lookup (); if (eigrp == NULL) { - vty_outln (vty, " EIGRP Routing Process not enabled"); + vty_out (vty, " EIGRP Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -929,7 +929,7 @@ DEFUN (no_eigrp_authentication_mode, eigrp = eigrp_lookup (); if (eigrp == NULL) { - vty_outln (vty, " EIGRP Routing Process not enabled"); + vty_out (vty, " EIGRP Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -955,7 +955,7 @@ DEFUN (eigrp_authentication_keychain, eigrp = eigrp_lookup (); if (eigrp == NULL) { - vty_outln (vty, "EIGRP Routing Process not enabled"); + vty_out (vty, "EIGRP Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -971,7 +971,7 @@ DEFUN (eigrp_authentication_keychain, IF_DEF_PARAMS (ifp)->auth_keychain = strdup(keychain->name); } else - vty_outln (vty,"Key chain with specified name not found"); + vty_out (vty,"Key chain with specified name not found\n"); return CMD_SUCCESS; } @@ -993,7 +993,7 @@ DEFUN (no_eigrp_authentication_keychain, eigrp = eigrp_lookup (); if (eigrp == NULL) { - vty_outln (vty, "EIGRP Routing Process not enabled"); + vty_out (vty, "EIGRP Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -1004,8 +1004,8 @@ DEFUN (no_eigrp_authentication_keychain, IF_DEF_PARAMS (ifp)->auth_keychain = NULL; } else - vty_outln (vty, - "Key chain with specified name not configured on interface"); + vty_out (vty, + "Key chain with specified name not configured on interface\n"); return CMD_SUCCESS; } @@ -1080,7 +1080,7 @@ DEFUN (eigrp_variance, eigrp = eigrp_lookup (); if (eigrp == NULL) { - vty_outln (vty, "EIGRP Routing Process not enabled"); + vty_out (vty, "EIGRP Routing Process not enabled\n"); return CMD_SUCCESS; } variance = atoi(argv[1]->arg); @@ -1103,7 +1103,7 @@ DEFUN (no_eigrp_variance, eigrp = eigrp_lookup (); if (eigrp == NULL) { - vty_outln (vty, "EIGRP Routing Process not enabled"); + vty_out (vty, "EIGRP Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -1126,7 +1126,7 @@ DEFUN (eigrp_maximum_paths, eigrp = eigrp_lookup (); if (eigrp == NULL) { - vty_outln (vty, "EIGRP Routing Process not enabled"); + vty_out (vty, "EIGRP Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -1151,7 +1151,7 @@ DEFUN (no_eigrp_maximum_paths, eigrp = eigrp_lookup (); if (eigrp == NULL) { - vty_outln (vty, "EIGRP Routing Process not enabled"); + vty_out (vty, "EIGRP Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -1182,7 +1182,7 @@ DEFUN (clear_ip_eigrp_neighbors, eigrp = eigrp_lookup (); if (eigrp == NULL) { - vty_outln (vty, " EIGRP Routing Process not enabled"); + vty_out (vty, " EIGRP Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -1201,7 +1201,7 @@ DEFUN (clear_ip_eigrp_neighbors, inet_ntoa (nbr->src), ifindex2ifname (nbr->ei->ifp->ifindex, VRF_DEFAULT)); vty_time_print (vty, 0); - vty_outln (vty, "Neighbor %s (%s) is down: manually cleared", + vty_out (vty, "Neighbor %s (%s) is down: manually cleared\n", inet_ntoa (nbr->src), ifindex2ifname(nbr->ei->ifp->ifindex, VRF_DEFAULT)); @@ -1238,7 +1238,7 @@ DEFUN (clear_ip_eigrp_neighbors_int, eigrp = eigrp_lookup (); if (eigrp == NULL) { - vty_outln (vty, " EIGRP Routing Process not enabled"); + vty_out (vty, " EIGRP Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -1247,7 +1247,7 @@ DEFUN (clear_ip_eigrp_neighbors_int, ei = eigrp_if_lookup_by_name(eigrp, argv[idx]->arg); if(ei == NULL) { - vty_outln (vty, " Interface (%s) doesn't exist", argv[idx]->arg); + vty_out (vty, " Interface (%s) doesn't exist\n", argv[idx]->arg); return CMD_WARNING; } @@ -1263,7 +1263,7 @@ DEFUN (clear_ip_eigrp_neighbors_int, inet_ntoa (nbr->src), ifindex2ifname (nbr->ei->ifp->ifindex, VRF_DEFAULT)); vty_time_print (vty, 0); - vty_outln (vty, "Neighbor %s (%s) is down: manually cleared", + vty_out (vty, "Neighbor %s (%s) is down: manually cleared\n", inet_ntoa (nbr->src), ifindex2ifname(nbr->ei->ifp->ifindex, VRF_DEFAULT)); @@ -1299,7 +1299,7 @@ DEFUN (clear_ip_eigrp_neighbors_IP, eigrp = eigrp_lookup (); if (eigrp == NULL) { - vty_outln (vty, " EIGRP Routing Process not enabled"); + vty_out (vty, " EIGRP Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -1309,7 +1309,7 @@ DEFUN (clear_ip_eigrp_neighbors_IP, /* if neighbor doesn't exists, notify user and exit */ if(nbr == NULL) { - vty_outln (vty, "Neighbor with entered address doesn't exists."); + vty_out (vty, "Neighbor with entered address doesn't exists.\n"); return CMD_WARNING; } @@ -1337,7 +1337,7 @@ DEFUN (clear_ip_eigrp_neighbors_soft, eigrp = eigrp_lookup (); if (eigrp == NULL) { - vty_outln (vty, " EIGRP Routing Process not enabled"); + vty_out (vty, " EIGRP Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -1367,7 +1367,7 @@ DEFUN (clear_ip_eigrp_neighbors_int_soft, eigrp = eigrp_lookup (); if (eigrp == NULL) { - vty_outln (vty, " EIGRP Routing Process not enabled"); + vty_out (vty, " EIGRP Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -1375,7 +1375,7 @@ DEFUN (clear_ip_eigrp_neighbors_int_soft, ei = eigrp_if_lookup_by_name(eigrp, argv[4]->arg); if(ei == NULL) { - vty_outln (vty, " Interface (%s) doesn't exist", argv[4]->arg); + vty_out (vty, " Interface (%s) doesn't exist\n", argv[4]->arg); return CMD_WARNING; } @@ -1407,7 +1407,7 @@ DEFUN (clear_ip_eigrp_neighbors_IP_soft, eigrp = eigrp_lookup (); if (eigrp == NULL) { - vty_outln (vty, " EIGRP Routing Process not enabled"); + vty_out (vty, " EIGRP Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -1417,7 +1417,7 @@ DEFUN (clear_ip_eigrp_neighbors_IP_soft, /* if neighbor doesn't exists, notify user and exit */ if(nbr == NULL) { - vty_outln (vty, "Neighbor with entered address doesn't exists."); + vty_out (vty, "Neighbor with entered address doesn't exists.\n"); return CMD_WARNING; } diff --git a/isisd/isis_adjacency.c b/isisd/isis_adjacency.c index efe5e6721..e4a4e0c42 100644 --- a/isisd/isis_adjacency.c +++ b/isisd/isis_adjacency.c @@ -402,13 +402,13 @@ isis_adj_print_vty (struct isis_adjacency *adj, struct vty *vty, char detail) else vty_out (vty, "- "); vty_out (vty, "%-10s", snpa_print (adj->snpa)); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } if (detail == ISIS_UI_LEVEL_DETAIL) { level = adj->level; - vty_out (vty, VTYNL); + vty_out (vty, "\n"); if (adj->circuit) vty_out (vty, " Interface: %s", adj->circuit->interface->name); else @@ -421,18 +421,18 @@ isis_adj_print_vty (struct isis_adjacency *adj, struct vty *vty, char detail) time2string (adj->last_upd + adj->hold_time - now)); else vty_out (vty, ", Expires in %s", time2string (adj->hold_time)); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); vty_out (vty, " Adjacency flaps: %u", adj->flaps); vty_out (vty, ", Last: %s ago", time2string (now - adj->last_flap)); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); vty_out (vty, " Circuit type: %s", circuit_t2string (adj->circuit_t)); vty_out (vty, ", Speaks: %s", nlpid2string (&adj->nlpids)); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); if (adj->mt_count != 1 || adj->mt_set[0] != ISIS_MT_IPV4_UNICAST) { - vty_outln (vty, " Topologies:"); + vty_out (vty, " Topologies:\n"); for (unsigned int i = 0; i < adj->mt_count; i++) - vty_outln (vty, " %s", isis_mtid2str(adj->mt_set[i])); + vty_out (vty, " %s\n", isis_mtid2str(adj->mt_set[i])); } vty_out (vty, " SNPA: %s", snpa_print (adj->snpa)); if (adj->circuit && (adj->circuit->circ_type == CIRCUIT_T_BROADCAST)) @@ -445,7 +445,7 @@ isis_adj_print_vty (struct isis_adjacency *adj, struct vty *vty, char detail) vty_out (vty, ", LAN id: %s.%02x", sysid_print (adj->lanid), adj->lanid[ISIS_SYS_ID_LEN]); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); vty_out (vty, " LAN Priority: %u", adj->prio[adj->level - 1]); vty_out (vty, ", %s, DIS flaps: %u, Last: %s ago", @@ -455,32 +455,32 @@ isis_adj_print_vty (struct isis_adjacency *adj, struct vty *vty, char detail) (adj->dis_record[ISIS_LEVELS + level - 1]. last_dis_change))); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); if (adj->area_addrs && listcount (adj->area_addrs) > 0) { struct area_addr *area_addr; - vty_outln (vty, " Area Address(es):"); + vty_out (vty, " Area Address(es):\n"); for (ALL_LIST_ELEMENTS_RO (adj->area_addrs, node, area_addr)) - vty_outln (vty, " %s", + vty_out (vty, " %s\n", isonet_print(area_addr->area_addr, area_addr->addr_len)); } if (adj->ipv4_addrs && listcount (adj->ipv4_addrs) > 0) { - vty_outln (vty, " IPv4 Address(es):"); + vty_out (vty, " IPv4 Address(es):\n"); for (ALL_LIST_ELEMENTS_RO (adj->ipv4_addrs, node, ip_addr)) - vty_outln (vty, " %s", inet_ntoa(*ip_addr)); + vty_out (vty, " %s\n", inet_ntoa(*ip_addr)); } if (adj->ipv6_addrs && listcount (adj->ipv6_addrs) > 0) { - vty_outln (vty, " IPv6 Address(es):"); + vty_out (vty, " IPv6 Address(es):\n"); for (ALL_LIST_ELEMENTS_RO (adj->ipv6_addrs, node, ipv6_addr)) { inet_ntop (AF_INET6, ipv6_addr, (char *)ip6, INET6_ADDRSTRLEN); - vty_outln (vty, " %s", ip6); + vty_out (vty, " %s\n", ip6); } } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } return; } diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c index 73affa91d..d07ea27c4 100644 --- a/isisd/isis_circuit.c +++ b/isisd/isis_circuit.c @@ -878,7 +878,7 @@ isis_circuit_print_vty (struct isis_circuit *circuit, struct vty *vty, vty_out (vty, "%-9s", circuit_state2string (circuit->state)); vty_out (vty, "%-9s", circuit_type2string (circuit->circ_type)); vty_out (vty, "%-9s", circuit_t2string (circuit->is_type)); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } if (detail == ISIS_UI_LEVEL_DETAIL) @@ -894,15 +894,15 @@ isis_circuit_print_vty (struct isis_circuit *circuit, struct vty *vty, else vty_out (vty, ", Active"); vty_out (vty, ", Circuit Id: 0x%x", circuit->circuit_id); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); vty_out (vty, " Type: %s", circuit_type2string (circuit->circ_type)); vty_out (vty, ", Level: %s", circuit_t2string (circuit->is_type)); if (circuit->circ_type == CIRCUIT_T_BROADCAST) vty_out (vty, ", SNPA: %-10s", snpa_print (circuit->u.bc.snpa)); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); if (circuit->is_type & IS_LEVEL_1) { - vty_outln (vty, " Level-1 Information:"); + vty_out (vty, " Level-1 Information:\n"); if (circuit->area->newmetric) vty_out (vty, " Metric: %d", circuit->te_metric[0]); else @@ -910,30 +910,30 @@ isis_circuit_print_vty (struct isis_circuit *circuit, struct vty *vty, circuit->metric[0]); if (!circuit->is_passive) { - vty_outln (vty, ", Active neighbors: %u", + vty_out (vty, ", Active neighbors: %u\n", circuit->upadjcount[0]); - vty_outln (vty, " Hello interval: %u, " - "Holddown count: %u %s", + vty_out (vty, " Hello interval: %u, " + "Holddown count: %u %s\n", circuit->hello_interval[0], circuit->hello_multiplier[0], (circuit->pad_hellos ? "(pad)" : "(no-pad)")); - vty_outln (vty, " CNSP interval: %u, " - "PSNP interval: %u", + vty_out (vty, " CNSP interval: %u, " + "PSNP interval: %u\n", circuit->csnp_interval[0], circuit->psnp_interval[0]); if (circuit->circ_type == CIRCUIT_T_BROADCAST) - vty_outln (vty, " LAN Priority: %u, %s", + vty_out (vty, " LAN Priority: %u, %s\n", circuit->priority[0], (circuit->u.bc.is_dr[0] ? "is DIS" : "is not DIS")); } else { - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } if (circuit->is_type & IS_LEVEL_2) { - vty_outln (vty, " Level-2 Information:"); + vty_out (vty, " Level-2 Information:\n"); if (circuit->area->newmetric) vty_out (vty, " Metric: %d", circuit->te_metric[1]); else @@ -941,56 +941,56 @@ isis_circuit_print_vty (struct isis_circuit *circuit, struct vty *vty, circuit->metric[1]); if (!circuit->is_passive) { - vty_outln (vty, ", Active neighbors: %u", + vty_out (vty, ", Active neighbors: %u\n", circuit->upadjcount[1]); - vty_outln (vty, " Hello interval: %u, " - "Holddown count: %u %s", + vty_out (vty, " Hello interval: %u, " + "Holddown count: %u %s\n", circuit->hello_interval[1], circuit->hello_multiplier[1], (circuit->pad_hellos ? "(pad)" : "(no-pad)")); - vty_outln (vty, " CNSP interval: %u, " - "PSNP interval: %u", + vty_out (vty, " CNSP interval: %u, " + "PSNP interval: %u\n", circuit->csnp_interval[1], circuit->psnp_interval[1]); if (circuit->circ_type == CIRCUIT_T_BROADCAST) - vty_outln (vty, " LAN Priority: %u, %s", + vty_out (vty, " LAN Priority: %u, %s\n", circuit->priority[1], (circuit->u.bc.is_dr[1] ? "is DIS" : "is not DIS")); } else { - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } if (circuit->ip_addrs && listcount (circuit->ip_addrs) > 0) { - vty_outln (vty, " IP Prefix(es):"); + vty_out (vty, " IP Prefix(es):\n"); for (ALL_LIST_ELEMENTS_RO (circuit->ip_addrs, node, ip_addr)) { prefix2str (ip_addr, buf, sizeof (buf)), - vty_outln (vty, " %s", buf); + vty_out (vty, " %s\n", buf); } } if (circuit->ipv6_link && listcount(circuit->ipv6_link) > 0) { - vty_outln (vty, " IPv6 Link-Locals:"); + vty_out (vty, " IPv6 Link-Locals:\n"); for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_link, node, ip_addr)) { prefix2str(ip_addr, (char*)buf, BUFSIZ), - vty_outln (vty, " %s", buf); + vty_out (vty, " %s\n", buf); } } if (circuit->ipv6_non_link && listcount(circuit->ipv6_non_link) > 0) { - vty_outln (vty, " IPv6 Prefixes:"); + vty_out (vty, " IPv6 Prefixes:\n"); for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_non_link, node, ip_addr)) { prefix2str(ip_addr, (char*)buf, BUFSIZ), - vty_outln (vty, " %s", buf); + vty_out (vty, " %s\n", buf); } } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } return; } @@ -1011,12 +1011,12 @@ isis_interface_config_write (struct vty *vty) continue; /* IF name */ - vty_outln (vty, "interface %s", ifp->name); + vty_out (vty, "interface %s\n", ifp->name); write++; /* IF desc */ if (ifp->desc) { - vty_outln (vty, " description %s", ifp->desc); + vty_out (vty, " description %s\n", ifp->desc); write++; } /* ISIS Circuit */ @@ -1027,36 +1027,36 @@ isis_interface_config_write (struct vty *vty) continue; if (circuit->ip_router) { - vty_outln (vty, " ip router isis %s",area->area_tag); + vty_out (vty, " ip router isis %s\n",area->area_tag); write++; } if (circuit->is_passive) { - vty_outln (vty, " isis passive"); + vty_out (vty, " isis passive\n"); write++; } if (circuit->circ_type_config == CIRCUIT_T_P2P) { - vty_outln (vty, " isis network point-to-point"); + vty_out (vty, " isis network point-to-point\n"); write++; } if (circuit->ipv6_router) { - vty_outln (vty, " ipv6 router isis %s",area->area_tag); + vty_out (vty, " ipv6 router isis %s\n",area->area_tag); write++; } /* ISIS - circuit type */ if (circuit->is_type == IS_LEVEL_1) { - vty_outln (vty, " isis circuit-type level-1"); + vty_out (vty, " isis circuit-type level-1\n"); write++; } else { if (circuit->is_type == IS_LEVEL_2) { - vty_outln (vty," isis circuit-type level-2-only"); + vty_out (vty," isis circuit-type level-2-only\n"); write++; } } @@ -1066,7 +1066,7 @@ isis_interface_config_write (struct vty *vty) { if (circuit->csnp_interval[0] != DEFAULT_CSNP_INTERVAL) { - vty_outln (vty, " isis csnp-interval %d", + vty_out (vty, " isis csnp-interval %d\n", circuit->csnp_interval[0]); write++; } @@ -1077,7 +1077,7 @@ isis_interface_config_write (struct vty *vty) { if (circuit->csnp_interval[i] != DEFAULT_CSNP_INTERVAL) { - vty_outln (vty, " isis csnp-interval %d level-%d", + vty_out (vty, " isis csnp-interval %d level-%d\n", circuit->csnp_interval[i], i + 1); write++; } @@ -1089,7 +1089,7 @@ isis_interface_config_write (struct vty *vty) { if (circuit->psnp_interval[0] != DEFAULT_PSNP_INTERVAL) { - vty_outln (vty, " isis psnp-interval %d", + vty_out (vty, " isis psnp-interval %d\n", circuit->psnp_interval[0]); write++; } @@ -1100,7 +1100,7 @@ isis_interface_config_write (struct vty *vty) { if (circuit->psnp_interval[i] != DEFAULT_PSNP_INTERVAL) { - vty_outln (vty, " isis psnp-interval %d level-%d", + vty_out (vty, " isis psnp-interval %d level-%d\n", circuit->psnp_interval[i], i + 1); write++; } @@ -1110,7 +1110,7 @@ isis_interface_config_write (struct vty *vty) /* ISIS - Hello padding - Defaults to true so only display if false */ if (circuit->pad_hellos == 0) { - vty_outln (vty, " no isis hello padding"); + vty_out (vty, " no isis hello padding\n"); write++; } @@ -1119,7 +1119,7 @@ isis_interface_config_write (struct vty *vty) { if (circuit->hello_interval[0] != DEFAULT_HELLO_INTERVAL) { - vty_outln (vty, " isis hello-interval %d", + vty_out (vty, " isis hello-interval %d\n", circuit->hello_interval[0]); write++; } @@ -1130,7 +1130,7 @@ isis_interface_config_write (struct vty *vty) { if (circuit->hello_interval[i] != DEFAULT_HELLO_INTERVAL) { - vty_outln (vty, " isis hello-interval %d level-%d", + vty_out (vty, " isis hello-interval %d level-%d\n", circuit->hello_interval[i], i + 1); write++; } @@ -1142,7 +1142,7 @@ isis_interface_config_write (struct vty *vty) { if (circuit->hello_multiplier[0] != DEFAULT_HELLO_MULTIPLIER) { - vty_outln (vty, " isis hello-multiplier %d", + vty_out (vty, " isis hello-multiplier %d\n", circuit->hello_multiplier[0]); write++; } @@ -1153,7 +1153,7 @@ isis_interface_config_write (struct vty *vty) { if (circuit->hello_multiplier[i] != DEFAULT_HELLO_MULTIPLIER) { - vty_outln (vty, " isis hello-multiplier %d level-%d", + vty_out (vty, " isis hello-multiplier %d level-%d\n", circuit->hello_multiplier[i],i + 1); write++; } @@ -1165,7 +1165,7 @@ isis_interface_config_write (struct vty *vty) { if (circuit->priority[0] != DEFAULT_PRIORITY) { - vty_outln (vty, " isis priority %d", + vty_out (vty, " isis priority %d\n", circuit->priority[0]); write++; } @@ -1176,7 +1176,7 @@ isis_interface_config_write (struct vty *vty) { if (circuit->priority[i] != DEFAULT_PRIORITY) { - vty_outln (vty, " isis priority %d level-%d", + vty_out (vty, " isis priority %d level-%d\n", circuit->priority[i], i + 1); write++; } @@ -1188,7 +1188,7 @@ isis_interface_config_write (struct vty *vty) { if (circuit->te_metric[0] != DEFAULT_CIRCUIT_METRIC) { - vty_outln (vty, " isis metric %d",circuit->te_metric[0]); + vty_out (vty, " isis metric %d\n",circuit->te_metric[0]); write++; } } @@ -1198,7 +1198,7 @@ isis_interface_config_write (struct vty *vty) { if (circuit->te_metric[i] != DEFAULT_CIRCUIT_METRIC) { - vty_outln (vty, " isis metric %d level-%d", + vty_out (vty, " isis metric %d level-%d\n", circuit->te_metric[i], i + 1); write++; } @@ -1206,19 +1206,19 @@ isis_interface_config_write (struct vty *vty) } if (circuit->passwd.type == ISIS_PASSWD_TYPE_HMAC_MD5) { - vty_outln (vty, " isis password md5 %s", + vty_out (vty, " isis password md5 %s\n", circuit->passwd.passwd); write++; } else if (circuit->passwd.type == ISIS_PASSWD_TYPE_CLEARTXT) { - vty_outln (vty, " isis password clear %s", + vty_out (vty, " isis password clear %s\n", circuit->passwd.passwd); write++; } write += circuit_write_mt_settings(circuit, vty); } - vty_outln (vty, "!"); + vty_out (vty, "!\n"); } return write; diff --git a/isisd/isis_dynhn.c b/isisd/isis_dynhn.c index e124bb467..35d573d30 100644 --- a/isisd/isis_dynhn.c +++ b/isisd/isis_dynhn.c @@ -159,13 +159,13 @@ dynhn_print_all (struct vty *vty) struct listnode *node; struct isis_dynhn *dyn; - vty_outln (vty, "Level System ID Dynamic Hostname"); + vty_out (vty, "Level System ID Dynamic Hostname\n"); for (ALL_LIST_ELEMENTS_RO (dyn_cache, node, dyn)) { vty_out (vty, "%-7d", dyn->level); - vty_outln (vty, "%-15s%-15s", sysid_print (dyn->id),dyn->name.name); + vty_out (vty, "%-15s%-15s\n", sysid_print (dyn->id),dyn->name.name); } - vty_outln (vty, " * %s %s", sysid_print (isis->sysid),unix_hostname()); + vty_out (vty, " * %s %s\n", sysid_print (isis->sysid),unix_hostname()); return; } diff --git a/isisd/isis_lsp.c b/isisd/isis_lsp.c index d0c4ccc30..ed376058b 100644 --- a/isisd/isis_lsp.c +++ b/isisd/isis_lsp.c @@ -824,7 +824,7 @@ lsp_print (struct isis_lsp *lsp, struct vty *vty, char dynhost) } else vty_out (vty, " %5u ", ntohs (lsp->lsp_header->rem_lifetime)); - vty_outln (vty, "%s", + vty_out (vty, "%s\n", lsp_bits2string(&lsp->lsp_header->lsp_bits)); } @@ -842,12 +842,12 @@ lsp_print_mt_reach(struct list *list, struct vty *vty, lspid_print(neigh->neigh_id, lspid, dynhost, 0); if (mtid == ISIS_MT_IPV4_UNICAST) { - vty_outln(vty, " Metric : %-8u IS-Extended : %s", + vty_out(vty, " Metric : %-8u IS-Extended : %s\n", GET_TE_METRIC(neigh), lspid); } else { - vty_outln(vty, " Metric : %-8u MT-Reach : %s %s", + vty_out(vty, " Metric : %-8u MT-Reach : %s %s\n", GET_TE_METRIC(neigh), lspid, isis_mtid2str(mtid)); } @@ -874,11 +874,11 @@ lsp_print_mt_ipv6_reach(struct list *list, struct vty *vty, uint16_t mtid) { if ((ipv6_reach->control_info & CTRL_INFO_DISTRIBUTION) == DISTRIBUTION_INTERNAL) - vty_outln (vty, " Metric : %-8" PRIu32 " IPv6-Internal : %s/%d", + vty_out (vty, " Metric : %-8" PRIu32 " IPv6-Internal : %s/%d\n", ntohl (ipv6_reach->metric), buff, ipv6_reach->prefix_len); else - vty_outln (vty, " Metric : %-8" PRIu32 " IPv6-External : %s/%d", + vty_out (vty, " Metric : %-8" PRIu32 " IPv6-External : %s/%d\n", ntohl (ipv6_reach->metric), buff, ipv6_reach->prefix_len); } @@ -886,12 +886,12 @@ lsp_print_mt_ipv6_reach(struct list *list, struct vty *vty, uint16_t mtid) { if ((ipv6_reach->control_info & CTRL_INFO_DISTRIBUTION) == DISTRIBUTION_INTERNAL) - vty_outln (vty, " Metric : %-8" PRIu32 " IPv6-MT-Int : %s/%d %s", + vty_out (vty, " Metric : %-8" PRIu32 " IPv6-MT-Int : %s/%d %s\n", ntohl (ipv6_reach->metric), buff, ipv6_reach->prefix_len, isis_mtid2str(mtid)); else - vty_outln (vty, " Metric : %-8" PRIu32 " IPv6-MT-Ext : %s/%d %s", + vty_out (vty, " Metric : %-8" PRIu32 " IPv6-MT-Ext : %s/%d %s\n", ntohl (ipv6_reach->metric), buff, ipv6_reach->prefix_len, isis_mtid2str(mtid)); @@ -910,7 +910,7 @@ lsp_print_mt_ipv4_reach(struct list *list, struct vty *vty, uint16_t mtid) if (mtid == ISIS_MT_IPV4_UNICAST) { /* FIXME: There should be better way to output this stuff. */ - vty_outln (vty, " Metric : %-8" PRIu32 " IPv4-Extended : %s/%d", + vty_out (vty, " Metric : %-8" PRIu32 " IPv4-Extended : %s/%d\n", ntohl (te_ipv4_reach->te_metric), inet_ntoa (newprefix2inaddr (&te_ipv4_reach->prefix_start, te_ipv4_reach->control)), @@ -919,7 +919,7 @@ lsp_print_mt_ipv4_reach(struct list *list, struct vty *vty, uint16_t mtid) else { /* FIXME: There should be better way to output this stuff. */ - vty_outln (vty, " Metric : %-8" PRIu32 " IPv4-MT : %s/%d %s", + vty_out (vty, " Metric : %-8" PRIu32 " IPv4-MT : %s/%d %s\n", ntohl (te_ipv4_reach->te_metric), inet_ntoa (newprefix2inaddr (&te_ipv4_reach->prefix_start, te_ipv4_reach->control)), @@ -955,7 +955,7 @@ lsp_print_detail (struct isis_lsp *lsp, struct vty *vty, char dynhost) if (lsp->tlv_data.area_addrs) for (ALL_LIST_ELEMENTS_RO (lsp->tlv_data.area_addrs, lnode, area_addr)) { - vty_outln (vty, " Area Address: %s", + vty_out (vty, " Area Address: %s\n", isonet_print(area_addr->area_addr, area_addr->addr_len)); } @@ -968,11 +968,11 @@ lsp_print_detail (struct isis_lsp *lsp, struct vty *vty, char dynhost) { case NLPID_IP: case NLPID_IPV6: - vty_outln (vty, " NLPID : 0x%X", + vty_out (vty, " NLPID : 0x%X\n", lsp->tlv_data.nlpids->nlpids[i]); break; default: - vty_outln (vty, " NLPID : %s", "unknown"); + vty_out (vty, " NLPID : %s\n", "unknown"); break; } } @@ -980,7 +980,7 @@ lsp_print_detail (struct isis_lsp *lsp, struct vty *vty, char dynhost) for (ALL_LIST_ELEMENTS_RO(lsp->tlv_data.mt_router_info, lnode, mt_router_info)) { - vty_outln (vty, " MT : %s%s", + vty_out (vty, " MT : %s%s\n", isis_mtid2str(mt_router_info->mtid), mt_router_info->overload ? " (overload)" : ""); } @@ -991,16 +991,16 @@ lsp_print_detail (struct isis_lsp *lsp, struct vty *vty, char dynhost) bzero (hostname, sizeof (hostname)); memcpy (hostname, lsp->tlv_data.hostname->name, lsp->tlv_data.hostname->namelen); - vty_outln (vty, " Hostname : %s", hostname); + vty_out (vty, " Hostname : %s\n", hostname); } /* authentication tlv */ if (lsp->tlv_data.auth_info.type != ISIS_PASSWD_TYPE_UNUSED) { if (lsp->tlv_data.auth_info.type == ISIS_PASSWD_TYPE_HMAC_MD5) - vty_outln (vty, " Auth type : md5"); + vty_out (vty, " Auth type : md5\n"); else if (lsp->tlv_data.auth_info.type == ISIS_PASSWD_TYPE_CLEARTXT) - vty_outln (vty, " Auth type : clear text"); + vty_out (vty, " Auth type : clear text\n"); } /* TE router id */ @@ -1008,14 +1008,14 @@ lsp_print_detail (struct isis_lsp *lsp, struct vty *vty, char dynhost) { memcpy (ipv4_address, inet_ntoa (lsp->tlv_data.router_id->id), sizeof (ipv4_address)); - vty_outln (vty, " Router ID : %s", ipv4_address); + vty_out (vty, " Router ID : %s\n", ipv4_address); } if (lsp->tlv_data.ipv4_addrs) for (ALL_LIST_ELEMENTS_RO (lsp->tlv_data.ipv4_addrs, lnode, ipv4_addr)) { memcpy (ipv4_address, inet_ntoa (*ipv4_addr), sizeof (ipv4_address)); - vty_outln (vty, " IPv4 Address: %s", ipv4_address); + vty_out (vty, " IPv4 Address: %s\n", ipv4_address); } /* for the IS neighbor tlv */ @@ -1023,7 +1023,7 @@ lsp_print_detail (struct isis_lsp *lsp, struct vty *vty, char dynhost) for (ALL_LIST_ELEMENTS_RO (lsp->tlv_data.is_neighs, lnode, is_neigh)) { lspid_print (is_neigh->neigh_id, LSPid, dynhost, 0); - vty_outln (vty, " Metric : %-8" PRIu8 " IS : %s", + vty_out (vty, " Metric : %-8" PRIu8 " IS : %s\n", is_neigh->metrics.metric_default, LSPid); } @@ -1036,7 +1036,7 @@ lsp_print_detail (struct isis_lsp *lsp, struct vty *vty, char dynhost) sizeof (ipv4_reach_prefix)); memcpy (ipv4_reach_mask, inet_ntoa (ipv4_reach->mask), sizeof (ipv4_reach_mask)); - vty_outln (vty, " Metric : %-8" PRIu8 " IPv4-Internal : %s %s", + vty_out (vty, " Metric : %-8" PRIu8 " IPv4-Internal : %s %s\n", ipv4_reach->metrics.metric_default, ipv4_reach_prefix, ipv4_reach_mask); } @@ -1050,7 +1050,7 @@ lsp_print_detail (struct isis_lsp *lsp, struct vty *vty, char dynhost) sizeof (ipv4_reach_prefix)); memcpy (ipv4_reach_mask, inet_ntoa (ipv4_reach->mask), sizeof (ipv4_reach_mask)); - vty_outln (vty, " Metric : %-8" PRIu8 " IPv4-External : %s %s", + vty_out (vty, " Metric : %-8" PRIu8 " IPv4-External : %s %s\n", ipv4_reach->metrics.metric_default, ipv4_reach_prefix, ipv4_reach_mask); } @@ -1079,7 +1079,7 @@ lsp_print_detail (struct isis_lsp *lsp, struct vty *vty, char dynhost) for (ALL_LIST_ELEMENTS_RO (lsp->tlv_data.mt_ipv4_reachs, lnode, mt_ipv4_reachs)) lsp_print_mt_ipv4_reach(mt_ipv4_reachs->list, vty, mt_ipv4_reachs->mtid); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return; } diff --git a/isisd/isis_mt.c b/isisd/isis_mt.c index 9c3bc1fe6..26e02498b 100644 --- a/isisd/isis_mt.c +++ b/isisd/isis_mt.c @@ -193,7 +193,7 @@ area_write_mt_settings(struct isis_area *area, struct vty *vty) { if (setting->mtid == ISIS_MT_IPV4_UNICAST) continue; /* always enabled, no need to write out config */ - vty_outln (vty, " topology %s%s", name, + vty_out (vty, " topology %s%s\n", name, setting->overload ? " overload" : ""); written++; } @@ -325,7 +325,7 @@ circuit_write_mt_settings(struct isis_circuit *circuit, struct vty *vty) const char *name = isis_mtid2str(setting->mtid); if (name && !setting->enabled) { - vty_outln (vty, " no isis topology %s", name); + vty_out (vty, " no isis topology %s\n", name); written++; } } diff --git a/isisd/isis_redist.c b/isisd/isis_redist.c index a646933bb..b3f29fd20 100644 --- a/isisd/isis_redist.c +++ b/isisd/isis_redist.c @@ -600,7 +600,7 @@ DEFUN (isis_redistribute, if ((area->is_type & level) != level) { - vty_outln (vty, "Node is not a level-%d IS", level); + vty_out (vty, "Node is not a level-%d IS\n", level); return CMD_WARNING_CONFIG_FAILED; } @@ -702,7 +702,7 @@ DEFUN (isis_default_originate, if ((area->is_type & level) != level) { - vty_outln (vty, "Node is not a level-%d IS", level); + vty_out (vty, "Node is not a level-%d IS\n", level); return CMD_WARNING_CONFIG_FAILED; } @@ -722,9 +722,9 @@ DEFUN (isis_default_originate, if (family == AF_INET6 && originate_type != DEFAULT_ORIGINATE_ALWAYS) { - vty_outln (vty, - "Zebra doesn't implement default-originate for IPv6 yet"); - vty_outln (vty, "so use with care or use default-originate always."); + vty_out (vty, + "Zebra doesn't implement default-originate for IPv6 yet\n"); + vty_out (vty, "so use with care or use default-originate always.\n"); } isis_redist_set(area, level, family, DEFAULT_ROUTE, metric, routemap, originate_type); @@ -796,7 +796,7 @@ isis_redist_config_write(struct vty *vty, struct isis_area *area, vty_out(vty, " metric %u", redist->metric); if (redist->map_name) vty_out(vty, " route-map %s", redist->map_name); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); write++; } } @@ -814,7 +814,7 @@ isis_redist_config_write(struct vty *vty, struct isis_area *area, vty_out(vty, " metric %u", redist->metric); if (redist->map_name) vty_out(vty, " route-map %s", redist->map_name); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); write++; } diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c index f19c81336..4b5592c15 100644 --- a/isisd/isis_spf.c +++ b/isisd/isis_spf.c @@ -1321,8 +1321,8 @@ isis_print_paths (struct vty *vty, struct list *paths, u_char *root_sysid) struct isis_adjacency *adj; char buff[PREFIX2STR_BUFFER]; - vty_outln (vty, - "Vertex Type Metric " "Next-Hop Interface Parent"); + vty_out (vty, + "Vertex Type Metric Next-Hop Interface Parent\n"); for (ALL_LIST_ELEMENTS_RO (paths, node, vertex)) { if (memcmp (vertex->N.id, root_sysid, ISIS_SYS_ID_LEN) == 0) { @@ -1336,7 +1336,7 @@ isis_print_paths (struct vty *vty, struct list *paths, u_char *root_sysid) for (ALL_LIST_ELEMENTS_RO (vertex->Adj_N, anode, adj)) { if (adj) { if (rows) { - vty_out (vty, VTYNL); + vty_out (vty, "\n"); vty_out (vty, "%-20s %-12s %-6s ", "", "", ""); } vty_out (vty, "%-20s %-9s ", @@ -1356,7 +1356,7 @@ isis_print_paths (struct vty *vty, struct list *paths, u_char *root_sysid) int rows = 0; for (ALL_LIST_ELEMENTS_RO (vertex->parents, pnode, pvertex)) { if (rows) { - vty_out (vty, VTYNL); + vty_out (vty, "\n"); vty_out (vty, "%-72s", ""); } vty_out (vty, "%s(%d)", @@ -1367,7 +1367,7 @@ isis_print_paths (struct vty *vty, struct list *paths, u_char *root_sysid) vty_out (vty, " NULL "); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } @@ -1396,7 +1396,7 @@ DEFUN (show_isis_topology, for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area)) { - vty_outln (vty, "Area %s:",area->area_tag ? area->area_tag : "null"); + vty_out (vty, "Area %s:\n",area->area_tag ? area->area_tag : "null"); for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) { @@ -1406,23 +1406,23 @@ DEFUN (show_isis_topology, if (area->ip_circuits > 0 && area->spftree[level-1] && area->spftree[level-1]->paths->count > 0) { - vty_outln (vty, "IS-IS paths to level-%d routers that speak IP", + vty_out (vty, "IS-IS paths to level-%d routers that speak IP\n", level); isis_print_paths (vty, area->spftree[level-1]->paths, isis->sysid); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } if (area->ipv6_circuits > 0 && area->spftree6[level-1] && area->spftree6[level-1]->paths->count > 0) { - vty_outln (vty, - "IS-IS paths to level-%d routers that speak IPv6", + vty_out (vty, + "IS-IS paths to level-%d routers that speak IPv6\n", level); isis_print_paths (vty, area->spftree6[level-1]->paths, isis->sysid); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } return CMD_SUCCESS; diff --git a/isisd/isis_te.c b/isisd/isis_te.c index 53b56186f..271545744 100644 --- a/isisd/isis_te.c +++ b/isisd/isis_te.c @@ -685,7 +685,7 @@ show_vty_subtlv_admin_grp (struct vty *vty, struct te_subtlv_admin_grp *tlv) { if (vty != NULL) - vty_outln (vty, " Administrative Group: 0x%x", + vty_out (vty, " Administrative Group: 0x%x\n", (u_int32_t)ntohl(tlv->value)); else zlog_debug (" Administrative Group: 0x%x", @@ -699,8 +699,8 @@ show_vty_subtlv_llri (struct vty *vty, struct te_subtlv_llri *tlv) { if (vty != NULL) { - vty_outln (vty, " Link Local ID: %d",(u_int32_t)ntohl(tlv->local)); - vty_outln (vty, " Link Remote ID: %d", + vty_out (vty, " Link Local ID: %d\n",(u_int32_t)ntohl(tlv->local)); + vty_out (vty, " Link Remote ID: %d\n", (u_int32_t)ntohl(tlv->remote)); } else @@ -716,7 +716,7 @@ static u_char show_vty_subtlv_local_ipaddr (struct vty *vty, struct te_subtlv_local_ipaddr *tlv) { if (vty != NULL) - vty_outln (vty, " Local Interface IP Address(es): %s", + vty_out (vty, " Local Interface IP Address(es): %s\n", inet_ntoa(tlv->value)); else zlog_debug (" Local Interface IP Address(es): %s", inet_ntoa (tlv->value)); @@ -728,7 +728,7 @@ static u_char show_vty_subtlv_rmt_ipaddr (struct vty *vty, struct te_subtlv_rmt_ipaddr *tlv) { if (vty != NULL) - vty_outln (vty, " Remote Interface IP Address(es): %s", + vty_out (vty, " Remote Interface IP Address(es): %s\n", inet_ntoa(tlv->value)); else zlog_debug (" Remote Interface IP Address(es): %s", inet_ntoa (tlv->value)); @@ -744,7 +744,7 @@ show_vty_subtlv_max_bw (struct vty *vty, struct te_subtlv_max_bw *tlv) fval = ntohf (tlv->value); if (vty != NULL) - vty_outln (vty, " Maximum Bandwidth: %g (Bytes/sec)", fval); + vty_out (vty, " Maximum Bandwidth: %g (Bytes/sec)\n", fval); else zlog_debug (" Maximum Bandwidth: %g (Bytes/sec)", fval); @@ -759,7 +759,7 @@ show_vty_subtlv_max_rsv_bw (struct vty *vty, struct te_subtlv_max_rsv_bw *tlv) fval = ntohf (tlv->value); if (vty != NULL) - vty_outln (vty, " Maximum Reservable Bandwidth: %g (Bytes/sec)",fval); + vty_out (vty, " Maximum Reservable Bandwidth: %g (Bytes/sec)\n",fval); else zlog_debug (" Maximum Reservable Bandwidth: %g (Bytes/sec)", fval); @@ -773,7 +773,7 @@ show_vty_subtlv_unrsv_bw (struct vty *vty, struct te_subtlv_unrsv_bw *tlv) int i; if (vty != NULL) - vty_outln (vty, " Unreserved Bandwidth:"); + vty_out (vty, " Unreserved Bandwidth:\n"); else zlog_debug (" Unreserved Bandwidth:"); @@ -782,7 +782,7 @@ show_vty_subtlv_unrsv_bw (struct vty *vty, struct te_subtlv_unrsv_bw *tlv) fval1 = ntohf (tlv->value[i]); fval2 = ntohf (tlv->value[i+1]); if (vty != NULL) - vty_outln (vty, " [%d]: %g (Bytes/sec),\t[%d]: %g (Bytes/sec)", i, fval1, i+1, + vty_out (vty, " [%d]: %g (Bytes/sec),\t[%d]: %g (Bytes/sec)\n", i, fval1, i+1, fval2); else zlog_debug (" [%d]: %g (Bytes/sec),\t[%d]: %g (Bytes/sec)", i, fval1, i+1, fval2); @@ -798,7 +798,7 @@ show_vty_subtlv_te_metric (struct vty *vty, struct te_subtlv_te_metric *tlv) te_metric = tlv->value[2] | tlv->value[1] << 8 | tlv->value[0] << 16; if (vty != NULL) - vty_outln (vty, " Traffic Engineering Metric: %u", te_metric); + vty_out (vty, " Traffic Engineering Metric: %u\n", te_metric); else zlog_debug (" Traffic Engineering Metric: %u", te_metric); @@ -809,7 +809,7 @@ static u_char show_vty_subtlv_ras (struct vty *vty, struct te_subtlv_ras *tlv) { if (vty != NULL) - vty_outln (vty, " Inter-AS TE Remote AS number: %u", + vty_out (vty, " Inter-AS TE Remote AS number: %u\n", ntohl(tlv->value)); else zlog_debug (" Inter-AS TE Remote AS number: %u", ntohl (tlv->value)); @@ -821,7 +821,7 @@ static u_char show_vty_subtlv_rip (struct vty *vty, struct te_subtlv_rip *tlv) { if (vty != NULL) - vty_outln (vty, " Inter-AS TE Remote ASBR IP address: %s", + vty_out (vty, " Inter-AS TE Remote ASBR IP address: %s\n", inet_ntoa(tlv->value)); else zlog_debug (" Inter-AS TE Remote ASBR IP address: %s", inet_ntoa (tlv->value)); @@ -839,7 +839,7 @@ show_vty_subtlv_av_delay (struct vty *vty, struct te_subtlv_av_delay *tlv) A = (u_int32_t) ntohl (tlv->value) & TE_EXT_ANORMAL; if (vty != NULL) - vty_outln (vty, " %s Average Link Delay: %d (micro-sec)", A ? "Anomalous" : "Normal", + vty_out (vty, " %s Average Link Delay: %d (micro-sec)\n", A ? "Anomalous" : "Normal", delay); else zlog_debug (" %s Average Link Delay: %d (micro-sec)", A ? "Anomalous" : "Normal", delay); @@ -858,7 +858,7 @@ show_vty_subtlv_mm_delay (struct vty *vty, struct te_subtlv_mm_delay *tlv) high = (u_int32_t) ntohl (tlv->high) & TE_EXT_MASK; if (vty != NULL) - vty_outln (vty, " %s Min/Max Link Delay: %d / %d (micro-sec)", A ? "Anomalous" : "Normal", low, + vty_out (vty, " %s Min/Max Link Delay: %d / %d (micro-sec)\n", A ? "Anomalous" : "Normal", low, high); else zlog_debug (" %s Min/Max Link Delay: %d / %d (micro-sec)", A ? "Anomalous" : "Normal", low, high); @@ -874,7 +874,7 @@ show_vty_subtlv_delay_var (struct vty *vty, struct te_subtlv_delay_var *tlv) jitter = (u_int32_t) ntohl (tlv->value) & TE_EXT_MASK; if (vty != NULL) - vty_outln (vty, " Delay Variation: %d (micro-sec)", jitter); + vty_out (vty, " Delay Variation: %d (micro-sec)\n", jitter); else zlog_debug (" Delay Variation: %d (micro-sec)", jitter); @@ -893,7 +893,7 @@ show_vty_subtlv_pkt_loss (struct vty *vty, struct te_subtlv_pkt_loss *tlv) A = (u_int32_t) ntohl (tlv->value) & TE_EXT_ANORMAL; if (vty != NULL) - vty_outln (vty, " %s Link Packet Loss: %g (%%)", A ? "Anomalous" : "Normal", + vty_out (vty, " %s Link Packet Loss: %g (%%)\n", A ? "Anomalous" : "Normal", fval); else zlog_debug (" %s Link Packet Loss: %g (%%)", A ? "Anomalous" : "Normal", fval); @@ -909,7 +909,7 @@ show_vty_subtlv_res_bw (struct vty *vty, struct te_subtlv_res_bw *tlv) fval = ntohf(tlv->value); if (vty != NULL) - vty_outln (vty, " Unidirectional Residual Bandwidth: %g (Bytes/sec)", + vty_out (vty, " Unidirectional Residual Bandwidth: %g (Bytes/sec)\n", fval); else zlog_debug (" Unidirectional Residual Bandwidth: %g (Bytes/sec)", fval); @@ -925,7 +925,7 @@ show_vty_subtlv_ava_bw (struct vty *vty, struct te_subtlv_ava_bw *tlv) fval = ntohf (tlv->value); if (vty != NULL) - vty_outln (vty, " Unidirectional Available Bandwidth: %g (Bytes/sec)", + vty_out (vty, " Unidirectional Available Bandwidth: %g (Bytes/sec)\n", fval); else zlog_debug (" Unidirectional Available Bandwidth: %g (Bytes/sec)", fval); @@ -941,7 +941,7 @@ show_vty_subtlv_use_bw (struct vty *vty, struct te_subtlv_use_bw *tlv) fval = ntohf (tlv->value); if (vty != NULL) - vty_outln (vty, " Unidirectional Utilized Bandwidth: %g (Bytes/sec)", + vty_out (vty, " Unidirectional Utilized Bandwidth: %g (Bytes/sec)\n", fval); else zlog_debug (" Unidirectional Utilized Bandwidth: %g (Bytes/sec)", fval); @@ -959,7 +959,7 @@ show_vty_unknown_tlv (struct vty *vty, struct subtlv_header *tlvh) { if (tlvh->length != 0) { - vty_outln (vty, " Unknown TLV: [type(%#.2x), length(%#.2x)]", + vty_out (vty, " Unknown TLV: [type(%#.2x), length(%#.2x)]\n", tlvh->type, tlvh->length); vty_out(vty, " Dump: [00]"); rtn = 1; /* initialize end of line counter */ @@ -968,16 +968,16 @@ show_vty_unknown_tlv (struct vty *vty, struct subtlv_header *tlvh) vty_out (vty, " %#.2x", v[i]); if (rtn == 8) { - vty_out (vty, "%s [%.2x]", VTYNL, i + 1); + vty_out (vty, "\n [%.2x]", i + 1); rtn = 1; } else rtn++; } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } else - vty_outln (vty, " Unknown TLV: [type(%#.2x), length(%#.2x)]", + vty_out (vty, " Unknown TLV: [type(%#.2x), length(%#.2x)]\n", tlvh->type, tlvh->length); } else @@ -1069,8 +1069,8 @@ isis_mpls_te_config_write_router (struct vty *vty) { if (IS_MPLS_TE(isisMplsTE)) { - vty_outln (vty, " mpls-te on"); - vty_outln (vty, " mpls-te router-address %s", + vty_out (vty, " mpls-te on\n"); + vty_out (vty, " mpls-te router-address %s\n", inet_ntoa(isisMplsTE.router_id)); } @@ -1173,7 +1173,7 @@ DEFUN (isis_mpls_te_router_addr, if (! inet_aton (argv[idx_ipv4]->arg, &value)) { - vty_outln (vty, "Please specify Router-Addr by A.B.C.D"); + vty_out (vty, "Please specify Router-Addr by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1201,7 +1201,7 @@ DEFUN (isis_mpls_te_inter_as, "AREA native mode self originate INTER-AS LSP with L1 and L2 flooding scope)\n" "AS native mode self originate INTER-AS LSP with L2 only flooding scope\n") { - vty_outln (vty, "Not yet supported"); + vty_out (vty, "Not yet supported\n"); return CMD_SUCCESS; } @@ -1213,7 +1213,7 @@ DEFUN (no_isis_mpls_te_inter_as, "Disable MPLS-TE Inter-AS support\n") { - vty_outln (vty, "Not yet supported"); + vty_out (vty, "Not yet supported\n"); return CMD_SUCCESS; } @@ -1227,16 +1227,16 @@ DEFUN (show_isis_mpls_te_router, { if (IS_MPLS_TE(isisMplsTE)) { - vty_outln (vty, "--- MPLS-TE router parameters ---"); + vty_out (vty, "--- MPLS-TE router parameters ---\n"); if (ntohs (isisMplsTE.router_id.s_addr) != 0) - vty_outln (vty, " Router-Address: %s", + vty_out (vty, " Router-Address: %s\n", inet_ntoa(isisMplsTE.router_id)); else - vty_outln (vty, " N/A"); + vty_out (vty, " N/A\n"); } else - vty_outln (vty, " MPLS-TE is disable on this router"); + vty_out (vty, " MPLS-TE is disable on this router\n"); return CMD_SUCCESS; } @@ -1254,21 +1254,21 @@ show_mpls_te_sub (struct vty *vty, struct interface *ifp) { if (IS_INTER_AS(mtc->type)) { - vty_outln (vty, "-- Inter-AS TEv2 link parameters for %s --", + vty_out (vty, "-- Inter-AS TEv2 link parameters for %s --\n", ifp->name); } else { /* MPLS-TE is not activate on this interface */ /* or this interface is passive and Inter-AS TEv2 is not activate */ - vty_outln (vty, " %s: MPLS-TE is disabled on this interface", + vty_out (vty, " %s: MPLS-TE is disabled on this interface\n", ifp->name); return; } } else { - vty_outln (vty, "-- MPLS-TE link parameters for %s --", + vty_out (vty, "-- MPLS-TE link parameters for %s --\n", ifp->name); } @@ -1299,11 +1299,11 @@ show_mpls_te_sub (struct vty *vty, struct interface *ifp) show_vty_subtlv_res_bw (vty, &mtc->res_bw); show_vty_subtlv_ava_bw (vty, &mtc->ava_bw); show_vty_subtlv_use_bw (vty, &mtc->use_bw); - vty_outln (vty, "---------------%s", VTYNL); + vty_out (vty, "---------------\n\n"); } else { - vty_outln (vty, " %s: MPLS-TE is disabled on this interface", + vty_out (vty, " %s: MPLS-TE is disabled on this interface\n", ifp->name); } @@ -1333,7 +1333,7 @@ DEFUN (show_isis_mpls_te_interface, else { if ((ifp = if_lookup_by_name (argv[idx_interface]->arg, VRF_DEFAULT)) == NULL) - vty_outln (vty, "No such interface name"); + vty_out (vty, "No such interface name\n"); else show_mpls_te_sub (vty, ifp); } diff --git a/isisd/isis_vty.c b/isisd/isis_vty.c index 9fc1cb110..157962dad 100644 --- a/isisd/isis_vty.c +++ b/isisd/isis_vty.c @@ -40,14 +40,14 @@ isis_circuit_lookup (struct vty *vty) if (!ifp) { - vty_outln (vty, "Invalid interface "); + vty_out (vty, "Invalid interface \n"); return NULL; } circuit = circuit_scan_by_ifp (ifp); if (!circuit) { - vty_outln (vty, "ISIS is not enabled on circuit %s", + vty_out (vty, "ISIS is not enabled on circuit %s\n", ifp->name); return NULL; } @@ -77,7 +77,7 @@ DEFUN (ip_router_isis, { if (strcmp (circuit->area->area_tag, area_tag)) { - vty_outln (vty, "ISIS circuit is already defined on %s", + vty_out (vty, "ISIS circuit is already defined on %s\n", circuit->area->area_tag); return CMD_ERR_NOTHING_TODO; } @@ -92,7 +92,7 @@ DEFUN (ip_router_isis, if (circuit->state != C_STATE_CONF && circuit->state != C_STATE_UP) { - vty_outln (vty, "Couldn't bring up interface, please check log."); + vty_out (vty, "Couldn't bring up interface, please check log.\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -139,7 +139,7 @@ DEFUN (no_ip_router_isis, area = isis_area_lookup (area_tag); if (!area) { - vty_outln (vty, "Can't find ISIS instance %s", + vty_out (vty, "Can't find ISIS instance %s\n", argv[idx_afi]->arg); return CMD_ERR_NO_MATCH; } @@ -147,7 +147,7 @@ DEFUN (no_ip_router_isis, circuit = circuit_lookup_by_ifp (ifp, area->circuit_list); if (!circuit) { - vty_outln (vty, "ISIS is not enabled on circuit %s", + vty_out (vty, "ISIS is not enabled on circuit %s\n", ifp->name); return CMD_ERR_NO_MATCH; } @@ -189,7 +189,7 @@ DEFUN (no_isis_passive, if (if_is_loopback (circuit->interface)) { - vty_outln (vty,"Can't set no passive for loopback interface"); + vty_out (vty,"Can't set no passive for loopback interface\n"); return CMD_ERR_AMBIGUOUS; } @@ -215,7 +215,7 @@ DEFUN (isis_circuit_type, is_type = string2circuit_t (argv[idx_level]->arg); if (!is_type) { - vty_outln (vty, "Unknown circuit-type "); + vty_out (vty, "Unknown circuit-type \n"); return CMD_ERR_AMBIGUOUS; } @@ -223,7 +223,7 @@ DEFUN (isis_circuit_type, circuit->area->is_type != IS_LEVEL_1_AND_2 && circuit->area->is_type != is_type) { - vty_outln (vty, "Invalid circuit level for area %s.", + vty_out (vty, "Invalid circuit level for area %s.\n", circuit->area->area_tag); return CMD_ERR_AMBIGUOUS; } @@ -272,8 +272,8 @@ DEFUN (isis_network, if (isis_circuit_circ_type_set(circuit, CIRCUIT_T_P2P)) { - vty_outln (vty, - "isis network point-to-point " "is valid only on broadcast interfaces"); + vty_out (vty, + "isis network point-to-point is valid only on broadcast interfaces\n"); return CMD_ERR_AMBIGUOUS; } @@ -294,8 +294,8 @@ DEFUN (no_isis_network, if (isis_circuit_circ_type_set(circuit, CIRCUIT_T_BROADCAST)) { - vty_outln (vty, - "isis network point-to-point " "is valid only on broadcast interfaces"); + vty_out (vty, + "isis network point-to-point is valid only on broadcast interfaces\n"); return CMD_ERR_AMBIGUOUS; } @@ -324,7 +324,7 @@ DEFUN (isis_passwd, rv = isis_circuit_passwd_cleartext_set(circuit, argv[idx_word]->arg); if (rv) { - vty_outln (vty, "Too long circuit password (>254)"); + vty_out (vty, "Too long circuit password (>254)\n"); return CMD_ERR_AMBIGUOUS; } @@ -367,7 +367,7 @@ DEFUN (isis_priority, prio = atoi (argv[idx_number]->arg); if (prio < MIN_PRIORITY || prio > MAX_PRIORITY) { - vty_outln (vty, "Invalid priority %d - should be <0-127>", + vty_out (vty, "Invalid priority %d - should be <0-127>\n", prio); return CMD_ERR_AMBIGUOUS; } @@ -414,7 +414,7 @@ DEFUN (isis_priority_l1, prio = atoi (argv[idx_number]->arg); if (prio < MIN_PRIORITY || prio > MAX_PRIORITY) { - vty_outln (vty, "Invalid priority %d - should be <0-127>", + vty_out (vty, "Invalid priority %d - should be <0-127>\n", prio); return CMD_ERR_AMBIGUOUS; } @@ -460,7 +460,7 @@ DEFUN (isis_priority_l2, prio = atoi (argv[idx_number]->arg); if (prio < MIN_PRIORITY || prio > MAX_PRIORITY) { - vty_outln (vty, "Invalid priority %d - should be <0-127>", + vty_out (vty, "Invalid priority %d - should be <0-127>\n", prio); return CMD_ERR_AMBIGUOUS; } @@ -509,8 +509,8 @@ DEFUN (isis_metric, if (circuit->area && circuit->area->oldmetric == 1 && met > MAX_NARROW_LINK_METRIC) { - vty_outln (vty, "Invalid metric %d - should be <0-63> " - "when narrow metric type enabled", + vty_out (vty, "Invalid metric %d - should be <0-63> " + "when narrow metric type enabled\n", met); return CMD_ERR_AMBIGUOUS; } @@ -519,8 +519,8 @@ DEFUN (isis_metric, if (circuit->area && circuit->area->newmetric == 1 && met > MAX_WIDE_LINK_METRIC) { - vty_outln (vty, "Invalid metric %d - should be <0-16777215> " - "when wide metric type enabled", + vty_out (vty, "Invalid metric %d - should be <0-16777215> " + "when wide metric type enabled\n", met); return CMD_ERR_AMBIGUOUS; } @@ -569,8 +569,8 @@ DEFUN (isis_metric_l1, if (circuit->area && circuit->area->oldmetric == 1 && met > MAX_NARROW_LINK_METRIC) { - vty_outln (vty, "Invalid metric %d - should be <0-63> " - "when narrow metric type enabled", + vty_out (vty, "Invalid metric %d - should be <0-63> " + "when narrow metric type enabled\n", met); return CMD_ERR_AMBIGUOUS; } @@ -579,8 +579,8 @@ DEFUN (isis_metric_l1, if (circuit->area && circuit->area->newmetric == 1 && met > MAX_WIDE_LINK_METRIC) { - vty_outln (vty, "Invalid metric %d - should be <0-16777215> " - "when wide metric type enabled", + vty_out (vty, "Invalid metric %d - should be <0-16777215> " + "when wide metric type enabled\n", met); return CMD_ERR_AMBIGUOUS; } @@ -628,8 +628,8 @@ DEFUN (isis_metric_l2, if (circuit->area && circuit->area->oldmetric == 1 && met > MAX_NARROW_LINK_METRIC) { - vty_outln (vty, "Invalid metric %d - should be <0-63> " - "when narrow metric type enabled", + vty_out (vty, "Invalid metric %d - should be <0-63> " + "when narrow metric type enabled\n", met); return CMD_ERR_AMBIGUOUS; } @@ -638,8 +638,8 @@ DEFUN (isis_metric_l2, if (circuit->area && circuit->area->newmetric == 1 && met > MAX_WIDE_LINK_METRIC) { - vty_outln (vty, "Invalid metric %d - should be <0-16777215> " - "when wide metric type enabled", + vty_out (vty, "Invalid metric %d - should be <0-16777215> " + "when wide metric type enabled\n", met); return CMD_ERR_AMBIGUOUS; } @@ -684,7 +684,7 @@ DEFUN (isis_hello_interval, interval = atoi (argv[idx_number]->arg); if (interval < MIN_HELLO_INTERVAL || interval > MAX_HELLO_INTERVAL) { - vty_outln (vty, "Invalid hello-interval %d - should be <1-600>", + vty_out (vty, "Invalid hello-interval %d - should be <1-600>\n", interval); return CMD_ERR_AMBIGUOUS; } @@ -732,7 +732,7 @@ DEFUN (isis_hello_interval_l1, interval = atoi (argv[idx_number]->arg); if (interval < MIN_HELLO_INTERVAL || interval > MAX_HELLO_INTERVAL) { - vty_outln (vty, "Invalid hello-interval %ld - should be <1-600>", + vty_out (vty, "Invalid hello-interval %ld - should be <1-600>\n", interval); return CMD_ERR_AMBIGUOUS; } @@ -779,7 +779,7 @@ DEFUN (isis_hello_interval_l2, interval = atoi (argv[idx_number]->arg); if (interval < MIN_HELLO_INTERVAL || interval > MAX_HELLO_INTERVAL) { - vty_outln (vty, "Invalid hello-interval %ld - should be <1-600>", + vty_out (vty, "Invalid hello-interval %ld - should be <1-600>\n", interval); return CMD_ERR_AMBIGUOUS; } @@ -825,7 +825,7 @@ DEFUN (isis_hello_multiplier, mult = atoi (argv[idx_number]->arg); if (mult < MIN_HELLO_MULTIPLIER || mult > MAX_HELLO_MULTIPLIER) { - vty_outln (vty, "Invalid hello-multiplier %d - should be <2-100>", + vty_out (vty, "Invalid hello-multiplier %d - should be <2-100>\n", mult); return CMD_ERR_AMBIGUOUS; } @@ -873,7 +873,7 @@ DEFUN (isis_hello_multiplier_l1, mult = atoi (argv[idx_number]->arg); if (mult < MIN_HELLO_MULTIPLIER || mult > MAX_HELLO_MULTIPLIER) { - vty_outln (vty, "Invalid hello-multiplier %d - should be <2-100>", + vty_out (vty, "Invalid hello-multiplier %d - should be <2-100>\n", mult); return CMD_ERR_AMBIGUOUS; } @@ -920,7 +920,7 @@ DEFUN (isis_hello_multiplier_l2, mult = atoi (argv[idx_number]->arg); if (mult < MIN_HELLO_MULTIPLIER || mult > MAX_HELLO_MULTIPLIER) { - vty_outln (vty, "Invalid hello-multiplier %d - should be <2-100>", + vty_out (vty, "Invalid hello-multiplier %d - should be <2-100>\n", mult); return CMD_ERR_AMBIGUOUS; } @@ -999,7 +999,7 @@ DEFUN (csnp_interval, interval = atol (argv[idx_number]->arg); if (interval < MIN_CSNP_INTERVAL || interval > MAX_CSNP_INTERVAL) { - vty_outln (vty, "Invalid csnp-interval %lu - should be <1-600>", + vty_out (vty, "Invalid csnp-interval %lu - should be <1-600>\n", interval); return CMD_ERR_AMBIGUOUS; } @@ -1047,7 +1047,7 @@ DEFUN (csnp_interval_l1, interval = atol (argv[idx_number]->arg); if (interval < MIN_CSNP_INTERVAL || interval > MAX_CSNP_INTERVAL) { - vty_outln (vty, "Invalid csnp-interval %lu - should be <1-600>", + vty_out (vty, "Invalid csnp-interval %lu - should be <1-600>\n", interval); return CMD_ERR_AMBIGUOUS; } @@ -1094,7 +1094,7 @@ DEFUN (csnp_interval_l2, interval = atol (argv[idx_number]->arg); if (interval < MIN_CSNP_INTERVAL || interval > MAX_CSNP_INTERVAL) { - vty_outln (vty, "Invalid csnp-interval %lu - should be <1-600>", + vty_out (vty, "Invalid csnp-interval %lu - should be <1-600>\n", interval); return CMD_ERR_AMBIGUOUS; } @@ -1140,7 +1140,7 @@ DEFUN (psnp_interval, interval = atol (argv[idx_number]->arg); if (interval < MIN_PSNP_INTERVAL || interval > MAX_PSNP_INTERVAL) { - vty_outln (vty, "Invalid psnp-interval %lu - should be <1-120>", + vty_out (vty, "Invalid psnp-interval %lu - should be <1-120>\n", interval); return CMD_ERR_AMBIGUOUS; } @@ -1188,7 +1188,7 @@ DEFUN (psnp_interval_l1, interval = atol (argv[idx_number]->arg); if (interval < MIN_PSNP_INTERVAL || interval > MAX_PSNP_INTERVAL) { - vty_outln (vty, "Invalid psnp-interval %lu - should be <1-120>", + vty_out (vty, "Invalid psnp-interval %lu - should be <1-120>\n", interval); return CMD_ERR_AMBIGUOUS; } @@ -1235,7 +1235,7 @@ DEFUN (psnp_interval_l2, interval = atol (argv[idx_number]->arg); if (interval < MIN_PSNP_INTERVAL || interval > MAX_PSNP_INTERVAL) { - vty_outln (vty, "Invalid psnp-interval %lu - should be <1-120>", + vty_out (vty, "Invalid psnp-interval %lu - should be <1-120>\n", interval); return CMD_ERR_AMBIGUOUS; } @@ -1279,14 +1279,14 @@ DEFUN (circuit_topology, if (circuit->area && circuit->area->oldmetric) { - vty_outln (vty, - "Multi topology IS-IS can only be used with wide metrics"); + vty_out (vty, + "Multi topology IS-IS can only be used with wide metrics\n"); return CMD_ERR_AMBIGUOUS; } if (mtid == (uint16_t)-1) { - vty_outln (vty, "Don't know topology '%s'", arg); + vty_out (vty, "Don't know topology '%s'\n", arg); return CMD_ERR_AMBIGUOUS; } @@ -1309,14 +1309,14 @@ DEFUN (no_circuit_topology, if (circuit->area && circuit->area->oldmetric) { - vty_outln (vty, - "Multi topology IS-IS can only be used with wide metrics"); + vty_out (vty, + "Multi topology IS-IS can only be used with wide metrics\n"); return CMD_ERR_AMBIGUOUS; } if (mtid == (uint16_t)-1) { - vty_outln (vty, "Don't know topology '%s'", arg); + vty_out (vty, "Don't know topology '%s'\n", arg); return CMD_ERR_AMBIGUOUS; } @@ -1334,7 +1334,7 @@ validate_metric_style_narrow (struct vty *vty, struct isis_area *area) if (! area) { - vty_outln (vty, "ISIS area is invalid"); + vty_out (vty, "ISIS area is invalid\n"); return CMD_ERR_AMBIGUOUS; } @@ -1344,7 +1344,7 @@ validate_metric_style_narrow (struct vty *vty, struct isis_area *area) (circuit->is_type & IS_LEVEL_1) && (circuit->te_metric[0] > MAX_NARROW_LINK_METRIC)) { - vty_outln (vty, "ISIS circuit %s metric is invalid", + vty_out (vty, "ISIS circuit %s metric is invalid\n", circuit->interface->name); return CMD_ERR_AMBIGUOUS; } @@ -1352,7 +1352,7 @@ validate_metric_style_narrow (struct vty *vty, struct isis_area *area) (circuit->is_type & IS_LEVEL_2) && (circuit->te_metric[1] > MAX_NARROW_LINK_METRIC)) { - vty_outln (vty, "ISIS circuit %s metric is invalid", + vty_out (vty, "ISIS circuit %s metric is invalid\n", circuit->interface->name); return CMD_ERR_AMBIGUOUS; } @@ -1381,8 +1381,8 @@ DEFUN (metric_style, if (area_is_mt(area)) { - vty_outln (vty, - "Narrow metrics cannot be used while multi topology IS-IS is active"); + vty_out (vty, + "Narrow metrics cannot be used while multi topology IS-IS is active\n"); return CMD_ERR_AMBIGUOUS; } @@ -1410,8 +1410,8 @@ DEFUN (no_metric_style, if (area_is_mt(area)) { - vty_outln (vty, - "Narrow metrics cannot be used while multi topology IS-IS is active"); + vty_out (vty, + "Narrow metrics cannot be used while multi topology IS-IS is active\n"); return CMD_ERR_AMBIGUOUS; } @@ -1506,7 +1506,7 @@ static int area_lsp_mtu_set(struct vty *vty, unsigned int lsp_mtu) continue; if(lsp_mtu > isis_circuit_pdu_size(circuit)) { - vty_outln (vty, "ISIS area contains circuit %s, which has a maximum PDU size of %zu.", + vty_out (vty, "ISIS area contains circuit %s, which has a maximum PDU size of %zu.\n", circuit->interface->name,isis_circuit_pdu_size(circuit)); return CMD_ERR_AMBIGUOUS; } @@ -1557,7 +1557,7 @@ DEFUN (is_type, type = string2circuit_t (argv[idx_level]->arg); if (!type) { - vty_outln (vty, "Unknown IS level "); + vty_out (vty, "Unknown IS level \n"); return CMD_SUCCESS; } @@ -1606,8 +1606,8 @@ set_lsp_gen_interval (struct vty *vty, struct isis_area *area, if (interval >= area->lsp_refresh[lvl-1]) { - vty_outln (vty, "LSP gen interval %us must be less than " - "the LSP refresh interval %us", + vty_out (vty, "LSP gen interval %us must be less than " + "the LSP refresh interval %us\n", interval, area->lsp_refresh[lvl - 1]); return CMD_ERR_AMBIGUOUS; } @@ -1845,17 +1845,17 @@ area_max_lsp_lifetime_set(struct vty *vty, int level, if (refresh_interval < area->lsp_refresh[lvl-1]) { - vty_outln (vty, "Level %d Max LSP lifetime %us must be 300s greater than " - "the configured LSP refresh interval %us", + vty_out (vty, "Level %d Max LSP lifetime %us must be 300s greater than " + "the configured LSP refresh interval %us\n", lvl, interval, area->lsp_refresh[lvl - 1]); - vty_outln (vty, "Automatically reducing level %d LSP refresh interval " - "to %us", lvl, refresh_interval); + vty_out (vty, "Automatically reducing level %d LSP refresh interval " + "to %us\n", lvl, refresh_interval); set_refresh_interval[lvl-1] = 1; if (refresh_interval <= area->lsp_gen_interval[lvl-1]) { - vty_outln (vty, "LSP refresh interval %us must be greater than " - "the configured LSP gen interval %us", + vty_out (vty, "LSP refresh interval %us must be greater than " + "the configured LSP gen interval %us\n", refresh_interval,area->lsp_gen_interval[lvl - 1]); return CMD_ERR_AMBIGUOUS; } @@ -1929,15 +1929,15 @@ area_lsp_refresh_interval_set(struct vty *vty, int level, uint16_t interval) continue; if (interval <= area->lsp_gen_interval[lvl-1]) { - vty_outln (vty, "LSP refresh interval %us must be greater than " - "the configured LSP gen interval %us", + vty_out (vty, "LSP refresh interval %us must be greater than " + "the configured LSP gen interval %us\n", interval,area->lsp_gen_interval[lvl - 1]); return CMD_ERR_AMBIGUOUS; } if (interval > (area->max_lsp_lifetime[lvl-1] - 300)) { - vty_outln (vty, "LSP refresh interval %us must be less than " - "the configured LSP lifetime %us less 300", + vty_out (vty, "LSP refresh interval %us must be less than " + "the configured LSP lifetime %us less 300\n", interval,area->max_lsp_lifetime[lvl - 1]); return CMD_ERR_AMBIGUOUS; } @@ -2004,7 +2004,7 @@ area_passwd_set(struct vty *vty, int level, if (passwd && strlen(passwd) > 254) { - vty_outln (vty, "Too long area password (>254)"); + vty_out (vty, "Too long area password (>254)\n"); return CMD_ERR_AMBIGUOUS; } diff --git a/isisd/isisd.c b/isisd/isisd.c index cf3b32513..473b6594e 100644 --- a/isisd/isisd.c +++ b/isisd/isisd.c @@ -218,7 +218,7 @@ isis_area_destroy (struct vty *vty, const char *area_tag) if (area == NULL) { - vty_outln (vty, "Can't find ISIS instance "); + vty_out (vty, "Can't find ISIS instance \n"); return CMD_ERR_NO_MATCH; } @@ -352,7 +352,7 @@ area_net_title (struct vty *vty, const char *net_title) /* We check that we are not over the maximal number of addresses */ if (listcount (area->area_addrs) >= isis->max_area_addrs) { - vty_outln (vty, "Maximum of area addresses (%d) already reached ", + vty_out (vty, "Maximum of area addresses (%d) already reached \n", isis->max_area_addrs); return CMD_ERR_NOTHING_TODO; } @@ -366,7 +366,7 @@ area_net_title (struct vty *vty, const char *net_title) #endif /* EXTREME_DEBUG */ if (addr->addr_len < 8 || addr->addr_len > 20) { - vty_outln (vty, "area address must be at least 8..20 octets long (%d)", + vty_out (vty, "area address must be at least 8..20 octets long (%d)\n", addr->addr_len); XFREE (MTYPE_ISIS_AREA_ADDR, addr); return CMD_ERR_AMBIGUOUS; @@ -374,7 +374,7 @@ area_net_title (struct vty *vty, const char *net_title) if (addr->area_addr[addr->addr_len-1] != 0) { - vty_outln (vty,"nsel byte (last byte) in area address must be 0"); + vty_out (vty,"nsel byte (last byte) in area address must be 0\n"); XFREE (MTYPE_ISIS_AREA_ADDR, addr); return CMD_ERR_AMBIGUOUS; } @@ -396,8 +396,8 @@ area_net_title (struct vty *vty, const char *net_title) */ if (memcmp (isis->sysid, GETSYSID (addr), ISIS_SYS_ID_LEN)) { - vty_outln (vty, - "System ID must not change when defining additional area" " addresses"); + vty_out (vty, + "System ID must not change when defining additional area addresses\n"); XFREE (MTYPE_ISIS_AREA_ADDR, addr); return CMD_ERR_AMBIGUOUS; } @@ -444,7 +444,7 @@ area_clear_net_title (struct vty *vty, const char *net_title) addr.addr_len = dotformat2buff (buff, net_title); if (addr.addr_len < 8 || addr.addr_len > 20) { - vty_outln (vty, "Unsupported area address length %d, should be 8...20 ", + vty_out (vty, "Unsupported area address length %d, should be 8...20 \n", addr.addr_len); return CMD_ERR_AMBIGUOUS; } @@ -458,7 +458,7 @@ area_clear_net_title (struct vty *vty, const char *net_title) if (!addrp) { - vty_outln (vty, "No area address %s for area %s ", net_title, + vty_out (vty, "No area address %s for area %s \n", net_title, area->area_tag); return CMD_ERR_NO_MATCH; } @@ -493,16 +493,16 @@ show_isis_interface_common (struct vty *vty, const char *ifname, char detail) if (!isis) { - vty_outln (vty, "IS-IS Routing Process not enabled"); + vty_out (vty, "IS-IS Routing Process not enabled\n"); return CMD_SUCCESS; } for (ALL_LIST_ELEMENTS_RO (isis->area_list, anode, area)) { - vty_outln (vty, "Area %s:", area->area_tag); + vty_out (vty, "Area %s:\n", area->area_tag); if (detail == ISIS_UI_LEVEL_BRIEF) - vty_outln (vty," Interface CircId State Type Level"); + vty_out (vty," Interface CircId State Type Level\n"); for (ALL_LIST_ELEMENTS_RO (area->circuit_list, cnode, circuit)) if (!ifname) @@ -565,7 +565,7 @@ show_isis_neighbor_common (struct vty *vty, const char *id, char detail) if (!isis) { - vty_outln (vty, "IS-IS Routing Process not enabled"); + vty_out (vty, "IS-IS Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -577,7 +577,7 @@ show_isis_neighbor_common (struct vty *vty, const char *id, char detail) dynhn = dynhn_find_by_name (id); if (dynhn == NULL) { - vty_outln (vty, "Invalid system id %s", id); + vty_out (vty, "Invalid system id %s\n", id); return CMD_SUCCESS; } memcpy (sysid, dynhn->id, ISIS_SYS_ID_LEN); @@ -586,11 +586,11 @@ show_isis_neighbor_common (struct vty *vty, const char *id, char detail) for (ALL_LIST_ELEMENTS_RO (isis->area_list, anode, area)) { - vty_outln (vty, "Area %s:", area->area_tag); + vty_out (vty, "Area %s:\n", area->area_tag); if (detail == ISIS_UI_LEVEL_BRIEF) - vty_outln (vty, - " System Id Interface L State" " Holdtime SNPA"); + vty_out (vty, + " System Id Interface L State Holdtime SNPA\n"); for (ALL_LIST_ELEMENTS_RO (area->circuit_list, cnode, circuit)) { @@ -638,7 +638,7 @@ clear_isis_neighbor_common (struct vty *vty, const char *id) if (!isis) { - vty_outln (vty, "IS-IS Routing Process not enabled"); + vty_out (vty, "IS-IS Routing Process not enabled\n"); return CMD_SUCCESS; } @@ -650,7 +650,7 @@ clear_isis_neighbor_common (struct vty *vty, const char *id) dynhn = dynhn_find_by_name (id); if (dynhn == NULL) { - vty_outln (vty, "Invalid system id %s", id); + vty_out (vty, "Invalid system id %s\n", id); return CMD_SUCCESS; } memcpy (sysid, dynhn->id, ISIS_SYS_ID_LEN); @@ -757,35 +757,35 @@ print_debug (struct vty *vty, int flags, int onoff) strcpy (onoffs, "off"); if (flags & DEBUG_ADJ_PACKETS) - vty_outln (vty, "IS-IS Adjacency related packets debugging is %s", + vty_out (vty, "IS-IS Adjacency related packets debugging is %s\n", onoffs); if (flags & DEBUG_CHECKSUM_ERRORS) - vty_outln (vty, "IS-IS checksum errors debugging is %s",onoffs); + vty_out (vty, "IS-IS checksum errors debugging is %s\n",onoffs); if (flags & DEBUG_LOCAL_UPDATES) - vty_outln (vty, "IS-IS local updates debugging is %s",onoffs); + vty_out (vty, "IS-IS local updates debugging is %s\n",onoffs); if (flags & DEBUG_PROTOCOL_ERRORS) - vty_outln (vty, "IS-IS protocol errors debugging is %s",onoffs); + vty_out (vty, "IS-IS protocol errors debugging is %s\n",onoffs); if (flags & DEBUG_SNP_PACKETS) - vty_outln (vty, "IS-IS CSNP/PSNP packets debugging is %s",onoffs); + vty_out (vty, "IS-IS CSNP/PSNP packets debugging is %s\n",onoffs); if (flags & DEBUG_SPF_EVENTS) - vty_outln (vty, "IS-IS SPF events debugging is %s", onoffs); + vty_out (vty, "IS-IS SPF events debugging is %s\n", onoffs); if (flags & DEBUG_SPF_STATS) - vty_outln (vty, "IS-IS SPF Timing and Statistics Data debugging is %s", + vty_out (vty, "IS-IS SPF Timing and Statistics Data debugging is %s\n", onoffs); if (flags & DEBUG_SPF_TRIGGERS) - vty_outln (vty, "IS-IS SPF triggering events debugging is %s",onoffs); + vty_out (vty, "IS-IS SPF triggering events debugging is %s\n",onoffs); if (flags & DEBUG_UPDATE_PACKETS) - vty_outln (vty, "IS-IS Update related packet debugging is %s",onoffs); + vty_out (vty, "IS-IS Update related packet debugging is %s\n",onoffs); if (flags & DEBUG_RTE_EVENTS) - vty_outln (vty, "IS-IS Route related debuggin is %s",onoffs); + vty_out (vty, "IS-IS Route related debuggin is %s\n",onoffs); if (flags & DEBUG_EVENTS) - vty_outln (vty, "IS-IS Event debugging is %s", onoffs); + vty_out (vty, "IS-IS Event debugging is %s\n", onoffs); if (flags & DEBUG_PACKET_DUMP) - vty_outln (vty, "IS-IS Packet dump debugging is %s", onoffs); + vty_out (vty, "IS-IS Packet dump debugging is %s\n", onoffs); if (flags & DEBUG_LSP_GEN) - vty_outln (vty, "IS-IS LSP generation debugging is %s", onoffs); + vty_out (vty, "IS-IS LSP generation debugging is %s\n", onoffs); if (flags & DEBUG_LSP_SCHED) - vty_outln (vty, "IS-IS LSP scheduling debugging is %s", onoffs); + vty_out (vty, "IS-IS LSP scheduling debugging is %s\n", onoffs); } DEFUN (show_debugging, @@ -796,7 +796,7 @@ DEFUN (show_debugging, ISIS_STR) { if (isis->debugs) { - vty_outln (vty, "IS-IS:"); + vty_out (vty, "IS-IS:\n"); print_debug (vty, isis->debugs, 1); } return CMD_SUCCESS; @@ -817,72 +817,72 @@ config_write_debug (struct vty *vty) if (flags & DEBUG_ADJ_PACKETS) { - vty_outln (vty, "debug isis adj-packets"); + vty_out (vty, "debug isis adj-packets\n"); write++; } if (flags & DEBUG_CHECKSUM_ERRORS) { - vty_outln (vty, "debug isis checksum-errors"); + vty_out (vty, "debug isis checksum-errors\n"); write++; } if (flags & DEBUG_LOCAL_UPDATES) { - vty_outln (vty, "debug isis local-updates"); + vty_out (vty, "debug isis local-updates\n"); write++; } if (flags & DEBUG_PROTOCOL_ERRORS) { - vty_outln (vty, "debug isis protocol-errors"); + vty_out (vty, "debug isis protocol-errors\n"); write++; } if (flags & DEBUG_SNP_PACKETS) { - vty_outln (vty, "debug isis snp-packets"); + vty_out (vty, "debug isis snp-packets\n"); write++; } if (flags & DEBUG_SPF_EVENTS) { - vty_outln (vty, "debug isis spf-events"); + vty_out (vty, "debug isis spf-events\n"); write++; } if (flags & DEBUG_SPF_STATS) { - vty_outln (vty, "debug isis spf-statistics"); + vty_out (vty, "debug isis spf-statistics\n"); write++; } if (flags & DEBUG_SPF_TRIGGERS) { - vty_outln (vty, "debug isis spf-triggers"); + vty_out (vty, "debug isis spf-triggers\n"); write++; } if (flags & DEBUG_UPDATE_PACKETS) { - vty_outln (vty, "debug isis update-packets"); + vty_out (vty, "debug isis update-packets\n"); write++; } if (flags & DEBUG_RTE_EVENTS) { - vty_outln (vty, "debug isis route-events"); + vty_out (vty, "debug isis route-events\n"); write++; } if (flags & DEBUG_EVENTS) { - vty_outln (vty, "debug isis events"); + vty_out (vty, "debug isis events\n"); write++; } if (flags & DEBUG_PACKET_DUMP) { - vty_outln (vty, "debug isis packet-dump"); + vty_out (vty, "debug isis packet-dump\n"); write++; } if (flags & DEBUG_LSP_GEN) { - vty_outln (vty, "debug isis lsp-gen"); + vty_out (vty, "debug isis lsp-gen\n"); write++; } if (flags & DEBUG_LSP_SCHED) { - vty_outln (vty, "debug isis lsp-sched"); + vty_out (vty, "debug isis lsp-sched\n"); write++; } write += spf_backoff_write_config(vty); @@ -1312,7 +1312,7 @@ DEFUN (show_isis_spf_ietf, { if (!isis) { - vty_outln (vty, "ISIS is not running"); + vty_out (vty, "ISIS is not running\n"); return CMD_SUCCESS; } @@ -1321,31 +1321,31 @@ DEFUN (show_isis_spf_ietf, for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area)) { - vty_outln (vty, "Area %s:",area->area_tag ? area->area_tag : "null"); + vty_out (vty, "Area %s:\n",area->area_tag ? area->area_tag : "null"); for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) { if ((area->is_type & level) == 0) continue; - vty_outln (vty, " Level-%d:", level); + vty_out (vty, " Level-%d:\n", level); vty_out (vty, " SPF delay status: "); if (area->spf_timer[level -1]) { struct timeval remain = thread_timer_remain(area->spf_timer[level - 1]); - vty_outln (vty, "Pending, due in %ld msec", + vty_out (vty, "Pending, due in %ld msec\n", remain.tv_sec * 1000 + remain.tv_usec / 1000); } else { - vty_outln (vty, "Not scheduled"); + vty_out (vty, "Not scheduled\n"); } if (area->spf_delay_ietf[level - 1]) { - vty_outln (vty, " Using draft-ietf-rtgwg-backoff-algo-04"); + vty_out (vty, " Using draft-ietf-rtgwg-backoff-algo-04\n"); spf_backoff_show(area->spf_delay_ietf[level - 1], vty, " "); } else { - vty_outln (vty, " Using legacy backoff algo"); + vty_out (vty, " Using legacy backoff algo\n"); } } } @@ -1364,31 +1364,31 @@ DEFUN (show_isis_summary, if (isis == NULL) { - vty_outln (vty, "ISIS is not running"); + vty_out (vty, "ISIS is not running\n"); return CMD_SUCCESS; } - vty_outln (vty, "Process Id : %ld",isis->process_id); + vty_out (vty, "Process Id : %ld\n",isis->process_id); if (isis->sysid_set) - vty_outln (vty, "System Id : %s",sysid_print(isis->sysid)); + vty_out (vty, "System Id : %s\n",sysid_print(isis->sysid)); vty_out (vty, "Up time : "); vty_out_timestr(vty, isis->uptime); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); if (isis->area_list) - vty_outln (vty, "Number of areas : %d",isis->area_list->count); + vty_out (vty, "Number of areas : %d\n",isis->area_list->count); for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area)) { - vty_outln (vty, "Area %s:",area->area_tag ? area->area_tag : "null"); + vty_out (vty, "Area %s:\n",area->area_tag ? area->area_tag : "null"); if (listcount (area->area_addrs) > 0) { struct area_addr *area_addr; for (ALL_LIST_ELEMENTS_RO (area->area_addrs, node2, area_addr)) { - vty_outln (vty, " Net: %s", + vty_out (vty, " Net: %s\n", isonet_print(area_addr->area_addr, area_addr->addr_len + ISIS_SYS_ID_LEN + 1)); } } @@ -1398,45 +1398,45 @@ DEFUN (show_isis_summary, if ((area->is_type & level) == 0) continue; - vty_outln (vty, " Level-%d:", level); + vty_out (vty, " Level-%d:\n", level); spftree = area->spftree[level - 1]; if (area->spf_timer[level - 1]) - vty_outln (vty, " SPF: (pending)"); + vty_out (vty, " SPF: (pending)\n"); else - vty_outln (vty, " SPF:"); + vty_out (vty, " SPF:\n"); vty_out (vty, " minimum interval : %d", area->min_spf_interval[level - 1]); if (area->spf_delay_ietf[level - 1]) vty_out (vty, " (not used, IETF SPF delay activated)"); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); - vty_outln (vty, " IPv4 route computation:"); + vty_out (vty, " IPv4 route computation:\n"); vty_out (vty, " last run elapsed : "); vty_out_timestr(vty, spftree->last_run_timestamp); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); - vty_outln (vty, " last run duration : %u usec", + vty_out (vty, " last run duration : %u usec\n", (u_int32_t)spftree->last_run_duration); - vty_outln (vty, " run count : %d", + vty_out (vty, " run count : %d\n", spftree->runcount); spftree = area->spftree6[level - 1]; - vty_outln (vty, " IPv6 route computation:"); + vty_out (vty, " IPv6 route computation:\n"); vty_out (vty, " last run elapsed : "); vty_out_timestr(vty, spftree->last_run_timestamp); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); - vty_outln (vty, " last run duration : %llu msec", + vty_out (vty, " last run duration : %llu msec\n", (unsigned long long)spftree->last_run_duration); - vty_outln (vty, " run count : %d", + vty_out (vty, " run count : %d\n", spftree->runcount); } } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -1508,7 +1508,7 @@ show_isis_database (struct vty *vty, const char *argv, int ui_level) for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area)) { - vty_outln (vty, "Area %s:",area->area_tag ? area->area_tag : "null"); + vty_out (vty, "Area %s:\n",area->area_tag ? area->area_tag : "null"); for (level = 0; level < ISIS_LEVELS; level++) { @@ -1539,12 +1539,12 @@ show_isis_database (struct vty *vty, const char *argv, int ui_level) if (lsp != NULL || argv == NULL) { - vty_outln (vty, "IS-IS Level-%d link-state database:", + vty_out (vty, "IS-IS Level-%d link-state database:\n", level + 1); /* print the title in all cases */ - vty_outln (vty, - "LSP ID PduLen " "SeqNumber Chksum Holdtime ATT/P/OL"); + vty_out (vty, + "LSP ID PduLen SeqNumber Chksum Holdtime ATT/P/OL\n"); } if (lsp) @@ -1560,8 +1560,8 @@ show_isis_database (struct vty *vty, const char *argv, int ui_level) ui_level, area->dynhostname); - vty_outln (vty, " %u LSPs%s", - lsp_count, VTYNL); + vty_out (vty, " %u LSPs\n\n", + lsp_count); } } } @@ -1652,19 +1652,19 @@ DEFUN (isis_topology, if (area->oldmetric) { - vty_outln (vty, - "Multi topology IS-IS can only be used with wide metrics"); + vty_out (vty, + "Multi topology IS-IS can only be used with wide metrics\n"); return CMD_ERR_AMBIGUOUS; } if (mtid == (uint16_t)-1) { - vty_outln (vty, "Don't know topology '%s'", arg); + vty_out (vty, "Don't know topology '%s'\n", arg); return CMD_ERR_AMBIGUOUS; } if (mtid == ISIS_MT_IPV4_UNICAST) { - vty_outln (vty, "Cannot configure IPv4 unicast topology"); + vty_out (vty, "Cannot configure IPv4 unicast topology\n"); return CMD_ERR_AMBIGUOUS; } @@ -1688,19 +1688,19 @@ DEFUN (no_isis_topology, if (area->oldmetric) { - vty_outln (vty, - "Multi topology IS-IS can only be used with wide metrics"); + vty_out (vty, + "Multi topology IS-IS can only be used with wide metrics\n"); return CMD_ERR_AMBIGUOUS; } if (mtid == (uint16_t)-1) { - vty_outln (vty, "Don't know topology '%s'", arg); + vty_out (vty, "Don't know topology '%s'\n", arg); return CMD_ERR_AMBIGUOUS; } if (mtid == ISIS_MT_IPV4_UNICAST) { - vty_outln (vty, "Cannot configure IPv4 unicast topology"); + vty_out (vty, "Cannot configure IPv4 unicast topology\n"); return CMD_ERR_AMBIGUOUS; } @@ -1990,7 +1990,7 @@ isis_config_write (struct vty *vty) for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area)) { /* ISIS - Area name */ - vty_outln (vty, "router isis %s", area->area_tag); + vty_out (vty, "router isis %s\n", area->area_tag); write++; /* ISIS - Net */ if (listcount (area->area_addrs) > 0) @@ -1998,7 +1998,7 @@ isis_config_write (struct vty *vty) struct area_addr *area_addr; for (ALL_LIST_ELEMENTS_RO (area->area_addrs, node2, area_addr)) { - vty_outln (vty, " net %s", + vty_out (vty, " net %s\n", isonet_print(area_addr->area_addr, area_addr->addr_len + ISIS_SYS_ID_LEN + 1)); write++; } @@ -2007,38 +2007,38 @@ isis_config_write (struct vty *vty) * false. */ if (!area->dynhostname) { - vty_outln (vty, " no hostname dynamic"); + vty_out (vty, " no hostname dynamic\n"); write++; } /* ISIS - Metric-Style - when true displays wide */ if (area->newmetric) { if (!area->oldmetric) - vty_outln (vty, " metric-style wide"); + vty_out (vty, " metric-style wide\n"); else - vty_outln (vty, " metric-style transition"); + vty_out (vty, " metric-style transition\n"); write++; } else { - vty_outln (vty, " metric-style narrow"); + vty_out (vty, " metric-style narrow\n"); write++; } /* ISIS - overload-bit */ if (area->overload_bit) { - vty_outln (vty, " set-overload-bit"); + vty_out (vty, " set-overload-bit\n"); write++; } /* ISIS - Area is-type (level-1-2 is default) */ if (area->is_type == IS_LEVEL_1) { - vty_outln (vty, " is-type level-1"); + vty_out (vty, " is-type level-1\n"); write++; } else if (area->is_type == IS_LEVEL_2) { - vty_outln (vty, " is-type level-2-only"); + vty_out (vty, " is-type level-2-only\n"); write++; } write += isis_redist_config_write(vty, area, AF_INET); @@ -2048,7 +2048,7 @@ isis_config_write (struct vty *vty) { if (area->lsp_gen_interval[0] != DEFAULT_MIN_LSP_GEN_INTERVAL) { - vty_outln (vty, " lsp-gen-interval %d", + vty_out (vty, " lsp-gen-interval %d\n", area->lsp_gen_interval[0]); write++; } @@ -2057,13 +2057,13 @@ isis_config_write (struct vty *vty) { if (area->lsp_gen_interval[0] != DEFAULT_MIN_LSP_GEN_INTERVAL) { - vty_outln (vty, " lsp-gen-interval level-1 %d", + vty_out (vty, " lsp-gen-interval level-1 %d\n", area->lsp_gen_interval[0]); write++; } if (area->lsp_gen_interval[1] != DEFAULT_MIN_LSP_GEN_INTERVAL) { - vty_outln (vty, " lsp-gen-interval level-2 %d", + vty_out (vty, " lsp-gen-interval level-2 %d\n", area->lsp_gen_interval[1]); write++; } @@ -2073,7 +2073,7 @@ isis_config_write (struct vty *vty) { if (area->max_lsp_lifetime[0] != DEFAULT_LSP_LIFETIME) { - vty_outln (vty, " max-lsp-lifetime %u", + vty_out (vty, " max-lsp-lifetime %u\n", area->max_lsp_lifetime[0]); write++; } @@ -2082,13 +2082,13 @@ isis_config_write (struct vty *vty) { if (area->max_lsp_lifetime[0] != DEFAULT_LSP_LIFETIME) { - vty_outln (vty, " max-lsp-lifetime level-1 %u", + vty_out (vty, " max-lsp-lifetime level-1 %u\n", area->max_lsp_lifetime[0]); write++; } if (area->max_lsp_lifetime[1] != DEFAULT_LSP_LIFETIME) { - vty_outln (vty, " max-lsp-lifetime level-2 %u", + vty_out (vty, " max-lsp-lifetime level-2 %u\n", area->max_lsp_lifetime[1]); write++; } @@ -2098,7 +2098,7 @@ isis_config_write (struct vty *vty) { if (area->lsp_refresh[0] != DEFAULT_MAX_LSP_GEN_INTERVAL) { - vty_outln (vty, " lsp-refresh-interval %u", + vty_out (vty, " lsp-refresh-interval %u\n", area->lsp_refresh[0]); write++; } @@ -2107,20 +2107,20 @@ isis_config_write (struct vty *vty) { if (area->lsp_refresh[0] != DEFAULT_MAX_LSP_GEN_INTERVAL) { - vty_outln (vty, " lsp-refresh-interval level-1 %u", + vty_out (vty, " lsp-refresh-interval level-1 %u\n", area->lsp_refresh[0]); write++; } if (area->lsp_refresh[1] != DEFAULT_MAX_LSP_GEN_INTERVAL) { - vty_outln (vty, " lsp-refresh-interval level-2 %u", + vty_out (vty, " lsp-refresh-interval level-2 %u\n", area->lsp_refresh[1]); write++; } } if (area->lsp_mtu != DEFAULT_LSP_MTU) { - vty_outln (vty, " lsp-mtu %u", area->lsp_mtu); + vty_out (vty, " lsp-mtu %u\n", area->lsp_mtu); write++; } @@ -2129,7 +2129,7 @@ isis_config_write (struct vty *vty) { if (area->min_spf_interval[0] != MINIMUM_SPF_INTERVAL) { - vty_outln (vty, " spf-interval %d", + vty_out (vty, " spf-interval %d\n", area->min_spf_interval[0]); write++; } @@ -2138,13 +2138,13 @@ isis_config_write (struct vty *vty) { if (area->min_spf_interval[0] != MINIMUM_SPF_INTERVAL) { - vty_outln (vty, " spf-interval level-1 %d", + vty_out (vty, " spf-interval level-1 %d\n", area->min_spf_interval[0]); write++; } if (area->min_spf_interval[1] != MINIMUM_SPF_INTERVAL) { - vty_outln (vty, " spf-interval level-2 %d", + vty_out (vty, " spf-interval level-2 %d\n", area->min_spf_interval[1]); write++; } @@ -2153,7 +2153,7 @@ isis_config_write (struct vty *vty) /* IETF SPF interval */ if (area->spf_delay_ietf[0]) { - vty_outln (vty, " spf-delay-ietf init-delay %ld short-delay %ld long-delay %ld holddown %ld time-to-learn %ld", + vty_out (vty, " spf-delay-ietf init-delay %ld short-delay %ld long-delay %ld holddown %ld time-to-learn %ld\n", spf_backoff_init_delay(area->spf_delay_ietf[0]), spf_backoff_short_delay(area->spf_delay_ietf[0]), spf_backoff_long_delay(area->spf_delay_ietf[0]), @@ -2174,7 +2174,7 @@ isis_config_write (struct vty *vty) else vty_out(vty, "send-only"); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); write++; } else if (area->area_passwd.type == ISIS_PASSWD_TYPE_CLEARTXT) @@ -2188,7 +2188,7 @@ isis_config_write (struct vty *vty) else vty_out(vty, "send-only"); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); write++; } if (area->domain_passwd.type == ISIS_PASSWD_TYPE_HMAC_MD5) @@ -2203,7 +2203,7 @@ isis_config_write (struct vty *vty) else vty_out(vty, "send-only"); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); write++; } else if (area->domain_passwd.type == ISIS_PASSWD_TYPE_CLEARTXT) @@ -2218,13 +2218,13 @@ isis_config_write (struct vty *vty) else vty_out(vty, "send-only"); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); write++; } if (area->log_adj_changes) { - vty_outln (vty, " log-adjacency-changes"); + vty_out (vty, " log-adjacency-changes\n"); write++; } diff --git a/ldpd/ldp_debug.c b/ldpd/ldp_debug.c index 80783994c..c9c7160ae 100644 --- a/ldpd/ldp_debug.c +++ b/ldpd/ldp_debug.c @@ -105,29 +105,29 @@ ldp_vty_debug(struct vty *vty, int disable, const char *type_str, int ldp_vty_show_debugging(struct vty *vty) { - vty_outln (vty, "LDP debugging status:"); + vty_out (vty, "LDP debugging status:\n"); if (LDP_DEBUG(hello, HELLO_RECV)) - vty_outln (vty," LDP discovery debugging is on (inbound)"); + vty_out (vty," LDP discovery debugging is on (inbound)\n"); if (LDP_DEBUG(hello, HELLO_SEND)) - vty_outln (vty," LDP discovery debugging is on (outbound)"); + vty_out (vty," LDP discovery debugging is on (outbound)\n"); if (LDP_DEBUG(errors, ERRORS)) - vty_outln (vty, " LDP errors debugging is on"); + vty_out (vty, " LDP errors debugging is on\n"); if (LDP_DEBUG(event, EVENT)) - vty_outln (vty, " LDP events debugging is on"); + vty_out (vty, " LDP events debugging is on\n"); if (LDP_DEBUG(msg, MSG_RECV_ALL)) - vty_outln (vty, - " LDP detailed messages debugging is on " "(inbound)"); + vty_out (vty, + " LDP detailed messages debugging is on (inbound)\n"); else if (LDP_DEBUG(msg, MSG_RECV)) - vty_outln (vty," LDP messages debugging is on (inbound)"); + vty_out (vty," LDP messages debugging is on (inbound)\n"); if (LDP_DEBUG(msg, MSG_SEND_ALL)) - vty_outln (vty, - " LDP detailed messages debugging is on " "(outbound)"); + vty_out (vty, + " LDP detailed messages debugging is on (outbound)\n"); else if (LDP_DEBUG(msg, MSG_SEND)) - vty_outln (vty," LDP messages debugging is on (outbound)"); + vty_out (vty," LDP messages debugging is on (outbound)\n"); if (LDP_DEBUG(zebra, ZEBRA)) - vty_outln (vty, " LDP zebra debugging is on"); - vty_out (vty, VTYNL); + vty_out (vty, " LDP zebra debugging is on\n"); + vty_out (vty, "\n"); return (CMD_SUCCESS); } @@ -138,43 +138,43 @@ ldp_debug_config_write(struct vty *vty) int write = 0; if (CONF_LDP_DEBUG(hello, HELLO_RECV)) { - vty_outln (vty,"debug mpls ldp discovery hello recv"); + vty_out (vty,"debug mpls ldp discovery hello recv\n"); write = 1; } if (CONF_LDP_DEBUG(hello, HELLO_SEND)) { - vty_outln (vty,"debug mpls ldp discovery hello sent"); + vty_out (vty,"debug mpls ldp discovery hello sent\n"); write = 1; } if (CONF_LDP_DEBUG(errors, ERRORS)) { - vty_outln (vty, "debug mpls ldp errors"); + vty_out (vty, "debug mpls ldp errors\n"); write = 1; } if (CONF_LDP_DEBUG(event, EVENT)) { - vty_outln (vty, "debug mpls ldp event"); + vty_out (vty, "debug mpls ldp event\n"); write = 1; } if (CONF_LDP_DEBUG(msg, MSG_RECV_ALL)) { - vty_outln (vty, "debug mpls ldp messages recv all"); + vty_out (vty, "debug mpls ldp messages recv all\n"); write = 1; } else if (CONF_LDP_DEBUG(msg, MSG_RECV)) { - vty_outln (vty, "debug mpls ldp messages recv"); + vty_out (vty, "debug mpls ldp messages recv\n"); write = 1; } if (CONF_LDP_DEBUG(msg, MSG_SEND_ALL)) { - vty_outln (vty, "debug mpls ldp messages sent all"); + vty_out (vty, "debug mpls ldp messages sent all\n"); write = 1; } else if (CONF_LDP_DEBUG(msg, MSG_SEND)) { - vty_outln (vty, "debug mpls ldp messages sent"); + vty_out (vty, "debug mpls ldp messages sent\n"); write = 1; } if (CONF_LDP_DEBUG(zebra, ZEBRA)) { - vty_outln (vty, "debug mpls ldp zebra"); + vty_out (vty, "debug mpls ldp zebra\n"); write = 1; } diff --git a/ldpd/ldp_vty_conf.c b/ldpd/ldp_vty_conf.c index 2e52188a8..4e900ca93 100644 --- a/ldpd/ldp_vty_conf.c +++ b/ldpd/ldp_vty_conf.c @@ -115,16 +115,16 @@ ldp_af_iface_config_write(struct vty *vty, int af) if (!ia->enabled) continue; - vty_outln (vty, " !"); - vty_outln (vty, " interface %s", iface->name); + vty_out (vty, " !\n"); + vty_out (vty, " interface %s\n", iface->name); if (ia->hello_holdtime != LINK_DFLT_HOLDTIME && ia->hello_holdtime != 0) - vty_outln (vty, " discovery hello holdtime %u", + vty_out (vty, " discovery hello holdtime %u\n", ia->hello_holdtime); if (ia->hello_interval != DEFAULT_HELLO_INTERVAL && ia->hello_interval != 0) - vty_outln (vty, " discovery hello interval %u", + vty_out (vty, " discovery hello interval %u\n", ia->hello_interval); } } @@ -138,16 +138,16 @@ ldp_af_config_write(struct vty *vty, int af, struct ldpd_conf *conf, if (!(af_conf->flags & F_LDPD_AF_ENABLED)) return; - vty_outln (vty, " !"); - vty_outln (vty, " address-family %s", af_name(af)); + vty_out (vty, " !\n"); + vty_out (vty, " address-family %s\n", af_name(af)); if (af_conf->lhello_holdtime != LINK_DFLT_HOLDTIME && af_conf->lhello_holdtime != 0 ) - vty_outln (vty, " discovery hello holdtime %u", + vty_out (vty, " discovery hello holdtime %u\n", af_conf->lhello_holdtime); if (af_conf->lhello_interval != DEFAULT_HELLO_INTERVAL && af_conf->lhello_interval != 0) - vty_outln (vty, " discovery hello interval %u", + vty_out (vty, " discovery hello interval %u\n", af_conf->lhello_interval); if (af_conf->flags & F_LDPD_AF_THELLO_ACCEPT) { @@ -155,24 +155,24 @@ ldp_af_config_write(struct vty *vty, int af, struct ldpd_conf *conf, if (af_conf->acl_thello_accept_from[0] != '\0') vty_out(vty, " from %s", af_conf->acl_thello_accept_from); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } if (af_conf->thello_holdtime != TARGETED_DFLT_HOLDTIME && af_conf->thello_holdtime != 0) - vty_outln (vty, " discovery targeted-hello holdtime %u", + vty_out (vty, " discovery targeted-hello holdtime %u\n", af_conf->thello_holdtime); if (af_conf->thello_interval != DEFAULT_HELLO_INTERVAL && af_conf->thello_interval != 0) - vty_outln (vty, " discovery targeted-hello interval %u", + vty_out (vty, " discovery targeted-hello interval %u\n", af_conf->thello_interval); if (ldp_addrisset(af, &af_conf->trans_addr)) - vty_outln (vty, " discovery transport-address %s", + vty_out (vty, " discovery transport-address %s\n", log_addr(af, &af_conf->trans_addr)); else - vty_outln (vty, - " ! Incomplete config, specify a discovery " "transport-address"); + vty_out (vty, + " ! Incomplete config, specify a discovery transport-address\n"); 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, VTYNL); + vty_out (vty, "\n"); } 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, VTYNL); + vty_out (vty, "\n"); } 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, VTYNL); + vty_out (vty, "\n"); } if (af_conf->acl_label_accept_for[0] != '\0' || @@ -214,26 +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, VTYNL); + vty_out (vty, "\n"); } if (af_conf->flags & F_LDPD_AF_NO_GTSM) - vty_outln (vty, " ttl-security disable"); + vty_out (vty, " ttl-security disable\n"); if (af_conf->keepalive != DEFAULT_KEEPALIVE) - vty_outln (vty, " session holdtime %u",af_conf->keepalive); + vty_out (vty, " session holdtime %u\n",af_conf->keepalive); RB_FOREACH(tnbr, tnbr_head, &ldpd_conf->tnbr_tree) { if (tnbr->af == af) { - vty_outln (vty, " !"); - vty_outln (vty, " neighbor %s targeted", + vty_out (vty, " !\n"); + vty_out (vty, " neighbor %s targeted\n", log_addr(tnbr->af, &tnbr->addr)); } } ldp_af_iface_config_write(vty, af); - vty_outln (vty, " !"); + vty_out (vty, " !\n"); } int @@ -244,61 +244,61 @@ ldp_config_write(struct vty *vty) if (!(ldpd_conf->flags & F_LDPD_ENABLED)) return (0); - vty_outln (vty, "mpls ldp"); + vty_out (vty, "mpls ldp\n"); if (ldpd_conf->rtr_id.s_addr != 0) - vty_outln (vty, " router-id %s", + vty_out (vty, " router-id %s\n", inet_ntoa(ldpd_conf->rtr_id)); if (ldpd_conf->lhello_holdtime != LINK_DFLT_HOLDTIME && ldpd_conf->lhello_holdtime != 0) - vty_outln (vty, " discovery hello holdtime %u", + vty_out (vty, " discovery hello holdtime %u\n", ldpd_conf->lhello_holdtime); if (ldpd_conf->lhello_interval != DEFAULT_HELLO_INTERVAL && ldpd_conf->lhello_interval != 0) - vty_outln (vty, " discovery hello interval %u", + vty_out (vty, " discovery hello interval %u\n", ldpd_conf->lhello_interval); if (ldpd_conf->thello_holdtime != TARGETED_DFLT_HOLDTIME && ldpd_conf->thello_holdtime != 0) - vty_outln (vty, " discovery targeted-hello holdtime %u", + vty_out (vty, " discovery targeted-hello holdtime %u\n", ldpd_conf->thello_holdtime); if (ldpd_conf->thello_interval != DEFAULT_HELLO_INTERVAL && ldpd_conf->thello_interval != 0) - vty_outln (vty, " discovery targeted-hello interval %u", + vty_out (vty, " discovery targeted-hello interval %u\n", ldpd_conf->thello_interval); if (ldpd_conf->trans_pref == DUAL_STACK_LDPOV4) - vty_outln (vty, - " dual-stack transport-connection prefer ipv4"); + vty_out (vty, + " dual-stack transport-connection prefer ipv4\n"); if (ldpd_conf->flags & F_LDPD_DS_CISCO_INTEROP) - vty_outln (vty, " dual-stack cisco-interop"); + vty_out (vty, " dual-stack cisco-interop\n"); RB_FOREACH(nbrp, nbrp_head, &ldpd_conf->nbrp_tree) { if (nbrp->flags & F_NBRP_KEEPALIVE) - vty_outln (vty, " neighbor %s session holdtime %u", + vty_out (vty, " neighbor %s session holdtime %u\n", inet_ntoa(nbrp->lsr_id),nbrp->keepalive); if (nbrp->flags & F_NBRP_GTSM) { if (nbrp->gtsm_enabled) - vty_outln (vty, " neighbor %s ttl-security hops " - "%u", inet_ntoa(nbrp->lsr_id), + vty_out (vty, " neighbor %s ttl-security hops " + "%u\n", inet_ntoa(nbrp->lsr_id), nbrp->gtsm_hops); else - vty_outln (vty, " neighbor %s ttl-security " - "disable",inet_ntoa(nbrp->lsr_id)); + vty_out (vty, " neighbor %s ttl-security " + "disable\n",inet_ntoa(nbrp->lsr_id)); } if (nbrp->auth.method == AUTH_MD5SIG) - vty_outln (vty, " neighbor %s password %s", + vty_out (vty, " neighbor %s password %s\n", 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_outln (vty, " !"); - vty_outln (vty, "!"); + vty_out (vty, " !\n"); + vty_out (vty, "!\n"); return (1); } @@ -309,34 +309,34 @@ ldp_l2vpn_pw_config_write(struct vty *vty, struct l2vpn_pw *pw) int missing_lsrid = 0; int missing_pwid = 0; - vty_outln (vty, " !"); - vty_outln (vty, " member pseudowire %s", pw->ifname); + vty_out (vty, " !\n"); + vty_out (vty, " member pseudowire %s\n", pw->ifname); if (pw->lsr_id.s_addr != INADDR_ANY) - vty_outln (vty, " neighbor lsr-id %s",inet_ntoa(pw->lsr_id)); + vty_out (vty, " neighbor lsr-id %s\n",inet_ntoa(pw->lsr_id)); else missing_lsrid = 1; if (pw->flags & F_PW_STATIC_NBR_ADDR) - vty_outln (vty, " neighbor address %s", + vty_out (vty, " neighbor address %s\n", log_addr(pw->af, &pw->addr)); if (pw->pwid != 0) - vty_outln (vty, " pw-id %u", pw->pwid); + vty_out (vty, " pw-id %u\n", pw->pwid); else missing_pwid = 1; if (!(pw->flags & F_PW_CWORD_CONF)) - vty_outln (vty, " control-word exclude"); + vty_out (vty, " control-word exclude\n"); if (!(pw->flags & F_PW_STATUSTLV_CONF)) - vty_outln (vty, " pw-status disable"); + vty_out (vty, " pw-status disable\n"); if (missing_lsrid) - vty_outln (vty, - " ! Incomplete config, specify a neighbor " "lsr-id"); + vty_out (vty, + " ! Incomplete config, specify a neighbor lsr-id\n"); if (missing_pwid) - vty_outln (vty," ! Incomplete config, specify a pw-id"); + vty_out (vty," ! Incomplete config, specify a pw-id\n"); } int @@ -347,27 +347,27 @@ ldp_l2vpn_config_write(struct vty *vty) struct l2vpn_pw *pw; RB_FOREACH(l2vpn, l2vpn_head, &ldpd_conf->l2vpn_tree) { - vty_outln (vty, "l2vpn %s type vpls", l2vpn->name); + vty_out (vty, "l2vpn %s type vpls\n", l2vpn->name); if (l2vpn->pw_type != DEFAULT_PW_TYPE) - vty_outln (vty, " vc type ethernet-tagged"); + vty_out (vty, " vc type ethernet-tagged\n"); if (l2vpn->mtu != DEFAULT_L2VPN_MTU) - vty_outln (vty, " mtu %u", l2vpn->mtu); + vty_out (vty, " mtu %u\n", l2vpn->mtu); if (l2vpn->br_ifname[0] != '\0') - vty_outln (vty, " bridge %s",l2vpn->br_ifname); + vty_out (vty, " bridge %s\n",l2vpn->br_ifname); RB_FOREACH(lif, l2vpn_if_head, &l2vpn->if_tree) - vty_outln (vty, " member interface %s",lif->ifname); + vty_out (vty, " member interface %s\n",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_outln (vty, " !"); - vty_outln (vty, "!"); + vty_out (vty, " !\n"); + vty_out (vty, "!\n"); } return (0); @@ -473,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_outln (vty, "%% Invalid holdtime"); + vty_out (vty, "%% Invalid holdtime\n"); return (CMD_WARNING_CONFIG_FAILED); } @@ -568,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_outln (vty, "%% Invalid interval"); + vty_out (vty, "%% Invalid interval\n"); return (CMD_WARNING_CONFIG_FAILED); } @@ -686,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_outln (vty, "%% Malformed address"); + vty_out (vty, "%% Malformed address\n"); return (CMD_WARNING_CONFIG_FAILED); } secs = strtol(seconds_str, &ep, 10); if (*ep != '\0' || secs < MIN_KEEPALIVE || secs > MAX_KEEPALIVE) { - vty_outln (vty, "%% Invalid holdtime"); + vty_out (vty, "%% Invalid holdtime\n"); return (CMD_SUCCESS); } @@ -732,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_outln (vty, "%% Invalid holdtime"); + vty_out (vty, "%% Invalid holdtime\n"); return (CMD_SUCCESS); } @@ -778,7 +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_outln (vty,"%% Interface is already in use"); + vty_out (vty,"%% Interface is already in use\n"); return (CMD_SUCCESS); } @@ -825,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_outln (vty, "%% Malformed address"); + vty_out (vty, "%% Malformed address\n"); return (CMD_SUCCESS); } } @@ -846,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_outln (vty, "%% Malformed address"); + vty_out (vty, "%% Malformed address\n"); return (CMD_WARNING_CONFIG_FAILED); } if (af == AF_INET6 && IN6_IS_SCOPE_EMBED(&addr.v6)) { - vty_outln (vty, "%% Address can not be link-local"); + vty_out (vty, "%% Address can not be link-local\n"); return (CMD_WARNING_CONFIG_FAILED); } @@ -1022,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_outln (vty, "%% Malformed address"); + vty_out (vty, "%% Malformed address\n"); return (CMD_SUCCESS); } } @@ -1068,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_outln (vty, "%% Malformed address"); + vty_out (vty, "%% Malformed address\n"); return (CMD_WARNING_CONFIG_FAILED); } @@ -1114,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_outln (vty, "%% Malformed address"); + vty_out (vty, "%% Malformed address\n"); return (CMD_WARNING_CONFIG_FAILED); } if (hops_str) { hops = strtol(hops_str, &ep, 10); if (*ep != '\0' || hops < 1 || hops > 254) { - vty_outln (vty, "%% Invalid hop count"); + vty_out (vty, "%% Invalid hop count\n"); return (CMD_SUCCESS); } } @@ -1226,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_outln (vty, "%% Invalid MTU"); + vty_out (vty, "%% Invalid MTU\n"); return (CMD_WARNING_CONFIG_FAILED); } @@ -1286,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_outln (vty, "%% Interface is already in use"); + vty_out (vty, "%% Interface is already in use\n"); return (CMD_SUCCESS); } @@ -1329,7 +1329,7 @@ ldp_vty_l2vpn_pseudowire(struct vty *vty, int disable, const char *ifname) } if (ldp_iface_is_configured(vty_conf, ifname)) { - vty_outln (vty, "%% Interface is already in use"); + vty_out (vty, "%% Interface is already in use\n"); return (CMD_SUCCESS); } @@ -1373,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_outln (vty, "%% Malformed address"); + vty_out (vty, "%% Malformed address\n"); return (CMD_WARNING_CONFIG_FAILED); } @@ -1400,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_outln (vty, "%% Malformed address"); + vty_out (vty, "%% Malformed address\n"); return (CMD_WARNING_CONFIG_FAILED); } @@ -1423,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_outln (vty, "%% Invalid pw-id"); + vty_out (vty, "%% Invalid pw-id\n"); return (CMD_WARNING_CONFIG_FAILED); } diff --git a/ldpd/ldp_vty_exec.c b/ldpd/ldp_vty_exec.c index c95606702..bec1375bd 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_outln (vty, "%-4s %-11s %-6s %-8s %-12s %3u", + vty_out (vty, "%-4s %-11s %-6s %-8s %-12s %3u\n", 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); break; case IMSG_CTL_END: - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return (1); default: break; @@ -211,13 +211,13 @@ show_discovery_msg(struct vty *vty, struct imsg *imsg, vty_out(vty, "%-8s %-15s ", "Targeted", addr); if (strlen(addr) > 15) - vty_out(vty, "%s%46s", VTYNL, " "); + vty_out(vty, "\n%46s", " "); break; } - vty_outln (vty, "%9u", adj->holdtime); + vty_out (vty, "%9u\n", adj->holdtime); break; case IMSG_CTL_END: - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return (1); default: break; @@ -232,23 +232,23 @@ show_discovery_detail_adj(struct vty *vty, char *buffer, struct ctl_adj *adj) size_t buflen = strlen(buffer); snprintf(buffer + buflen, LDPBUFSIZ - buflen, - " LSR Id: %s:0%s", inet_ntoa(adj->id), VTYNL); + " LSR Id: %s:0\n", inet_ntoa(adj->id)); buflen = strlen(buffer); snprintf(buffer + buflen, LDPBUFSIZ - buflen, - " Source address: %s%s", - log_addr(adj->af, &adj->src_addr), VTYNL); + " Source address: %s\n", + log_addr(adj->af, &adj->src_addr)); buflen = strlen(buffer); snprintf(buffer + buflen, LDPBUFSIZ - buflen, - " Transport address: %s%s", - log_addr(adj->af, &adj->trans_addr), VTYNL); + " Transport address: %s\n", + log_addr(adj->af, &adj->trans_addr)); buflen = strlen(buffer); snprintf(buffer + buflen, LDPBUFSIZ - buflen, - " Hello hold time: %u secs (due in %u secs)%s", - adj->holdtime, adj->holdtime_remaining, VTYNL); + " Hello hold time: %u secs (due in %u secs)\n", + adj->holdtime, adj->holdtime_remaining); buflen = strlen(buffer); snprintf(buffer + buflen, LDPBUFSIZ - buflen, - " Dual-stack capability TLV: %s%s", - (adj->ds_tlv) ? "yes" : "no", VTYNL); + " Dual-stack capability TLV: %s\n", + (adj->ds_tlv) ? "yes" : "no"); } static int @@ -279,8 +279,8 @@ show_discovery_detail_msg(struct vty *vty, struct imsg *imsg, buflen = strlen(ifaces_buffer); snprintf(ifaces_buffer + buflen, LDPBUFSIZ - buflen, - " %s: %s%s", iface->name, (iface->no_adj) ? - "(no adjacencies)" : "", VTYNL); + " %s: %s\n", iface->name, (iface->no_adj) ? + "(no adjacencies)" : ""); break; case IMSG_CTL_SHOW_DISC_TNBR: tnbr = imsg->data; @@ -292,9 +292,9 @@ show_discovery_detail_msg(struct vty *vty, struct imsg *imsg, tnbr->af))->trans_addr; buflen = strlen(tnbrs_buffer); snprintf(tnbrs_buffer + buflen, LDPBUFSIZ - buflen, - " %s -> %s: %s%s", log_addr(tnbr->af, trans_addr), + " %s -> %s: %s\n", log_addr(tnbr->af, trans_addr), log_addr(tnbr->af, &tnbr->addr), (tnbr->no_adj) ? - "(no adjacencies)" : "", VTYNL); + "(no adjacencies)" : ""); break; case IMSG_CTL_SHOW_DISC_ADJ: adj = imsg->data; @@ -313,20 +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_outln (vty, "Local:"); - vty_outln (vty, " LSR Id: %s:0",inet_ntoa(rtr_id)); + vty_out (vty, "Local:\n"); + vty_out (vty, " LSR Id: %s:0\n",inet_ntoa(rtr_id)); if (ldpd_conf->ipv4.flags & F_LDPD_AF_ENABLED) - vty_outln (vty, " Transport Address (IPv4): %s", + vty_out (vty, " Transport Address (IPv4): %s\n", log_addr(AF_INET, &ldpd_conf->ipv4.trans_addr)); if (ldpd_conf->ipv6.flags & F_LDPD_AF_ENABLED) - vty_outln (vty, " Transport Address (IPv6): %s", + vty_out (vty, " Transport Address (IPv6): %s\n", log_addr(AF_INET6, &ldpd_conf->ipv6.trans_addr)); - vty_outln (vty, "Discovery Sources:"); - vty_outln (vty, " Interfaces:"); + vty_out (vty, "Discovery Sources:\n"); + vty_out (vty, " Interfaces:\n"); vty_out(vty, "%s", ifaces_buffer); - vty_outln (vty, " Targeted Hellos:"); + vty_out (vty, " Targeted Hellos:\n"); vty_out(vty, "%s", tnbrs_buffer); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return (1); default: break; @@ -511,8 +511,8 @@ show_nbr_msg(struct vty *vty, struct imsg *imsg, struct show_params *params) af_name(nbr->af), inet_ntoa(nbr->id), nbr_state_name(nbr->nbr_state), addr); if (strlen(addr) > 15) - vty_out(vty, "%s%48s", VTYNL, " "); - vty_outln (vty, " %8s", log_time(nbr->uptime)); + vty_out(vty, "\n%48s", " "); + vty_out (vty, " %8s\n", log_time(nbr->uptime)); break; case IMSG_CTL_END: return (1); @@ -531,12 +531,12 @@ show_nbr_detail_adj(struct vty *vty, char *buffer, struct ctl_adj *adj) switch (adj->type) { case HELLO_LINK: snprintf(buffer + buflen, LDPBUFSIZ - buflen, - " Interface: %s%s", adj->ifname, VTYNL); + " Interface: %s\n", adj->ifname); break; case HELLO_TARGETED: snprintf(buffer + buflen, LDPBUFSIZ - buflen, - " Targeted Hello: %s%s", log_addr(adj->af, - &adj->src_addr), VTYNL); + " Targeted Hello: %s\n", log_addr(adj->af, + &adj->src_addr)); break; } } @@ -557,41 +557,41 @@ show_nbr_detail_msg(struct vty *vty, struct imsg *imsg, v4adjs_buffer[0] = '\0'; v6adjs_buffer[0] = '\0'; - vty_outln (vty, "Peer LDP Identifier: %s:0", + vty_out (vty, "Peer LDP Identifier: %s:0\n", inet_ntoa(nbr->id)); - vty_outln (vty, " TCP connection: %s:%u - %s:%u", + vty_out (vty, " TCP connection: %s:%u - %s:%u\n", log_addr(nbr->af, &nbr->laddr), ntohs(nbr->lport), log_addr(nbr->af, &nbr->raddr),ntohs(nbr->rport)); - vty_outln (vty, " Authentication: %s", + vty_out (vty, " Authentication: %s\n", (nbr->auth_method == AUTH_MD5SIG) ? "TCP MD5 Signature" : "none"); - vty_outln(vty, " Session Holdtime: %u secs; " - "KeepAlive interval: %u secs", nbr->holdtime, + vty_out(vty, " Session Holdtime: %u secs; " + "KeepAlive interval: %u secs\n", nbr->holdtime, nbr->holdtime / KEEPALIVE_PER_PERIOD); - vty_outln(vty, " State: %s; Downstream-Unsolicited", + vty_out(vty, " State: %s; Downstream-Unsolicited\n", nbr_state_name(nbr->nbr_state)); - vty_outln (vty, " Up time: %s",log_time(nbr->uptime)); + vty_out (vty, " Up time: %s\n",log_time(nbr->uptime)); stats = &nbr->stats; - vty_outln (vty, " Messages sent/rcvd:"); - vty_outln (vty, " - Keepalive Messages: %u/%u", + vty_out (vty, " Messages sent/rcvd:\n"); + vty_out (vty, " - Keepalive Messages: %u/%u\n", stats->kalive_sent, stats->kalive_rcvd); - vty_outln (vty, " - Address Messages: %u/%u", + vty_out (vty, " - Address Messages: %u/%u\n", stats->addr_sent, stats->addr_rcvd); - vty_outln (vty, " - Address Withdraw Messages: %u/%u", + vty_out (vty, " - Address Withdraw Messages: %u/%u\n", stats->addrwdraw_sent, stats->addrwdraw_rcvd); - vty_outln (vty, " - Notification Messages: %u/%u", + vty_out (vty, " - Notification Messages: %u/%u\n", stats->notif_sent, stats->notif_rcvd); - vty_outln (vty, " - Capability Messages: %u/%u", + vty_out (vty, " - Capability Messages: %u/%u\n", stats->capability_sent, stats->capability_rcvd); - vty_outln (vty, " - Label Mapping Messages: %u/%u", + vty_out (vty, " - Label Mapping Messages: %u/%u\n", stats->labelmap_sent, stats->labelmap_rcvd); - vty_outln (vty, " - Label Request Messages: %u/%u", + vty_out (vty, " - Label Request Messages: %u/%u\n", stats->labelreq_sent, stats->labelreq_rcvd); - vty_outln (vty, " - Label Withdraw Messages: %u/%u", + vty_out (vty, " - Label Withdraw Messages: %u/%u\n", stats->labelwdraw_sent, stats->labelwdraw_rcvd); - vty_outln (vty, " - Label Release Messages: %u/%u", + vty_out (vty, " - Label Release Messages: %u/%u\n", stats->labelrel_sent, stats->labelrel_rcvd); - vty_outln (vty, " - Label Abort Request Messages: %u/%u", + vty_out (vty, " - Label Abort Request Messages: %u/%u\n", stats->labelabreq_sent, stats->labelabreq_rcvd); show_nbr_capabilities(vty, nbr); @@ -611,16 +611,16 @@ show_nbr_detail_msg(struct vty *vty, struct imsg *imsg, } break; case IMSG_CTL_SHOW_NBR_END: - vty_outln (vty, " LDP Discovery Sources:"); + vty_out (vty, " LDP Discovery Sources:\n"); if (v4adjs_buffer[0] != '\0') { - vty_outln (vty, " IPv4:"); + vty_out (vty, " IPv4:\n"); vty_out(vty, "%s", v4adjs_buffer); } if (v6adjs_buffer[0] != '\0') { - vty_outln (vty, " IPv6:"); + vty_out (vty, " IPv6:\n"); vty_out(vty, "%s", v6adjs_buffer); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); break; case IMSG_CTL_END: return (1); @@ -869,18 +869,17 @@ show_nbr_detail_msg_json(struct imsg *imsg, struct show_params *params, void show_nbr_capabilities(struct vty *vty, struct ctl_nbr *nbr) { - vty_outln (vty, " Capabilities Sent:%s" - " - Dynamic Announcement (0x0506)%s" - " - Typed Wildcard (0x050B)%s" - " - Unrecognized Notification (0x0603)", - VTYNL, VTYNL, VTYNL); - vty_outln (vty, " Capabilities Received:"); + vty_out (vty, " Capabilities Sent:\n" + " - Dynamic Announcement (0x0506)\n" + " - Typed Wildcard (0x050B)\n" + " - Unrecognized Notification (0x0603)\n"); + vty_out (vty, " Capabilities Received:\n"); if (nbr->flags & F_NBR_CAP_DYNAMIC) - vty_outln (vty," - Dynamic Announcement (0x0506)"); + vty_out (vty," - Dynamic Announcement (0x0506)\n"); if (nbr->flags & F_NBR_CAP_TWCARD) - vty_outln (vty, " - Typed Wildcard (0x050B)"); + vty_out (vty, " - Typed Wildcard (0x050B)\n"); if (nbr->flags & F_NBR_CAP_UNOTIF) - vty_outln (vty," - Unrecognized Notification (0x0603)"); + vty_out (vty," - Unrecognized Notification (0x0603)\n"); } static int @@ -895,13 +894,13 @@ show_nbr_capabilities_msg(struct vty *vty, struct imsg *imsg, struct show_params if (nbr->nbr_state != NBR_STA_OPER) break; - vty_outln (vty, "Peer LDP Identifier: %s:0", + vty_out (vty, "Peer LDP Identifier: %s:0\n", inet_ntoa(nbr->id)); show_nbr_capabilities(vty, nbr); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); break; case IMSG_CTL_END: - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return (1); default: break; @@ -1021,13 +1020,13 @@ 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", VTYNL, " "); - vty_outln (vty, " %-15s %-11s %-13s %6s", inet_ntoa(rt->nexthop), + vty_out(vty, "\n%25s", " "); + vty_out (vty, " %-15s %-11s %-13s %6s\n", inet_ntoa(rt->nexthop), log_label(rt->local_label), log_label(rt->remote_label), rt->in_use ? "yes" : "no"); break; case IMSG_CTL_END: - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return (1); default: break; @@ -1069,37 +1068,37 @@ 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_outln (vty, "%s", dstnet); - vty_outln (vty, "%-8sLocal binding: label: %s", "", + vty_out (vty, "%s\n", dstnet); + vty_out (vty, "%-8sLocal binding: label: %s\n", "", log_label(rt->local_label)); break; case IMSG_CTL_SHOW_LIB_SENT: upstream = 1; buflen = strlen(sent_buffer); snprintf(sent_buffer + buflen, LDPBUFSIZ - buflen, - "%12s%s:0%s", "", inet_ntoa(rt->nexthop), VTYNL); + "%12s%s:0\n", "", inet_ntoa(rt->nexthop)); break; case IMSG_CTL_SHOW_LIB_RCVD: downstream = 1; buflen = strlen(rcvd_buffer); snprintf(rcvd_buffer + buflen, LDPBUFSIZ - buflen, - "%12s%s:0, label %s%s%s", "", inet_ntoa(rt->nexthop), + "%12s%s:0, label %s%s\n", "", inet_ntoa(rt->nexthop), log_label(rt->remote_label), - rt->in_use ? " (in use)" : "", VTYNL); + rt->in_use ? " (in use)" : ""); break; case IMSG_CTL_SHOW_LIB_END: if (upstream) { - vty_outln (vty, "%-8sAdvertised to:", ""); + vty_out (vty, "%-8sAdvertised to:\n", ""); vty_out(vty, "%s", sent_buffer); } if (downstream) { - vty_outln (vty, "%-8sRemote bindings:", ""); + vty_out (vty, "%-8sRemote bindings:\n", ""); vty_out(vty, "%s", rcvd_buffer); } else - vty_outln (vty, "%-8sNo remote bindings",""); + vty_out (vty, "%-8sNo remote bindings\n",""); break; case IMSG_CTL_END: - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return (1); default: break; @@ -1235,33 +1234,33 @@ show_l2vpn_binding_msg(struct vty *vty, struct imsg *imsg, case IMSG_CTL_SHOW_L2VPN_BINDING: pw = imsg->data; - vty_outln (vty, " Destination Address: %s, VC ID: %u", + vty_out (vty, " Destination Address: %s, VC ID: %u\n", inet_ntoa(pw->lsr_id), pw->pwid); /* local binding */ if (pw->local_label != NO_LABEL) { - vty_outln (vty, " Local Label: %u", + vty_out (vty, " Local Label: %u\n", pw->local_label); - vty_outln (vty, "%-8sCbit: %u, VC Type: %s, " - "GroupID: %u", "", pw->local_cword, + vty_out (vty, "%-8sCbit: %u, VC Type: %s, " + "GroupID: %u\n", "", pw->local_cword, pw_type_name(pw->type),pw->local_gid); - vty_outln (vty, "%-8sMTU: %u", "",pw->local_ifmtu); + vty_out (vty, "%-8sMTU: %u\n", "",pw->local_ifmtu); } else - vty_outln (vty," Local Label: unassigned"); + vty_out (vty," Local Label: unassigned\n"); /* remote binding */ if (pw->remote_label != NO_LABEL) { - vty_outln (vty, " Remote Label: %u", + vty_out (vty, " Remote Label: %u\n", pw->remote_label); - vty_outln (vty, "%-8sCbit: %u, VC Type: %s, " - "GroupID: %u", "", pw->remote_cword, + vty_out (vty, "%-8sCbit: %u, VC Type: %s, " + "GroupID: %u\n", "", pw->remote_cword, pw_type_name(pw->type),pw->remote_gid); - vty_outln (vty, "%-8sMTU: %u", "",pw->remote_ifmtu); + vty_out (vty, "%-8sMTU: %u\n", "",pw->remote_ifmtu); } else - vty_outln (vty," Remote Label: unassigned"); + vty_out (vty," Remote Label: unassigned\n"); break; case IMSG_CTL_END: - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return (1); default: break; @@ -1340,12 +1339,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_outln (vty, "%-9s %-15s %-10u %-16s %-10s", pw->ifname, + vty_out (vty, "%-9s %-15s %-10u %-16s %-10s\n", pw->ifname, inet_ntoa(pw->lsr_id), pw->pwid, pw->l2vpn_name, (pw->status ? "UP" : "DOWN")); break; case IMSG_CTL_END: - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return (1); default: break; @@ -1540,7 +1539,7 @@ ldp_vty_dispatch(struct vty *vty, struct imsgbuf *ibuf, enum show_command cmd, done: close(ibuf->fd); if (json) { - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } @@ -1584,7 +1583,7 @@ ldp_vty_show_binding(struct vty *vty, const char *af_str, int detail, int json) params.json = json; if (!params.detail && !params.json) - vty_outln (vty, "%-4s %-20s %-15s %-11s %-13s %6s", "AF", + vty_out (vty, "%-4s %-20s %-15s %-11s %-13s %6s\n", "AF", "Destination", "Nexthop", "Local Label", "Remote Label", "In Use"); @@ -1612,7 +1611,7 @@ ldp_vty_show_discovery(struct vty *vty, const char *af_str, int detail, params.json = json; if (!params.detail && !params.json) - vty_outln (vty, "%-4s %-15s %-8s %-15s %9s", + vty_out (vty, "%-4s %-15s %-8s %-15s %9s\n", "AF", "ID", "Type", "Source", "Holdtime"); if (params.detail) @@ -1643,7 +1642,7 @@ ldp_vty_show_interface(struct vty *vty, const char *af_str, int json) /* header */ if (!params.json) { - vty_outln (vty, "%-4s %-11s %-6s %-8s %-12s %3s", "AF", + vty_out (vty, "%-4s %-11s %-6s %-8s %-12s %3s\n", "AF", "Interface", "State", "Uptime", "Hello Timers","ac"); } @@ -1688,18 +1687,17 @@ ldp_vty_show_capabilities(struct vty *vty, int json) "0x0603"); json_object_array_add(json_array, json_cap); - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); return (0); } - vty_outln (vty, - "Supported LDP Capabilities%s" - " * Dynamic Announcement (0x0506)%s" - " * Typed Wildcard (0x050B)%s" - " * Unrecognized Notification (0x0603)%s", VTYNL, - VTYNL, VTYNL, VTYNL); + vty_out (vty, + "Supported LDP Capabilities\n" + " * Dynamic Announcement (0x0506)\n" + " * Typed Wildcard (0x050B)\n" + " * Unrecognized Notification (0x0603)\n\n"); return (0); } @@ -1722,7 +1720,7 @@ ldp_vty_show_neighbor(struct vty *vty, int capabilities, int detail, int json) params.detail = 1; if (!params.detail && !params.json) - vty_outln (vty, "%-4s %-15s %-11s %-15s %8s", + vty_out (vty, "%-4s %-15s %-11s %-15s %8s\n", "AF", "ID", "State", "Remote Address","Uptime"); imsg_compose(&ibuf, IMSG_CTL_SHOW_NBR, 0, 0, -1, NULL, 0); @@ -1759,9 +1757,9 @@ ldp_vty_show_atom_vc(struct vty *vty, int json) if (!params.json) { /* header */ - vty_outln (vty, "%-9s %-15s %-10s %-16s %-10s", + vty_out (vty, "%-9s %-15s %-10s %-16s %-10s\n", "Interface", "Peer ID", "VC ID", "Name","Status"); - vty_outln (vty, "%-9s %-15s %-10s %-16s %-10s", + vty_out (vty, "%-9s %-15s %-10s %-16s %-10s\n", "---------", "---------------", "----------", "----------------", "----------"); } @@ -1780,7 +1778,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_outln (vty, "%% Malformed address"); + vty_out (vty, "%% Malformed address\n"); return (CMD_WARNING); } diff --git a/lib/agentx.c b/lib/agentx.c index 53e5f2bc5..30c03e6cf 100644 --- a/lib/agentx.c +++ b/lib/agentx.c @@ -168,7 +168,7 @@ static int config_write_agentx (struct vty *vty) { if (agentx_enabled) - vty_outln (vty, "agentx"); + vty_out (vty, "agentx\n"); return 1; } @@ -185,7 +185,7 @@ DEFUN (agentx_enable, agentx_enabled = 1; return CMD_SUCCESS; } - vty_outln (vty, "SNMP AgentX already enabled"); + vty_out (vty, "SNMP AgentX already enabled\n"); return CMD_SUCCESS; } @@ -196,7 +196,7 @@ DEFUN (no_agentx, "SNMP AgentX protocol settings\n") { if (!agentx_enabled) return CMD_SUCCESS; - vty_outln (vty, "SNMP AgentX support cannot be disabled once enabled"); + vty_out (vty, "SNMP AgentX support cannot be disabled once enabled\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -394,8 +394,8 @@ bfd_show_param(struct vty *vty, struct bfd_info *bfd_info, int bfd_tag, } else { - vty_outln (vty, " %s%sDetect Mul: %d, Min Rx interval: %d," - " Min Tx interval: %d", + vty_out (vty, " %s%sDetect Mul: %d, Min Rx interval: %d," + " Min Tx interval: %d\n", (extra_space) ? " ": "", (bfd_tag) ? "BFD: " : " ", bfd_info->detect_mult, bfd_info->required_min_rx, bfd_info->desired_min_tx); @@ -423,7 +423,7 @@ bfd_show_status(struct vty *vty, struct bfd_info *bfd_info, int bfd_tag, } else { - vty_outln (vty, " %s%sStatus: %s, Last update: %s", + vty_out (vty, " %s%sStatus: %s, Last update: %s\n", (extra_space) ? " ": "", (bfd_tag) ? "BFD: " : " ", bfd_get_status_str(bfd_info->status), time_buf); } @@ -451,7 +451,7 @@ bfd_show_info(struct vty *vty, struct bfd_info *bfd_info, int multihop, } else { - vty_outln (vty, " %sBFD: Type: %s", (extra_space) ? " " : "", + vty_out (vty, " %sBFD: Type: %s\n", (extra_space) ? " " : "", (multihop) ? "multi hop" : "single hop"); } @@ -461,7 +461,7 @@ bfd_show_info(struct vty *vty, struct bfd_info *bfd_info, int multihop, if (use_json) json_object_object_add(json_obj, "peerBfdInfo", json_bfd); else - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } /* diff --git a/lib/buffer.c b/lib/buffer.c index 649677fc9..5d458901e 100644 --- a/lib/buffer.c +++ b/lib/buffer.c @@ -199,6 +199,50 @@ buffer_putstr (struct buffer *b, const char *c) buffer_put(b, c, strlen(c)); } +/* Expand \n to \r\n */ +void +buffer_put_crlf(struct buffer *b, const void *origp, size_t origsize) +{ + struct buffer_data *data = b->tail; + const char *p = origp, *end = p + origsize, *lf; + size_t size; + + lf = memchr(p, '\n', end - p); + + /* We use even last one byte of data buffer. */ + while (p < end) + { + size_t avail, chunk; + + /* If there is no data buffer add it. */ + if (data == NULL || data->cp == b->size) + data = buffer_add (b); + + size = (lf ? lf : end) - p; + avail = b->size - data->cp; + + chunk = (size <= avail) ? size : avail; + memcpy (data->data + data->cp, p, chunk); + + p += chunk; + data->cp += chunk; + + if (lf && size <= avail) + { + /* we just copied up to (including) a '\n' */ + if (data->cp == b->size) + data = buffer_add (b); + data->data[data->cp++] = '\r'; + if (data->cp == b->size) + data = buffer_add (b); + data->data[data->cp++] = '\n'; + + p++; + lf = memchr(p, '\n', end - p); + } + } +} + /* Keep flushing data to the fd until the buffer is empty or an error is encountered or the operation would block. */ buffer_status_t diff --git a/lib/buffer.h b/lib/buffer.h index 67ac71cad..059f2cf33 100644 --- a/lib/buffer.h +++ b/lib/buffer.h @@ -41,6 +41,8 @@ extern void buffer_put (struct buffer *, const void *, size_t); extern void buffer_putc (struct buffer *, u_char); /* Add a NUL-terminated string to the end of the buffer. */ extern void buffer_putstr (struct buffer *, const char *); +/* Add given data, inline-expanding \n to \r\n */ +extern void buffer_put_crlf(struct buffer *b, const void *p, size_t size); /* Combine all accumulated (and unflushed) data inside the buffer into a single NUL-terminated string allocated using XMALLOC(MTYPE_TMP). Note diff --git a/lib/command.c b/lib/command.c index 18a28f57c..6d304fc12 100644 --- a/lib/command.c +++ b/lib/command.c @@ -433,27 +433,27 @@ static int config_write_host (struct vty *vty) { if (host.name) - vty_outln (vty, "hostname %s", host.name); + vty_out (vty, "hostname %s\n", host.name); if (host.encrypt) { if (host.password_encrypt) - vty_outln (vty, "password 8 %s", host.password_encrypt); + vty_out (vty, "password 8 %s\n", host.password_encrypt); if (host.enable_encrypt) - vty_outln (vty, "enable password 8 %s", host.enable_encrypt); + vty_out (vty, "enable password 8 %s\n", host.enable_encrypt); } else { if (host.password) - vty_outln (vty, "password %s", host.password); + vty_out (vty, "password %s\n", host.password); if (host.enable) - vty_outln (vty, "enable password %s", host.enable); + vty_out (vty, "enable password %s\n", host.enable); } if (zlog_default->default_lvl != LOG_DEBUG) { - vty_outln (vty,"! N.B. The 'log trap' command is deprecated."); - vty_outln (vty, "log trap %s", + vty_out (vty,"! N.B. The 'log trap' command is deprecated.\n"); + vty_out (vty, "log trap %s\n", zlog_priority[zlog_default->default_lvl]); } @@ -463,7 +463,7 @@ config_write_host (struct vty *vty) if (zlog_default->maxlvl[ZLOG_DEST_FILE] != zlog_default->default_lvl) vty_out (vty, " %s", zlog_priority[zlog_default->maxlvl[ZLOG_DEST_FILE]]); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } if (zlog_default->maxlvl[ZLOG_DEST_STDOUT] != ZLOG_DISABLED) @@ -472,13 +472,13 @@ config_write_host (struct vty *vty) if (zlog_default->maxlvl[ZLOG_DEST_STDOUT] != zlog_default->default_lvl) vty_out (vty, " %s", zlog_priority[zlog_default->maxlvl[ZLOG_DEST_STDOUT]]); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } if (zlog_default->maxlvl[ZLOG_DEST_MONITOR] == ZLOG_DISABLED) - vty_outln (vty,"no log monitor"); + vty_out (vty,"no log monitor\n"); else if (zlog_default->maxlvl[ZLOG_DEST_MONITOR] != zlog_default->default_lvl) - vty_outln (vty,"log monitor %s", + vty_out (vty,"log monitor %s\n", zlog_priority[zlog_default->maxlvl[ZLOG_DEST_MONITOR]]); if (zlog_default->maxlvl[ZLOG_DEST_SYSLOG] != ZLOG_DISABLED) @@ -487,33 +487,33 @@ config_write_host (struct vty *vty) if (zlog_default->maxlvl[ZLOG_DEST_SYSLOG] != zlog_default->default_lvl) vty_out (vty, " %s", zlog_priority[zlog_default->maxlvl[ZLOG_DEST_SYSLOG]]); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } if (zlog_default->facility != LOG_DAEMON) - vty_outln (vty, "log facility %s", + vty_out (vty, "log facility %s\n", facility_name(zlog_default->facility)); if (zlog_default->record_priority == 1) - vty_outln (vty, "log record-priority"); + vty_out (vty, "log record-priority\n"); if (zlog_default->timestamp_precision > 0) - vty_outln (vty, "log timestamp precision %d", + vty_out (vty, "log timestamp precision %d\n", zlog_default->timestamp_precision); if (host.advanced) - vty_outln (vty, "service advanced-vty"); + vty_out (vty, "service advanced-vty\n"); if (host.encrypt) - vty_outln (vty, "service password-encryption"); + vty_out (vty, "service password-encryption\n"); if (host.lines >= 0) - vty_outln (vty, "service terminal-length %d",host.lines); + vty_out (vty, "service terminal-length %d\n",host.lines); if (host.motdfile) - vty_outln (vty, "banner motd file %s", host.motdfile); + vty_out (vty, "banner motd file %s\n", host.motdfile); else if (! host.motd) - vty_outln (vty, "no banner motd"); + vty_out (vty, "no banner motd\n"); return 1; } @@ -718,13 +718,12 @@ cmd_variable_complete (struct cmd_token *token, const char *arg, vector comps) #define AUTOCOMP_INDENT 5 char * -cmd_variable_comp2str(vector comps, unsigned short cols, const char nl[]) +cmd_variable_comp2str(vector comps, unsigned short cols) { size_t bsz = 16; char *buf = XCALLOC(MTYPE_TMP, bsz); int lc = AUTOCOMP_INDENT; size_t cs = AUTOCOMP_INDENT; - size_t nllen = strlen(nl); size_t itemlen; snprintf(buf, bsz, "%*s", AUTOCOMP_INDENT, ""); for (size_t j = 0; j < vector_active (comps); j++) @@ -732,12 +731,12 @@ cmd_variable_comp2str(vector comps, unsigned short cols, const char nl[]) char *item = vector_slot (comps, j); itemlen = strlen(item); - if (cs + itemlen + nllen + AUTOCOMP_INDENT + 2 >= bsz) + if (cs + itemlen + AUTOCOMP_INDENT + 3 >= bsz) buf = XREALLOC(MTYPE_TMP, buf, (bsz *= 2)); if (lc + itemlen + 1 >= cols) { - cs += snprintf(&buf[cs], bsz - cs, "%s%*s", nl, AUTOCOMP_INDENT, ""); + cs += snprintf(&buf[cs], bsz - cs, "\n%*s", AUTOCOMP_INDENT, ""); lc = AUTOCOMP_INDENT; } @@ -1184,7 +1183,7 @@ DEFUN (config_terminal, vty->node = CONFIG_NODE; else { - vty_outln (vty, "VTY configuration is locked by other VTY"); + vty_out (vty, "VTY configuration is locked by other VTY\n"); return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -1381,10 +1380,10 @@ DEFUN (show_version, SHOW_STR "Displays zebra version\n") { - vty_outln (vty, "%s %s (%s).", FRR_FULL_NAME, FRR_VERSION, + vty_out (vty, "%s %s (%s).\n", FRR_FULL_NAME, FRR_VERSION, host.name ? host.name : ""); - vty_outln (vty, "%s%s", FRR_COPYRIGHT, GIT_INFO); - vty_outln (vty, "configured with:%s %s", VTYNL, + vty_out (vty, "%s%s\n", FRR_COPYRIGHT, GIT_INFO); + vty_out (vty, "configured with:\n %s\n", FRR_CONFIG_ARGS); return CMD_SUCCESS; @@ -1408,21 +1407,19 @@ DEFUN (config_help, "help", "Description of the interactive help system\n") { - vty_outln (vty, - "Quagga VTY provides advanced help feature. When you need help,%s\ -anytime at the command line please press '?'.%s\ -%s\ -If nothing matches, the help list will be empty and you must backup%s\ - until entering a '?' shows the available options.%s\ -Two styles of help are provided:%s\ -1. Full help is available when you are ready to enter a%s\ -command argument (e.g. 'show ?') and describes each possible%s\ -argument.%s\ -2. Partial help is provided when an abbreviated argument is entered%s\ - and you want to know what arguments match the input%s\ - (e.g. 'show me?'.)%s", VTYNL, VTYNL, VTYNL, - VTYNL, VTYNL, VTYNL, VTYNL, VTYNL, - VTYNL, VTYNL, VTYNL, VTYNL); + vty_out (vty, + "Quagga VTY provides advanced help feature. When you need help,\n\ +anytime at the command line please press '?'.\n\ +\n\ +If nothing matches, the help list will be empty and you must backup\n\ + until entering a '?' shows the available options.\n\ +Two styles of help are provided:\n\ +1. Full help is available when you are ready to enter a\n\ +command argument (e.g. 'show ?') and describes each possible\n\ +argument.\n\ +2. Partial help is provided when an abbreviated argument is entered\n\ + and you want to know what arguments match the input\n\ + (e.g. 'show me?'.)\n\n"); return CMD_SUCCESS; } @@ -1456,7 +1453,7 @@ permute (struct graph_node *start, struct vty *vty) } if (gn == start) vty_out (vty, "..."); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } else { @@ -1490,7 +1487,7 @@ cmd_list_cmds (struct vty *vty, int do_permute) if ((element = vector_slot (node->cmd_vector, i)) && element->attr != CMD_ATTR_DEPRECATED && element->attr != CMD_ATTR_HIDDEN) - vty_outln (vty, " %s", element->string); + vty_out (vty, " %s\n", element->string); } return CMD_SUCCESS; } @@ -1523,25 +1520,25 @@ vty_write_config (struct vty *vty) if (vty->type == VTY_TERM) { - vty_outln (vty, "%sCurrent configuration:",VTYNL); - vty_outln (vty, "!"); + vty_out (vty, "\nCurrent configuration:\n"); + vty_out (vty, "!\n"); } - vty_outln (vty, "frr version %s", FRR_VER_SHORT); - vty_outln (vty, "frr defaults %s", DFLT_NAME); - vty_outln (vty, "!"); + vty_out (vty, "frr version %s\n", FRR_VER_SHORT); + vty_out (vty, "frr defaults %s\n", DFLT_NAME); + vty_out (vty, "!\n"); for (i = 0; i < vector_active (cmdvec); i++) if ((node = vector_slot (cmdvec, i)) && node->func && (node->vtysh || vty->type != VTY_SHELL)) { if ((*node->func) (vty)) - vty_outln (vty, "!"); + vty_out (vty, "!\n"); } if (vty->type == VTY_TERM) { - vty_outln (vty, "end"); + vty_out (vty, "end\n"); } } @@ -1578,7 +1575,7 @@ DEFUN (config_write, /* Check and see if we are operating under vtysh configuration */ if (host.config == NULL) { - vty_outln (vty,"Can't save to configuration file, using vtysh."); + vty_out (vty,"Can't save to configuration file, using vtysh.\n"); return CMD_WARNING; } @@ -1613,12 +1610,12 @@ DEFUN (config_write, fd = mkstemp (config_file_tmp); if (fd < 0) { - vty_outln (vty, "Can't open configuration file %s.",config_file_tmp); + vty_out (vty, "Can't open configuration file %s.\n",config_file_tmp); goto finished; } if (fchmod (fd, CONFIGFILE_MASK) != 0) { - vty_outln (vty, "Can't chmod configuration file %s: %s (%d).", + vty_out (vty, "Can't chmod configuration file %s: %s (%d).\n", config_file_tmp, safe_strerror(errno), errno); goto finished; } @@ -1640,13 +1637,13 @@ DEFUN (config_write, if (unlink (config_file_sav) != 0) if (errno != ENOENT) { - vty_outln (vty, "Can't unlink backup configuration file %s.", + vty_out (vty, "Can't unlink backup configuration file %s.\n", config_file_sav); goto finished; } if (link (config_file, config_file_sav) != 0) { - vty_outln (vty, "Can't backup old configuration file %s.", + vty_out (vty, "Can't backup old configuration file %s.\n", config_file_sav); goto finished; } @@ -1655,13 +1652,13 @@ DEFUN (config_write, } if (rename (config_file_tmp, config_file) != 0) { - vty_outln (vty, "Can't save configuration file %s.",config_file); + vty_out (vty, "Can't save configuration file %s.\n",config_file); goto finished; } if (dirfd >= 0) fsync (dirfd); - vty_outln (vty, "Configuration saved to %s",config_file); + vty_out (vty, "Configuration saved to %s\n",config_file); ret = CMD_SUCCESS; finished: @@ -1716,7 +1713,7 @@ DEFUN (show_startup_config, confp = fopen (host.config, "r"); if (confp == NULL) { - vty_outln (vty, "Can't open configuration file [%s] due to '%s'", + vty_out (vty, "Can't open configuration file [%s] due to '%s'\n", host.config, safe_strerror(errno)); return CMD_WARNING; } @@ -1729,7 +1726,7 @@ DEFUN (show_startup_config, cp++; *cp = '\0'; - vty_outln (vty, "%s", buf); + vty_out (vty, "%s\n", buf); } fclose (confp); @@ -1756,7 +1753,7 @@ DEFUN (config_hostname, if (!isalpha((int) word->arg[0])) { - vty_outln (vty, "Please specify string starting with alphabet"); + vty_out (vty, "Please specify string starting with alphabet\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1796,8 +1793,8 @@ DEFUN (config_password, if (!isalnum (argv[idx_8]->arg[0])) { - vty_outln (vty, - "Please specify string starting with alphanumeric"); + vty_out (vty, + "Please specify string starting with alphanumeric\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1846,15 +1843,15 @@ DEFUN (config_enable_password, } else { - vty_outln (vty, "Unknown encryption type."); + vty_out (vty, "Unknown encryption type.\n"); return CMD_WARNING_CONFIG_FAILED; } } if (!isalnum (argv[idx_8]->arg[0])) { - vty_outln (vty, - "Please specify string starting with alphanumeric"); + vty_out (vty, + "Please specify string starting with alphanumeric\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2003,7 +2000,7 @@ DEFUN_HIDDEN (do_echo, { char *message; - vty_outln (vty, "%s", + vty_out (vty, "%s\n", ((message = argv_concat(argv, argc, 1)) ? message : "")); if (message) XFREE(MTYPE_TMP, message); @@ -2047,7 +2044,7 @@ DEFUN (show_logging, vty_out (vty, "level %s, facility %s, ident %s", zlog_priority[zl->maxlvl[ZLOG_DEST_SYSLOG]], facility_name(zl->facility), zl->ident); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); vty_out (vty, "Stdout logging: "); if (zl->maxlvl[ZLOG_DEST_STDOUT] == ZLOG_DISABLED) @@ -2055,7 +2052,7 @@ DEFUN (show_logging, else vty_out (vty, "level %s", zlog_priority[zl->maxlvl[ZLOG_DEST_STDOUT]]); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); vty_out (vty, "Monitor logging: "); if (zl->maxlvl[ZLOG_DEST_MONITOR] == ZLOG_DISABLED) @@ -2063,7 +2060,7 @@ DEFUN (show_logging, else vty_out (vty, "level %s", zlog_priority[zl->maxlvl[ZLOG_DEST_MONITOR]]); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); vty_out (vty, "File logging: "); if ((zl->maxlvl[ZLOG_DEST_FILE] == ZLOG_DISABLED) || @@ -2073,13 +2070,13 @@ DEFUN (show_logging, vty_out (vty, "level %s, filename %s", zlog_priority[zl->maxlvl[ZLOG_DEST_FILE]], zl->filename); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); - vty_outln (vty, "Protocol name: %s", + vty_out (vty, "Protocol name: %s\n", zl->protoname); - vty_outln (vty, "Record priority: %s", + vty_out (vty, "Record priority: %s\n", (zl->record_priority ? "enabled" : "disabled")); - vty_outln (vty, "Timestamp precision: %d", + vty_out (vty, "Timestamp precision: %d\n", zl->timestamp_precision); return CMD_SUCCESS; diff --git a/lib/command.h b/lib/command.h index f712407b7..5bde83001 100644 --- a/lib/command.h +++ b/lib/command.h @@ -406,6 +406,6 @@ struct cmd_variable_handler { extern void cmd_variable_complete (struct cmd_token *token, const char *arg, vector comps); extern void cmd_variable_handler_register (const struct cmd_variable_handler *cvh); -extern char *cmd_variable_comp2str (vector comps, unsigned short cols, const char nl[]); +extern char *cmd_variable_comp2str (vector comps, unsigned short cols); #endif /* _ZEBRA_COMMAND_H */ diff --git a/lib/distribute.c b/lib/distribute.c index 02c888b69..34ccfb4c7 100644 --- a/lib/distribute.c +++ b/lib/distribute.c @@ -349,7 +349,7 @@ DEFUN (no_distribute_list, if (! ret) { - vty_outln (vty, "distribute list doesn't exist"); + vty_out (vty, "distribute list doesn't exist\n"); return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -393,9 +393,9 @@ config_show_distribute (struct vty *vty) DISTRIBUTE_V6_OUT, has_print); } if (has_print) - vty_out (vty, VTYNL); + vty_out (vty, "\n"); else - vty_outln (vty, " not set"); + vty_out (vty, " not set\n"); for (i = 0; i < disthash->size; i++) for (mp = disthash->index[i]; mp; mp = mp->next) @@ -414,9 +414,9 @@ config_show_distribute (struct vty *vty) has_print = distribute_print(vty, dist->prefix, 1, DISTRIBUTE_V6_OUT, has_print); if (has_print) - vty_out (vty, VTYNL); + vty_out (vty, "\n"); else - vty_outln (vty, " nothing"); + vty_out (vty, " nothing\n"); } } @@ -437,9 +437,9 @@ config_show_distribute (struct vty *vty) DISTRIBUTE_V6_IN, has_print); } if (has_print) - vty_out (vty, VTYNL); + vty_out (vty, "\n"); else - vty_outln (vty, " not set"); + vty_out (vty, " not set\n"); for (i = 0; i < disthash->size; i++) for (mp = disthash->index[i]; mp; mp = mp->next) @@ -458,9 +458,9 @@ config_show_distribute (struct vty *vty) has_print = distribute_print(vty, dist->prefix, 1, DISTRIBUTE_V6_IN, has_print); if (has_print) - vty_out (vty, VTYNL); + vty_out (vty, "\n"); else - vty_outln (vty, " nothing"); + vty_out (vty, " nothing\n"); } } return 0; @@ -487,7 +487,7 @@ config_write_distribute (struct vty *vty) if (dist->list[j]) { output = j == DISTRIBUTE_V4_OUT || j == DISTRIBUTE_V6_OUT; v6 = j == DISTRIBUTE_V6_IN || j == DISTRIBUTE_V6_OUT; - vty_outln (vty, " %sdistribute-list %s %s %s", + vty_out (vty, " %sdistribute-list %s %s %s\n", v6 ? "ipv6 " : "", dist->list[j], output ? "out" : "in", @@ -499,7 +499,7 @@ config_write_distribute (struct vty *vty) if (dist->prefix[j]) { output = j == DISTRIBUTE_V4_OUT || j == DISTRIBUTE_V6_OUT; v6 = j == DISTRIBUTE_V6_IN || j == DISTRIBUTE_V6_OUT; - vty_outln (vty, " %sdistribute-list prefix %s %s %s", + vty_out (vty, " %sdistribute-list prefix %s %s %s\n", v6 ? "ipv6 " : "", dist->prefix[j], output ? "out" : "in", diff --git a/lib/filter.c b/lib/filter.c index d2c80fc2a..c1e922f5b 100644 --- a/lib/filter.c +++ b/lib/filter.c @@ -576,7 +576,7 @@ vty_access_list_remark_unset (struct vty *vty, afi_t afi, const char *name) access = access_list_lookup (afi, name); if (! access) { - vty_outln (vty, "%% access-list %s doesn't exist",name); + vty_out (vty, "%% access-list %s doesn't exist\n",name); return CMD_WARNING_CONFIG_FAILED; } @@ -615,21 +615,21 @@ filter_set_cisco (struct vty *vty, const char *name_str, const char *type_str, type = FILTER_DENY; else { - vty_outln (vty, "%% filter type must be permit or deny"); + vty_out (vty, "%% filter type must be permit or deny\n"); return CMD_WARNING_CONFIG_FAILED; } ret = inet_aton (addr_str, &addr); if (ret <= 0) { - vty_outln (vty,"%%Inconsistent address and mask"); + vty_out (vty,"%%Inconsistent address and mask\n"); return CMD_WARNING_CONFIG_FAILED; } ret = inet_aton (addr_mask_str, &addr_mask); if (ret <= 0) { - vty_outln (vty,"%%Inconsistent address and mask"); + vty_out (vty,"%%Inconsistent address and mask\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -638,14 +638,14 @@ filter_set_cisco (struct vty *vty, const char *name_str, const char *type_str, ret = inet_aton (mask_str, &mask); if (ret <= 0) { - vty_outln (vty,"%%Inconsistent address and mask"); + vty_out (vty,"%%Inconsistent address and mask\n"); return CMD_WARNING_CONFIG_FAILED; } ret = inet_aton (mask_mask_str, &mask_mask); if (ret <= 0) { - vty_outln (vty,"%%Inconsistent address and mask"); + vty_out (vty,"%%Inconsistent address and mask\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -1256,8 +1256,8 @@ filter_set_zebra (struct vty *vty, const char *name_str, const char *type_str, if (strlen(name_str) > ACL_NAMSIZ) { - vty_outln (vty, "%% ACL name %s is invalid: length exceeds " - "%d characters", + vty_out (vty, "%% ACL name %s is invalid: length exceeds " + "%d characters\n", name_str, ACL_NAMSIZ); return CMD_WARNING_CONFIG_FAILED; } @@ -1269,7 +1269,7 @@ filter_set_zebra (struct vty *vty, const char *name_str, const char *type_str, type = FILTER_DENY; else { - vty_outln (vty, "filter type must be [permit|deny]"); + vty_out (vty, "filter type must be [permit|deny]\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1279,7 +1279,7 @@ filter_set_zebra (struct vty *vty, const char *name_str, const char *type_str, ret = str2prefix_ipv4 (prefix_str, (struct prefix_ipv4 *)&p); if (ret <= 0) { - vty_outln (vty,"IP address prefix/prefixlen is malformed"); + vty_out (vty,"IP address prefix/prefixlen is malformed\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -1288,7 +1288,7 @@ filter_set_zebra (struct vty *vty, const char *name_str, const char *type_str, ret = str2prefix_ipv6 (prefix_str, (struct prefix_ipv6 *) &p); if (ret <= 0) { - vty_outln (vty,"IPv6 address prefix/prefixlen is malformed"); + vty_out (vty,"IPv6 address prefix/prefixlen is malformed\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -1424,7 +1424,7 @@ DEFUN (no_access_list_all, access = access_list_lookup (AFI_IP, argv[idx_acl]->arg); if (access == NULL) { - vty_outln (vty, "%% access-list %s doesn't exist",argv[idx_acl]->arg); + vty_out (vty, "%% access-list %s doesn't exist\n",argv[idx_acl]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -1601,7 +1601,7 @@ DEFUN (no_ipv6_access_list_all, access = access_list_lookup (AFI_IP6, argv[idx_word]->arg); if (access == NULL) { - vty_outln (vty, "%% access-list %s doesn't exist",argv[idx_word]->arg); + vty_out (vty, "%% access-list %s doesn't exist\n",argv[idx_word]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -1688,7 +1688,7 @@ filter_show (struct vty *vty, const char *name, afi_t afi) return 0; /* Print the name of the protocol */ - vty_outln (vty, "%s:", frr_protoname); + vty_out (vty, "%s:\n", frr_protoname); for (access = master->num.head; access; access = access->next) { @@ -1703,7 +1703,7 @@ filter_show (struct vty *vty, const char *name, afi_t afi) if (write) { - vty_outln (vty, "%s IP%s access list %s", + vty_out (vty, "%s IP%s access list %s\n", mfilter->cisco ? (filter->extended ? "Extended" : "Standard") : "Zebra", afi == AFI_IP6 ? "v6" : "", @@ -1721,13 +1721,13 @@ filter_show (struct vty *vty, const char *name, afi_t afi) else { if (filter->addr_mask.s_addr == 0xffffffff) - vty_outln (vty, " any"); + vty_out (vty, " any\n"); else { vty_out (vty, " %s", inet_ntoa (filter->addr)); if (filter->addr_mask.s_addr != 0) vty_out (vty, ", wildcard bits %s", inet_ntoa (filter->addr_mask)); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } } @@ -1746,7 +1746,7 @@ filter_show (struct vty *vty, const char *name, afi_t afi) if (write) { - vty_outln (vty, "%s IP%s access list %s", + vty_out (vty, "%s IP%s access list %s\n", mfilter->cisco ? (filter->extended ? "Extended" : "Standard") : "Zebra", afi == AFI_IP6 ? "v6" : "", @@ -1764,13 +1764,13 @@ filter_show (struct vty *vty, const char *name, afi_t afi) else { if (filter->addr_mask.s_addr == 0xffffffff) - vty_outln (vty, " any"); + vty_out (vty, " any\n"); else { vty_out (vty, " %s", inet_ntoa (filter->addr)); if (filter->addr_mask.s_addr != 0) vty_out (vty, ", wildcard bits %s", inet_ntoa (filter->addr_mask)); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } } @@ -1855,18 +1855,18 @@ config_write_access_cisco (struct vty *vty, struct filter *mfilter) vty_out (vty, " %s", inet_ntoa (filter->mask)); vty_out (vty, " %s", inet_ntoa (filter->mask_mask)); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } else { if (filter->addr_mask.s_addr == 0xffffffff) - vty_outln (vty, " any"); + vty_out (vty, " any\n"); else { vty_out (vty, " %s", inet_ntoa (filter->addr)); if (filter->addr_mask.s_addr != 0) vty_out (vty, " %s", inet_ntoa (filter->addr_mask)); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } } @@ -1889,7 +1889,7 @@ config_write_access_zebra (struct vty *vty, struct filter *mfilter) p->prefixlen, filter->exact ? " exact-match" : ""); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } static int @@ -1908,7 +1908,7 @@ config_write_access (struct vty *vty, afi_t afi) { if (access->remark) { - vty_outln (vty, "%saccess-list %s remark %s", + vty_out (vty, "%saccess-list %s remark %s\n", afi == AFI_IP ? "" : "ipv6 ", access->name,access->remark); write++; @@ -1934,7 +1934,7 @@ config_write_access (struct vty *vty, afi_t afi) { if (access->remark) { - vty_outln (vty, "%saccess-list %s remark %s", + vty_out (vty, "%saccess-list %s remark %s\n", afi == AFI_IP ? "" : "ipv6 ", access->name,access->remark); write++; diff --git a/lib/grammar_sandbox.c b/lib/grammar_sandbox.c index 7962b5aef..9f4c071ab 100644 --- a/lib/grammar_sandbox.c +++ b/lib/grammar_sandbox.c @@ -52,7 +52,7 @@ struct graph *nodegraph = NULL, *nodegraph_free = NULL; #define check_nodegraph() \ do { if (!nodegraph) { \ - vty_outln(vty, "nodegraph not initialized"); \ + vty_out(vty, "nodegraph not initialized\n"); \ return CMD_WARNING; \ } } while (0) @@ -128,7 +128,7 @@ DEFUN (grammar_test_complete, // print completions for (i = 0; i < vector_active (comps); i++) { tkn = vector_slot (comps, i); - vty_outln (vty, " %-*s %s", width, tkn->text, tkn->desc); + vty_out (vty, " %-*s %s\n", width, tkn->text, tkn->desc); } for (i = 0; i < vector_active (comps); i++) @@ -136,7 +136,7 @@ DEFUN (grammar_test_complete, vector_free (comps); } else - vty_outln (vty, "%% No match"); + vty_out (vty, "%% No match\n"); // free resources list_delete (completions); @@ -176,13 +176,13 @@ DEFUN (grammar_test_match, // print completions or relevant error message if (element) { - vty_outln (vty, "Matched: %s", element->string); + vty_out (vty, "Matched: %s\n", element->string); struct listnode *ln; struct cmd_token *token; for (ALL_LIST_ELEMENTS_RO(argvv,ln,token)) - vty_outln (vty, "%s -- %s", token->text, token->arg); + vty_out (vty, "%s -- %s\n", token->text, token->arg); - vty_outln (vty, "func: %p", element->func); + vty_out (vty, "func: %p\n", element->func); list_delete (argvv); } @@ -190,16 +190,16 @@ DEFUN (grammar_test_match, assert(MATCHER_ERROR(result)); switch (result) { case MATCHER_NO_MATCH: - vty_outln (vty, "%% Unknown command"); + vty_out (vty, "%% Unknown command\n"); break; case MATCHER_INCOMPLETE: - vty_outln (vty, "%% Incomplete command"); + vty_out (vty, "%% Incomplete command\n"); break; case MATCHER_AMBIGUOUS: - vty_outln (vty, "%% Ambiguous command"); + vty_out (vty, "%% Ambiguous command\n"); break; default: - vty_outln (vty, "%% Unknown error"); + vty_out (vty, "%% Unknown error\n"); break; } } @@ -411,7 +411,7 @@ DEFUN (grammar_findambig, nodegraph = cnode->cmdgraph; if (!nodegraph) continue; - vty_outln (vty, "scanning node %d", scannode - 1); + vty_out (vty, "scanning node %d\n", scannode - 1); } commands = cmd_graph_permutations (nodegraph); @@ -420,25 +420,25 @@ DEFUN (grammar_findambig, { int same = prev && !strcmp (prev->cmd, cur->cmd); if (printall && !same) - vty_outln (vty, "'%s' [%x]", cur->cmd, cur->el->daemon); + vty_out (vty, "'%s' [%x]\n", cur->cmd, cur->el->daemon); if (same) { - vty_outln (vty, "'%s' AMBIGUOUS:", cur->cmd); - vty_outln (vty, " %s%s '%s'", prev->el->name, VTYNL, + vty_out (vty, "'%s' AMBIGUOUS:\n", cur->cmd); + vty_out (vty, " %s\n '%s'\n", prev->el->name, prev->el->string); - vty_outln (vty, " %s%s '%s'", cur->el->name, VTYNL, + vty_out (vty, " %s\n '%s'\n", cur->el->name, cur->el->string); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); ambig++; } prev = cur; } list_delete (commands); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } while (scan && scannode < LINK_PARAMS_NODE); - vty_outln (vty, "%d ambiguous commands found.", ambig); + vty_out (vty, "%d ambiguous commands found.\n", ambig); if (scan) nodegraph = NULL; @@ -475,11 +475,11 @@ DEFUN (grammar_access, cnode = vector_slot (cmdvec, atoi (argv[2]->arg)); if (!cnode) { - vty_outln (vty, "%% no such node"); + vty_out (vty, "%% no such node\n"); return CMD_WARNING_CONFIG_FAILED; } - vty_outln (vty, "node %d", (int)cnode->node); + vty_out (vty, "node %d\n", (int)cnode->node); nodegraph = cnode->cmdgraph; return CMD_SUCCESS; } @@ -542,7 +542,7 @@ pretty_print_graph (struct vty *vty, struct graph_node *start, int level, if (stackpos == MAXDEPTH) { - vty_outln (vty, " -aborting! (depth limit)"); + vty_out (vty, " -aborting! (depth limit)\n"); return; } stack[stackpos++] = start; @@ -551,7 +551,7 @@ pretty_print_graph (struct vty *vty, struct graph_node *start, int level, if (numto) { if (numto > 1) - vty_out (vty, VTYNL); + vty_out (vty, "\n"); for (unsigned int i = 0; i < vector_active (start->to); i++) { struct graph_node *adj = vector_slot (start->to, i); @@ -563,12 +563,12 @@ pretty_print_graph (struct vty *vty, struct graph_node *start, int level, if (adj == start) vty_out(vty, "*"); else if (((struct cmd_token *)adj->data)->type == END_TKN) - vty_outln (vty, "--END"); + vty_out (vty, "--END\n"); else { size_t k; for (k = 0; k < stackpos; k++) if (stack[k] == adj) { - vty_outln (vty, "<<loop@%zu ", k); + vty_out (vty, "<<loop@%zu \n", k); break; } if (k == stackpos) @@ -577,7 +577,7 @@ pretty_print_graph (struct vty *vty, struct graph_node *start, int level, } } else - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } static void @@ -660,5 +660,5 @@ init_cmdgraph (struct vty *vty, struct graph **graph) struct cmd_token *token = cmd_token_new (START_TKN, 0, NULL, NULL); graph_new_node (*graph, token, (void (*)(void *)) &cmd_token_del); if (vty) - vty_outln (vty, "initialized graph"); + vty_out (vty, "initialized graph\n"); } diff --git a/lib/hash.c b/lib/hash.c index bdb2e097c..7c355b2d8 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -426,7 +426,7 @@ DEFUN(show_hash_stats, if (!_hashes) { pthread_mutex_unlock (&_hashes_mtx); - vty_outln (vty, "No hash tables in use."); + vty_out (vty, "No hash tables in use.\n"); return CMD_SUCCESS; } @@ -460,21 +460,21 @@ DEFUN(show_hash_stats, char underln[sizeof(header) + strlen(frr_protonameinst)]; memset (underln, '-', sizeof(underln)); underln[sizeof(underln) - 1] = '\0'; - vty_outln (vty, "%s%s", header, frr_protonameinst); - vty_outln (vty, "%s", underln); + vty_out (vty, "%s%s\n", header, frr_protonameinst); + vty_out (vty, "%s\n", underln); - vty_outln (vty, "# allocated: %d", _hashes->count); - vty_outln (vty, "# named: %d%s", tt->nrows - 1, VTYNL); + vty_out (vty, "# allocated: %d\n", _hashes->count); + vty_out (vty, "# named: %d\n\n", tt->nrows - 1); if (tt->nrows > 1) { ttable_colseps (tt, 0, RIGHT, true, '|'); - char *table = ttable_dump (tt, VTYNL); - vty_out (vty, "%s%s", table, VTYNL); + char *table = ttable_dump (tt, "\n"); + vty_out (vty, "%s\n", table); XFREE (MTYPE_TMP, table); } else - vty_outln (vty, "No named hash tables to display."); + vty_out (vty, "No named hash tables to display.\n"); ttable_del (tt); @@ -690,8 +690,8 @@ DEFUN (interface, if ((sl = strlen(ifname)) > INTERFACE_NAMSIZ) { - vty_outln (vty, "%% Interface name %s is invalid: length exceeds " - "%d characters", + vty_out (vty, "%% Interface name %s is invalid: length exceeds " + "%d characters\n", ifname, INTERFACE_NAMSIZ); return CMD_WARNING_CONFIG_FAILED; } @@ -709,7 +709,7 @@ DEFUN (interface, if (!ifp) { - vty_outln (vty, "%% interface %s not in %s", ifname, vrfname); + vty_out (vty, "%% interface %s not in %s\n", ifname, vrfname); return CMD_WARNING_CONFIG_FAILED; } VTY_PUSH_CONTEXT (INTERFACE_NODE, ifp); @@ -739,14 +739,13 @@ DEFUN_NOSH (no_interface, if (ifp == NULL) { - vty_out (vty, "%% Interface %s does not exist%s", ifname, VTYNL); + vty_out (vty, "%% Interface %s does not exist\n", ifname); return CMD_WARNING_CONFIG_FAILED; } if (CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_ACTIVE)) { - vty_out (vty, "%% Only inactive interfaces can be deleted%s", - VTYNL); + vty_out (vty, "%% Only inactive interfaces can be deleted\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -793,8 +792,7 @@ DEFUN (show_address, p = ifc->address; if (p->family == AF_INET) - vty_out (vty, "%s/%d%s", inet_ntoa (p->u.prefix4), p->prefixlen, - VTYNL); + vty_out (vty, "%s/%d\n", inet_ntoa (p->u.prefix4), p->prefixlen); } } return CMD_SUCCESS; @@ -819,8 +817,7 @@ DEFUN (show_address_vrf_all, if (!vrf->iflist || !listcount (vrf->iflist)) continue; - vty_out (vty, "%sVRF %u%s%s", VTYNL, vrf->vrf_id, VTYNL, - VTYNL); + vty_out (vty, "\nVRF %u\n\n", vrf->vrf_id); for (ALL_LIST_ELEMENTS_RO (vrf->iflist, node, ifp)) { @@ -829,8 +826,7 @@ DEFUN (show_address_vrf_all, p = ifc->address; if (p->family == AF_INET) - vty_out (vty, "%s/%d%s", inet_ntoa (p->u.prefix4), p->prefixlen, - VTYNL); + vty_out (vty, "%s/%d\n", inet_ntoa (p->u.prefix4), p->prefixlen); } } } diff --git a/lib/if_rmap.c b/lib/if_rmap.c index 492c39c6a..a0c40d5af 100644 --- a/lib/if_rmap.c +++ b/lib/if_rmap.c @@ -228,7 +228,7 @@ DEFUN (if_rmap, type = IF_RMAP_OUT; else { - vty_outln (vty, "route-map direction must be [in|out]"); + vty_out (vty, "route-map direction must be [in|out]\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -259,14 +259,14 @@ DEFUN (no_if_rmap, type = IF_RMAP_OUT; else { - vty_outln (vty, "route-map direction must be [in|out]"); + vty_out (vty, "route-map direction must be [in|out]\n"); return CMD_WARNING_CONFIG_FAILED; } ret = if_rmap_unset (argv[idx_ifname]->arg, type, argv[idx_routemap_name]->arg); if (! ret) { - vty_outln (vty, "route-map doesn't exist"); + vty_out (vty, "route-map doesn't exist\n"); return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -290,7 +290,7 @@ config_write_if_rmap (struct vty *vty) if (if_rmap->routemap[IF_RMAP_IN]) { - vty_outln (vty, " route-map %s in %s", + vty_out (vty, " route-map %s in %s\n", if_rmap->routemap[IF_RMAP_IN], if_rmap->ifname); write++; @@ -298,7 +298,7 @@ config_write_if_rmap (struct vty *vty) if (if_rmap->routemap[IF_RMAP_OUT]) { - vty_outln (vty, " route-map %s out %s", + vty_out (vty, " route-map %s out %s\n", if_rmap->routemap[IF_RMAP_OUT], if_rmap->ifname); write++; diff --git a/lib/keychain.c b/lib/keychain.c index ab2ad3262..f768933b7 100644 --- a/lib/keychain.c +++ b/lib/keychain.c @@ -271,7 +271,7 @@ DEFUN (no_key_chain, if (! keychain) { - vty_outln (vty, "Can't find keychain %s", argv[idx_word]->arg); + vty_out (vty, "Can't find keychain %s\n", argv[idx_word]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -314,7 +314,7 @@ DEFUN (no_key, key = key_lookup (keychain, index); if (! key) { - vty_outln (vty, "Can't find key %d", index); + vty_out (vty, "Can't find key %d\n", index); return CMD_WARNING_CONFIG_FAILED; } @@ -477,20 +477,20 @@ key_lifetime_set (struct vty *vty, struct key_range *krange, time_start = key_str2time (stime_str, sday_str, smonth_str, syear_str); if (time_start < 0) { - vty_outln (vty, "Malformed time value"); + vty_out (vty, "Malformed time value\n"); return CMD_WARNING_CONFIG_FAILED; } time_end = key_str2time (etime_str, eday_str, emonth_str, eyear_str); if (time_end < 0) { - vty_outln (vty, "Malformed time value"); + vty_out (vty, "Malformed time value\n"); return CMD_WARNING_CONFIG_FAILED; } if (time_end <= time_start) { - vty_outln (vty, "Expire time is not later than start time"); + vty_out (vty, "Expire time is not later than start time\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -512,7 +512,7 @@ key_lifetime_duration_set (struct vty *vty, struct key_range *krange, time_start = key_str2time (stime_str, sday_str, smonth_str, syear_str); if (time_start < 0) { - vty_outln (vty, "Malformed time value"); + vty_out (vty, "Malformed time value\n"); return CMD_WARNING_CONFIG_FAILED; } krange->start = time_start; @@ -534,7 +534,7 @@ key_lifetime_infinite_set (struct vty *vty, struct key_range *krange, time_start = key_str2time (stime_str, sday_str, smonth_str, syear_str); if (time_start < 0) { - vty_outln (vty, "Malformed time value"); + vty_out (vty, "Malformed time value\n"); return CMD_WARNING_CONFIG_FAILED; } krange->start = time_start; @@ -966,14 +966,14 @@ keychain_config_write (struct vty *vty) for (ALL_LIST_ELEMENTS_RO (keychain_list, node, keychain)) { - vty_outln (vty, "key chain %s", keychain->name); + vty_out (vty, "key chain %s\n", keychain->name); for (ALL_LIST_ELEMENTS_RO (keychain->key, knode, key)) { - vty_outln (vty, " key %d", key->index); + vty_out (vty, " key %d\n", key->index); if (key->string) - vty_outln (vty, " key-string %s", key->string); + vty_out (vty, " key-string %s\n", key->string); if (key->accept.start) { @@ -990,7 +990,7 @@ keychain_config_write (struct vty *vty) keychain_strftime (buf, BUFSIZ, &key->accept.end); vty_out (vty, " %s", buf); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } if (key->send.start) @@ -1007,10 +1007,10 @@ keychain_config_write (struct vty *vty) keychain_strftime (buf, BUFSIZ, &key->send.end); vty_out (vty, " %s", buf); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } - vty_outln (vty, "!"); + vty_out (vty, "!\n"); } return 0; diff --git a/lib/memory_vty.c b/lib/memory_vty.c index 5983efbdc..f65952e8a 100644 --- a/lib/memory_vty.c +++ b/lib/memory_vty.c @@ -44,26 +44,26 @@ show_memory_mallinfo (struct vty *vty) struct mallinfo minfo = mallinfo(); char buf[MTYPE_MEMSTR_LEN]; - vty_outln (vty, "System allocator statistics:"); - vty_outln (vty, " Total heap allocated: %s", + vty_out (vty, "System allocator statistics:\n"); + vty_out (vty, " Total heap allocated: %s\n", mtype_memstr(buf, MTYPE_MEMSTR_LEN, minfo.arena)); - vty_outln (vty, " Holding block headers: %s", + vty_out (vty, " Holding block headers: %s\n", mtype_memstr(buf, MTYPE_MEMSTR_LEN, minfo.hblkhd)); - vty_outln (vty, " Used small blocks: %s", + vty_out (vty, " Used small blocks: %s\n", mtype_memstr(buf, MTYPE_MEMSTR_LEN, minfo.usmblks)); - vty_outln (vty, " Used ordinary blocks: %s", + vty_out (vty, " Used ordinary blocks: %s\n", mtype_memstr(buf, MTYPE_MEMSTR_LEN, minfo.uordblks)); - vty_outln (vty, " Free small blocks: %s", + vty_out (vty, " Free small blocks: %s\n", mtype_memstr(buf, MTYPE_MEMSTR_LEN, minfo.fsmblks)); - vty_outln (vty, " Free ordinary blocks: %s", + vty_out (vty, " Free ordinary blocks: %s\n", mtype_memstr(buf, MTYPE_MEMSTR_LEN, minfo.fordblks)); - vty_outln (vty, " Ordinary blocks: %ld", + vty_out (vty, " Ordinary blocks: %ld\n", (unsigned long)minfo.ordblks); - vty_outln (vty, " Small blocks: %ld", + vty_out (vty, " Small blocks: %ld\n", (unsigned long)minfo.smblks); - vty_outln (vty, " Holding blocks: %ld", + vty_out (vty, " Holding blocks: %ld\n", (unsigned long)minfo.hblks); - vty_outln (vty,"(see system documentation for 'mallinfo' for meaning)"); + vty_out (vty,"(see system documentation for 'mallinfo' for meaning)\n"); return 1; } #endif /* HAVE_MALLINFO */ @@ -72,12 +72,12 @@ static int qmem_walker(void *arg, struct memgroup *mg, struct memtype *mt) { struct vty *vty = arg; if (!mt) - vty_outln (vty, "--- qmem %s ---", mg->name); + vty_out (vty, "--- qmem %s ---\n", mg->name); else { if (mt->n_alloc != 0) { char size[32]; snprintf(size, sizeof(size), "%6zu", mt->size); - vty_outln (vty, "%-30s: %10zu %s", + vty_out (vty, "%-30s: %10zu %s\n", mt->name, mt->n_alloc, mt->size == 0 ? "" : mt->size == SIZE_VAR ? "(variably sized)" : size); } @@ -108,14 +108,13 @@ DEFUN (show_modules, { struct frrmod_runtime *plug = frrmod_list; - vty_outln (vty, "%-12s %-25s %s%s", - "Module Name", "Version", "Description", - VTYNL); + vty_out (vty, "%-12s %-25s %s\n\n", + "Module Name", "Version", "Description"); while (plug) { const struct frrmod_info *i = plug->info; - vty_outln (vty, "%-12s %-25s %s", i->name, i->version,i->description); + vty_out (vty, "%-12s %-25s %s\n", i->name, i->version,i->description); if (plug->dl_handle) { #ifdef HAVE_DLINFO_ORIGIN @@ -129,13 +128,13 @@ DEFUN (show_modules, { name = strrchr(lm->l_name, '/'); name = name ? name + 1 : lm->l_name; - vty_outln (vty, "\tfrom: %s/%s", origin, name); + vty_out (vty, "\tfrom: %s/%s\n", origin, name); } # else - vty_outln (vty, "\tfrom: %s ", origin, plug->load_name); + vty_out (vty, "\tfrom: %s \n", origin, plug->load_name); # endif #else - vty_outln (vty, "\tfrom: %s", plug->load_name); + vty_out (vty, "\tfrom: %s\n", plug->load_name); #endif } plug = plug->next; @@ -296,7 +296,7 @@ ns_netns_pathname (struct vty *vty, const char *name) if (! result) { - vty_outln (vty, "Invalid pathname: %s",safe_strerror(errno)); + vty_out (vty, "Invalid pathname: %s\n",safe_strerror(errno)); return NULL; } return pathname; @@ -324,8 +324,8 @@ DEFUN_NOSH (ns_netns, if (ns->name && strcmp (ns->name, pathname) != 0) { - vty_out (vty, "NS %u is already configured with NETNS %s%s", - ns->ns_id, ns->name, VTYNL); + vty_out (vty, "NS %u is already configured with NETNS %s\n", + ns->ns_id, ns->name); return CMD_WARNING_CONFIG_FAILED; } @@ -334,8 +334,8 @@ DEFUN_NOSH (ns_netns, if (!ns_enable (ns)) { - vty_out (vty, "Can not associate NS %u with NETNS %s%s", - ns->ns_id, ns->name, VTYNL); + vty_out (vty, "Can not associate NS %u with NETNS %s\n", + ns->ns_id, ns->name); return CMD_WARNING_CONFIG_FAILED; } @@ -365,13 +365,13 @@ DEFUN (no_ns_netns, if (!ns) { - vty_outln (vty, "NS %u is not found", ns_id); + vty_out (vty, "NS %u is not found\n", ns_id); return CMD_SUCCESS; } if (ns->name && strcmp (ns->name, pathname) != 0) { - vty_outln (vty, "Incorrect NETNS file name"); + vty_out (vty, "Incorrect NETNS file name\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -405,7 +405,7 @@ ns_config_write (struct vty *vty) if (ns->ns_id == NS_DEFAULT || ns->name == NULL) continue; - vty_outln (vty, "logical-router %u netns %s", ns->ns_id,ns->name); + vty_out (vty, "logical-router %u netns %s\n", ns->ns_id,ns->name); write = 1; } diff --git a/lib/plist.c b/lib/plist.c index 88788b14b..96c60a489 100644 --- a/lib/plist.c +++ b/lib/plist.c @@ -882,7 +882,7 @@ prefix_entry_dup_check (struct prefix_list *plist, static int vty_invalid_prefix_range (struct vty *vty, const char *prefix) { - vty_outln (vty, "%% Invalid prefix range for %s, make sure: len < ge-value <= le-value", + vty_out (vty, "%% Invalid prefix range for %s, make sure: len < ge-value <= le-value\n", prefix); return CMD_WARNING_CONFIG_FAILED; } @@ -920,7 +920,7 @@ vty_prefix_list_install (struct vty *vty, afi_t afi, const char *name, type = PREFIX_DENY; else { - vty_outln (vty, "%% prefix type must be permit or deny"); + vty_out (vty, "%% prefix type must be permit or deny\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -940,7 +940,7 @@ vty_prefix_list_install (struct vty *vty, afi_t afi, const char *name, if (ret <= 0) { - vty_outln (vty, "%% Malformed IPv4 prefix"); + vty_out (vty, "%% Malformed IPv4 prefix\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -962,7 +962,7 @@ vty_prefix_list_install (struct vty *vty, afi_t afi, const char *name, if (ret <= 0) { - vty_outln (vty, "%% Malformed IPv6 prefix"); + vty_out (vty, "%% Malformed IPv6 prefix\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -973,7 +973,7 @@ vty_prefix_list_install (struct vty *vty, afi_t afi, const char *name, break; case AFI_L2VPN: default: - vty_outln (vty, "%% Unrecognized AFI (%d)", afi); + vty_out (vty, "%% Unrecognized AFI (%d)\n", afi); return CMD_WARNING_CONFIG_FAILED; break; } @@ -1042,7 +1042,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name, plist = prefix_list_lookup (afi, name); if (! plist) { - vty_outln (vty, "%% Can't find specified prefix-list"); + vty_out (vty, "%% Can't find specified prefix-list\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1057,7 +1057,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name, /* We must have, at a minimum, both the type and prefix here */ if ((typestr == NULL) || (prefix == NULL)) { - vty_outln (vty, "%% Both prefix and type required"); + vty_out (vty, "%% Both prefix and type required\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1078,7 +1078,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name, type = PREFIX_DENY; else { - vty_outln (vty, "%% prefix type must be permit or deny"); + vty_out (vty, "%% prefix type must be permit or deny\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1096,7 +1096,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name, if (ret <= 0) { - vty_outln (vty, "%% Malformed IPv4 prefix"); + vty_out (vty, "%% Malformed IPv4 prefix\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -1113,7 +1113,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name, if (ret <= 0) { - vty_outln (vty, "%% Malformed IPv6 prefix"); + vty_out (vty, "%% Malformed IPv6 prefix\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -1123,7 +1123,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name, if (pentry == NULL) { - vty_outln (vty, "%% Can't find specified prefix-list"); + vty_out (vty, "%% Can't find specified prefix-list\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1141,7 +1141,7 @@ vty_prefix_list_desc_unset (struct vty *vty, afi_t afi, const char *name) plist = prefix_list_lookup (afi, name); if (! plist) { - vty_outln (vty, "%% Can't find specified prefix-list"); + vty_out (vty, "%% Can't find specified prefix-list\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1179,21 +1179,21 @@ vty_show_prefix_entry (struct vty *vty, afi_t afi, struct prefix_list *plist, if (dtype == normal_display) { - vty_outln (vty, "ip%s prefix-list %s: %d entries", + vty_out (vty, "ip%s prefix-list %s: %d entries\n", afi == AFI_IP ? "" : "v6", plist->name, plist->count); if (plist->desc) - vty_outln (vty, " Description: %s", plist->desc); + vty_out (vty, " Description: %s\n", plist->desc); } else if (dtype == summary_display || dtype == detail_display) { - vty_outln (vty, "ip%s prefix-list %s:", + vty_out (vty, "ip%s prefix-list %s:\n", afi == AFI_IP ? "" : "v6", plist->name); if (plist->desc) - vty_outln (vty, " Description: %s", plist->desc); + vty_out (vty, " Description: %s\n", plist->desc); - vty_outln (vty, " count: %d, range entries: %d, sequences: %u - %u", + vty_out (vty, " count: %d, range entries: %d, sequences: %u - %u\n", plist->count, plist->rangecount, plist->head ? plist->head->seq : 0, plist->tail ? plist->tail->seq : 0); @@ -1234,7 +1234,7 @@ vty_show_prefix_entry (struct vty *vty, afi_t afi, struct prefix_list *plist, vty_out (vty, " (hit count: %ld, refcount: %ld)", pentry->hitcnt, pentry->refcnt); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } } @@ -1259,7 +1259,7 @@ vty_show_prefix_list (struct vty *vty, afi_t afi, const char *name, plist = prefix_list_lookup (afi, name); if (! plist) { - vty_outln (vty, "%% Can't find specified prefix-list"); + vty_out (vty, "%% Can't find specified prefix-list\n"); return CMD_WARNING; } vty_show_prefix_entry (vty, afi, plist, master, dtype, seqnum); @@ -1269,7 +1269,7 @@ vty_show_prefix_list (struct vty *vty, afi_t afi, const char *name, if (dtype == detail_display || dtype == summary_display) { if (master->recent) - vty_outln (vty, "Prefix-list with the last deletion/insertion: %s", + vty_out (vty, "Prefix-list with the last deletion/insertion: %s\n", master->recent->name); } @@ -1296,14 +1296,14 @@ vty_show_prefix_list_prefix (struct vty *vty, afi_t afi, const char *name, plist = prefix_list_lookup (afi, name); if (! plist) { - vty_outln (vty, "%% Can't find specified prefix-list"); + vty_out (vty, "%% Can't find specified prefix-list\n"); return CMD_WARNING; } ret = str2prefix (prefix, &p); if (ret <= 0) { - vty_outln (vty, "%% prefix is malformed"); + vty_out (vty, "%% prefix is malformed\n"); return CMD_WARNING; } @@ -1346,7 +1346,7 @@ vty_show_prefix_list_prefix (struct vty *vty, afi_t afi, const char *name, vty_out (vty, " (hit count: %ld, refcount: %ld)", pentry->hitcnt, pentry->refcnt); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); if (type == first_match_display) return CMD_SUCCESS; @@ -1384,7 +1384,7 @@ vty_clear_prefix_list (struct vty *vty, afi_t afi, const char *name, plist = prefix_list_lookup (afi, name); if (! plist) { - vty_outln (vty, "%% Can't find specified prefix-list"); + vty_out (vty, "%% Can't find specified prefix-list\n"); return CMD_WARNING; } @@ -1393,7 +1393,7 @@ vty_clear_prefix_list (struct vty *vty, afi_t afi, const char *name, ret = str2prefix (prefix, &p); if (ret <= 0) { - vty_outln (vty, "%% prefix is malformed"); + vty_out (vty, "%% prefix is malformed\n"); return CMD_WARNING; } } @@ -1816,16 +1816,16 @@ config_write_prefix_afi (afi_t afi, struct vty *vty) if (! master->seqnum) { - vty_outln (vty, "no ip%s prefix-list sequence-number", + vty_out (vty, "no ip%s prefix-list sequence-number\n", afi == AFI_IP ? "" : "v6"); - vty_outln (vty, "!"); + vty_out (vty, "!\n"); } for (plist = master->num.head; plist; plist = plist->next) { if (plist->desc) { - vty_outln (vty, "ip%s prefix-list %s description %s", + vty_out (vty, "ip%s prefix-list %s description %s\n", afi == AFI_IP ? "" : "v6", plist->name, plist->desc); write++; @@ -1858,17 +1858,17 @@ config_write_prefix_afi (afi_t afi, struct vty *vty) if (pentry->le) vty_out (vty, " le %d", pentry->le); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); write++; } - /* vty_out (vty, "!%s", VTYNL); */ + /* vty_out (vty, "!\n"); */ } for (plist = master->str.head; plist; plist = plist->next) { if (plist->desc) { - vty_outln (vty, "ip%s prefix-list %s description %s", + vty_out (vty, "ip%s prefix-list %s description %s\n", afi == AFI_IP ? "" : "v6", plist->name, plist->desc); write++; @@ -1901,7 +1901,7 @@ config_write_prefix_afi (afi_t afi, struct vty *vty) if (pentry->le) vty_out (vty, " le %d", pentry->le); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); write++; } } @@ -2046,13 +2046,13 @@ prefix_bgp_show_prefix_list (struct vty *vty, afi_t afi, char *name, u_char use_ else json_object_object_add(json, "ipv6PrefixList", json_prefix); - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else { - vty_outln (vty, "ip%s prefix-list %s: %d entries", + vty_out (vty, "ip%s prefix-list %s: %d entries\n", afi == AFI_IP ? "" : "v6", plist->name, plist->count); @@ -2071,7 +2071,7 @@ prefix_bgp_show_prefix_list (struct vty *vty, afi_t afi, char *name, u_char use_ if (pentry->le) vty_out (vty, " le %d", pentry->le); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } return plist->count; diff --git a/lib/route_types.pl b/lib/route_types.pl index 29bcd3a67..9d50acaae 100755 --- a/lib/route_types.pl +++ b/lib/route_types.pl @@ -113,19 +113,15 @@ sub codelist { $protodetail{$p}->{"shorthelp"}); if (length($str . $s) > 70) { $str =~ s/ $//; - push @lines, $str . "%s\" \\\n"; + push @lines, $str . "\\n\" \\\n"; $str = " \" "; } $str .= $s; } $str =~ s/ $//; - push @lines, $str . "%s\" \\\n"; - push @lines, " \" > - selected route, * - FIB route%s%s\", \\\n"; - my @nl = (); - for (my $c = 0; $c < @lines + 1; $c++) { - push @nl, "VTYNL" - } - return join("", @lines) ." ". join(", ", @nl); + push @lines, $str . "\\n\" \\\n"; + push @lines, " \" > - selected route, * - FIB route\\n\\n\""; + return join("", @lines); } print "\n"; diff --git a/lib/routemap.c b/lib/routemap.c index da8d48192..9ceaa1115 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -521,10 +521,10 @@ generic_match_add (struct vty *vty, struct route_map_index *index, switch (ret) { case RMAP_RULE_MISSING: - vty_outln (vty, "%% [%s] Can't find rule.", frr_protonameinst); + vty_out (vty, "%% [%s] Can't find rule.\n", frr_protonameinst); return CMD_WARNING_CONFIG_FAILED; case RMAP_COMPILE_ERROR: - vty_outln (vty, "%% [%s] Argument form is unsupported or malformed.", + vty_out (vty, "%% [%s] Argument form is unsupported or malformed.\n", frr_protonameinst); return CMD_WARNING_CONFIG_FAILED; } @@ -568,10 +568,10 @@ generic_match_delete (struct vty *vty, struct route_map_index *index, switch (ret) { case RMAP_RULE_MISSING: - vty_outln (vty, "%% [%s] Can't find rule.", frr_protonameinst); + vty_out (vty, "%% [%s] Can't find rule.\n", frr_protonameinst); break; case RMAP_COMPILE_ERROR: - vty_outln (vty, "%% [%s] Argument form is unsupported or malformed.", + vty_out (vty, "%% [%s] Argument form is unsupported or malformed.\n", frr_protonameinst); break; } @@ -605,10 +605,10 @@ generic_set_add (struct vty *vty, struct route_map_index *index, switch (ret) { case RMAP_RULE_MISSING: - vty_outln (vty, "%% [%s] Can't find rule.", frr_protonameinst); + vty_out (vty, "%% [%s] Can't find rule.\n", frr_protonameinst); return CMD_WARNING_CONFIG_FAILED; case RMAP_COMPILE_ERROR: - vty_outln (vty, "%% [%s] Argument form is unsupported or malformed.", + vty_out (vty, "%% [%s] Argument form is unsupported or malformed.\n", frr_protonameinst); return CMD_WARNING_CONFIG_FAILED; } @@ -628,10 +628,10 @@ generic_set_delete (struct vty *vty, struct route_map_index *index, switch (ret) { case RMAP_RULE_MISSING: - vty_outln (vty, "%% [%s] Can't find rule.", frr_protonameinst); + vty_out (vty, "%% [%s] Can't find rule.\n", frr_protonameinst); return CMD_WARNING_CONFIG_FAILED; case RMAP_COMPILE_ERROR: - vty_outln (vty, "%% [%s] Argument form is unsupported or malformed.", + vty_out (vty, "%% [%s] Argument form is unsupported or malformed.\n", frr_protonameinst); return CMD_WARNING_CONFIG_FAILED; } @@ -993,43 +993,43 @@ vty_show_route_map_entry (struct vty *vty, struct route_map *map) struct route_map_index *index; struct route_map_rule *rule; - vty_outln (vty, "%s:", frr_protonameinst); + vty_out (vty, "%s:\n", frr_protonameinst); for (index = map->head; index; index = index->next) { - vty_outln (vty, "route-map %s, %s, sequence %d", + vty_out (vty, "route-map %s, %s, sequence %d\n", map->name, route_map_type_str (index->type), index->pref); /* Description */ if (index->description) - vty_outln (vty, " Description:%s %s", VTYNL, + vty_out (vty, " Description:\n %s\n", index->description); /* Match clauses */ - vty_outln (vty, " Match clauses:"); + vty_out (vty, " Match clauses:\n"); for (rule = index->match_list.head; rule; rule = rule->next) - vty_outln (vty, " %s %s", + vty_out (vty, " %s %s\n", rule->cmd->str, rule->rule_str); - vty_outln (vty, " Set clauses:"); + vty_out (vty, " Set clauses:\n"); for (rule = index->set_list.head; rule; rule = rule->next) - vty_outln (vty, " %s %s", + vty_out (vty, " %s %s\n", rule->cmd->str, rule->rule_str); /* Call clause */ - vty_outln (vty, " Call clause:"); + vty_out (vty, " Call clause:\n"); if (index->nextrm) - vty_outln (vty, " Call %s", index->nextrm); + vty_out (vty, " Call %s\n", index->nextrm); /* Exit Policy */ - vty_outln (vty, " Action:"); + vty_out (vty, " Action:\n"); if (index->exitpolicy == RMAP_GOTO) - vty_outln (vty, " Goto %d", index->nextpref); + vty_out (vty, " Goto %d\n", index->nextpref); else if (index->exitpolicy == RMAP_NEXT) - vty_outln (vty, " Continue to next entry"); + vty_out (vty, " Continue to next entry\n"); else if (index->exitpolicy == RMAP_EXIT) - vty_outln (vty, " Exit routemap"); + vty_out (vty, " Exit routemap\n"); } } @@ -1049,7 +1049,7 @@ vty_show_route_map (struct vty *vty, const char *name) } else { - vty_outln (vty, "%s: 'route-map %s' not found", frr_protonameinst, + vty_out (vty, "%s: 'route-map %s' not found\n", frr_protonameinst, name); return CMD_SUCCESS; } @@ -2359,14 +2359,14 @@ DEFUN (set_ip_nexthop, ret = str2sockunion (argv[idx_ipv4]->arg, &su); if (ret < 0) { - vty_outln (vty, "%% Malformed nexthop address"); + vty_out (vty, "%% Malformed nexthop address\n"); return CMD_WARNING_CONFIG_FAILED; } if (su.sin.sin_addr.s_addr == 0 || IPV4_CLASS_DE(su.sin.sin_addr.s_addr)) { - vty_outln (vty, - "%% nexthop address cannot be 0.0.0.0, multicast " "or reserved"); + vty_out (vty, + "%% nexthop address cannot be 0.0.0.0, multicast or reserved\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2416,12 +2416,12 @@ DEFUN (set_ipv6_nexthop_local, ret = inet_pton (AF_INET6, argv[idx_ipv6]->arg, &addr); if (!ret) { - vty_outln (vty, "%% Malformed nexthop address"); + vty_out (vty, "%% Malformed nexthop address\n"); return CMD_WARNING_CONFIG_FAILED; } if (!IN6_IS_ADDR_LINKLOCAL(&addr)) { - vty_outln (vty, "%% Invalid link-local nexthop address"); + vty_out (vty, "%% Invalid link-local nexthop address\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2577,7 +2577,7 @@ DEFUN (no_route_map_all, map = route_map_lookup_by_name (mapname); if (map == NULL) { - vty_outln (vty, "%% Could not find route-map %s", mapname); + vty_out (vty, "%% Could not find route-map %s\n", mapname); return CMD_WARNING_CONFIG_FAILED; } @@ -2612,7 +2612,7 @@ DEFUN (no_route_map, map = route_map_lookup_by_name (mapname); if (map == NULL) { - vty_outln (vty, "%% Could not find route-map %s", mapname); + vty_out (vty, "%% Could not find route-map %s\n", mapname); return CMD_WARNING_CONFIG_FAILED; } @@ -2620,7 +2620,7 @@ DEFUN (no_route_map, index = route_map_index_lookup (map, permit, pref); if (index == NULL) { - vty_outln (vty, "%% Could not find route-map entry %s %s", + vty_out (vty, "%% Could not find route-map entry %s %s\n", mapname, prefstr); return CMD_WARNING_CONFIG_FAILED; } @@ -2648,7 +2648,7 @@ DEFUN (rmap_onmatch_next, if (index->type == RMAP_DENY) { /* Under a deny clause, match means it's finished. No need to set next */ - vty_outln (vty,"on-match next not supported under route-map deny"); + vty_out (vty,"on-match next not supported under route-map deny\n"); return CMD_WARNING_CONFIG_FAILED; } index->exitpolicy = RMAP_NEXT; @@ -2689,7 +2689,7 @@ DEFUN (rmap_onmatch_goto, if (index->type == RMAP_DENY) { /* Under a deny clause, match means it's finished. No need to go anywhere */ - vty_outln (vty,"on-match goto not supported under route-map deny"); + vty_out (vty,"on-match goto not supported under route-map deny\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2701,7 +2701,7 @@ DEFUN (rmap_onmatch_goto, if (d <= index->pref) { /* Can't allow you to do that, Dave */ - vty_outln (vty, "can't jump backwards in route-maps"); + vty_out (vty, "can't jump backwards in route-maps\n"); return CMD_WARNING_CONFIG_FAILED; } else @@ -2860,31 +2860,31 @@ route_map_config_write (struct vty *vty) for (index = map->head; index; index = index->next) { if (!first) - vty_outln (vty, "!"); + vty_out (vty, "!\n"); else first = 0; - vty_outln (vty, "route-map %s %s %d", + vty_out (vty, "route-map %s %s %d\n", map->name, route_map_type_str (index->type), index->pref); if (index->description) - vty_outln (vty, " description %s", index->description); + vty_out (vty, " description %s\n", index->description); for (rule = index->match_list.head; rule; rule = rule->next) - vty_outln (vty, " match %s %s", rule->cmd->str, + vty_out (vty, " match %s %s\n", rule->cmd->str, rule->rule_str ? rule->rule_str : ""); for (rule = index->set_list.head; rule; rule = rule->next) - vty_outln (vty, " set %s %s", rule->cmd->str, + vty_out (vty, " set %s %s\n", rule->cmd->str, rule->rule_str ? rule->rule_str : ""); if (index->nextrm) - vty_outln (vty, " call %s", index->nextrm); + vty_out (vty, " call %s\n", index->nextrm); if (index->exitpolicy == RMAP_GOTO) - vty_outln (vty, " on-match goto %d", index->nextpref); + vty_out (vty, " on-match goto %d\n", index->nextpref); if (index->exitpolicy == RMAP_NEXT) - vty_outln (vty," on-match next"); + vty_out (vty," on-match next\n"); write++; } diff --git a/lib/skiplist.c b/lib/skiplist.c index 5ba1c80e4..fd772b64c 100644 --- a/lib/skiplist.c +++ b/lib/skiplist.c @@ -602,9 +602,9 @@ skiplist_debug(struct vty *vty, struct skiplist *l) if (!l) l = skiplist_last_created; - vty_outln (vty, "Skiplist %p has max level %d", l, l->level); + vty_out (vty, "Skiplist %p has max level %d\n", l, l->level); for (i = l->level; i >= 0; --i) - vty_outln (vty, " @%d: %ld", + vty_out (vty, " @%d: %ld\n", i,(long)((l->stats->forward[i]) - (struct skiplistnode *)NULL)); } diff --git a/lib/smux.c b/lib/smux.c index 77092cdc2..d7d99cc8a 100644 --- a/lib/smux.c +++ b/lib/smux.c @@ -1278,7 +1278,7 @@ smux_peer_oid (struct vty *vty, const char *oid_str, const char *passwd_str) ret = smux_str2oid (oid_str, oid, &oid_len); if (ret != 0) { - vty_out (vty, "object ID malformed%s", VTYNL); + vty_out (vty, "object ID malformed\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1387,7 +1387,7 @@ config_write_smux (struct vty *vty) vty_out (vty, "%s%d", first ? "" : ".", (int) smux_oid[i]); first = 0; } - vty_outln (vty, " %s", smux_passwd); + vty_out (vty, " %s\n", smux_passwd); } return 0; } diff --git a/lib/spf_backoff.c b/lib/spf_backoff.c index 7cbb300c5..10f00426c 100644 --- a/lib/spf_backoff.c +++ b/lib/spf_backoff.c @@ -223,43 +223,43 @@ void spf_backoff_show(struct spf_backoff *backoff, struct vty *vty, const char *prefix) { - vty_outln (vty, "%sCurrent state: %s", prefix, + vty_out (vty, "%sCurrent state: %s\n", prefix, spf_backoff_state2str(backoff->state)); - vty_outln (vty, "%sInit timer: %ld msec", prefix, + vty_out (vty, "%sInit timer: %ld msec\n", prefix, backoff->init_delay); - vty_outln (vty, "%sShort timer: %ld msec", prefix, + vty_out (vty, "%sShort timer: %ld msec\n", prefix, backoff->short_delay); - vty_outln (vty, "%sLong timer: %ld msec", prefix, + vty_out (vty, "%sLong timer: %ld msec\n", prefix, backoff->long_delay); - vty_outln (vty, "%sHolddown timer: %ld msec", prefix, + vty_out (vty, "%sHolddown timer: %ld msec\n", prefix, backoff->holddown); if (backoff->t_holddown) { struct timeval remain = thread_timer_remain(backoff->t_holddown); - vty_outln (vty, "%s Still runs for %ld msec", + vty_out (vty, "%s Still runs for %ld msec\n", prefix, remain.tv_sec * 1000 + remain.tv_usec / 1000); } else { - vty_outln (vty, "%s Inactive", prefix); + vty_out (vty, "%s Inactive\n", prefix); } - vty_outln (vty, "%sTimeToLearn timer: %ld msec", prefix, + vty_out (vty, "%sTimeToLearn timer: %ld msec\n", prefix, backoff->timetolearn); if (backoff->t_timetolearn) { struct timeval remain = thread_timer_remain(backoff->t_timetolearn); - vty_outln (vty, "%s Still runs for %ld msec", + vty_out (vty, "%s Still runs for %ld msec\n", prefix, remain.tv_sec * 1000 + remain.tv_usec / 1000); } else { - vty_outln (vty, "%s Inactive", prefix); + vty_out (vty, "%s Inactive\n", prefix); } - vty_outln (vty, "%sFirst event: %s", prefix, + vty_out (vty, "%sFirst event: %s\n", prefix, timeval_format(&backoff->first_event_time)); - vty_outln (vty, "%sLast event: %s", prefix, + vty_out (vty, "%sLast event: %s\n", prefix, timeval_format(&backoff->last_event_time)); } @@ -291,7 +291,7 @@ spf_backoff_write_config(struct vty *vty) if (debug_spf_backoff) { - vty_outln (vty, "debug spf-delay-ietf"); + vty_out (vty, "debug spf-delay-ietf\n"); written++; } diff --git a/lib/thread.c b/lib/thread.c index 26fb46e49..2c87c099d 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -95,7 +95,7 @@ vty_out_cpu_thread_history(struct vty* vty, a->total_active, a->cpu.total/1000, a->cpu.total%1000, a->total_calls, a->cpu.total/a->total_calls, a->cpu.max, a->real.total/a->total_calls, a->real.max); - vty_outln (vty, " %c%c%c%c%c %s", + vty_out (vty, " %c%c%c%c%c %s\n", a->types & (1 << THREAD_READ) ? 'R':' ', a->types & (1 << THREAD_WRITE) ? 'W':' ', a->types & (1 << THREAD_TIMER) ? 'T':' ', @@ -147,13 +147,13 @@ cpu_record_print(struct vty *vty, thread_type filter) memset (underline, '-', sizeof (underline)); underline[sizeof(underline)] = '\0'; - vty_out (vty, VTYNL); - vty_outln(vty, "Showing statistics for pthread %s", name); - vty_outln(vty, "-------------------------------%s", underline); - vty_outln(vty, "%21s %18s %18s", "", "CPU (user+system):", "Real (wall-clock):"); + vty_out (vty, "\n"); + vty_out(vty, "Showing statistics for pthread %s\n", name); + vty_out(vty, "-------------------------------%s\n", underline); + vty_out(vty, "%21s %18s %18s\n", "", "CPU (user+system):", "Real (wall-clock):"); vty_out(vty, "Active Runtime(ms) Invoked Avg uSec Max uSecs"); vty_out(vty, " Avg uSec Max uSecs"); - vty_outln(vty, " Type Thread"); + vty_out(vty, " Type Thread\n"); if (m->cpu_record->count) hash_iterate(m->cpu_record, @@ -161,20 +161,20 @@ cpu_record_print(struct vty *vty, thread_type filter) cpu_record_hash_print, args); else - vty_outln(vty, "No data to display yet."); + vty_out(vty, "No data to display yet.\n"); - vty_out(vty, VTYNL); + vty_out(vty, "\n"); } } pthread_mutex_unlock (&masters_mtx); - vty_out(vty, VTYNL); - vty_outln(vty, "Total thread statistics"); - vty_outln(vty, "-------------------------"); - vty_outln(vty, "%21s %18s %18s", "", "CPU (user+system):", "Real (wall-clock):"); + vty_out(vty, "\n"); + vty_out(vty, "Total thread statistics\n"); + vty_out(vty, "-------------------------\n"); + vty_out(vty, "%21s %18s %18s\n", "", "CPU (user+system):", "Real (wall-clock):"); vty_out(vty, "Active Runtime(ms) Invoked Avg uSec Max uSecs"); vty_out(vty, " Avg uSec Max uSecs"); - vty_outln(vty, " Type Thread"); + vty_out(vty, " Type Thread\n"); if (tmp.total_calls > 0) vty_out_cpu_thread_history(vty, &tmp); @@ -270,8 +270,8 @@ DEFUN (show_thread_cpu, if (argv_find (argv, argc, "FILTER", &idx)) { filter = parse_filter (argv[idx]->arg); if (!filter) { - vty_outln(vty, "Invalid filter \"%s\" specified; must contain at least" - "one of 'RWTEXB'", argv[idx]->arg); + vty_out(vty, "Invalid filter \"%s\" specified; must contain at least" + "one of 'RWTEXB'\n", argv[idx]->arg); return CMD_WARNING; } } @@ -294,8 +294,8 @@ DEFUN (clear_thread_cpu, if (argv_find (argv, argc, "FILTER", &idx)) { filter = parse_filter (argv[idx]->arg); if (!filter) { - vty_outln(vty, "Invalid filter \"%s\" specified; must contain at least" - "one of 'RWTEXB'", argv[idx]->arg); + vty_out(vty, "Invalid filter \"%s\" specified; must contain at least" + "one of 'RWTEXB'\n", argv[idx]->arg); return CMD_WARNING; } } @@ -474,8 +474,8 @@ DEFUN_NOSH (vrf, if (strlen(vrfname) > VRF_NAMSIZ) { vty_out (vty, "%% VRF name %s is invalid: length exceeds " - "%d characters%s", - vrfname, VRF_NAMSIZ, VTYNL); + "%d characters\n", + vrfname, VRF_NAMSIZ); return CMD_WARNING_CONFIG_FAILED; } @@ -501,14 +501,13 @@ DEFUN_NOSH (no_vrf, if (vrfp == NULL) { - vty_out (vty, "%% VRF %s does not exist%s", vrfname, VTYNL); + vty_out (vty, "%% VRF %s does not exist\n", vrfname); return CMD_WARNING_CONFIG_FAILED; } if (CHECK_FLAG (vrfp->status, VRF_ACTIVE)) { - vty_out (vty, "%% Only inactive VRFs can be deleted%s", - VTYNL); + vty_out (vty, "%% Only inactive VRFs can be deleted\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -555,7 +554,7 @@ static int vrf_write_host (struct vty *vty) { if (debug_vrf) - vty_outln (vty, "debug vrf"); + vty_out (vty, "debug vrf\n"); return 1; } @@ -115,12 +115,12 @@ extern vrf_id_t vrf_name_to_id (const char *); struct vrf *vrf; \ if (!(vrf = vrf_lookup_by_name(NAME))) \ { \ - vty_out (vty, "%% VRF %s not found%s", NAME, VTYNL);\ + vty_out (vty, "%% VRF %s not found\n", NAME);\ return CMD_WARNING; \ } \ if (vrf->vrf_id == VRF_UNKNOWN) \ { \ - vty_out (vty, "%% VRF %s not active%s", NAME, VTYNL);\ + vty_out (vty, "%% VRF %s not active\n", NAME);\ return CMD_WARNING; \ } \ (V) = vrf->vrf_id; \ @@ -92,23 +92,28 @@ char integrate_default[] = SYSCONFDIR INTEGRATE_DEFAULT_CONFIG; static int do_log_commands = 0; -static int -vty_out_variadic (struct vty *vty, const char *format, va_list args) +/* VTY standard output function. */ +int +vty_out (struct vty *vty, const char *format, ...) { + va_list args; int len = 0; int size = 1024; char buf[1024]; char *p = NULL; - va_list cp; if (vty_shell (vty)) - vprintf (format, args); + { + va_start (args, format); + vprintf (format, args); + va_end (args); + } else { /* Try to write to initial buffer. */ - va_copy (cp, args); - len = vsnprintf (buf, sizeof(buf), format, cp); - va_end (cp); + va_start (args, format); + len = vsnprintf (buf, sizeof(buf), format, args); + va_end (args); /* Initial buffer is not enough. */ if (len < 0 || len >= size) @@ -124,9 +129,9 @@ vty_out_variadic (struct vty *vty, const char *format, va_list args) if (! p) return -1; - va_copy (cp, args); - len = vsnprintf (p, size, format, cp); - va_end (cp); + va_start (args, format); + len = vsnprintf (p, size, format, args); + va_end (args); if (len > -1 && len < size) break; @@ -138,7 +143,10 @@ vty_out_variadic (struct vty *vty, const char *format, va_list args) p = buf; /* Pointer p must point out buffer. */ - buffer_put (vty->obuf, (u_char *) p, len); + if (vty->type != VTY_TERM) + buffer_put (vty->obuf, (u_char *) p, len); + else + buffer_put_crlf (vty->obuf, (u_char *) p, len); /* If p is not different with buf, it is allocated buffer. */ if (p != buf) @@ -147,32 +155,6 @@ vty_out_variadic (struct vty *vty, const char *format, va_list args) return len; } -/* VTY standard output function. */ -int -vty_out (struct vty *vty, const char *format, ...) -{ - int len; - va_list args; - - va_start (args, format); - len = vty_out_variadic (vty, format, args); - va_end (args); - - return len; -} - -int -vty_outln (struct vty *vty, const char *format, ...) -{ - int len; - va_list args; - - va_start (args, format); - len = vty_out_variadic (vty, format, args); - va_end (args); - - return len + vty_out (vty, "%s", VTYNL); -} static int vty_log_out (struct vty *vty, const char *level, const char *proto_str, @@ -265,12 +247,12 @@ vty_hello (struct vty *vty) for (s = buf + strlen (buf); (s > buf) && isspace ((int)*(s - 1)); s--); *s = '\0'; - vty_outln (vty, "%s", buf); + vty_out (vty, "%s\n", buf); } fclose (f); } else - vty_outln (vty, "MOTD file not found"); + vty_out (vty, "MOTD file not found\n"); } else if (host.motd) vty_out (vty, "%s", host.motd); @@ -403,14 +385,14 @@ vty_auth (struct vty *vty, char *buf) { if (vty->node == AUTH_NODE) { - vty_outln (vty, "%% Bad passwords, too many failures!"); + vty_out (vty, "%% Bad passwords, too many failures!\n"); vty->status = VTY_CLOSE; } else { /* AUTH_ENABLE_NODE */ vty->fail = 0; - vty_outln (vty, "%% Bad enable passwords, too many failures!"); + vty_out (vty, "%% Bad enable passwords, too many failures!\n"); vty->status = VTY_CLOSE; } } @@ -495,16 +477,16 @@ vty_command (struct vty *vty, char *buf) { case CMD_WARNING: if (vty->type == VTY_FILE) - vty_outln (vty, "Warning..."); + vty_out (vty, "Warning...\n"); break; case CMD_ERR_AMBIGUOUS: - vty_outln (vty, "%% Ambiguous command."); + vty_out (vty, "%% Ambiguous command.\n"); break; case CMD_ERR_NO_MATCH: - vty_outln (vty, "%% [%s] Unknown command: %s", protocolname, buf); + vty_out (vty, "%% [%s] Unknown command: %s\n", protocolname, buf); break; case CMD_ERR_INCOMPLETE: - vty_outln (vty, "%% Command incomplete."); + vty_out (vty, "%% Command incomplete.\n"); break; } cmd_free_strvec (vline); @@ -732,7 +714,7 @@ vty_backward_word (struct vty *vty) static void vty_down_level (struct vty *vty) { - vty_out (vty, VTYNL); + vty_out (vty, "\n"); cmd_exit (vty); vty_prompt (vty); vty->cp = 0; @@ -742,7 +724,7 @@ vty_down_level (struct vty *vty) static void vty_end_config (struct vty *vty) { - vty_out (vty, VTYNL); + vty_out (vty, "\n"); switch (vty->node) { @@ -947,16 +929,16 @@ vty_complete_command (struct vty *vty) cmd_free_strvec (vline); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); switch (ret) { case CMD_ERR_AMBIGUOUS: - vty_outln (vty, "%% Ambiguous command."); + vty_out (vty, "%% Ambiguous command.\n"); vty_prompt (vty); vty_redraw_line (vty); break; case CMD_ERR_NO_MATCH: - /* vty_out (vty, "%% There is no matched command.%s", VTYNL); */ + /* vty_out (vty, "%% There is no matched command.\n"); */ vty_prompt (vty); vty_redraw_line (vty); break; @@ -964,7 +946,7 @@ vty_complete_command (struct vty *vty) if (!matched[0]) { /* 2016-11-28 equinox -- need to debug, SEGV here */ - vty_outln (vty, "%% CLI BUG: FULL_MATCH with NULL str"); + vty_out (vty, "%% CLI BUG: FULL_MATCH with NULL str\n"); vty_prompt (vty); vty_redraw_line (vty); break; @@ -987,11 +969,11 @@ vty_complete_command (struct vty *vty) for (i = 0; matched[i] != NULL; i++) { if (i != 0 && ((i % 6) == 0)) - vty_out (vty, VTYNL); + vty_out (vty, "\n"); vty_out (vty, "%-10s ", matched[i]); XFREE (MTYPE_COMPLETION, matched[i]); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); vty_prompt (vty); vty_redraw_line (vty); @@ -1019,7 +1001,7 @@ vty_describe_fold (struct vty *vty, int cmd_width, if (desc_width <= 0) { - vty_outln (vty, " %-*s %s", cmd_width, cmd, token->desc); + vty_out (vty, " %-*s %s\n", cmd_width, cmd, token->desc); return; } @@ -1036,12 +1018,12 @@ vty_describe_fold (struct vty *vty, int cmd_width, strncpy (buf, p, pos); buf[pos] = '\0'; - vty_outln (vty, " %-*s %s", cmd_width, cmd, buf); + vty_out (vty, " %-*s %s\n", cmd_width, cmd, buf); cmd = ""; } - vty_outln (vty, " %-*s %s", cmd_width, cmd, p); + vty_out (vty, " %-*s %s\n", cmd_width, cmd, p); XFREE (MTYPE_TMP, buf); } @@ -1070,17 +1052,17 @@ vty_describe_command (struct vty *vty) describe = cmd_describe_command (vline, vty, &ret); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); /* Ambiguous error. */ switch (ret) { case CMD_ERR_AMBIGUOUS: - vty_outln (vty, "%% Ambiguous command."); + vty_out (vty, "%% Ambiguous command.\n"); goto out; break; case CMD_ERR_NO_MATCH: - vty_outln (vty, "%% There is no matched command."); + vty_out (vty, "%% There is no matched command.\n"); goto out; break; } @@ -1118,10 +1100,10 @@ vty_describe_command (struct vty *vty) } if (!token->desc) - vty_outln (vty, " %-s", + vty_out (vty, " %-s\n", token->text); else if (desc_width >= strlen (token->desc)) - vty_outln (vty, " %-*s %s", width, + vty_out (vty, " %-*s %s\n", width, token->text, token->desc); else @@ -1136,27 +1118,27 @@ vty_describe_command (struct vty *vty) if (vector_active (varcomps) > 0) { - char *ac = cmd_variable_comp2str(varcomps, vty->width, VTYNL); - vty_outln(vty, "%s", ac); + char *ac = cmd_variable_comp2str(varcomps, vty->width); + vty_out(vty, "%s\n", ac); XFREE(MTYPE_TMP, ac); } vector_free(varcomps); } #if 0 - vty_out (vty, " %-*s %s%s", width + vty_out (vty, " %-*s %s\n", width desc->cmd[0] == '.' ? desc->cmd + 1 : desc->cmd, - desc->str ? desc->str : "", VTYNL); + desc->str ? desc->str : ""); #endif /* 0 */ } if ((token = token_cr)) { if (!token->desc) - vty_outln (vty, " %-s", + vty_out (vty, " %-s\n", token->text); else if (desc_width >= strlen (token->desc)) - vty_outln (vty, " %-*s %s", width, + vty_out (vty, " %-*s %s\n", width, token->text, token->desc); else @@ -1184,7 +1166,7 @@ vty_stop_input (struct vty *vty) { vty->cp = vty->length = 0; vty_clear_buf (vty); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); switch (vty->node) { @@ -1295,20 +1277,20 @@ vty_telnet_option (struct vty *vty, unsigned char *buf, int nbytes) vty_out (vty, "SE "); break; case TELOPT_ECHO: - vty_outln (vty, "TELOPT_ECHO "); + vty_out (vty, "TELOPT_ECHO \n"); break; case TELOPT_SGA: - vty_outln (vty, "TELOPT_SGA "); + vty_out (vty, "TELOPT_SGA \n"); break; case TELOPT_NAWS: - vty_outln (vty, "TELOPT_NAWS "); + vty_out (vty, "TELOPT_NAWS \n"); break; default: vty_out (vty, "%x ", buf[i]); break; } } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); #endif /* TELNET_OPTION_DEBUG */ @@ -1345,8 +1327,8 @@ vty_telnet_option (struct vty *vty, unsigned char *buf, int nbytes) vty->width = ((vty->sb_buf[1] << 8)|vty->sb_buf[2]); vty->height = ((vty->sb_buf[3] << 8)|vty->sb_buf[4]); #ifdef TELNET_OPTION_DEBUG - vty_outln (vty, "TELNET NAWS window size negotiation completed: " - "width %d, height %d", + vty_out (vty, "TELNET NAWS window size negotiation completed: " + "width %d, height %d\n", vty->width, vty->height); #endif } @@ -1604,7 +1586,7 @@ vty_read (struct thread *thread) break; case '\n': case '\r': - vty_out (vty, VTYNL); + vty_out (vty, "\n"); vty_execute (vty); break; case '\t': @@ -1763,7 +1745,7 @@ vty_create (int vty_sock, union sockunion *su) /* Vty is not available if password isn't set. */ if (host.password == NULL && host.password_encrypt == NULL) { - vty_outln (vty, "Vty password is not set."); + vty_out (vty, "Vty password is not set.\n"); vty->status = VTY_CLOSE; vty_close (vty); return NULL; @@ -1773,8 +1755,7 @@ vty_create (int vty_sock, union sockunion *su) /* Say hello to the world. */ vty_hello (vty); if (! no_password_check) - vty_outln (vty, "%sUser Access Verification%s", VTYNL, - VTYNL); + vty_out (vty, "\nUser Access Verification\n\n"); /* Setting up terminal. */ vty_will_echo (vty); @@ -2191,7 +2172,7 @@ vtysh_read (struct thread *thread) /* Clear command line buffer. */ vty->cp = vty->length = 0; vty_clear_buf (vty); - vty_outln (vty, "%% Command is too long."); + vty_out (vty, "%% Command is too long.\n"); } else { @@ -2334,7 +2315,7 @@ vty_timeout (struct thread *thread) /* Clear buffer*/ buffer_reset (vty->obuf); - vty_outln (vty, "%sVty connection is timed out.", VTYNL); + vty_out (vty, "\nVty connection is timed out.\n"); /* Close connection. */ vty->status = VTY_CLOSE; @@ -2715,9 +2696,9 @@ DEFUN_NOSH (config_who, for (i = 0; i < vector_active (vtyvec); i++) if ((v = vector_slot (vtyvec, i)) != NULL) - vty_out (vty, "%svty[%d] connected from %s.%s", + vty_out (vty, "%svty[%d] connected from %s.\n", v->config ? "*" : " ", - i, v->address, VTYNL); + i, v->address); return CMD_SUCCESS; } @@ -2815,7 +2796,7 @@ DEFUN (no_vty_access_class, const char *accesslist = (argc == 3) ? argv[idx_word]->arg : NULL; if (! vty_accesslist_name || (argc == 3 && strcmp(vty_accesslist_name, accesslist))) { - vty_outln (vty,"Access-class is not currently applied to vty"); + vty_out (vty,"Access-class is not currently applied to vty\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2858,7 +2839,7 @@ DEFUN (no_vty_ipv6_access_class, if (! vty_ipv6_accesslist_name || (argc == 4 && strcmp(vty_ipv6_accesslist_name, accesslist))) { - vty_outln (vty,"IPv6 access-class is not currently applied to vty"); + vty_out (vty,"IPv6 access-class is not currently applied to vty\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2959,7 +2940,7 @@ DEFUN_NOSH (show_history, } if (vty->hist[index] != NULL) - vty_out (vty, " %s%s", vty->hist[index], VTYNL); + vty_out (vty, " %s\n", vty->hist[index]); index++; } @@ -2982,30 +2963,30 @@ DEFUN (log_commands, static int vty_config_write (struct vty *vty) { - vty_outln (vty, "line vty"); + vty_out (vty, "line vty\n"); if (vty_accesslist_name) - vty_outln (vty, " access-class %s", + vty_out (vty, " access-class %s\n", vty_accesslist_name); if (vty_ipv6_accesslist_name) - vty_outln (vty, " ipv6 access-class %s", + vty_out (vty, " ipv6 access-class %s\n", vty_ipv6_accesslist_name); /* exec-timeout */ if (vty_timeout_val != VTY_TIMEOUT_DEFAULT) - vty_outln (vty, " exec-timeout %ld %ld", + vty_out (vty, " exec-timeout %ld %ld\n", vty_timeout_val / 60, vty_timeout_val % 60); /* login */ if (no_password_check) - vty_outln (vty, " no login"); + vty_out (vty, " no login\n"); if (do_log_commands) - vty_outln (vty, "log commands"); + vty_out (vty, "log commands\n"); - vty_outln (vty, "!"); + vty_out (vty, "!\n"); return CMD_SUCCESS; } @@ -156,7 +156,7 @@ static inline void vty_push_context(struct vty *vty, #define VTY_CHECK_CONTEXT(ptr) \ if (!ptr) { \ vty_out (vty, "Current configuration object was deleted " \ - "by another process.%s", VTYNL); \ + "by another process.\n"); \ return CMD_WARNING; \ } @@ -179,17 +179,43 @@ struct vty_arg /* Integrated configuration file. */ #define INTEGRATE_DEFAULT_CONFIG "frr.conf" -/* Small macro to determine newline is newline only or linefeed needed. */ -#define VTYNL ((vty->type == VTY_TERM) ? "\r\n" : "\n") - /* for compatibility */ -#define VTY_NEWLINE VTYNL -#define VTY_GET_INTEGER(desc,v,str) {(v)=strtoul ((str), NULL, 10);} -#define VTY_GET_INTEGER_RANGE(desc,v,str,min,max) {(v)=strtoul ((str), NULL, 10);} -#define VTY_GET_ULONG(desc,v,str) {(v)=strtoul ((str), NULL, 10);} -#define VTY_GET_ULL(desc,v,str) {(v)=strtoull ((str), NULL, 10);} -#define VTY_GET_IPV4_ADDRESS(desc,v,str) inet_aton ((str), &(v)) -#define VTY_GET_IPV4_PREFIX(desc,v,str) str2prefix_ipv4 ((str), &(v)) +#if defined(__ICC) +#define CPP_WARN_STR(X) #X +#define CPP_WARN(text) _Pragma(CPP_WARN_STR(message __FILE__ ": " text)) + +#elif (defined(__GNUC__) && \ + (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))) || \ + (defined(__clang__) && \ + (__clang_major__ >= 4 || (__clang_major__ == 3 && __clang_minor__ >= 5))) +#define CPP_WARN_STR(X) #X +#define CPP_WARN(text) _Pragma(CPP_WARN_STR(GCC warning text)) + +#else +#define CPP_WARN(text) +#endif + +#define VNL "\n" \ + CPP_WARN("VNL has been replaced with \\n.") +#define VTYNL "\n" \ + CPP_WARN("VTYNL has been replaced with \\n.") +#define VTY_NEWLINE "\n" \ + CPP_WARN("VTY_NEWLINE has been replaced with \\n.") +#define VTY_GET_INTEGER(desc,v,str) {(v)=strtoul ((str), NULL, 10);} \ + CPP_WARN("VTY_GET_INTEGER is no longer useful, use strtoul() or DEFPY.") +#define VTY_GET_INTEGER_RANGE(desc,v,str,min,max) {(v)=strtoul ((str), NULL, 10);} \ + CPP_WARN("VTY_GET_INTEGER_RANGE is no longer useful, use strtoul() or DEFPY.") +#define VTY_GET_ULONG(desc,v,str) {(v)=strtoul ((str), NULL, 10);} \ + CPP_WARN("VTY_GET_ULONG is no longer useful, use strtoul() or DEFPY.") +#define VTY_GET_ULL(desc,v,str) {(v)=strtoull ((str), NULL, 10);} \ + CPP_WARN("VTY_GET_ULL is no longer useful, use strtoull() or DEFPY.") +#define VTY_GET_IPV4_ADDRESS(desc,v,str) inet_aton ((str), &(v)) \ + CPP_WARN("VTY_GET_IPV4_ADDRESS is no longer useful, use inet_aton() or DEFPY.") +#define VTY_GET_IPV4_PREFIX(desc,v,str) str2prefix_ipv4 ((str), &(v)) \ + CPP_WARN("VTY_GET_IPV4_PREFIX is no longer useful, use str2prefix_ipv4() or DEFPY.") +#define vty_outln(vty, str, ...) \ + vty_out(vty, str "\n", ## __VA_ARGS__) \ + CPP_WARN("vty_outln is no longer useful, use vty_out(...\\n...)") /* Default time out value */ #define VTY_TIMEOUT_DEFAULT 600 @@ -217,7 +243,6 @@ extern void vty_reset (void); extern struct vty *vty_new (void); extern struct vty *vty_stdio (void (*atclose)(void)); extern int vty_out (struct vty *, const char *, ...) PRINTF_ATTRIBUTE(2, 3); -extern int vty_outln (struct vty *, const char *, ...) PRINTF_ATTRIBUTE(2, 3); extern void vty_read_config (const char *, char *); extern void vty_time_print (struct vty *, int); extern void vty_serv_sock (const char *, unsigned short, const char *); diff --git a/lib/workqueue.c b/lib/workqueue.c index 374934419..3600df2f2 100644 --- a/lib/workqueue.c +++ b/lib/workqueue.c @@ -191,11 +191,11 @@ DEFUN (show_work_queues, struct listnode *node; struct work_queue *wq; - vty_outln (vty, - "%c %8s %5s %8s %8s %21s", + vty_out (vty, + "%c %8s %5s %8s %8s %21s\n", ' ', "List","(ms) ","Q. Runs","Yields","Cycle Counts "); - vty_outln (vty, - "%c %8s %5s %8s %8s %7s %6s %8s %6s %s", + vty_out (vty, + "%c %8s %5s %8s %8s %7s %6s %8s %6s %s\n", 'P', "Items", "Hold", @@ -205,7 +205,7 @@ DEFUN (show_work_queues, for (ALL_LIST_ELEMENTS_RO (work_queues, node, wq)) { - vty_outln (vty,"%c %8d %5d %8ld %8ld %7d %6d %8ld %6u %s", + vty_out (vty,"%c %8d %5d %8ld %8ld %7d %6d %8ld %6u %s\n", (CHECK_FLAG (wq->flags, WQ_UNPLUGGED) ? ' ' : 'P'), listcount (wq->items), wq->spec.hold, diff --git a/nhrpd/nhrp_vty.c b/nhrpd/nhrp_vty.c index 5aeaad62f..af7fb0a50 100644 --- a/nhrpd/nhrp_vty.c +++ b/nhrpd/nhrp_vty.c @@ -83,7 +83,7 @@ static int nhrp_vty_return(struct vty *vty, int ret) snprintf(buf, sizeof(buf), "Unknown error %d", ret); } - vty_outln (vty, "%% %s", str); + vty_out (vty, "%% %s\n", str); return CMD_WARNING_CONFIG_FAILED;; } @@ -104,7 +104,7 @@ static int toggle_flag( return CMD_SUCCESS; } - vty_outln (vty, "%% Invalid value %s", name); + vty_out (vty, "%% Invalid value %s\n", name); return CMD_WARNING_CONFIG_FAILED;; } @@ -118,7 +118,7 @@ DEFUN(show_debugging_nhrp, show_debugging_nhrp_cmd, { int i; - vty_outln (vty, "NHRP debugging status:"); + vty_out (vty, "NHRP debugging status:\n"); for (i = 0; debug_flags_desc[i].str != NULL; i++) { if (debug_flags_desc[i].key == NHRP_DEBUG_ALL) @@ -126,7 +126,7 @@ DEFUN(show_debugging_nhrp, show_debugging_nhrp_cmd, if (!(debug_flags_desc[i].key & debug_flags)) continue; - vty_outln (vty, " NHRP %s debugging is on", + vty_out (vty, " NHRP %s debugging is on\n", debug_flags_desc[i].str); } @@ -158,7 +158,7 @@ static int nhrp_config_write(struct vty *vty) { #ifndef NO_DEBUG if (debug_flags == NHRP_DEBUG_ALL) { - vty_outln (vty, "debug nhrp all"); + vty_out (vty, "debug nhrp all\n"); } else { int i; @@ -167,19 +167,19 @@ static int nhrp_config_write(struct vty *vty) continue; if (!(debug_flags & debug_flags_desc[i].key)) continue; - vty_outln (vty, "debug nhrp %s", + vty_out (vty, "debug nhrp %s\n", debug_flags_desc[i].str); } } - vty_outln (vty, "!"); + vty_out (vty, "!\n"); #endif /* NO_DEBUG */ if (nhrp_event_socket_path) { - vty_outln (vty, "nhrp event socket %s", + vty_out (vty, "nhrp event socket %s\n", nhrp_event_socket_path); } if (netlink_nflog_group) { - vty_outln (vty, "nhrp nflog-group %d", + vty_out (vty, "nhrp nflog-group %d\n", netlink_nflog_group); } @@ -598,7 +598,7 @@ static void show_ip_nhrp_cache(struct nhrp_cache *c, void *pctx) return; if (!ctx->count) { - vty_outln (vty, "%-8s %-8s %-24s %-24s %-6s %s", + vty_out (vty, "%-8s %-8s %-24s %-24s %-6s %s\n", "Iface", "Type", "Protocol", @@ -608,7 +608,7 @@ static void show_ip_nhrp_cache(struct nhrp_cache *c, void *pctx) } ctx->count++; - vty_outln(ctx->vty, "%-8s %-8s %-24s %-24s %c%c%c %s", + vty_out(ctx->vty, "%-8s %-8s %-24s %-24s %c%c%c %s\n", c->ifp->name, nhrp_cache_type_str[c->cur.type], sockunion2str(&c->remote_addr, buf[0], sizeof buf[0]), @@ -626,7 +626,7 @@ static void show_ip_nhrp_nhs(struct nhrp_nhs *n, struct nhrp_registration *reg, char buf[2][SU_ADDRSTRLEN]; if (!ctx->count) { - vty_outln (vty, "%-8s %-24s %-16s %-16s", + vty_out (vty, "%-8s %-24s %-16s %-16s\n", "Iface", "FQDN", "NBMA", @@ -634,7 +634,7 @@ static void show_ip_nhrp_nhs(struct nhrp_nhs *n, struct nhrp_registration *reg, } ctx->count++; - vty_outln (vty, "%-8s %-24s %-16s %-16s", + vty_out (vty, "%-8s %-24s %-16s %-16s\n", n->ifp->name, n->nbma_fqdn, (reg && reg->peer) ? sockunion2str(®->peer->vc->remote.nbma, @@ -652,7 +652,7 @@ static void show_ip_nhrp_shortcut(struct nhrp_shortcut *s, void *pctx) char buf1[PREFIX_STRLEN], buf2[SU_ADDRSTRLEN]; if (!ctx->count) { - vty_outln (vty, "%-8s %-24s %-24s %s", + vty_out (vty, "%-8s %-24s %-24s %s\n", "Type", "Prefix", "Via", @@ -661,7 +661,7 @@ static void show_ip_nhrp_shortcut(struct nhrp_shortcut *s, void *pctx) ctx->count++; c = s->cache; - vty_outln(ctx->vty, "%-8s %-24s %-24s %s", + vty_out(ctx->vty, "%-8s %-24s %-24s %s\n", nhrp_cache_type_str[s->type], prefix2str(s->p, buf1, sizeof buf1), c ? sockunion2str(&c->remote_addr, buf2, sizeof buf2) : "", @@ -677,32 +677,30 @@ static void show_ip_opennhrp_cache(struct nhrp_cache *c, void *pctx) if (ctx->afi != family2afi(sockunion_family(&c->remote_addr))) return; - vty_outln(ctx->vty, - "Type: %s%s" - "Flags:%s%s%s" - "Protocol-Address: %s/%zu", + vty_out(ctx->vty, + "Type: %s\n" + "Flags:%s%s\n" + "Protocol-Address: %s/%zu\n", nhrp_cache_type_str[c->cur.type], - VTYNL, (c->cur.peer && c->cur.peer->online) ? " up": "", c->used ? " used": "", - VTYNL, sockunion2str(&c->remote_addr, buf, sizeof buf), 8 * family2addrsize(sockunion_family(&c->remote_addr))); if (c->cur.peer) { - vty_outln(ctx->vty, - "NBMA-Address: %s", + vty_out(ctx->vty, + "NBMA-Address: %s\n", sockunion2str(&c->cur.peer->vc->remote.nbma, buf, sizeof buf)); } if (sockunion_family(&c->cur.remote_nbma_natoa) != AF_UNSPEC) { - vty_outln(ctx->vty, - "NBMA-NAT-OA-Address: %s", + vty_out(ctx->vty, + "NBMA-NAT-OA-Address: %s\n", sockunion2str(&c->cur.remote_nbma_natoa, buf, sizeof buf)); } - vty_outln(ctx->vty, VTYNL); + vty_out(ctx->vty, "\n\n"); } DEFUN(show_ip_nhrp, show_ip_nhrp_cmd, @@ -731,14 +729,14 @@ DEFUN(show_ip_nhrp, show_ip_nhrp_cmd, } else if (argv[3]->text[0] == 's') { nhrp_shortcut_foreach(ctx.afi, show_ip_nhrp_shortcut, &ctx); } else { - vty_outln (vty, "Status: ok%s", VTYNL); + vty_out (vty, "Status: ok\n\n"); ctx.count++; for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) nhrp_cache_foreach(ifp, show_ip_opennhrp_cache, &ctx); } if (!ctx.count) { - vty_outln (vty, "%% No entries"); + vty_out (vty, "%% No entries\n"); return CMD_WARNING; } @@ -750,7 +748,7 @@ static void show_dmvpn_entry(struct nhrp_vc *vc, void *ctx) struct vty *vty = ctx; char buf[2][SU_ADDRSTRLEN]; - vty_outln (vty, "%-24s %-24s %c %-4d %-24s", + vty_out (vty, "%-24s %-24s %c %-4d %-24s\n", sockunion2str(&vc->local.nbma, buf[0], sizeof buf[0]), sockunion2str(&vc->remote.nbma, buf[1], sizeof buf[1]), notifier_active(&vc->notifier_list) ? 'n' : ' ', @@ -763,7 +761,7 @@ DEFUN(show_dmvpn, show_dmvpn_cmd, SHOW_STR "DMVPN information\n") { - vty_outln (vty, "%-24s %-24s %-6s %-4s %-24s", + vty_out (vty, "%-24s %-24s %-6s %-4s %-24s\n", "Src", "Dst", "Flags", @@ -815,11 +813,11 @@ DEFUN(clear_nhrp, clear_nhrp_cmd, } if (!ctx.count) { - vty_outln (vty, "%% No entries"); + vty_out (vty, "%% No entries\n"); return CMD_WARNING; } - vty_outln (vty, "%% %d entries cleared", ctx.count); + vty_out (vty, "%% %d entries cleared\n", ctx.count); return CMD_SUCCESS; } @@ -838,7 +836,7 @@ static void interface_config_write_nhrp_map(struct nhrp_cache *c, void *data) if (!c->map) return; if (sockunion_family(&c->remote_addr) != ctx->family) return; - vty_outln (vty, " %s nhrp map %s %s", + vty_out (vty, " %s nhrp map %s %s\n", ctx->aficmd, sockunion2str(&c->remote_addr, buf[0], sizeof buf[0]), c->cur.type == NHRP_CACHE_LOCAL ? "local" : sockunion2str(&c->cur.peer->vc->remote.nbma, buf[1], sizeof buf[1])); @@ -857,9 +855,9 @@ static int interface_config_write(struct vty *vty) int i; for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) { - vty_outln (vty, "interface %s", ifp->name); + vty_out (vty, "interface %s\n", ifp->name); if (ifp->desc) - vty_outln (vty, " description %s", ifp->desc); + vty_out (vty, " description %s\n", ifp->desc); nifp = ifp->info; if (nifp->ipsec_profile) { @@ -868,10 +866,10 @@ static int interface_config_write(struct vty *vty) if (nifp->ipsec_fallback_profile) vty_out(vty, " fallback-profile %s", nifp->ipsec_fallback_profile); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } if (nifp->source) - vty_outln (vty, " tunnel source %s", + vty_out (vty, " tunnel source %s\n", nifp->source); for (afi = 0; afi < AFI_MAX; afi++) { @@ -880,24 +878,24 @@ static int interface_config_write(struct vty *vty) aficmd = afi_to_cmd(afi); if (ad->network_id) - vty_outln (vty, " %s nhrp network-id %u", + vty_out (vty, " %s nhrp network-id %u\n", aficmd,ad->network_id); if (ad->holdtime != NHRPD_DEFAULT_HOLDTIME) - vty_outln (vty, " %s nhrp holdtime %u", + vty_out (vty, " %s nhrp holdtime %u\n", aficmd,ad->holdtime); if (ad->configured_mtu < 0) - vty_outln (vty, " %s nhrp mtu opennhrp", + vty_out (vty, " %s nhrp mtu opennhrp\n", aficmd); else if (ad->configured_mtu) - vty_outln (vty, " %s nhrp mtu %u", + vty_out (vty, " %s nhrp mtu %u\n", aficmd,ad->configured_mtu); for (i = 0; interface_flags_desc[i].str != NULL; i++) { if (!(ad->flags & interface_flags_desc[i].key)) continue; - vty_outln (vty, " %s nhrp %s", + vty_out (vty, " %s nhrp %s\n", aficmd, interface_flags_desc[i].str); } @@ -909,14 +907,14 @@ static int interface_config_write(struct vty *vty) nhrp_cache_foreach(ifp, interface_config_write_nhrp_map, &mapctx); list_for_each_entry(nhs, &ad->nhslist_head, nhslist_entry) { - vty_outln (vty, " %s nhrp nhs %s nbma %s", + vty_out (vty, " %s nhrp nhs %s nbma %s\n", aficmd, sockunion_family(&nhs->proto_addr) == AF_UNSPEC ? "dynamic" : sockunion2str(&nhs->proto_addr, buf, sizeof buf), nhs->nbma_fqdn); } } - vty_outln (vty, "!"); + vty_out (vty, "!\n"); } return 0; diff --git a/ospf6d/ospf6_abr.c b/ospf6d/ospf6_abr.c index 7ef7fdd94..314fe4873 100644 --- a/ospf6d/ospf6_abr.c +++ b/ospf6d/ospf6_abr.c @@ -1066,16 +1066,16 @@ ospf6_inter_area_prefix_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) prefix_lsa = (struct ospf6_inter_prefix_lsa *) OSPF6_LSA_HEADER_END (lsa->header); - vty_out (vty, " Metric: %lu%s", - (u_long) OSPF6_ABR_SUMMARY_METRIC (prefix_lsa), VNL); + vty_out (vty, " Metric: %lu\n", + (u_long) OSPF6_ABR_SUMMARY_METRIC (prefix_lsa)); ospf6_prefix_options_printbuf (prefix_lsa->prefix.prefix_options, buf, sizeof (buf)); - vty_out (vty, " Prefix Options: %s%s", buf, VNL); + vty_out (vty, " Prefix Options: %s\n", buf); - vty_out (vty, " Prefix: %s%s", + vty_out (vty, " Prefix: %s\n", ospf6_inter_area_prefix_lsa_get_prefix_str (lsa, buf, sizeof(buf), - 0), VNL); + 0)); return 0; } @@ -1109,12 +1109,12 @@ ospf6_inter_area_router_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) OSPF6_LSA_HEADER_END (lsa->header); ospf6_options_printbuf (router_lsa->options, buf, sizeof (buf)); - vty_out (vty, " Options: %s%s", buf, VNL); - vty_out (vty, " Metric: %lu%s", - (u_long) OSPF6_ABR_SUMMARY_METRIC (router_lsa), VNL); + vty_out (vty, " Options: %s\n", buf); + vty_out (vty, " Metric: %lu\n", + (u_long) OSPF6_ABR_SUMMARY_METRIC (router_lsa)); inet_ntop (AF_INET, &router_lsa->router_id, buf, sizeof (buf)); - vty_out (vty, " Destination Router ID: %s%s", buf, VNL); + vty_out (vty, " Destination Router ID: %s\n", buf); return 0; } @@ -1149,7 +1149,7 @@ int config_write_ospf6_debug_abr (struct vty *vty) { if (IS_OSPF6_DEBUG_ABR) - vty_out (vty, "debug ospf6 abr%s", VNL); + vty_out (vty, "debug ospf6 abr\n"); return 0; } diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c index b63e8f5ef..8e6408bf4 100644 --- a/ospf6d/ospf6_area.c +++ b/ospf6d/ospf6_area.c @@ -371,43 +371,43 @@ ospf6_area_show (struct vty *vty, struct ospf6_area *oa) unsigned long result; if (!IS_AREA_STUB (oa)) - vty_out (vty, " Area %s%s", oa->name, VNL); + vty_out (vty, " Area %s\n", oa->name); else { if (oa->no_summary) { - vty_out (vty, " Area %s[Stub, No Summary]%s", oa->name, VNL); + vty_out (vty, " Area %s[Stub, No Summary]\n", oa->name); } else { - vty_out (vty, " Area %s[Stub]%s", oa->name, VNL); + vty_out (vty, " Area %s[Stub]\n", oa->name); } } - vty_out (vty, " Number of Area scoped LSAs is %u%s", - oa->lsdb->count, VNL); + vty_out (vty, " Number of Area scoped LSAs is %u\n", + oa->lsdb->count); 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); + vty_out (vty, "\n"); if (oa->ts_spf.tv_sec || oa->ts_spf.tv_usec) { result = monotime_since(&oa->ts_spf, NULL); if (result/TIMER_SECOND_MICRO > 0) { - vty_outln (vty, "SPF last executed %ld.%lds ago", + vty_out (vty, "SPF last executed %ld.%lds ago\n", result/TIMER_SECOND_MICRO, result % TIMER_SECOND_MICRO); } else { - vty_outln (vty, "SPF last executed %ldus ago", + vty_out (vty, "SPF last executed %ldus ago\n", result); } } else - vty_outln (vty, "SPF has not been run"); + vty_out (vty, "SPF has not been run\n"); } @@ -417,7 +417,7 @@ ospf6_area_show (struct vty *vty, struct ospf6_area *oa) u_int32_t area_id = htonl (strtoul (str, &ep, 10)); \ if (*ep && inet_pton (AF_INET, str, &area_id) != 1) \ { \ - vty_out (vty, "Malformed Area-ID: %s%s", str, VNL); \ + vty_out (vty, "Malformed Area-ID: %s\n", str); \ return CMD_SUCCESS; \ } \ int format = !*ep ? OSPF6_AREA_FMT_DECIMAL : \ @@ -454,7 +454,7 @@ DEFUN (area_range, ret = str2prefix (argv[idx_ipv6_prefixlen]->arg, &prefix); if (ret != 1 || prefix.family != AF_INET6) { - vty_out (vty, "Malformed argument: %s%s", argv[idx_ipv6_prefixlen]->arg, VNL); + vty_out (vty, "Malformed argument: %s\n", argv[idx_ipv6_prefixlen]->arg); return CMD_SUCCESS; } @@ -528,14 +528,14 @@ DEFUN (no_area_range, ret = str2prefix (argv[idx_ipv6]->arg, &prefix); if (ret != 1 || prefix.family != AF_INET6) { - vty_out (vty, "Malformed argument: %s%s", argv[idx_ipv6]->arg, VNL); + vty_out (vty, "Malformed argument: %s\n", argv[idx_ipv6]->arg); return CMD_SUCCESS; } range = ospf6_route_lookup (&prefix, oa->range_table); if (range == NULL) { - vty_out (vty, "Range %s does not exists.%s", argv[idx_ipv6]->arg, VNL); + vty_out (vty, "Range %s does not exists.\n", argv[idx_ipv6]->arg); return CMD_SUCCESS; } @@ -583,28 +583,28 @@ ospf6_area_config_write (struct vty *vty) if (range->path.u.cost_config != OSPF_AREA_RANGE_COST_UNSPEC) vty_out (vty, " cost %d", range->path.u.cost_config); } - vty_out (vty, "%s", VNL); + vty_out (vty, "\n"); } if (IS_AREA_STUB (oa)) { if (oa->no_summary) - vty_out (vty, " area %s stub no-summary%s", oa->name, VNL); + vty_out (vty, " area %s stub no-summary\n", oa->name); else - vty_out (vty, " area %s stub%s", oa->name, VNL); + vty_out (vty, " area %s stub\n", oa->name); } if (PREFIX_NAME_IN (oa)) - vty_out (vty, " area %s filter-list prefix %s in%s", - oa->name, PREFIX_NAME_IN (oa), VNL); + vty_out (vty, " area %s filter-list prefix %s in\n", + oa->name, PREFIX_NAME_IN (oa)); if (PREFIX_NAME_OUT (oa)) - vty_out (vty, " area %s filter-list prefix %s out%s", - oa->name, PREFIX_NAME_OUT (oa), VNL); + vty_out (vty, " area %s filter-list prefix %s out\n", + oa->name, PREFIX_NAME_OUT (oa)); if (IMPORT_NAME (oa)) - vty_out (vty, " area %s import-list %s%s", - oa->name, IMPORT_NAME (oa), VNL); + vty_out (vty, " area %s import-list %s\n", + oa->name, IMPORT_NAME (oa)); if (EXPORT_NAME (oa)) - vty_out (vty, " area %s export-list %s%s", - oa->name, EXPORT_NAME (oa), VNL); + vty_out (vty, " area %s export-list %s\n", + oa->name, EXPORT_NAME (oa)); } } @@ -831,8 +831,8 @@ DEFUN (show_ipv6_ospf6_spf_tree, route = ospf6_route_lookup (&prefix, oa->spf_table); if (route == NULL) { - vty_out (vty, "LS entry for root not found in area %s%s", - oa->name, VNL); + vty_out (vty, "LS entry for root not found in area %s\n", + oa->name); continue; } root = (struct ospf6_vertex *) route->route_option; @@ -866,21 +866,21 @@ DEFUN (show_ipv6_ospf6_area_spf_tree, if (inet_pton (AF_INET, argv[idx_ipv4]->arg, &area_id) != 1) { - vty_out (vty, "Malformed Area-ID: %s%s", argv[idx_ipv4]->arg, VNL); + vty_out (vty, "Malformed Area-ID: %s\n", argv[idx_ipv4]->arg); return CMD_SUCCESS; } oa = ospf6_area_lookup (area_id, ospf6); if (oa == NULL) { - vty_out (vty, "No such Area: %s%s", argv[idx_ipv4]->arg, VNL); + vty_out (vty, "No such Area: %s\n", argv[idx_ipv4]->arg); return CMD_SUCCESS; } route = ospf6_route_lookup (&prefix, oa->spf_table); if (route == NULL) { - vty_out (vty, "LS entry for root not found in area %s%s", - oa->name, VNL); + vty_out (vty, "LS entry for root not found in area %s\n", + oa->name); return CMD_SUCCESS; } root = (struct ospf6_vertex *) route->route_option; @@ -919,13 +919,13 @@ DEFUN (show_ipv6_ospf6_simulate_spf_tree_root, if (inet_pton (AF_INET, argv[idx_ipv4_2]->arg, &area_id) != 1) { - vty_out (vty, "Malformed Area-ID: %s%s", argv[idx_ipv4_2]->arg, VNL); + vty_out (vty, "Malformed Area-ID: %s\n", argv[idx_ipv4_2]->arg); return CMD_SUCCESS; } oa = ospf6_area_lookup (area_id, ospf6); if (oa == NULL) { - vty_out (vty, "No such Area: %s%s", argv[idx_ipv4_2]->arg, VNL); + vty_out (vty, "No such Area: %s\n", argv[idx_ipv4_2]->arg); return CMD_SUCCESS; } @@ -968,7 +968,7 @@ DEFUN (ospf6_area_stub, if (!ospf6_area_stub_set (ospf6, area)) { - vty_outln (vty,"First deconfigure all virtual link through this area"); + vty_out (vty,"First deconfigure all virtual link through this area\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -993,7 +993,7 @@ DEFUN (ospf6_area_stub_no_summary, if (!ospf6_area_stub_set (ospf6, area)) { - vty_outln (vty,"First deconfigure all virtual link through this area"); + vty_out (vty,"First deconfigure all virtual link through this area\n"); return CMD_WARNING_CONFIG_FAILED; } diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c index bc816c26a..867d8bb64 100644 --- a/ospf6d/ospf6_asbr.c +++ b/ospf6d/ospf6_asbr.c @@ -759,11 +759,11 @@ ospf6_redistribute_config_write (struct vty *vty) continue; if (ospf6->rmap[type].name) - vty_out (vty, " redistribute %s route-map %s%s", - ZROUTE_NAME (type), ospf6->rmap[type].name, VNL); + vty_out (vty, " redistribute %s route-map %s\n", + ZROUTE_NAME (type), ospf6->rmap[type].name); else - vty_out (vty, " redistribute %s%s", - ZROUTE_NAME (type), VNL); + vty_out (vty, " redistribute %s\n", + ZROUTE_NAME (type)); } return 0; @@ -789,7 +789,7 @@ ospf6_redistribute_show_config (struct vty *vty) total++; } - vty_out (vty, "Redistributing External Routes from:%s", VNL); + vty_out (vty, "Redistributing External Routes from:\n"); for (type = 0; type < ZEBRA_ROUTE_MAX; type++) { if (type == ZEBRA_ROUTE_OSPF6) @@ -798,15 +798,14 @@ ospf6_redistribute_show_config (struct vty *vty) continue; if (ospf6->rmap[type].name) - vty_out (vty, " %d: %s with route-map \"%s\"%s%s", nroute[type], + vty_out (vty, " %d: %s with route-map \"%s\"%s\n", nroute[type], ZROUTE_NAME (type), ospf6->rmap[type].name, - (ospf6->rmap[type].map ? "" : " (not found !)"), - VNL); + (ospf6->rmap[type].map ? "" : " (not found !)")); else - vty_out (vty, " %d: %s%s", nroute[type], - ZROUTE_NAME (type), VNL); + vty_out (vty, " %d: %s\n", nroute[type], + ZROUTE_NAME (type)); } - vty_out (vty, "Total %d routes%s", total, VNL); + vty_out (vty, "Total %d routes\n", total); } @@ -1082,13 +1081,13 @@ route_map_command_status (struct vty *vty, int ret) switch (ret) { case RMAP_RULE_MISSING: - vty_out (vty, "OSPF6 Can't find rule.%s", VNL); + vty_out (vty, "OSPF6 Can't find rule.\n"); break; case RMAP_COMPILE_ERROR: - vty_out (vty, "OSPF6 Argument is malformed.%s", VNL); + vty_out (vty, "OSPF6 Argument is malformed.\n"); break; default: - vty_out (vty, "OSPF6 route-map add set failed.%s", VNL); + vty_out (vty, "OSPF6 route-map add set failed.\n"); break; } return CMD_WARNING_CONFIG_FAILED; @@ -1247,35 +1246,31 @@ ospf6_as_external_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) (CHECK_FLAG (external->bits_metric, OSPF6_ASBR_BIT_F) ? 'F' : '-'), (CHECK_FLAG (external->bits_metric, OSPF6_ASBR_BIT_T) ? 'T' : '-')); - vty_out (vty, " Bits: %s%s", buf, VNL); - vty_out (vty, " Metric: %5lu%s", (u_long) OSPF6_ASBR_METRIC (external), - VNL); + vty_out (vty, " Bits: %s\n", buf); + vty_out (vty, " Metric: %5lu\n", (u_long) OSPF6_ASBR_METRIC (external)); ospf6_prefix_options_printbuf (external->prefix.prefix_options, buf, sizeof (buf)); - vty_out (vty, " Prefix Options: %s%s", buf, - VNL); + vty_out (vty, " Prefix Options: %s\n", buf); - vty_out (vty, " Referenced LSType: %d%s", - ntohs (external->prefix.prefix_refer_lstype), - VNL); + vty_out (vty, " Referenced LSType: %d\n", + ntohs (external->prefix.prefix_refer_lstype)); - vty_out (vty, " Prefix: %s%s", - ospf6_as_external_lsa_get_prefix_str (lsa, buf, sizeof(buf), 0), VNL); + vty_out (vty, " Prefix: %s\n", + ospf6_as_external_lsa_get_prefix_str (lsa, buf, sizeof(buf), 0)); /* Forwarding-Address */ if (CHECK_FLAG (external->bits_metric, OSPF6_ASBR_BIT_F)) { - vty_out (vty, " Forwarding-Address: %s%s", - ospf6_as_external_lsa_get_prefix_str (lsa, buf, sizeof(buf), 1), - VNL); + vty_out (vty, " Forwarding-Address: %s\n", + ospf6_as_external_lsa_get_prefix_str (lsa, buf, sizeof(buf), 1)); } /* Tag */ if (CHECK_FLAG (external->bits_metric, OSPF6_ASBR_BIT_T)) { - vty_out (vty, " Tag: %"ROUTE_TAG_PRI"%s", - ospf6_as_external_lsa_get_tag (lsa), VNL); + vty_out (vty, " Tag: %"ROUTE_TAG_PRI"\n", + ospf6_as_external_lsa_get_tag (lsa)); } return 0; @@ -1297,12 +1292,12 @@ ospf6_asbr_external_route_show (struct vty *vty, struct ospf6_route *route) snprintf (forwarding, sizeof (forwarding), ":: (ifindex %d)", ospf6_route_get_first_nh_index (route)); - vty_out (vty, "%c %-32s %-15s type-%d %5lu %s%s", + vty_out (vty, "%c %-32s %-15s type-%d %5lu %s\n", zebra_route_char(info->type), prefix, id, route->path.metric_type, (u_long) (route->path.metric_type == 2 ? route->path.u.cost_e2 : route->path.cost), - forwarding, VNL); + forwarding); } DEFUN (show_ipv6_ospf6_redistribute, @@ -1399,7 +1394,7 @@ int config_write_ospf6_debug_asbr (struct vty *vty) { if (IS_OSPF6_DEBUG_ASBR) - vty_out (vty, "debug ospf6 asbr%s", VNL); + vty_out (vty, "debug ospf6 asbr\n"); return 0; } diff --git a/ospf6d/ospf6_bfd.c b/ospf6d/ospf6_bfd.c index 6ca56869d..f460bf065 100644 --- a/ospf6d/ospf6_bfd.c +++ b/ospf6d/ospf6_bfd.c @@ -295,11 +295,11 @@ ospf6_bfd_write_config(struct vty *vty, struct ospf6_interface *oi) bfd_info = (struct bfd_info *)oi->bfd_info; if (CHECK_FLAG(bfd_info->flags, BFD_FLAG_PARAM_CFG)) - vty_outln (vty, " ipv6 ospf6 bfd %d %d %d", + vty_out (vty, " ipv6 ospf6 bfd %d %d %d\n", bfd_info->detect_mult, bfd_info->required_min_rx, bfd_info->desired_min_tx); else - vty_outln (vty, " ipv6 ospf6 bfd"); + vty_out (vty, " ipv6 ospf6 bfd\n"); } /* diff --git a/ospf6d/ospf6_flood.c b/ospf6d/ospf6_flood.c index 8a8dcfcd2..f816c6f48 100644 --- a/ospf6d/ospf6_flood.c +++ b/ospf6d/ospf6_flood.c @@ -1032,7 +1032,7 @@ int config_write_ospf6_debug_flood (struct vty *vty) { if (IS_OSPF6_DEBUG_FLOODING) - vty_out (vty, "debug ospf6 flooding%s", VNL); + vty_out (vty, "debug ospf6 flooding\n"); return 0; } diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index febc59327..d647b94df 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -917,20 +917,19 @@ ospf6_interface_show (struct vty *vty, struct interface *ifp) else type = "UNKNOWN"; - vty_out (vty, "%s is %s, type %s%s", - ifp->name, updown[if_is_operative (ifp)], type, - VNL); - vty_out (vty, " Interface ID: %d%s", ifp->ifindex, VNL); + vty_out (vty, "%s is %s, type %s\n", + ifp->name, updown[if_is_operative (ifp)], type); + vty_out (vty, " Interface ID: %d\n", ifp->ifindex); if (ifp->info == NULL) { - vty_out (vty, " OSPF not enabled on this interface%s", VNL); + vty_out (vty, " OSPF not enabled on this interface\n"); return 0; } else oi = (struct ospf6_interface *) ifp->info; - vty_out (vty, " Internet Address:%s", VNL); + vty_out (vty, " Internet Address:\n"); for (ALL_LIST_ELEMENTS_RO (ifp->connected, i, c)) { @@ -939,49 +938,43 @@ ospf6_interface_show (struct vty *vty, struct interface *ifp) switch (p->family) { case AF_INET: - vty_out (vty, " inet : %s%s", strbuf, - VNL); + vty_out (vty, " inet : %s\n", strbuf); break; case AF_INET6: - vty_out (vty, " inet6: %s%s", strbuf, - VNL); + vty_out (vty, " inet6: %s\n", strbuf); break; default: - vty_out (vty, " ??? : %s%s", strbuf, - VNL); + vty_out (vty, " ??? : %s\n", strbuf); break; } } if (oi->area) { - vty_out (vty, " Instance ID %d, Interface MTU %d (autodetect: %d)%s", - oi->instance_id, oi->ifmtu, ifp->mtu6, VNL); - vty_out (vty, " MTU mismatch detection: %s%s", oi->mtu_ignore ? - "disabled" : "enabled", VNL); + vty_out (vty, " Instance ID %d, Interface MTU %d (autodetect: %d)\n", + oi->instance_id, oi->ifmtu, ifp->mtu6); + vty_out (vty, " MTU mismatch detection: %s\n", oi->mtu_ignore ? + "disabled" : "enabled"); inet_ntop (AF_INET, &oi->area->area_id, strbuf, sizeof (strbuf)); - vty_out (vty, " Area ID %s, Cost %u%s", strbuf, oi->cost, - VNL); + vty_out (vty, " Area ID %s, Cost %u\n", strbuf, oi->cost); } else - vty_out (vty, " Not Attached to Area%s", VNL); + vty_out (vty, " Not Attached to Area\n"); - vty_out (vty, " State %s, Transmit Delay %d sec, Priority %d%s", + vty_out (vty, " State %s, Transmit Delay %d sec, Priority %d\n", ospf6_interface_state_str[oi->state], - oi->transdelay, oi->priority, - VNL); - vty_out (vty, " Timer intervals configured:%s", VNL); - vty_out (vty, " Hello %d, Dead %d, Retransmit %d%s", - oi->hello_interval, oi->dead_interval, oi->rxmt_interval, - VNL); + oi->transdelay, oi->priority); + vty_out (vty, " Timer intervals configured:\n"); + vty_out (vty, " Hello %d, Dead %d, Retransmit %d\n", + oi->hello_interval, oi->dead_interval, oi->rxmt_interval); inet_ntop (AF_INET, &oi->drouter, drouter, sizeof (drouter)); inet_ntop (AF_INET, &oi->bdrouter, bdrouter, sizeof (bdrouter)); - vty_out (vty, " DR: %s BDR: %s%s", drouter, bdrouter, VNL); + vty_out (vty, " DR: %s BDR: %s\n", drouter, bdrouter); - vty_out (vty, " Number of I/F scoped LSAs is %u%s", - oi->lsdb->count, VNL); + vty_out (vty, " Number of I/F scoped LSAs is %u\n", + oi->lsdb->count); monotime(&now); @@ -989,25 +982,23 @@ ospf6_interface_show (struct vty *vty, struct interface *ifp) if (oi->thread_send_lsupdate) timersub (&oi->thread_send_lsupdate->u.sands, &now, &res); timerstring (&res, duration, sizeof (duration)); - vty_out (vty, " %d Pending LSAs for LSUpdate in Time %s [thread %s]%s", + vty_out (vty, " %d Pending LSAs for LSUpdate in Time %s [thread %s]\n", oi->lsupdate_list->count, duration, - (oi->thread_send_lsupdate ? "on" : "off"), - VNL); + (oi->thread_send_lsupdate ? "on" : "off")); for (lsa = ospf6_lsdb_head (oi->lsupdate_list); lsa; lsa = ospf6_lsdb_next (lsa)) - vty_out (vty, " %s%s", lsa->name, VNL); + vty_out (vty, " %s\n", lsa->name); timerclear (&res); if (oi->thread_send_lsack) timersub (&oi->thread_send_lsack->u.sands, &now, &res); timerstring (&res, duration, sizeof (duration)); - vty_out (vty, " %d Pending LSAs for LSAck in Time %s [thread %s]%s", + vty_out (vty, " %d Pending LSAs for LSAck in Time %s [thread %s]\n", oi->lsack_list->count, duration, - (oi->thread_send_lsack ? "on" : "off"), - VNL); + (oi->thread_send_lsack ? "on" : "off")); for (lsa = ospf6_lsdb_head (oi->lsack_list); lsa; lsa = ospf6_lsdb_next (lsa)) - vty_out (vty, " %s%s", lsa->name, VNL); + vty_out (vty, " %s\n", lsa->name); ospf6_bfd_show_info(vty, oi->bfd_info, 1); return 0; } @@ -1031,8 +1022,7 @@ DEFUN (show_ipv6_ospf6_interface, ifp = if_lookup_by_name (argv[idx_ifname]->arg, VRF_DEFAULT); if (ifp == NULL) { - vty_out (vty, "No such Interface: %s%s", argv[idx_ifname]->arg, - VNL); + vty_out (vty, "No such Interface: %s\n", argv[idx_ifname]->arg); return CMD_WARNING; } ospf6_interface_show (vty, ifp); @@ -1068,14 +1058,14 @@ DEFUN (show_ipv6_ospf6_interface_ifname_prefix, ifp = if_lookup_by_name (argv[idx_ifname]->arg, VRF_DEFAULT); if (ifp == NULL) { - vty_out (vty, "No such Interface: %s%s", argv[idx_ifname]->arg, VNL); + vty_out (vty, "No such Interface: %s\n", argv[idx_ifname]->arg); return CMD_WARNING; } oi = ifp->info; if (oi == NULL) { - vty_out (vty, "OSPFv3 is not enabled on %s%s", argv[idx_ifname]->arg, VNL); + vty_out (vty, "OSPFv3 is not enabled on %s\n", argv[idx_ifname]->arg); return CMD_WARNING; } @@ -1145,8 +1135,8 @@ DEFUN (ipv6_ospf6_ifmtu, if (ifp->mtu6 != 0 && ifp->mtu6 < ifmtu) { - vty_out (vty, "%s's ospf6 ifmtu cannot go beyond physical mtu (%d)%s", - ifp->name, ifp->mtu6, VNL); + vty_out (vty, "%s's ospf6 ifmtu cannot go beyond physical mtu (%d)\n", + ifp->name, ifp->mtu6); return CMD_WARNING_CONFIG_FAILED; } @@ -1155,8 +1145,8 @@ DEFUN (ipv6_ospf6_ifmtu, iobuflen = ospf6_iobuf_size (ifmtu); if (iobuflen < ifmtu) { - vty_out (vty, "%s's ifmtu is adjusted to I/O buffer size (%d).%s", - ifp->name, iobuflen, VNL); + vty_out (vty, "%s's ifmtu is adjusted to I/O buffer size (%d).\n", + ifp->name, iobuflen); oi->ifmtu = oi->c_ifmtu = iobuflen; } else @@ -1203,8 +1193,8 @@ DEFUN (no_ipv6_ospf6_ifmtu, iobuflen = ospf6_iobuf_size (ifp->mtu); if (iobuflen < ifp->mtu) { - vty_out (vty, "%s's ifmtu is adjusted to I/O buffer size (%d).%s", - ifp->name, iobuflen, VNL); + vty_out (vty, "%s's ifmtu is adjusted to I/O buffer size (%d).\n", + ifp->name, iobuflen); oi->ifmtu = iobuflen; } else @@ -1250,7 +1240,7 @@ DEFUN (ipv6_ospf6_cost, if (lcost > UINT32_MAX) { - vty_out (vty, "Cost %ld is out of range%s", lcost, VNL); + vty_out (vty, "Cost %ld is out of range\n", lcost); return CMD_WARNING_CONFIG_FAILED; } @@ -1307,7 +1297,7 @@ DEFUN (auto_cost_reference_bandwidth, refbw = strtol (argv[idx_number]->arg, NULL, 10); if (refbw < 1 || refbw > 4294967) { - vty_outln (vty, "reference-bandwidth value is invalid"); + vty_out (vty, "reference-bandwidth value is invalid\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1769,63 +1759,63 @@ config_write_ospf6_interface (struct vty *vty) if (oi == NULL) continue; - vty_out (vty, "interface %s%s", - oi->interface->name, VNL); + vty_out (vty, "interface %s\n", + oi->interface->name); if (ifp->desc) - vty_out (vty, " description %s%s", ifp->desc, VNL); + vty_out (vty, " description %s\n", ifp->desc); if (oi->c_ifmtu) - vty_out (vty, " ipv6 ospf6 ifmtu %d%s", oi->c_ifmtu, VNL); + vty_out (vty, " ipv6 ospf6 ifmtu %d\n", oi->c_ifmtu); if (CHECK_FLAG (oi->flag, OSPF6_INTERFACE_NOAUTOCOST)) - vty_out (vty, " ipv6 ospf6 cost %d%s", - oi->cost, VNL); + vty_out (vty, " ipv6 ospf6 cost %d\n", + oi->cost); if (oi->hello_interval != OSPF6_INTERFACE_HELLO_INTERVAL) - vty_out (vty, " ipv6 ospf6 hello-interval %d%s", - oi->hello_interval, VNL); + vty_out (vty, " ipv6 ospf6 hello-interval %d\n", + oi->hello_interval); if (oi->dead_interval != OSPF6_INTERFACE_DEAD_INTERVAL) - vty_out (vty, " ipv6 ospf6 dead-interval %d%s", - oi->dead_interval, VNL); + vty_out (vty, " ipv6 ospf6 dead-interval %d\n", + oi->dead_interval); if (oi->rxmt_interval != OSPF6_INTERFACE_RXMT_INTERVAL) - vty_out (vty, " ipv6 ospf6 retransmit-interval %d%s", - oi->rxmt_interval, VNL); + vty_out (vty, " ipv6 ospf6 retransmit-interval %d\n", + oi->rxmt_interval); if (oi->priority != OSPF6_INTERFACE_PRIORITY) - vty_out (vty, " ipv6 ospf6 priority %d%s", - oi->priority, VNL); + vty_out (vty, " ipv6 ospf6 priority %d\n", + oi->priority); if (oi->transdelay != OSPF6_INTERFACE_TRANSDELAY) - vty_out (vty, " ipv6 ospf6 transmit-delay %d%s", - oi->transdelay, VNL); + vty_out (vty, " ipv6 ospf6 transmit-delay %d\n", + oi->transdelay); if (oi->instance_id != OSPF6_INTERFACE_INSTANCE_ID) - vty_out (vty, " ipv6 ospf6 instance-id %d%s", - oi->instance_id, VNL); + vty_out (vty, " ipv6 ospf6 instance-id %d\n", + oi->instance_id); if (oi->plist_name) - vty_out (vty, " ipv6 ospf6 advertise prefix-list %s%s", - oi->plist_name, VNL); + vty_out (vty, " ipv6 ospf6 advertise prefix-list %s\n", + oi->plist_name); if (CHECK_FLAG (oi->flag, OSPF6_INTERFACE_PASSIVE)) - vty_out (vty, " ipv6 ospf6 passive%s", VNL); + vty_out (vty, " ipv6 ospf6 passive\n"); if (oi->mtu_ignore) - vty_out (vty, " ipv6 ospf6 mtu-ignore%s", VNL); + vty_out (vty, " ipv6 ospf6 mtu-ignore\n"); if (oi->type != ospf6_default_iftype(ifp)) { if (oi->type == OSPF_IFTYPE_POINTOPOINT) - vty_out (vty, " ipv6 ospf6 network point-to-point%s", VNL); + vty_out (vty, " ipv6 ospf6 network point-to-point\n"); else if (oi->type == OSPF_IFTYPE_BROADCAST) - vty_out (vty, " ipv6 ospf6 network broadcast%s", VNL); + vty_out (vty, " ipv6 ospf6 network broadcast\n"); } ospf6_bfd_write_config(vty, oi); - vty_out (vty, "!%s", VNL); + vty_out (vty, "!\n"); } return 0; } @@ -1922,7 +1912,7 @@ DEFUN (clear_ipv6_ospf6_interface, { if ((ifp = if_lookup_by_name (argv[idx_ifname]->arg, VRF_DEFAULT)) == NULL) { - vty_out (vty, "No such Interface: %s%s", argv[idx_ifname]->arg, VNL); + vty_out (vty, "No such Interface: %s\n", argv[idx_ifname]->arg); return CMD_WARNING; } ospf6_interface_clear (vty, ifp); @@ -1966,7 +1956,7 @@ int config_write_ospf6_debug_interface (struct vty *vty) { if (IS_OSPF6_DEBUG_INTERFACE) - vty_out (vty, "debug ospf6 interface%s", VNL); + vty_out (vty, "debug ospf6 interface\n"); return 0; } diff --git a/ospf6d/ospf6_intra.c b/ospf6d/ospf6_intra.c index 6acd45b7c..41271d802 100644 --- a/ospf6d/ospf6_intra.c +++ b/ospf6d/ospf6_intra.c @@ -105,7 +105,7 @@ ospf6_router_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) ospf6_capability_printbuf (router_lsa->bits, bits, sizeof (bits)); ospf6_options_printbuf (router_lsa->options, options, sizeof (options)); - vty_out (vty, " Bits: %s Options: %s%s", bits, options, VNL); + vty_out (vty, " Bits: %s Options: %s\n", bits, options); start = (char *) router_lsa + sizeof (struct ospf6_router_lsa); end = (char *) lsa->header + ntohs (lsa->header->length); @@ -125,17 +125,17 @@ ospf6_router_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) else snprintf (name, sizeof (name), "Unknown (%#x)", lsdesc->type); - vty_out (vty, " Type: %s Metric: %d%s", - name, ntohs (lsdesc->metric), VNL); - vty_out (vty, " Interface ID: %s%s", + vty_out (vty, " Type: %s Metric: %d\n", + name, ntohs (lsdesc->metric)); + vty_out (vty, " Interface ID: %s\n", inet_ntop (AF_INET, &lsdesc->interface_id, - buf, sizeof (buf)), VNL); - vty_out (vty, " Neighbor Interface ID: %s%s", + buf, sizeof (buf))); + vty_out (vty, " Neighbor Interface ID: %s\n", inet_ntop (AF_INET, &lsdesc->neighbor_interface_id, - buf, sizeof (buf)), VNL); - vty_out (vty, " Neighbor Router ID: %s%s", + buf, sizeof (buf))); + vty_out (vty, " Neighbor Router ID: %s\n", inet_ntop (AF_INET, &lsdesc->neighbor_router_id, - buf, sizeof (buf)), VNL); + buf, sizeof (buf))); } return 0; } @@ -408,7 +408,7 @@ ospf6_network_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) ((caddr_t) lsa->header + sizeof (struct ospf6_lsa_header)); ospf6_options_printbuf (network_lsa->options, options, sizeof (options)); - vty_out (vty, " Options: %s%s", options, VNL); + vty_out (vty, " Options: %s\n", options); start = (char *) network_lsa + sizeof (struct ospf6_network_lsa); end = (char *) lsa->header + ntohs (lsa->header->length); @@ -417,7 +417,7 @@ ospf6_network_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) { lsdesc = (struct ospf6_network_lsdesc *) current; inet_ntop (AF_INET, &lsdesc->router_id, buf, sizeof (buf)); - vty_out (vty, " Attached Router: %s%s", buf, VNL); + vty_out (vty, " Attached Router: %s\n", buf); } return 0; } @@ -623,10 +623,10 @@ ospf6_link_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) inet_ntop (AF_INET6, &link_lsa->linklocal_addr, buf, sizeof (buf)); prefixnum = ntohl (link_lsa->prefix_num); - vty_out (vty, " Priority: %d Options: %s%s", - link_lsa->priority, options, VNL); - vty_out (vty, " LinkLocal Address: %s%s", buf, VNL); - vty_out (vty, " Number of Prefix: %d%s", prefixnum, VNL); + vty_out (vty, " Priority: %d Options: %s\n", + link_lsa->priority, options); + vty_out (vty, " LinkLocal Address: %s\n", buf); + vty_out (vty, " Number of Prefix: %d\n", prefixnum); start = (char *) link_lsa + sizeof (struct ospf6_link_lsa); end = (char *) lsa->header + ntohs (lsa->header->length); @@ -645,15 +645,15 @@ ospf6_link_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) "LA" : "--"); nu = (CHECK_FLAG (prefix->prefix_options, OSPF6_PREFIX_OPTION_NU) ? "NU" : "--"); - vty_out (vty, " Prefix Options: %s|%s|%s|%s%s", - p, mc, la, nu, VNL); + vty_out (vty, " Prefix Options: %s|%s|%s|%s\n", + p, mc, la, nu); memset (&in6, 0, sizeof (in6)); memcpy (&in6, OSPF6_PREFIX_BODY (prefix), OSPF6_PREFIX_SPACE (prefix->prefix_length)); inet_ntop (AF_INET6, &in6, buf, sizeof (buf)); - vty_out (vty, " Prefix: %s/%d%s", - buf, prefix->prefix_length, VNL); + vty_out (vty, " Prefix: %s/%d\n", + buf, prefix->prefix_length); } return 0; @@ -825,14 +825,13 @@ ospf6_intra_prefix_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) prefixnum = ntohs (intra_prefix_lsa->prefix_num); - vty_out (vty, " Number of Prefix: %d%s", prefixnum, VNL); + vty_out (vty, " Number of Prefix: %d\n", prefixnum); inet_ntop (AF_INET, &intra_prefix_lsa->ref_id, id, sizeof (id)); inet_ntop (AF_INET, &intra_prefix_lsa->ref_adv_router, adv_router, sizeof (adv_router)); - vty_out (vty, " Reference: %s Id: %s Adv: %s%s", - ospf6_lstype_name (intra_prefix_lsa->ref_type), id, adv_router, - VNL); + vty_out (vty, " Reference: %s Id: %s Adv: %s\n", + ospf6_lstype_name (intra_prefix_lsa->ref_type), id, adv_router); start = (char *) intra_prefix_lsa + sizeof (struct ospf6_intra_prefix_lsa); end = (char *) lsa->header + ntohs (lsa->header->length); @@ -851,15 +850,15 @@ ospf6_intra_prefix_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) "LA" : "--"); nu = (CHECK_FLAG (prefix->prefix_options, OSPF6_PREFIX_OPTION_NU) ? "NU" : "--"); - vty_out (vty, " Prefix Options: %s|%s|%s|%s%s", - p, mc, la, nu, VNL); + vty_out (vty, " Prefix Options: %s|%s|%s|%s\n", + p, mc, la, nu); memset (&in6, 0, sizeof (in6)); memcpy (&in6, OSPF6_PREFIX_BODY (prefix), OSPF6_PREFIX_SPACE (prefix->prefix_length)); inet_ntop (AF_INET6, &in6, buf, sizeof (buf)); - vty_out (vty, " Prefix: %s/%d%s", - buf, prefix->prefix_length, VNL); + vty_out (vty, " Prefix: %s/%d\n", + buf, prefix->prefix_length); } return 0; @@ -1793,18 +1792,18 @@ config_write_ospf6_debug_brouter (struct vty *vty) { char buf[16]; if (IS_OSPF6_DEBUG_BROUTER) - vty_out (vty, "debug ospf6 border-routers%s", VNL); + vty_out (vty, "debug ospf6 border-routers\n"); if (IS_OSPF6_DEBUG_BROUTER_SPECIFIC_ROUTER) { inet_ntop (AF_INET, &conf_debug_ospf6_brouter_specific_router_id, buf, sizeof (buf)); - vty_out (vty, "debug ospf6 border-routers router-id %s%s", buf, VNL); + vty_out (vty, "debug ospf6 border-routers router-id %s\n", buf); } if (IS_OSPF6_DEBUG_BROUTER_SPECIFIC_AREA) { inet_ntop (AF_INET, &conf_debug_ospf6_brouter_specific_area_id, buf, sizeof (buf)); - vty_out (vty, "debug ospf6 border-routers area-id %s%s", buf, VNL); + vty_out (vty, "debug ospf6 border-routers area-id %s\n", buf); } return 0; } diff --git a/ospf6d/ospf6_lsa.c b/ospf6d/ospf6_lsa.c index 624acb9c6..7817448b7 100644 --- a/ospf6d/ospf6_lsa.c +++ b/ospf6d/ospf6_lsa.c @@ -54,11 +54,11 @@ ospf6_unknown_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) start = (u_char *) lsa->header + sizeof (struct ospf6_lsa_header); end = (u_char *) lsa->header + ntohs (lsa->header->length); - vty_out (vty, " Unknown contents:%s", VNL); + vty_out (vty, " Unknown contents:\n"); for (current = start; current < end; current ++) { if ((current - start) % 16 == 0) - vty_out (vty, "%s ", VNL); + vty_out (vty, "\n "); else if ((current - start) % 4 == 0) vty_out (vty, " "); @@ -66,7 +66,7 @@ ospf6_unknown_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) vty_out (vty, "%s", byte); } - vty_out (vty, "%s%s", VNL, VNL); + vty_out (vty, "\n\n"); return 0; } @@ -381,9 +381,9 @@ ospf6_lsa_header_print (struct ospf6_lsa *lsa) void ospf6_lsa_show_summary_header (struct vty *vty) { - vty_out (vty, "%-4s %-15s%-15s%4s %8s %30s%s", + vty_out (vty, "%-4s %-15s%-15s%4s %8s %30s\n", "Type", "LSId", "AdvRouter", "Age", "SeqNum", - "Payload", VNL); + "Payload"); } void @@ -408,11 +408,11 @@ ospf6_lsa_show_summary (struct vty *vty, struct ospf6_lsa *lsa) (type == OSPF6_LSTYPE_INTER_ROUTER) || (type == OSPF6_LSTYPE_AS_EXTERNAL)) { - vty_out (vty, "%-4s %-15s%-15s%4hu %8lx %30s%s", + vty_out (vty, "%-4s %-15s%-15s%4hu %8lx %30s\n", ospf6_lstype_short_name (lsa->header->type), id, adv_router, ospf6_lsa_age_current (lsa), (u_long) ntohl (lsa->header->seqnum), - handler->get_prefix_str(lsa, buf, sizeof(buf), 0), VNL); + handler->get_prefix_str(lsa, buf, sizeof(buf), 0)); } else if (type != OSPF6_LSTYPE_UNKNOWN) { @@ -423,16 +423,16 @@ ospf6_lsa_show_summary (struct vty *vty, struct ospf6_lsa *lsa) while (handler->get_prefix_str(lsa, buf, sizeof(buf), cnt) != NULL) { - vty_out (vty, "%s %30s%s", tmpbuf, buf, VNL); + vty_out (vty, "%s %30s\n", tmpbuf, buf); cnt++; } } else { - vty_out (vty, "%-4s %-15s%-15s%4hu %8lx%s", + vty_out (vty, "%-4s %-15s%-15s%4hu %8lx\n", ospf6_lstype_short_name (lsa->header->type), id, adv_router, ospf6_lsa_age_current (lsa), - (u_long) ntohl (lsa->header->seqnum), VNL); + (u_long) ntohl (lsa->header->seqnum)); } } @@ -445,13 +445,13 @@ ospf6_lsa_show_dump (struct vty *vty, struct ospf6_lsa *lsa) start = (u_char *) lsa->header; end = (u_char *) lsa->header + ntohs (lsa->header->length); - vty_out (vty, "%s", VNL); - vty_out (vty, "%s:%s", lsa->name, VNL); + vty_out (vty, "\n"); + vty_out (vty, "%s:\n", lsa->name); for (current = start; current < end; current ++) { if ((current - start) % 16 == 0) - vty_out (vty, "%s ", VNL); + vty_out (vty, "\n "); else if ((current - start) % 4 == 0) vty_out (vty, " "); @@ -459,7 +459,7 @@ ospf6_lsa_show_dump (struct vty *vty, struct ospf6_lsa *lsa) vty_out (vty, "%s", byte); } - vty_out (vty, "%s%s", VNL, VNL); + vty_out (vty, "\n\n"); return; } @@ -474,22 +474,22 @@ ospf6_lsa_show_internal (struct vty *vty, struct ospf6_lsa *lsa) inet_ntop (AF_INET, &lsa->header->adv_router, adv_router, sizeof (adv_router)); - vty_out (vty, "%s", VNL); - vty_out (vty, "Age: %4hu Type: %s%s", ospf6_lsa_age_current (lsa), - ospf6_lstype_name (lsa->header->type), VNL); - vty_out (vty, "Link State ID: %s%s", id, VNL); - vty_out (vty, "Advertising Router: %s%s", adv_router, VNL); - vty_out (vty, "LS Sequence Number: %#010lx%s", - (u_long) ntohl (lsa->header->seqnum), VNL); - vty_out (vty, "CheckSum: %#06hx Length: %hu%s", + vty_out (vty, "\n"); + vty_out (vty, "Age: %4hu Type: %s\n", ospf6_lsa_age_current (lsa), + ospf6_lstype_name (lsa->header->type)); + vty_out (vty, "Link State ID: %s\n", id); + vty_out (vty, "Advertising Router: %s\n", adv_router); + vty_out (vty, "LS Sequence Number: %#010lx\n", + (u_long) ntohl (lsa->header->seqnum)); + vty_out (vty, "CheckSum: %#06hx Length: %hu\n", ntohs (lsa->header->checksum), - ntohs (lsa->header->length), VNL); - vty_out (vty, "Flag: %x %s", lsa->flag, VNL); - vty_out (vty, "Lock: %d %s", lsa->lock, VNL); - vty_out (vty, "ReTx Count: %d%s", lsa->retrans_count, VNL); - vty_out (vty, "Threads: Expire: 0x%p, Refresh: 0x%p %s", - (void *)lsa->expire, (void *)lsa->refresh, VNL); - vty_out (vty, "%s", VNL); + ntohs (lsa->header->length)); + vty_out (vty, "Flag: %x \n", lsa->flag); + vty_out (vty, "Lock: %d \n", lsa->lock); + vty_out (vty, "ReTx Count: %d\n", lsa->retrans_count); + vty_out (vty, "Threads: Expire: 0x%p, Refresh: 0x%p \n", + (void *)lsa->expire, (void *)lsa->refresh); + vty_out (vty, "\n"); return; } @@ -511,23 +511,23 @@ ospf6_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) timersub (&now, &lsa->installed, &res); timerstring (&res, duration, sizeof (duration)); - vty_out (vty, "Age: %4hu Type: %s%s", ospf6_lsa_age_current (lsa), - ospf6_lstype_name (lsa->header->type), VNL); - vty_out (vty, "Link State ID: %s%s", id, VNL); - vty_out (vty, "Advertising Router: %s%s", adv_router, VNL); - vty_out (vty, "LS Sequence Number: %#010lx%s", - (u_long) ntohl (lsa->header->seqnum), VNL); - vty_out (vty, "CheckSum: %#06hx Length: %hu%s", + vty_out (vty, "Age: %4hu Type: %s\n", ospf6_lsa_age_current (lsa), + ospf6_lstype_name (lsa->header->type)); + vty_out (vty, "Link State ID: %s\n", id); + vty_out (vty, "Advertising Router: %s\n", adv_router); + vty_out (vty, "LS Sequence Number: %#010lx\n", + (u_long) ntohl (lsa->header->seqnum)); + vty_out (vty, "CheckSum: %#06hx Length: %hu\n", ntohs (lsa->header->checksum), - ntohs (lsa->header->length), VNL); - vty_out (vty, "Duration: %s%s", duration, VNL); + ntohs (lsa->header->length)); + vty_out (vty, "Duration: %s\n", duration); handler = ospf6_get_lsa_handler (lsa->header->type); if (handler->show == NULL) handler = &unknown_handler; (*handler->show) (vty, lsa); - vty_out (vty, "%s", VNL); + vty_out (vty, "\n"); } /* OSPFv3 LSA creation/deletion function */ @@ -937,17 +937,17 @@ config_write_ospf6_debug_lsa (struct vty *vty) if (handler == NULL) continue; if (CHECK_FLAG (handler->debug, OSPF6_LSA_DEBUG)) - vty_out (vty, "debug ospf6 lsa %s%s", - ospf6_lsa_handler_name (handler), VNL); + vty_out (vty, "debug ospf6 lsa %s\n", + ospf6_lsa_handler_name (handler)); if (CHECK_FLAG (handler->debug, OSPF6_LSA_DEBUG_ORIGINATE)) - vty_out (vty, "debug ospf6 lsa %s originate%s", - ospf6_lsa_handler_name (handler), VNL); + vty_out (vty, "debug ospf6 lsa %s originate\n", + ospf6_lsa_handler_name (handler)); if (CHECK_FLAG (handler->debug, OSPF6_LSA_DEBUG_EXAMIN)) - vty_out (vty, "debug ospf6 lsa %s examine%s", - ospf6_lsa_handler_name (handler), VNL); + vty_out (vty, "debug ospf6 lsa %s examine\n", + ospf6_lsa_handler_name (handler)); if (CHECK_FLAG (handler->debug, OSPF6_LSA_DEBUG_FLOOD)) - vty_out (vty, "debug ospf6 lsa %s flooding%s", - ospf6_lsa_handler_name (handler), VNL); + vty_out (vty, "debug ospf6 lsa %s flooding\n", + ospf6_lsa_handler_name (handler)); } return 0; diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c index 9bd337ba1..5924afc38 100644 --- a/ospf6d/ospf6_message.c +++ b/ospf6d/ospf6_message.c @@ -2459,41 +2459,39 @@ config_write_ospf6_debug_message (struct vty *vty) if (s == 0x3f && r == 0x3f) { - vty_out (vty, "debug ospf6 message all%s", VNL); + vty_out (vty, "debug ospf6 message all\n"); return 0; } if (s == 0x3f && r == 0) { - vty_out (vty, "debug ospf6 message all send%s", VNL); + vty_out (vty, "debug ospf6 message all send\n"); return 0; } else if (s == 0 && r == 0x3f) { - vty_out (vty, "debug ospf6 message all recv%s", VNL); + vty_out (vty, "debug ospf6 message all recv\n"); return 0; } /* Unknown message is logged by default */ if (! IS_OSPF6_DEBUG_MESSAGE (OSPF6_MESSAGE_TYPE_UNKNOWN, SEND) && ! IS_OSPF6_DEBUG_MESSAGE (OSPF6_MESSAGE_TYPE_UNKNOWN, RECV)) - vty_out (vty, "no debug ospf6 message unknown%s", VNL); + vty_out (vty, "no debug ospf6 message unknown\n"); else if (! IS_OSPF6_DEBUG_MESSAGE (OSPF6_MESSAGE_TYPE_UNKNOWN, SEND)) - vty_out (vty, "no debug ospf6 message unknown send%s", VNL); + vty_out (vty, "no debug ospf6 message unknown send\n"); else if (! IS_OSPF6_DEBUG_MESSAGE (OSPF6_MESSAGE_TYPE_UNKNOWN, RECV)) - vty_out (vty, "no debug ospf6 message unknown recv%s", VNL); + vty_out (vty, "no debug ospf6 message unknown recv\n"); for (i = 1; i < 6; i++) { if (IS_OSPF6_DEBUG_MESSAGE (i, SEND) && IS_OSPF6_DEBUG_MESSAGE (i, RECV)) - vty_out (vty, "debug ospf6 message %s%s", type_str[i], VNL); + vty_out (vty, "debug ospf6 message %s\n", type_str[i]); else if (IS_OSPF6_DEBUG_MESSAGE (i, SEND)) - vty_out (vty, "debug ospf6 message %s send%s", type_str[i], - VNL); + vty_out (vty, "debug ospf6 message %s send\n", type_str[i]); else if (IS_OSPF6_DEBUG_MESSAGE (i, RECV)) - vty_out (vty, "debug ospf6 message %s recv%s", type_str[i], - VNL); + vty_out (vty, "debug ospf6 message %s recv\n", type_str[i]); } return 0; diff --git a/ospf6d/ospf6_neighbor.c b/ospf6d/ospf6_neighbor.c index c58922b0e..fec992927 100644 --- a/ospf6d/ospf6_neighbor.c +++ b/ospf6d/ospf6_neighbor.c @@ -673,16 +673,16 @@ ospf6_neighbor_show (struct vty *vty, struct ospf6_neighbor *on) timerstring (&res, duration, sizeof (duration)); /* - vty_out (vty, "%-15s %3d %11s %6s/%-12s %11s %s[%s]%s", + vty_out (vty, "%-15s %3d %11s %6s/%-12s %11s %s[%s]\n", "Neighbor ID", "Pri", "DeadTime", "State", "", "Duration", - "I/F", "State", VNL); + "I/F", "State"); */ - vty_out (vty, "%-15s %3d %11s %8s/%-12s %11s %s[%s]%s", + vty_out (vty, "%-15s %3d %11s %8s/%-12s %11s %s[%s]\n", 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); + ospf6_interface_state_str[on->ospf6_if->state]); } static void @@ -694,9 +694,9 @@ ospf6_neighbor_show_drchoice (struct vty *vty, struct ospf6_neighbor *on) struct timeval now, res; /* - vty_out (vty, "%-15s %6s/%-11s %-15s %-15s %s[%s]%s", + vty_out (vty, "%-15s %6s/%-11s %-15s %-15s %s[%s]\n", "RouterID", "State", "Duration", "DR", "BDR", "I/F", - "State", VNL); + "State"); */ inet_ntop (AF_INET, &on->router_id, router_id, sizeof (router_id)); @@ -707,11 +707,10 @@ ospf6_neighbor_show_drchoice (struct vty *vty, struct ospf6_neighbor *on) timersub (&now, &on->last_changed, &res); timerstring (&res, duration, sizeof (duration)); - vty_out (vty, "%-15s %8s/%-11s %-15s %-15s %s[%s]%s", + vty_out (vty, "%-15s %8s/%-11s %-15s %-15s %s[%s]\n", 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); + ospf6_interface_state_str[on->ospf6_if->state]); } static void @@ -731,94 +730,81 @@ ospf6_neighbor_show_detail (struct vty *vty, struct ospf6_neighbor *on) timersub (&now, &on->last_changed, &res); timerstring (&res, duration, sizeof (duration)); - vty_out (vty, " Neighbor %s%s", on->name, - VNL); - vty_out (vty, " Area %s via interface %s (ifindex %d)%s", + vty_out (vty, " Neighbor %s\n", on->name); + vty_out (vty, " Area %s via interface %s (ifindex %d)\n", on->ospf6_if->area->name, on->ospf6_if->interface->name, - on->ospf6_if->interface->ifindex, - VNL); - vty_out (vty, " His IfIndex: %d Link-local address: %s%s", - on->ifindex, linklocal_addr, - VNL); - vty_out (vty, " State %s for a duration of %s%s", - ospf6_neighbor_state_str[on->state], duration, - VNL); - vty_out (vty, " His choice of DR/BDR %s/%s, Priority %d%s", - drouter, bdrouter, on->priority, - VNL); - vty_out (vty, " DbDesc status: %s%s%s SeqNum: %#lx%s", + on->ospf6_if->interface->ifindex); + vty_out (vty, " His IfIndex: %d Link-local address: %s\n", + on->ifindex, linklocal_addr); + vty_out (vty, " State %s for a duration of %s\n", + ospf6_neighbor_state_str[on->state], duration); + vty_out (vty, " His choice of DR/BDR %s/%s, Priority %d\n", + drouter, bdrouter, on->priority); + vty_out (vty, " DbDesc status: %s%s%s SeqNum: %#lx\n", (CHECK_FLAG (on->dbdesc_bits, OSPF6_DBDESC_IBIT) ? "Initial " : ""), (CHECK_FLAG (on->dbdesc_bits, OSPF6_DBDESC_MBIT) ? "More " : ""), (CHECK_FLAG (on->dbdesc_bits, OSPF6_DBDESC_MSBIT) ? - "Master" : "Slave"), (u_long) ntohl (on->dbdesc_seqnum), - VNL); + "Master" : "Slave"), (u_long) ntohl (on->dbdesc_seqnum)); - vty_out (vty, " Summary-List: %d LSAs%s", on->summary_list->count, - VNL); + vty_out (vty, " Summary-List: %d LSAs\n", on->summary_list->count); for (lsa = ospf6_lsdb_head (on->summary_list); lsa; lsa = ospf6_lsdb_next (lsa)) - vty_out (vty, " %s%s", lsa->name, VNL); + vty_out (vty, " %s\n", lsa->name); - vty_out (vty, " Request-List: %d LSAs%s", on->request_list->count, - VNL); + vty_out (vty, " Request-List: %d LSAs\n", on->request_list->count); for (lsa = ospf6_lsdb_head (on->request_list); lsa; lsa = ospf6_lsdb_next (lsa)) - vty_out (vty, " %s%s", lsa->name, VNL); + vty_out (vty, " %s\n", lsa->name); - vty_out (vty, " Retrans-List: %d LSAs%s", on->retrans_list->count, - VNL); + vty_out (vty, " Retrans-List: %d LSAs\n", on->retrans_list->count); for (lsa = ospf6_lsdb_head (on->retrans_list); lsa; lsa = ospf6_lsdb_next (lsa)) - vty_out (vty, " %s%s", lsa->name, VNL); + vty_out (vty, " %s\n", lsa->name); timerclear (&res); if (on->thread_send_dbdesc) timersub (&on->thread_send_dbdesc->u.sands, &now, &res); timerstring (&res, duration, sizeof (duration)); - vty_out (vty, " %d Pending LSAs for DbDesc in Time %s [thread %s]%s", + vty_out (vty, " %d Pending LSAs for DbDesc in Time %s [thread %s]\n", on->dbdesc_list->count, duration, - (on->thread_send_dbdesc ? "on" : "off"), - VNL); + (on->thread_send_dbdesc ? "on" : "off")); for (lsa = ospf6_lsdb_head (on->dbdesc_list); lsa; lsa = ospf6_lsdb_next (lsa)) - vty_out (vty, " %s%s", lsa->name, VNL); + vty_out (vty, " %s\n", lsa->name); timerclear (&res); if (on->thread_send_lsreq) timersub (&on->thread_send_lsreq->u.sands, &now, &res); timerstring (&res, duration, sizeof (duration)); - vty_out (vty, " %d Pending LSAs for LSReq in Time %s [thread %s]%s", + vty_out (vty, " %d Pending LSAs for LSReq in Time %s [thread %s]\n", on->request_list->count, duration, - (on->thread_send_lsreq ? "on" : "off"), - VNL); + (on->thread_send_lsreq ? "on" : "off")); for (lsa = ospf6_lsdb_head (on->request_list); lsa; lsa = ospf6_lsdb_next (lsa)) - vty_out (vty, " %s%s", lsa->name, VNL); + vty_out (vty, " %s\n", lsa->name); timerclear (&res); if (on->thread_send_lsupdate) timersub (&on->thread_send_lsupdate->u.sands, &now, &res); timerstring (&res, duration, sizeof (duration)); - vty_out (vty, " %d Pending LSAs for LSUpdate in Time %s [thread %s]%s", + vty_out (vty, " %d Pending LSAs for LSUpdate in Time %s [thread %s]\n", on->lsupdate_list->count, duration, - (on->thread_send_lsupdate ? "on" : "off"), - VNL); + (on->thread_send_lsupdate ? "on" : "off")); for (lsa = ospf6_lsdb_head (on->lsupdate_list); lsa; lsa = ospf6_lsdb_next (lsa)) - vty_out (vty, " %s%s", lsa->name, VNL); + vty_out (vty, " %s\n", lsa->name); timerclear (&res); if (on->thread_send_lsack) timersub (&on->thread_send_lsack->u.sands, &now, &res); timerstring (&res, duration, sizeof (duration)); - vty_out (vty, " %d Pending LSAs for LSAck in Time %s [thread %s]%s", + vty_out (vty, " %d Pending LSAs for LSAck in Time %s [thread %s]\n", on->lsack_list->count, duration, - (on->thread_send_lsack ? "on" : "off"), - VNL); + (on->thread_send_lsack ? "on" : "off")); for (lsa = ospf6_lsdb_head (on->lsack_list); lsa; lsa = ospf6_lsdb_next (lsa)) - vty_out (vty, " %s%s", lsa->name, VNL); + vty_out (vty, " %s\n", lsa->name); ospf6_bfd_show_info(vty, on->bfd_info, 0); } @@ -852,13 +838,13 @@ DEFUN (show_ipv6_ospf6_neighbor, } if (showfunc == ospf6_neighbor_show) - vty_out (vty, "%-15s %3s %11s %8s/%-12s %11s %s[%s]%s", + vty_out (vty, "%-15s %3s %11s %8s/%-12s %11s %s[%s]\n", "Neighbor ID", "Pri", "DeadTime", "State", "IfState", "Duration", - "I/F", "State", VNL); + "I/F", "State"); else if (showfunc == ospf6_neighbor_show_drchoice) - vty_out (vty, "%-15s %8s/%-11s %-15s %-15s %s[%s]%s", + vty_out (vty, "%-15s %8s/%-11s %-15s %-15s %s[%s]\n", "RouterID", "State", "Duration", "DR", "BDR", "I/F", - "State", VNL); + "State"); for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, i, oa)) for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) @@ -892,8 +878,7 @@ DEFUN (show_ipv6_ospf6_neighbor_one, if ((inet_pton (AF_INET, argv[idx_ipv4]->arg, &router_id)) != 1) { - vty_out (vty, "Router-ID is not parsable: %s%s", argv[idx_ipv4]->arg, - VNL); + vty_out (vty, "Router-ID is not parsable: %s\n", argv[idx_ipv4]->arg); return CMD_SUCCESS; } @@ -1016,11 +1001,11 @@ config_write_ospf6_debug_neighbor (struct vty *vty) { if (IS_OSPF6_DEBUG_NEIGHBOR (STATE) && IS_OSPF6_DEBUG_NEIGHBOR (EVENT)) - vty_out (vty, "debug ospf6 neighbor%s", VNL); + vty_out (vty, "debug ospf6 neighbor\n"); else if (IS_OSPF6_DEBUG_NEIGHBOR (STATE)) - vty_out (vty, "debug ospf6 neighbor state%s", VNL); + vty_out (vty, "debug ospf6 neighbor state\n"); else if (IS_OSPF6_DEBUG_NEIGHBOR (EVENT)) - vty_out (vty, "debug ospf6 neighbor event%s", VNL); + vty_out (vty, "debug ospf6 neighbor event\n"); return 0; } diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c index a6bb099dd..7b01c69a8 100644 --- a/ospf6d/ospf6_route.c +++ b/ospf6d/ospf6_route.c @@ -1043,16 +1043,16 @@ ospf6_route_show (struct vty *vty, struct ospf6_route *route) if (!i) { - vty_out (vty, "%c%1s %2s %-30s %-25s %6.*s %s%s", + vty_out (vty, "%c%1s %2s %-30s %-25s %6.*s %s\n", (ospf6_route_is_best (route) ? '*' : ' '), OSPF6_DEST_TYPE_SUBSTR (route->type), OSPF6_PATH_TYPE_SUBSTR (route->path.type), - destination, nexthop, IFNAMSIZ, ifname, duration, VNL); + destination, nexthop, IFNAMSIZ, ifname, duration); i++; } else - vty_out (vty, "%c%1s %2s %-30s %-25s %6.*s %s%s", - ' ', "", "", "", nexthop, IFNAMSIZ, ifname, "", VNL); + vty_out (vty, "%c%1s %2s %-30s %-25s %6.*s %s\n", + ' ', "", "", "", nexthop, IFNAMSIZ, ifname, ""); } } @@ -1078,77 +1078,74 @@ ospf6_route_show_detail (struct vty *vty, struct ospf6_route *route) destination, sizeof (destination)); else prefix2str (&route->prefix, destination, sizeof (destination)); - vty_out (vty, "Destination: %s%s", destination, VNL); + vty_out (vty, "Destination: %s\n", destination); /* destination type */ - vty_out (vty, "Destination type: %s%s", - OSPF6_DEST_TYPE_NAME (route->type), - VNL); + vty_out (vty, "Destination type: %s\n", + OSPF6_DEST_TYPE_NAME (route->type)); /* Time */ timersub (&now, &route->installed, &res); timerstring (&res, duration, sizeof (duration)); - vty_out (vty, "Installed Time: %s ago%s", duration, VNL); + vty_out (vty, "Installed Time: %s ago\n", duration); timersub (&now, &route->changed, &res); timerstring (&res, duration, sizeof (duration)); - vty_out (vty, " Changed Time: %s ago%s", duration, VNL); + vty_out (vty, " Changed Time: %s ago\n", duration); /* Debugging info */ - vty_out (vty, "Lock: %d Flags: %s%s%s%s%s", route->lock, + vty_out (vty, "Lock: %d Flags: %s%s%s%s\n", route->lock, (CHECK_FLAG (route->flag, OSPF6_ROUTE_BEST) ? "B" : "-"), (CHECK_FLAG (route->flag, OSPF6_ROUTE_ADD) ? "A" : "-"), (CHECK_FLAG (route->flag, OSPF6_ROUTE_REMOVE) ? "R" : "-"), - (CHECK_FLAG (route->flag, OSPF6_ROUTE_CHANGE) ? "C" : "-"), - VNL); - vty_out (vty, "Memory: prev: %p this: %p next: %p%s", - (void *)route->prev, (void *)route, (void *)route->next, VNL); + (CHECK_FLAG (route->flag, OSPF6_ROUTE_CHANGE) ? "C" : "-")); + vty_out (vty, "Memory: prev: %p this: %p next: %p\n", + (void *)route->prev, (void *)route, (void *)route->next); /* Path section */ /* Area-ID */ inet_ntop (AF_INET, &route->path.area_id, area_id, sizeof (area_id)); - vty_out (vty, "Associated Area: %s%s", area_id, VNL); + vty_out (vty, "Associated Area: %s\n", area_id); /* Path type */ - vty_out (vty, "Path Type: %s%s", - OSPF6_PATH_TYPE_NAME (route->path.type), VNL); + vty_out (vty, "Path Type: %s\n", + OSPF6_PATH_TYPE_NAME (route->path.type)); /* LS Origin */ inet_ntop (AF_INET, &route->path.origin.id, id, sizeof (id)); inet_ntop (AF_INET, &route->path.origin.adv_router, adv_router, sizeof (adv_router)); - vty_out (vty, "LS Origin: %s Id: %s Adv: %s%s", + vty_out (vty, "LS Origin: %s Id: %s Adv: %s\n", ospf6_lstype_name (route->path.origin.type), - id, adv_router, VNL); + id, adv_router); /* Options */ ospf6_options_printbuf (route->path.options, options, sizeof (options)); - vty_out (vty, "Options: %s%s", options, VNL); + vty_out (vty, "Options: %s\n", options); /* Router Bits */ ospf6_capability_printbuf (route->path.router_bits, capa, sizeof (capa)); - vty_out (vty, "Router Bits: %s%s", capa, VNL); + vty_out (vty, "Router Bits: %s\n", capa); /* Prefix Options */ - vty_out (vty, "Prefix Options: xxx%s", VNL); + vty_out (vty, "Prefix Options: xxx\n"); /* Metrics */ - vty_out (vty, "Metric Type: %d%s", route->path.metric_type, - VNL); - vty_out (vty, "Metric: %d (%d)%s", - route->path.cost, route->path.u.cost_e2, VNL); + vty_out (vty, "Metric Type: %d\n", route->path.metric_type); + vty_out (vty, "Metric: %d (%d)\n", + route->path.cost, route->path.u.cost_e2); /* Nexthops */ - vty_out (vty, "Nexthop:%s", VNL); + vty_out (vty, "Nexthop:\n"); for (ALL_LIST_ELEMENTS_RO (route->nh_list, node, nh)) { /* nexthop */ inet_ntop (AF_INET6, &nh->address, nexthop, sizeof (nexthop)); ifname = ifindex2ifname (nh->ifindex, VRF_DEFAULT); - vty_out (vty, " %s %.*s%s", nexthop, IFNAMSIZ, ifname, VNL); + vty_out (vty, " %s %.*s\n", nexthop, IFNAMSIZ, ifname); } - vty_out (vty, "%s", VNL); + vty_out (vty, "\n"); } static void @@ -1184,14 +1181,14 @@ ospf6_route_show_table_summary (struct vty *vty, assert (number == table->count); - vty_out (vty, "Number of OSPFv3 routes: %d%s", number, VNL); - vty_out (vty, "Number of Destination: %d%s", destination, VNL); - vty_out (vty, "Number of Alternative routes: %d%s", alternative, VNL); - vty_out (vty, "Number of Equal Cost Multi Path: %d%s", ecmp, VNL); + vty_out (vty, "Number of OSPFv3 routes: %d\n", number); + vty_out (vty, "Number of Destination: %d\n", destination); + vty_out (vty, "Number of Alternative routes: %d\n", alternative); + vty_out (vty, "Number of Equal Cost Multi Path: %d\n", ecmp); for (i = OSPF6_PATH_TYPE_INTRA; i <= OSPF6_PATH_TYPE_EXTERNAL2; i++) { - vty_out (vty, "Number of %s routes: %d%s", - OSPF6_PATH_TYPE_NAME (i), pathtype[i], VNL); + vty_out (vty, "Number of %s routes: %d\n", + OSPF6_PATH_TYPE_NAME (i), pathtype[i]); } } @@ -1364,7 +1361,7 @@ ospf6_route_table_show (struct vty *vty, int argc_start, int argc, struct cmd_to continue; } - vty_out (vty, "Malformed argument: %s%s", argv[i]->arg, VNL); + vty_out (vty, "Malformed argument: %s\n", argv[i]->arg); return CMD_SUCCESS; } @@ -1400,8 +1397,8 @@ ospf6_route_table_show (struct vty *vty, int argc_start, int argc, struct cmd_to static void ospf6_linkstate_show_header (struct vty *vty) { - vty_out (vty, "%-7s %-15s %-15s %-8s %-14s %s%s", - "Type", "Router-ID", "Net-ID", "Rtr-Bits", "Options", "Cost", VNL); + vty_out (vty, "%-7s %-15s %-15s %-8s %-14s %s\n", + "Type", "Router-ID", "Net-ID", "Rtr-Bits", "Options", "Cost"); } static void @@ -1419,13 +1416,13 @@ ospf6_linkstate_show (struct vty *vty, struct ospf6_route *route) ospf6_options_printbuf (route->path.options, options, sizeof (options)); if (ntohl (id)) - vty_out (vty, "%-7s %-15s %-15s %-8s %-14s %lu%s", + vty_out (vty, "%-7s %-15s %-15s %-8s %-14s %lu\n", "Network", routername, idname, rbits, options, - (unsigned long) route->path.cost, VNL); + (unsigned long) route->path.cost); else - vty_out (vty, "%-7s %-15s %-15s %-8s %-14s %lu%s", + vty_out (vty, "%-7s %-15s %-15s %-8s %-14s %lu\n", "Router", routername, idname, rbits, options, - (unsigned long) route->path.cost, VNL); + (unsigned long) route->path.cost); } @@ -1502,7 +1499,7 @@ ospf6_linkstate_table_show (struct vty *vty, int idx_ipv4, int argc, is_router++; continue; } - vty_out (vty, "Malformed argument: %s%s", argv[i]->arg, VNL); + vty_out (vty, "Malformed argument: %s\n", argv[i]->arg); return CMD_SUCCESS; } @@ -1514,11 +1511,11 @@ ospf6_linkstate_table_show (struct vty *vty, int idx_ipv4, int argc, is_id++; continue; } - vty_out (vty, "Malformed argument: %s%s", argv[i]->arg, VNL); + vty_out (vty, "Malformed argument: %s\n", argv[i]->arg); return CMD_SUCCESS; } - vty_out (vty, "Malformed argument: %s%s", argv[i]->arg, VNL); + vty_out (vty, "Malformed argument: %s\n", argv[i]->arg); return CMD_SUCCESS; } @@ -1538,8 +1535,8 @@ ospf6_linkstate_table_show (struct vty *vty, int idx_ipv4, int argc, void ospf6_brouter_show_header (struct vty *vty) { - vty_out (vty, "%-15s %-8s %-14s %-10s %-15s%s", - "Router-ID", "Rtr-Bits", "Options", "Path-Type", "Area", VNL); + vty_out (vty, "%-15s %-8s %-14s %-10s %-15s\n", + "Router-ID", "Rtr-Bits", "Options", "Path-Type", "Area"); } void @@ -1554,11 +1551,11 @@ ospf6_brouter_show (struct vty *vty, struct ospf6_route *route) ospf6_options_printbuf (route->path.options, options, sizeof (options)); inet_ntop (AF_INET, &route->path.area_id, area, sizeof (area)); - /* vty_out (vty, "%-15s %-8s %-14s %-10s %-15s%s", - "Router-ID", "Rtr-Bits", "Options", "Path-Type", "Area", VNL); */ - vty_out (vty, "%-15s %-8s %-14s %-10s %-15s%s", + /* vty_out (vty, "%-15s %-8s %-14s %-10s %-15s\n", + "Router-ID", "Rtr-Bits", "Options", "Path-Type", "Area"); */ + vty_out (vty, "%-15s %-8s %-14s %-10s %-15s\n", adv, rbits, options, OSPF6_PATH_TYPE_NAME (route->path.type), - area, VNL); + area); } DEFUN (debug_ospf6_route, @@ -1619,11 +1616,11 @@ int config_write_ospf6_debug_route (struct vty *vty) { if (IS_OSPF6_DEBUG_ROUTE (TABLE)) - vty_out (vty, "debug ospf6 route table%s", VNL); + vty_out (vty, "debug ospf6 route table\n"); if (IS_OSPF6_DEBUG_ROUTE (INTRA)) - vty_out (vty, "debug ospf6 route intra-area%s", VNL); + vty_out (vty, "debug ospf6 route intra-area\n"); if (IS_OSPF6_DEBUG_ROUTE (INTER)) - vty_out (vty, "debug ospf6 route inter-area%s", VNL); + vty_out (vty, "debug ospf6 route inter-area\n"); return 0; } diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c index 0b8a5e476..a1a5fbd70 100644 --- a/ospf6d/ospf6_spf.c +++ b/ospf6d/ospf6_spf.c @@ -742,13 +742,13 @@ ospf6_spf_display_subtree (struct vty *vty, const char *prefix, int rest, int restnum; /* "prefix" is the space prefix of the display line */ - vty_out (vty, "%s+-%s [%d]%s", prefix, v->name, v->cost, VNL); + vty_out (vty, "%s+-%s [%d]\n", prefix, v->name, v->cost); len = strlen (prefix) + 4; next_prefix = (char *) malloc (len); if (next_prefix == NULL) { - vty_out (vty, "malloc failed%s", VNL); + vty_out (vty, "malloc failed\n"); return; } snprintf (next_prefix, len, "%s%s", prefix, (rest ? "| " : " ")); @@ -914,11 +914,11 @@ int config_write_ospf6_debug_spf (struct vty *vty) { if (IS_OSPF6_DEBUG_SPF (PROCESS)) - vty_out (vty, "debug ospf6 spf process%s", VNL); + vty_out (vty, "debug ospf6 spf process\n"); if (IS_OSPF6_DEBUG_SPF (TIME)) - vty_out (vty, "debug ospf6 spf time%s", VNL); + vty_out (vty, "debug ospf6 spf time\n"); if (IS_OSPF6_DEBUG_SPF (DATABASE)) - vty_out (vty, "debug ospf6 spf database%s", VNL); + vty_out (vty, "debug ospf6 spf database\n"); return 0; } @@ -929,7 +929,7 @@ ospf6_spf_config_write (struct vty *vty) if (ospf6->spf_delay != OSPF_SPF_DELAY_DEFAULT || ospf6->spf_holdtime != OSPF_SPF_HOLDTIME_DEFAULT || ospf6->spf_max_holdtime != OSPF_SPF_MAX_HOLDTIME_DEFAULT) - vty_outln (vty, " timers throttle spf %d %d %d", + vty_out (vty, " timers throttle spf %d %d %d\n", ospf6->spf_delay, ospf6->spf_holdtime, ospf6->spf_max_holdtime); diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c index 268b7a60a..9e0b86b7b 100644 --- a/ospf6d/ospf6_top.c +++ b/ospf6d/ospf6_top.c @@ -315,7 +315,7 @@ DEFUN (no_router_ospf6, OSPF6_STR) { if (ospf6 == NULL) - vty_out (vty, "OSPFv3 is not configured%s", VNL); + vty_out (vty, "OSPFv3 is not configured\n"); else { ospf6_delete (ospf6); @@ -343,7 +343,7 @@ DEFUN (ospf6_router_id, ret = inet_pton (AF_INET, argv[idx_ipv4]->arg, &router_id); if (ret == 0) { - vty_out (vty, "malformed OSPF Router-ID: %s%s", argv[idx_ipv4]->arg, VNL); + vty_out (vty, "malformed OSPF Router-ID: %s\n", argv[idx_ipv4]->arg); return CMD_SUCCESS; } @@ -588,15 +588,15 @@ DEFUN (ospf6_interface_area, oi = ospf6_interface_create (ifp); if (oi->area) { - vty_out (vty, "%s already attached to Area %s%s", - oi->interface->name, oi->area->name, VNL); + vty_out (vty, "%s already attached to Area %s\n", + oi->interface->name, oi->area->name); return CMD_SUCCESS; } /* parse Area-ID */ if (inet_pton (AF_INET, argv[idx_ipv4]->arg, &area_id) != 1) { - vty_out (vty, "Invalid Area-ID: %s%s", argv[idx_ipv4]->arg, VNL); + vty_out (vty, "Invalid Area-ID: %s\n", argv[idx_ipv4]->arg); return CMD_SUCCESS; } @@ -645,35 +645,35 @@ DEFUN (no_ospf6_interface_area, ifp = if_lookup_by_name (argv[idx_ifname]->arg, VRF_DEFAULT); if (ifp == NULL) { - vty_out (vty, "No such interface %s%s", argv[idx_ifname]->arg, VNL); + vty_out (vty, "No such interface %s\n", argv[idx_ifname]->arg); return CMD_SUCCESS; } oi = (struct ospf6_interface *) ifp->info; if (oi == NULL) { - vty_out (vty, "Interface %s not enabled%s", ifp->name, VNL); + vty_out (vty, "Interface %s not enabled\n", ifp->name); return CMD_SUCCESS; } /* parse Area-ID */ if (inet_pton (AF_INET, argv[idx_ipv4]->arg, &area_id) != 1) { - vty_out (vty, "Invalid Area-ID: %s%s", argv[idx_ipv4]->arg, VNL); + vty_out (vty, "Invalid Area-ID: %s\n", argv[idx_ipv4]->arg); return CMD_SUCCESS; } /* Verify Area */ if (oi->area == NULL) { - vty_out (vty, "No such Area-ID: %s%s", argv[idx_ipv4]->arg, VNL); + vty_out (vty, "No such Area-ID: %s\n", argv[idx_ipv4]->arg); return CMD_SUCCESS; } if (oi->area->area_id != area_id) { - vty_out (vty, "Wrong Area-ID: %s is attached to area %s%s", - oi->interface->name, oi->area->name, VNL); + vty_out (vty, "Wrong Area-ID: %s is attached to area %s\n", + oi->interface->name, oi->area->name); return CMD_SUCCESS; } @@ -799,29 +799,29 @@ ospf6_show (struct vty *vty, struct ospf6 *o) /* process id, router id */ inet_ntop (AF_INET, &o->router_id, router_id, sizeof (router_id)); - vty_out (vty, " OSPFv3 Routing Process (0) with Router-ID %s%s", - router_id, VNL); + vty_out (vty, " OSPFv3 Routing Process (0) with Router-ID %s\n", + router_id); /* running time */ monotime(&now); timersub (&now, &o->starttime, &running); timerstring (&running, duration, sizeof (duration)); - vty_out (vty, " Running %s%s", duration, VNL); + vty_out (vty, " Running %s\n", duration); /* Redistribute configuration */ /* XXX */ - vty_outln (vty, " LSA minimum arrival %d msecs",o->lsa_minarrival); + vty_out (vty, " LSA minimum arrival %d msecs\n",o->lsa_minarrival); /* Show SPF parameters */ - vty_out(vty, " Initial SPF scheduling delay %d millisec(s)%s" - " Minimum hold time between consecutive SPFs %d millsecond(s)%s" - " Maximum hold time between consecutive SPFs %d millsecond(s)%s" - " Hold time multiplier is currently %d%s", - o->spf_delay, VNL, - o->spf_holdtime, VNL, - o->spf_max_holdtime, VNL, - o->spf_hold_multiplier, VNL); + vty_out(vty, " Initial SPF scheduling delay %d millisec(s)\n" + " Minimum hold time between consecutive SPFs %d millsecond(s)\n" + " Maximum hold time between consecutive SPFs %d millsecond(s)\n" + " Hold time multiplier is currently %d\n", + o->spf_delay, + o->spf_holdtime, + o->spf_max_holdtime, + o->spf_hold_multiplier); vty_out(vty, " SPF algorithm "); if (o->ts_spf.tv_sec || o->ts_spf.tv_usec) @@ -829,37 +829,37 @@ ospf6_show (struct vty *vty, struct ospf6 *o) timersub(&now, &o->ts_spf, &result); timerstring(&result, buf, sizeof(buf)); ospf6_spf_reason_string(o->last_spf_reason, rbuf, sizeof(rbuf)); - vty_out(vty, "last executed %s ago, reason %s%s", buf, rbuf, VNL); - vty_out (vty, " Last SPF duration %lld sec %lld usec%s", + vty_out(vty, "last executed %s ago, reason %s\n", buf, rbuf); + vty_out (vty, " Last SPF duration %lld sec %lld usec\n", (long long)o->ts_spf_duration.tv_sec, - (long long)o->ts_spf_duration.tv_usec, VNL); + (long long)o->ts_spf_duration.tv_usec); } else - vty_out(vty, "has not been run$%s", VNL); + vty_out(vty, "has not been run$\n"); threadtimer_string(now, o->t_spf_calc, buf, sizeof(buf)); - vty_out (vty, " SPF timer %s%s%s", - (o->t_spf_calc ? "due in " : "is "), buf, VNL); + vty_out (vty, " SPF timer %s%s\n", + (o->t_spf_calc ? "due in " : "is "), buf); if (CHECK_FLAG (o->flag, OSPF6_STUB_ROUTER)) - vty_out (vty, " Router Is Stub Router%s", VNL); + vty_out (vty, " Router Is Stub Router\n"); /* LSAs */ - vty_out (vty, " Number of AS scoped LSAs is %u%s", - o->lsdb->count, VNL); + vty_out (vty, " Number of AS scoped LSAs is %u\n", + o->lsdb->count); /* Areas */ - vty_out (vty, " Number of areas in this router is %u%s", - listcount (o->area_list), VNL); + vty_out (vty, " Number of areas in this router is %u\n", + listcount (o->area_list)); if (CHECK_FLAG(o->config_flags, OSPF6_LOG_ADJACENCY_CHANGES)) { if (CHECK_FLAG(o->config_flags, OSPF6_LOG_ADJACENCY_DETAIL)) - vty_outln (vty, " All adjacency changes are logged"); + vty_out (vty, " All adjacency changes are logged\n"); else - vty_outln (vty, " Adjacency changes are logged"); + vty_out (vty, " Adjacency changes are logged\n"); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); for (ALL_LIST_ELEMENTS_RO (o->area_list, n, oa)) ospf6_area_show (vty, oa); @@ -963,7 +963,7 @@ ospf6_stub_router_config_write (struct vty *vty) { if (CHECK_FLAG (ospf6->flag, OSPF6_STUB_ROUTER)) { - vty_out (vty, " stub-router administrative%s", VNL); + vty_out (vty, " stub-router administrative\n"); } return; } @@ -975,7 +975,7 @@ ospf6_distance_config_write (struct vty *vty) struct ospf6_distance *odistance; if (ospf6->distance_all) - vty_outln (vty, " distance %u", ospf6->distance_all); + vty_out (vty, " distance %u\n", ospf6->distance_all); if (ospf6->distance_intra || ospf6->distance_inter @@ -990,7 +990,7 @@ ospf6_distance_config_write (struct vty *vty) if (ospf6->distance_external) vty_out (vty, " external %u", ospf6->distance_external); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } for (rn = route_top (ospf6->distance_table); rn; rn = route_next (rn)) @@ -998,7 +998,7 @@ ospf6_distance_config_write (struct vty *vty) { char buf[PREFIX_STRLEN]; - vty_outln (vty, " distance %u %s %s", odistance->distance, + vty_out (vty, " distance %u %s %s\n", odistance->distance, prefix2str (&rn->p, buf, sizeof (buf)), odistance->access_list ? odistance->access_list : ""); } @@ -1019,30 +1019,29 @@ config_write_ospf6 (struct vty *vty) return CMD_SUCCESS; inet_ntop (AF_INET, &ospf6->router_id_static, router_id, sizeof (router_id)); - vty_out (vty, "router ospf6%s", VNL); + vty_out (vty, "router ospf6\n"); if (ospf6->router_id_static != 0) - vty_out (vty, " router-id %s%s", router_id, VNL); + vty_out (vty, " router-id %s\n", router_id); /* log-adjacency-changes flag print. */ if (CHECK_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_CHANGES)) { if (CHECK_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_DETAIL)) - vty_outln (vty, " log-adjacency-changes detail"); + vty_out (vty, " log-adjacency-changes detail\n"); else if (!DFLT_OSPF6_LOG_ADJACENCY_CHANGES) - vty_outln (vty, " log-adjacency-changes"); + vty_out (vty, " log-adjacency-changes\n"); } else if (DFLT_OSPF6_LOG_ADJACENCY_CHANGES) { - vty_outln (vty, " no log-adjacency-changes"); + vty_out (vty, " no log-adjacency-changes\n"); } if (ospf6->ref_bandwidth != OSPF6_REFERENCE_BANDWIDTH) - vty_out (vty, " auto-cost reference-bandwidth %d%s", ospf6->ref_bandwidth, - VNL); + vty_out (vty, " auto-cost reference-bandwidth %d\n", ospf6->ref_bandwidth); /* LSA timers print. */ if (ospf6->lsa_minarrival != OSPF_MIN_LS_ARRIVAL) - vty_outln (vty, " timers lsa min-arrival %d",ospf6->lsa_minarrival); + vty_out (vty, " timers lsa min-arrival %d\n",ospf6->lsa_minarrival); ospf6_stub_router_config_write (vty); ospf6_redistribute_config_write (vty); @@ -1053,10 +1052,10 @@ config_write_ospf6 (struct vty *vty) for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, j, oa)) { for (ALL_LIST_ELEMENTS_RO (oa->if_list, k, oi)) - vty_out (vty, " interface %s area %s%s", - oi->interface->name, oa->name, VNL); + vty_out (vty, " interface %s area %s\n", + oi->interface->name, oa->name); } - vty_out (vty, "!%s", VNL); + vty_out (vty, "!\n"); return 0; } diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c index a30bef87b..ddd2f3f1b 100644 --- a/ospf6d/ospf6_zebra.c +++ b/ospf6d/ospf6_zebra.c @@ -315,23 +315,22 @@ DEFUN (show_zebra, int i; if (zclient == NULL) { - vty_out (vty, "Not connected to zebra%s", VNL); + vty_out (vty, "Not connected to zebra\n"); return CMD_SUCCESS; } - vty_out (vty, "Zebra Infomation%s", VNL); - vty_out (vty, " enable: %d fail: %d%s", - zclient->enable, zclient->fail, VNL); - vty_out (vty, " redistribute default: %d%s", - vrf_bitmap_check (zclient->default_information, VRF_DEFAULT), - VNL); + vty_out (vty, "Zebra Infomation\n"); + vty_out (vty, " enable: %d fail: %d\n", + zclient->enable, zclient->fail); + vty_out (vty, " redistribute default: %d\n", + vrf_bitmap_check (zclient->default_information, VRF_DEFAULT)); vty_out (vty, " redistribute:"); for (i = 0; i < ZEBRA_ROUTE_MAX; i++) { if (vrf_bitmap_check (zclient->redist[AFI_IP6][i], VRF_DEFAULT)) vty_out (vty, " %s", zebra_route_string(i)); } - vty_out (vty, "%s", VNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -341,15 +340,15 @@ config_write_ospf6_zebra (struct vty *vty) { if (! zclient->enable) { - vty_out (vty, "no router zebra%s", VNL); - vty_out (vty, "!%s", VNL); + vty_out (vty, "no router zebra\n"); + vty_out (vty, "!\n"); } else if (! vrf_bitmap_check (zclient->redist[AFI_IP6][ZEBRA_ROUTE_OSPF6], VRF_DEFAULT)) { - vty_out (vty, "router zebra%s", VNL); - vty_out (vty, " no redistribute ospf6%s", VNL); - vty_out (vty, "!%s", VNL); + vty_out (vty, "router zebra\n"); + vty_out (vty, " no redistribute ospf6\n"); + vty_out (vty, "!\n"); } return 0; } @@ -683,7 +682,7 @@ ospf6_distance_set (struct vty *vty, struct ospf6 *o, ret = str2prefix_ipv6 (ip_str, &p); if (ret == 0) { - vty_outln (vty, "Malformed prefix"); + vty_out (vty, "Malformed prefix\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -731,14 +730,14 @@ ospf6_distance_unset (struct vty *vty, struct ospf6 *o, ret = str2prefix_ipv6 (ip_str, &p); if (ret == 0) { - vty_outln (vty, "Malformed prefix"); + vty_out (vty, "Malformed prefix\n"); return CMD_WARNING_CONFIG_FAILED; } rn = route_node_lookup (o->distance_table, (struct prefix *) &p); if (!rn) { - vty_outln (vty, "Can't find specified prefix"); + vty_out (vty, "Cant't find specified prefix\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -905,13 +904,13 @@ int config_write_ospf6_debug_zebra (struct vty *vty) { if (IS_OSPF6_DEBUG_ZEBRA (SEND) && IS_OSPF6_DEBUG_ZEBRA (RECV)) - vty_out (vty, "debug ospf6 zebra%s", VNL); + vty_out (vty, "debug ospf6 zebra\n"); else { if (IS_OSPF6_DEBUG_ZEBRA (SEND)) - vty_out (vty, "debug ospf6 zebra send%s", VNL); + vty_out (vty, "debug ospf6 zebra send\n"); if (IS_OSPF6_DEBUG_ZEBRA (RECV)) - vty_out (vty, "debug ospf6 zebra recv%s", VNL); + vty_out (vty, "debug ospf6 zebra recv\n"); } return 0; } diff --git a/ospf6d/ospf6d.c b/ospf6d/ospf6d.c index 1ccf7ce7a..c4a499031 100644 --- a/ospf6d/ospf6d.c +++ b/ospf6d/ospf6d.c @@ -83,8 +83,8 @@ DEFUN (show_version_ospf6, "Display ospf6d version\n" ) { - vty_out (vty, "Zebra OSPF6d Version: %s%s", - ospf6_daemon_version, VNL); + vty_out (vty, "Zebra OSPF6d Version: %s\n", + ospf6_daemon_version); return CMD_SUCCESS; } @@ -110,16 +110,16 @@ config_write_ospf6_debug (struct vty *vty) config_write_ospf6_debug_asbr (vty); config_write_ospf6_debug_abr (vty); config_write_ospf6_debug_flood (vty); - vty_out (vty, "!%s", VNL); + vty_out (vty, "!\n"); return 0; } #define AREA_LSDB_TITLE_FORMAT \ - "%s Area Scoped Link State Database (Area %s)%s%s" + "\n Area Scoped Link State Database (Area %s)\n\n" #define IF_LSDB_TITLE_FORMAT \ - "%s I/F Scoped Link State Database (I/F %s in Area %s)%s%s" + "\n I/F Scoped Link State Database (I/F %s in Area %s)\n\n" #define AS_LSDB_TITLE_FORMAT \ - "%s AS Scoped Link State Database%s%s" + "\n AS Scoped Link State Database\n\n" static int parse_show_level (int idx_level, int argc, struct cmd_token **argv) @@ -189,7 +189,7 @@ DEFUN (show_ipv6_ospf6_database, for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) { - vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); + vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name); ospf6_lsdb_show (vty, level, NULL, NULL, NULL, oa->lsdb); } @@ -197,16 +197,16 @@ DEFUN (show_ipv6_ospf6_database, { for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) { - vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, - oi->interface->name, oa->name, VNL, VNL); + vty_out (vty, IF_LSDB_TITLE_FORMAT, + oi->interface->name, oa->name); ospf6_lsdb_show (vty, level, NULL, NULL, NULL, oi->lsdb); } } - vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, NULL, NULL, NULL, o->lsdb); - vty_out (vty, "%s", VNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -250,7 +250,7 @@ DEFUN (show_ipv6_ospf6_database_type, case OSPF6_SCOPE_AREA: for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) { - vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); + vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name); ospf6_lsdb_show (vty, level, &type, NULL, NULL, oa->lsdb); } break; @@ -260,15 +260,15 @@ DEFUN (show_ipv6_ospf6_database_type, { for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) { - vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, - oi->interface->name, oa->name, VNL, VNL); + vty_out (vty, IF_LSDB_TITLE_FORMAT, + oi->interface->name, oa->name); ospf6_lsdb_show (vty, level, &type, NULL, NULL, oi->lsdb); } } break; case OSPF6_SCOPE_AS: - vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, &type, NULL, NULL, o->lsdb); break; @@ -277,7 +277,7 @@ DEFUN (show_ipv6_ospf6_database_type, break; } - vty_out (vty, "%s", VNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -313,7 +313,7 @@ DEFUN (show_ipv6_ospf6_database_id, for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) { - vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); + vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name); ospf6_lsdb_show (vty, level, NULL, &id, NULL, oa->lsdb); } @@ -321,16 +321,16 @@ DEFUN (show_ipv6_ospf6_database_id, { for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) { - vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, - oi->interface->name, oa->name, VNL, VNL); + vty_out (vty, IF_LSDB_TITLE_FORMAT, + oi->interface->name, oa->name); ospf6_lsdb_show (vty, level, NULL, &id, NULL, oi->lsdb); } } - vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, NULL, &id, NULL, o->lsdb); - vty_out (vty, "%s", VNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -364,7 +364,7 @@ DEFUN (show_ipv6_ospf6_database_router, for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) { - vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); + vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name); ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oa->lsdb); } @@ -372,16 +372,16 @@ DEFUN (show_ipv6_ospf6_database_router, { for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) { - vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, - oi->interface->name, oa->name, VNL, VNL); + vty_out (vty, IF_LSDB_TITLE_FORMAT, + oi->interface->name, oa->name); ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oi->lsdb); } } - vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb); - vty_out (vty, "%s", VNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -430,7 +430,7 @@ DEFUN (show_ipv6_ospf6_database_type_id, case OSPF6_SCOPE_AREA: for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) { - vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); + vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name); ospf6_lsdb_show (vty, level, &type, &id, NULL, oa->lsdb); } break; @@ -440,15 +440,15 @@ DEFUN (show_ipv6_ospf6_database_type_id, { for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) { - vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, - oi->interface->name, oa->name, VNL, VNL); + vty_out (vty, IF_LSDB_TITLE_FORMAT, + oi->interface->name, oa->name); ospf6_lsdb_show (vty, level, &type, &id, NULL, oi->lsdb); } } break; case OSPF6_SCOPE_AS: - vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, &type, &id, NULL, o->lsdb); break; @@ -457,7 +457,7 @@ DEFUN (show_ipv6_ospf6_database_type_id, break; } - vty_out (vty, "%s", VNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -507,7 +507,7 @@ DEFUN (show_ipv6_ospf6_database_type_router, case OSPF6_SCOPE_AREA: for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) { - vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); + vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name); ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oa->lsdb); } break; @@ -517,15 +517,15 @@ DEFUN (show_ipv6_ospf6_database_type_router, { for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) { - vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, - oi->interface->name, oa->name, VNL, VNL); + vty_out (vty, IF_LSDB_TITLE_FORMAT, + oi->interface->name, oa->name); ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oi->lsdb); } } break; case OSPF6_SCOPE_AS: - vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, o->lsdb); break; @@ -534,7 +534,7 @@ DEFUN (show_ipv6_ospf6_database_type_router, break; } - vty_out (vty, "%s", VNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -572,7 +572,7 @@ DEFUN (show_ipv6_ospf6_database_id_router, for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) { - vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); + vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name); ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oa->lsdb); } @@ -580,16 +580,16 @@ DEFUN (show_ipv6_ospf6_database_id_router, { for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) { - vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, - oi->interface->name, oa->name, VNL, VNL); + vty_out (vty, IF_LSDB_TITLE_FORMAT, + oi->interface->name, oa->name); ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oi->lsdb); } } - vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb); - vty_out (vty, "%s", VNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -627,7 +627,7 @@ DEFUN (show_ipv6_ospf6_database_adv_router_linkstate_id, for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) { - vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); + vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name); ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oa->lsdb); } @@ -635,16 +635,16 @@ DEFUN (show_ipv6_ospf6_database_adv_router_linkstate_id, { for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) { - vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, - oi->interface->name, oa->name, VNL, VNL); + vty_out (vty, IF_LSDB_TITLE_FORMAT, + oi->interface->name, oa->name); ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oi->lsdb); } } - vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb); - vty_out (vty, "%s", VNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -694,7 +694,7 @@ DEFUN (show_ipv6_ospf6_database_type_id_router, case OSPF6_SCOPE_AREA: for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) { - vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); + vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb); } break; @@ -704,15 +704,15 @@ DEFUN (show_ipv6_ospf6_database_type_id_router, { for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) { - vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, - oi->interface->name, oa->name, VNL, VNL); + vty_out (vty, IF_LSDB_TITLE_FORMAT, + oi->interface->name, oa->name); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb); } } break; case OSPF6_SCOPE_AS: - vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb); break; @@ -721,7 +721,7 @@ DEFUN (show_ipv6_ospf6_database_type_id_router, break; } - vty_out (vty, "%s", VNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -774,7 +774,7 @@ DEFUN (show_ipv6_ospf6_database_type_adv_router_linkstate_id, case OSPF6_SCOPE_AREA: for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) { - vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); + vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb); } break; @@ -784,15 +784,15 @@ DEFUN (show_ipv6_ospf6_database_type_adv_router_linkstate_id, { for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) { - vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, - oi->interface->name, oa->name, VNL, VNL); + vty_out (vty, IF_LSDB_TITLE_FORMAT, + oi->interface->name, oa->name); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb); } } break; case OSPF6_SCOPE_AS: - vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb); break; @@ -801,7 +801,7 @@ DEFUN (show_ipv6_ospf6_database_type_adv_router_linkstate_id, break; } - vty_out (vty, "%s", VNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -831,7 +831,7 @@ DEFUN (show_ipv6_ospf6_database_self_originated, for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) { - vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); + vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name); ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oa->lsdb); } @@ -839,16 +839,16 @@ DEFUN (show_ipv6_ospf6_database_self_originated, { for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) { - vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, - oi->interface->name, oa->name, VNL, VNL); + vty_out (vty, IF_LSDB_TITLE_FORMAT, + oi->interface->name, oa->name); ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oi->lsdb); } } - vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb); - vty_out (vty, "%s", VNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -896,7 +896,7 @@ DEFUN (show_ipv6_ospf6_database_type_self_originated, case OSPF6_SCOPE_AREA: for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) { - vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); + vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name); ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oa->lsdb); } break; @@ -906,15 +906,15 @@ DEFUN (show_ipv6_ospf6_database_type_self_originated, { for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) { - vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, - oi->interface->name, oa->name, VNL, VNL); + vty_out (vty, IF_LSDB_TITLE_FORMAT, + oi->interface->name, oa->name); ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oi->lsdb); } } break; case OSPF6_SCOPE_AS: - vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, o->lsdb); break; @@ -923,7 +923,7 @@ DEFUN (show_ipv6_ospf6_database_type_self_originated, break; } - vty_out (vty, "%s", VNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -974,7 +974,7 @@ DEFUN (show_ipv6_ospf6_database_type_self_originated_linkstate_id, case OSPF6_SCOPE_AREA: for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) { - vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); + vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb); } break; @@ -984,15 +984,15 @@ DEFUN (show_ipv6_ospf6_database_type_self_originated_linkstate_id, { for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) { - vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, - oi->interface->name, oa->name, VNL, VNL); + vty_out (vty, IF_LSDB_TITLE_FORMAT, + oi->interface->name, oa->name); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb); } } break; case OSPF6_SCOPE_AS: - vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb); break; @@ -1001,7 +1001,7 @@ DEFUN (show_ipv6_ospf6_database_type_self_originated_linkstate_id, break; } - vty_out (vty, "%s", VNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -1051,7 +1051,7 @@ DEFUN (show_ipv6_ospf6_database_type_id_self_originated, case OSPF6_SCOPE_AREA: for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) { - vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); + vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb); } break; @@ -1061,15 +1061,15 @@ DEFUN (show_ipv6_ospf6_database_type_id_self_originated, { for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) { - vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, - oi->interface->name, oa->name, VNL, VNL); + vty_out (vty, IF_LSDB_TITLE_FORMAT, + oi->interface->name, oa->name); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb); } } break; case OSPF6_SCOPE_AS: - vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb); break; @@ -1078,7 +1078,7 @@ DEFUN (show_ipv6_ospf6_database_type_id_self_originated, break; } - vty_out (vty, "%s", VNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -1115,7 +1115,7 @@ DEFUN (show_ipv6_ospf6_border_routers, ro = ospf6_route_lookup (&prefix, ospf6->brouter_table); if (!ro) { - vty_out (vty, "No Route found for Router ID: %s%s", argv[4]->arg, VNL); + vty_out (vty, "No Route found for Router ID: %s\n", argv[4]->arg); return CMD_SUCCESS; } @@ -1157,12 +1157,11 @@ DEFUN (show_ipv6_ospf6_linkstate, for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, node, oa)) { - vty_out (vty, "%s SPF Result in Area %s%s%s", - VNL, oa->name, VNL, VNL); + vty_out (vty, "\n SPF Result in Area %s\n\n", oa->name); ospf6_linkstate_table_show (vty, idx_ipv4, argc, argv, oa->spf_table); } - vty_out (vty, "%s", VNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -1185,12 +1184,11 @@ DEFUN (show_ipv6_ospf6_linkstate_detail, for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, node, oa)) { - vty_out (vty, "%s SPF Result in Area %s%s%s", - VNL, oa->name, VNL, VNL); + vty_out (vty, "\n SPF Result in Area %s\n\n", oa->name); ospf6_linkstate_table_show (vty, idx_detail, argc, argv, oa->spf_table); } - vty_out (vty, "%s", VNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } diff --git a/ospf6d/ospf6d.h b/ospf6d/ospf6d.h index 41082e451..2da11d0ab 100644 --- a/ospf6d/ospf6d.h +++ b/ospf6d/ospf6d.h @@ -90,11 +90,10 @@ extern struct thread_master *master; #define OSPF6_ROUTER_ID_STR "Specify Router-ID\n" #define OSPF6_LS_ID_STR "Specify Link State ID\n" -#define VNL VTYNL #define OSPF6_CMD_CHECK_RUNNING() \ if (ospf6 == NULL) \ { \ - vty_out (vty, "OSPFv3 is not running%s", VTYNL); \ + vty_out (vty, "OSPFv3 is not running\n"); \ return CMD_SUCCESS; \ } diff --git a/ospfd/ospf_apiserver.c b/ospfd/ospf_apiserver.c index d09290e52..2b72abcd7 100644 --- a/ospfd/ospf_apiserver.c +++ b/ospfd/ospf_apiserver.c @@ -2192,7 +2192,7 @@ ospf_apiserver_show_info (struct vty *vty, struct ospf_lsa *lsa) if (vty != NULL) { int i; - vty_outln (vty, " Added using OSPF API: %u octets of opaque data %s", + vty_out (vty, " Added using OSPF API: %u octets of opaque data %s\n", opaquelen, VALID_OPAQUE_INFO_LEN(lsa->data) ? "" : "(Invalid length?)"); vty_out (vty, " Opaque data: "); @@ -2201,7 +2201,7 @@ ospf_apiserver_show_info (struct vty *vty, struct ospf_lsa *lsa) { vty_out (vty, "0x%x ", olsa->data[i]); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } else { diff --git a/ospfd/ospf_bfd.c b/ospfd/ospf_bfd.c index f8fa9bbb3..1bcffea6f 100644 --- a/ospfd/ospf_bfd.c +++ b/ospfd/ospf_bfd.c @@ -307,11 +307,11 @@ ospf_bfd_write_config(struct vty *vty, struct ospf_if_params *params) bfd_info = (struct bfd_info *)params->bfd_info; if (CHECK_FLAG(bfd_info->flags, BFD_FLAG_PARAM_CFG)) - vty_outln (vty, " ip ospf bfd %d %d %d", + vty_out (vty, " ip ospf bfd %d %d %d\n", bfd_info->detect_mult, bfd_info->required_min_rx, bfd_info->desired_min_tx); else - vty_outln (vty, " ip ospf bfd"); + vty_out (vty, " ip ospf bfd\n"); } /* diff --git a/ospfd/ospf_dump.c b/ospfd/ospf_dump.c index 3947d5182..f233f79c0 100644 --- a/ospfd/ospf_dump.c +++ b/ospfd/ospf_dump.c @@ -1568,92 +1568,91 @@ show_debugging_ospf_common (struct vty *vty, struct ospf *ospf) int i; if (ospf->instance) - vty_outln (vty, "%sOSPF Instance: %d%s", VTYNL, ospf->instance, - VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); - vty_outln (vty, "OSPF debugging status:"); + vty_out (vty, "OSPF debugging status:\n"); /* Show debug status for events. */ if (IS_DEBUG_OSPF(event,EVENT)) - vty_outln (vty, " OSPF event debugging is on"); + vty_out (vty, " OSPF event debugging is on\n"); /* Show debug status for ISM. */ if (IS_DEBUG_OSPF (ism, ISM) == OSPF_DEBUG_ISM) - vty_outln (vty, " OSPF ISM debugging is on"); + vty_out (vty, " OSPF ISM debugging is on\n"); else { if (IS_DEBUG_OSPF (ism, ISM_STATUS)) - vty_outln (vty, " OSPF ISM status debugging is on"); + vty_out (vty, " OSPF ISM status debugging is on\n"); if (IS_DEBUG_OSPF (ism, ISM_EVENTS)) - vty_outln (vty, " OSPF ISM event debugging is on"); + vty_out (vty, " OSPF ISM event debugging is on\n"); if (IS_DEBUG_OSPF (ism, ISM_TIMERS)) - vty_outln (vty, " OSPF ISM timer debugging is on"); + vty_out (vty, " OSPF ISM timer debugging is on\n"); } /* Show debug status for NSM. */ if (IS_DEBUG_OSPF (nsm, NSM) == OSPF_DEBUG_NSM) - vty_outln (vty, " OSPF NSM debugging is on"); + vty_out (vty, " OSPF NSM debugging is on\n"); else { if (IS_DEBUG_OSPF (nsm, NSM_STATUS)) - vty_outln (vty, " OSPF NSM status debugging is on"); + vty_out (vty, " OSPF NSM status debugging is on\n"); if (IS_DEBUG_OSPF (nsm, NSM_EVENTS)) - vty_outln (vty, " OSPF NSM event debugging is on"); + vty_out (vty, " OSPF NSM event debugging is on\n"); if (IS_DEBUG_OSPF (nsm, NSM_TIMERS)) - vty_outln (vty, " OSPF NSM timer debugging is on"); + vty_out (vty, " OSPF NSM timer debugging is on\n"); } /* Show debug status for OSPF Packets. */ for (i = 0; i < 5; i++) if (IS_DEBUG_OSPF_PACKET (i, SEND) && IS_DEBUG_OSPF_PACKET (i, RECV)) { - vty_outln (vty, " OSPF packet %s%s debugging is on", + vty_out (vty, " OSPF packet %s%s debugging is on\n", lookup_msg(ospf_packet_type_str, i + 1, NULL), IS_DEBUG_OSPF_PACKET (i, DETAIL) ? " detail" : ""); } else { if (IS_DEBUG_OSPF_PACKET (i, SEND)) - vty_outln (vty, " OSPF packet %s send%s debugging is on", + vty_out (vty, " OSPF packet %s send%s debugging is on\n", lookup_msg(ospf_packet_type_str, i + 1, NULL), IS_DEBUG_OSPF_PACKET (i, DETAIL) ? " detail" : ""); if (IS_DEBUG_OSPF_PACKET (i, RECV)) - vty_outln (vty, " OSPF packet %s receive%s debugging is on", + vty_out (vty, " OSPF packet %s receive%s debugging is on\n", lookup_msg(ospf_packet_type_str, i + 1, NULL), IS_DEBUG_OSPF_PACKET (i, DETAIL) ? " detail" : ""); } /* Show debug status for OSPF LSAs. */ if (IS_DEBUG_OSPF (lsa, LSA) == OSPF_DEBUG_LSA) - vty_outln (vty, " OSPF LSA debugging is on"); + vty_out (vty, " OSPF LSA debugging is on\n"); else { if (IS_DEBUG_OSPF (lsa, LSA_GENERATE)) - vty_outln (vty, " OSPF LSA generation debugging is on"); + vty_out (vty, " OSPF LSA generation debugging is on\n"); if (IS_DEBUG_OSPF (lsa, LSA_FLOODING)) - vty_outln (vty, " OSPF LSA flooding debugging is on"); + vty_out (vty, " OSPF LSA flooding debugging is on\n"); if (IS_DEBUG_OSPF (lsa, LSA_INSTALL)) - vty_outln (vty, " OSPF LSA install debugging is on"); + vty_out (vty, " OSPF LSA install debugging is on\n"); if (IS_DEBUG_OSPF (lsa, LSA_REFRESH)) - vty_outln (vty, " OSPF LSA refresh debugging is on"); + vty_out (vty, " OSPF LSA refresh debugging is on\n"); } /* Show debug status for Zebra. */ if (IS_DEBUG_OSPF (zebra, ZEBRA) == OSPF_DEBUG_ZEBRA) - vty_outln (vty, " OSPF Zebra debugging is on"); + vty_out (vty, " OSPF Zebra debugging is on\n"); else { if (IS_DEBUG_OSPF (zebra, ZEBRA_INTERFACE)) - vty_outln (vty, " OSPF Zebra interface debugging is on"); + vty_out (vty, " OSPF Zebra interface debugging is on\n"); if (IS_DEBUG_OSPF (zebra, ZEBRA_REDISTRIBUTE)) - vty_outln (vty, " OSPF Zebra redistribute debugging is on"); + vty_out (vty, " OSPF Zebra redistribute debugging is on\n"); } /* Show debug status for NSSA. */ if (IS_DEBUG_OSPF (nssa, NSSA) == OSPF_DEBUG_NSSA) - vty_outln (vty, " OSPF NSSA debugging is on"); + vty_out (vty, " OSPF NSSA debugging is on\n"); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -1722,56 +1721,56 @@ config_write_debug (struct vty *vty) /* debug ospf ism (status|events|timers). */ if (IS_CONF_DEBUG_OSPF (ism, ISM) == OSPF_DEBUG_ISM) - vty_outln (vty, "debug ospf%s ism", str); + vty_out (vty, "debug ospf%s ism\n", str); else { if (IS_CONF_DEBUG_OSPF (ism, ISM_STATUS)) - vty_outln (vty, "debug ospf%s ism status", str); + vty_out (vty, "debug ospf%s ism status\n", str); if (IS_CONF_DEBUG_OSPF (ism, ISM_EVENTS)) - vty_outln (vty, "debug ospf%s ism event", str); + vty_out (vty, "debug ospf%s ism event\n", str); if (IS_CONF_DEBUG_OSPF (ism, ISM_TIMERS)) - vty_outln (vty, "debug ospf%s ism timer", str); + vty_out (vty, "debug ospf%s ism timer\n", str); } /* debug ospf nsm (status|events|timers). */ if (IS_CONF_DEBUG_OSPF (nsm, NSM) == OSPF_DEBUG_NSM) - vty_outln (vty, "debug ospf%s nsm", str); + vty_out (vty, "debug ospf%s nsm\n", str); else { if (IS_CONF_DEBUG_OSPF (nsm, NSM_STATUS)) - vty_outln (vty, "debug ospf%s nsm status", str); + vty_out (vty, "debug ospf%s nsm status\n", str); if (IS_CONF_DEBUG_OSPF (nsm, NSM_EVENTS)) - vty_outln (vty, "debug ospf%s nsm event", str); + vty_out (vty, "debug ospf%s nsm event\n", str); if (IS_CONF_DEBUG_OSPF (nsm, NSM_TIMERS)) - vty_outln (vty, "debug ospf%s nsm timer", str); + vty_out (vty, "debug ospf%s nsm timer\n", str); } /* debug ospf lsa (generate|flooding|install|refresh). */ if (IS_CONF_DEBUG_OSPF (lsa, LSA) == OSPF_DEBUG_LSA) - vty_outln (vty, "debug ospf%s lsa", str); + vty_out (vty, "debug ospf%s lsa\n", str); else { if (IS_CONF_DEBUG_OSPF (lsa, LSA_GENERATE)) - vty_outln (vty, "debug ospf%s lsa generate", str); + vty_out (vty, "debug ospf%s lsa generate\n", str); if (IS_CONF_DEBUG_OSPF (lsa, LSA_FLOODING)) - vty_outln (vty, "debug ospf%s lsa flooding", str); + vty_out (vty, "debug ospf%s lsa flooding\n", str); if (IS_CONF_DEBUG_OSPF (lsa, LSA_INSTALL)) - vty_outln (vty, "debug ospf%s lsa install", str); + vty_out (vty, "debug ospf%s lsa install\n", str); if (IS_CONF_DEBUG_OSPF (lsa, LSA_REFRESH)) - vty_outln (vty, "debug ospf%s lsa refresh", str); + vty_out (vty, "debug ospf%s lsa refresh\n", str); write = 1; } /* debug ospf zebra (interface|redistribute). */ if (IS_CONF_DEBUG_OSPF (zebra, ZEBRA) == OSPF_DEBUG_ZEBRA) - vty_outln (vty, "debug ospf%s zebra", str); + vty_out (vty, "debug ospf%s zebra\n", str); else { if (IS_CONF_DEBUG_OSPF (zebra, ZEBRA_INTERFACE)) - vty_outln (vty, "debug ospf%s zebra interface", str); + vty_out (vty, "debug ospf%s zebra interface\n", str); if (IS_CONF_DEBUG_OSPF (zebra, ZEBRA_REDISTRIBUTE)) - vty_outln (vty, "debug ospf%s zebra redistribute", str); + vty_out (vty, "debug ospf%s zebra redistribute\n", str); write = 1; } @@ -1779,14 +1778,14 @@ config_write_debug (struct vty *vty) /* debug ospf event. */ if (IS_CONF_DEBUG_OSPF (event, EVENT) == OSPF_DEBUG_EVENT) { - vty_outln (vty, "debug ospf%s event", str); + vty_out (vty, "debug ospf%s event\n", str); write = 1; } /* debug ospf nssa. */ if (IS_CONF_DEBUG_OSPF (nssa, NSSA) == OSPF_DEBUG_NSSA) { - vty_outln (vty, "debug ospf%s nssa", str); + vty_out (vty, "debug ospf%s nssa\n", str); write = 1; } @@ -1796,7 +1795,7 @@ config_write_debug (struct vty *vty) r &= conf_debug_ospf_packet[i] & (OSPF_DEBUG_SEND_RECV|OSPF_DEBUG_DETAIL); if (r == (OSPF_DEBUG_SEND_RECV|OSPF_DEBUG_DETAIL)) { - vty_outln (vty, "debug ospf%s packet all detail", str); + vty_out (vty, "debug ospf%s packet all detail\n", str); return 1; } @@ -1806,10 +1805,10 @@ config_write_debug (struct vty *vty) r &= conf_debug_ospf_packet[i] & OSPF_DEBUG_SEND_RECV; if (r == OSPF_DEBUG_SEND_RECV) { - vty_outln (vty, "debug ospf%s packet all", str); + vty_out (vty, "debug ospf%s packet all\n", str); for (i = 0; i < 5; i++) if (conf_debug_ospf_packet[i] & OSPF_DEBUG_DETAIL) - vty_outln (vty, "debug ospf%s packet %s detail", str, + vty_out (vty, "debug ospf%s packet %s detail\n", str, type_str[i]); return 1; } @@ -1821,7 +1820,7 @@ config_write_debug (struct vty *vty) if (conf_debug_ospf_packet[i] == 0) continue; - vty_outln (vty, "debug ospf%s packet %s%s", str, + vty_out (vty, "debug ospf%s packet %s%s\n", str, type_str[i],detail_str[conf_debug_ospf_packet[i]]); write = 1; } diff --git a/ospfd/ospf_opaque.c b/ospfd/ospf_opaque.c index 09d218f81..f3db6afd1 100644 --- a/ospfd/ospf_opaque.c +++ b/ospfd/ospf_opaque.c @@ -1120,7 +1120,7 @@ ospf_opaque_config_write_router (struct vty *vty, struct ospf *ospf) struct list *funclist; if (CHECK_FLAG (ospf->config, OSPF_OPAQUE_CAPABLE)) - vty_outln (vty, " capability opaque"); + vty_out (vty, " capability opaque\n"); funclist = ospf_opaque_wildcard_funclist; opaque_lsa_config_write_router_callback (funclist, vty); @@ -1189,11 +1189,11 @@ show_opaque_info_detail (struct vty *vty, struct ospf_lsa *lsa) /* Switch output functionality by vty address. */ if (vty != NULL) { - vty_outln (vty, " Opaque-Type %u (%s)", opaque_type, + vty_out (vty, " Opaque-Type %u (%s)\n", opaque_type, ospf_opaque_type_name(opaque_type)); - vty_outln (vty, " Opaque-ID 0x%x", opaque_id); + vty_out (vty, " Opaque-ID 0x%x\n", opaque_id); - vty_outln (vty, " Opaque-Info: %u octets of data%s", + vty_out (vty, " Opaque-Info: %u octets of data%s\n", ntohs (lsah->length) - OSPF_LSA_HEADER_SIZE, VALID_OPAQUE_INFO_LEN(lsah) ? "" : "(Invalid length?)"); } diff --git a/ospfd/ospf_ri.c b/ospfd/ospf_ri.c index 21798300e..0f1ef35e4 100644 --- a/ospfd/ospf_ri.c +++ b/ospfd/ospf_ri.c @@ -906,7 +906,7 @@ show_vty_router_cap (struct vty *vty, struct ri_tlv_header *tlvh) struct ri_tlv_router_cap *top = (struct ri_tlv_router_cap *) tlvh; if (vty != NULL) - vty_outln (vty, " Router Capabilities: 0x%x",ntohl(top->value)); + vty_out (vty, " Router Capabilities: 0x%x\n",ntohl(top->value)); else zlog_debug (" Router Capabilities: 0x%x", ntohl (top->value)); @@ -921,7 +921,7 @@ show_vty_pce_subtlv_address (struct vty *vty, struct ri_tlv_header *tlvh) if (ntohs (top->address.type) == PCE_ADDRESS_TYPE_IPV4) { if (vty != NULL) - vty_outln (vty, " PCE Address: %s",inet_ntoa(top->address.value)); + vty_out (vty, " PCE Address: %s\n",inet_ntoa(top->address.value)); else zlog_debug (" PCE Address: %s", inet_ntoa (top->address.value)); } @@ -929,7 +929,7 @@ show_vty_pce_subtlv_address (struct vty *vty, struct ri_tlv_header *tlvh) { /* TODO: Add support to IPv6 with inet_ntop() */ if (vty != NULL) - vty_outln (vty, " PCE Address: 0x%x", + vty_out (vty, " PCE Address: 0x%x\n", ntohl(top->address.value.s_addr)); else zlog_debug (" PCE Address: 0x%x", @@ -946,7 +946,7 @@ show_vty_pce_subtlv_path_scope (struct vty *vty, struct ri_tlv_header *tlvh) (struct ri_pce_subtlv_path_scope *) tlvh; if (vty != NULL) - vty_outln (vty, " PCE Path Scope: 0x%x",ntohl(top->value)); + vty_out (vty, " PCE Path Scope: 0x%x\n",ntohl(top->value)); else zlog_debug (" PCE Path Scope: 0x%x", ntohl (top->value)); @@ -963,14 +963,14 @@ show_vty_pce_subtlv_domain (struct vty *vty, struct ri_tlv_header *tlvh) { tmp.s_addr = top->value; if (vty != NULL) - vty_outln (vty, " PCE domain Area: %s",inet_ntoa(tmp)); + vty_out (vty, " PCE domain Area: %s\n",inet_ntoa(tmp)); else zlog_debug (" PCE domain Area: %s", inet_ntoa (tmp)); } else { if (vty != NULL) - vty_outln (vty, " PCE domain AS: %d",ntohl(top->value)); + vty_out (vty, " PCE domain AS: %d\n",ntohl(top->value)); else zlog_debug (" PCE domain AS: %d", ntohl (top->value)); } @@ -988,14 +988,14 @@ show_vty_pce_subtlv_neighbor (struct vty *vty, struct ri_tlv_header *tlvh) { tmp.s_addr = top->value; if (vty != NULL) - vty_outln (vty, " PCE neighbor Area: %s",inet_ntoa(tmp)); + vty_out (vty, " PCE neighbor Area: %s\n",inet_ntoa(tmp)); else zlog_debug (" PCE neighbor Area: %s", inet_ntoa (tmp)); } else { if (vty != NULL) - vty_outln (vty, " PCE neighbor AS: %d",ntohl(top->value)); + vty_out (vty, " PCE neighbor AS: %d\n",ntohl(top->value)); else zlog_debug (" PCE neighbor AS: %d", ntohl (top->value)); } @@ -1008,7 +1008,7 @@ show_vty_pce_subtlv_cap_flag (struct vty *vty, struct ri_tlv_header *tlvh) struct ri_pce_subtlv_cap_flag *top = (struct ri_pce_subtlv_cap_flag *) tlvh; if (vty != NULL) - vty_outln (vty, " PCE Capabilities Flag: 0x%x",ntohl(top->value)); + vty_out (vty, " PCE Capabilities Flag: 0x%x\n",ntohl(top->value)); else zlog_debug (" PCE Capabilities Flag: 0x%x", ntohl (top->value)); @@ -1019,7 +1019,7 @@ static u_int16_t show_vty_unknown_tlv (struct vty *vty, struct ri_tlv_header *tlvh) { if (vty != NULL) - vty_outln (vty, " Unknown TLV: [type(0x%x), length(0x%x)]", + vty_out (vty, " Unknown TLV: [type(0x%x), length(0x%x)]\n", ntohs (tlvh->type), ntohs(tlvh->length)); else zlog_debug (" Unknown TLV: [type(0x%x), length(0x%x)]", @@ -1105,16 +1105,16 @@ ospf_router_info_config_write_router (struct vty *vty) if (OspfRI.status == enabled) { if (OspfRI.scope == OSPF_OPAQUE_AS_LSA) - vty_outln (vty, " router-info as"); + vty_out (vty, " router-info as\n"); else - vty_outln (vty, " router-info area %s",inet_ntoa(OspfRI.area_id)); + vty_out (vty, " router-info area %s\n",inet_ntoa(OspfRI.area_id)); if (pce->pce_address.header.type != 0) - vty_outln (vty, " pce address %s", + vty_out (vty, " pce address %s\n", inet_ntoa(pce->pce_address.address.value)); if (pce->pce_cap_flag.header.type != 0) - vty_outln (vty, " pce flag 0x%x",ntohl(pce->pce_cap_flag.value)); + vty_out (vty, " pce flag 0x%x\n",ntohl(pce->pce_cap_flag.value)); for (ALL_LIST_ELEMENTS_RO (pce->pce_domain, node, domain)) { @@ -1123,11 +1123,11 @@ ospf_router_info_config_write_router (struct vty *vty) if (domain->type == PCE_DOMAIN_TYPE_AREA) { tmp.s_addr = domain->value; - vty_outln (vty, " pce domain area %s",inet_ntoa(tmp)); + vty_out (vty, " pce domain area %s\n",inet_ntoa(tmp)); } else { - vty_outln (vty, " pce domain as %d",ntohl(domain->value)); + vty_out (vty, " pce domain as %d\n",ntohl(domain->value)); } } } @@ -1139,18 +1139,18 @@ ospf_router_info_config_write_router (struct vty *vty) if (neighbor->type == PCE_DOMAIN_TYPE_AREA) { tmp.s_addr = neighbor->value; - vty_outln (vty, " pce neighbor area %s",inet_ntoa(tmp)); + vty_out (vty, " pce neighbor area %s\n",inet_ntoa(tmp)); } else { - vty_outln (vty, " pce neighbor as %d", + vty_out (vty, " pce neighbor as %d\n", ntohl(neighbor->value)); } } } if (pce->pce_scope.header.type != 0) - vty_outln (vty, " pce scope 0x%x", + vty_out (vty, " pce scope 0x%x\n", ntohl(OspfRI.pce_info.pce_scope.value)); } return; @@ -1181,7 +1181,7 @@ DEFUN (router_info, { if (!inet_aton (area, &OspfRI.area_id)) { - vty_outln (vty, "%% specified Area ID %s is invalid", + vty_out (vty, "%% specified Area ID %s is invalid\n", area); return CMD_WARNING_CONFIG_FAILED; } @@ -1257,7 +1257,7 @@ ospf_ri_enabled (struct vty *vty) return 1; if (vty) - vty_outln (vty, "%% OSPF RI is not turned on"); + vty_out (vty, "%% OSPF RI is not turned on\n"); return 0; } @@ -1278,7 +1278,7 @@ DEFUN (pce_address, if (!inet_aton (argv[idx_ipv4]->arg, &value)) { - vty_outln (vty, "Please specify PCE Address by A.B.C.D"); + vty_out (vty, "Please specify PCE Address by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1330,7 +1330,7 @@ DEFUN (pce_path_scope, if (sscanf (argv[idx_bitpattern]->arg, "0x%x", &scope) != 1) { - vty_outln (vty, "pce_path_scope: fscanf: %s",safe_strerror(errno)); + vty_out (vty, "pce_path_scope: fscanf: %s\n",safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } @@ -1384,7 +1384,7 @@ DEFUN (pce_domain, if (sscanf (argv[idx_number]->arg, "%d", &as) != 1) { - vty_outln (vty, "pce_domain: fscanf: %s",safe_strerror(errno)); + vty_out (vty, "pce_domain: fscanf: %s\n",safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } @@ -1421,7 +1421,7 @@ DEFUN (no_pce_domain, if (sscanf (argv[idx_number]->arg, "%d", &as) != 1) { - vty_outln (vty, "no_pce_domain: fscanf: %s",safe_strerror(errno)); + vty_out (vty, "no_pce_domain: fscanf: %s\n",safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } @@ -1455,7 +1455,7 @@ DEFUN (pce_neigbhor, if (sscanf (argv[idx_number]->arg, "%d", &as) != 1) { - vty_outln (vty, "pce_neighbor: fscanf: %s",safe_strerror(errno)); + vty_out (vty, "pce_neighbor: fscanf: %s\n",safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } @@ -1492,7 +1492,7 @@ DEFUN (no_pce_neighbor, if (sscanf (argv[idx_number]->arg, "%d", &as) != 1) { - vty_outln (vty, "no_pce_neighbor: fscanf: %s",safe_strerror(errno)); + vty_out (vty, "no_pce_neighbor: fscanf: %s\n",safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } @@ -1523,7 +1523,7 @@ DEFUN (pce_cap_flag, if (sscanf (argv[idx_bitpattern]->arg, "0x%x", &cap) != 1) { - vty_outln (vty, "pce_cap_flag: fscanf: %s",safe_strerror(errno)); + vty_out (vty, "pce_cap_flag: fscanf: %s\n",safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } @@ -1568,13 +1568,13 @@ DEFUN (show_ip_ospf_router_info, if (OspfRI.status == enabled) { - vty_outln (vty, "--- Router Information parameters ---"); + vty_out (vty, "--- Router Information parameters ---\n"); show_vty_router_cap (vty, &OspfRI.router_cap.header); } else { if (vty != NULL) - vty_outln (vty, " Router Information is disabled on this router"); + vty_out (vty, " Router Information is disabled on this router\n"); } return CMD_SUCCESS; } @@ -1596,7 +1596,7 @@ DEFUN (show_ip_opsf_router_info_pce, if (OspfRI.status == enabled) { - vty_outln (vty, "--- PCE parameters ---"); + vty_out (vty, "--- PCE parameters ---\n"); if (pce->pce_address.header.type != 0) show_vty_pce_subtlv_address (vty, &pce->pce_address.header); @@ -1622,7 +1622,7 @@ DEFUN (show_ip_opsf_router_info_pce, } else { - vty_outln (vty," Router Information is disabled on this router"); + vty_out (vty," Router Information is disabled on this router\n"); } return CMD_SUCCESS; diff --git a/ospfd/ospf_te.c b/ospfd/ospf_te.c index aafc0a98e..c34d97ff2 100644 --- a/ospfd/ospf_te.c +++ b/ospfd/ospf_te.c @@ -1671,7 +1671,7 @@ show_vty_router_addr (struct vty *vty, struct te_tlv_header *tlvh) struct te_tlv_router_addr *top = (struct te_tlv_router_addr *) tlvh; if (vty != NULL) - vty_outln (vty, " Router-Address: %s",inet_ntoa(top->value)); + vty_out (vty, " Router-Address: %s\n",inet_ntoa(top->value)); else zlog_debug (" Router-Address: %s", inet_ntoa (top->value)); @@ -1684,7 +1684,7 @@ show_vty_link_header (struct vty *vty, struct te_tlv_header *tlvh) struct te_tlv_link *top = (struct te_tlv_link *) tlvh; if (vty != NULL) - vty_outln (vty, " Link: %u octets of data",ntohs(top->header.length)); + vty_out (vty, " Link: %u octets of data\n",ntohs(top->header.length)); else zlog_debug (" Link: %u octets of data", ntohs (top->header.length)); @@ -1711,7 +1711,7 @@ show_vty_link_subtlv_link_type (struct vty *vty, struct te_tlv_header *tlvh) } if (vty != NULL) - vty_outln (vty, " Link-Type: %s (%u)", cp,top->link_type.value); + vty_out (vty, " Link-Type: %s (%u)\n", cp,top->link_type.value); else zlog_debug (" Link-Type: %s (%u)", cp, top->link_type.value); @@ -1725,7 +1725,7 @@ show_vty_link_subtlv_link_id (struct vty *vty, struct te_tlv_header *tlvh) top = (struct te_link_subtlv_link_id *) tlvh; if (vty != NULL) - vty_outln (vty, " Link-ID: %s", inet_ntoa(top->value)); + vty_out (vty, " Link-ID: %s\n", inet_ntoa(top->value)); else zlog_debug (" Link-ID: %s", inet_ntoa (top->value)); @@ -1743,14 +1743,14 @@ show_vty_link_subtlv_lclif_ipaddr (struct vty *vty, n = ntohs (tlvh->length) / sizeof (top->value[0]); if (vty != NULL) - vty_outln (vty, " Local Interface IP Address(es): %d", n); + vty_out (vty, " Local Interface IP Address(es): %d\n", n); else zlog_debug (" Local Interface IP Address(es): %d", n); for (i = 0; i < n; i++) { if (vty != NULL) - vty_outln (vty, " #%d: %s", i,inet_ntoa(top->value[i])); + vty_out (vty, " #%d: %s\n", i,inet_ntoa(top->value[i])); else zlog_debug (" #%d: %s", i, inet_ntoa (top->value[i])); } @@ -1767,14 +1767,14 @@ show_vty_link_subtlv_rmtif_ipaddr (struct vty *vty, top = (struct te_link_subtlv_rmtif_ipaddr *) tlvh; n = ntohs (tlvh->length) / sizeof (top->value[0]); if (vty != NULL) - vty_outln (vty, " Remote Interface IP Address(es): %d", n); + vty_out (vty, " Remote Interface IP Address(es): %d\n", n); else zlog_debug (" Remote Interface IP Address(es): %d", n); for (i = 0; i < n; i++) { if (vty != NULL) - vty_outln (vty, " #%d: %s", i,inet_ntoa(top->value[i])); + vty_out (vty, " #%d: %s\n", i,inet_ntoa(top->value[i])); else zlog_debug (" #%d: %s", i, inet_ntoa (top->value[i])); } @@ -1788,7 +1788,7 @@ show_vty_link_subtlv_te_metric (struct vty *vty, struct te_tlv_header *tlvh) top = (struct te_link_subtlv_te_metric *) tlvh; if (vty != NULL) - vty_outln (vty, " Traffic Engineering Metric: %u", + vty_out (vty, " Traffic Engineering Metric: %u\n", (u_int32_t)ntohl(top->value)); else zlog_debug (" Traffic Engineering Metric: %u", @@ -1807,7 +1807,7 @@ show_vty_link_subtlv_max_bw (struct vty *vty, struct te_tlv_header *tlvh) fval = ntohf (top->value); if (vty != NULL) - vty_outln (vty, " Maximum Bandwidth: %g (Bytes/sec)", fval); + vty_out (vty, " Maximum Bandwidth: %g (Bytes/sec)\n", fval); else zlog_debug (" Maximum Bandwidth: %g (Bytes/sec)", fval); @@ -1824,7 +1824,7 @@ show_vty_link_subtlv_max_rsv_bw (struct vty *vty, struct te_tlv_header *tlvh) fval = ntohf (top->value); if (vty != NULL) - vty_outln (vty, " Maximum Reservable Bandwidth: %g (Bytes/sec)",fval); + vty_out (vty, " Maximum Reservable Bandwidth: %g (Bytes/sec)\n",fval); else zlog_debug (" Maximum Reservable Bandwidth: %g (Bytes/sec)", fval); @@ -1840,7 +1840,7 @@ show_vty_link_subtlv_unrsv_bw (struct vty *vty, struct te_tlv_header *tlvh) top = (struct te_link_subtlv_unrsv_bw *) tlvh; if (vty != NULL) - vty_outln (vty, " Unreserved Bandwidth per Class Type in Byte/s:"); + vty_out (vty, " Unreserved Bandwidth per Class Type in Byte/s:\n"); else zlog_debug (" Unreserved Bandwidth per Class Type in Byte/s:"); for (i = 0; i < MAX_CLASS_TYPE; i+=2) @@ -1849,7 +1849,7 @@ show_vty_link_subtlv_unrsv_bw (struct vty *vty, struct te_tlv_header *tlvh) fval2 = ntohf (top->value[i+1]); if (vty != NULL) - vty_outln (vty, " [%d]: %g (Bytes/sec),\t[%d]: %g (Bytes/sec)", + vty_out (vty, " [%d]: %g (Bytes/sec),\t[%d]: %g (Bytes/sec)\n", i, fval1, i+1, fval2); else zlog_debug (" [%d]: %g (Bytes/sec),\t[%d]: %g (Bytes/sec)", @@ -1866,7 +1866,7 @@ show_vty_link_subtlv_rsc_clsclr (struct vty *vty, struct te_tlv_header *tlvh) top = (struct te_link_subtlv_rsc_clsclr *) tlvh; if (vty != NULL) - vty_outln (vty, " Resource class/color: 0x%x", + vty_out (vty, " Resource class/color: 0x%x\n", (u_int32_t)ntohl(top->value)); else zlog_debug (" Resource Class/Color: 0x%x", @@ -1884,8 +1884,8 @@ show_vty_link_subtlv_lrrid (struct vty *vty, struct te_tlv_header *tlvh) if (vty != NULL) { - vty_outln (vty, " Local TE Router ID: %s",inet_ntoa(top->local)); - vty_outln (vty, " Remote TE Router ID: %s",inet_ntoa(top->remote)); + vty_out (vty, " Local TE Router ID: %s\n",inet_ntoa(top->local)); + vty_out (vty, " Remote TE Router ID: %s\n",inet_ntoa(top->remote)); } else { @@ -1905,8 +1905,8 @@ show_vty_link_subtlv_llri (struct vty *vty, struct te_tlv_header *tlvh) if (vty != NULL) { - vty_outln (vty, " Link Local ID: %d",(u_int32_t)ntohl(top->local)); - vty_outln (vty, " Link Remote ID: %d",(u_int32_t)ntohl(top->remote)); + vty_out (vty, " Link Local ID: %d\n",(u_int32_t)ntohl(top->local)); + vty_out (vty, " Link Remote ID: %d\n",(u_int32_t)ntohl(top->remote)); } else { @@ -1925,7 +1925,7 @@ show_vty_link_subtlv_rip (struct vty *vty, struct te_tlv_header *tlvh) top = (struct te_link_subtlv_rip *) tlvh; if (vty != NULL) - vty_outln (vty, " Inter-AS TE Remote ASBR IP address: %s", + vty_out (vty, " Inter-AS TE Remote ASBR IP address: %s\n", inet_ntoa(top->value)); else zlog_debug (" Inter-AS TE Remote ASBR IP address: %s", @@ -1942,7 +1942,7 @@ show_vty_link_subtlv_ras (struct vty *vty, struct te_tlv_header *tlvh) top = (struct te_link_subtlv_ras *) tlvh; if (vty != NULL) - vty_outln (vty, " Inter-AS TE Remote AS number: %u",ntohl(top->value)); + vty_out (vty, " Inter-AS TE Remote AS number: %u\n",ntohl(top->value)); else zlog_debug (" Inter-AS TE Remote AS number: %u", ntohl (top->value)); @@ -1961,7 +1961,7 @@ show_vty_link_subtlv_av_delay (struct vty *vty, struct te_tlv_header *tlvh) anomalous = (u_int32_t) ntohl (top->value) & TE_EXT_ANORMAL; if (vty != NULL) - vty_outln (vty, " %s Average Link Delay: %d (micro-sec)", + vty_out (vty, " %s Average Link Delay: %d (micro-sec)\n", anomalous ? "Anomalous" : "Normal", delay); else zlog_debug (" %s Average Link Delay: %d (micro-sec)", @@ -1983,7 +1983,7 @@ show_vty_link_subtlv_mm_delay (struct vty *vty, struct te_tlv_header *tlvh) high = (u_int32_t) ntohl (top->high); if (vty != NULL) - vty_outln (vty, " %s Min/Max Link Delay: %d/%d (micro-sec)", + vty_out (vty, " %s Min/Max Link Delay: %d/%d (micro-sec)\n", anomalous ? "Anomalous" : "Normal", low, high); else zlog_debug (" %s Min/Max Link Delay: %d/%d (micro-sec)", @@ -2002,7 +2002,7 @@ show_vty_link_subtlv_delay_var (struct vty *vty, struct te_tlv_header *tlvh) jitter = (u_int32_t) ntohl (top->value) & TE_EXT_MASK; if (vty != NULL) - vty_outln (vty, " Delay Variation: %d (micro-sec)", jitter); + vty_out (vty, " Delay Variation: %d (micro-sec)\n", jitter); else zlog_debug (" Delay Variation: %d (micro-sec)", jitter); @@ -2023,7 +2023,7 @@ show_vty_link_subtlv_pkt_loss (struct vty *vty, struct te_tlv_header *tlvh) anomalous = (u_int32_t) ntohl (top->value) & TE_EXT_ANORMAL; if (vty != NULL) - vty_outln (vty, " %s Link Loss: %g (%%)", anomalous ? "Anomalous" : "Normal", + vty_out (vty, " %s Link Loss: %g (%%)\n", anomalous ? "Anomalous" : "Normal", fval); else zlog_debug (" %s Link Loss: %g (%%)", anomalous ? "Anomalous" : "Normal", @@ -2042,7 +2042,7 @@ show_vty_link_subtlv_res_bw (struct vty *vty, struct te_tlv_header *tlvh) fval = ntohf (top->value); if (vty != NULL) - vty_outln (vty, " Unidirectional Residual Bandwidth: %g (Bytes/sec)", + vty_out (vty, " Unidirectional Residual Bandwidth: %g (Bytes/sec)\n", fval); else zlog_debug (" Unidirectional Residual Bandwidth: %g (Bytes/sec)", @@ -2061,7 +2061,7 @@ show_vty_link_subtlv_ava_bw (struct vty *vty, struct te_tlv_header *tlvh) fval = ntohf (top->value); if (vty != NULL) - vty_outln (vty, " Unidirectional Available Bandwidth: %g (Bytes/sec)", + vty_out (vty, " Unidirectional Available Bandwidth: %g (Bytes/sec)\n", fval); else zlog_debug (" Unidirectional Available Bandwidth: %g (Bytes/sec)", @@ -2080,7 +2080,7 @@ show_vty_link_subtlv_use_bw (struct vty *vty, struct te_tlv_header *tlvh) fval = ntohf (top->value); if (vty != NULL) - vty_outln (vty, " Unidirectional Utilized Bandwidth: %g (Bytes/sec)", + vty_out (vty, " Unidirectional Utilized Bandwidth: %g (Bytes/sec)\n", fval); else zlog_debug (" Unidirectional Utilized Bandwidth: %g (Bytes/sec)", @@ -2093,7 +2093,7 @@ static u_int16_t show_vty_unknown_tlv (struct vty *vty, struct te_tlv_header *tlvh) { if (vty != NULL) - vty_outln (vty, " Unknown TLV: [type(0x%x), length(0x%x)]", + vty_out (vty, " Unknown TLV: [type(0x%x), length(0x%x)]\n", ntohs (tlvh->type), ntohs(tlvh->length)); else zlog_debug (" Unknown TLV: [type(0x%x), length(0x%x)]", @@ -2230,15 +2230,15 @@ ospf_mpls_te_config_write_router (struct vty *vty) if (OspfMplsTE.status == enabled) { - vty_outln (vty, " mpls-te on"); - vty_outln (vty, " mpls-te router-address %s", + vty_out (vty, " mpls-te on\n"); + vty_out (vty, " mpls-te router-address %s\n", inet_ntoa(OspfMplsTE.router_addr.value)); } if (OspfMplsTE.inter_as == AS) - vty_outln (vty, " mpls-te inter-as as"); + vty_out (vty, " mpls-te inter-as as\n"); if (OspfMplsTE.inter_as == Area) - vty_outln (vty, " mpls-te inter-as area %s ", + vty_out (vty, " mpls-te inter-as area %s \n", inet_ntoa(OspfMplsTE.interas_areaid)); return; @@ -2325,7 +2325,7 @@ DEFUN (ospf_mpls_te_router_addr, if (! inet_aton (argv[idx_ipv4]->arg, &value)) { - vty_outln (vty, "Please specify Router-Addr by A.B.C.D"); + vty_out (vty, "Please specify Router-Addr by A.B.C.D\n"); return CMD_WARNING; } @@ -2393,7 +2393,7 @@ set_inter_as_mode (struct vty *vty, const char *mode_name, } else { - vty_outln (vty,"Unknown mode. Please choose between as or area"); + vty_out (vty,"Unknown mode. Please choose between as or area\n"); return CMD_WARNING; } @@ -2404,8 +2404,8 @@ set_inter_as_mode (struct vty *vty, const char *mode_name, /* Register new callbacks regarding the flooding scope (AS or Area) */ if (ospf_mpls_te_register (mode) < 0) { - vty_outln (vty, - "Internal error: Unable to register Inter-AS functions"); + vty_out (vty, + "Internal error: Unable to register Inter-AS functions\n"); return CMD_WARNING; } @@ -2428,14 +2428,14 @@ set_inter_as_mode (struct vty *vty, const char *mode_name, } else { - vty_outln (vty, "Please change Inter-AS support to disable first before going to mode %s", + vty_out (vty, "Please change Inter-AS support to disable first before going to mode %s\n", mode2text[mode]); return CMD_WARNING; } } else { - vty_outln (vty, "mpls-te has not been turned on"); + vty_out (vty, "mpls-te has not been turned on\n"); return CMD_WARNING; } return CMD_SUCCESS; @@ -2505,12 +2505,12 @@ DEFUN (show_ip_ospf_mpls_te_router, { if (OspfMplsTE.status == enabled) { - vty_outln (vty, "--- MPLS-TE router parameters ---"); + vty_out (vty, "--- MPLS-TE router parameters ---\n"); if (ntohs (OspfMplsTE.router_addr.header.type) != 0) show_vty_router_addr (vty, &OspfMplsTE.router_addr.header); else if (vty != NULL) - vty_outln (vty, " N/A"); + vty_out (vty, " N/A\n"); } return CMD_SUCCESS; } @@ -2531,21 +2531,21 @@ show_mpls_te_link_sub (struct vty *vty, struct interface *ifp) { if (IS_INTER_AS (lp->type)) { - vty_outln (vty, "-- Inter-AS TEv2 link parameters for %s --", + vty_out (vty, "-- Inter-AS TEv2 link parameters for %s --\n", ifp->name); } else { /* MPLS-TE is not activate on this interface */ /* or this interface is passive and Inter-AS TEv2 is not activate */ - vty_outln (vty, " %s: MPLS-TE is disabled on this interface", + vty_out (vty, " %s: MPLS-TE is disabled on this interface\n", ifp->name); return; } } else { - vty_outln (vty, "-- MPLS-TE link parameters for %s --", + vty_out (vty, "-- MPLS-TE link parameters for %s --\n", ifp->name); } @@ -2585,11 +2585,11 @@ show_mpls_te_link_sub (struct vty *vty, struct interface *ifp) show_vty_link_subtlv_ava_bw (vty, &lp->ava_bw.header); if (TLV_TYPE(lp->use_bw) != 0) show_vty_link_subtlv_use_bw (vty, &lp->use_bw.header); - vty_outln (vty, "---------------%s", VTYNL); + vty_out (vty, "---------------\n\n"); } else { - vty_outln (vty, " %s: MPLS-TE is disabled on this interface", + vty_out (vty, " %s: MPLS-TE is disabled on this interface\n", ifp->name); } @@ -2620,7 +2620,7 @@ DEFUN (show_ip_ospf_mpls_te_link, else { if ((ifp = if_lookup_by_name (argv[idx_interface]->arg, VRF_DEFAULT)) == NULL) - vty_outln (vty, "No such interface name"); + vty_out (vty, "No such interface name\n"); else show_mpls_te_link_sub (vty, ifp); } diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index fa02561ab..f6387b759 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -100,7 +100,7 @@ str2metric (const char *str, int *metric) *metric = strtol (str, NULL, 10); if (*metric < 0 && *metric > 16777214) { - /* vty_out (vty, "OSPF metric value is invalid%s", VTYNL); */ + /* vty_out (vty, "OSPF metric value is invalid\n"); */ return 0; } @@ -150,7 +150,7 @@ DEFUN_NOSH (router_ospf, ospf = ospf_lookup(); if (!ospf) { - vty_out (vty, "There isn't active ospf instance %s", VTYNL); + vty_out (vty, "There isn't active ospf instance \n"); return CMD_WARNING_CONFIG_FAILED; } @@ -213,7 +213,7 @@ DEFUN (ospf_router_id, ret = inet_aton (argv[idx_ipv4]->arg, &router_id); if (!ret) { - vty_out (vty, "Please specify Router ID by A.B.C.D%s", VTYNL); + vty_out (vty, "Please specify Router ID by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -223,7 +223,7 @@ DEFUN (ospf_router_id, if (area->full_nbrs) { vty_out (vty, "For this router-id change to take effect," - " save config and restart ospfd%s", VTYNL); + " save config and restart ospfd\n"); return CMD_SUCCESS; } @@ -248,7 +248,7 @@ DEFUN_HIDDEN (ospf_router_id_old, ret = inet_aton (argv[idx_ipv4]->arg, &router_id); if (!ret) { - vty_out (vty, "Please specify Router ID by A.B.C.D%s", VTYNL); + vty_out (vty, "Please specify Router ID by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -258,7 +258,7 @@ DEFUN_HIDDEN (ospf_router_id_old, if (area->full_nbrs) { vty_out (vty, "For this router-id change to take effect," - " save config and restart ospfd%s", VTYNL); + " save config and restart ospfd\n"); return CMD_SUCCESS; } @@ -285,7 +285,7 @@ DEFUN (no_ospf_router_id, if (area->full_nbrs) { vty_out (vty, "For this router-id change to take effect," - " save config and restart ospfd%s", VTYNL); + " save config and restart ospfd\n"); return CMD_SUCCESS; } @@ -389,8 +389,7 @@ DEFUN (ospf_passive_interface, ret = inet_aton(argv[idx_ipv4]->arg, &addr); if (!ret) { - vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTYNL); + vty_out (vty, "Please specify interface address by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -459,8 +458,7 @@ DEFUN (no_ospf_passive_interface, ret = inet_aton(argv[idx_ipv4]->arg, &addr); if (!ret) { - vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTYNL); + vty_out (vty, "Please specify interface address by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -510,15 +508,13 @@ DEFUN (ospf_network_area, if (ospf->instance) { - vty_out (vty, "The network command is not supported in multi-instance ospf%s", - VTYNL); + vty_out (vty, "The network command is not supported in multi-instance ospf\n"); return CMD_WARNING_CONFIG_FAILED; } if (ospf->if_ospf_cli_count > 0) { - vty_out (vty, "Please remove all ip ospf area x.x.x.x commands first.%s", - VTYNL); + vty_out (vty, "Please remove all ip ospf area x.x.x.x commands first.\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -529,7 +525,7 @@ DEFUN (ospf_network_area, ret = ospf_network_set (ospf, &p, area_id, format); if (ret == 0) { - vty_out (vty, "There is already same network statement.%s", VTYNL); + vty_out (vty, "There is already same network statement.\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -555,8 +551,7 @@ DEFUN (no_ospf_network_area, if (ospf->instance) { - vty_out (vty, "The network command is not supported in multi-instance ospf%s", - VTYNL); + vty_out (vty, "The network command is not supported in multi-instance ospf\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -567,8 +562,7 @@ DEFUN (no_ospf_network_area, ret = ospf_network_unset (ospf, &p, area_id); if (ret == 0) { - vty_out (vty, "Can't find specified network area configuration.%s", - VTYNL); + vty_out (vty, "Can't find specified network area configuration.\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -812,8 +806,7 @@ ospf_find_vl_data (struct ospf *ospf, struct ospf_vl_config_data *vl_config) if (area_id.s_addr == OSPF_AREA_BACKBONE) { vty_out (vty, - "Configuring VLs over the backbone is not allowed%s", - VTYNL); + "Configuring VLs over the backbone is not allowed\n"); return NULL; } area = ospf_area_get (ospf, area_id); @@ -822,15 +815,13 @@ ospf_find_vl_data (struct ospf *ospf, struct ospf_vl_config_data *vl_config) if (area->external_routing != OSPF_AREA_DEFAULT) { if (vl_config->area_id_fmt == OSPF_AREA_ID_FMT_DOTTEDQUAD) - vty_out (vty, "Area %s is %s%s", + vty_out (vty, "Area %s is %s\n", inet_ntoa (area_id), - area->external_routing == OSPF_AREA_NSSA?"nssa":"stub", - VTYNL); + area->external_routing == OSPF_AREA_NSSA?"nssa":"stub"); else - vty_out (vty, "Area %ld is %s%s", + vty_out (vty, "Area %ld is %s\n", (u_long)ntohl (area_id.s_addr), - area->external_routing == OSPF_AREA_NSSA?"nssa":"stub", - VTYNL); + area->external_routing == OSPF_AREA_NSSA?"nssa":"stub"); return NULL; } @@ -875,8 +866,8 @@ ospf_vl_set_security (struct ospf_vl_data *vl_data, if (ospf_crypt_key_lookup (IF_DEF_PARAMS (ifp)->auth_crypt, vl_config->crypto_key_id) != NULL) { - vty_out (vty, "OSPF: Key %d already exists%s", - vl_config->crypto_key_id, VTYNL); + vty_out (vty, "OSPF: Key %d already exists\n", + vl_config->crypto_key_id); return CMD_WARNING_CONFIG_FAILED; } ck = ospf_crypt_key_new (); @@ -893,8 +884,8 @@ ospf_vl_set_security (struct ospf_vl_data *vl_data, if (ospf_crypt_key_lookup (IF_DEF_PARAMS (ifp)->auth_crypt, vl_config->crypto_key_id) == NULL) { - vty_out (vty, "OSPF: Key %d does not exist%s", - vl_config->crypto_key_id, VTYNL); + vty_out (vty, "OSPF: Key %d does not exist\n", + vl_config->crypto_key_id); return CMD_WARNING_CONFIG_FAILED; } @@ -1037,15 +1028,14 @@ DEFUN (ospf_area_vlink, &vl_config.area_id_fmt); if (ret < 0) { - vty_out (vty, "OSPF area ID is invalid%s", VTYNL); + vty_out (vty, "OSPF area ID is invalid\n"); return CMD_WARNING_CONFIG_FAILED; } ret = inet_aton (argv[idx_ipv4]->arg, &vl_config.vl_peer); if (! ret) { - vty_out (vty, "Please specify valid Router ID as a.b.c.d%s", - VTYNL); + vty_out (vty, "Please specify valid Router ID as a.b.c.d\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1060,7 +1050,7 @@ DEFUN (ospf_area_vlink, for (i=5; i < argc; i++) { - /* vty_out (vty, "argv[%d]->arg - %s%s", i, argv[i]->text, VTYNL); */ + /* vty_out (vty, "argv[%d]->arg - %s\n", i, argv[i]->text); */ switch (argv[i]->arg[0]) { @@ -1157,22 +1147,21 @@ DEFUN (no_ospf_area_vlink, ret = str2area_id (argv[idx_ipv4_number]->arg, &vl_config.area_id, &format); if (ret < 0) { - vty_out (vty, "OSPF area ID is invalid%s", VTYNL); + vty_out (vty, "OSPF area ID is invalid\n"); return CMD_WARNING_CONFIG_FAILED; } area = ospf_area_lookup_by_area_id (ospf, vl_config.area_id); if (!area) { - vty_out (vty, "Area does not exist%s", VTYNL); + vty_out (vty, "Area does not exist\n"); return CMD_WARNING_CONFIG_FAILED; } ret = inet_aton (argv[idx_ipv4]->arg, &vl_config.vl_peer); if (! ret) { - vty_out (vty, "Please specify valid Router ID as a.b.c.d%s", - VTYNL); + vty_out (vty, "Please specify valid Router ID as a.b.c.d\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1193,7 +1182,7 @@ DEFUN (no_ospf_area_vlink, /* Deal with other parameters */ for (i=6; i < argc; i++) { - /* vty_out (vty, "argv[%d] - %s%s", i, argv[i], VTYNL); */ + /* vty_out (vty, "argv[%d] - %s\n", i, argv[i]); */ switch (argv[i]->arg[0]) { @@ -1257,14 +1246,14 @@ DEFUN (ospf_area_vlink_intervals, ret = str2area_id (area_id, &vl_config.area_id, &vl_config.area_id_fmt); if (ret < 0) { - vty_out (vty, "OSPF area ID is invalid%s", VTYNL); + vty_out (vty, "OSPF area ID is invalid\n"); return CMD_WARNING_CONFIG_FAILED; } ret = inet_aton (router_id, &vl_config.vl_peer); if (! ret) { - vty_out (vty, "Please specify valid Router ID as a.b.c.d%s", VTYNL); + vty_out (vty, "Please specify valid Router ID as a.b.c.d\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1303,14 +1292,14 @@ DEFUN (no_ospf_area_vlink_intervals, ret = str2area_id (area_id, &vl_config.area_id, &vl_config.area_id_fmt); if (ret < 0) { - vty_out (vty, "OSPF area ID is invalid%s", VTYNL); + vty_out (vty, "OSPF area ID is invalid\n"); return CMD_WARNING_CONFIG_FAILED; } ret = inet_aton (router_id, &vl_config.vl_peer); if (! ret) { - vty_out (vty, "Please specify valid Router ID as a.b.c.d%s", VTYNL); + vty_out (vty, "Please specify valid Router ID as a.b.c.d\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1367,8 +1356,7 @@ DEFUN (ospf_area_shortcut, if (ospf->abr_type != OSPF_ABR_SHORTCUT) vty_out (vty, "Shortcut area setting will take effect " - "only when the router is configured as Shortcut ABR%s", - VTYNL); + "only when the router is configured as Shortcut ABR\n"); return CMD_SUCCESS; } @@ -1421,8 +1409,7 @@ DEFUN (ospf_area_stub, ospf_area_display_format_set (ospf, ospf_area_get (ospf, area_id), format); if (ret == 0) { - vty_out (vty, "First deconfigure all virtual link through this area%s", - VTYNL); + vty_out (vty, "First deconfigure all virtual link through this area\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1451,8 +1438,7 @@ DEFUN (ospf_area_stub_no_summary, ospf_area_display_format_set (ospf, ospf_area_get (ospf, area_id), format); if (ret == 0) { - vty_out (vty, "%% Area cannot be stub as it contains a virtual link%s", - VTYNL); + vty_out (vty, "%% Area cannot be stub as it contains a virtual link\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1518,8 +1504,7 @@ ospf_area_nssa_cmd_handler (struct vty *vty, int argc, struct cmd_token **argv, ospf_area_display_format_set (ospf, ospf_area_get (ospf, area_id), format); if (ret == 0) { - vty_out (vty, "%% Area cannot be nssa as it contains a virtual link%s", - VTYNL); + vty_out (vty, "%% Area cannot be nssa as it contains a virtual link\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1658,7 +1643,7 @@ DEFUN (ospf_area_default_cost, if (area->external_routing == OSPF_AREA_DEFAULT) { - vty_out (vty, "The area is neither stub, nor NSSA%s", VTYNL); + vty_out (vty, "The area is neither stub, nor NSSA\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1701,7 +1686,7 @@ DEFUN (no_ospf_area_default_cost, if (area->external_routing == OSPF_AREA_DEFAULT) { - vty_out (vty, "The area is neither stub, nor NSSA%s", VTYNL); + vty_out (vty, "The area is neither stub, nor NSSA\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2205,7 +2190,7 @@ DEFUN (ospf_timers_min_ls_interval, if (argc < 5) { - vty_out (vty, "Insufficient arguments%s", VTYNL); + vty_out (vty, "Insufficient arguments\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2247,7 +2232,7 @@ DEFUN (ospf_timers_min_ls_arrival, if (argc < 4) { - vty_out (vty, "Insufficient arguments%s", VTYNL); + vty_out (vty, "Insufficient arguments\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2292,7 +2277,7 @@ DEFUN (ospf_timers_throttle_spf, if (argc < 6) { - vty_out (vty, "Insufficient arguments%s", VTYNL); + vty_out (vty, "Insufficient arguments\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2335,7 +2320,7 @@ DEFUN (ospf_timers_lsa, if (argc < 4) { - vty_out (vty, "Insufficient number of arguments%s", VTYNL); + vty_out (vty, "Insufficient number of arguments\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2549,7 +2534,7 @@ DEFUN (ospf_auto_cost_reference_bandwidth, refbw = strtol (argv[idx_number]->arg, NULL, 10); if (refbw < 1 || refbw > 4294967) { - vty_out (vty, "reference-bandwidth value is invalid%s", VTYNL); + vty_out (vty, "reference-bandwidth value is invalid\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2580,8 +2565,8 @@ DEFUN (no_ospf_auto_cost_reference_bandwidth, return CMD_SUCCESS; ospf->ref_bandwidth = OSPF_DEFAULT_REF_BANDWIDTH; - vty_out (vty, "%% OSPF: Reference bandwidth is changed.%s", VTYNL); - vty_out (vty, " Please ensure reference bandwidth is consistent across all routers%s", VTYNL); + vty_out (vty, "%% OSPF: Reference bandwidth is changed.\n"); + vty_out (vty, " Please ensure reference bandwidth is consistent across all routers\n"); for (ALL_LIST_ELEMENTS (om->iflist, node, nnode, ifp)) ospf_if_recalculate_output_cost (ifp); @@ -2608,7 +2593,7 @@ DEFUN (ospf_write_multiplier, write_oi_count = strtol (argv[idx_number]->arg, NULL, 10); if (write_oi_count < 1 || write_oi_count > 100) { - vty_out (vty, "write-multiplier value is invalid%s", VTYNL); + vty_out (vty, "write-multiplier value is invalid\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2677,7 +2662,7 @@ show_ip_ospf_area (struct vty *vty, struct ospf_area *area, json_object *json_ar if (use_json) json_object_boolean_true_add(json_area, "backbone"); else - vty_out (vty, " (Backbone)%s", VTYNL); + vty_out (vty, " (Backbone)\n"); } else { @@ -2714,11 +2699,11 @@ show_ip_ospf_area (struct vty *vty, struct ospf_area *area, json_object *json_ar area->no_summary ? ", no summary" : "", area->shortcut_configured ? "; " : ""); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); vty_out (vty, " Shortcutting mode: %s", ospf_shortcut_mode_descr_str[area->shortcut_configured]); - vty_out (vty, ", S-bit consensus: %s%s", - area->shortcut_capability ? "ok" : "no", VTYNL); + vty_out (vty, ", S-bit consensus: %s\n", + area->shortcut_capability ? "ok" : "no"); } } @@ -2730,8 +2715,8 @@ show_ip_ospf_area (struct vty *vty, struct ospf_area *area, json_object *json_ar } else vty_out (vty, " Number of interfaces in this area: Total: %d, " - "Active: %d%s", listcount (area->oiflist), - area->act_ints, VTYNL); + "Active: %d\n", listcount (area->oiflist), + area->act_ints); if (area->external_routing == OSPF_AREA_NSSA) { @@ -2759,29 +2744,24 @@ show_ip_ospf_area (struct vty *vty, struct ospf_area *area, json_object *json_ar } else { - vty_out (vty, " It is an NSSA configuration. %s Elected NSSA/ABR performs type-7/type-5 LSA translation. %s", VTYNL, VTYNL); + vty_out (vty, " It is an NSSA configuration. \n Elected NSSA/ABR performs type-7/type-5 LSA translation. \n"); if (! IS_OSPF_ABR (area->ospf)) - vty_out (vty, " It is not ABR, therefore not Translator. %s", - VTYNL); + vty_out (vty, " It is not ABR, therefore not Translator. \n"); else if (area->NSSATranslatorState) { vty_out (vty, " We are an ABR and "); if (area->NSSATranslatorRole == OSPF_NSSA_ROLE_CANDIDATE) - vty_out (vty, "the NSSA Elected Translator. %s", - VTYNL); + vty_out (vty, "the NSSA Elected Translator. \n"); else if (area->NSSATranslatorRole == OSPF_NSSA_ROLE_ALWAYS) - vty_out (vty, "always an NSSA Translator. %s", - VTYNL); + vty_out (vty, "always an NSSA Translator. \n"); } else { vty_out (vty, " We are an ABR, but "); if (area->NSSATranslatorRole == OSPF_NSSA_ROLE_CANDIDATE) - vty_out (vty, "not the NSSA Elected Translator. %s", - VTYNL); + vty_out (vty, "not the NSSA Elected Translator. \n"); else - vty_out (vty, "never an NSSA Translator. %s", - VTYNL); + vty_out (vty, "never an NSSA Translator. \n"); } } } @@ -2805,15 +2785,13 @@ show_ip_ospf_area (struct vty *vty, struct ospf_area *area, json_object *json_ar } else { - vty_out (vty, " Originating stub / maximum-distance Router-LSA%s", - VTYNL); + vty_out (vty, " Originating stub / maximum-distance Router-LSA\n"); if (CHECK_FLAG(area->stub_router_state, OSPF_AREA_ADMIN_STUB_ROUTED)) - vty_out (vty, " Administratively activated (indefinitely)%s", - VTYNL); + vty_out (vty, " Administratively activated (indefinitely)\n"); if (area->t_stub_router) - vty_out (vty, " Active from startup, %s remaining%s", + vty_out (vty, " Active from startup, %s remaining\n", ospf_timer_dump (area->t_stub_router, timebuf, - sizeof(timebuf)), VTYNL); + sizeof(timebuf))); } } @@ -2851,42 +2829,42 @@ show_ip_ospf_area (struct vty *vty, struct ospf_area *area, json_object *json_ar { /* Show number of fully adjacent neighbors. */ vty_out (vty, " Number of fully adjacent neighbors in this area:" - " %d%s", area->full_nbrs, VTYNL); + " %d\n", area->full_nbrs); /* Show authentication type. */ vty_out (vty, " Area has "); if (area->auth_type == OSPF_AUTH_NULL) - vty_out (vty, "no authentication%s", VTYNL); + vty_out (vty, "no authentication\n"); else if (area->auth_type == OSPF_AUTH_SIMPLE) - vty_out (vty, "simple password authentication%s", VTYNL); + vty_out (vty, "simple password authentication\n"); else if (area->auth_type == OSPF_AUTH_CRYPTOGRAPHIC) - vty_out (vty, "message digest authentication%s", VTYNL); + vty_out (vty, "message digest authentication\n"); if (!OSPF_IS_AREA_BACKBONE (area)) vty_out (vty, " Number of full virtual adjacencies going through" - " this area: %d%s", area->full_vls, VTYNL); + " this area: %d\n", area->full_vls); /* Show SPF calculation times. */ - vty_out (vty, " SPF algorithm executed %d times%s", - area->spf_calculation, VTYNL); + vty_out (vty, " SPF algorithm executed %d times\n", + area->spf_calculation); /* Show number of LSA. */ - vty_out (vty, " Number of LSA %ld%s", area->lsdb->total, VTYNL); - vty_out (vty, " Number of router LSA %ld. Checksum Sum 0x%08x%s", + vty_out (vty, " Number of LSA %ld\n", area->lsdb->total); + vty_out (vty, " Number of router LSA %ld. Checksum Sum 0x%08x\n", ospf_lsdb_count (area->lsdb, OSPF_ROUTER_LSA), - ospf_lsdb_checksum (area->lsdb, OSPF_ROUTER_LSA), VTYNL); - vty_out (vty, " Number of network LSA %ld. Checksum Sum 0x%08x%s", + ospf_lsdb_checksum (area->lsdb, OSPF_ROUTER_LSA)); + vty_out (vty, " Number of network LSA %ld. Checksum Sum 0x%08x\n", ospf_lsdb_count (area->lsdb, OSPF_NETWORK_LSA), - ospf_lsdb_checksum (area->lsdb, OSPF_NETWORK_LSA), VTYNL); - vty_out (vty, " Number of summary LSA %ld. Checksum Sum 0x%08x%s", + ospf_lsdb_checksum (area->lsdb, OSPF_NETWORK_LSA)); + vty_out (vty, " Number of summary LSA %ld. Checksum Sum 0x%08x\n", ospf_lsdb_count (area->lsdb, OSPF_SUMMARY_LSA), - ospf_lsdb_checksum (area->lsdb, OSPF_SUMMARY_LSA), VTYNL); - vty_out (vty, " Number of ASBR summary LSA %ld. Checksum Sum 0x%08x%s", + ospf_lsdb_checksum (area->lsdb, OSPF_SUMMARY_LSA)); + vty_out (vty, " Number of ASBR summary LSA %ld. Checksum Sum 0x%08x\n", ospf_lsdb_count (area->lsdb, OSPF_ASBR_SUMMARY_LSA), - ospf_lsdb_checksum (area->lsdb, OSPF_ASBR_SUMMARY_LSA), VTYNL); - vty_out (vty, " Number of NSSA LSA %ld. Checksum Sum 0x%08x%s", + ospf_lsdb_checksum (area->lsdb, OSPF_ASBR_SUMMARY_LSA)); + vty_out (vty, " Number of NSSA LSA %ld. Checksum Sum 0x%08x\n", ospf_lsdb_count (area->lsdb, OSPF_AS_NSSA_LSA), - ospf_lsdb_checksum (area->lsdb, OSPF_AS_NSSA_LSA), VTYNL); + ospf_lsdb_checksum (area->lsdb, OSPF_AS_NSSA_LSA)); } if (use_json) @@ -2898,18 +2876,18 @@ show_ip_ospf_area (struct vty *vty, struct ospf_area *area, json_object *json_ar } else { - vty_out (vty, " Number of opaque link LSA %ld. Checksum Sum 0x%08x%s", + vty_out (vty, " Number of opaque link LSA %ld. Checksum Sum 0x%08x\n", ospf_lsdb_count (area->lsdb, OSPF_OPAQUE_LINK_LSA), - ospf_lsdb_checksum (area->lsdb, OSPF_OPAQUE_LINK_LSA), VTYNL); - vty_out (vty, " Number of opaque area LSA %ld. Checksum Sum 0x%08x%s", + ospf_lsdb_checksum (area->lsdb, OSPF_OPAQUE_LINK_LSA)); + vty_out (vty, " Number of opaque area LSA %ld. Checksum Sum 0x%08x\n", ospf_lsdb_count (area->lsdb, OSPF_OPAQUE_AREA_LSA), - ospf_lsdb_checksum (area->lsdb, OSPF_OPAQUE_AREA_LSA), VTYNL); + ospf_lsdb_checksum (area->lsdb, OSPF_OPAQUE_AREA_LSA)); } if (use_json) json_object_object_add(json_areas, inet_ntoa (area->area_id), json_area); else - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } static int @@ -2936,8 +2914,7 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) } else { - vty_out (vty, "%sOSPF Instance: %d%s%s", VTYNL, ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); } } @@ -2948,9 +2925,8 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) } else { - vty_out (vty, " OSPF Routing Process, Router ID: %s%s", - inet_ntoa (ospf->router_id), - VTYNL); + vty_out (vty, " OSPF Routing Process, Router ID: %s\n", + inet_ntoa (ospf->router_id)); } /* Graceful shutdown */ @@ -2964,9 +2940,9 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) } else { - vty_out (vty, " Deferred shutdown in progress, %s remaining%s", + vty_out (vty, " Deferred shutdown in progress, %s remaining\n", ospf_timer_dump (ospf->t_deferred_shutdown, - timebuf, sizeof (timebuf)), VTYNL); + timebuf, sizeof (timebuf))); } } @@ -2982,11 +2958,11 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) } else { - vty_out (vty, " Supports only single TOS (TOS0) routes%s", VTYNL); - vty_out (vty, " This implementation conforms to RFC2328%s", VTYNL); - vty_out (vty, " RFC1583Compatibility flag is %s%s", + vty_out (vty, " Supports only single TOS (TOS0) routes\n"); + vty_out (vty, " This implementation conforms to RFC2328\n"); + vty_out (vty, " RFC1583Compatibility flag is %s\n", CHECK_FLAG (ospf->config, OSPF_RFC1583_COMPATIBLE) ? - "enabled" : "disabled", VTYNL); + "enabled" : "disabled"); } if (use_json) @@ -2998,9 +2974,8 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) } else { - vty_out (vty, " OpaqueCapability flag is %s%s", - CHECK_FLAG (ospf->config, OSPF_OPAQUE_CAPABLE) ? "enabled" : "disabled", - VTYNL); + vty_out (vty, " OpaqueCapability flag is %s\n", + CHECK_FLAG (ospf->config, OSPF_OPAQUE_CAPABLE) ? "enabled" : "disabled"); } /* Show stub-router configuration */ @@ -3017,14 +2992,13 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) } else { - vty_out (vty, " Stub router advertisement is configured%s", - VTYNL); + vty_out (vty, " Stub router advertisement is configured\n"); if (ospf->stub_router_startup_time != OSPF_STUB_ROUTER_UNCONFIGURED) - vty_out (vty, " Enabled for %us after start-up%s", - ospf->stub_router_startup_time, VTYNL); + vty_out (vty, " Enabled for %us after start-up\n", + ospf->stub_router_startup_time); if (ospf->stub_router_shutdown_time != OSPF_STUB_ROUTER_UNCONFIGURED) - vty_out (vty, " Enabled for %us prior to full shutdown%s", - ospf->stub_router_shutdown_time, VTYNL); + vty_out (vty, " Enabled for %us prior to full shutdown\n", + ospf->stub_router_shutdown_time); } } @@ -3038,14 +3012,14 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) } else { - vty_out (vty, " Initial SPF scheduling delay %d millisec(s)%s" - " Minimum hold time between consecutive SPFs %d millisec(s)%s" - " Maximum hold time between consecutive SPFs %d millisec(s)%s" - " Hold time multiplier is currently %d%s", - ospf->spf_delay, VTYNL, - ospf->spf_holdtime, VTYNL, - ospf->spf_max_holdtime, VTYNL, - ospf->spf_hold_multiplier, VTYNL); + vty_out (vty, " Initial SPF scheduling delay %d millisec(s)\n" + " Minimum hold time between consecutive SPFs %d millisec(s)\n" + " Maximum hold time between consecutive SPFs %d millisec(s)\n" + " Hold time multiplier is currently %d\n", + ospf->spf_delay, + ospf->spf_holdtime, + ospf->spf_max_holdtime, + ospf->spf_hold_multiplier); } if (use_json) @@ -3069,15 +3043,13 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) if (ospf->ts_spf.tv_sec || ospf->ts_spf.tv_usec) { monotime_since(&ospf->ts_spf, &result); - vty_out (vty, "last executed %s ago%s", - ospf_timeval_dump (&result, timebuf, sizeof (timebuf)), - VTYNL); - vty_out (vty, " Last SPF duration %s%s", - ospf_timeval_dump (&ospf->ts_spf_duration, timebuf, sizeof (timebuf)), - VTYNL); + vty_out (vty, "last executed %s ago\n", + ospf_timeval_dump (&result, timebuf, sizeof (timebuf))); + vty_out (vty, " Last SPF duration %s\n", + ospf_timeval_dump (&ospf->ts_spf_duration, timebuf, sizeof (timebuf))); } else - vty_out (vty, "has not been run%s", VTYNL); + vty_out (vty, "has not been run\n"); } if (use_json) @@ -3098,23 +3070,22 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) } else { - vty_out (vty, " SPF timer %s%s%s", + vty_out (vty, " SPF timer %s%s\n", (ospf->t_spf_calc ? "due in " : "is "), - ospf_timer_dump (ospf->t_spf_calc, timebuf, sizeof (timebuf)), - VTYNL); + ospf_timer_dump (ospf->t_spf_calc, timebuf, sizeof (timebuf))); - vty_out (vty, " LSA minimum interval %d msecs%s", - ospf->min_ls_interval, VTYNL); - vty_out (vty, " LSA minimum arrival %d msecs%s", - ospf->min_ls_arrival, VTYNL); + vty_out (vty, " LSA minimum interval %d msecs\n", + ospf->min_ls_interval); + vty_out (vty, " LSA minimum arrival %d msecs\n", + ospf->min_ls_arrival); /* Show write multiplier values */ - vty_out (vty, " Write Multiplier set to %d %s", - ospf->write_oi_count, VTYNL); + vty_out (vty, " Write Multiplier set to %d \n", + ospf->write_oi_count); /* Show refresh parameters. */ - vty_out (vty, " Refresh timer %d secs%s", - ospf->lsa_refresh_interval, VTYNL); + vty_out (vty, " Refresh timer %d secs\n", + ospf->lsa_refresh_interval); } /* Show ABR/ASBR flags. */ @@ -3123,8 +3094,8 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) if (use_json) json_object_string_add(json, "abrType", ospf_abr_type_descr_str[ospf->abr_type]); else - vty_out (vty, " This router is an ABR, ABR type is: %s%s", - ospf_abr_type_descr_str[ospf->abr_type], VTYNL); + vty_out (vty, " This router is an ABR, ABR type is: %s\n", + ospf_abr_type_descr_str[ospf->abr_type]); } if (CHECK_FLAG (ospf->flags, OSPF_FLAG_ASBR)) { @@ -3132,7 +3103,7 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) json_object_string_add(json, "asbrRouter", "injectingExternalRoutingInformation"); else vty_out (vty, " This router is an ASBR " - "(injecting external routing information)%s", VTYNL); + "(injecting external routing information)\n"); } /* Show Number of AS-external-LSAs. */ @@ -3145,9 +3116,9 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) } else { - vty_out (vty, " Number of external LSA %ld. Checksum Sum 0x%08x%s", + vty_out (vty, " Number of external LSA %ld. Checksum Sum 0x%08x\n", ospf_lsdb_count (ospf->lsdb, OSPF_AS_EXTERNAL_LSA), - ospf_lsdb_checksum (ospf->lsdb, OSPF_AS_EXTERNAL_LSA), VTYNL); + ospf_lsdb_checksum (ospf->lsdb, OSPF_AS_EXTERNAL_LSA)); } if (use_json) @@ -3159,17 +3130,17 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) } else { - vty_out (vty, " Number of opaque AS LSA %ld. Checksum Sum 0x%08x%s", + vty_out (vty, " Number of opaque AS LSA %ld. Checksum Sum 0x%08x\n", ospf_lsdb_count (ospf->lsdb, OSPF_OPAQUE_AS_LSA), - ospf_lsdb_checksum (ospf->lsdb, OSPF_OPAQUE_AS_LSA), VTYNL); + ospf_lsdb_checksum (ospf->lsdb, OSPF_OPAQUE_AS_LSA)); } /* Show number of areas attached. */ if (use_json) json_object_int_add(json, "attachedAreaCounter", listcount (ospf->areas)); else - vty_out (vty, " Number of areas attached to this router: %d%s", - listcount (ospf->areas), VTYNL); + vty_out (vty, " Number of areas attached to this router: %d\n", + listcount (ospf->areas)); if (CHECK_FLAG(ospf->config, OSPF_LOG_ADJACENCY_CHANGES)) { @@ -3178,14 +3149,14 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) if (use_json) json_object_boolean_true_add(json, "adjacencyChangesLoggedAll"); else - vty_out(vty, " All adjacency changes are logged%s",VTYNL); + vty_out(vty, " All adjacency changes are logged\n"); } else { if (use_json) json_object_boolean_true_add(json, "adjacencyChangesLogged"); else - vty_out(vty, " Adjacency changes are logged%s",VTYNL); + vty_out(vty, " Adjacency changes are logged\n"); } } /* Show each area status. */ @@ -3195,11 +3166,11 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) if (use_json) { json_object_object_add(json, "areas", json_areas); - vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL); + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else - vty_out (vty, "%s",VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -3267,9 +3238,9 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface } else { - vty_outln (vty, "%s is %s", ifp->name, + vty_out (vty, "%s is %s\n", ifp->name, ((is_up = if_is_operative(ifp)) ? "up" : "down")); - vty_outln (vty, " ifindex %u, MTU %u bytes, BW %u Mbit %s", + vty_out (vty, " ifindex %u, MTU %u bytes, BW %u Mbit %s\n", ifp->ifindex, ifp->mtu, bandwidth, if_flag_dump(ifp->flags)); } @@ -3293,13 +3264,12 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface { if (ospf_oi_count(ifp) == 0) { - vty_out (vty, " OSPF not enabled on this interface%s", VTYNL); + vty_out (vty, " OSPF not enabled on this interface\n"); return; } else if (!is_up) { - vty_out (vty, " OSPF is enabled, but not running on this interface%s", - VTYNL); + vty_out (vty, " OSPF is enabled, but not running on this interface\n"); return; } } @@ -3375,16 +3345,16 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface } else { - vty_outln (vty, " Area %s", ospf_area_desc_string (oi->area)); + vty_out (vty, " Area %s\n", ospf_area_desc_string (oi->area)); - vty_outln (vty, " MTU mismatch detection: %s", + vty_out (vty, " MTU mismatch detection: %s\n", OSPF_IF_PARAM(oi, mtu_ignore) ? "disabled" : "enabled"); - vty_outln (vty, " Router ID %s, Network Type %s, Cost: %d", + vty_out (vty, " Router ID %s, Network Type %s, Cost: %d\n", inet_ntoa (ospf->router_id), ospf_network_type_str[oi->type], oi->output_cost); - vty_outln (vty, " Transmit Delay is %d sec, State %s, Priority %d", + vty_out (vty, " Transmit Delay is %d sec, State %s, Priority %d\n", OSPF_IF_PARAM (oi,transmit_delay), lookup_msg(ospf_ism_state_msg, oi->state, NULL), PRIORITY (oi)); } @@ -3393,7 +3363,7 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface if (DR (oi).s_addr == 0) { if (!use_json) - vty_outln (vty, " No backup designated router on this network"); + vty_out (vty, " No backup designated router on this network\n"); } else { @@ -3401,7 +3371,7 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface if (nbr == NULL) { if (!use_json) - vty_outln (vty, " No backup designated router on this network"); + vty_out (vty, " No backup designated router on this network\n"); } else { @@ -3414,7 +3384,7 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface { vty_out (vty, " Backup Designated Router (ID) %s,", inet_ntoa (nbr->router_id)); - vty_outln (vty, " Interface Address %s", + vty_out (vty, " Interface Address %s\n", inet_ntoa (nbr->address.u.prefix4)); } } @@ -3426,8 +3396,8 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface if (use_json) json_object_int_add(json_interface_sub, "networkLsaSequence", ntohl (oi->params->network_lsa_seqnum)); else - vty_out (vty, " Saved Network-LSA sequence number 0x%x%s", - ntohl (oi->params->network_lsa_seqnum), VTYNL); + vty_out (vty, " Saved Network-LSA sequence number 0x%x\n", + ntohl (oi->params->network_lsa_seqnum)); } if (use_json) @@ -3454,7 +3424,7 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface } else vty_out (vty, " <None>"); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } if (use_json) @@ -3475,11 +3445,10 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface vty_out (vty, "%ds,", OSPF_IF_PARAM (oi, v_hello)); else vty_out (vty, "%dms,", 1000 / OSPF_IF_PARAM (oi, fast_hello)); - vty_out (vty, " Dead %ds, Wait %ds, Retransmit %d%s", + vty_out (vty, " Dead %ds, Wait %ds, Retransmit %d\n", OSPF_IF_PARAM (oi, v_wait), OSPF_IF_PARAM (oi, v_wait), - OSPF_IF_PARAM (oi, retransmit_interval), - VTYNL); + OSPF_IF_PARAM (oi, retransmit_interval)); } if (OSPF_IF_PASSIVE_STATUS (oi) == OSPF_IF_ACTIVE) @@ -3493,16 +3462,15 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface json_object_int_add(json_interface_sub, "timerHelloInMsecs", time_store); } else - vty_out (vty, " Hello due in %s%s", - ospf_timer_dump (oi->t_hello, timebuf, sizeof(timebuf)), - VTYNL); + vty_out (vty, " Hello due in %s\n", + ospf_timer_dump (oi->t_hello, timebuf, sizeof(timebuf))); } else /* passive-interface is set */ { if (use_json) json_object_boolean_true_add(json_interface_sub, "timerPassiveIface"); else - vty_out (vty, " No Hellos (Passive interface)%s", VTYNL); + vty_out (vty, " No Hellos (Passive interface)\n"); } if (use_json) @@ -3511,9 +3479,8 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface json_object_int_add(json_interface_sub, "nbrAdjacentCount", ospf_nbr_count (oi, NSM_Full)); } else - vty_out (vty, " Neighbor Count is %d, Adjacent neighbor count is %d%s", - ospf_nbr_count (oi, 0), ospf_nbr_count (oi, NSM_Full), - VTYNL); + vty_out (vty, " Neighbor Count is %d, Adjacent neighbor count is %d\n", + ospf_nbr_count (oi, 0), ospf_nbr_count (oi, NSM_Full)); ospf_bfd_interface_show(vty, ifp, json_interface_sub, use_json); } } @@ -3537,8 +3504,7 @@ show_ip_ospf_interface_common (struct vty *vty, struct ospf *ospf, int argc, if (use_json) json_object_int_add(json, "ospfInstance", ospf->instance); else - vty_out (vty, "%sOSPF Instance: %d%s%s", VTYNL, ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); } if (argc == iface_argv) @@ -3566,7 +3532,7 @@ show_ip_ospf_interface_common (struct vty *vty, struct ospf *ospf, int argc, if (use_json) json_object_boolean_true_add(json, "noSuchIface"); else - vty_out (vty, "No such interface name%s", VTYNL); + vty_out (vty, "No such interface name\n"); } else { @@ -3582,11 +3548,11 @@ show_ip_ospf_interface_common (struct vty *vty, struct ospf *ospf, int argc, if (use_json) { - vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL); + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -3642,11 +3608,9 @@ DEFUN (show_ip_ospf_instance_interface, static void show_ip_ospf_neighbour_header (struct vty *vty) { - vty_out (vty, "%s%-15s %3s %-15s %9s %-15s %-20s %5s %5s %5s%s", - VTYNL, + vty_out (vty, "\n%-15s %3s %-15s %9s %-15s %-20s %5s %5s %5s\n", "Neighbor ID", "Pri", "State", "Dead Time", - "Address", "Interface", "RXmtL", "RqstL", "DBsmL", - VTYNL); + "Address", "Interface", "RXmtL", "RqstL", "DBsmL"); } static void @@ -3707,10 +3671,9 @@ show_ip_ospf_neighbor_sub (struct vty *vty, struct ospf_interface *oi, json_obje ospf_timer_dump (nbr->t_inactivity, timebuf, sizeof(timebuf))); vty_out (vty, "%-15s ", inet_ntoa (nbr->src)); - vty_out (vty, "%-20s %5ld %5ld %5d%s", + vty_out (vty, "%-20s %5ld %5ld %5d\n", IF_NAME (oi), ospf_ls_retransmit_count (nbr), - ospf_ls_request_count (nbr), ospf_db_summary_count (nbr), - VTYNL); + ospf_ls_request_count (nbr), ospf_db_summary_count (nbr)); } } } @@ -3735,8 +3698,7 @@ show_ip_ospf_neighbor_common (struct vty *vty, struct ospf *ospf, u_char use_jso if (use_json) json_object_int_add(json, "ospfInstance", ospf->instance); else - vty_out (vty, "%sOSPF Instance: %d%s%s", VTYNL, ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); } for (ALL_LIST_ELEMENTS_RO (ospf->oiflist, node, oi)) @@ -3744,11 +3706,11 @@ show_ip_ospf_neighbor_common (struct vty *vty, struct ospf *ospf, u_char use_jso if (use_json) { - vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL); + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -3815,8 +3777,7 @@ show_ip_ospf_neighbor_all_common (struct vty *vty, struct ospf *ospf, u_char use if (use_json) json_object_int_add(json, "ospfInstance", ospf->instance); else - vty_out (vty, "%sOSPF Instance: %d%s%s", VTYNL, ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); } for (ALL_LIST_ELEMENTS_RO (ospf->oiflist, node, oi)) @@ -3846,9 +3807,9 @@ show_ip_ospf_neighbor_all_common (struct vty *vty, struct ospf *ospf, u_char use { vty_out (vty, "%-15s %3d %-15s %9s ", "-", nbr_nbma->priority, "Down", "-"); - vty_out (vty, "%-15s %-20s %5d %5d %5d%s", + vty_out (vty, "%-15s %-20s %5d %5d %5d\n", inet_ntoa (nbr_nbma->addr), IF_NAME (oi), - 0, 0, 0, VTYNL); + 0, 0, 0); } } } @@ -3856,11 +3817,11 @@ show_ip_ospf_neighbor_all_common (struct vty *vty, struct ospf *ospf, u_char use if (use_json) { - vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL); + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -3925,8 +3886,7 @@ show_ip_ospf_neighbor_int_common (struct vty *vty, struct ospf *ospf, int arg_ba if (use_json) json_object_int_add(json, "ospfInstance", ospf->instance); else - vty_out (vty, "%sOSPF Instance: %d%s%s", VTYNL, ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); } ifp = if_lookup_by_name (argv[arg_base]->arg, VRF_DEFAULT); @@ -3935,7 +3895,7 @@ show_ip_ospf_neighbor_int_common (struct vty *vty, struct ospf *ospf, int arg_ba if (use_json) json_object_boolean_true_add(json, "noSuchIface"); else - vty_out (vty, "No such interface.%s", VTYNL); + vty_out (vty, "No such interface.\n"); return CMD_WARNING; } @@ -3951,11 +3911,11 @@ show_ip_ospf_neighbor_int_common (struct vty *vty, struct ospf *ospf, int arg_ba if (use_json) { - vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL); + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -4018,8 +3978,8 @@ show_ip_ospf_nbr_nbma_detail_sub (struct vty *vty, struct ospf_interface *oi, st if (use_json) json_object_string_add(json_sub, "ifaceAddress", inet_ntoa (nbr_nbma->addr)); else - vty_out (vty, " interface address %s%s", - inet_ntoa (nbr_nbma->addr), VTYNL); + vty_out (vty, " interface address %s\n", + inet_ntoa (nbr_nbma->addr)); /* Show Area ID. */ if (use_json) @@ -4028,8 +3988,8 @@ show_ip_ospf_nbr_nbma_detail_sub (struct vty *vty, struct ospf_interface *oi, st json_object_string_add(json_sub, "iface", IF_NAME (oi)); } else - vty_out (vty, " In the area %s via interface %s%s", - ospf_area_desc_string (oi->area), IF_NAME (oi), VTYNL); + vty_out (vty, " In the area %s via interface %s\n", + ospf_area_desc_string (oi->area), IF_NAME (oi)); /* Show neighbor priority and state. */ if (use_json) @@ -4045,13 +4005,13 @@ show_ip_ospf_nbr_nbma_detail_sub (struct vty *vty, struct ospf_interface *oi, st if (use_json) json_object_int_add(json_sub, "stateChangeCounter", nbr_nbma->state_change); else - vty_out (vty, " %d state changes%s", nbr_nbma->state_change, VTYNL); + vty_out (vty, " %d state changes\n", nbr_nbma->state_change); /* Show PollInterval */ if (use_json) json_object_int_add(json_sub, "pollInterval", nbr_nbma->v_poll); else - vty_out (vty, " Poll interval %d%s", nbr_nbma->v_poll, VTYNL); + vty_out (vty, " Poll interval %d\n", nbr_nbma->v_poll); /* Show poll-interval timer. */ if (use_json) @@ -4061,9 +4021,8 @@ show_ip_ospf_nbr_nbma_detail_sub (struct vty *vty, struct ospf_interface *oi, st json_object_int_add(json_sub, "pollIntervalTimerDueMsec", time_store); } else - vty_out (vty, " Poll timer due in %s%s", - ospf_timer_dump (nbr_nbma->t_poll, timebuf, sizeof(timebuf)), - VTYNL); + vty_out (vty, " Poll timer due in %s\n", + ospf_timer_dump (nbr_nbma->t_poll, timebuf, sizeof(timebuf))); /* Show poll-interval timer thread. */ if (use_json) @@ -4072,8 +4031,8 @@ show_ip_ospf_nbr_nbma_detail_sub (struct vty *vty, struct ospf_interface *oi, st json_object_string_add(json_sub, "pollIntervalTimerThread", "on"); } else - vty_out (vty, " Thread Poll Timer %s%s", - nbr_nbma->t_poll != NULL ? "on" : "off", VTYNL); + vty_out (vty, " Thread Poll Timer %s\n", + nbr_nbma->t_poll != NULL ? "on" : "off"); if (use_json) json_object_object_add(json, "noNbrId", json_sub); @@ -4101,8 +4060,8 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, if (use_json) json_object_string_add(json_sub, "ifaceAddress", inet_ntoa (nbr->address.u.prefix4)); else - vty_out (vty, " interface address %s%s", - inet_ntoa (nbr->address.u.prefix4), VTYNL); + vty_out (vty, " interface address %s\n", + inet_ntoa (nbr->address.u.prefix4)); /* Show Area ID. */ if (use_json) @@ -4111,8 +4070,8 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, json_object_string_add(json_sub, "ifaceName", oi->ifp->name); } else - vty_out (vty, " In the area %s via interface %s%s", - ospf_area_desc_string (oi->area), oi->ifp->name, VTYNL); + vty_out (vty, " In the area %s via interface %s\n", + ospf_area_desc_string (oi->area), oi->ifp->name); /* Show neighbor priority and state. */ if (use_json) @@ -4128,7 +4087,7 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, if (use_json) json_object_int_add(json_sub, "stateChangeCounter", nbr->state_change); else - vty_out (vty, " %d state changes%s", nbr->state_change, VTYNL); + vty_out (vty, " %d state changes\n", nbr->state_change); if (nbr->ts_last_progress.tv_sec || nbr->ts_last_progress.tv_usec) { @@ -4142,11 +4101,9 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, } else { - vty_out (vty, " Most recent state change statistics:%s", - VTYNL); - vty_out (vty, " Progressive change %s ago%s", - ospf_timeval_dump (&res, timebuf, sizeof(timebuf)), - VTYNL); + vty_out (vty, " Most recent state change statistics:\n"); + vty_out (vty, " Progressive change %s ago\n", + ospf_timeval_dump (&res, timebuf, sizeof(timebuf))); } } @@ -4164,10 +4121,9 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, } else { - vty_out (vty, " Regressive change %s ago, due to %s%s", + vty_out (vty, " Regressive change %s ago, due to %s\n", ospf_timeval_dump (&res, timebuf, sizeof(timebuf)), - (nbr->last_regress_str ? nbr->last_regress_str : "??"), - VTYNL); + (nbr->last_regress_str ? nbr->last_regress_str : "??")); } } @@ -4181,7 +4137,7 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, if (use_json) json_object_string_add(json_sub, "routerDesignatedBackupId", inet_ntoa (nbr->bd_router)); else - vty_out (vty, " BDR is %s%s", inet_ntoa (nbr->bd_router), VTYNL); + vty_out (vty, " BDR is %s\n", inet_ntoa (nbr->bd_router)); /* Show options. */ if (use_json) @@ -4190,8 +4146,8 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, json_object_string_add(json_sub, "optionsList", ospf_options_dump (nbr->options)); } else - vty_out (vty, " Options %d %s%s", nbr->options, - ospf_options_dump (nbr->options), VTYNL); + vty_out (vty, " Options %d %s\n", nbr->options, + ospf_options_dump (nbr->options)); /* Show Router Dead interval timer. */ if (use_json) @@ -4206,30 +4162,29 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, json_object_int_add(json_sub, "routerDeadIntervalTimerDueMsec", -1); } else - vty_out (vty, " Dead timer due in %s%s", - ospf_timer_dump (nbr->t_inactivity, timebuf, sizeof (timebuf)), - VTYNL); + vty_out (vty, " Dead timer due in %s\n", + ospf_timer_dump (nbr->t_inactivity, timebuf, sizeof (timebuf))); /* Show Database Summary list. */ if (use_json) json_object_int_add(json_sub, "databaseSummaryListCounter", ospf_db_summary_count (nbr)); else - vty_out (vty, " Database Summary List %d%s", - ospf_db_summary_count (nbr), VTYNL); + vty_out (vty, " Database Summary List %d\n", + ospf_db_summary_count (nbr)); /* Show Link State Request list. */ if (use_json) json_object_int_add(json_sub, "linkStateRequestListCounter", ospf_ls_request_count (nbr)); else - vty_out (vty, " Link State Request List %ld%s", - ospf_ls_request_count (nbr), VTYNL); + vty_out (vty, " Link State Request List %ld\n", + ospf_ls_request_count (nbr)); /* Show Link State Retransmission list. */ if (use_json) json_object_int_add(json_sub, "linkStateRetransmissionListCounter", ospf_ls_retransmit_count (nbr)); else - vty_out (vty, " Link State Retransmission List %ld%s", - ospf_ls_retransmit_count (nbr), VTYNL); + vty_out (vty, " Link State Retransmission List %ld\n", + ospf_ls_retransmit_count (nbr)); /* Show inactivity timer thread. */ if (use_json) @@ -4238,8 +4193,8 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, json_object_string_add(json_sub, "threadInactivityTimer", "on"); } else - vty_out (vty, " Thread Inactivity Timer %s%s", - nbr->t_inactivity != NULL ? "on" : "off", VTYNL); + vty_out (vty, " Thread Inactivity Timer %s\n", + nbr->t_inactivity != NULL ? "on" : "off"); /* Show Database Description retransmission thread. */ if (use_json) @@ -4248,8 +4203,8 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, json_object_string_add(json_sub, "threadDatabaseDescriptionRetransmission", "on"); } else - vty_out (vty, " Thread Database Description Retransmision %s%s", - nbr->t_db_desc != NULL ? "on" : "off", VTYNL); + vty_out (vty, " Thread Database Description Retransmision %s\n", + nbr->t_db_desc != NULL ? "on" : "off"); /* Show Link State Request Retransmission thread. */ if (use_json) @@ -4258,8 +4213,8 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, json_object_string_add(json_sub, "threadLinkStateRequestRetransmission", "on"); } else - vty_out (vty, " Thread Link State Request Retransmission %s%s", - nbr->t_ls_req != NULL ? "on" : "off", VTYNL); + vty_out (vty, " Thread Link State Request Retransmission %s\n", + nbr->t_ls_req != NULL ? "on" : "off"); /* Show Link State Update Retransmission thread. */ if (use_json) @@ -4268,8 +4223,8 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, json_object_string_add(json_sub, "threadLinkStateUpdateRetransmission", "on"); } else - vty_out (vty, " Thread Link State Update Retransmission %s%s%s", - nbr->t_ls_upd != NULL ? "on" : "off", VTYNL, VTYNL); + vty_out (vty, " Thread Link State Update Retransmission %s\n\n", + nbr->t_ls_upd != NULL ? "on" : "off"); if (use_json) { @@ -4301,15 +4256,14 @@ show_ip_ospf_neighbor_id_common (struct vty *vty, struct ospf *ospf, if (use_json) json_object_int_add(json, "ospfInstance", ospf->instance); else - vty_out (vty, "%sOSPF Instance: %d%s%s", VTYNL, ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); } ret = inet_aton (argv[arg_base]->arg, &router_id); if (!ret) { if (!use_json) - vty_out (vty, "Please specify Neighbor ID by A.B.C.D%s", VTYNL); + vty_out (vty, "Please specify Neighbor ID by A.B.C.D\n"); return CMD_WARNING; } @@ -4323,11 +4277,11 @@ show_ip_ospf_neighbor_id_common (struct vty *vty, struct ospf *ospf, if (use_json) { - vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL); + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -4389,8 +4343,7 @@ show_ip_ospf_neighbor_detail_common (struct vty *vty, struct ospf *ospf, u_char if (use_json) json_object_int_add(json, "ospfInstance", ospf->instance); else - vty_out (vty, "%sOSPF Instance: %d%s%s", VTYNL, ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); } for (ALL_LIST_ELEMENTS_RO (ospf->oiflist, node, oi)) @@ -4415,11 +4368,11 @@ show_ip_ospf_neighbor_detail_common (struct vty *vty, struct ospf *ospf, u_char if (use_json) { - vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL); + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -4481,8 +4434,7 @@ show_ip_ospf_neighbor_detail_all_common (struct vty *vty, struct ospf *ospf, u_c if (use_json) json_object_int_add(json, "ospfInstance", ospf->instance); else - vty_out (vty, "%sOSPF Instance: %d%s%s", VTYNL, ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); } for (ALL_LIST_ELEMENTS_RO (ospf->oiflist, node, oi)) @@ -4511,12 +4463,12 @@ show_ip_ospf_neighbor_detail_all_common (struct vty *vty, struct ospf *ospf, u_c if (use_json) { - vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL); + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else { - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } return CMD_SUCCESS; @@ -4584,15 +4536,14 @@ show_ip_ospf_neighbor_int_detail_common (struct vty *vty, struct ospf *ospf, if (use_json) json_object_int_add(json, "ospfInstance", ospf->instance); else - vty_out (vty, "%sOSPF Instance: %d%s%s", VTYNL, ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); } ifp = if_lookup_by_name (argv[arg_base]->arg, VRF_DEFAULT); if (!ifp) { if (!use_json) - vty_out (vty, "No such interface.%s", VTYNL); + vty_out (vty, "No such interface.\n"); return CMD_WARNING; } @@ -4616,11 +4567,11 @@ show_ip_ospf_neighbor_int_detail_common (struct vty *vty, struct ospf *ospf, if (use_json) { - vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTYNL); + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -4726,7 +4677,7 @@ show_lsa_summary (struct vty *vty, struct ospf_lsa *lsa, int self) default: break; } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } return 0; @@ -4769,10 +4720,10 @@ show_ip_ospf_database_header (struct vty *vty, struct ospf_lsa *lsa) { struct router_lsa *rlsa = (struct router_lsa*) lsa->data; - vty_outln (vty, " LS age: %d", LS_AGE (lsa)); - vty_outln (vty, " Options: 0x%-2x : %s", lsa->data->options, + vty_out (vty, " LS age: %d\n", LS_AGE (lsa)); + vty_out (vty, " Options: 0x%-2x : %s\n", lsa->data->options, ospf_options_dump(lsa->data->options)); - vty_outln (vty, " LS Flags: 0x%-2x %s", + vty_out (vty, " LS Flags: 0x%-2x %s\n", lsa->flags, ((lsa->flags & OSPF_LSA_LOCAL_XLT) ? "(Translated from Type-7)" : "")); @@ -4788,16 +4739,16 @@ show_ip_ospf_database_header (struct vty *vty, struct ospf_lsa *lsa) IS_ROUTER_LSA_VIRTUAL (rlsa) ? " VL-endpoint" : "", IS_ROUTER_LSA_SHORTCUT (rlsa) ? " Shortcut" : ""); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } - vty_outln (vty, " LS Type: %s", + vty_out (vty, " LS Type: %s\n", lookup_msg(ospf_lsa_type_msg, lsa->data->type, NULL)); - vty_outln (vty, " Link State ID: %s %s", inet_ntoa (lsa->data->id), + vty_out (vty, " Link State ID: %s %s\n", inet_ntoa (lsa->data->id), lookup_msg(ospf_link_state_id_type_msg, lsa->data->type, NULL)); - vty_outln (vty, " Advertising Router: %s", inet_ntoa (lsa->data->adv_router)); - vty_outln (vty, " LS Seq Number: %08lx", (u_long)ntohl (lsa->data->ls_seqnum)); - vty_outln (vty, " Checksum: 0x%04x", ntohs (lsa->data->checksum)); - vty_outln (vty, " Length: %d%s", ntohs (lsa->data->length), VTYNL); + vty_out (vty, " Advertising Router: %s\n", inet_ntoa (lsa->data->adv_router)); + vty_out (vty, " LS Seq Number: %08lx\n", (u_long)ntohl (lsa->data->ls_seqnum)); + vty_out (vty, " Checksum: 0x%04x\n", ntohs (lsa->data->checksum)); + vty_out (vty, " Length: %d\n\n", ntohs (lsa->data->length)); } const char *link_type_desc[] = @@ -4840,16 +4791,16 @@ show_ip_ospf_database_router_links (struct vty *vty, { type = rl->link[i].type; - vty_out (vty, " Link connected to: %s%s", - link_type_desc[type], VTYNL); - vty_out (vty, " (Link ID) %s: %s%s", link_id_desc[type], - inet_ntoa (rl->link[i].link_id), VTYNL); - vty_out (vty, " (Link Data) %s: %s%s", link_data_desc[type], - inet_ntoa (rl->link[i].link_data), VTYNL); - vty_out (vty, " Number of TOS metrics: 0%s", VTYNL); - vty_out (vty, " TOS 0 Metric: %d%s", - ntohs (rl->link[i].metric), VTYNL); - vty_out (vty, "%s", VTYNL); + vty_out (vty, " Link connected to: %s\n", + link_type_desc[type]); + vty_out (vty, " (Link ID) %s: %s\n", link_id_desc[type], + inet_ntoa (rl->link[i].link_id)); + vty_out (vty, " (Link Data) %s: %s\n", link_data_desc[type], + inet_ntoa (rl->link[i].link_data)); + vty_out (vty, " Number of TOS metrics: 0\n"); + vty_out (vty, " TOS 0 Metric: %d\n", + ntohs (rl->link[i].metric)); + vty_out (vty, "\n"); } } @@ -4863,11 +4814,10 @@ show_router_lsa_detail (struct vty *vty, struct ospf_lsa *lsa) show_ip_ospf_database_header (vty, lsa); - vty_out (vty, " Number of Links: %d%s%s", ntohs (rl->links), - VTYNL, VTYNL); + vty_out (vty, " Number of Links: %d\n\n", ntohs (rl->links)); show_ip_ospf_database_router_links (vty, rl); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } return 0; @@ -4885,16 +4835,16 @@ show_network_lsa_detail (struct vty *vty, struct ospf_lsa *lsa) show_ip_ospf_database_header (vty, lsa); - vty_out (vty, " Network Mask: /%d%s", - ip_masklen (nl->mask), VTYNL); + vty_out (vty, " Network Mask: /%d\n", + ip_masklen (nl->mask)); length = ntohs (lsa->data->length) - OSPF_LSA_HEADER_SIZE - 4; for (i = 0; length > 0; i++, length -= 4) - vty_out (vty, " Attached Router: %s%s", - inet_ntoa (nl->routers[i]), VTYNL); + vty_out (vty, " Attached Router: %s\n", + inet_ntoa (nl->routers[i])); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } return 0; @@ -4910,11 +4860,9 @@ show_summary_lsa_detail (struct vty *vty, struct ospf_lsa *lsa) show_ip_ospf_database_header (vty, lsa); - vty_out (vty, " Network Mask: /%d%s", ip_masklen (sl->mask), - VTYNL); - vty_out (vty, " TOS: 0 Metric: %d%s", GET_METRIC (sl->metric), - VTYNL); - vty_out (vty, "%s", VTYNL); + vty_out (vty, " Network Mask: /%d\n", ip_masklen (sl->mask)); + vty_out (vty, " TOS: 0 Metric: %d\n", GET_METRIC (sl->metric)); + vty_out (vty, "\n"); } return 0; @@ -4930,11 +4878,10 @@ show_summary_asbr_lsa_detail (struct vty *vty, struct ospf_lsa *lsa) show_ip_ospf_database_header (vty, lsa); - vty_out (vty, " Network Mask: /%d%s", - ip_masklen (sl->mask), VTYNL); - vty_out (vty, " TOS: 0 Metric: %d%s", GET_METRIC (sl->metric), - VTYNL); - vty_out (vty, "%s", VTYNL); + vty_out (vty, " Network Mask: /%d\n", + ip_masklen (sl->mask)); + vty_out (vty, " TOS: 0 Metric: %d\n", GET_METRIC (sl->metric)); + vty_out (vty, "\n"); } return 0; @@ -4950,19 +4897,19 @@ show_as_external_lsa_detail (struct vty *vty, struct ospf_lsa *lsa) show_ip_ospf_database_header (vty, lsa); - vty_out (vty, " Network Mask: /%d%s", - ip_masklen (al->mask), VTYNL); - vty_out (vty, " Metric Type: %s%s", + vty_out (vty, " Network Mask: /%d\n", + ip_masklen (al->mask)); + vty_out (vty, " Metric Type: %s\n", IS_EXTERNAL_METRIC (al->e[0].tos) ? - "2 (Larger than any link state path)" : "1", VTYNL); - vty_out (vty, " TOS: 0%s", VTYNL); - vty_out (vty, " Metric: %d%s", - GET_METRIC (al->e[0].metric), VTYNL); - vty_out (vty, " Forward Address: %s%s", - inet_ntoa (al->e[0].fwd_addr), VTYNL); + "2 (Larger than any link state path)" : "1"); + vty_out (vty, " TOS: 0\n"); + vty_out (vty, " Metric: %d\n", + GET_METRIC (al->e[0].metric)); + vty_out (vty, " Forward Address: %s\n", + inet_ntoa (al->e[0].fwd_addr)); - vty_out (vty, " External Route Tag: %"ROUTE_TAG_PRI"%s%s", - (route_tag_t)ntohl (al->e[0].route_tag), VTYNL, VTYNL); + vty_out (vty, " External Route Tag: %"ROUTE_TAG_PRI"\n\n", + (route_tag_t)ntohl (al->e[0].route_tag)); } return 0; @@ -5002,19 +4949,19 @@ show_as_nssa_lsa_detail (struct vty *vty, struct ospf_lsa *lsa) show_ip_ospf_database_header (vty, lsa); - vty_out (vty, " Network Mask: /%d%s", - ip_masklen (al->mask), VTYNL); - vty_out (vty, " Metric Type: %s%s", + vty_out (vty, " Network Mask: /%d\n", + ip_masklen (al->mask)); + vty_out (vty, " Metric Type: %s\n", IS_EXTERNAL_METRIC (al->e[0].tos) ? - "2 (Larger than any link state path)" : "1", VTYNL); - vty_out (vty, " TOS: 0%s", VTYNL); - vty_out (vty, " Metric: %d%s", - GET_METRIC (al->e[0].metric), VTYNL); - vty_out (vty, " NSSA: Forward Address: %s%s", - inet_ntoa (al->e[0].fwd_addr), VTYNL); + "2 (Larger than any link state path)" : "1"); + vty_out (vty, " TOS: 0\n"); + vty_out (vty, " Metric: %d\n", + GET_METRIC (al->e[0].metric)); + vty_out (vty, " NSSA: Forward Address: %s\n", + inet_ntoa (al->e[0].fwd_addr)); - vty_out (vty, " External Route Tag: %"ROUTE_TAG_PRI"%s%s", - (route_tag_t)ntohl (al->e[0].route_tag), VTYNL, VTYNL); + vty_out (vty, " External Route Tag: %"ROUTE_TAG_PRI"\n\n", + (route_tag_t)ntohl (al->e[0].route_tag)); } return 0; @@ -5034,7 +4981,7 @@ show_opaque_lsa_detail (struct vty *vty, struct ospf_lsa *lsa) show_ip_ospf_database_header (vty, lsa); show_opaque_info_detail (vty, lsa); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } return 0; } @@ -5112,17 +5059,15 @@ show_lsa_detail (struct vty *vty, struct ospf *ospf, int type, { case OSPF_AS_EXTERNAL_LSA: case OSPF_OPAQUE_AS_LSA: - vty_out (vty, " %s %s%s", - show_database_desc[type], - VTYNL, VTYNL); + vty_out (vty, " %s \n\n", + show_database_desc[type]); show_lsa_detail_proc (vty, AS_LSDB (ospf, type), id, adv_router); break; default: for (ALL_LIST_ELEMENTS_RO (ospf->areas, node, area)) { - vty_out (vty, "%s %s (Area %s)%s%s", - VTYNL, show_database_desc[type], - ospf_area_desc_string (area), VTYNL, VTYNL); + vty_out (vty, "\n %s (Area %s)\n\n", show_database_desc[type], + ospf_area_desc_string (area)); show_lsa_detail_proc (vty, AREA_LSDB (area, type), id, adv_router); } break; @@ -5159,18 +5104,16 @@ show_lsa_detail_adv_router (struct vty *vty, struct ospf *ospf, int type, { case OSPF_AS_EXTERNAL_LSA: case OSPF_OPAQUE_AS_LSA: - vty_out (vty, " %s %s%s", - show_database_desc[type], - VTYNL, VTYNL); + vty_out (vty, " %s \n\n", + show_database_desc[type]); show_lsa_detail_adv_router_proc (vty, AS_LSDB (ospf, type), adv_router); break; default: for (ALL_LIST_ELEMENTS_RO (ospf->areas, node, area)) { - vty_out (vty, "%s %s (Area %s)%s%s", - VTYNL, show_database_desc[type], - ospf_area_desc_string (area), VTYNL, VTYNL); + vty_out (vty, "\n %s (Area %s)\n\n", show_database_desc[type], + ospf_area_desc_string (area)); show_lsa_detail_adv_router_proc (vty, AREA_LSDB (area, type), adv_router); } @@ -5202,16 +5145,15 @@ show_ip_ospf_database_summary (struct vty *vty, struct ospf *ospf, int self) if (ospf_lsdb_count_self (area->lsdb, type) > 0 || (!self && ospf_lsdb_count (area->lsdb, type) > 0)) { - vty_out (vty, " %s (Area %s)%s%s", + vty_out (vty, " %s (Area %s)\n\n", show_database_desc[type], - ospf_area_desc_string (area), - VTYNL, VTYNL); - vty_out (vty, "%s%s", show_database_header[type], VTYNL); + ospf_area_desc_string (area)); + vty_out (vty, "%s\n", show_database_header[type]); LSDB_LOOP (AREA_LSDB (area, type), rn, lsa) show_lsa_summary (vty, lsa, self); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } } } @@ -5229,20 +5171,18 @@ show_ip_ospf_database_summary (struct vty *vty, struct ospf *ospf, int self) if (ospf_lsdb_count_self (ospf->lsdb, type) || (!self && ospf_lsdb_count (ospf->lsdb, type))) { - vty_out (vty, " %s%s%s", - show_database_desc[type], - VTYNL, VTYNL); - vty_out (vty, "%s%s", show_database_header[type], - VTYNL); + vty_out (vty, " %s\n\n", + show_database_desc[type]); + vty_out (vty, "%s\n", show_database_header[type]); LSDB_LOOP (AS_LSDB (ospf, type), rn, lsa) show_lsa_summary (vty, lsa, self); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } static void @@ -5250,8 +5190,7 @@ show_ip_ospf_database_maxage (struct vty *vty, struct ospf *ospf) { struct route_node *rn; - vty_out (vty, "%s MaxAge Link States:%s%s", - VTYNL, VTYNL, VTYNL); + vty_out (vty, "\n MaxAge Link States:\n\n"); for (rn = route_top (ospf->maxage_lsa); rn; rn = route_next (rn)) { @@ -5259,13 +5198,13 @@ show_ip_ospf_database_maxage (struct vty *vty, struct ospf *ospf) if ((lsa = rn->info) != NULL) { - vty_out (vty, "Link type: %d%s", lsa->data->type, VTYNL); - vty_out (vty, "Link State ID: %s%s", - inet_ntoa (lsa->data->id), VTYNL); - vty_out (vty, "Advertising Router: %s%s", - inet_ntoa (lsa->data->adv_router), VTYNL); - vty_out (vty, "LSA lock count: %d%s", lsa->lock, VTYNL); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "Link type: %d\n", lsa->data->type); + vty_out (vty, "Link State ID: %s\n", + inet_ntoa (lsa->data->id)); + vty_out (vty, "Advertising Router: %s\n", + inet_ntoa (lsa->data->adv_router)); + vty_out (vty, "LSA lock count: %d\n", lsa->lock); + vty_out (vty, "\n"); } } } @@ -5298,11 +5237,10 @@ show_ip_ospf_database_common (struct vty *vty, struct ospf *ospf, struct in_addr id, adv_router; if (ospf->instance) - vty_out (vty, "%sOSPF Instance: %d%s", VTYNL, ospf->instance, - VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n", ospf->instance); - vty_out (vty, "%s OSPF Router with ID (%s)%s%s", VTYNL, - inet_ntoa (ospf->router_id), VTYNL, VTYNL); + vty_out (vty, "\n OSPF Router with ID (%s)\n\n", + inet_ntoa (ospf->router_id)); /* Show all LSA. */ if (argc == arg_base + 4) @@ -5457,11 +5395,10 @@ show_ip_ospf_database_type_adv_router_common (struct vty *vty, struct ospf *ospf struct in_addr adv_router; if (ospf->instance) - vty_out (vty, "%sOSPF Instance: %d%s", VTYNL, ospf->instance, - VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n", ospf->instance); - vty_out (vty, "%s OSPF Router with ID (%s)%s%s", VTYNL, - inet_ntoa (ospf->router_id), VTYNL, VTYNL); + vty_out (vty, "\n OSPF Router with ID (%s)\n\n", + inet_ntoa (ospf->router_id)); /* Set database type to show. */ if (strncmp (argv[arg_base + idx_type]->text, "r", 1) == 0) @@ -5555,8 +5492,7 @@ DEFUN (ip_ospf_authentication_args, ret = inet_aton(argv[idx_ipv4]->arg, &addr); if (!ret) { - vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTYNL); + vty_out (vty, "Please specify interface address by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -5580,7 +5516,7 @@ DEFUN (ip_ospf_authentication_args, return CMD_SUCCESS; } - vty_out (vty, "You shouldn't get here!%s", VTYNL); + vty_out (vty, "You shouldn't get here!\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -5605,8 +5541,7 @@ DEFUN (ip_ospf_authentication, ret = inet_aton(argv[idx_ipv4]->arg, &addr); if (!ret) { - vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTYNL); + vty_out (vty, "Please specify interface address by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -5647,15 +5582,14 @@ DEFUN (no_ip_ospf_authentication_args, ret = inet_aton(argv[idx_ipv4]->arg, &addr); if (!ret) { - vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTYNL); + vty_out (vty, "Please specify interface address by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } params = ospf_lookup_if_params (ifp, addr); if (params == NULL) { - vty_out (vty, "Ip Address specified is unknown%s", VTYNL); + vty_out (vty, "Ip Address specified is unknown\n"); return CMD_WARNING_CONFIG_FAILED; } params->auth_type = OSPF_AUTH_NOTSET; @@ -5678,7 +5612,7 @@ DEFUN (no_ip_ospf_authentication_args, } else { - vty_out (vty, "Unexpected input encountered%s", VTYNL); + vty_out (vty, "Unexpected input encountered\n"); return CMD_WARNING_CONFIG_FAILED; } /* @@ -5737,15 +5671,14 @@ DEFUN (no_ip_ospf_authentication, ret = inet_aton(argv[idx_ipv4]->arg, &addr); if (!ret) { - vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTYNL); + vty_out (vty, "Please specify interface address by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } params = ospf_lookup_if_params (ifp, addr); if (params == NULL) { - vty_out (vty, "Ip Address specified is unknown%s", VTYNL); + vty_out (vty, "Ip Address specified is unknown\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -5817,8 +5750,7 @@ DEFUN (ip_ospf_authentication_key, { if (!inet_aton(argv[idx]->arg, &addr)) { - vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTYNL); + vty_out (vty, "Please specify interface address by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -5863,8 +5795,7 @@ DEFUN (no_ip_ospf_authentication_key, { if (!inet_aton(argv[idx]->arg, &addr)) { - vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTYNL); + vty_out (vty, "Please specify interface address by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -5925,8 +5856,7 @@ DEFUN (ip_ospf_message_digest_key, { if (!inet_aton(argv[idx]->arg, &addr)) { - vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTYNL); + vty_out (vty, "Please specify interface address by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -5937,7 +5867,7 @@ DEFUN (ip_ospf_message_digest_key, key_id = strtol (keyid, NULL, 10); if (ospf_crypt_key_lookup (params->auth_crypt, key_id) != NULL) { - vty_out (vty, "OSPF: Key %d already exists%s", key_id, VTYNL); + vty_out (vty, "OSPF: Key %d already exists\n", key_id); return CMD_WARNING_CONFIG_FAILED; } @@ -5992,8 +5922,7 @@ DEFUN (no_ip_ospf_message_digest_key, { if (!inet_aton(argv[idx]->arg, &addr)) { - vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTYNL); + vty_out (vty, "Please specify interface address by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -6006,7 +5935,7 @@ DEFUN (no_ip_ospf_message_digest_key, ck = ospf_crypt_key_lookup (params->auth_crypt, key_id); if (ck == NULL) { - vty_out (vty, "OSPF: Key %d does not exist%s", key_id, VTYNL); + vty_out (vty, "OSPF: Key %d does not exist\n", key_id); return CMD_WARNING_CONFIG_FAILED; } @@ -6060,8 +5989,7 @@ DEFUN (ip_ospf_cost, { if(!inet_aton(ifaddr, &addr)) { - vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTYNL); + vty_out (vty, "Please specify interface address by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -6115,8 +6043,7 @@ DEFUN (no_ip_ospf_cost, { if (!inet_aton(ifaddr, &addr)) { - vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTYNL); + vty_out (vty, "Please specify interface address by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -6187,8 +6114,7 @@ ospf_vty_dead_interval_set (struct vty *vty, const char *interval_str, ret = inet_aton(nbr_str, &addr); if (!ret) { - vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTYNL); + vty_out (vty, "Please specify interface address by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -6214,8 +6140,7 @@ ospf_vty_dead_interval_set (struct vty *vty, const char *interval_str, } else { - vty_out (vty, "Please specify dead-interval or hello-multiplier%s", - VTYNL); + vty_out (vty, "Please specify dead-interval or hello-multiplier\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -6314,8 +6239,7 @@ DEFUN (no_ip_ospf_dead_interval, ret = inet_aton(argv[idx_ipv4]->arg, &addr); if (!ret) { - vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTYNL); + vty_out (vty, "Please specify interface address by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -6393,8 +6317,7 @@ DEFUN (ip_ospf_hello_interval, { if(!inet_aton(argv[idx]->arg, &addr)) { - vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTYNL); + vty_out (vty, "Please specify interface address by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -6440,8 +6363,7 @@ DEFUN (no_ip_ospf_hello_interval, { if(!inet_aton(argv[idx]->arg, &addr)) { - vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTYNL); + vty_out (vty, "Please specify interface address by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -6492,7 +6414,7 @@ DEFUN (ip_ospf_network, if (old_type == OSPF_IFTYPE_LOOPBACK) { - vty_out (vty, "This is a loopback interface. Can't set network type.%s", VTYNL); + vty_out (vty, "This is a loopback interface. Can't set network type.\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -6620,8 +6542,7 @@ DEFUN (ip_ospf_priority, { if (!inet_aton(argv[idx]->arg, &addr)) { - vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTYNL); + vty_out (vty, "Please specify interface address by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -6682,8 +6603,7 @@ DEFUN (no_ip_ospf_priority, { if (!inet_aton(argv[idx]->arg, &addr)) { - vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTYNL); + vty_out (vty, "Please specify interface address by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -6753,8 +6673,7 @@ DEFUN (ip_ospf_retransmit_interval, { if (!inet_aton(argv[idx]->arg, &addr)) { - vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTYNL); + vty_out (vty, "Please specify interface address by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -6800,8 +6719,7 @@ DEFUN (no_ip_ospf_retransmit_interval, { if (!inet_aton(argv[idx]->arg, &addr)) { - vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTYNL); + vty_out (vty, "Please specify interface address by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -6857,8 +6775,7 @@ DEFUN (ip_ospf_transmit_delay, { if (!inet_aton(argv[idx]->arg, &addr)) { - vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTYNL); + vty_out (vty, "Please specify interface address by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -6903,8 +6820,7 @@ DEFUN (no_ip_ospf_transmit_delay, { if (!inet_aton(argv[idx]->arg, &addr)) { - vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTYNL); + vty_out (vty, "Please specify interface address by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -6981,13 +6897,12 @@ DEFUN (ip_ospf_area, ret = str2area_id (areaid, &area_id, &format); if (ret < 0) { - vty_out (vty, "Please specify area by A.B.C.D|<0-4294967295>%s", - VTYNL); + vty_out (vty, "Please specify area by A.B.C.D|<0-4294967295>\n"); return CMD_WARNING_CONFIG_FAILED; } if (memcmp (ifp->name, "VLINK", 5) == 0) { - vty_out (vty, "Cannot enable OSPF on a virtual link.%s", VTYNL); + vty_out (vty, "Cannot enable OSPF on a virtual link.\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -6995,8 +6910,7 @@ DEFUN (ip_ospf_area, if (OSPF_IF_PARAM_CONFIGURED(params, if_area) && !IPV4_ADDR_SAME(¶ms->if_area, &area_id)) { vty_out (vty, - "Must remove previous area config before changing ospf area %s", - VTYNL); + "Must remove previous area config before changing ospf area \n"); return CMD_WARNING_CONFIG_FAILED; } @@ -7018,7 +6932,7 @@ DEFUN (ip_ospf_area, { if (rn->info != NULL) { - vty_out (vty, "Please remove all network commands first.%s", VTYNL); + vty_out (vty, "Please remove all network commands first.\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -7071,7 +6985,7 @@ DEFUN (no_ip_ospf_area, if (!OSPF_IF_PARAM_CONFIGURED(params, if_area)) { - vty_outln (vty, "Can't find specified interface area configuration."); + vty_out (vty, "Can't find specified interface area configuration.\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -7203,15 +7117,13 @@ DEFUN (ospf_redistribute_instance_source, if ((source == ZEBRA_ROUTE_OSPF) && !ospf->instance) { - vty_out (vty, "Instance redistribution in non-instanced OSPF not allowed%s", - VTYNL); + vty_out (vty, "Instance redistribution in non-instanced OSPF not allowed\n"); return CMD_WARNING_CONFIG_FAILED; } if ((source == ZEBRA_ROUTE_OSPF) && (ospf->instance == instance)) { - vty_out (vty, "Same instance OSPF redistribution not allowed%s", - VTYNL); + vty_out (vty, "Same instance OSPF redistribution not allowed\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -7268,15 +7180,13 @@ DEFUN (no_ospf_redistribute_instance_source, if ((source == ZEBRA_ROUTE_OSPF) && !ospf->instance) { - vty_out (vty, "Instance redistribution in non-instanced OSPF not allowed%s", - VTYNL); + vty_out (vty, "Instance redistribution in non-instanced OSPF not allowed\n"); return CMD_WARNING_CONFIG_FAILED; } if ((source == ZEBRA_ROUTE_OSPF) && (ospf->instance == instance)) { - vty_out (vty, "Same instance OSPF redistribution not allowed%s", - VTYNL); + vty_out (vty, "Same instance OSPF redistribution not allowed\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -7638,8 +7548,7 @@ DEFUN (ip_ospf_mtu_ignore, ret = inet_aton(argv[idx_ipv4]->arg, &addr); if (!ret) { - vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTYNL); + vty_out (vty, "Please specify interface address by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } params = ospf_get_if_params (ifp, addr); @@ -7681,8 +7590,7 @@ DEFUN (no_ip_ospf_mtu_ignore, ret = inet_aton(argv[idx_ipv4]->arg, &addr); if (!ret) { - vty_out (vty, "Please specify interface address by A.B.C.D%s", - VTYNL); + vty_out (vty, "Please specify interface address by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } params = ospf_get_if_params (ifp, addr); @@ -7861,17 +7769,16 @@ config_write_stub_router (struct vty *vty, struct ospf *ospf) struct ospf_area *area; if (ospf->stub_router_startup_time != OSPF_STUB_ROUTER_UNCONFIGURED) - vty_out (vty, " max-metric router-lsa on-startup %u%s", - ospf->stub_router_startup_time, VTYNL); + vty_out (vty, " max-metric router-lsa on-startup %u\n", + ospf->stub_router_startup_time); if (ospf->stub_router_shutdown_time != OSPF_STUB_ROUTER_UNCONFIGURED) - vty_out (vty, " max-metric router-lsa on-shutdown %u%s", - ospf->stub_router_shutdown_time, VTYNL); + vty_out (vty, " max-metric router-lsa on-shutdown %u\n", + ospf->stub_router_shutdown_time); for (ALL_LIST_ELEMENTS_RO (ospf->areas, ln, area)) { if (CHECK_FLAG (area->stub_router_state, OSPF_AREA_ADMIN_STUB_ROUTED)) { - vty_out (vty, " max-metric router-lsa administrative%s", - VTYNL); + vty_out (vty, " max-metric router-lsa administrative\n"); break; } } @@ -7886,8 +7793,7 @@ show_ip_ospf_route_network (struct vty *vty, struct route_table *rt) struct listnode *pnode, *pnnode; struct ospf_path *path; - vty_out (vty, "============ OSPF network routing table ============%s", - VTYNL); + vty_out (vty, "============ OSPF network routing table ============\n"); for (rn = route_top (rt); rn; rn = route_next (rn)) if ((or = rn->info) != NULL) @@ -7900,14 +7806,14 @@ show_ip_ospf_route_network (struct vty *vty, struct route_table *rt) { case OSPF_PATH_INTER_AREA: if (or->type == OSPF_DESTINATION_NETWORK) - vty_out (vty, "N IA %-18s [%d] area: %s%s", buf1, or->cost, - inet_ntoa (or->u.std.area_id), VTYNL); + vty_out (vty, "N IA %-18s [%d] area: %s\n", buf1, or->cost, + inet_ntoa (or->u.std.area_id)); else if (or->type == OSPF_DESTINATION_DISCARD) - vty_out (vty, "D IA %-18s Discard entry%s", buf1, VTYNL); + vty_out (vty, "D IA %-18s Discard entry\n", buf1); break; case OSPF_PATH_INTRA_AREA: - vty_out (vty, "N %-18s [%d] area: %s%s", buf1, or->cost, - inet_ntoa (or->u.std.area_id), VTYNL); + vty_out (vty, "N %-18s [%d] area: %s\n", buf1, or->cost, + inet_ntoa (or->u.std.area_id)); break; default: break; @@ -7919,16 +7825,16 @@ show_ip_ospf_route_network (struct vty *vty, struct route_table *rt) if (if_lookup_by_index(path->ifindex, VRF_DEFAULT)) { if (path->nexthop.s_addr == 0) - vty_out (vty, "%24s directly attached to %s%s", - "", ifindex2ifname (path->ifindex, VRF_DEFAULT), VTYNL); + vty_out (vty, "%24s directly attached to %s\n", + "", ifindex2ifname (path->ifindex, VRF_DEFAULT)); else - vty_out (vty, "%24s via %s, %s%s", "", + vty_out (vty, "%24s via %s, %s\n", "", inet_ntoa (path->nexthop), - ifindex2ifname (path->ifindex, VRF_DEFAULT), VTYNL); + ifindex2ifname (path->ifindex, VRF_DEFAULT)); } } } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } static void @@ -7940,8 +7846,7 @@ show_ip_ospf_route_router (struct vty *vty, struct route_table *rtrs) struct listnode *node; struct ospf_path *path; - vty_out (vty, "============ OSPF router routing table =============%s", - VTYNL); + vty_out (vty, "============ OSPF router routing table =============\n"); for (rn = route_top (rtrs); rn; rn = route_next (rn)) if (rn->info) { @@ -7959,29 +7864,26 @@ show_ip_ospf_route_router (struct vty *vty, struct route_table *rtrs) (or->path_type == OSPF_PATH_INTER_AREA ? "IA" : " "), or->cost, inet_ntoa (or->u.std.area_id)); /* Show flags. */ - vty_out (vty, "%s%s%s", + vty_out (vty, "%s%s\n", (or->u.std.flags & ROUTER_LSA_BORDER ? ", ABR" : ""), - (or->u.std.flags & ROUTER_LSA_EXTERNAL ? ", ASBR" : ""), - VTYNL); + (or->u.std.flags & ROUTER_LSA_EXTERNAL ? ", ASBR" : "")); for (ALL_LIST_ELEMENTS_RO (or->paths, pnode, path)) { if (if_lookup_by_index(path->ifindex, VRF_DEFAULT)) { if (path->nexthop.s_addr == 0) - vty_out (vty, "%24s directly attached to %s%s", - "", ifindex2ifname (path->ifindex, VRF_DEFAULT), - VTYNL); + vty_out (vty, "%24s directly attached to %s\n", + "", ifindex2ifname (path->ifindex, VRF_DEFAULT)); else - vty_out (vty, "%24s via %s, %s%s", "", + vty_out (vty, "%24s via %s, %s\n", "", inet_ntoa (path->nexthop), - ifindex2ifname (path->ifindex, VRF_DEFAULT), - VTYNL); + ifindex2ifname (path->ifindex, VRF_DEFAULT)); } } } } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } static void @@ -7992,8 +7894,7 @@ show_ip_ospf_route_external (struct vty *vty, struct route_table *rt) struct listnode *pnode, *pnnode; struct ospf_path *path; - vty_out (vty, "============ OSPF external routing table ===========%s", - VTYNL); + vty_out (vty, "============ OSPF external routing table ===========\n"); for (rn = route_top (rt); rn; rn = route_next (rn)) if ((er = rn->info) != NULL) { @@ -8004,12 +7905,12 @@ show_ip_ospf_route_external (struct vty *vty, struct route_table *rt) switch (er->path_type) { case OSPF_PATH_TYPE1_EXTERNAL: - vty_out (vty, "N E1 %-18s [%d] tag: %"ROUTE_TAG_PRI"%s", buf1, - er->cost, er->u.ext.tag, VTYNL); + vty_out (vty, "N E1 %-18s [%d] tag: %"ROUTE_TAG_PRI"\n", buf1, + er->cost, er->u.ext.tag); break; case OSPF_PATH_TYPE2_EXTERNAL: - vty_out (vty, "N E2 %-18s [%d/%d] tag: %"ROUTE_TAG_PRI"%s", buf1, er->cost, - er->u.ext.type2_cost, er->u.ext.tag, VTYNL); + vty_out (vty, "N E2 %-18s [%d/%d] tag: %"ROUTE_TAG_PRI"\n", buf1, er->cost, + er->u.ext.type2_cost, er->u.ext.tag); break; } @@ -8018,29 +7919,27 @@ show_ip_ospf_route_external (struct vty *vty, struct route_table *rt) if (if_lookup_by_index(path->ifindex, VRF_DEFAULT)) { if (path->nexthop.s_addr == 0) - vty_out (vty, "%24s directly attached to %s%s", - "", ifindex2ifname (path->ifindex, VRF_DEFAULT), VTYNL); + vty_out (vty, "%24s directly attached to %s\n", + "", ifindex2ifname (path->ifindex, VRF_DEFAULT)); else - vty_out (vty, "%24s via %s, %s%s", "", + vty_out (vty, "%24s via %s, %s\n", "", inet_ntoa (path->nexthop), - ifindex2ifname (path->ifindex, VRF_DEFAULT), - VTYNL); + ifindex2ifname (path->ifindex, VRF_DEFAULT)); } } } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } static int show_ip_ospf_border_routers_common (struct vty *vty, struct ospf *ospf) { if (ospf->instance) - vty_out (vty, "%sOSPF Instance: %d%s%s", VTYNL, ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); if (ospf->new_table == NULL) { - vty_out (vty, "No OSPF routing information exist%s", VTYNL); + vty_out (vty, "No OSPF routing information exist\n"); return CMD_SUCCESS; } @@ -8050,7 +7949,7 @@ show_ip_ospf_border_routers_common (struct vty *vty, struct ospf *ospf) /* Show Router routes. */ show_ip_ospf_route_router (vty, ospf->new_rtrs); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -8095,12 +7994,11 @@ static int show_ip_ospf_route_common (struct vty *vty, struct ospf *ospf) { if (ospf->instance) - vty_out (vty, "%sOSPF Instance: %d%s%s", VTYNL, ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); if (ospf->new_table == NULL) { - vty_out (vty, "No OSPF routing information exist%s", VTYNL); + vty_out (vty, "No OSPF routing information exist\n"); return CMD_SUCCESS; } @@ -8113,7 +8011,7 @@ show_ip_ospf_route_common (struct vty *vty, struct ospf *ospf) /* Show AS External routes. */ show_ip_ospf_route_external (vty, ospf->old_external_route); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -8201,12 +8099,10 @@ config_write_interface (struct vty *vty) if (ifp->ifindex == IFINDEX_DELETED) continue; - vty_out (vty, "!%s", VTYNL); - vty_out (vty, "interface %s%s", ifp->name, - VTYNL); + vty_out (vty, "!\n"); + vty_out (vty, "interface %s\n", ifp->name); if (ifp->desc) - vty_out (vty, " description %s%s", ifp->desc, - VTYNL); + vty_out (vty, " description %s\n", ifp->desc); write++; @@ -8223,7 +8119,7 @@ config_write_interface (struct vty *vty) ospf_int_type_str[params->type]); if (params != IF_DEF_PARAMS (ifp)) vty_out (vty, " %s", inet_ntoa (rn->p.u.prefix4)); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } } @@ -8258,7 +8154,7 @@ config_write_interface (struct vty *vty) vty_out (vty, " ip ospf authentication%s", auth_str); if (params != IF_DEF_PARAMS (ifp)) vty_out (vty, " %s", inet_ntoa (rn->p.u.prefix4)); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } /* Simple Authentication Password print. */ @@ -8269,7 +8165,7 @@ config_write_interface (struct vty *vty) params->auth_simple); if (params != IF_DEF_PARAMS (ifp)) vty_out (vty, " %s", inet_ntoa (rn->p.u.prefix4)); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } /* Cryptographic Authentication Key print. */ @@ -8279,7 +8175,7 @@ config_write_interface (struct vty *vty) ck->key_id, ck->auth_key); if (params != IF_DEF_PARAMS (ifp)) vty_out (vty, " %s", inet_ntoa (rn->p.u.prefix4)); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } /* Interface Output Cost print. */ @@ -8288,7 +8184,7 @@ config_write_interface (struct vty *vty) vty_out (vty, " ip ospf cost %u", params->output_cost_cmd); if (params != IF_DEF_PARAMS (ifp)) vty_out (vty, " %s", inet_ntoa (rn->p.u.prefix4)); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } /* Hello Interval print. */ @@ -8298,7 +8194,7 @@ config_write_interface (struct vty *vty) vty_out (vty, " ip ospf hello-interval %u", params->v_hello); if (params != IF_DEF_PARAMS (ifp)) vty_out (vty, " %s", inet_ntoa (rn->p.u.prefix4)); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } @@ -8317,7 +8213,7 @@ config_write_interface (struct vty *vty) if (params != IF_DEF_PARAMS (ifp)) vty_out (vty, " %s", inet_ntoa (rn->p.u.prefix4)); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } /* Router Priority print. */ @@ -8327,7 +8223,7 @@ config_write_interface (struct vty *vty) vty_out (vty, " ip ospf priority %u", params->priority); if (params != IF_DEF_PARAMS (ifp)) vty_out (vty, " %s", inet_ntoa (rn->p.u.prefix4)); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } /* Retransmit Interval print. */ @@ -8338,7 +8234,7 @@ config_write_interface (struct vty *vty) params->retransmit_interval); if (params != IF_DEF_PARAMS (ifp)) vty_out (vty, " %s", inet_ntoa (rn->p.u.prefix4)); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } /* Transmit Delay print. */ @@ -8348,7 +8244,7 @@ config_write_interface (struct vty *vty) vty_out (vty, " ip ospf transmit-delay %u", params->transmit_delay); if (params != IF_DEF_PARAMS (ifp)) vty_out (vty, " %s", inet_ntoa (rn->p.u.prefix4)); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } /* Area print. */ @@ -8362,7 +8258,7 @@ config_write_interface (struct vty *vty) vty_out (vty, " area %s", inet_ntoa (params->if_area)); if (params != IF_DEF_PARAMS (ifp)) vty_out (vty, " %s", inet_ntoa (rn->p.u.prefix4)); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } /* bfd print. */ @@ -8378,7 +8274,7 @@ config_write_interface (struct vty *vty) vty_out (vty, " ip ospf mtu-ignore"); if (params != IF_DEF_PARAMS (ifp)) vty_out (vty, " %s", inet_ntoa (rn->p.u.prefix4)); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } @@ -8425,9 +8321,9 @@ config_write_network_area (struct vty *vty, struct ospf *ospf) (unsigned long int) ntohl (n->area_id.s_addr)); /* Network print. */ - vty_out (vty, " network %s/%d area %s%s", + vty_out (vty, " network %s/%d area %s\n", inet_ntoa (rn->p.u.prefix4), rn->p.prefixlen, - buf, VTYNL); + buf); } return 0; @@ -8451,16 +8347,15 @@ config_write_ospf_area (struct vty *vty, struct ospf *ospf) if (area->auth_type != OSPF_AUTH_NULL) { if (area->auth_type == OSPF_AUTH_SIMPLE) - vty_out (vty, " area %s authentication%s", buf, VTYNL); + vty_out (vty, " area %s authentication\n", buf); else - vty_out (vty, " area %s authentication message-digest%s", - buf, VTYNL); + vty_out (vty, " area %s authentication message-digest\n", + buf); } if (area->shortcut_configured != OSPF_SHORTCUT_DEFAULT) - vty_out (vty, " area %s shortcut %s%s", buf, - ospf_shortcut_mode_str[area->shortcut_configured], - VTYNL); + vty_out (vty, " area %s shortcut %s\n", buf, + ospf_shortcut_mode_str[area->shortcut_configured]); if ((area->external_routing == OSPF_AREA_STUB) || (area->external_routing == OSPF_AREA_NSSA) @@ -8488,11 +8383,11 @@ config_write_ospf_area (struct vty *vty, struct ospf *ospf) if (area->no_summary) vty_out (vty, " no-summary"); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); if (area->default_cost != 1) - vty_out (vty, " area %s default-cost %d%s", buf, - area->default_cost, VTYNL); + vty_out (vty, " area %s default-cost %d\n", buf, + area->default_cost); } for (rn1 = route_top (area->ranges); rn1; rn1 = route_next (rn1)) @@ -8513,24 +8408,24 @@ config_write_ospf_area (struct vty *vty, struct ospf *ospf) vty_out (vty, " substitute %s/%d", inet_ntoa (range->subst_addr), range->subst_masklen); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } if (EXPORT_NAME (area)) - vty_out (vty, " area %s export-list %s%s", buf, - EXPORT_NAME (area), VTYNL); + vty_out (vty, " area %s export-list %s\n", buf, + EXPORT_NAME (area)); if (IMPORT_NAME (area)) - vty_out (vty, " area %s import-list %s%s", buf, - IMPORT_NAME (area), VTYNL); + vty_out (vty, " area %s import-list %s\n", buf, + IMPORT_NAME (area)); if (PREFIX_NAME_IN (area)) - vty_out (vty, " area %s filter-list prefix %s in%s", buf, - PREFIX_NAME_IN (area), VTYNL); + vty_out (vty, " area %s filter-list prefix %s in\n", buf, + PREFIX_NAME_IN (area)); if (PREFIX_NAME_OUT (area)) - vty_out (vty, " area %s filter-list prefix %s out%s", buf, - PREFIX_NAME_OUT (area), VTYNL); + vty_out (vty, " area %s filter-list prefix %s out\n", buf, + PREFIX_NAME_OUT (area)); } return 0; @@ -8554,7 +8449,7 @@ config_write_ospf_nbr_nbma (struct vty *vty, struct ospf *ospf) if (nbr_nbma->v_poll != OSPF_POLL_INTERVAL_DEFAULT) vty_out (vty, " poll-interval %d", nbr_nbma->v_poll); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } return 0; @@ -8586,32 +8481,30 @@ config_write_virtual_link (struct vty *vty, struct ospf *ospf) OSPF_IF_PARAM (oi, v_wait) != OSPF_ROUTER_DEAD_INTERVAL_DEFAULT || OSPF_IF_PARAM (oi, retransmit_interval) != OSPF_RETRANSMIT_INTERVAL_DEFAULT || OSPF_IF_PARAM (oi, transmit_delay) != OSPF_TRANSMIT_DELAY_DEFAULT) - vty_out (vty, " area %s virtual-link %s hello-interval %d retransmit-interval %d transmit-delay %d dead-interval %d%s", + vty_out (vty, " area %s virtual-link %s hello-interval %d retransmit-interval %d transmit-delay %d dead-interval %d\n", buf, inet_ntoa (vl_data->vl_peer), OSPF_IF_PARAM (oi, v_hello), OSPF_IF_PARAM (oi, retransmit_interval), OSPF_IF_PARAM (oi, transmit_delay), - OSPF_IF_PARAM (oi, v_wait), - VTYNL); + OSPF_IF_PARAM (oi, v_wait)); else - vty_out (vty, " area %s virtual-link %s%s", buf, - inet_ntoa (vl_data->vl_peer), VTYNL); + vty_out (vty, " area %s virtual-link %s\n", buf, + inet_ntoa (vl_data->vl_peer)); /* Auth key */ if (IF_DEF_PARAMS (vl_data->vl_oi->ifp)->auth_simple[0] != '\0') - vty_out (vty, " area %s virtual-link %s authentication-key %s%s", + vty_out (vty, " area %s virtual-link %s authentication-key %s\n", buf, inet_ntoa (vl_data->vl_peer), - IF_DEF_PARAMS (vl_data->vl_oi->ifp)->auth_simple, - VTYNL); + IF_DEF_PARAMS (vl_data->vl_oi->ifp)->auth_simple); /* md5 keys */ for (ALL_LIST_ELEMENTS_RO (IF_DEF_PARAMS (vl_data->vl_oi->ifp)->auth_crypt, n2, ck)) vty_out (vty, " area %s virtual-link %s" - " message-digest-key %d md5 %s%s", + " message-digest-key %d md5 %s\n", buf, inet_ntoa (vl_data->vl_peer), - ck->key_id, ck->auth_key, VTYNL); + ck->key_id, ck->auth_key); } } @@ -8651,7 +8544,7 @@ config_write_ospf_redistribute (struct vty *vty, struct ospf *ospf) if (ROUTEMAP_NAME (red)) vty_out (vty, " route-map %s", ROUTEMAP_NAME (red)); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } } @@ -8662,8 +8555,7 @@ static int config_write_ospf_default_metric (struct vty *vty, struct ospf *ospf) { if (ospf->default_metric != -1) - vty_out (vty, " default-metric %d%s", ospf->default_metric, - VTYNL); + vty_out (vty, " default-metric %d\n", ospf->default_metric); return 0; } @@ -8678,9 +8570,9 @@ config_write_ospf_distribute (struct vty *vty, struct ospf *ospf) /* distribute-list print. */ for (type = 0; type < ZEBRA_ROUTE_MAX; type++) if (DISTRIBUTE_NAME (ospf, type)) - vty_out (vty, " distribute-list %s out %s%s", + vty_out (vty, " distribute-list %s out %s\n", DISTRIBUTE_NAME (ospf, type), - zebra_route_string(type), VTYNL); + zebra_route_string(type)); /* default-information print. */ if (ospf->default_originate != DEFAULT_ORIGINATE_NONE) @@ -8703,7 +8595,7 @@ config_write_ospf_distribute (struct vty *vty, struct ospf *ospf) ROUTEMAP_NAME (red)); } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } } @@ -8718,7 +8610,7 @@ config_write_ospf_distance (struct vty *vty, struct ospf *ospf) struct ospf_distance *odistance; if (ospf->distance_all) - vty_out (vty, " distance %d%s", ospf->distance_all, VTYNL); + vty_out (vty, " distance %d\n", ospf->distance_all); if (ospf->distance_intra || ospf->distance_inter @@ -8733,16 +8625,15 @@ config_write_ospf_distance (struct vty *vty, struct ospf *ospf) if (ospf->distance_external) vty_out (vty, " external %d", ospf->distance_external); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } for (rn = route_top (ospf->distance_table); rn; rn = route_next (rn)) if ((odistance = rn->info) != NULL) { - vty_out (vty, " distance %d %s/%d %s%s", odistance->distance, + vty_out (vty, " distance %d %s/%d %s\n", odistance->distance, inet_ntoa (rn->p.u.prefix4), rn->p.prefixlen, - odistance->access_list ? odistance->access_list : "", - VTYNL); + odistance->access_list ? odistance->access_list : ""); } return 0; } @@ -8762,9 +8653,9 @@ ospf_config_write (struct vty *vty) { /* `router ospf' print. */ if (ospf->instance) - vty_out (vty, "router ospf %d%s", ospf->instance, VTYNL); + vty_out (vty, "router ospf %d\n", ospf->instance); else - vty_out (vty, "router ospf%s", VTYNL); + vty_out (vty, "router ospf\n"); write++; @@ -8773,84 +8664,84 @@ ospf_config_write (struct vty *vty) /* Router ID print. */ if (ospf->router_id_static.s_addr != 0) - vty_out (vty, " ospf router-id %s%s", - inet_ntoa (ospf->router_id_static), VTYNL); + vty_out (vty, " ospf router-id %s\n", + inet_ntoa (ospf->router_id_static)); /* ABR type print. */ if (ospf->abr_type != OSPF_ABR_DEFAULT) - vty_out (vty, " ospf abr-type %s%s", - ospf_abr_type_str[ospf->abr_type], VTYNL); + vty_out (vty, " ospf abr-type %s\n", + ospf_abr_type_str[ospf->abr_type]); /* log-adjacency-changes flag print. */ if (CHECK_FLAG(ospf->config, OSPF_LOG_ADJACENCY_CHANGES)) { if (CHECK_FLAG(ospf->config, OSPF_LOG_ADJACENCY_DETAIL)) - vty_out(vty, " log-adjacency-changes detail%s", VTYNL); + vty_out(vty, " log-adjacency-changes detail\n"); else if (!DFLT_OSPF_LOG_ADJACENCY_CHANGES) - vty_out(vty, " log-adjacency-changes%s", VTYNL); + vty_out(vty, " log-adjacency-changes\n"); } else if (DFLT_OSPF_LOG_ADJACENCY_CHANGES) { - vty_out(vty, " no log-adjacency-changes%s", VTYNL); + vty_out(vty, " no log-adjacency-changes\n"); } /* RFC1583 compatibility flag print -- Compatible with CISCO 12.1. */ if (CHECK_FLAG (ospf->config, OSPF_RFC1583_COMPATIBLE)) - vty_out (vty, " compatible rfc1583%s", VTYNL); + vty_out (vty, " compatible rfc1583\n"); /* auto-cost reference-bandwidth configuration. */ if (ospf->ref_bandwidth != OSPF_DEFAULT_REF_BANDWIDTH) { vty_out (vty, "! Important: ensure reference bandwidth " - "is consistent across all routers%s", VTYNL); - vty_out (vty, " auto-cost reference-bandwidth %d%s", - ospf->ref_bandwidth, VTYNL); + "is consistent across all routers\n"); + vty_out (vty, " auto-cost reference-bandwidth %d\n", + ospf->ref_bandwidth); } /* SPF timers print. */ if (ospf->spf_delay != OSPF_SPF_DELAY_DEFAULT || ospf->spf_holdtime != OSPF_SPF_HOLDTIME_DEFAULT || ospf->spf_max_holdtime != OSPF_SPF_MAX_HOLDTIME_DEFAULT) - vty_out (vty, " timers throttle spf %d %d %d%s", + vty_out (vty, " timers throttle spf %d %d %d\n", ospf->spf_delay, ospf->spf_holdtime, - ospf->spf_max_holdtime, VTYNL); + ospf->spf_max_holdtime); /* LSA timers print. */ if (ospf->min_ls_interval != OSPF_MIN_LS_INTERVAL) - vty_out (vty, " timers throttle lsa all %d%s", - ospf->min_ls_interval, VTYNL); + vty_out (vty, " timers throttle lsa all %d\n", + ospf->min_ls_interval); if (ospf->min_ls_arrival != OSPF_MIN_LS_ARRIVAL) - vty_out (vty, " timers lsa min-arrival %d%s", - ospf->min_ls_arrival, VTYNL); + vty_out (vty, " timers lsa min-arrival %d\n", + ospf->min_ls_arrival); /* Write multiplier print. */ if (ospf->write_oi_count != OSPF_WRITE_INTERFACE_COUNT_DEFAULT) - vty_out (vty, " ospf write-multiplier %d%s", - ospf->write_oi_count, VTYNL); + vty_out (vty, " ospf write-multiplier %d\n", + ospf->write_oi_count); /* Max-metric router-lsa print */ config_write_stub_router (vty, ospf); /* SPF refresh parameters print. */ if (ospf->lsa_refresh_interval != OSPF_LSA_REFRESH_INTERVAL_DEFAULT) - vty_out (vty, " refresh timer %d%s", - ospf->lsa_refresh_interval, VTYNL); + vty_out (vty, " refresh timer %d\n", + ospf->lsa_refresh_interval); /* Redistribute information print. */ config_write_ospf_redistribute (vty, ospf); /* passive-interface print. */ if (ospf->passive_interface_default == OSPF_IF_PASSIVE) - vty_out (vty, " passive-interface default%s", VTYNL); + vty_out (vty, " passive-interface default\n"); for (ALL_LIST_ELEMENTS_RO (om->iflist, node, ifp)) if (OSPF_IF_PARAM_CONFIGURED (IF_DEF_PARAMS (ifp), passive_interface) && IF_DEF_PARAMS (ifp)->passive_interface != ospf->passive_interface_default) { - vty_out (vty, " %spassive-interface %s%s", + vty_out (vty, " %spassive-interface %s\n", IF_DEF_PARAMS (ifp)->passive_interface ? "" : "no ", - ifp->name, VTYNL); + ifp->name); } for (ALL_LIST_ELEMENTS_RO (ospf->oiflist, node, oi)) { @@ -8865,10 +8756,10 @@ ospf_config_write (struct vty *vty) else if (oi->params->passive_interface == ospf->passive_interface_default) continue; - vty_out (vty, " %spassive-interface %s %s%s", + vty_out (vty, " %spassive-interface %s %s\n", oi->params->passive_interface ? "" : "no ", oi->ifp->name, - inet_ntoa (oi->address->u.prefix4), VTYNL); + inet_ntoa (oi->address->u.prefix4)); } /* Network area print. */ @@ -9098,7 +8989,7 @@ DEFUN (clear_ip_ospf_interface, else /* Interface name is specified. */ { if ((ifp = if_lookup_by_name (argv[idx_ifname]->arg, VRF_DEFAULT)) == NULL) - vty_out (vty, "No such interface name%s", VTYNL); + vty_out (vty, "No such interface name\n"); else ospf_interface_clear(ifp); } diff --git a/ospfd/ospf_vty.h b/ospfd/ospf_vty.h index 0bb5b6f3f..ba7b24ed9 100644 --- a/ospfd/ospf_vty.h +++ b/ospfd/ospf_vty.h @@ -28,7 +28,7 @@ retv = str2area_id ((STR), &(V), &(F)); \ if (retv < 0) \ { \ - vty_out (vty, "%% Invalid OSPF area ID%s", VTYNL); \ + vty_out (vty, "%% Invalid OSPF area ID\n"); \ return CMD_WARNING; \ } \ } @@ -39,13 +39,13 @@ retv = str2area_id ((STR), &(V), &(F)); \ if (retv < 0) \ { \ - vty_out (vty, "%% Invalid OSPF area ID%s", VTYNL); \ + vty_out (vty, "%% Invalid OSPF area ID\n"); \ return CMD_WARNING; \ } \ if (OSPF_IS_AREA_ID_BACKBONE ((V))) \ { \ - vty_out (vty, "%% You can't configure %s to backbone%s", \ - NAME, VTYNL); \ + vty_out (vty, "%% You can't configure %s to backbone\n", \ + NAME); \ } \ } diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c index 5c60aae13..e262bd8aa 100644 --- a/ospfd/ospf_zebra.c +++ b/ospfd/ospf_zebra.c @@ -1445,7 +1445,7 @@ ospf_distance_set (struct vty *vty, struct ospf *ospf, ret = str2prefix_ipv4 (ip_str, &p); if (ret == 0) { - vty_outln (vty, "Malformed prefix"); + vty_out (vty, "Malformed prefix\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1493,14 +1493,14 @@ ospf_distance_unset (struct vty *vty, struct ospf *ospf, ret = str2prefix_ipv4 (ip_str, &p); if (ret == 0) { - vty_outln (vty, "Malformed prefix"); + vty_out (vty, "Malformed prefix\n"); return CMD_WARNING_CONFIG_FAILED; } rn = route_node_lookup (ospf->distance_table, (struct prefix *) &p); if (!rn) { - vty_outln (vty, "Can't find specified prefix"); + vty_out (vty, "Can't find specified prefix\n"); return CMD_WARNING_CONFIG_FAILED; } diff --git a/pimd/pim_bfd.c b/pimd/pim_bfd.c index 2a90eea3b..af8a8e2c5 100644 --- a/pimd/pim_bfd.c +++ b/pimd/pim_bfd.c @@ -52,11 +52,11 @@ pim_bfd_write_config (struct vty *vty, struct interface *ifp) return; if (CHECK_FLAG (bfd_info->flags, BFD_FLAG_PARAM_CFG)) - vty_outln (vty, " ip pim bfd %d %d %d", + vty_out (vty, " ip pim bfd %d %d %d\n", bfd_info->detect_mult, bfd_info->required_min_rx, bfd_info->desired_min_tx); else - vty_outln (vty, " ip pim bfd"); + vty_out (vty, " ip pim bfd\n"); } /* diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index 486771003..88c43104c 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -173,8 +173,8 @@ static void pim_show_assert(struct vty *vty) now = pim_time_monotonic_sec(); - vty_outln (vty, - "Interface Address Source Group State Winner Uptime Timer"); + vty_out (vty, + "Interface Address Source Group State Winner Uptime Timer\n"); for (ALL_LIST_ELEMENTS_RO(pim_ifchannel_list, ch_node, ch)) { char ch_src_str[INET_ADDRSTRLEN]; @@ -201,7 +201,7 @@ static void pim_show_assert(struct vty *vty) pim_time_timer_to_mmss(timer, sizeof(timer), ch->t_ifassert_timer); - vty_outln (vty, "%-9s %-15s %-15s %-15s %-6s %-15s %-8s %-5s", + vty_out (vty, "%-9s %-15s %-15s %-15s %-6s %-15s %-8s %-5s\n", ch->interface->name, inet_ntoa(ifaddr), ch_src_str, @@ -220,15 +220,14 @@ static void pim_show_assert_internal(struct vty *vty) struct pim_ifchannel *ch; struct in_addr ifaddr; - vty_outln (vty, - "CA: CouldAssert%s" - "ECA: Evaluate CouldAssert%s" - "ATD: AssertTrackingDesired%s" - "eATD: Evaluate AssertTrackingDesired%s", - VTYNL, VTYNL, VTYNL, VTYNL); + vty_out (vty, + "CA: CouldAssert\n" + "ECA: Evaluate CouldAssert\n" + "ATD: AssertTrackingDesired\n" + "eATD: Evaluate AssertTrackingDesired\n\n"); - vty_outln (vty, - "Interface Address Source Group CA eCA ATD eATD"); + vty_out (vty, + "Interface Address Source Group CA eCA ATD eATD\n"); for (ALL_LIST_ELEMENTS_RO(pim_ifchannel_list, ch_node, ch)) { pim_ifp = ch->interface->info; @@ -245,7 +244,7 @@ static void pim_show_assert_internal(struct vty *vty) ch_src_str, sizeof(ch_src_str)); pim_inet4_dump("<ch_grp?>", ch->sg.grp, ch_grp_str, sizeof(ch_grp_str)); - vty_outln (vty, "%-9s %-15s %-15s %-15s %-3s %-3s %-3s %-4s", + vty_out (vty, "%-9s %-15s %-15s %-15s %-3s %-3s %-3s %-4s\n", ch->interface->name, inet_ntoa(ifaddr), ch_src_str, @@ -264,8 +263,8 @@ static void pim_show_assert_metric(struct vty *vty) struct pim_ifchannel *ch; struct in_addr ifaddr; - vty_outln (vty, - "Interface Address Source Group RPT Pref Metric Address "); + vty_out (vty, + "Interface Address Source Group RPT Pref Metric Address \n"); for (ALL_LIST_ELEMENTS_RO(pim_ifchannel_list, ch_node, ch)) { pim_ifp = ch->interface->info; @@ -289,7 +288,7 @@ static void pim_show_assert_metric(struct vty *vty) pim_inet4_dump("<addr?>", am.ip_address, addr_str, sizeof(addr_str)); - vty_outln (vty, "%-9s %-15s %-15s %-15s %-3s %4u %6u %-15s", + vty_out (vty, "%-9s %-15s %-15s %-15s %-3s %4u %6u %-15s\n", ch->interface->name, inet_ntoa(ifaddr), ch_src_str, @@ -308,8 +307,8 @@ static void pim_show_assert_winner_metric(struct vty *vty) struct pim_ifchannel *ch; struct in_addr ifaddr; - vty_outln (vty, - "Interface Address Source Group RPT Pref Metric Address "); + vty_out (vty, + "Interface Address Source Group RPT Pref Metric Address \n"); for (ALL_LIST_ELEMENTS_RO(pim_ifchannel_list, ch_node, ch)) { pim_ifp = ch->interface->info; @@ -345,7 +344,7 @@ static void pim_show_assert_winner_metric(struct vty *vty) else snprintf(metr_str, sizeof(metr_str), "%6u", am->route_metric); - vty_outln (vty, "%-9s %-15s %-15s %-15s %-3s %-4s %-6s %-15s", + vty_out (vty, "%-9s %-15s %-15s %-15s %-3s %-4s %-6s %-15s\n", ch->interface->name, inet_ntoa(ifaddr), ch_src_str, @@ -431,11 +430,11 @@ static void pim_show_membership(struct vty *vty, u_char uj) } /* scan interface channels */ if (uj) { - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); } else { - vty_outln (vty, - "Interface Address Source Group Membership"); + vty_out (vty, + "Interface Address Source Group Membership\n"); /* * Example of the json data we are traversing @@ -480,7 +479,7 @@ static void pim_show_membership(struct vty *vty, u_char uj) vty_out(vty, "%-15s ", if_field_key); json_object_object_get_ex(if_field_val, "localMembership", &json_tmp); - vty_outln (vty, "%-10s", json_object_get_string(json_tmp)); + vty_out (vty, "%-10s\n", json_object_get_string(json_tmp)); } } } @@ -491,22 +490,22 @@ static void pim_show_membership(struct vty *vty, u_char uj) static void pim_print_ifp_flags(struct vty *vty, struct interface *ifp, int mloop) { - vty_outln (vty, "Flags"); - vty_outln (vty, "-----"); - vty_outln (vty, "All Multicast : %s", + vty_out (vty, "Flags\n"); + vty_out (vty, "-----\n"); + vty_out (vty, "All Multicast : %s\n", (ifp->flags & IFF_ALLMULTI) ? "yes" : "no"); - vty_outln (vty, "Broadcast : %s", + vty_out (vty, "Broadcast : %s\n", if_is_broadcast(ifp) ? "yes" : "no"); - vty_outln (vty, "Deleted : %s", + vty_out (vty, "Deleted : %s\n", PIM_IF_IS_DELETED(ifp) ? "yes" : "no"); - vty_outln (vty, "Interface Index : %d", ifp->ifindex); - vty_outln (vty, "Multicast : %s", + vty_out (vty, "Interface Index : %d\n", ifp->ifindex); + vty_out (vty, "Multicast : %s\n", if_is_multicast(ifp) ? "yes" : "no"); - vty_outln (vty, "Multicast Loop : %d", mloop); - vty_outln (vty, "Promiscuous : %s", + vty_out (vty, "Multicast Loop : %d\n", mloop); + vty_out (vty, "Promiscuous : %s\n", (ifp->flags & IFF_PROMISC) ? "yes" : "no"); - vty_out (vty, VTYNL); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); + vty_out (vty, "\n"); } static void igmp_show_interfaces(struct vty *vty, u_char uj) @@ -522,8 +521,8 @@ static void igmp_show_interfaces(struct vty *vty, u_char uj) if (uj) json = json_object_new_object(); else - vty_outln (vty, - "Interface State Address V Querier Query Timer Uptime"); + vty_out (vty, + "Interface State Address V Querier Query Timer Uptime\n"); for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp)) { struct pim_interface *pim_ifp; @@ -556,7 +555,7 @@ static void igmp_show_interfaces(struct vty *vty, u_char uj) json_object_object_add(json, ifp->name, json_row); } else { - vty_outln (vty, "%-9s %5s %15s %d %7s %11s %8s", + vty_out (vty, "%-9s %5s %15s %d %7s %11s %8s\n", ifp->name, if_is_up(ifp) ? "up" : "down", inet_ntoa(igmp->ifaddr), @@ -569,7 +568,7 @@ static void igmp_show_interfaces(struct vty *vty, u_char uj) } if (uj) { - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } @@ -659,44 +658,44 @@ static void igmp_show_interfaces_single(struct vty *vty, const char *ifname, u_c json_object_object_add(json, ifp->name, json_row); } else { - vty_outln (vty, "Interface : %s", ifp->name); - vty_outln (vty, "State : %s", if_is_up(ifp) ? "up" : "down"); - vty_outln (vty, "Address : %s", + vty_out (vty, "Interface : %s\n", ifp->name); + vty_out (vty, "State : %s\n", if_is_up(ifp) ? "up" : "down"); + vty_out (vty, "Address : %s\n", inet_ntoa(pim_ifp->primary_address)); - vty_outln (vty, "Uptime : %s", uptime); - vty_outln (vty, "Version : %d", pim_ifp->igmp_version); - vty_out (vty, VTYNL); - vty_out (vty, VTYNL); - - vty_outln (vty, "Querier"); - vty_outln (vty, "-------"); - vty_outln (vty, "Querier : %s", + vty_out (vty, "Uptime : %s\n", uptime); + vty_out (vty, "Version : %d\n", pim_ifp->igmp_version); + vty_out (vty, "\n"); + vty_out (vty, "\n"); + + vty_out (vty, "Querier\n"); + vty_out (vty, "-------\n"); + vty_out (vty, "Querier : %s\n", igmp->t_igmp_query_timer ? "local" : "other"); - vty_outln (vty, "Start Count : %d", igmp->startup_query_count); - vty_outln (vty, "Query Timer : %s", query_hhmmss); - vty_outln (vty, "Other Timer : %s", other_hhmmss); - vty_out (vty, VTYNL); - vty_out (vty, VTYNL); - - vty_outln (vty, "Timers"); - vty_outln (vty, "------"); - vty_outln (vty, "Group Membership Interval : %lis", + vty_out (vty, "Start Count : %d\n", igmp->startup_query_count); + vty_out (vty, "Query Timer : %s\n", query_hhmmss); + vty_out (vty, "Other Timer : %s\n", other_hhmmss); + vty_out (vty, "\n"); + vty_out (vty, "\n"); + + vty_out (vty, "Timers\n"); + vty_out (vty, "------\n"); + vty_out (vty, "Group Membership Interval : %lis\n", gmi_msec / 1000); - vty_outln (vty, "Last Member Query Time : %lis", + vty_out (vty, "Last Member Query Time : %lis\n", lmqt_msec / 1000); - vty_outln (vty, "Older Host Present Interval : %lis", + vty_out (vty, "Older Host Present Interval : %lis\n", ohpi_msec / 1000); - vty_outln (vty, "Other Querier Present Interval : %lis", + vty_out (vty, "Other Querier Present Interval : %lis\n", oqpi_msec / 1000); - vty_outln (vty, "Query Interval : %ds", + vty_out (vty, "Query Interval : %ds\n", igmp->querier_query_interval); - vty_outln (vty, "Query Response Interval : %lis", + vty_out (vty, "Query Response Interval : %lis\n", qri_msec / 1000); - vty_outln (vty, "Robustness Variable : %d", + vty_out (vty, "Robustness Variable : %d\n", igmp->querier_robustness_variable); - vty_outln (vty, "Startup Query Interval : %ds", sqi); - vty_out (vty, VTYNL); - vty_out (vty, VTYNL); + vty_out (vty, "Startup Query Interval : %ds\n", sqi); + vty_out (vty, "\n"); + vty_out (vty, "\n"); pim_print_ifp_flags(vty, ifp, mloop); } @@ -704,12 +703,12 @@ static void igmp_show_interfaces_single(struct vty *vty, const char *ifname, u_c } if (uj) { - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else { if (!found_ifname) - vty_outln (vty, "%% No such interface"); + vty_out (vty, "%% No such interface\n"); } } @@ -721,8 +720,8 @@ static void igmp_show_interface_join(struct vty *vty) now = pim_time_monotonic_sec(); - vty_outln (vty, - "Interface Address Source Group Socket Uptime "); + vty_out (vty, + "Interface Address Source Group Socket Uptime \n"); for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp)) { struct pim_interface *pim_ifp; @@ -751,7 +750,7 @@ static void igmp_show_interface_join(struct vty *vty) pim_inet4_dump("<grp?>", ij->group_addr, group_str, sizeof(group_str)); pim_inet4_dump("<src?>", ij->source_addr, source_str, sizeof(source_str)); - vty_outln (vty, "%-9s %-15s %-15s %-15s %6d %8s", + vty_out (vty, "%-9s %-15s %-15s %-15s %6d %8s\n", ifp->name, pri_addr_str, source_str, @@ -925,23 +924,23 @@ static void pim_show_interfaces_single(struct vty *vty, const char *ifname, u_ch json_object_object_add(json, ifp->name, json_row); } else { - vty_outln (vty, "Interface : %s", ifp->name); - vty_outln (vty, "State : %s", if_is_up(ifp) ? "up" : "down"); + vty_out (vty, "Interface : %s\n", ifp->name); + vty_out (vty, "State : %s\n", if_is_up(ifp) ? "up" : "down"); if (pim_ifp->update_source.s_addr != INADDR_ANY) { - vty_outln (vty, "Use Source : %s", inet_ntoa(pim_ifp->update_source)); + vty_out (vty, "Use Source : %s\n", inet_ntoa(pim_ifp->update_source)); } if (pim_ifp->sec_addr_list) { char pbuf[PREFIX2STR_BUFFER]; - vty_outln (vty, "Address : %s (primary)", + vty_out (vty, "Address : %s (primary)\n", inet_ntoa(ifaddr)); for (ALL_LIST_ELEMENTS_RO(pim_ifp->sec_addr_list, sec_node, sec_addr)) { - vty_outln (vty, " %s", + vty_out (vty, " %s\n", prefix2str(&sec_addr->addr, pbuf, sizeof(pbuf))); } } else { - vty_outln (vty, "Address : %s", inet_ntoa(ifaddr)); + vty_out (vty, "Address : %s\n", inet_ntoa(ifaddr)); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); // PIM neighbors print_header = 1; @@ -949,32 +948,32 @@ static void pim_show_interfaces_single(struct vty *vty, const char *ifname, u_ch for (ALL_LIST_ELEMENTS_RO(pim_ifp->pim_neighbor_list, neighnode, neigh)) { if (print_header) { - vty_outln (vty, "PIM Neighbors"); - vty_outln (vty, "-------------"); + vty_out (vty, "PIM Neighbors\n"); + vty_out (vty, "-------------\n"); print_header = 0; } pim_inet4_dump("<src?>", neigh->source_addr, neigh_src_str, sizeof(neigh_src_str)); pim_time_uptime(uptime, sizeof(uptime), now - neigh->creation); pim_time_timer_to_hhmmss(expire, sizeof(expire), neigh->t_expire_timer); - vty_outln (vty, "%-15s : up for %s, holdtime expires in %s", neigh_src_str, uptime, + vty_out (vty, "%-15s : up for %s, holdtime expires in %s\n", neigh_src_str, uptime, expire); } if (!print_header) { - vty_out (vty, VTYNL); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); + vty_out (vty, "\n"); } - vty_outln (vty, "Designated Router"); - vty_outln (vty, "-----------------"); - vty_outln (vty, "Address : %s", dr_str); - vty_outln (vty, "Priority : %d", pim_ifp->pim_dr_priority); - vty_outln (vty, "Uptime : %s", dr_uptime); - vty_outln (vty, "Elections : %d", pim_ifp->pim_dr_election_count); - vty_outln (vty, "Changes : %d", pim_ifp->pim_dr_election_changes); - vty_out (vty, VTYNL); - vty_out (vty, VTYNL); + vty_out (vty, "Designated Router\n"); + vty_out (vty, "-----------------\n"); + vty_out (vty, "Address : %s\n", dr_str); + vty_out (vty, "Priority : %d\n", pim_ifp->pim_dr_priority); + vty_out (vty, "Uptime : %s\n", dr_uptime); + vty_out (vty, "Elections : %d\n", pim_ifp->pim_dr_election_count); + vty_out (vty, "Changes : %d\n", pim_ifp->pim_dr_election_changes); + vty_out (vty, "\n"); + vty_out (vty, "\n"); // FHR print_header = 1; @@ -983,77 +982,77 @@ static void pim_show_interfaces_single(struct vty *vty, const char *ifname, u_ch if (up->flags & PIM_UPSTREAM_FLAG_MASK_FHR) { if (print_header) { - vty_outln (vty, "FHR - First Hop Router"); - vty_outln (vty, "----------------------"); + vty_out (vty, "FHR - First Hop Router\n"); + vty_out (vty, "----------------------\n"); print_header = 0; } pim_inet4_dump("<src?>", up->sg.src, src_str, sizeof(src_str)); pim_inet4_dump("<grp?>", up->sg.grp, grp_str, sizeof(grp_str)); pim_time_uptime(uptime, sizeof(uptime), now - up->state_transition); - vty_outln (vty, "%s : %s is a source, uptime is %s", grp_str, src_str, + vty_out (vty, "%s : %s is a source, uptime is %s\n", grp_str, src_str, uptime); } } } if (!print_header) { - vty_out (vty, VTYNL); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); + vty_out (vty, "\n"); } - vty_outln (vty, "Hellos"); - vty_outln (vty, "------"); - vty_outln (vty, "Period : %d", pim_ifp->pim_hello_period); - vty_outln (vty, "Timer : %s", hello_timer); - vty_outln (vty, "StatStart : %s", stat_uptime); - vty_outln (vty, "Receive : %d", pim_ifp->pim_ifstat_hello_recv); - vty_outln (vty, "Receive Failed : %d", + vty_out (vty, "Hellos\n"); + vty_out (vty, "------\n"); + vty_out (vty, "Period : %d\n", pim_ifp->pim_hello_period); + vty_out (vty, "Timer : %s\n", hello_timer); + vty_out (vty, "StatStart : %s\n", stat_uptime); + vty_out (vty, "Receive : %d\n", pim_ifp->pim_ifstat_hello_recv); + vty_out (vty, "Receive Failed : %d\n", pim_ifp->pim_ifstat_hello_recvfail); - vty_outln (vty, "Send : %d", pim_ifp->pim_ifstat_hello_sent); - vty_outln (vty, "Send Failed : %d", + vty_out (vty, "Send : %d\n", pim_ifp->pim_ifstat_hello_sent); + vty_out (vty, "Send Failed : %d\n", pim_ifp->pim_ifstat_hello_sendfail); - vty_outln (vty, "Generation ID : %08x", pim_ifp->pim_generation_id); - vty_out (vty, VTYNL); - vty_out (vty, VTYNL); + vty_out (vty, "Generation ID : %08x\n", pim_ifp->pim_generation_id); + vty_out (vty, "\n"); + vty_out (vty, "\n"); pim_print_ifp_flags(vty, ifp, mloop); - vty_outln (vty, "Join Prune Interval"); - vty_outln (vty, "-------------------"); - vty_outln (vty, "LAN Delay : %s", + vty_out (vty, "Join Prune Interval\n"); + vty_out (vty, "-------------------\n"); + vty_out (vty, "LAN Delay : %s\n", pim_if_lan_delay_enabled(ifp) ? "yes" : "no"); - vty_outln (vty, "Effective Propagation Delay : %d msec", + vty_out (vty, "Effective Propagation Delay : %d msec\n", pim_if_effective_propagation_delay_msec(ifp)); - vty_outln (vty, "Effective Override Interval : %d msec", + vty_out (vty, "Effective Override Interval : %d msec\n", pim_if_effective_override_interval_msec(ifp)); - vty_outln (vty, "Join Prune Override Interval : %d msec", + vty_out (vty, "Join Prune Override Interval : %d msec\n", pim_if_jp_override_interval_msec(ifp)); - vty_out (vty, VTYNL); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); + vty_out (vty, "\n"); - vty_outln (vty, "LAN Prune Delay"); - vty_outln (vty, "---------------"); - vty_outln (vty, "Propagation Delay : %d msec", + vty_out (vty, "LAN Prune Delay\n"); + vty_out (vty, "---------------\n"); + vty_out (vty, "Propagation Delay : %d msec\n", pim_ifp->pim_propagation_delay_msec); - vty_outln (vty, "Propagation Delay (Highest) : %d msec", + vty_out (vty, "Propagation Delay (Highest) : %d msec\n", pim_ifp->pim_neighbors_highest_propagation_delay_msec); - vty_outln (vty, "Override Interval : %d msec", + vty_out (vty, "Override Interval : %d msec\n", pim_ifp->pim_override_interval_msec); - vty_outln (vty, "Override Interval (Highest) : %d msec", + vty_out (vty, "Override Interval (Highest) : %d msec\n", pim_ifp->pim_neighbors_highest_override_interval_msec); - vty_out (vty, VTYNL); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); + vty_out (vty, "\n"); } } if (uj) { - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else { if (!found_ifname) - vty_outln (vty, "%% No such interface"); + vty_out (vty, "%% No such interface\n"); } } @@ -1105,11 +1104,11 @@ static void pim_show_interfaces(struct vty *vty, u_char uj) } if (uj) { - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); } else { - vty_outln (vty, - "Interface State Address PIM Nbrs PIM DR FHR IfChannels"); + vty_out (vty, + "Interface State Address PIM Nbrs PIM DR FHR IfChannels\n"); json_object_object_foreach(json, key, val) { vty_out(vty, "%-9s ", key); @@ -1134,7 +1133,7 @@ static void pim_show_interfaces(struct vty *vty, u_char uj) vty_out(vty, "%3d ", json_object_get_int(json_tmp)); json_object_object_get_ex(val, "pimIfChannels", &json_tmp); - vty_outln (vty, "%9d", json_object_get_int(json_tmp)); + vty_out (vty, "%9d\n", json_object_get_int(json_tmp)); } } @@ -1153,16 +1152,16 @@ static void pim_show_interface_traffic (struct vty *vty, u_char uj) json = json_object_new_object (); else { - vty_out (vty, VTYNL); - vty_outln (vty, "%-12s%-17s%-17s%-17s%-17s%-17s%-17s", "Interface", + vty_out (vty, "\n"); + vty_out (vty, "%-12s%-17s%-17s%-17s%-17s%-17s%-17s\n", "Interface", " HELLO", " JOIN", " PRUNE", " REGISTER", " REGISTER-STOP", " ASSERT"); - vty_outln (vty, - "%-10s%-18s%-17s%-17s%-17s%-17s%-17s", + vty_out (vty, + "%-10s%-18s%-17s%-17s%-17s%-17s%-17s\n", "", " Rx/Tx", " Rx/Tx", " Rx/Tx", " Rx/Tx", " Rx/Tx", " Rx/Tx"); - vty_outln (vty, - "---------------------------------------------------------------------------------------------------------------"); + vty_out (vty, + "---------------------------------------------------------------------------------------------------------------\n"); } for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp)) @@ -1193,8 +1192,8 @@ static void pim_show_interface_traffic (struct vty *vty, u_char uj) } else { - vty_outln (vty, - "%-10s %8u/%-8u %7u/%-7u %7u/%-7u %7u/%-7u %7u/%-7u %7u/%-7u ", + vty_out (vty, + "%-10s %8u/%-8u %7u/%-7u %7u/%-7u %7u/%-7u %7u/%-7u %7u/%-7u \n", ifp->name, pim_ifp->pim_ifstat_hello_recv, pim_ifp->pim_ifstat_hello_sent, pim_ifp->pim_ifstat_join_recv, pim_ifp->pim_ifstat_join_send, pim_ifp->pim_ifstat_prune_recv, @@ -1208,7 +1207,7 @@ static void pim_show_interface_traffic (struct vty *vty, u_char uj) } if (uj) { - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free (json); } @@ -1227,16 +1226,16 @@ static void pim_show_interface_traffic_single (struct vty *vty, const char *ifna json = json_object_new_object (); else { - vty_out (vty, VTYNL); - vty_outln (vty, "%-12s%-17s%-17s%-17s%-17s%-17s%-17s", "Interface", + vty_out (vty, "\n"); + vty_out (vty, "%-12s%-17s%-17s%-17s%-17s%-17s%-17s\n", "Interface", " HELLO", " JOIN", " PRUNE", " REGISTER", " REGISTER-STOP", " ASSERT"); - vty_outln (vty, - "%-10s%-18s%-17s%-17s%-17s%-17s%-17s", + vty_out (vty, + "%-10s%-18s%-17s%-17s%-17s%-17s%-17s\n", "", " Rx/Tx", " Rx/Tx", " Rx/Tx", " Rx/Tx", " Rx/Tx", " Rx/Tx"); - vty_outln (vty, - "---------------------------------------------------------------------------------------------------------------"); + vty_out (vty, + "---------------------------------------------------------------------------------------------------------------\n"); } for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp)) @@ -1272,8 +1271,8 @@ static void pim_show_interface_traffic_single (struct vty *vty, const char *ifna } else { - vty_outln (vty, - "%-10s %8u/%-8u %7u/%-7u %7u/%-7u %7u/%-7u %7u/%-7u %7u/%-7u ", + vty_out (vty, + "%-10s %8u/%-8u %7u/%-7u %7u/%-7u %7u/%-7u %7u/%-7u %7u/%-7u \n", ifp->name, pim_ifp->pim_ifstat_hello_recv, pim_ifp->pim_ifstat_hello_sent, pim_ifp->pim_ifstat_join_recv, pim_ifp->pim_ifstat_join_send, pim_ifp->pim_ifstat_prune_recv, @@ -1287,14 +1286,14 @@ static void pim_show_interface_traffic_single (struct vty *vty, const char *ifna } if (uj) { - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free (json); } else { if (!found_ifname) - vty_outln (vty, "%% No such interface"); + vty_out (vty, "%% No such interface\n"); } } @@ -1315,8 +1314,8 @@ static void pim_show_join(struct vty *vty, u_char uj) if (uj) json = json_object_new_object(); else - vty_outln (vty, - "Interface Address Source Group State Uptime Expire Prune"); + vty_out (vty, + "Interface Address Source Group State Uptime Expire Prune\n"); for (ALL_LIST_ELEMENTS_RO(pim_ifchannel_list, ch_node, ch)) { @@ -1374,7 +1373,7 @@ static void pim_show_join(struct vty *vty, u_char uj) else json_object_object_add(json_grp, ch_src_str, json_row); } else { - vty_outln (vty, "%-9s %-15s %-15s %-15s %-6s %8s %-6s %5s", + vty_out (vty, "%-9s %-15s %-15s %-15s %-6s %8s %-6s %5s\n", ch->interface->name, inet_ntoa(ifaddr), ch_src_str, @@ -1387,7 +1386,7 @@ static void pim_show_join(struct vty *vty, u_char uj) } /* scan interface channels */ if (uj) { - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } @@ -1512,44 +1511,44 @@ static void pim_show_neighbors_single(struct vty *vty, const char *neighbor, u_c json_object_object_add(json_ifp, neigh_src_str, json_row); } else { - vty_outln (vty, "Interface : %s", ifp->name); - vty_outln (vty, "Neighbor : %s", neigh_src_str); - vty_outln (vty, " Uptime : %s", uptime); - vty_outln (vty, " Holdtime : %s", expire); - vty_outln (vty, " DR Priority : %d", + vty_out (vty, "Interface : %s\n", ifp->name); + vty_out (vty, "Neighbor : %s\n", neigh_src_str); + vty_out (vty, " Uptime : %s\n", uptime); + vty_out (vty, " Holdtime : %s\n", expire); + vty_out (vty, " DR Priority : %d\n", neigh->dr_priority); - vty_outln (vty, " Generation ID : %08x", + vty_out (vty, " Generation ID : %08x\n", neigh->generation_id); - vty_outln (vty, " Override Interval (msec) : %d", + vty_out (vty, " Override Interval (msec) : %d\n", neigh->override_interval_msec); - vty_outln (vty, " Propagation Delay (msec) : %d", + vty_out (vty, " Propagation Delay (msec) : %d\n", neigh->propagation_delay_msec); - vty_outln (vty, " Hello Option - Address List : %s", + vty_out (vty, " Hello Option - Address List : %s\n", option_address_list ? "yes" : "no"); - vty_outln (vty, " Hello Option - DR Priority : %s", + vty_out (vty, " Hello Option - DR Priority : %s\n", option_dr_priority ? "yes" : "no"); - vty_outln (vty, " Hello Option - Generation ID : %s", + vty_out (vty, " Hello Option - Generation ID : %s\n", option_generation_id ? "yes" : "no"); - vty_outln (vty, " Hello Option - Holdtime : %s", + vty_out (vty, " Hello Option - Holdtime : %s\n", option_holdtime ? "yes" : "no"); - vty_outln (vty, " Hello Option - LAN Prune Delay : %s", + vty_out (vty, " Hello Option - LAN Prune Delay : %s\n", option_lan_prune_delay ? "yes" : "no"); - vty_outln (vty, " Hello Option - T-bit : %s", + vty_out (vty, " Hello Option - T-bit : %s\n", option_t_bit ? "yes" : "no"); pim_bfd_show_info (vty, neigh->bfd_info, json_ifp, uj, 0); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } } if (uj) { - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else { { if (!found_neighbor) - vty_outln (vty, "%% No such interface or neighbor"); + vty_out (vty, "%% No such interface or neighbor\n"); } } } @@ -1572,8 +1571,7 @@ pim_show_state(struct vty *vty, const char *src_or_group, const char *group, u_c json = json_object_new_object(); } else { vty_out(vty, "Codes: J -> Pim Join, I -> IGMP Report, S -> Source, * -> Inherited from (*,G)"); - vty_outln (vty, "%sInstalled Source Group IIF OIL", - VTYNL); + vty_out (vty, "\nInstalled Source Group IIF OIL\n"); } for (ALL_LIST_ELEMENTS_RO(pim_channel_oil_list, node, c_oil)) { @@ -1690,16 +1688,16 @@ pim_show_state(struct vty *vty, const char *src_or_group, const char *group, u_c } if (!uj) - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } if (uj) { - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else { - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } @@ -1723,7 +1721,7 @@ static void pim_show_neighbors(struct vty *vty, u_char uj) if (uj) { json = json_object_new_object(); } else { - vty_outln (vty, "Interface Neighbor Uptime Holdtime DR Pri"); + vty_out (vty, "Interface Neighbor Uptime Holdtime DR Pri\n"); } for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp)) { @@ -1755,7 +1753,7 @@ static void pim_show_neighbors(struct vty *vty, u_char uj) json_object_object_add(json_ifp_rows, neigh_src_str, json_row); } else { - vty_outln (vty, "%-9s %15s %8s %8s %6d", + vty_out (vty, "%-9s %15s %8s %8s %6d\n", ifp->name, neigh_src_str, uptime, @@ -1771,7 +1769,7 @@ static void pim_show_neighbors(struct vty *vty, u_char uj) } if (uj) { - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } @@ -1782,8 +1780,8 @@ static void pim_show_neighbors_secondary(struct vty *vty) struct listnode *node; struct interface *ifp; - vty_outln (vty, - "Interface Address Neighbor Secondary "); + vty_out (vty, + "Interface Address Neighbor Secondary \n"); for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp)) { struct pim_interface *pim_ifp; @@ -1817,7 +1815,7 @@ static void pim_show_neighbors_secondary(struct vty *vty) prefix2str(p, neigh_sec_str, sizeof(neigh_sec_str)); - vty_outln (vty, "%-9s %-15s %-15s %-15s", + vty_out (vty, "%-9s %-15s %-15s %-15s\n", ifp->name, inet_ntoa(ifaddr), neigh_src_str, @@ -1905,8 +1903,8 @@ static void pim_show_upstream(struct vty *vty, u_char uj) if (uj) json = json_object_new_object(); else - vty_outln (vty, - "Iif Source Group State Uptime JoinTimer RSTimer KATimer RefCnt"); + vty_out (vty, + "Iif Source Group State Uptime JoinTimer RSTimer KATimer RefCnt\n"); for (ALL_LIST_ELEMENTS_RO(pim_upstream_list, upnode, up)) { char src_str[INET_ADDRSTRLEN]; @@ -1973,7 +1971,7 @@ static void pim_show_upstream(struct vty *vty, u_char uj) json_object_int_add(json_row, "sptBit", up->sptbit); json_object_object_add(json_group, src_str, json_row); } else { - vty_outln (vty, "%-10s%-15s %-15s %-11s %-8s %-9s %-9s %-9s %6d", + vty_out (vty, "%-10s%-15s %-15s %-11s %-8s %-9s %-9s %-9s %6d\n", up->rpf.source_nexthop.interface->name, src_str, grp_str, @@ -1987,7 +1985,7 @@ static void pim_show_upstream(struct vty *vty, u_char uj) } if (uj) { - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } @@ -2007,8 +2005,8 @@ static void pim_show_join_desired(struct vty *vty, u_char uj) if (uj) json = json_object_new_object(); else - vty_outln (vty, - "Interface Source Group LostAssert Joins PimInclude JoinDesired EvalJD"); + vty_out (vty, + "Interface Source Group LostAssert Joins PimInclude JoinDesired EvalJD\n"); /* scan per-interface (S,G) state */ for (ALL_LIST_ELEMENTS_RO(pim_ifchannel_list, chnode, ch)) { @@ -2051,7 +2049,7 @@ static void pim_show_join_desired(struct vty *vty, u_char uj) json_object_object_add(json_group, src_str, json_row); } else { - vty_outln (vty, "%-9s %-15s %-15s %-10s %-5s %-10s %-11s %-6s", + vty_out (vty, "%-9s %-15s %-15s %-10s %-5s %-10s %-11s %-6s\n", ch->interface->name, src_str, grp_str, @@ -2064,7 +2062,7 @@ static void pim_show_join_desired(struct vty *vty, u_char uj) } if (uj) { - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } @@ -2081,8 +2079,8 @@ static void pim_show_upstream_rpf(struct vty *vty, u_char uj) if (uj) json = json_object_new_object(); else - vty_outln (vty, - "Source Group RpfIface RibNextHop RpfAddress "); + vty_out (vty, + "Source Group RpfIface RibNextHop RpfAddress \n"); for (ALL_LIST_ELEMENTS_RO(pim_upstream_list, upnode, up)) { char src_str[INET_ADDRSTRLEN]; @@ -2118,7 +2116,7 @@ static void pim_show_upstream_rpf(struct vty *vty, u_char uj) json_object_string_add(json_row, "rpfAddress", rpf_addr_str); json_object_object_add(json_group, src_str, json_row); } else { - vty_outln (vty, "%-15s %-15s %-8s %-15s %-15s", + vty_out (vty, "%-15s %-15s %-8s %-15s %-15s\n", src_str, grp_str, rpf_ifname, @@ -2128,7 +2126,7 @@ static void pim_show_upstream_rpf(struct vty *vty, u_char uj) } if (uj) { - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } @@ -2149,20 +2147,20 @@ static void show_rpf_refresh_stats(struct vty *vty, time_t now, json_object *jso json_object_int_add(json, "nexthopLookups", qpim_nexthop_lookups); json_object_int_add(json, "nexthopLookupsAvoided", nexthop_lookups_avoided); } else { - vty_outln (vty, - "RPF Cache Refresh Delay: %ld msecs%s" - "RPF Cache Refresh Timer: %ld msecs%s" - "RPF Cache Refresh Requests: %lld%s" - "RPF Cache Refresh Events: %lld%s" - "RPF Cache Refresh Last: %s%s" - "Nexthop Lookups: %lld%s" - "Nexthop Lookups Avoided: %lld", - qpim_rpf_cache_refresh_delay_msec, VTYNL, - pim_time_timer_remain_msec(qpim_rpf_cache_refresher), VTYNL, - (long long)qpim_rpf_cache_refresh_requests, VTYNL, - (long long)qpim_rpf_cache_refresh_events, VTYNL, - refresh_uptime, VTYNL, - (long long) qpim_nexthop_lookups, VTYNL, + vty_out (vty, + "RPF Cache Refresh Delay: %ld msecs\n" + "RPF Cache Refresh Timer: %ld msecs\n" + "RPF Cache Refresh Requests: %lld\n" + "RPF Cache Refresh Events: %lld\n" + "RPF Cache Refresh Last: %s\n" + "Nexthop Lookups: %lld\n" + "Nexthop Lookups Avoided: %lld\n", + qpim_rpf_cache_refresh_delay_msec, + pim_time_timer_remain_msec(qpim_rpf_cache_refresher), + (long long)qpim_rpf_cache_refresh_requests, + (long long)qpim_rpf_cache_refresh_events, + refresh_uptime, + (long long) qpim_nexthop_lookups, (long long)nexthop_lookups_avoided); } } @@ -2177,12 +2175,12 @@ static void show_scan_oil_stats(struct vty *vty, time_t now) pim_time_uptime_begin(uptime_mroute_add, sizeof(uptime_mroute_add), now, qpim_mroute_add_last); pim_time_uptime_begin(uptime_mroute_del, sizeof(uptime_mroute_del), now, qpim_mroute_del_last); - vty_outln (vty, - "Scan OIL - Last: %s Events: %lld%s" - "MFC Add - Last: %s Events: %lld%s" - "MFC Del - Last: %s Events: %lld", - uptime_scan_oil, (long long) qpim_scan_oil_events, VTYNL, - uptime_mroute_add, (long long) qpim_mroute_add_events, VTYNL, + vty_out (vty, + "Scan OIL - Last: %s Events: %lld\n" + "MFC Add - Last: %s Events: %lld\n" + "MFC Del - Last: %s Events: %lld\n", + uptime_scan_oil, (long long) qpim_scan_oil_events, + uptime_mroute_add, (long long) qpim_mroute_add_events, uptime_mroute_del, (long long)qpim_mroute_del_events); } @@ -2200,9 +2198,9 @@ static void pim_show_rpf(struct vty *vty, u_char uj) show_rpf_refresh_stats(vty, now, json); } else { show_rpf_refresh_stats(vty, now, json); - vty_out (vty, VTYNL); - vty_outln (vty, - "Source Group RpfIface RpfAddress RibNextHop Metric Pref"); + vty_out (vty, "\n"); + vty_out (vty, + "Source Group RpfIface RpfAddress RibNextHop Metric Pref\n"); } for (ALL_LIST_ELEMENTS_RO(pim_upstream_list, up_node, up)) { @@ -2239,7 +2237,7 @@ static void pim_show_rpf(struct vty *vty, u_char uj) json_object_object_add(json_group, src_str, json_row); } else { - vty_outln (vty, "%-15s %-15s %-8s %-15s %-15s %6d %4d", + vty_out (vty, "%-15s %-15s %-8s %-15s %-15s %6d %4d\n", src_str, grp_str, rpf_ifname, @@ -2251,7 +2249,7 @@ static void pim_show_rpf(struct vty *vty, u_char uj) } if (uj) { - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } @@ -2277,7 +2275,7 @@ pim_print_pnc_cache_walkcb (struct hash_backet *backet, void *arg) vty_out (vty, "%-15s ", inet_ntoa (pnc->rpf.rpf_addr.u.prefix4)); vty_out (vty, "%-14s ", ifp ? ifp->name : "NULL"); vty_out (vty, "%s ", inet_ntoa (nh_node->gate.ipv4)); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } return CMD_SUCCESS; } @@ -2288,14 +2286,14 @@ pim_show_nexthop (struct vty *vty) if (pimg && !pimg->rpf_hash) { - vty_outln (vty, "no nexthop cache "); + vty_out (vty, "no nexthop cache \n"); return; } - vty_outln (vty, "Number of registered addresses: %lu ", + vty_out (vty, "Number of registered addresses: %lu \n", pimg->rpf_hash->count); - vty_outln (vty, "Address Interface Nexthop"); - vty_outln (vty, "-------------------------------------------"); + vty_out (vty, "Address Interface Nexthop\n"); + vty_out (vty, "-------------------------------------------\n"); hash_walk (pimg->rpf_hash, pim_print_pnc_cache_walkcb, vty); @@ -2315,8 +2313,8 @@ static void igmp_show_groups(struct vty *vty, u_char uj) if (uj) json = json_object_new_object(); else - vty_outln (vty, - "Interface Address Group Mode Timer Srcs V Uptime "); + vty_out (vty, + "Interface Address Group Mode Timer Srcs V Uptime \n"); /* scan interfaces */ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), ifnode, ifp)) { @@ -2368,7 +2366,7 @@ static void igmp_show_groups(struct vty *vty, u_char uj) json_object_object_add(json_iface, group_str, json_row); } else { - vty_outln (vty, "%-9s %-15s %-15s %4s %8s %4d %d %8s", + vty_out (vty, "%-9s %-15s %-15s %4s %8s %4d %d %8s\n", ifp->name, ifaddr_str, group_str, @@ -2383,7 +2381,7 @@ static void igmp_show_groups(struct vty *vty, u_char uj) } /* scan interfaces */ if (uj) { - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } @@ -2394,8 +2392,8 @@ static void igmp_show_group_retransmission(struct vty *vty) struct listnode *ifnode; struct interface *ifp; - vty_outln (vty, - "Interface Address Group RetTimer Counter RetSrcs"); + vty_out (vty, + "Interface Address Group RetTimer Counter RetSrcs\n"); /* scan interfaces */ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), ifnode, ifp)) { @@ -2433,7 +2431,7 @@ static void igmp_show_group_retransmission(struct vty *vty) } } - vty_outln (vty, "%-9s %-15s %-15s %-8s %7d %7d", + vty_out (vty, "%-9s %-15s %-15s %-8s %7d %7d\n", ifp->name, ifaddr_str, group_str, @@ -2454,8 +2452,8 @@ static void igmp_show_sources(struct vty *vty) now = pim_time_monotonic_sec(); - vty_outln (vty, - "Interface Address Group Source Timer Fwd Uptime "); + vty_out (vty, + "Interface Address Group Source Timer Fwd Uptime \n"); /* scan interfaces */ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), ifnode, ifp)) { @@ -2494,7 +2492,7 @@ static void igmp_show_sources(struct vty *vty) pim_time_uptime(uptime, sizeof(uptime), now - src->source_creation); - vty_outln (vty, "%-9s %-15s %-15s %-15s %5s %3s %8s", + vty_out (vty, "%-9s %-15s %-15s %-15s %5s %3s %8s\n", ifp->name, ifaddr_str, group_str, @@ -2514,8 +2512,8 @@ static void igmp_show_source_retransmission(struct vty *vty) struct listnode *ifnode; struct interface *ifp; - vty_outln (vty, - "Interface Address Group Source Counter"); + vty_out (vty, + "Interface Address Group Source Counter\n"); /* scan interfaces */ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), ifnode, ifp)) { @@ -2548,7 +2546,7 @@ static void igmp_show_source_retransmission(struct vty *vty) pim_inet4_dump("<source?>", src->source_addr, source_str, sizeof(source_str)); - vty_outln (vty, "%-9s %-15s %-15s %-15s %7d", + vty_out (vty, "%-9s %-15s %-15s %-15s %7d\n", ifp->name, ifaddr_str, group_str, @@ -3113,14 +3111,14 @@ DEFUN (show_ip_pim_nexthop_lookup, result = inet_pton (AF_INET, addr_str, &src_addr); if (result <= 0) { - vty_outln (vty, "Bad unicast address %s: errno=%d: %s", + vty_out (vty, "Bad unicast address %s: errno=%d: %s\n", addr_str, errno, safe_strerror(errno)); return CMD_WARNING; } if (pim_is_group_224_4 (src_addr)) { - vty_outln (vty, "Invalid argument. Expected Valid Source Address."); + vty_out (vty, "Invalid argument. Expected Valid Source Address.\n"); return CMD_WARNING; } @@ -3128,15 +3126,15 @@ DEFUN (show_ip_pim_nexthop_lookup, result = inet_pton (AF_INET, addr_str1, &grp_addr); if (result <= 0) { - vty_outln (vty, "Bad unicast address %s: errno=%d: %s", + vty_out (vty, "Bad unicast address %s: errno=%d: %s\n", addr_str, errno, safe_strerror(errno)); return CMD_WARNING; } if (!pim_is_group_224_4 (grp_addr)) { - vty_outln (vty, - "Invalid argument. Expected Valid Multicast Group Address."); + vty_out (vty, + "Invalid argument. Expected Valid Multicast Group Address.\n"); return CMD_WARNING; } @@ -3163,7 +3161,7 @@ DEFUN (show_ip_pim_nexthop_lookup, pim_addr_dump ("<grp?>", &grp, grp_str, sizeof (grp_str)); pim_addr_dump ("<nexthop?>", &nexthop.mrib_nexthop_addr, nexthop_addr_str, sizeof (nexthop_addr_str)); - vty_outln (vty, "Group %s --- Nexthop %s Interface %s ", grp_str, + vty_out (vty, "Group %s --- Nexthop %s Interface %s \n", grp_str, nexthop_addr_str, nexthop.interface->name); return CMD_SUCCESS; @@ -3196,10 +3194,10 @@ static void show_multicast_interfaces(struct vty *vty) struct listnode *node; struct interface *ifp; - vty_out (vty, VTYNL); + vty_out (vty, "\n"); - vty_outln (vty, - "Interface Address ifi Vif PktsIn PktsOut BytesIn BytesOut"); + vty_out (vty, + "Interface Address ifi Vif PktsIn PktsOut BytesIn BytesOut\n"); for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp)) { struct pim_interface *pim_ifp; @@ -3215,18 +3213,17 @@ static void show_multicast_interfaces(struct vty *vty) vreq.vifi = pim_ifp->mroute_vif_index; if (ioctl(qpim_mroute_socket_fd, SIOCGETVIFCNT, &vreq)) { - zlog_warn("ioctl(SIOCGETVIFCNT=%lu) failure for interface %s vif_index=%d: errno=%d: %s%s", + zlog_warn("ioctl(SIOCGETVIFCNT=%lu) failure for interface %s vif_index=%d: errno=%d: %s\n", (unsigned long)SIOCGETVIFCNT, ifp->name, pim_ifp->mroute_vif_index, errno, - safe_strerror(errno), - VTYNL); + safe_strerror(errno)); } ifaddr = pim_ifp->primary_address; - vty_outln (vty, "%-9s %-15s %3d %3d %7lu %7lu %10lu %10lu", + vty_out (vty, "%-9s %-15s %3d %3d %7lu %7lu %10lu %10lu\n", ifp->name, inet_ntoa(ifaddr), ifp->ifindex, @@ -3249,37 +3246,37 @@ DEFUN (show_ip_multicast, char uptime[10]; - vty_outln (vty, "Mroute socket descriptor: %d", + vty_out (vty, "Mroute socket descriptor: %d\n", qpim_mroute_socket_fd); pim_time_uptime(uptime, sizeof(uptime), now - qpim_mroute_socket_creation); - vty_outln (vty, "Mroute socket uptime: %s", + vty_out (vty, "Mroute socket uptime: %s\n", uptime); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); pim_zebra_zclient_update (vty); pim_zlookup_show_ip_multicast (vty); - vty_out (vty, VTYNL); - vty_outln (vty, "Maximum highest VifIndex: %d", + vty_out (vty, "\n"); + vty_out (vty, "Maximum highest VifIndex: %d\n", PIM_MAX_USABLE_VIFS); - vty_out (vty, VTYNL); - vty_outln (vty, "Upstream Join Timer: %d secs", + vty_out (vty, "\n"); + vty_out (vty, "Upstream Join Timer: %d secs\n", qpim_t_periodic); - vty_outln (vty, "Join/Prune Holdtime: %d secs", + vty_out (vty, "Join/Prune Holdtime: %d secs\n", PIM_JP_HOLDTIME); - vty_outln (vty, "PIM ECMP: %s", + vty_out (vty, "PIM ECMP: %s\n", qpim_ecmp_enable ? "Enable" : "Disable"); - vty_outln (vty, "PIM ECMP Rebalance: %s", + vty_out (vty, "PIM ECMP Rebalance: %s\n", qpim_ecmp_rebalance_enable ? "Enable" : "Disable"); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); show_rpf_refresh_stats(vty, now, NULL); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); show_scan_oil_stats(vty, now); @@ -3312,8 +3309,8 @@ static void show_mroute(struct vty *vty, u_char uj) if (uj) { json = json_object_new_object(); } else { - vty_outln (vty, - "Source Group Proto Input Output TTL Uptime"); + vty_out (vty, + "Source Group Proto Input Output TTL Uptime\n"); } now = pim_time_monotonic_sec(); @@ -3424,7 +3421,7 @@ static void show_mroute(struct vty *vty, u_char uj) strcpy(proto, "STAR"); } - vty_outln (vty, "%-15s %-15s %-6s %-10s %-10s %-3d %8s", + vty_out (vty, "%-15s %-15s %-6s %-10s %-10s %-3d %8s\n", src_str, grp_str, proto, @@ -3444,7 +3441,7 @@ static void show_mroute(struct vty *vty, u_char uj) } if (!uj && !found_oif) { - vty_outln (vty, "%-15s %-15s %-6s %-10s %-10s %-3d %8s", + vty_out (vty, "%-15s %-15s %-6s %-10s %-10s %-3d %8s\n", src_str, grp_str, "none", @@ -3531,7 +3528,7 @@ static void show_mroute(struct vty *vty, u_char uj) } json_object_object_add(json_oil, out_ifname, json_ifp_out); } else { - vty_outln (vty, "%-15s %-15s %-6s %-10s %-10s %-3d %8s", + vty_out (vty, "%-15s %-15s %-6s %-10s %-10s %-3d %8s\n", src_str, grp_str, proto, @@ -3550,7 +3547,7 @@ static void show_mroute(struct vty *vty, u_char uj) } if (!uj && !found_oif) { - vty_outln (vty, "%-15s %-15s %-6s %-10s %-10s %-3d %8s", + vty_out (vty, "%-15s %-15s %-6s %-10s %-10s %-3d %8s\n", src_str, grp_str, proto, @@ -3562,7 +3559,7 @@ static void show_mroute(struct vty *vty, u_char uj) } if (uj) { - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } @@ -3587,10 +3584,10 @@ static void show_mroute_count(struct vty *vty) struct channel_oil *c_oil; struct static_route *s_route; - vty_out (vty, VTYNL); + vty_out (vty, "\n"); - vty_outln (vty, - "Source Group LastUsed Packets Bytes WrongIf "); + vty_out (vty, + "Source Group LastUsed Packets Bytes WrongIf \n"); /* Print PIM and IGMP route counts */ for (ALL_LIST_ELEMENTS_RO(pim_channel_oil_list, node, c_oil)) { @@ -3605,7 +3602,7 @@ static void show_mroute_count(struct vty *vty) pim_inet4_dump("<group?>", c_oil->oil.mfcc_mcastgrp, group_str, sizeof(group_str)); pim_inet4_dump("<source?>", c_oil->oil.mfcc_origin, source_str, sizeof(source_str)); - vty_outln (vty, "%-15s %-15s %-8llu %-7ld %-10ld %-7ld", + vty_out (vty, "%-15s %-15s %-8llu %-7ld %-10ld %-7ld\n", source_str, group_str, c_oil->cc.lastused/100, @@ -3627,7 +3624,7 @@ static void show_mroute_count(struct vty *vty) pim_inet4_dump("<group?>", s_route->c_oil.oil.mfcc_mcastgrp, group_str, sizeof(group_str)); pim_inet4_dump("<source?>", s_route->c_oil.oil.mfcc_origin, source_str, sizeof(source_str)); - vty_outln (vty, "%-15s %-15s %-8llu %-7ld %-10ld %-7ld", + vty_out (vty, "%-15s %-15s %-8llu %-7ld %-10ld %-7ld\n", source_str, group_str, s_route->c_oil.cc.lastused, @@ -3668,24 +3665,24 @@ DEFUN (show_ip_rib, addr_str = argv[idx_ipv4]->arg; result = inet_pton(AF_INET, addr_str, &addr); if (result <= 0) { - vty_outln (vty, "Bad unicast address %s: errno=%d: %s", + vty_out (vty, "Bad unicast address %s: errno=%d: %s\n", addr_str, errno, safe_strerror(errno)); return CMD_WARNING; } if (pim_nexthop_lookup(&nexthop, addr, 0)) { - vty_outln (vty, "Failure querying RIB nexthop for unicast address %s", + vty_out (vty, "Failure querying RIB nexthop for unicast address %s\n", addr_str); return CMD_WARNING; } - vty_outln (vty, - "Address NextHop Interface Metric Preference"); + vty_out (vty, + "Address NextHop Interface Metric Preference\n"); pim_addr_dump("<nexthop?>", &nexthop.mrib_nexthop_addr, nexthop_addr_str, sizeof(nexthop_addr_str)); - vty_outln (vty, "%-15s %-15s %-9s %6d %10d", + vty_out (vty, "%-15s %-15s %-9s %6d %10d\n", addr_str, nexthop_addr_str, nexthop.interface ? nexthop.interface->name : "<ifname?>", @@ -3701,8 +3698,8 @@ static void show_ssmpingd(struct vty *vty) struct ssmpingd_sock *ss; time_t now; - vty_outln (vty, - "Source Socket Address Port Uptime Requests"); + vty_out (vty, + "Source Socket Address Port Uptime Requests\n"); if (!qpim_ssmpingd_list) return; @@ -3719,14 +3716,14 @@ static void show_ssmpingd(struct vty *vty) pim_inet4_dump("<src?>", ss->source_addr, source_str, sizeof(source_str)); if (pim_socket_getsockname(ss->sock_fd, (struct sockaddr *) &bind_addr, &len)) { - vty_outln (vty, "%% Failure reading socket name for ssmpingd source %s on fd=%d", + vty_out (vty, "%% Failure reading socket name for ssmpingd source %s on fd=%d\n", source_str, ss->sock_fd); } pim_inet4_dump("<addr?>", bind_addr.sin_addr, bind_addr_str, sizeof(bind_addr_str)); pim_time_uptime(ss_uptime, sizeof(ss_uptime), now - ss->creation); - vty_outln (vty, "%-15s %6d %-15s %5d %8s %8lld", + vty_out (vty, "%-15s %6d %-15s %5d %8s %8lld\n", source_str, ss->sock_fd, bind_addr_str, @@ -3756,45 +3753,45 @@ pim_rp_cmd_worker (struct vty *vty, const char *rp, const char *group, const cha if (result == PIM_MALLOC_FAIL) { - vty_outln (vty, "%% Out of memory"); + vty_out (vty, "%% Out of memory\n"); return CMD_WARNING_CONFIG_FAILED; } if (result == PIM_GROUP_BAD_ADDRESS) { - vty_outln (vty, "%% Bad group address specified: %s", group); + vty_out (vty, "%% Bad group address specified: %s\n", group); return CMD_WARNING_CONFIG_FAILED; } if (result == PIM_RP_BAD_ADDRESS) { - vty_outln (vty, "%% Bad RP address specified: %s", rp); + vty_out (vty, "%% Bad RP address specified: %s\n", rp); return CMD_WARNING_CONFIG_FAILED; } if (result == PIM_RP_NO_PATH) { - vty_outln (vty, "%% No Path to RP address specified: %s", rp); + vty_out (vty, "%% No Path to RP address specified: %s\n", rp); return CMD_WARNING_CONFIG_FAILED; } if (result == PIM_GROUP_OVERLAP) { - vty_outln (vty, "%% Group range specified cannot overlap"); + vty_out (vty, "%% Group range specified cannot overlap\n"); return CMD_WARNING_CONFIG_FAILED; } if (result == PIM_GROUP_PFXLIST_OVERLAP) { - vty_outln (vty, - "%% This group is already covered by a RP prefix-list"); + vty_out (vty, + "%% This group is already covered by a RP prefix-list\n"); return CMD_WARNING_CONFIG_FAILED; } if (result == PIM_RP_PFXLIST_IN_USE) { - vty_outln (vty, - "%% The same prefix-list cannot be applied to multiple RPs"); + vty_out (vty, + "%% The same prefix-list cannot be applied to multiple RPs\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -4042,19 +4039,19 @@ pim_no_rp_cmd_worker (struct vty *vty, const char *rp, const char *group, if (result == PIM_GROUP_BAD_ADDRESS) { - vty_outln (vty, "%% Bad group address specified: %s", group); + vty_out (vty, "%% Bad group address specified: %s\n", group); return CMD_WARNING_CONFIG_FAILED; } if (result == PIM_RP_BAD_ADDRESS) { - vty_outln (vty, "%% Bad RP address specified: %s", rp); + vty_out (vty, "%% Bad RP address specified: %s\n", rp); return CMD_WARNING_CONFIG_FAILED; } if (result == PIM_RP_NOT_FOUND) { - vty_outln (vty, "%% Unable to find specified RP"); + vty_out (vty, "%% Unable to find specified RP\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -4104,13 +4101,13 @@ pim_ssm_cmd_worker (struct vty *vty, const char *plist) switch (result) { case PIM_SSM_ERR_NO_VRF: - vty_outln (vty, "%% VRF doesn't exist"); + vty_out (vty, "%% VRF doesn't exist\n"); break; case PIM_SSM_ERR_DUP: - vty_outln (vty, "%% duplicate config"); + vty_out (vty, "%% duplicate config\n"); break; default: - vty_outln (vty, "%% ssm range config failed"); + vty_out (vty, "%% ssm range config failed\n"); } return CMD_WARNING_CONFIG_FAILED; @@ -4155,7 +4152,7 @@ DEFUN (no_ip_pim_ssm_prefix_list_name, if (ssm->plist_name && !strcmp(ssm->plist_name, argv[0]->arg)) return pim_ssm_cmd_worker (vty, NULL); - vty_outln (vty, "%% pim ssm prefix-list %s doesn't exist", + vty_out (vty, "%% pim ssm prefix-list %s doesn't exist\n", argv[0]->arg); return CMD_WARNING_CONFIG_FAILED; @@ -4172,12 +4169,12 @@ ip_pim_ssm_show_group_range(struct vty *vty, u_char uj) json_object *json; json = json_object_new_object(); json_object_string_add(json, "ssmGroups", range_str); - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else - vty_outln (vty, "SSM group range : %s", range_str); + vty_out (vty, "SSM group range : %s\n", range_str); } DEFUN (show_ip_pim_ssm_range, @@ -4218,12 +4215,12 @@ ip_pim_ssm_show_group_type(struct vty *vty, u_char uj, const char *group) json_object *json; json = json_object_new_object(); json_object_string_add(json, "groupType", type_str); - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else - vty_outln (vty, "Group type : %s", type_str); + vty_out (vty, "Group type : %s\n", type_str); } DEFUN (show_ip_pim_group_type, @@ -4258,8 +4255,8 @@ DEFUN_HIDDEN (no_ip_multicast_routing, IP_STR "Enable IP multicast forwarding\n") { - vty_outln (vty, - "Command is Disabled and will be removed in a future version"); + vty_out (vty, + "Command is Disabled and will be removed in a future version\n"); return CMD_SUCCESS; } @@ -4277,14 +4274,14 @@ DEFUN (ip_ssmpingd, result = inet_pton(AF_INET, source_str, &source_addr); if (result <= 0) { - vty_outln (vty, "%% Bad source address %s: errno=%d: %s", + vty_out (vty, "%% Bad source address %s: errno=%d: %s\n", source_str, errno, safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } result = pim_ssmpingd_start(source_addr); if (result) { - vty_outln (vty, "%% Failure starting ssmpingd for source %s: %d", + vty_out (vty, "%% Failure starting ssmpingd for source %s: %d\n", source_str, result); return CMD_WARNING_CONFIG_FAILED; } @@ -4307,14 +4304,14 @@ DEFUN (no_ip_ssmpingd, result = inet_pton(AF_INET, source_str, &source_addr); if (result <= 0) { - vty_outln (vty, "%% Bad source address %s: errno=%d: %s", + vty_out (vty, "%% Bad source address %s: errno=%d: %s\n", source_str, errno, safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } result = pim_ssmpingd_stop(source_addr); if (result) { - vty_outln (vty, "%% Failure stopping ssmpingd for source %s: %d", + vty_out (vty, "%% Failure stopping ssmpingd for source %s: %d\n", source_str, result); return CMD_WARNING_CONFIG_FAILED; } @@ -4388,7 +4385,7 @@ pim_cmd_igmp_start (struct vty *vty, struct interface *ifp) pim_ifp = pim_if_new(ifp, 1 /* igmp=true */, 0 /* pim=false */); if (!pim_ifp) { - vty_outln (vty, "Could not enable IGMP on interface %s", + vty_out (vty, "Could not enable IGMP on interface %s\n", ifp->name); return CMD_WARNING_CONFIG_FAILED; } @@ -4473,7 +4470,7 @@ DEFUN (interface_ip_igmp_join, group_str = argv[idx_ipv4]->arg; result = inet_pton(AF_INET, group_str, &group_addr); if (result <= 0) { - vty_outln (vty, "Bad group address %s: errno=%d: %s", + vty_out (vty, "Bad group address %s: errno=%d: %s\n", group_str, errno, safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } @@ -4482,14 +4479,14 @@ DEFUN (interface_ip_igmp_join, source_str = argv[idx_ipv4_2]->arg; result = inet_pton(AF_INET, source_str, &source_addr); if (result <= 0) { - vty_outln (vty, "Bad source address %s: errno=%d: %s", + vty_out (vty, "Bad source address %s: errno=%d: %s\n", source_str, errno, safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } result = pim_if_igmp_join_add(ifp, group_addr, source_addr); if (result) { - vty_outln (vty, "%% Failure joining IGMP group %s source %s on interface %s: %d", + vty_out (vty, "%% Failure joining IGMP group %s source %s on interface %s: %d\n", group_str, source_str, ifp->name, result); return CMD_WARNING_CONFIG_FAILED; } @@ -4520,7 +4517,7 @@ DEFUN (interface_no_ip_igmp_join, group_str = argv[idx_ipv4]->arg; result = inet_pton(AF_INET, group_str, &group_addr); if (result <= 0) { - vty_outln (vty, "Bad group address %s: errno=%d: %s", + vty_out (vty, "Bad group address %s: errno=%d: %s\n", group_str, errno, safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } @@ -4529,14 +4526,14 @@ DEFUN (interface_no_ip_igmp_join, source_str = argv[idx_ipv4_2]->arg; result = inet_pton(AF_INET, source_str, &source_addr); if (result <= 0) { - vty_outln (vty, "Bad source address %s: errno=%d: %s", + vty_out (vty, "Bad source address %s: errno=%d: %s\n", source_str, errno, safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } result = pim_if_igmp_join_del(ifp, group_addr, source_addr); if (result) { - vty_outln (vty, "%% Failure leaving IGMP group %s source %s on interface %s: %d", + vty_out (vty, "%% Failure leaving IGMP group %s source %s on interface %s: %d\n", group_str, source_str, ifp->name, result); return CMD_WARNING_CONFIG_FAILED; } @@ -4704,21 +4701,21 @@ DEFUN (interface_ip_igmp_query_interval, already, but we verify them anyway for extra safety. */ if (query_interval < IGMP_QUERY_INTERVAL_MIN) { - vty_outln (vty, "General query interval %d lower than minimum %d", + vty_out (vty, "General query interval %d lower than minimum %d\n", query_interval, IGMP_QUERY_INTERVAL_MIN); return CMD_WARNING_CONFIG_FAILED; } if (query_interval > IGMP_QUERY_INTERVAL_MAX) { - vty_outln (vty, "General query interval %d higher than maximum %d", + vty_out (vty, "General query interval %d higher than maximum %d\n", query_interval, IGMP_QUERY_INTERVAL_MAX); return CMD_WARNING_CONFIG_FAILED; } if (query_interval_dsec <= pim_ifp->igmp_query_max_response_time_dsec) { - vty_outln (vty, - "Can't set general query interval %d dsec <= query max response time %d dsec.", + vty_out (vty, + "Can't set general query interval %d dsec <= query max response time %d dsec.\n", query_interval_dsec,pim_ifp->igmp_query_max_response_time_dsec); return CMD_WARNING_CONFIG_FAILED; } @@ -4746,8 +4743,8 @@ DEFUN (interface_no_ip_igmp_query_interval, default_query_interval_dsec = IGMP_GENERAL_QUERY_INTERVAL * 10; if (default_query_interval_dsec <= pim_ifp->igmp_query_max_response_time_dsec) { - vty_outln (vty, - "Can't set default general query interval %d dsec <= query max response time %d dsec.", + vty_out (vty, + "Can't set default general query interval %d dsec <= query max response time %d dsec.\n", default_query_interval_dsec, pim_ifp->igmp_query_max_response_time_dsec); return CMD_WARNING_CONFIG_FAILED; @@ -4845,8 +4842,8 @@ DEFUN (interface_ip_igmp_query_max_response_time, query_max_response_time = atoi(argv[3]->arg); if (query_max_response_time >= pim_ifp->igmp_default_query_interval * 10) { - vty_outln (vty, - "Can't set query max response time %d sec >= general query interval %d sec", + vty_out (vty, + "Can't set query max response time %d sec >= general query interval %d sec\n", query_max_response_time,pim_ifp->igmp_default_query_interval); return CMD_WARNING_CONFIG_FAILED; } @@ -4905,8 +4902,8 @@ DEFUN_HIDDEN (interface_ip_igmp_query_max_response_time_dsec, default_query_interval_dsec = 10 * pim_ifp->igmp_default_query_interval; if (query_max_response_time_dsec >= default_query_interval_dsec) { - vty_outln (vty, - "Can't set query max response time %d dsec >= general query interval %d dsec", + vty_out (vty, + "Can't set query max response time %d dsec >= general query interval %d dsec\n", query_max_response_time_dsec,default_query_interval_dsec); return CMD_WARNING_CONFIG_FAILED; } @@ -4949,7 +4946,7 @@ DEFUN (interface_ip_pim_drprio, uint32_t old_dr_prio; if (!pim_ifp) { - vty_outln (vty, "Please enable PIM on interface, first"); + vty_out (vty, "Please enable PIM on interface, first\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -4978,7 +4975,7 @@ DEFUN (interface_no_ip_pim_drprio, struct pim_interface *pim_ifp = ifp->info; if (!pim_ifp) { - vty_outln (vty, "Pim not enabled on this interface"); + vty_out (vty, "Pim not enabled on this interface\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -5021,12 +5018,12 @@ DEFUN_HIDDEN (interface_ip_pim_ssm, VTY_DECLVAR_CONTEXT(interface, ifp); if (!pim_cmd_interface_add(ifp)) { - vty_outln (vty, "Could not enable PIM SM on interface"); + vty_out (vty, "Could not enable PIM SM on interface\n"); return CMD_WARNING_CONFIG_FAILED; } - vty_outln(vty, "WARN: Enabled PIM SM on interface; configure PIM SSM " - "range if needed"); + vty_out(vty, "WARN: Enabled PIM SM on interface; configure PIM SSM " + "range if needed\n"); return CMD_SUCCESS; } @@ -5039,7 +5036,7 @@ DEFUN (interface_ip_pim_sm, { VTY_DECLVAR_CONTEXT(interface, ifp); if (!pim_cmd_interface_add(ifp)) { - vty_outln (vty, "Could not enable PIM SM on interface"); + vty_out (vty, "Could not enable PIM SM on interface\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -5084,7 +5081,7 @@ DEFUN_HIDDEN (interface_no_ip_pim_ssm, { VTY_DECLVAR_CONTEXT(interface, ifp); if (!pim_cmd_interface_delete(ifp)) { - vty_outln (vty, "Unable to delete interface information"); + vty_out (vty, "Unable to delete interface information\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -5101,7 +5098,7 @@ DEFUN (interface_no_ip_pim_sm, { VTY_DECLVAR_CONTEXT(interface, ifp); if (!pim_cmd_interface_delete(ifp)) { - vty_outln (vty, "Unable to delete interface information"); + vty_out (vty, "Unable to delete interface information\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -5129,7 +5126,7 @@ DEFUN (interface_ip_mroute, oifname = argv[idx_interface]->arg; oif = if_lookup_by_name(oifname, VRF_DEFAULT); if (!oif) { - vty_outln (vty, "No such interface name %s", + vty_out (vty, "No such interface name %s\n", oifname); return CMD_WARNING_CONFIG_FAILED; } @@ -5137,7 +5134,7 @@ DEFUN (interface_ip_mroute, grp_str = argv[idx_ipv4]->arg; result = inet_pton(AF_INET, grp_str, &grp_addr); if (result <= 0) { - vty_outln (vty, "Bad group address %s: errno=%d: %s", + vty_out (vty, "Bad group address %s: errno=%d: %s\n", grp_str, errno, safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } @@ -5145,7 +5142,7 @@ DEFUN (interface_ip_mroute, src_addr.s_addr = INADDR_ANY; if (pim_static_add(iif, oif, grp_addr, src_addr)) { - vty_outln (vty, "Failed to add route"); + vty_out (vty, "Failed to add route\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -5176,7 +5173,7 @@ DEFUN (interface_ip_mroute_source, oifname = argv[idx_interface]->arg; oif = if_lookup_by_name(oifname, VRF_DEFAULT); if (!oif) { - vty_outln (vty, "No such interface name %s", + vty_out (vty, "No such interface name %s\n", oifname); return CMD_WARNING_CONFIG_FAILED; } @@ -5184,7 +5181,7 @@ DEFUN (interface_ip_mroute_source, grp_str = argv[idx_ipv4]->arg; result = inet_pton(AF_INET, grp_str, &grp_addr); if (result <= 0) { - vty_outln (vty, "Bad group address %s: errno=%d: %s", + vty_out (vty, "Bad group address %s: errno=%d: %s\n", grp_str, errno, safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } @@ -5192,13 +5189,13 @@ DEFUN (interface_ip_mroute_source, src_str = argv[idx_ipv4_2]->arg; result = inet_pton(AF_INET, src_str, &src_addr); if (result <= 0) { - vty_outln (vty, "Bad source address %s: errno=%d: %s", + vty_out (vty, "Bad source address %s: errno=%d: %s\n", src_str, errno, safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } if (pim_static_add(iif, oif, grp_addr, src_addr)) { - vty_outln (vty, "Failed to add route"); + vty_out (vty, "Failed to add route\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -5227,7 +5224,7 @@ DEFUN (interface_no_ip_mroute, oifname = argv[idx_interface]->arg; oif = if_lookup_by_name(oifname, VRF_DEFAULT); if (!oif) { - vty_outln (vty, "No such interface name %s", + vty_out (vty, "No such interface name %s\n", oifname); return CMD_WARNING_CONFIG_FAILED; } @@ -5235,7 +5232,7 @@ DEFUN (interface_no_ip_mroute, grp_str = argv[idx_ipv4]->arg; result = inet_pton(AF_INET, grp_str, &grp_addr); if (result <= 0) { - vty_outln (vty, "Bad group address %s: errno=%d: %s", + vty_out (vty, "Bad group address %s: errno=%d: %s\n", grp_str, errno, safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } @@ -5243,7 +5240,7 @@ DEFUN (interface_no_ip_mroute, src_addr.s_addr = INADDR_ANY; if (pim_static_del(iif, oif, grp_addr, src_addr)) { - vty_outln (vty, "Failed to remove route"); + vty_out (vty, "Failed to remove route\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -5275,7 +5272,7 @@ DEFUN (interface_no_ip_mroute_source, oifname = argv[idx_interface]->arg; oif = if_lookup_by_name(oifname, VRF_DEFAULT); if (!oif) { - vty_outln (vty, "No such interface name %s", + vty_out (vty, "No such interface name %s\n", oifname); return CMD_WARNING_CONFIG_FAILED; } @@ -5283,7 +5280,7 @@ DEFUN (interface_no_ip_mroute_source, grp_str = argv[idx_ipv4]->arg; result = inet_pton(AF_INET, grp_str, &grp_addr); if (result <= 0) { - vty_outln (vty, "Bad group address %s: errno=%d: %s", + vty_out (vty, "Bad group address %s: errno=%d: %s\n", grp_str, errno, safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } @@ -5291,13 +5288,13 @@ DEFUN (interface_no_ip_mroute_source, src_str = argv[idx_ipv4_2]->arg; result = inet_pton(AF_INET, src_str, &src_addr); if (result <= 0) { - vty_outln (vty, "Bad source address %s: errno=%d: %s", + vty_out (vty, "Bad source address %s: errno=%d: %s\n", src_str, errno, safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } if (pim_static_del(iif, oif, grp_addr, src_addr)) { - vty_outln (vty, "Failed to remove route"); + vty_out (vty, "Failed to remove route\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -5322,7 +5319,7 @@ DEFUN (interface_ip_pim_hello, { if (!pim_cmd_interface_add(ifp)) { - vty_outln (vty, "Could not enable PIM SM on interface"); + vty_out (vty, "Could not enable PIM SM on interface\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -5352,7 +5349,7 @@ DEFUN (interface_no_ip_pim_hello, struct pim_interface *pim_ifp = ifp->info; if (!pim_ifp) { - vty_outln (vty, "Pim not enabled on this interface"); + vty_out (vty, "Pim not enabled on this interface\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -5597,22 +5594,22 @@ DEFUN (debug_pim_packets, if (argv_find (argv, argc, "hello", &idx)) { PIM_DO_DEBUG_PIM_HELLO; - vty_outln (vty, "PIM Hello debugging is on"); + vty_out (vty, "PIM Hello debugging is on\n"); } else if (argv_find (argv, argc ,"joins", &idx)) { PIM_DO_DEBUG_PIM_J_P; - vty_outln (vty, "PIM Join/Prune debugging is on"); + vty_out (vty, "PIM Join/Prune debugging is on\n"); } else if (argv_find (argv, argc, "register", &idx)) { PIM_DO_DEBUG_PIM_REG; - vty_outln (vty, "PIM Register debugging is on"); + vty_out (vty, "PIM Register debugging is on\n"); } else { PIM_DO_DEBUG_PIM_PACKETS; - vty_outln (vty, "PIM Packet debugging is on "); + vty_out (vty, "PIM Packet debugging is on \n"); } return CMD_SUCCESS; } @@ -5632,17 +5629,17 @@ DEFUN (no_debug_pim_packets, if (argv_find (argv, argc,"hello",&idx)) { PIM_DONT_DEBUG_PIM_HELLO; - vty_outln (vty, "PIM Hello debugging is off "); + vty_out (vty, "PIM Hello debugging is off \n"); } else if (argv_find (argv, argc, "joins", &idx)) { PIM_DONT_DEBUG_PIM_J_P; - vty_outln (vty, "PIM Join/Prune debugging is off "); + vty_out (vty, "PIM Join/Prune debugging is off \n"); } else if (argv_find (argv, argc, "register", &idx)) { PIM_DONT_DEBUG_PIM_REG; - vty_outln (vty, "PIM Register debugging is off"); + vty_out (vty, "PIM Register debugging is off\n"); } else PIM_DONT_DEBUG_PIM_PACKETS; @@ -5882,7 +5879,7 @@ interface_pim_use_src_cmd_worker(struct vty *vty, const char *source) result = inet_pton(AF_INET, source, &source_addr); if (result <= 0) { - vty_outln (vty, "%% Bad source address %s: errno=%d: %s", + vty_out (vty, "%% Bad source address %s: errno=%d: %s\n", source, errno, safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } @@ -5892,13 +5889,13 @@ interface_pim_use_src_cmd_worker(struct vty *vty, const char *source) case PIM_SUCCESS: break; case PIM_IFACE_NOT_FOUND: - vty_outln (vty, "Pim not enabled on this interface"); + vty_out (vty, "Pim not enabled on this interface\n"); break; case PIM_UPDATE_SOURCE_DUP: - vty_outln (vty, "%% Source already set to %s", source); + vty_out (vty, "%% Source already set to %s\n", source); break; default: - vty_outln (vty, "%% Source set failed"); + vty_out (vty, "%% Source set failed\n"); } return result ? CMD_WARNING_CONFIG_FAILED : CMD_SUCCESS; @@ -6022,14 +6019,14 @@ ip_msdp_peer_cmd_worker (struct vty *vty, const char *peer, const char *local) result = inet_pton(AF_INET, peer, &peer_addr); if (result <= 0) { - vty_outln (vty, "%% Bad peer address %s: errno=%d: %s", + vty_out (vty, "%% Bad peer address %s: errno=%d: %s\n", peer, errno, safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } result = inet_pton(AF_INET, local, &local_addr); if (result <= 0) { - vty_outln (vty, "%% Bad source address %s: errno=%d: %s", + vty_out (vty, "%% Bad source address %s: errno=%d: %s\n", local, errno, safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } @@ -6039,16 +6036,16 @@ ip_msdp_peer_cmd_worker (struct vty *vty, const char *peer, const char *local) case PIM_MSDP_ERR_NONE: break; case PIM_MSDP_ERR_OOM: - vty_outln (vty, "%% Out of memory"); + vty_out (vty, "%% Out of memory\n"); break; case PIM_MSDP_ERR_PEER_EXISTS: - vty_outln (vty, "%% Peer exists"); + vty_out (vty, "%% Peer exists\n"); break; case PIM_MSDP_ERR_MAX_MESH_GROUPS: - vty_outln (vty, "%% Only one mesh-group allowed currently"); + vty_out (vty, "%% Only one mesh-group allowed currently\n"); break; default: - vty_outln (vty, "%% peer add failed"); + vty_out (vty, "%% peer add failed\n"); } return result ? CMD_WARNING_CONFIG_FAILED : CMD_SUCCESS; @@ -6075,7 +6072,7 @@ ip_no_msdp_peer_cmd_worker (struct vty *vty, const char *peer) result = inet_pton(AF_INET, peer, &peer_addr); if (result <= 0) { - vty_outln (vty, "%% Bad peer address %s: errno=%d: %s", + vty_out (vty, "%% Bad peer address %s: errno=%d: %s\n", peer, errno, safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } @@ -6085,10 +6082,10 @@ ip_no_msdp_peer_cmd_worker (struct vty *vty, const char *peer) case PIM_MSDP_ERR_NONE: break; case PIM_MSDP_ERR_NO_PEER: - vty_outln (vty, "%% Peer does not exist"); + vty_out (vty, "%% Peer does not exist\n"); break; default: - vty_outln (vty, "%% peer del failed"); + vty_out (vty, "%% peer del failed\n"); } return result ? CMD_WARNING_CONFIG_FAILED : CMD_SUCCESS; @@ -6114,7 +6111,7 @@ ip_msdp_mesh_group_member_cmd_worker(struct vty *vty, const char *mg, const char result = inet_pton(AF_INET, mbr, &mbr_ip); if (result <= 0) { - vty_outln (vty, "%% Bad member address %s: errno=%d: %s", + vty_out (vty, "%% Bad member address %s: errno=%d: %s\n", mbr, errno, safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } @@ -6124,16 +6121,16 @@ ip_msdp_mesh_group_member_cmd_worker(struct vty *vty, const char *mg, const char case PIM_MSDP_ERR_NONE: break; case PIM_MSDP_ERR_OOM: - vty_outln (vty, "%% Out of memory"); + vty_out (vty, "%% Out of memory\n"); break; case PIM_MSDP_ERR_MG_MBR_EXISTS: - vty_outln (vty, "%% mesh-group member exists"); + vty_out (vty, "%% mesh-group member exists\n"); break; case PIM_MSDP_ERR_MAX_MESH_GROUPS: - vty_outln (vty, "%% Only one mesh-group allowed currently"); + vty_out (vty, "%% Only one mesh-group allowed currently\n"); break; default: - vty_outln (vty, "%% member add failed"); + vty_out (vty, "%% member add failed\n"); } return result ? CMD_WARNING_CONFIG_FAILED : CMD_SUCCESS; @@ -6160,7 +6157,7 @@ ip_no_msdp_mesh_group_member_cmd_worker(struct vty *vty, const char *mg, const c result = inet_pton(AF_INET, mbr, &mbr_ip); if (result <= 0) { - vty_outln (vty, "%% Bad member address %s: errno=%d: %s", + vty_out (vty, "%% Bad member address %s: errno=%d: %s\n", mbr, errno, safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } @@ -6170,13 +6167,13 @@ ip_no_msdp_mesh_group_member_cmd_worker(struct vty *vty, const char *mg, const c case PIM_MSDP_ERR_NONE: break; case PIM_MSDP_ERR_NO_MG: - vty_outln (vty, "%% mesh-group does not exist"); + vty_out (vty, "%% mesh-group does not exist\n"); break; case PIM_MSDP_ERR_NO_MG_MBR: - vty_outln (vty, "%% mesh-group member does not exist"); + vty_out (vty, "%% mesh-group member does not exist\n"); break; default: - vty_outln (vty, "%% mesh-group member del failed"); + vty_out (vty, "%% mesh-group member del failed\n"); } return result ? CMD_WARNING_CONFIG_FAILED : CMD_SUCCESS; @@ -6203,7 +6200,7 @@ ip_msdp_mesh_group_source_cmd_worker(struct vty *vty, const char *mg, const char result = inet_pton(AF_INET, src, &src_ip); if (result <= 0) { - vty_outln (vty, "%% Bad source address %s: errno=%d: %s", + vty_out (vty, "%% Bad source address %s: errno=%d: %s\n", src, errno, safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } @@ -6213,13 +6210,13 @@ ip_msdp_mesh_group_source_cmd_worker(struct vty *vty, const char *mg, const char case PIM_MSDP_ERR_NONE: break; case PIM_MSDP_ERR_OOM: - vty_outln (vty, "%% Out of memory"); + vty_out (vty, "%% Out of memory\n"); break; case PIM_MSDP_ERR_MAX_MESH_GROUPS: - vty_outln (vty, "%% Only one mesh-group allowed currently"); + vty_out (vty, "%% Only one mesh-group allowed currently\n"); break; default: - vty_outln (vty, "%% source add failed"); + vty_out (vty, "%% source add failed\n"); } return result ? CMD_WARNING_CONFIG_FAILED : CMD_SUCCESS; @@ -6249,10 +6246,10 @@ ip_no_msdp_mesh_group_source_cmd_worker(struct vty *vty, const char *mg) case PIM_MSDP_ERR_NONE: break; case PIM_MSDP_ERR_NO_MG: - vty_outln (vty, "%% mesh-group does not exist"); + vty_out (vty, "%% mesh-group does not exist\n"); break; default: - vty_outln (vty, "%% mesh-group source del failed"); + vty_out (vty, "%% mesh-group source del failed\n"); } return result ? CMD_WARNING_CONFIG_FAILED : CMD_SUCCESS; @@ -6268,10 +6265,10 @@ ip_no_msdp_mesh_group_cmd_worker(struct vty *vty, const char *mg) case PIM_MSDP_ERR_NONE: break; case PIM_MSDP_ERR_NO_MG: - vty_outln (vty, "%% mesh-group does not exist"); + vty_out (vty, "%% mesh-group does not exist\n"); break; default: - vty_outln (vty, "%% mesh-group source del failed"); + vty_out (vty, "%% mesh-group source del failed\n"); } return result ? CMD_WARNING_CONFIG_FAILED : CMD_SUCCESS; @@ -6299,7 +6296,7 @@ print_empty_json_obj(struct vty *vty) { json_object *json; json = json_object_new_object(); - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } @@ -6334,9 +6331,9 @@ ip_msdp_show_mesh_group(struct vty *vty, u_char uj) json_object_string_add(json_mg_row, "name", mg->mesh_group_name); json_object_string_add(json_mg_row, "source", src_str); } else { - vty_outln (vty, "Mesh group : %s", mg->mesh_group_name); - vty_outln (vty, " Source : %s", src_str); - vty_outln (vty, " Member State"); + vty_out (vty, "Mesh group : %s\n", mg->mesh_group_name); + vty_out (vty, " Source : %s\n", src_str); + vty_out (vty, " Member State\n"); } for (ALL_LIST_ELEMENTS_RO(mg->mbr_list, mbrnode, mbr)) { @@ -6357,14 +6354,14 @@ ip_msdp_show_mesh_group(struct vty *vty, u_char uj) } json_object_object_add(json_members, mbr_str, json_row); } else { - vty_outln (vty, " %-15s %11s", + vty_out (vty, " %-15s %11s\n", mbr_str, state_str); } } if (uj) { json_object_object_add(json, mg->mesh_group_name, json_mg_row); - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } @@ -6402,8 +6399,8 @@ ip_msdp_show_peers(struct vty *vty, u_char uj) if (uj) { json = json_object_new_object(); } else { - vty_outln (vty, - "Peer Local State Uptime SaCnt"); + vty_out (vty, + "Peer Local State Uptime SaCnt\n"); } for (ALL_LIST_ELEMENTS_RO(msdp->peer_list, mpnode, mp)) { @@ -6425,14 +6422,14 @@ ip_msdp_show_peers(struct vty *vty, u_char uj) json_object_int_add(json_row, "saCount", mp->sa_cnt); json_object_object_add(json, peer_str, json_row); } else { - vty_outln (vty, "%-15s %15s %11s %8s %6d", + vty_out (vty, "%-15s %15s %11s %8s %6d\n", peer_str, local_str, state_str, timebuf, mp->sa_cnt); } } if (uj) { - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } @@ -6496,31 +6493,31 @@ ip_msdp_show_peers_detail(struct vty *vty, const char *peer, u_char uj) json_object_int_add(json_row, "saRcvd", mp->sa_rx_cnt); json_object_object_add(json, peer_str, json_row); } else { - vty_outln (vty, "Peer : %s", peer_str); - vty_outln (vty, " Local : %s", local_str); - vty_outln (vty, " Mesh Group : %s", mp->mesh_group_name); - vty_outln (vty, " State : %s", state_str); - vty_outln (vty, " Uptime : %s", timebuf); - - vty_outln (vty, " Keepalive Timer : %s", katimer); - vty_outln (vty, " Conn Retry Timer : %s", crtimer); - vty_outln (vty, " Hold Timer : %s", holdtimer); - vty_outln (vty, " Last Reset : %s", mp->last_reset); - vty_outln (vty, " Conn Attempts : %d", mp->conn_attempts); - vty_outln (vty, " Established Changes : %d", mp->est_flaps); - vty_outln (vty, " SA Count : %d", mp->sa_cnt); - vty_outln (vty, " Statistics :"); - vty_outln (vty, " Sent Rcvd"); - vty_outln (vty, " Keepalives : %10d %10d", + vty_out (vty, "Peer : %s\n", peer_str); + vty_out (vty, " Local : %s\n", local_str); + vty_out (vty, " Mesh Group : %s\n", mp->mesh_group_name); + vty_out (vty, " State : %s\n", state_str); + vty_out (vty, " Uptime : %s\n", timebuf); + + vty_out (vty, " Keepalive Timer : %s\n", katimer); + vty_out (vty, " Conn Retry Timer : %s\n", crtimer); + vty_out (vty, " Hold Timer : %s\n", holdtimer); + vty_out (vty, " Last Reset : %s\n", mp->last_reset); + vty_out (vty, " Conn Attempts : %d\n", mp->conn_attempts); + vty_out (vty, " Established Changes : %d\n", mp->est_flaps); + vty_out (vty, " SA Count : %d\n", mp->sa_cnt); + vty_out (vty, " Statistics :\n"); + vty_out (vty, " Sent Rcvd\n"); + vty_out (vty, " Keepalives : %10d %10d\n", mp->ka_tx_cnt, mp->ka_rx_cnt); - vty_outln (vty, " SAs : %10d %10d", + vty_out (vty, " SAs : %10d %10d\n", mp->sa_tx_cnt, mp->sa_rx_cnt); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } if (uj) { - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } @@ -6568,8 +6565,8 @@ ip_msdp_show_sa(struct vty *vty, u_char uj) if (uj) { json = json_object_new_object(); } else { - vty_outln (vty, - "Source Group RP Local SPT Uptime"); + vty_out (vty, + "Source Group RP Local SPT Uptime\n"); } for (ALL_LIST_ELEMENTS_RO(msdp->sa_list, sanode, sa)) { @@ -6610,14 +6607,14 @@ ip_msdp_show_sa(struct vty *vty, u_char uj) json_object_string_add(json_row, "upTime", timebuf); json_object_object_add(json_group, src_str, json_row); } else { - vty_outln (vty, "%-15s %15s %15s %5c %3c %8s", + vty_out (vty, "%-15s %15s %15s %5c %3c %8s\n", src_str, grp_str, rp_str, local_str[0], spt_str[0], timebuf); } } if (uj) { - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } @@ -6677,14 +6674,14 @@ ip_msdp_show_sa_entry_detail(struct pim_msdp_sa *sa, const char *src_str, json_object_string_add(json_row, "stateTimer", statetimer); json_object_object_add(json_group, src_str, json_row); } else { - vty_outln (vty, "SA : %s", sa->sg_str); - vty_outln (vty, " RP : %s", rp_str); - vty_outln (vty, " Peer : %s", peer_str); - vty_outln (vty, " Local : %s", local_str); - vty_outln (vty, " SPT Setup : %s", spt_str); - vty_outln (vty, " Uptime : %s", timebuf); - vty_outln (vty, " State Timer : %s", statetimer); - vty_out (vty, VTYNL); + vty_out (vty, "SA : %s\n", sa->sg_str); + vty_out (vty, " RP : %s\n", rp_str); + vty_out (vty, " Peer : %s\n", peer_str); + vty_out (vty, " Local : %s\n", local_str); + vty_out (vty, " SPT Setup : %s\n", spt_str); + vty_out (vty, " Uptime : %s\n", timebuf); + vty_out (vty, " State Timer : %s\n", statetimer); + vty_out (vty, "\n"); } } @@ -6708,7 +6705,7 @@ ip_msdp_show_sa_detail(struct vty *vty, u_char uj) } if (uj) { - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } @@ -6752,7 +6749,7 @@ ip_msdp_show_sa_addr(struct vty *vty, const char *addr, u_char uj) } if (uj) { - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } @@ -6780,7 +6777,7 @@ ip_msdp_show_sa_sg(struct vty *vty, const char *src, const char *grp, u_char uj) } if (uj) { - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } diff --git a/pimd/pim_msdp.c b/pimd/pim_msdp.c index 71a286981..170692e7f 100644 --- a/pimd/pim_msdp.c +++ b/pimd/pim_msdp.c @@ -1533,14 +1533,14 @@ pim_msdp_config_write(struct vty *vty) if (mg->src_ip.s_addr != INADDR_ANY) { pim_inet4_dump("<src?>", mg->src_ip, src_str, sizeof(src_str)); - vty_outln (vty, "ip msdp mesh-group %s source %s", + vty_out (vty, "ip msdp mesh-group %s source %s\n", 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_outln (vty, "ip msdp mesh-group %s member %s", + vty_out (vty, "ip msdp mesh-group %s member %s\n", mg->mesh_group_name, mbr_str); ++count; } diff --git a/pimd/pim_rp.c b/pimd/pim_rp.c index 324541caa..28300dbdf 100644 --- a/pimd/pim_rp.c +++ b/pimd/pim_rp.c @@ -821,11 +821,11 @@ pim_rp_config_write (struct vty *vty) continue; if (rp_info->plist) - vty_outln (vty, "ip pim rp %s prefix-list %s", + vty_out (vty, "ip pim rp %s prefix-list %s\n", inet_ntop(AF_INET, &rp_info->rp.rpf_addr.u.prefix4, rp_buffer, 32), rp_info->plist); else - vty_outln (vty, "ip pim rp %s %s", + vty_out (vty, "ip pim rp %s %s\n", inet_ntop(AF_INET, &rp_info->rp.rpf_addr.u.prefix4, rp_buffer, 32), prefix2str(&rp_info->group, group_buffer, 32)); count++; @@ -878,8 +878,8 @@ pim_rp_show_information (struct vty *vty, u_char uj) if (uj) json = json_object_new_object(); else - vty_outln (vty, - "RP address group/prefix-list OIF I am RP"); + vty_out (vty, + "RP address group/prefix-list OIF I am RP\n"); for (ALL_LIST_ELEMENTS_RO (qpim_rp_list, node, rp_info)) { @@ -931,9 +931,9 @@ pim_rp_show_information (struct vty *vty, u_char uj) vty_out (vty, "%-10s ", "(Unknown)"); if (rp_info->i_am_rp) - vty_outln (vty, "yes"); + vty_out (vty, "yes\n"); else - vty_outln (vty, "no"); + vty_out (vty, "no\n"); } prev_rp_info = rp_info; @@ -944,7 +944,7 @@ pim_rp_show_information (struct vty *vty, u_char uj) if (prev_rp_info && json_rp_rows) json_object_object_add(json, inet_ntoa (prev_rp_info->rp.rpf_addr.u.prefix4), json_rp_rows); - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } diff --git a/pimd/pim_static.c b/pimd/pim_static.c index a35bb60f4..d373581fe 100644 --- a/pimd/pim_static.c +++ b/pimd/pim_static.c @@ -337,9 +337,9 @@ pim_static_write_mroute (struct vty *vty, struct interface *ifp) { struct interface *oifp = pim_if_find_by_vif_index (i); if (sroute->source.s_addr == 0) - vty_outln (vty, " ip mroute %s %s", oifp->name, gbuf); + vty_out (vty, " ip mroute %s %s\n", oifp->name, gbuf); else - vty_outln (vty, " ip mroute %s %s %s", oifp->name, gbuf, + vty_out (vty, " ip mroute %s %s %s\n", oifp->name, gbuf, sbuf); count ++; } diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c index 5526881d2..81b49c630 100644 --- a/pimd/pim_vty.c +++ b/pimd/pim_vty.c @@ -46,97 +46,97 @@ pim_debug_config_write (struct vty *vty) int writes = 0; if (PIM_DEBUG_MSDP_EVENTS) { - vty_outln (vty, "debug msdp events"); + vty_out (vty, "debug msdp events\n"); ++writes; } if (PIM_DEBUG_MSDP_PACKETS) { - vty_outln (vty, "debug msdp packets"); + vty_out (vty, "debug msdp packets\n"); ++writes; } if (PIM_DEBUG_MSDP_INTERNAL) { - vty_outln (vty, "debug msdp internal"); + vty_out (vty, "debug msdp internal\n"); ++writes; } if (PIM_DEBUG_IGMP_EVENTS) { - vty_outln (vty, "debug igmp events"); + vty_out (vty, "debug igmp events\n"); ++writes; } if (PIM_DEBUG_IGMP_PACKETS) { - vty_outln (vty, "debug igmp packets"); + vty_out (vty, "debug igmp packets\n"); ++writes; } if (PIM_DEBUG_IGMP_TRACE) { - vty_outln (vty, "debug igmp trace"); + vty_out (vty, "debug igmp trace\n"); ++writes; } if (PIM_DEBUG_IGMP_TRACE_DETAIL) { - vty_outln (vty, "debug igmp trace detail"); + vty_out (vty, "debug igmp trace detail\n"); ++writes; } if (PIM_DEBUG_MROUTE) { - vty_outln (vty, "debug mroute"); + vty_out (vty, "debug mroute\n"); ++writes; } if (PIM_DEBUG_MROUTE_DETAIL) { - vty_outln (vty, "debug mroute detail"); + vty_out (vty, "debug mroute detail\n"); ++writes; } if (PIM_DEBUG_PIM_EVENTS) { - vty_outln (vty, "debug pim events"); + vty_out (vty, "debug pim events\n"); ++writes; } if (PIM_DEBUG_PIM_PACKETS) { - vty_outln (vty, "debug pim packets"); + vty_out (vty, "debug pim packets\n"); ++writes; } if (PIM_DEBUG_PIM_PACKETDUMP_SEND) { - vty_outln (vty, "debug pim packet-dump send"); + vty_out (vty, "debug pim packet-dump send\n"); ++writes; } if (PIM_DEBUG_PIM_PACKETDUMP_RECV) { - vty_outln (vty, "debug pim packet-dump receive"); + vty_out (vty, "debug pim packet-dump receive\n"); ++writes; } if (PIM_DEBUG_PIM_TRACE) { - vty_outln (vty, "debug pim trace"); + vty_out (vty, "debug pim trace\n"); ++writes; } if (PIM_DEBUG_PIM_TRACE_DETAIL) { - vty_outln (vty, "debug pim trace detail"); + vty_out (vty, "debug pim trace detail\n"); ++writes; } if (PIM_DEBUG_ZEBRA) { - vty_outln (vty, "debug pim zebra"); + vty_out (vty, "debug pim zebra\n"); ++writes; } if (PIM_DEBUG_SSMPINGD) { - vty_outln (vty, "debug ssmpingd"); + vty_out (vty, "debug ssmpingd\n"); ++writes; } if (PIM_DEBUG_PIM_HELLO) { - vty_outln (vty, "debug pim packets hello"); + vty_out (vty, "debug pim packets hello\n"); ++writes; } if (PIM_DEBUG_PIM_J_P) { - vty_outln (vty, "debug pim packets joins"); + vty_out (vty, "debug pim packets joins\n"); ++writes; } if (PIM_DEBUG_PIM_REG) { - vty_outln (vty, "debug pim packets register"); + vty_out (vty, "debug pim packets register\n"); ++writes; } if (PIM_DEBUG_STATIC) { - vty_outln (vty, "debug pim static"); + vty_out (vty, "debug pim static\n"); ++writes; } @@ -152,7 +152,7 @@ int pim_global_config_write(struct vty *vty) if (!pimg->send_v6_secondary) { - vty_outln (vty, "no ip pim send-v6-secondary"); + vty_out (vty, "no ip pim send-v6-secondary\n"); ++writes; } @@ -160,62 +160,62 @@ int pim_global_config_write(struct vty *vty) if (qpim_register_suppress_time != PIM_REGISTER_SUPPRESSION_TIME_DEFAULT) { - vty_outln (vty, "ip pim register-suppress-time %d", + vty_out (vty, "ip pim register-suppress-time %d\n", qpim_register_suppress_time); ++writes; } if (qpim_t_periodic != PIM_DEFAULT_T_PERIODIC) { - vty_outln (vty, "ip pim join-prune-interval %d", + vty_out (vty, "ip pim join-prune-interval %d\n", qpim_t_periodic); ++writes; } if (qpim_keep_alive_time != PIM_KEEPALIVE_PERIOD) { - vty_outln (vty, "ip pim keep-alive-timer %d", + vty_out (vty, "ip pim keep-alive-timer %d\n", qpim_keep_alive_time); ++writes; } if (qpim_packet_process != PIM_DEFAULT_PACKET_PROCESS) { - vty_outln (vty, "ip pim packets %d", + vty_out (vty, "ip pim packets %d\n", qpim_packet_process); ++writes; } if (ssm->plist_name) { - vty_outln (vty, "ip pim ssm prefix-list %s", + vty_out (vty, "ip pim ssm prefix-list %s\n", ssm->plist_name); ++writes; } if (pimg->spt.switchover == PIM_SPT_INFINITY) { if (pimg->spt.plist) - vty_outln (vty, "ip pim spt-switchover infinity-and-beyond prefix-list %s", + vty_out (vty, "ip pim spt-switchover infinity-and-beyond prefix-list %s\n", pimg->spt.plist); else - vty_outln (vty,"ip pim spt-switchover infinity-and-beyond"); + vty_out (vty,"ip pim spt-switchover infinity-and-beyond\n"); ++writes; } if (qpim_ecmp_rebalance_enable) { - vty_outln (vty, "ip pim ecmp rebalance"); + vty_out (vty, "ip pim ecmp rebalance\n"); ++writes; } else if (qpim_ecmp_enable) { - vty_outln (vty, "ip pim ecmp"); + vty_out (vty, "ip pim ecmp\n"); ++writes; } if (qpim_ssmpingd_list) { struct listnode *node; struct ssmpingd_sock *ss; - vty_outln (vty, "!"); + vty_out (vty, "!\n"); ++writes; for (ALL_LIST_ELEMENTS_RO(qpim_ssmpingd_list, node, ss)) { char source_str[INET_ADDRSTRLEN]; pim_inet4_dump("<src?>", ss->source_addr, source_str, sizeof(source_str)); - vty_outln (vty, "ip ssmpingd %s", source_str); + vty_out (vty, "ip ssmpingd %s\n", source_str); ++writes; } } @@ -232,20 +232,20 @@ int pim_interface_config_write(struct vty *vty) for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp)) { /* IF name */ - vty_outln (vty, "interface %s", ifp->name); + vty_out (vty, "interface %s\n", ifp->name); ++writes; if (ifp->info) { struct pim_interface *pim_ifp = ifp->info; if (PIM_IF_TEST_PIM(pim_ifp->options)) { - vty_outln (vty, " ip pim sm"); + vty_out (vty, " ip pim sm\n"); ++writes; } /* IF ip pim drpriority */ if (pim_ifp->pim_dr_priority != PIM_DEFAULT_DR_PRIORITY) { - vty_outln (vty, " ip pim drpriority %u",pim_ifp->pim_dr_priority); + vty_out (vty, " ip pim drpriority %u\n",pim_ifp->pim_dr_priority); ++writes; } @@ -254,7 +254,7 @@ int pim_interface_config_write(struct vty *vty) vty_out(vty, " ip pim hello %d", pim_ifp->pim_hello_period); if (pim_ifp->pim_default_holdtime != -1) vty_out(vty, " %d", pim_ifp->pim_default_holdtime); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } /* update source */ @@ -262,20 +262,20 @@ int pim_interface_config_write(struct vty *vty) char src_str[INET_ADDRSTRLEN]; pim_inet4_dump("<src?>", pim_ifp->update_source, src_str, sizeof(src_str)); - vty_outln (vty, " ip pim use-source %s", src_str); + vty_out (vty, " ip pim use-source %s\n", src_str); ++writes; } /* IF ip igmp */ if (PIM_IF_TEST_IGMP(pim_ifp->options)) { - vty_outln (vty, " ip igmp"); + vty_out (vty, " ip igmp\n"); ++writes; } /* ip igmp version */ if (pim_ifp->igmp_version != IGMP_DEFAULT_VERSION) { - vty_outln (vty, " ip igmp version %d", + vty_out (vty, " ip igmp version %d\n", pim_ifp->igmp_version); ++writes; } @@ -283,7 +283,7 @@ int pim_interface_config_write(struct vty *vty) /* IF ip igmp query-interval */ if (pim_ifp->igmp_default_query_interval != IGMP_GENERAL_QUERY_INTERVAL) { - vty_outln (vty, " ip igmp query-interval %d", + vty_out (vty, " ip igmp query-interval %d\n", pim_ifp->igmp_default_query_interval); ++writes; } @@ -291,7 +291,7 @@ int pim_interface_config_write(struct vty *vty) /* IF ip igmp query-max-response-time */ if (pim_ifp->igmp_query_max_response_time_dsec != IGMP_QUERY_MAX_RESPONSE_TIME_DSEC) { - vty_outln (vty, " ip igmp query-max-response-time %d", + vty_out (vty, " ip igmp query-max-response-time %d\n", pim_ifp->igmp_query_max_response_time_dsec); ++writes; } @@ -305,7 +305,7 @@ int pim_interface_config_write(struct vty *vty) char source_str[INET_ADDRSTRLEN]; pim_inet4_dump("<grp?>", ij->group_addr, group_str, sizeof(group_str)); inet_ntop(AF_INET, &ij->source_addr, source_str, sizeof(source_str)); - vty_outln (vty, " ip igmp join %s %s", + vty_out (vty, " ip igmp join %s %s\n", group_str,source_str); ++writes; } @@ -313,7 +313,7 @@ int pim_interface_config_write(struct vty *vty) writes += pim_static_write_mroute (vty, ifp); } - vty_outln (vty, "!"); + vty_out (vty, "!\n"); ++writes; /* PIM BFD write */ pim_bfd_write_config (vty, ifp); diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c index 908c0a1f8..b4fff9712 100644 --- a/pimd/pim_zebra.c +++ b/pimd/pim_zebra.c @@ -1151,11 +1151,11 @@ pim_zebra_zclient_update (struct vty *vty) vty_out(vty, "Zclient update socket: "); if (zclient) { - vty_outln (vty, "%d failures=%d", zclient->sock, + vty_out (vty, "%d failures=%d\n", zclient->sock, zclient->fail); } else { - vty_outln (vty, "<null zclient>"); + vty_out (vty, "<null zclient>\n"); } } diff --git a/pimd/pim_zlookup.c b/pimd/pim_zlookup.c index e7ffe0f4a..f405a39c9 100644 --- a/pimd/pim_zlookup.c +++ b/pimd/pim_zlookup.c @@ -439,11 +439,11 @@ pim_zlookup_show_ip_multicast (struct vty *vty) { vty_out(vty, "Zclient lookup socket: "); if (zlookup) { - vty_outln (vty, "%d failures=%d", zlookup->sock, + vty_out (vty, "%d failures=%d\n", zlookup->sock, zlookup->fail); } else { - vty_outln (vty, "<null zclient>"); + vty_out (vty, "<null zclient>\n"); } } diff --git a/python/clidef.py b/python/clidef.py index 1bf3c24aa..069d80fb7 100644 --- a/python/clidef.py +++ b/python/clidef.py @@ -142,7 +142,7 @@ $argdecls continue; _fail = 0;$argblocks if (_fail) - vty_outln (vty, "%% invalid input for %s: %s", + vty_out (vty, "%% invalid input for %s: %s\\n", argv[_i]->varname, argv[_i]->arg); _failcnt += _fail; } diff --git a/ripd/rip_debug.c b/ripd/rip_debug.c index c9a548959..04252a85f 100644 --- a/ripd/rip_debug.c +++ b/ripd/rip_debug.c @@ -34,28 +34,28 @@ DEFUN (show_debugging_rip, DEBUG_STR RIP_STR) { - vty_outln (vty, "RIP debugging status:"); + vty_out (vty, "RIP debugging status:\n"); if (IS_RIP_DEBUG_EVENT) - vty_outln (vty, " RIP event debugging is on"); + vty_out (vty, " RIP event debugging is on\n"); if (IS_RIP_DEBUG_PACKET) { if (IS_RIP_DEBUG_SEND && IS_RIP_DEBUG_RECV) { - vty_outln (vty," RIP packet debugging is on"); + vty_out (vty," RIP packet debugging is on\n"); } else { if (IS_RIP_DEBUG_SEND) - vty_outln (vty," RIP packet send debugging is on"); + vty_out (vty," RIP packet send debugging is on\n"); else - vty_outln (vty," RIP packet receive debugging is on"); + vty_out (vty," RIP packet receive debugging is on\n"); } } if (IS_RIP_DEBUG_ZEBRA) - vty_outln (vty, " RIP zebra debugging is on"); + vty_out (vty, " RIP zebra debugging is on\n"); return CMD_SUCCESS; } @@ -192,28 +192,28 @@ config_write_debug (struct vty *vty) if (IS_RIP_DEBUG_EVENT) { - vty_outln (vty, "debug rip events"); + vty_out (vty, "debug rip events\n"); write++; } if (IS_RIP_DEBUG_PACKET) { if (IS_RIP_DEBUG_SEND && IS_RIP_DEBUG_RECV) { - vty_outln (vty,"debug rip packet"); + vty_out (vty,"debug rip packet\n"); write++; } else { if (IS_RIP_DEBUG_SEND) - vty_outln (vty,"debug rip packet send"); + vty_out (vty,"debug rip packet send\n"); else - vty_outln (vty,"debug rip packet recv"); + vty_out (vty,"debug rip packet recv\n"); write++; } } if (IS_RIP_DEBUG_ZEBRA) { - vty_outln (vty, "debug rip zebra"); + vty_out (vty, "debug rip zebra\n"); write++; } return write; diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c index d5570eac2..357856e1e 100644 --- a/ripd/rip_interface.c +++ b/ripd/rip_interface.c @@ -1233,7 +1233,7 @@ DEFUN (rip_network, if (ret < 0) { - vty_outln (vty, "There is a same network configuration %s", + vty_out (vty, "There is a same network configuration %s\n", argv[idx_ipv4_word]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -1263,7 +1263,7 @@ DEFUN (no_rip_network, if (ret < 0) { - vty_outln (vty, "Can't find network configuration %s", + vty_out (vty, "Can't find network configuration %s\n", argv[idx_ipv4_word]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -1286,7 +1286,7 @@ DEFUN (rip_neighbor, if (ret <= 0) { - vty_outln (vty, "Please specify address by A.B.C.D"); + vty_out (vty, "Please specify address by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1311,7 +1311,7 @@ DEFUN (no_rip_neighbor, if (ret <= 0) { - vty_outln (vty, "Please specify address by A.B.C.D"); + vty_out (vty, "Please specify address by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1534,7 +1534,7 @@ DEFUN (ip_rip_authentication_mode, { if (auth_type != RIP_AUTH_MD5) { - vty_outln (vty, "auth length argument only valid for md5"); + vty_out (vty, "auth length argument only valid for md5\n"); return CMD_WARNING_CONFIG_FAILED; } if (strmatch ("rfc", authlen)) @@ -1591,14 +1591,14 @@ DEFUN (ip_rip_authentication_string, if (strlen (argv[idx_line]->arg) > 16) { - vty_outln (vty, - "%% RIPv2 authentication string must be shorter than 16"); + vty_out (vty, + "%% RIPv2 authentication string must be shorter than 16\n"); return CMD_WARNING_CONFIG_FAILED; } if (ri->key_chain) { - vty_outln (vty, "%% key-chain configuration exists"); + vty_out (vty, "%% key-chain configuration exists\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1651,7 +1651,7 @@ DEFUN (ip_rip_authentication_key_chain, if (ri->auth_str) { - vty_outln (vty,"%% authentication string configuration exists"); + vty_out (vty,"%% authentication string configuration exists\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1837,43 +1837,43 @@ rip_interface_config_write (struct vty *vty) (!ri->key_chain) ) continue; - vty_outln (vty, "interface %s",ifp->name); + vty_out (vty, "interface %s\n",ifp->name); if (ifp->desc) - vty_outln (vty, " description %s",ifp->desc); + vty_out (vty, " description %s\n",ifp->desc); /* Split horizon. */ if (ri->split_horizon != ri->split_horizon_default) { switch (ri->split_horizon) { case RIP_SPLIT_HORIZON: - vty_outln (vty, " ip rip split-horizon"); + vty_out (vty, " ip rip split-horizon\n"); break; case RIP_SPLIT_HORIZON_POISONED_REVERSE: - vty_outln (vty," ip rip split-horizon poisoned-reverse"); + vty_out (vty," ip rip split-horizon poisoned-reverse\n"); break; case RIP_NO_SPLIT_HORIZON: default: - vty_outln (vty, " no ip rip split-horizon"); + vty_out (vty, " no ip rip split-horizon\n"); break; } } /* RIP version setting. */ if (ri->ri_send != RI_RIP_UNSPEC) - vty_outln (vty, " ip rip send version %s", + vty_out (vty, " ip rip send version %s\n", lookup_msg(ri_version_msg, ri->ri_send, NULL)); if (ri->ri_receive != RI_RIP_UNSPEC) - vty_outln (vty, " ip rip receive version %s ", + vty_out (vty, " ip rip receive version %s \n", lookup_msg(ri_version_msg, ri->ri_receive, NULL)); if (ri->v2_broadcast) - vty_outln (vty, " ip rip v2-broadcast"); + vty_out (vty, " ip rip v2-broadcast\n"); /* RIP authentication. */ if (ri->auth_type == RIP_AUTH_SIMPLE_PASSWORD) - vty_outln (vty, " ip rip authentication mode text"); + vty_out (vty, " ip rip authentication mode text\n"); if (ri->auth_type == RIP_AUTH_MD5) { @@ -1882,18 +1882,18 @@ rip_interface_config_write (struct vty *vty) vty_out (vty, " auth-length old-ripd"); else vty_out (vty, " auth-length rfc"); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } if (ri->auth_str) - vty_outln (vty, " ip rip authentication string %s", + vty_out (vty, " ip rip authentication string %s\n", ri->auth_str); if (ri->key_chain) - vty_outln (vty, " ip rip authentication key-chain %s", + vty_out (vty, " ip rip authentication key-chain %s\n", ri->key_chain); - vty_outln (vty, "!"); + vty_out (vty, "!\n"); } return 0; } @@ -1908,7 +1908,7 @@ config_write_rip_network (struct vty *vty, int config_mode) /* Network type RIP enable interface statement. */ for (node = route_top (rip_enable_network); node; node = route_next (node)) if (node->info) - vty_outln (vty, "%s%s/%d", + vty_out (vty, "%s%s/%d\n", config_mode ? " network " : " ", inet_ntoa (node->p.u.prefix4), node->p.prefixlen); @@ -1916,24 +1916,24 @@ config_write_rip_network (struct vty *vty, int config_mode) /* Interface name RIP enable statement. */ for (i = 0; i < vector_active (rip_enable_interface); i++) if ((ifname = vector_slot (rip_enable_interface, i)) != NULL) - vty_outln (vty, "%s%s", + vty_out (vty, "%s%s\n", config_mode ? " network " : " ", ifname); /* RIP neighbors listing. */ for (node = route_top (rip->neighbor); node; node = route_next (node)) if (node->info) - vty_outln (vty, "%s%s", + vty_out (vty, "%s%s\n", config_mode ? " neighbor " : " ", inet_ntoa(node->p.u.prefix4)); /* RIP passive interface listing. */ if (config_mode) { if (passive_default) - vty_outln (vty, " passive-interface default"); + vty_out (vty, " passive-interface default\n"); for (i = 0; i < vector_active (Vrip_passive_nondefault); i++) if ((ifname = vector_slot (Vrip_passive_nondefault, i)) != NULL) - vty_outln (vty, " %spassive-interface %s", + vty_out (vty, " %spassive-interface %s\n", (passive_default ? "no " : ""), ifname); } diff --git a/ripd/rip_offset.c b/ripd/rip_offset.c index 3fb0daa86..63f93d139 100644 --- a/ripd/rip_offset.c +++ b/ripd/rip_offset.c @@ -117,7 +117,7 @@ rip_offset_list_set (struct vty *vty, const char *alist, const char *direct_str, direct = RIP_OFFSET_LIST_OUT; else { - vty_outln (vty, "Invalid direction: %s", direct_str); + vty_out (vty, "Invalid direction: %s\n", direct_str); return CMD_WARNING_CONFIG_FAILED; } @@ -125,7 +125,7 @@ rip_offset_list_set (struct vty *vty, const char *alist, const char *direct_str, metric = atoi (metric_str); if (metric < 0 || metric > 16) { - vty_outln (vty, "Invalid metric: %s", metric_str); + vty_out (vty, "Invalid metric: %s\n", metric_str); return CMD_WARNING_CONFIG_FAILED; } @@ -156,7 +156,7 @@ rip_offset_list_unset (struct vty *vty, const char *alist, direct = RIP_OFFSET_LIST_OUT; else { - vty_outln (vty, "Invalid direction: %s", direct_str); + vty_out (vty, "Invalid direction: %s\n", direct_str); return CMD_WARNING_CONFIG_FAILED; } @@ -164,7 +164,7 @@ rip_offset_list_unset (struct vty *vty, const char *alist, metric = atoi (metric_str); if (metric < 0 || metric > 16) { - vty_outln (vty, "Invalid metric: %s", metric_str); + vty_out (vty, "Invalid metric: %s\n", metric_str); return CMD_WARNING_CONFIG_FAILED; } @@ -188,7 +188,7 @@ rip_offset_list_unset (struct vty *vty, const char *alist, } else { - vty_outln (vty, "Can't find offset-list"); + vty_out (vty, "Can't find offset-list\n"); return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -397,23 +397,23 @@ config_write_rip_offset_list (struct vty *vty) if (! offset->ifname) { if (offset->direct[RIP_OFFSET_LIST_IN].alist_name) - vty_outln (vty, " offset-list %s in %d", + vty_out (vty, " offset-list %s in %d\n", offset->direct[RIP_OFFSET_LIST_IN].alist_name, offset->direct[RIP_OFFSET_LIST_IN].metric); if (offset->direct[RIP_OFFSET_LIST_OUT].alist_name) - vty_outln (vty, " offset-list %s out %d", + vty_out (vty, " offset-list %s out %d\n", offset->direct[RIP_OFFSET_LIST_OUT].alist_name, offset->direct[RIP_OFFSET_LIST_OUT].metric); } else { if (offset->direct[RIP_OFFSET_LIST_IN].alist_name) - vty_outln (vty, " offset-list %s in %d %s", + vty_out (vty, " offset-list %s in %d %s\n", offset->direct[RIP_OFFSET_LIST_IN].alist_name, offset->direct[RIP_OFFSET_LIST_IN].metric, offset->ifname); if (offset->direct[RIP_OFFSET_LIST_OUT].alist_name) - vty_outln (vty, " offset-list %s out %d %s", + vty_out (vty, " offset-list %s out %d %s\n", offset->direct[RIP_OFFSET_LIST_OUT].alist_name, offset->direct[RIP_OFFSET_LIST_OUT].metric, offset->ifname); diff --git a/ripd/rip_peer.c b/ripd/rip_peer.c index 636aa80a9..7f494a098 100644 --- a/ripd/rip_peer.c +++ b/ripd/rip_peer.c @@ -185,7 +185,7 @@ rip_peer_display (struct vty *vty) for (ALL_LIST_ELEMENTS (peer_list, node, nnode, peer)) { - vty_outln (vty, " %-16s %9d %9d %9d %s", inet_ntoa (peer->addr), + vty_out (vty, " %-16s %9d %9d %9d %s\n", inet_ntoa (peer->addr), peer->recv_badpackets, peer->recv_badroutes, ZEBRA_RIP_DISTANCE_DEFAULT, rip_peer_uptime(peer, timebuf, RIP_UPTIME_LEN)); diff --git a/ripd/rip_zebra.c b/ripd/rip_zebra.c index c2418e1b5..dffa9db7c 100644 --- a/ripd/rip_zebra.c +++ b/ripd/rip_zebra.c @@ -347,7 +347,7 @@ DEFUN (rip_redistribute_type, } } - vty_outln (vty, "Invalid type %s",argv[1]->arg); + vty_out (vty, "Invalid type %s\n",argv[1]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -373,7 +373,7 @@ DEFUN (no_rip_redistribute_type, } } - vty_outln (vty, "Invalid type %s",argv[2]->arg); + vty_out (vty, "Invalid type %s\n",argv[2]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -400,7 +400,7 @@ DEFUN (rip_redistribute_type_routemap, } } - vty_outln (vty, "Invalid type %s", argv[idx_protocol]->text); + vty_out (vty, "Invalid type %s\n", argv[idx_protocol]->text); return CMD_WARNING_CONFIG_FAILED; } @@ -428,7 +428,7 @@ DEFUN (no_rip_redistribute_type_routemap, } } - vty_outln (vty, "Invalid type %s", argv[idx_protocol]->text); + vty_out (vty, "Invalid type %s\n", argv[idx_protocol]->text); return CMD_WARNING_CONFIG_FAILED; } @@ -458,7 +458,7 @@ DEFUN (rip_redistribute_type_metric, } } - vty_outln (vty, "Invalid type %s", argv[idx_protocol]->text); + vty_out (vty, "Invalid type %s\n", argv[idx_protocol]->text); return CMD_WARNING_CONFIG_FAILED; } @@ -486,7 +486,7 @@ DEFUN (no_rip_redistribute_type_metric, } } - vty_outln (vty, "Invalid type %s", argv[idx_protocol]->text); + vty_out (vty, "Invalid type %s\n", argv[idx_protocol]->text); return CMD_WARNING_CONFIG_FAILED; } @@ -520,7 +520,7 @@ DEFUN (rip_redistribute_type_metric_routemap, } } - vty_outln (vty, "Invalid type %s", argv[idx_protocol]->text); + vty_out (vty, "Invalid type %s\n", argv[idx_protocol]->text); return CMD_WARNING_CONFIG_FAILED; } @@ -557,7 +557,7 @@ DEFUN (no_rip_redistribute_type_metric_routemap, } } - vty_outln (vty, "Invalid type %s", argv[idx_protocol]->text); + vty_out (vty, "Invalid type %s\n", argv[idx_protocol]->text); return CMD_WARNING_CONFIG_FAILED; } @@ -614,13 +614,13 @@ config_write_zebra (struct vty *vty) { if (! zclient->enable) { - vty_outln (vty, "no router zebra"); + vty_out (vty, "no router zebra\n"); return 1; } else if (! vrf_bitmap_check (zclient->redist[AFI_IP][ZEBRA_ROUTE_RIP], VRF_DEFAULT)) { - vty_outln (vty, "router zebra"); - vty_outln (vty, " no redistribute rip"); + vty_out (vty, "router zebra\n"); + vty_out (vty, " no redistribute rip\n"); return 1; } return 0; @@ -640,20 +640,20 @@ config_write_rip_redistribute (struct vty *vty, int config_mode) if (rip->route_map[i].metric_config) { if (rip->route_map[i].name) - vty_outln (vty, " redistribute %s metric %d route-map %s", + vty_out (vty, " redistribute %s metric %d route-map %s\n", zebra_route_string(i), rip->route_map[i].metric, rip->route_map[i].name); else - vty_outln (vty, " redistribute %s metric %d", + vty_out (vty, " redistribute %s metric %d\n", zebra_route_string(i),rip->route_map[i].metric); } else { if (rip->route_map[i].name) - vty_outln (vty, " redistribute %s route-map %s", + vty_out (vty, " redistribute %s route-map %s\n", zebra_route_string(i),rip->route_map[i].name); else - vty_outln (vty, " redistribute %s",zebra_route_string(i)); + vty_out (vty, " redistribute %s\n",zebra_route_string(i)); } } else diff --git a/ripd/ripd.c b/ripd/ripd.c index 780efcc94..8578dc3d2 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -2847,7 +2847,7 @@ DEFUN (rip_version, version = atoi (argv[idx_number]->arg); if (version != RIPv1 && version != RIPv2) { - vty_outln (vty, "invalid rip version %d",version); + vty_out (vty, "invalid rip version %d\n",version); return CMD_WARNING_CONFIG_FAILED; } rip->version_send = version; @@ -2885,7 +2885,7 @@ DEFUN (rip_route, ret = str2prefix_ipv4 (argv[idx_ipv4_prefixlen]->arg, &p); if (ret < 0) { - vty_outln (vty, "Malformed address"); + vty_out (vty, "Malformed address\n"); return CMD_WARNING_CONFIG_FAILED; } apply_mask_ipv4 (&p); @@ -2895,7 +2895,7 @@ DEFUN (rip_route, if (node->info) { - vty_outln (vty, "There is already same static route."); + vty_out (vty, "There is already same static route.\n"); route_unlock_node (node); return CMD_WARNING_CONFIG_FAILED; } @@ -2922,7 +2922,7 @@ DEFUN (no_rip_route, ret = str2prefix_ipv4 (argv[idx_ipv4_prefixlen]->arg, &p); if (ret < 0) { - vty_outln (vty, "Malformed address"); + vty_out (vty, "Malformed address\n"); return CMD_WARNING_CONFIG_FAILED; } apply_mask_ipv4 (&p); @@ -2931,7 +2931,7 @@ DEFUN (no_rip_route, node = route_node_lookup (rip->route, (struct prefix *) &p); if (! node) { - vty_outln (vty, "Can't find route %s.",argv[idx_ipv4_prefixlen]->arg); + vty_out (vty, "Can't find route %s.\n",argv[idx_ipv4_prefixlen]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -3014,21 +3014,21 @@ DEFUN (rip_timers, update = strtoul (argv[idx_number]->arg, &endptr, 10); if (update > RIP_TIMER_MAX || update < RIP_TIMER_MIN || *endptr != '\0') { - vty_outln (vty, "update timer value error"); + vty_out (vty, "update timer value error\n"); return CMD_WARNING_CONFIG_FAILED; } timeout = strtoul (argv[idx_number_2]->arg, &endptr, 10); if (timeout > RIP_TIMER_MAX || timeout < RIP_TIMER_MIN || *endptr != '\0') { - vty_outln (vty, "timeout timer value error"); + vty_out (vty, "timeout timer value error\n"); return CMD_WARNING_CONFIG_FAILED; } garbage = strtoul (argv[idx_number_3]->arg, &endptr, 10); if (garbage > RIP_TIMER_MAX || garbage < RIP_TIMER_MIN || *endptr != '\0') { - vty_outln (vty, "garbage timer value error"); + vty_out (vty, "garbage timer value error\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3102,7 +3102,7 @@ rip_distance_set (struct vty *vty, const char *distance_str, const char *ip_str, ret = str2prefix_ipv4 (ip_str, &p); if (ret == 0) { - vty_outln (vty, "Malformed prefix"); + vty_out (vty, "Malformed prefix\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3148,14 +3148,14 @@ rip_distance_unset (struct vty *vty, const char *distance_str, ret = str2prefix_ipv4 (ip_str, &p); if (ret == 0) { - vty_outln (vty, "Malformed prefix"); + vty_out (vty, "Malformed prefix\n"); return CMD_WARNING_CONFIG_FAILED; } rn = route_node_lookup (rip_distance_table, (struct prefix *)&p); if (! rn) { - vty_outln (vty, "Can't find specified prefix"); + vty_out (vty, "Can't find specified prefix\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3241,7 +3241,7 @@ rip_distance_show (struct vty *vty) int header = 1; char buf[BUFSIZ]; - vty_outln (vty, " Distance: (default is %d)", + vty_out (vty, " Distance: (default is %d)\n", rip->distance ? rip->distance : ZEBRA_RIP_DISTANCE_DEFAULT); for (rn = route_top (rip_distance_table); rn; rn = route_next (rn)) @@ -3249,11 +3249,11 @@ rip_distance_show (struct vty *vty) { if (header) { - vty_outln (vty," Address Distance List"); + vty_out (vty," Address Distance List\n"); header = 0; } sprintf (buf, "%s/%d", inet_ntoa (rn->p.u.prefix4), rn->p.prefixlen); - vty_outln (vty, " %-20s %4d %s", + vty_out (vty, " %-20s %4d %s\n", buf, rdistance->distance, rdistance->access_list ? rdistance->access_list : ""); } @@ -3386,7 +3386,7 @@ DEFUN (rip_allow_ecmp, { if (rip->ecmp) { - vty_outln (vty, "ECMP is already enabled."); + vty_out (vty, "ECMP is already enabled.\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3403,7 +3403,7 @@ DEFUN (no_rip_allow_ecmp, { if (!rip->ecmp) { - vty_outln (vty, "ECMP is already disabled."); + vty_out (vty, "ECMP is already disabled.\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3474,12 +3474,11 @@ DEFUN (show_ip_rip, if (! rip) return CMD_SUCCESS; - vty_outln (vty, "Codes: R - RIP, C - connected, S - Static, O - OSPF, B - BGP%s" - "Sub-codes:%s" - " (n) - normal, (s) - static, (d) - default, (r) - redistribute,%s" - " (i) - interface%s%s" - " Network Next Hop Metric From Tag Time", - VTYNL, VTYNL, VTYNL, VTYNL, VTYNL); + vty_out (vty, "Codes: R - RIP, C - connected, S - Static, O - OSPF, B - BGP\n" + "Sub-codes:\n" + " (n) - normal, (s) - static, (d) - default, (r) - redistribute,\n" + " (i) - interface\n\n" + " Network Next Hop Metric From Tag Time\n"); for (np = route_top (rip->table); np; np = route_next (np)) if ((list = np->info) != NULL) @@ -3534,7 +3533,7 @@ DEFUN (show_ip_rip, vty_out (vty, "%3"ROUTE_TAG_PRI, (route_tag_t)rinfo->tag); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } return CMD_SUCCESS; } @@ -3558,35 +3557,35 @@ DEFUN (show_ip_rip_status, if (! rip) return CMD_SUCCESS; - vty_outln (vty, "Routing Protocol is \"rip\""); + vty_out (vty, "Routing Protocol is \"rip\"\n"); vty_out (vty, " Sending updates every %ld seconds with +/-50%%,", rip->update_time); - vty_outln (vty, " next due in %lu seconds", + vty_out (vty, " next due in %lu seconds\n", thread_timer_remain_second(rip->t_update)); vty_out (vty, " Timeout after %ld seconds,", rip->timeout_time); - vty_outln (vty, " garbage collect after %ld seconds",rip->garbage_time); + vty_out (vty, " garbage collect after %ld seconds\n",rip->garbage_time); /* Filtering status show. */ config_show_distribute (vty); /* Default metric information. */ - vty_outln (vty, " Default redistribution metric is %d", + vty_out (vty, " Default redistribution metric is %d\n", rip->default_metric); /* Redistribute information. */ vty_out (vty, " Redistributing:"); config_write_rip_redistribute (vty, 0); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); vty_out (vty, " Default version control: send version %s,", lookup_msg(ri_version_msg,rip->version_send, NULL)); if (rip->version_recv == RI_RIP_VERSION_1_AND_2) - vty_outln (vty, " receive any version "); + vty_out (vty, " receive any version \n"); else - vty_outln (vty, " receive version %s ", + vty_out (vty, " receive version %s \n", lookup_msg(ri_version_msg,rip->version_recv, NULL)); - vty_outln (vty, " Interface Send Recv Key-chain"); + vty_out (vty, " Interface Send Recv Key-chain\n"); for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp)) { @@ -3607,14 +3606,14 @@ DEFUN (show_ip_rip_status, else receive_version = lookup_msg(ri_version_msg, ri->ri_receive, NULL); - vty_outln (vty, " %-17s%-3s %-3s %s", ifp->name, + vty_out (vty, " %-17s%-3s %-3s %s\n", ifp->name, send_version, receive_version, ri->key_chain ? ri->key_chain : ""); } } - vty_outln (vty, " Routing for Networks:"); + vty_out (vty, " Routing for Networks:\n"); config_write_rip_network (vty, 0); { @@ -3627,17 +3626,17 @@ DEFUN (show_ip_rip_status, { if (!found_passive) { - vty_outln (vty, " Passive Interface(s):"); + vty_out (vty, " Passive Interface(s):\n"); found_passive = 1; } - vty_outln (vty, " %s", ifp->name); + vty_out (vty, " %s\n", ifp->name); } } } - vty_outln (vty, " Routing Information Sources:"); - vty_outln (vty, - " Gateway BadPackets BadRoutes Distance Last Update"); + vty_out (vty, " Routing Information Sources:\n"); + vty_out (vty, + " Gateway BadPackets BadRoutes Distance Last Update\n"); rip_peer_display (vty); rip_distance_show (vty); @@ -3656,19 +3655,19 @@ config_write_rip (struct vty *vty) if (rip) { /* Router RIP statement. */ - vty_outln (vty, "router rip"); + vty_out (vty, "router rip\n"); write++; /* RIP version statement. Default is RIP version 2. */ if (rip->version_send != RI_RIP_VERSION_2 || rip->version_recv != RI_RIP_VERSION_1_AND_2) - vty_outln (vty, " version %d",rip->version_send); + vty_out (vty, " version %d\n",rip->version_send); /* RIP timer configuration. */ if (rip->update_time != RIP_UPDATE_TIMER_DEFAULT || rip->timeout_time != RIP_TIMEOUT_TIMER_DEFAULT || rip->garbage_time != RIP_GARBAGE_TIMER_DEFAULT) - vty_outln (vty, " timers basic %lu %lu %lu", + vty_out (vty, " timers basic %lu %lu %lu\n", rip->update_time, rip->timeout_time, rip->garbage_time); @@ -3677,10 +3676,10 @@ config_write_rip (struct vty *vty) if (rip->default_information) { if (rip->default_information_route_map) - vty_outln (vty, " default-information originate route-map %s", + vty_out (vty, " default-information originate route-map %s\n", rip->default_information_route_map); else - vty_outln (vty," default-information originate"); + vty_out (vty," default-information originate\n"); } /* Redistribute configuration. */ @@ -3694,7 +3693,7 @@ config_write_rip (struct vty *vty) /* RIP default metric configuration */ if (rip->default_metric != RIP_DEFAULT_METRIC_DEFAULT) - vty_outln (vty, " default-metric %d", + vty_out (vty, " default-metric %d\n", rip->default_metric); /* Distribute configuration. */ @@ -3705,23 +3704,23 @@ config_write_rip (struct vty *vty) /* Distance configuration. */ if (rip->distance) - vty_outln (vty, " distance %d", rip->distance); + vty_out (vty, " distance %d\n", rip->distance); /* RIP source IP prefix distance configuration. */ for (rn = route_top (rip_distance_table); rn; rn = route_next (rn)) if ((rdistance = rn->info) != NULL) - vty_outln (vty, " distance %d %s/%d %s", rdistance->distance, + vty_out (vty, " distance %d %s/%d %s\n", rdistance->distance, inet_ntoa (rn->p.u.prefix4), rn->p.prefixlen, rdistance->access_list ? rdistance->access_list : ""); /* ECMP configuration. */ if (rip->ecmp) - vty_outln (vty, " allow-ecmp"); + vty_out (vty, " allow-ecmp\n"); /* RIP static route configuration. */ for (rn = route_top (rip->route); rn; rn = route_next (rn)) if (rn->info) - vty_outln (vty, " route %s/%d", + vty_out (vty, " route %s/%d\n", inet_ntoa (rn->p.u.prefix4), rn->p.prefixlen); diff --git a/ripngd/ripng_debug.c b/ripngd/ripng_debug.c index 74a93d8eb..3bc9b4b21 100644 --- a/ripngd/ripng_debug.c +++ b/ripngd/ripng_debug.c @@ -35,28 +35,28 @@ DEFUN (show_debugging_ripng, DEBUG_STR "RIPng configuration\n") { - vty_outln (vty, "RIPng debugging status:"); + vty_out (vty, "RIPng debugging status:\n"); if (IS_RIPNG_DEBUG_EVENT) - vty_outln (vty, " RIPng event debugging is on"); + vty_out (vty, " RIPng event debugging is on\n"); if (IS_RIPNG_DEBUG_PACKET) { if (IS_RIPNG_DEBUG_SEND && IS_RIPNG_DEBUG_RECV) { - vty_outln (vty," RIPng packet debugging is on"); + vty_out (vty," RIPng packet debugging is on\n"); } else { if (IS_RIPNG_DEBUG_SEND) - vty_outln (vty," RIPng packet send debugging is on"); + vty_out (vty," RIPng packet send debugging is on\n"); else - vty_outln (vty," RIPng packet receive debugging is on"); + vty_out (vty," RIPng packet receive debugging is on\n"); } } if (IS_RIPNG_DEBUG_ZEBRA) - vty_outln (vty, " RIPng zebra debugging is on"); + vty_out (vty, " RIPng zebra debugging is on\n"); return CMD_SUCCESS; } @@ -194,28 +194,28 @@ config_write_debug (struct vty *vty) if (IS_RIPNG_DEBUG_EVENT) { - vty_outln (vty, "debug ripng events"); + vty_out (vty, "debug ripng events\n"); write++; } if (IS_RIPNG_DEBUG_PACKET) { if (IS_RIPNG_DEBUG_SEND && IS_RIPNG_DEBUG_RECV) { - vty_outln (vty,"debug ripng packet"); + vty_out (vty,"debug ripng packet\n"); write++; } else { if (IS_RIPNG_DEBUG_SEND) - vty_outln (vty,"debug ripng packet send"); + vty_out (vty,"debug ripng packet send\n"); else - vty_outln (vty,"debug ripng packet recv"); + vty_out (vty,"debug ripng packet recv\n"); write++; } } if (IS_RIPNG_DEBUG_ZEBRA) { - vty_outln (vty, "debug ripng zebra"); + vty_out (vty, "debug ripng zebra\n"); write++; } return write; diff --git a/ripngd/ripng_interface.c b/ripngd/ripng_interface.c index 8daad0803..e4b45c54a 100644 --- a/ripngd/ripng_interface.c +++ b/ripngd/ripng_interface.c @@ -916,7 +916,7 @@ ripng_network_write (struct vty *vty, int config_mode) if (node->info) { struct prefix *p = &node->p; - vty_outln (vty, "%s%s/%d", + vty_out (vty, "%s%s/%d\n", config_mode ? " network " : " ", inet_ntop (p->family, &p->u.prefix, buf, BUFSIZ), p->prefixlen); @@ -926,7 +926,7 @@ ripng_network_write (struct vty *vty, int config_mode) /* Write enable interface. */ for (i = 0; i < vector_active (ripng_enable_if); i++) if ((ifname = vector_slot (ripng_enable_if, i)) != NULL) - vty_outln (vty, "%s%s", + vty_out (vty, "%s%s\n", config_mode ? " network " : " ", ifname); @@ -934,7 +934,7 @@ ripng_network_write (struct vty *vty, int config_mode) if (config_mode) for (i = 0; i < vector_active (Vripng_passive_interface); i++) if ((ifname = vector_slot (Vripng_passive_interface, i)) != NULL) - vty_outln (vty, " passive-interface %s", ifname); + vty_out (vty, " passive-interface %s\n", ifname); return 0; } @@ -960,7 +960,7 @@ DEFUN (ripng_network, if (ret < 0) { - vty_outln (vty, "There is same network configuration %s", + vty_out (vty, "There is same network configuration %s\n", argv[idx_if_or_addr]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -990,7 +990,7 @@ DEFUN (no_ripng_network, if (ret < 0) { - vty_outln (vty, "can't find network %s",argv[idx_if_or_addr]->arg); + vty_out (vty, "can't find network %s\n",argv[idx_if_or_addr]->arg); return CMD_WARNING_CONFIG_FAILED; } @@ -1121,28 +1121,28 @@ interface_config_write (struct vty *vty) (ri->split_horizon == ri->split_horizon_default)) continue; - vty_outln (vty, "interface %s",ifp->name); + vty_out (vty, "interface %s\n",ifp->name); if (ifp->desc) - vty_outln (vty, " description %s",ifp->desc); + vty_out (vty, " description %s\n",ifp->desc); /* Split horizon. */ if (ri->split_horizon != ri->split_horizon_default) { switch (ri->split_horizon) { case RIPNG_SPLIT_HORIZON: - vty_outln (vty, " ipv6 ripng split-horizon"); + vty_out (vty, " ipv6 ripng split-horizon\n"); break; case RIPNG_SPLIT_HORIZON_POISONED_REVERSE: - vty_outln (vty," ipv6 ripng split-horizon poisoned-reverse"); + vty_out (vty," ipv6 ripng split-horizon poisoned-reverse\n"); break; case RIPNG_NO_SPLIT_HORIZON: default: - vty_outln (vty, " no ipv6 ripng split-horizon"); + vty_out (vty, " no ipv6 ripng split-horizon\n"); break; } } - vty_outln (vty, "!"); + vty_out (vty, "!\n"); write++; } diff --git a/ripngd/ripng_offset.c b/ripngd/ripng_offset.c index df460a00f..81e892d7d 100644 --- a/ripngd/ripng_offset.c +++ b/ripngd/ripng_offset.c @@ -125,7 +125,7 @@ ripng_offset_list_set (struct vty *vty, const char *alist, direct = RIPNG_OFFSET_LIST_OUT; else { - vty_outln (vty, "Invalid direction: %s", direct_str); + vty_out (vty, "Invalid direction: %s\n", direct_str); return CMD_WARNING_CONFIG_FAILED; } @@ -133,7 +133,7 @@ ripng_offset_list_set (struct vty *vty, const char *alist, metric = atoi (metric_str); if (metric < 0 || metric > 16) { - vty_outln (vty, "Invalid metric: %s", metric_str); + vty_out (vty, "Invalid metric: %s\n", metric_str); return CMD_WARNING_CONFIG_FAILED; } @@ -164,7 +164,7 @@ ripng_offset_list_unset (struct vty *vty, const char *alist, direct = RIPNG_OFFSET_LIST_OUT; else { - vty_outln (vty, "Invalid direction: %s", direct_str); + vty_out (vty, "Invalid direction: %s\n", direct_str); return CMD_WARNING_CONFIG_FAILED; } @@ -172,7 +172,7 @@ ripng_offset_list_unset (struct vty *vty, const char *alist, metric = atoi (metric_str); if (metric < 0 || metric > 16) { - vty_outln (vty, "Invalid metric: %s", metric_str); + vty_out (vty, "Invalid metric: %s\n", metric_str); return CMD_WARNING_CONFIG_FAILED; } @@ -196,7 +196,7 @@ ripng_offset_list_unset (struct vty *vty, const char *alist, } else { - vty_outln (vty, "Can't find offset-list"); + vty_out (vty, "Can't find offset-list\n"); return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -405,23 +405,23 @@ config_write_ripng_offset_list (struct vty *vty) if (! offset->ifname) { if (offset->direct[RIPNG_OFFSET_LIST_IN].alist_name) - vty_outln (vty, " offset-list %s in %d", + vty_out (vty, " offset-list %s in %d\n", offset->direct[RIPNG_OFFSET_LIST_IN].alist_name, offset->direct[RIPNG_OFFSET_LIST_IN].metric); if (offset->direct[RIPNG_OFFSET_LIST_OUT].alist_name) - vty_outln (vty, " offset-list %s out %d", + vty_out (vty, " offset-list %s out %d\n", offset->direct[RIPNG_OFFSET_LIST_OUT].alist_name, offset->direct[RIPNG_OFFSET_LIST_OUT].metric); } else { if (offset->direct[RIPNG_OFFSET_LIST_IN].alist_name) - vty_outln (vty, " offset-list %s in %d %s", + vty_out (vty, " offset-list %s in %d %s\n", offset->direct[RIPNG_OFFSET_LIST_IN].alist_name, offset->direct[RIPNG_OFFSET_LIST_IN].metric, offset->ifname); if (offset->direct[RIPNG_OFFSET_LIST_OUT].alist_name) - vty_outln (vty, " offset-list %s out %d %s", + vty_out (vty, " offset-list %s out %d %s\n", offset->direct[RIPNG_OFFSET_LIST_OUT].alist_name, offset->direct[RIPNG_OFFSET_LIST_OUT].metric, offset->ifname); diff --git a/ripngd/ripng_peer.c b/ripngd/ripng_peer.c index 51f1a4009..f27c33f37 100644 --- a/ripngd/ripng_peer.c +++ b/ripngd/ripng_peer.c @@ -193,8 +193,8 @@ ripng_peer_display (struct vty *vty) for (ALL_LIST_ELEMENTS (peer_list, node, nnode, peer)) { - vty_outln (vty, " %s %s%14s %10d %10d %10d %s", inet6_ntoa (peer->addr), - VTYNL, " ", + vty_out (vty, " %s \n%14s %10d %10d %10d %s\n", inet6_ntoa (peer->addr), + " ", peer->recv_badpackets, peer->recv_badroutes, ZEBRA_RIPNG_DISTANCE_DEFAULT, ripng_peer_uptime(peer, timebuf, RIPNG_UPTIME_LEN)); diff --git a/ripngd/ripng_zebra.c b/ripngd/ripng_zebra.c index 132422ed8..b49de9902 100644 --- a/ripngd/ripng_zebra.c +++ b/ripngd/ripng_zebra.c @@ -337,7 +337,7 @@ DEFUN (ripng_redistribute_type, if (type < 0) { - vty_outln (vty, "Invalid type %s", proto); + vty_out (vty, "Invalid type %s\n", proto); return CMD_WARNING_CONFIG_FAILED; } @@ -363,7 +363,7 @@ DEFUN (no_ripng_redistribute_type, if (type < 0) { - vty_outln (vty, "Invalid type %s", proto); + vty_out (vty, "Invalid type %s\n", proto); return CMD_WARNING_CONFIG_FAILED; } @@ -391,7 +391,7 @@ DEFUN (ripng_redistribute_type_metric, if (type < 0) { - vty_outln (vty, "Invalid type %s", argv[idx_protocol]->text); + vty_out (vty, "Invalid type %s\n", argv[idx_protocol]->text); return CMD_WARNING_CONFIG_FAILED; } @@ -417,7 +417,7 @@ DEFUN (ripng_redistribute_type_routemap, if (type < 0) { - vty_outln (vty, "Invalid type %s", argv[idx_protocol]->text); + vty_out (vty, "Invalid type %s\n", argv[idx_protocol]->text); return CMD_WARNING_CONFIG_FAILED; } @@ -448,7 +448,7 @@ DEFUN (ripng_redistribute_type_metric_routemap, if (type < 0) { - vty_outln (vty, "Invalid type %s", argv[idx_protocol]->text); + vty_out (vty, "Invalid type %s\n", argv[idx_protocol]->text); return CMD_WARNING_CONFIG_FAILED; } @@ -472,20 +472,20 @@ ripng_redistribute_write (struct vty *vty, int config_mode) if (ripng->route_map[i].metric_config) { if (ripng->route_map[i].name) - vty_outln (vty, " redistribute %s metric %d route-map %s", + vty_out (vty, " redistribute %s metric %d route-map %s\n", zebra_route_string(i), ripng->route_map[i].metric, ripng->route_map[i].name); else - vty_outln (vty, " redistribute %s metric %d", + vty_out (vty, " redistribute %s metric %d\n", zebra_route_string(i),ripng->route_map[i].metric); } else { if (ripng->route_map[i].name) - vty_outln (vty, " redistribute %s route-map %s", + vty_out (vty, " redistribute %s route-map %s\n", zebra_route_string(i),ripng->route_map[i].name); else - vty_outln (vty, " redistribute %s",zebra_route_string(i)); + vty_out (vty, " redistribute %s\n",zebra_route_string(i)); } } else @@ -499,13 +499,13 @@ zebra_config_write (struct vty *vty) { if (! zclient->enable) { - vty_outln (vty, "no router zebra"); + vty_out (vty, "no router zebra\n"); return 1; } else if (! vrf_bitmap_check (zclient->redist[AFI_IP6][ZEBRA_ROUTE_RIPNG], VRF_DEFAULT)) { - vty_outln (vty, "router zebra"); - vty_outln (vty, " no redistribute ripng"); + vty_out (vty, "router zebra\n"); + vty_out (vty, " no redistribute ripng\n"); return 1; } return 0; diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c index 15fce90c2..8b4c3e850 100644 --- a/ripngd/ripngd.c +++ b/ripngd/ripngd.c @@ -2004,13 +2004,11 @@ DEFUN (show_ipv6_ripng, return CMD_SUCCESS; /* Header of display. */ - vty_outln (vty, "Codes: R - RIPng, C - connected, S - Static, O - OSPF, B - BGP%s" - "Sub-codes:%s" - " (n) - normal, (s) - static, (d) - default, (r) - redistribute,%s" - " (i) - interface, (a/S) - aggregated/Suppressed%s%s" - " Network Next Hop Via Metric Tag Time", - VTYNL, VTYNL, VTYNL, - VTYNL, VTYNL); + vty_out (vty, "Codes: R - RIPng, C - connected, S - Static, O - OSPF, B - BGP\n" + "Sub-codes:\n" + " (n) - normal, (s) - static, (d) - default, (r) - redistribute,\n" + " (i) - interface, (a/S) - aggregated/Suppressed\n\n" + " Network Next Hop Via Metric Tag Time\n"); for (rp = route_top (ripng->table); rp; rp = route_next (rp)) { @@ -2026,11 +2024,11 @@ DEFUN (show_ipv6_ripng, vty_out (vty, "R(a) %s/%d ", inet6_ntoa (p->prefix), p->prefixlen); #endif /* DEBUG */ - vty_out (vty, VTYNL); + vty_out (vty, "\n"); vty_out (vty, "%*s", 18, " "); vty_out (vty, "%*s", 28, " "); - vty_outln (vty, "self %2d %3"ROUTE_TAG_PRI"", aggregate->metric, + vty_out (vty, "self %2d %3"ROUTE_TAG_PRI"\n", aggregate->metric, (route_tag_t)aggregate->tag); } @@ -2051,7 +2049,7 @@ DEFUN (show_ipv6_ripng, ripng_route_subtype_print(rinfo), inet6_ntoa (p->prefix), p->prefixlen); #endif /* DEBUG */ - vty_out (vty, VTYNL); + vty_out (vty, "\n"); vty_out (vty, "%*s", 18, " "); len = vty_out (vty, "%s", inet6_ntoa (rinfo->nexthop)); @@ -2089,7 +2087,7 @@ DEFUN (show_ipv6_ripng, ripng_vty_out_uptime (vty, rinfo); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } @@ -2110,30 +2108,30 @@ DEFUN (show_ipv6_ripng_status, if (! ripng) return CMD_SUCCESS; - vty_outln (vty, "Routing Protocol is \"RIPng\""); + vty_out (vty, "Routing Protocol is \"RIPng\"\n"); vty_out (vty, " Sending updates every %ld seconds with +/-50%%,", ripng->update_time); - vty_outln (vty, " next due in %lu seconds", + vty_out (vty, " next due in %lu seconds\n", thread_timer_remain_second(ripng->t_update)); vty_out (vty, " Timeout after %ld seconds,", ripng->timeout_time); - vty_outln (vty, " garbage collect after %ld seconds",ripng->garbage_time); + vty_out (vty, " garbage collect after %ld seconds\n",ripng->garbage_time); /* Filtering status show. */ config_show_distribute (vty); /* Default metric information. */ - vty_outln (vty, " Default redistribution metric is %d", + vty_out (vty, " Default redistribution metric is %d\n", ripng->default_metric); /* Redistribute information. */ vty_out (vty, " Redistributing:"); ripng_redistribute_write (vty, 0); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); vty_out (vty, " Default version control: send version %d,", ripng->version); - vty_outln (vty, " receive version %d ",ripng->version); + vty_out (vty, " receive version %d \n",ripng->version); - vty_outln (vty, " Interface Send Recv"); + vty_out (vty, " Interface Send Recv\n"); for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp)) { @@ -2144,18 +2142,18 @@ DEFUN (show_ipv6_ripng_status, if (ri->enable_network || ri->enable_interface) { - vty_outln (vty, " %-17s%-3d %-3d", ifp->name, + vty_out (vty, " %-17s%-3d %-3d\n", ifp->name, ripng->version, ripng->version); } } - vty_outln (vty, " Routing for Networks:"); + vty_out (vty, " Routing for Networks:\n"); ripng_network_write (vty, 0); - vty_outln (vty, " Routing Information Sources:"); - vty_outln (vty, - " Gateway BadPackets BadRoutes Distance Last Update"); + vty_out (vty, " Routing Information Sources:\n"); + vty_out (vty, + " Gateway BadPackets BadRoutes Distance Last Update\n"); ripng_peer_display (vty); return CMD_SUCCESS; @@ -2260,7 +2258,7 @@ DEFUN (ripng_route, ret = str2prefix_ipv6 (argv[idx_ipv6addr]->arg, (struct prefix_ipv6 *)&p); if (ret <= 0) { - vty_outln (vty, "Malformed address"); + vty_out (vty, "Malformed address\n"); return CMD_WARNING_CONFIG_FAILED; } apply_mask_ipv6 (&p); @@ -2268,7 +2266,7 @@ DEFUN (ripng_route, rp = route_node_get (ripng->route, (struct prefix *) &p); if (rp->info) { - vty_outln (vty, "There is already same static route."); + vty_out (vty, "There is already same static route.\n"); route_unlock_node (rp); return CMD_WARNING_CONFIG_FAILED; } @@ -2294,7 +2292,7 @@ DEFUN (no_ripng_route, ret = str2prefix_ipv6 (argv[idx_ipv6addr]->arg, (struct prefix_ipv6 *)&p); if (ret <= 0) { - vty_outln (vty, "Malformed address"); + vty_out (vty, "Malformed address\n"); return CMD_WARNING_CONFIG_FAILED; } apply_mask_ipv6 (&p); @@ -2302,7 +2300,7 @@ DEFUN (no_ripng_route, rp = route_node_lookup (ripng->route, (struct prefix *) &p); if (! rp) { - vty_outln (vty, "Can't find static route."); + vty_out (vty, "Can't find static route.\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2329,7 +2327,7 @@ DEFUN (ripng_aggregate_address, ret = str2prefix_ipv6 (argv[idx_ipv6_prefixlen]->arg, (struct prefix_ipv6 *)&p); if (ret <= 0) { - vty_outln (vty, "Malformed address"); + vty_out (vty, "Malformed address\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2337,7 +2335,7 @@ DEFUN (ripng_aggregate_address, node = route_node_get (ripng->aggregate, &p); if (node->info) { - vty_outln (vty, "There is already same aggregate route."); + vty_out (vty, "There is already same aggregate route.\n"); route_unlock_node (node); return CMD_WARNING_CONFIG_FAILED; } @@ -2363,14 +2361,14 @@ DEFUN (no_ripng_aggregate_address, ret = str2prefix_ipv6 (argv[idx_ipv6_prefixlen]->arg, (struct prefix_ipv6 *) &p); if (ret <= 0) { - vty_outln (vty, "Malformed address"); + vty_out (vty, "Malformed address\n"); return CMD_WARNING_CONFIG_FAILED; } rn = route_node_lookup (ripng->aggregate, &p); if (! rn) { - vty_outln (vty, "Can't find aggregate route."); + vty_out (vty, "Can't find aggregate route.\n"); return CMD_WARNING_CONFIG_FAILED; } route_unlock_node (rn); @@ -2425,7 +2423,7 @@ DEFUN (ripng_update_timer, update = strtoul (argv[0], &endptr, 10); if (update == ULONG_MAX || *endptr != '\0') { - vty_out (vty, "update timer value error%s", VTYNL); + vty_out (vty, "update timer value error\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2460,7 +2458,7 @@ DEFUN (ripng_timeout_timer, timeout = strtoul (argv[0], &endptr, 10); if (timeout == ULONG_MAX || *endptr != '\0') { - vty_out (vty, "timeout timer value error%s", VTYNL); + vty_out (vty, "timeout timer value error\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2493,7 +2491,7 @@ DEFUN (ripng_garbage_timer, garbage = strtoul (argv[0], &endptr, 10); if (garbage == ULONG_MAX || *endptr != '\0') { - vty_out (vty, "garbage timer value error%s", VTYNL); + vty_out (vty, "garbage timer value error\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2577,16 +2575,14 @@ DEFUN (show_ipv6_protocols, if (! ripng) return CMD_SUCCESS; - vty_out (vty, "Routing Protocol is \"ripng\"%s", VTYNL); + vty_out (vty, "Routing Protocol is \"ripng\"\n"); - vty_out (vty, "Sending updates every %ld seconds, next due in %d seconds%s", - ripng->update_time, 0, - VTYNL); + vty_out (vty, "Sending updates every %ld seconds, next due in %d seconds\n", + ripng->update_time, 0); - vty_out (vty, "Timerout after %ld seconds, garbage correct %ld%s", + vty_out (vty, "Timerout after %ld seconds, garbage correct %ld\n", ripng->timeout_time, - ripng->garbage_time, - VTYNL); + ripng->garbage_time); vty_out (vty, "Outgoing update filter list for all interfaces is not set"); vty_out (vty, "Incoming update filter list for all interfaces is not set"); @@ -2680,7 +2676,7 @@ DEFUN (ripng_allow_ecmp, { if (ripng->ecmp) { - vty_outln (vty, "ECMP is already enabled."); + vty_out (vty, "ECMP is already enabled.\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2697,7 +2693,7 @@ DEFUN (no_ripng_allow_ecmp, { if (!ripng->ecmp) { - vty_outln (vty, "ECMP is already disabled."); + vty_out (vty, "ECMP is already disabled.\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2720,16 +2716,16 @@ ripng_config_write (struct vty *vty) { /* RIPng router. */ - vty_outln (vty, "router ripng"); + vty_out (vty, "router ripng\n"); if (ripng->default_information) - vty_outln (vty, " default-information originate"); + vty_out (vty, " default-information originate\n"); ripng_network_write (vty, 1); /* RIPng default metric configuration */ if (ripng->default_metric != RIPNG_DEFAULT_METRIC_DEFAULT) - vty_outln (vty, " default-metric %d", + vty_out (vty, " default-metric %d\n", ripng->default_metric); ripng_redistribute_write (vty, 1); @@ -2740,18 +2736,18 @@ ripng_config_write (struct vty *vty) /* RIPng aggregate routes. */ for (rp = route_top (ripng->aggregate); rp; rp = route_next (rp)) if (rp->info != NULL) - vty_outln (vty, " aggregate-address %s/%d", + vty_out (vty, " aggregate-address %s/%d\n", inet6_ntoa (rp->p.u.prefix6), rp->p.prefixlen); /* ECMP configuration. */ if (ripng->ecmp) - vty_outln (vty, " allow-ecmp"); + vty_out (vty, " allow-ecmp\n"); /* RIPng static routes. */ for (rp = route_top (ripng->route); rp; rp = route_next (rp)) if (rp->info != NULL) - vty_outln (vty, " route %s/%d", inet6_ntoa (rp->p.u.prefix6), + vty_out (vty, " route %s/%d\n", inet6_ntoa (rp->p.u.prefix6), rp->p.prefixlen); /* RIPng timers configuration. */ @@ -2759,21 +2755,18 @@ ripng_config_write (struct vty *vty) ripng->timeout_time != RIPNG_TIMEOUT_TIMER_DEFAULT || ripng->garbage_time != RIPNG_GARBAGE_TIMER_DEFAULT) { - vty_outln (vty, " timers basic %ld %ld %ld", + vty_out (vty, " timers basic %ld %ld %ld\n", ripng->update_time, ripng->timeout_time, ripng->garbage_time); } #if 0 if (ripng->update_time != RIPNG_UPDATE_TIMER_DEFAULT) - vty_out (vty, " update-timer %d%s", ripng->update_time, - VTYNL); + vty_out (vty, " update-timer %d\n", ripng->update_time); if (ripng->timeout_time != RIPNG_TIMEOUT_TIMER_DEFAULT) - vty_out (vty, " timeout-timer %d%s", ripng->timeout_time, - VTYNL); + vty_out (vty, " timeout-timer %d\n", ripng->timeout_time); if (ripng->garbage_time != RIPNG_GARBAGE_TIMER_DEFAULT) - vty_out (vty, " garbage-timer %d%s", ripng->garbage_time, - VTYNL); + vty_out (vty, " garbage-timer %d\n", ripng->garbage_time); #endif /* 0 */ write += config_write_distribute (vty); diff --git a/tests/lib/cli/common_cli.c b/tests/lib/cli/common_cli.c index 728ae8cb0..f1b07ce22 100644 --- a/tests/lib/cli/common_cli.c +++ b/tests/lib/cli/common_cli.c @@ -36,10 +36,10 @@ int dump_args(struct vty *vty, const char *descr, int argc, struct cmd_token *argv[]) { int i; - vty_outln (vty, "%s with %d args.", descr, argc); + vty_out (vty, "%s with %d args.\n", descr, argc); for (i = 0; i < argc; i++) { - vty_outln (vty, "[%02d] %s@%s: %s", i, argv[i]->text, argv[i]->varname, argv[i]->arg); + vty_out (vty, "[%02d] %s@%s: %s\n", i, argv[i]->text, argv[i]->varname, argv[i]->arg); } return CMD_SUCCESS; diff --git a/tests/lib/cli/test_cli.c b/tests/lib/cli/test_cli.c index 43366d49e..a4d3fb4e8 100644 --- a/tests/lib/cli/test_cli.c +++ b/tests/lib/cli/test_cli.c @@ -47,10 +47,10 @@ DEFPY(magic_test, magic_test_cmd, "1\n2\n3\n4\n5\n") { char buf[256]; - vty_outln(vty, "def: %s", self->string); - vty_outln(vty, "num: %ld", magic); - vty_outln(vty, "ipv4: %s", prefix2str(ipv4net, buf, sizeof(buf))); - vty_outln(vty, "ipv6: %s", inet_ntop(AF_INET6, &ipv6, buf, sizeof(buf))); + vty_out(vty, "def: %s\n", self->string); + vty_out(vty, "num: %ld\n", magic); + vty_out(vty, "ipv4: %s\n", prefix2str(ipv4net, buf, sizeof(buf))); + vty_out(vty, "ipv6: %s\n", inet_ntop(AF_INET6, &ipv6, buf, sizeof(buf))); return CMD_SUCCESS; } diff --git a/tests/lib/test_heavy.c b/tests/lib/test_heavy.c index 810d9fda7..c6f6bbba2 100644 --- a/tests/lib/test_heavy.c +++ b/tests/lib/test_heavy.c @@ -63,7 +63,7 @@ slow_func (struct vty *vty, const char *str, const int i) printf ("%s: hard error\n", __func__); if ((i % ITERS_PRINT) == 0) - printf ("%s did %d, x = %g%s", str, i, x, VTYNL); + printf ("%s did %d, x = %g\n", str, i, x); } static void @@ -88,7 +88,7 @@ DEFUN (clear_foo, char *str; if (!argc) { - vty_outln (vty, "%% string argument required"); + vty_out (vty, "%% string argument required\n"); return CMD_WARNING; } diff --git a/tests/lib/test_heavy_thread.c b/tests/lib/test_heavy_thread.c index 80c54a827..9e1d70adc 100644 --- a/tests/lib/test_heavy_thread.c +++ b/tests/lib/test_heavy_thread.c @@ -112,7 +112,7 @@ DEFUN (clear_foo, if (!argc) { - vty_outln (vty, "%% string argument required"); + vty_out (vty, "%% string argument required\n"); return CMD_WARNING; } diff --git a/tests/lib/test_heavy_wq.c b/tests/lib/test_heavy_wq.c index 13641f6ed..18b80d081 100644 --- a/tests/lib/test_heavy_wq.c +++ b/tests/lib/test_heavy_wq.c @@ -146,7 +146,7 @@ DEFUN (clear_foo, char *str; if (!argc) { - vty_outln (vty, "%% string argument required"); + vty_out (vty, "%% string argument required\n"); return CMD_WARNING; } diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 80200d9c5..e4bf5b257 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -816,7 +816,7 @@ vtysh_rl_describe (void) int rows, cols; rl_get_screen_size(&rows, &cols); - char *ac = cmd_variable_comp2str(varcomps, cols, "\n"); + char *ac = cmd_variable_comp2str(varcomps, cols); fprintf(stdout, "%s\n", ac); XFREE(MTYPE_TMP, ac); } @@ -2511,9 +2511,9 @@ DEFUN (vtysh_write_terminal, else fp = stdout; - vty_outln (vty, "Building configuration..."); - vty_outln (vty, "%sCurrent configuration:",VTYNL); - vty_outln (vty, "!"); + vty_out (vty, "Building configuration...\n"); + vty_out (vty, "\nCurrent configuration:\n"); + vty_out (vty, "!\n"); for (i = 0; i < array_size(vtysh_client); i++) if ((argc < 3 ) || (strmatch (vtysh_client[i].name, argv[2]->text))) @@ -2535,7 +2535,7 @@ DEFUN (vtysh_write_terminal, fp = NULL; } - vty_outln (vty, "end"); + vty_out (vty, "end\n"); return CMD_SUCCESS; } @@ -2768,7 +2768,7 @@ DEFUN (vtysh_terminal_length, lines = strtol (argv[idx_number]->arg, &endptr, 10); if (lines < 0 || lines > 512 || *endptr != '\0') { - vty_outln (vty, "length is malformed"); + vty_out (vty, "length is malformed\n"); return CMD_WARNING; } @@ -2815,7 +2815,7 @@ DEFUN (vtysh_show_daemons, for (i = 0; i < array_size(vtysh_client); i++) if ( vtysh_client[i].fd >= 0 ) vty_out(vty, " %s", vtysh_client[i].name); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } diff --git a/watchfrr/watchfrr_vty.c b/watchfrr/watchfrr_vty.c index 819d896af..276e186c4 100644 --- a/watchfrr/watchfrr_vty.c +++ b/watchfrr/watchfrr_vty.c @@ -41,7 +41,7 @@ DEFUN(config_write_integrated, sigset_t oldmask, sigmask; if (integrated_write_pid != -1) { - vty_outln (vty,"%% configuration write already in progress."); + vty_out (vty,"%% configuration write already in progress.\n"); return CMD_WARNING; } @@ -59,7 +59,7 @@ DEFUN(config_write_integrated, child = fork(); if (child == -1) { - vty_outln (vty, "%% configuration write fork() failed: %s.", + vty_out (vty, "%% configuration write fork() failed: %s.\n", safe_strerror(errno)); sigprocmask(SIG_SETMASK, &oldmask, NULL); return CMD_WARNING; diff --git a/zebra/debug.c b/zebra/debug.c index b57085464..f99e06bbb 100644 --- a/zebra/debug.c +++ b/zebra/debug.c @@ -39,51 +39,48 @@ DEFUN (show_debugging_zebra, "Debugging information\n" "Zebra configuration\n") { - vty_out (vty, "Zebra debugging status:%s", VTYNL); + vty_out (vty, "Zebra debugging status:\n"); if (IS_ZEBRA_DEBUG_EVENT) - vty_out (vty, " Zebra event debugging is on%s", VTYNL); + vty_out (vty, " Zebra event debugging is on\n"); if (IS_ZEBRA_DEBUG_PACKET) { if (IS_ZEBRA_DEBUG_SEND && IS_ZEBRA_DEBUG_RECV) { - vty_out (vty, " Zebra packet%s debugging is on%s", - IS_ZEBRA_DEBUG_DETAIL ? " detail" : "", - VTYNL); + vty_out (vty, " Zebra packet%s debugging is on\n", + IS_ZEBRA_DEBUG_DETAIL ? " detail" : ""); } else { if (IS_ZEBRA_DEBUG_SEND) - vty_out (vty, " Zebra packet send%s debugging is on%s", - IS_ZEBRA_DEBUG_DETAIL ? " detail" : "", - VTYNL); + vty_out (vty, " Zebra packet send%s debugging is on\n", + IS_ZEBRA_DEBUG_DETAIL ? " detail" : ""); else - vty_out (vty, " Zebra packet receive%s debugging is on%s", - IS_ZEBRA_DEBUG_DETAIL ? " detail" : "", - VTYNL); + vty_out (vty, " Zebra packet receive%s debugging is on\n", + IS_ZEBRA_DEBUG_DETAIL ? " detail" : ""); } } if (IS_ZEBRA_DEBUG_KERNEL) - vty_out (vty, " Zebra kernel debugging is on%s", VTYNL); + vty_out (vty, " Zebra kernel debugging is on\n"); if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND) - vty_out (vty, " Zebra kernel netlink message dumps (send) are on%s", VTYNL); + vty_out (vty, " Zebra kernel netlink message dumps (send) are on\n"); if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV) - vty_out (vty, " Zebra kernel netlink message dumps (recv) are on%s", VTYNL); + vty_out (vty, " Zebra kernel netlink message dumps (recv) are on\n"); /* Check here using flags as the 'macro' does an OR */ if (CHECK_FLAG (zebra_debug_rib, ZEBRA_DEBUG_RIB)) - vty_out (vty, " Zebra RIB debugging is on%s", VTYNL); + vty_out (vty, " Zebra RIB debugging is on\n"); if (CHECK_FLAG (zebra_debug_rib, ZEBRA_DEBUG_RIB_DETAILED)) - vty_out (vty, " Zebra RIB detailed debugging is on%s", VTYNL); + vty_out (vty, " Zebra RIB detailed debugging is on\n"); if (IS_ZEBRA_DEBUG_FPM) - vty_out (vty, " Zebra FPM debugging is on%s", VTYNL); + vty_out (vty, " Zebra FPM debugging is on\n"); if (IS_ZEBRA_DEBUG_NHT) - vty_out (vty, " Zebra next-hop tracking debugging is on%s", VTYNL); + vty_out (vty, " Zebra next-hop tracking debugging is on\n"); if (IS_ZEBRA_DEBUG_MPLS) - vty_out (vty, " Zebra MPLS debugging is on%s", VTYNL); + vty_out (vty, " Zebra MPLS debugging is on\n"); return CMD_SUCCESS; } @@ -353,70 +350,67 @@ config_write_debug (struct vty *vty) if (IS_ZEBRA_DEBUG_EVENT) { - vty_out (vty, "debug zebra events%s", VTYNL); + vty_out (vty, "debug zebra events\n"); write++; } if (IS_ZEBRA_DEBUG_PACKET) { if (IS_ZEBRA_DEBUG_SEND && IS_ZEBRA_DEBUG_RECV) { - vty_out (vty, "debug zebra packet%s%s", - IS_ZEBRA_DEBUG_DETAIL ? " detail" : "", - VTYNL); + vty_out (vty, "debug zebra packet%s\n", + IS_ZEBRA_DEBUG_DETAIL ? " detail" : ""); write++; } else { if (IS_ZEBRA_DEBUG_SEND) - vty_out (vty, "debug zebra packet send%s%s", - IS_ZEBRA_DEBUG_DETAIL ? " detail" : "", - VTYNL); + vty_out (vty, "debug zebra packet send%s\n", + IS_ZEBRA_DEBUG_DETAIL ? " detail" : ""); else - vty_out (vty, "debug zebra packet recv%s%s", - IS_ZEBRA_DEBUG_DETAIL ? " detail" : "", - VTYNL); + vty_out (vty, "debug zebra packet recv%s\n", + IS_ZEBRA_DEBUG_DETAIL ? " detail" : ""); write++; } } if (IS_ZEBRA_DEBUG_KERNEL) { - vty_out (vty, "debug zebra kernel%s", VTYNL); + vty_out (vty, "debug zebra kernel\n"); write++; } if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV) { - vty_out (vty, "debug zebra kernel msgdump recv%s", VTYNL); + vty_out (vty, "debug zebra kernel msgdump recv\n"); write++; } if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND) { - vty_out (vty, "debug zebra kernel msgdump send%s", VTYNL); + vty_out (vty, "debug zebra kernel msgdump send\n"); write++; } /* Check here using flags as the 'macro' does an OR */ if (CHECK_FLAG (zebra_debug_rib, ZEBRA_DEBUG_RIB)) { - vty_out (vty, "debug zebra rib%s", VTYNL); + vty_out (vty, "debug zebra rib\n"); write++; } if (CHECK_FLAG (zebra_debug_rib, ZEBRA_DEBUG_RIB_DETAILED)) { - vty_out (vty, "debug zebra rib detailed%s", VTYNL); + vty_out (vty, "debug zebra rib detailed\n"); write++; } if (IS_ZEBRA_DEBUG_FPM) { - vty_out (vty, "debug zebra fpm%s", VTYNL); + vty_out (vty, "debug zebra fpm\n"); write++; } if (IS_ZEBRA_DEBUG_NHT) { - vty_out (vty, "debug zebra nht%s", VTYNL); + vty_out (vty, "debug zebra nht\n"); write++; } if (IS_ZEBRA_DEBUG_MPLS) { - vty_out (vty, "debug zebra mpls%s", VTYNL); + vty_out (vty, "debug zebra mpls\n"); write++; } return write; diff --git a/zebra/interface.c b/zebra/interface.c index e3e2e2c67..39125a392 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -944,7 +944,7 @@ connected_dump_vty (struct vty *vty, struct connected *connected) if (connected->label) vty_out (vty, " %s", connected->label); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } /* Dump interface neighbor address information to vty. */ @@ -959,7 +959,7 @@ nbr_connected_dump_vty (struct vty *vty, struct nbr_connected *connected) prefix_vty_out (vty, p); vty_out (vty, "/%d", p->prefixlen); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } #if defined (HAVE_RTADV) @@ -976,46 +976,46 @@ nd_dump_vty (struct vty *vty, struct interface *ifp) if (rtadv->AdvSendAdvertisements) { - vty_outln (vty, " ND advertised reachable time is %d milliseconds", + vty_out (vty, " ND advertised reachable time is %d milliseconds\n", rtadv->AdvReachableTime); - vty_outln (vty, " ND advertised retransmit interval is %d milliseconds", + vty_out (vty, " ND advertised retransmit interval is %d milliseconds\n", rtadv->AdvRetransTimer); - vty_outln (vty, " ND router advertisements sent: %d rcvd: %d", + vty_out (vty, " ND router advertisements sent: %d rcvd: %d\n", zif->ra_sent, zif->ra_rcvd); interval = rtadv->MaxRtrAdvInterval; if (interval % 1000) - vty_outln (vty, " ND router advertisements are sent every " - "%d milliseconds",interval); + vty_out (vty, " ND router advertisements are sent every " + "%d milliseconds\n",interval); else - vty_outln (vty, " ND router advertisements are sent every " - "%d seconds",interval / 1000); + vty_out (vty, " ND router advertisements are sent every " + "%d seconds\n",interval / 1000); if (rtadv->AdvDefaultLifetime != -1) - vty_outln (vty, " ND router advertisements live for %d seconds", + vty_out (vty, " ND router advertisements live for %d seconds\n", rtadv->AdvDefaultLifetime); else - vty_outln (vty, - " ND router advertisements lifetime tracks ra-interval"); - vty_outln (vty, " ND router advertisement default router preference is " - "%s",rtadv_pref_strs[rtadv->DefaultPreference]); + vty_out (vty, + " ND router advertisements lifetime tracks ra-interval\n"); + vty_out (vty, " ND router advertisement default router preference is " + "%s\n",rtadv_pref_strs[rtadv->DefaultPreference]); if (rtadv->AdvManagedFlag) - vty_outln (vty," Hosts use DHCP to obtain routable addresses."); + vty_out (vty," Hosts use DHCP to obtain routable addresses.\n"); else - vty_outln (vty," Hosts use stateless autoconfig for addresses."); + vty_out (vty," Hosts use stateless autoconfig for addresses.\n"); if (rtadv->AdvHomeAgentFlag) { - vty_outln (vty, - " ND router advertisements with " "Home Agent flag bit set."); + vty_out (vty, + " ND router advertisements with Home Agent flag bit set.\n"); if (rtadv->HomeAgentLifetime != -1) - vty_outln (vty, " Home Agent lifetime is %u seconds", + vty_out (vty, " Home Agent lifetime is %u seconds\n", rtadv->HomeAgentLifetime); else - vty_outln (vty," Home Agent lifetime tracks ra-lifetime"); - vty_outln (vty, " Home Agent preference is %u", + vty_out (vty," Home Agent lifetime tracks ra-lifetime\n"); + vty_out (vty, " Home Agent preference is %u\n", rtadv->HomeAgentPreference); } if (rtadv->AdvIntervalOption) - vty_outln (vty, - " ND router advertisements with Adv. Interval option."); + vty_out (vty, + " ND router advertisements with Adv. Interval option.\n"); } } #endif /* HAVE_RTADV */ @@ -1039,36 +1039,36 @@ if_dump_vty (struct vty *vty, struct interface *ifp) if (CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_LINKDETECTION)) { if (if_is_running(ifp)) - vty_outln (vty, "is up"); + vty_out (vty, "is up\n"); else - vty_outln (vty, "is down"); + vty_out (vty, "is down\n"); } else { - vty_outln (vty, "detection is disabled"); + vty_out (vty, "detection is disabled\n"); } } else { - vty_outln (vty, "down"); + vty_out (vty, "down\n"); } - vty_outln (vty, " Link ups: %5u last: %s", zebra_if->up_count, + vty_out (vty, " Link ups: %5u last: %s\n", zebra_if->up_count, zebra_if->up_last[0] ? zebra_if->up_last : "(never)"); - vty_outln (vty, " Link downs: %5u last: %s", zebra_if->down_count, + vty_out (vty, " Link downs: %5u last: %s\n", zebra_if->down_count, zebra_if->down_last[0] ? zebra_if->down_last : "(never)"); zebra_ptm_show_status(vty, ifp); vrf = vrf_lookup_by_id (ifp->vrf_id); - vty_outln (vty, " vrf: %s", vrf->name); + vty_out (vty, " vrf: %s\n", vrf->name); if (ifp->desc) - vty_outln (vty, " Description: %s",ifp->desc); + vty_out (vty, " Description: %s\n",ifp->desc); if (ifp->ifindex == IFINDEX_INTERNAL) { - vty_outln (vty, " pseudo interface"); + vty_out (vty, " pseudo interface\n"); return; } else if (! CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_ACTIVE)) { - vty_outln (vty, " index %d inactive interface", + vty_out (vty, " index %d inactive interface\n", ifp->ifindex); return; } @@ -1077,11 +1077,11 @@ if_dump_vty (struct vty *vty, struct interface *ifp) ifp->ifindex, ifp->metric, ifp->mtu, ifp->speed); if (ifp->mtu6 != ifp->mtu) vty_out (vty, "mtu6 %d ", ifp->mtu6); - vty_outln (vty, "%s flags: %s", VTYNL, + vty_out (vty, "\n flags: %s\n", if_flag_dump(ifp->flags)); /* Hardware address. */ - vty_outln (vty, " Type: %s", if_link_type_str(ifp->ll_type)); + vty_out (vty, " Type: %s\n", if_link_type_str(ifp->ll_type)); if (ifp->hw_addr_len != 0) { int i; @@ -1089,14 +1089,14 @@ if_dump_vty (struct vty *vty, struct interface *ifp) vty_out (vty, " HWaddr: "); for (i = 0; i < ifp->hw_addr_len; i++) vty_out (vty, "%s%02x", i == 0 ? "" : ":", ifp->hw_addr[i]); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } /* Bandwidth in Mbps */ if (ifp->bandwidth != 0) { vty_out(vty, " bandwidth %u Mbps", ifp->bandwidth); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } for (rn = route_top (zebra_if->ipv4_subnets); rn; rn = route_next (rn)) @@ -1119,23 +1119,23 @@ if_dump_vty (struct vty *vty, struct interface *ifp) { int i; struct if_link_params *iflp = ifp->link_params; - vty_outln (vty, " Traffic Engineering Link Parameters:"); + vty_out (vty, " Traffic Engineering Link Parameters:\n"); if (IS_PARAM_SET(iflp, LP_TE_METRIC)) - vty_outln (vty, " TE metric %u",iflp->te_metric); + vty_out (vty, " TE metric %u\n",iflp->te_metric); if (IS_PARAM_SET(iflp, LP_MAX_BW)) - vty_outln (vty, " Maximum Bandwidth %g (Byte/s)", iflp->max_bw); + vty_out (vty, " Maximum Bandwidth %g (Byte/s)\n", iflp->max_bw); if (IS_PARAM_SET(iflp, LP_MAX_RSV_BW)) - vty_outln (vty, " Maximum Reservable Bandwidth %g (Byte/s)", + vty_out (vty, " Maximum Reservable Bandwidth %g (Byte/s)\n", iflp->max_rsv_bw); if (IS_PARAM_SET(iflp, LP_UNRSV_BW)) { - vty_outln (vty, " Unreserved Bandwidth per Class Type in Byte/s:"); + vty_out (vty, " Unreserved Bandwidth per Class Type in Byte/s:\n"); for (i = 0; i < MAX_CLASS_TYPE; i+=2) - vty_outln (vty, " [%d]: %g (Bytes/sec),\t[%d]: %g (Bytes/sec)", + vty_out (vty, " [%d]: %g (Bytes/sec),\t[%d]: %g (Bytes/sec)\n", i, iflp->unrsv_bw[i], i+1, iflp->unrsv_bw[i + 1]); } if (IS_PARAM_SET(iflp, LP_ADM_GRP)) - vty_outln (vty, " Administrative Group:%u", iflp->admin_grp); + vty_out (vty, " Administrative Group:%u\n", iflp->admin_grp); if (IS_PARAM_SET(iflp, LP_DELAY)) { vty_out(vty, " Link Delay Average: %u (micro-sec.)", iflp->av_delay); @@ -1144,21 +1144,21 @@ if_dump_vty (struct vty *vty, struct interface *ifp) vty_out(vty, " Min: %u (micro-sec.)", iflp->min_delay); vty_out(vty, " Max: %u (micro-sec.)", iflp->max_delay); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } if (IS_PARAM_SET(iflp, LP_DELAY_VAR)) - vty_outln (vty, " Link Delay Variation %u (micro-sec.)", + vty_out (vty, " Link Delay Variation %u (micro-sec.)\n", iflp->delay_var); if (IS_PARAM_SET(iflp, LP_PKT_LOSS)) - vty_outln (vty, " Link Packet Loss %g (in %%)", iflp->pkt_loss); + vty_out (vty, " Link Packet Loss %g (in %%)\n", iflp->pkt_loss); if (IS_PARAM_SET(iflp, LP_AVA_BW)) - vty_outln (vty, " Available Bandwidth %g (Byte/s)", iflp->ava_bw); + vty_out (vty, " Available Bandwidth %g (Byte/s)\n", iflp->ava_bw); if (IS_PARAM_SET(iflp, LP_RES_BW)) - vty_outln (vty, " Residual Bandwidth %g (Byte/s)", iflp->res_bw); + vty_out (vty, " Residual Bandwidth %g (Byte/s)\n", iflp->res_bw); if (IS_PARAM_SET(iflp, LP_USE_BW)) - vty_outln (vty, " Utilized Bandwidth %g (Byte/s)", iflp->use_bw); + vty_out (vty, " Utilized Bandwidth %g (Byte/s)\n", iflp->use_bw); if (IS_PARAM_SET(iflp, LP_RMT_AS)) - vty_outln (vty, " Neighbor ASBR IP: %s AS: %u ", inet_ntoa(iflp->rmt_ip), + vty_out (vty, " Neighbor ASBR IP: %s AS: %u \n", inet_ntoa(iflp->rmt_ip), iflp->rmt_as); } @@ -1169,82 +1169,82 @@ if_dump_vty (struct vty *vty, struct interface *ifp) nd_dump_vty (vty, ifp); #endif /* HAVE_RTADV */ if (listhead(ifp->nbr_connected)) - vty_outln (vty, " Neighbor address(s):"); + vty_out (vty, " Neighbor address(s):\n"); for (ALL_LIST_ELEMENTS_RO (ifp->nbr_connected, node, nbr_connected)) nbr_connected_dump_vty (vty, nbr_connected); #ifdef HAVE_PROC_NET_DEV /* Statistics print out using proc file system. */ - vty_outln (vty, " %lu input packets (%lu multicast), %lu bytes, " - "%lu dropped", + vty_out (vty, " %lu input packets (%lu multicast), %lu bytes, " + "%lu dropped\n", ifp->stats.rx_packets, ifp->stats.rx_multicast, ifp->stats.rx_bytes, ifp->stats.rx_dropped); - vty_outln (vty, " %lu input errors, %lu length, %lu overrun," - " %lu CRC, %lu frame", + vty_out (vty, " %lu input errors, %lu length, %lu overrun," + " %lu CRC, %lu frame\n", ifp->stats.rx_errors, ifp->stats.rx_length_errors, ifp->stats.rx_over_errors, ifp->stats.rx_crc_errors, ifp->stats.rx_frame_errors); - vty_outln (vty, " %lu fifo, %lu missed", ifp->stats.rx_fifo_errors, + vty_out (vty, " %lu fifo, %lu missed\n", ifp->stats.rx_fifo_errors, ifp->stats.rx_missed_errors); - vty_outln (vty, " %lu output packets, %lu bytes, %lu dropped", + vty_out (vty, " %lu output packets, %lu bytes, %lu dropped\n", ifp->stats.tx_packets, ifp->stats.tx_bytes, ifp->stats.tx_dropped); - vty_outln (vty, " %lu output errors, %lu aborted, %lu carrier," - " %lu fifo, %lu heartbeat", + vty_out (vty, " %lu output errors, %lu aborted, %lu carrier," + " %lu fifo, %lu heartbeat\n", ifp->stats.tx_errors, ifp->stats.tx_aborted_errors, ifp->stats.tx_carrier_errors, ifp->stats.tx_fifo_errors, ifp->stats.tx_heartbeat_errors); - vty_outln (vty, " %lu window, %lu collisions", + vty_out (vty, " %lu window, %lu collisions\n", ifp->stats.tx_window_errors, ifp->stats.collisions); #endif /* HAVE_PROC_NET_DEV */ #ifdef HAVE_NET_RT_IFLIST #if defined (__bsdi__) || defined (__NetBSD__) /* Statistics print out using sysctl (). */ - vty_outln (vty, " input packets %llu, bytes %llu, dropped %llu," - " multicast packets %llu", + vty_out (vty, " input packets %llu, bytes %llu, dropped %llu," + " multicast packets %llu\n", (unsigned long long)ifp->stats.ifi_ipackets, (unsigned long long)ifp->stats.ifi_ibytes, (unsigned long long)ifp->stats.ifi_iqdrops, (unsigned long long)ifp->stats.ifi_imcasts); - vty_outln (vty, " input errors %llu", + vty_out (vty, " input errors %llu\n", (unsigned long long)ifp->stats.ifi_ierrors); - vty_outln (vty, " output packets %llu, bytes %llu," - " multicast packets %llu", + vty_out (vty, " output packets %llu, bytes %llu," + " multicast packets %llu\n", (unsigned long long)ifp->stats.ifi_opackets, (unsigned long long)ifp->stats.ifi_obytes, (unsigned long long)ifp->stats.ifi_omcasts); - vty_outln (vty, " output errors %llu", + vty_out (vty, " output errors %llu\n", (unsigned long long)ifp->stats.ifi_oerrors); - vty_outln (vty, " collisions %llu", + vty_out (vty, " collisions %llu\n", (unsigned long long)ifp->stats.ifi_collisions); #else /* Statistics print out using sysctl (). */ - vty_outln (vty, " input packets %lu, bytes %lu, dropped %lu," - " multicast packets %lu", + vty_out (vty, " input packets %lu, bytes %lu, dropped %lu," + " multicast packets %lu\n", ifp->stats.ifi_ipackets, ifp->stats.ifi_ibytes, ifp->stats.ifi_iqdrops,ifp->stats.ifi_imcasts); - vty_outln (vty, " input errors %lu", + vty_out (vty, " input errors %lu\n", ifp->stats.ifi_ierrors); - vty_outln (vty, " output packets %lu, bytes %lu, multicast packets %lu", + vty_out (vty, " output packets %lu, bytes %lu, multicast packets %lu\n", ifp->stats.ifi_opackets, ifp->stats.ifi_obytes, ifp->stats.ifi_omcasts); - vty_outln (vty, " output errors %lu", + vty_out (vty, " output errors %lu\n", ifp->stats.ifi_oerrors); - vty_outln (vty, " collisions %lu", + vty_out (vty, " collisions %lu\n", ifp->stats.ifi_collisions); #endif /* __bsdi__ || __NetBSD__ */ #endif /* HAVE_NET_RT_IFLIST */ @@ -1340,7 +1340,7 @@ DEFUN (show_interface_name_vrf, ifp = if_lookup_by_name (argv[idx_ifname]->arg, vrf_id); if (ifp == NULL) { - vty_outln (vty, "%% Can't find interface %s",argv[idx_ifname]->arg); + vty_out (vty, "%% Can't find interface %s\n",argv[idx_ifname]->arg); return CMD_WARNING; } if_dump_vty (vty, ifp); @@ -1378,7 +1378,7 @@ DEFUN (show_interface_name_vrf_all, if (!found) { - vty_outln (vty, "%% Can't find interface %s", argv[idx_ifname]->arg); + vty_out (vty, "%% Can't find interface %s\n", argv[idx_ifname]->arg); return CMD_WARNING; } @@ -1392,7 +1392,7 @@ if_show_description (struct vty *vty, vrf_id_t vrf_id) struct listnode *node; struct interface *ifp; - vty_outln (vty, "Interface Status Protocol Description"); + vty_out (vty, "Interface Status Protocol Description\n"); for (ALL_LIST_ELEMENTS_RO (vrf_iflist (vrf_id), node, ifp)) { int len; @@ -1422,7 +1422,7 @@ if_show_description (struct vty *vty, vrf_id_t vrf_id) if (ifp->desc) vty_out (vty, "%s", ifp->desc); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } @@ -1458,8 +1458,7 @@ DEFUN (show_interface_desc_vrf_all, RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) if (!list_isempty (vrf->iflist)) { - vty_outln (vty, "%s\tVRF %u%s", VTYNL, vrf->vrf_id, - VTYNL); + vty_out (vty, "\n\tVRF %u\n\n", vrf->vrf_id); if_show_description (vty, vrf->vrf_id); } @@ -1480,7 +1479,7 @@ DEFUN (multicast, ret = if_set_flags (ifp, IFF_MULTICAST); if (ret < 0) { - vty_outln (vty, "Can't set multicast flag"); + vty_out (vty, "Can't set multicast flag\n"); return CMD_WARNING_CONFIG_FAILED; } if_refresh (ifp); @@ -1506,7 +1505,7 @@ DEFUN (no_multicast, ret = if_unset_flags (ifp, IFF_MULTICAST); if (ret < 0) { - vty_outln (vty, "Can't unset multicast flag"); + vty_out (vty, "Can't unset multicast flag\n"); return CMD_WARNING_CONFIG_FAILED; } if_refresh (ifp); @@ -1572,7 +1571,7 @@ DEFUN (shutdown_if, ret = if_unset_flags (ifp, IFF_UP); if (ret < 0) { - vty_outln (vty, "Can't shutdown interface"); + vty_out (vty, "Can't shutdown interface\n"); return CMD_WARNING_CONFIG_FAILED; } if_refresh (ifp); @@ -1598,7 +1597,7 @@ DEFUN (no_shutdown_if, ret = if_set_flags (ifp, IFF_UP | IFF_RUNNING); if (ret < 0) { - vty_outln (vty, "Can't up interface"); + vty_out (vty, "Can't up interface\n"); return CMD_WARNING_CONFIG_FAILED; } if_refresh (ifp); @@ -1630,7 +1629,7 @@ DEFUN (bandwidth_if, /* bandwidth range is <1-100000> */ if (bandwidth < 1 || bandwidth > 100000) { - vty_outln (vty, "Bandwidth is invalid"); + vty_out (vty, "Bandwidth is invalid\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1832,7 +1831,7 @@ DEFUN (link_params_maxbw, if (sscanf (argv[idx_bandwidth]->arg, "%g", &bw) != 1) { - vty_outln (vty, "link_params_maxbw: fscanf: %s",safe_strerror(errno)); + vty_out (vty, "link_params_maxbw: fscanf: %s\n",safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } @@ -1850,8 +1849,8 @@ DEFUN (link_params_maxbw, || (bw <= iflp->res_bw) || (bw <= iflp->use_bw)) { - vty_outln (vty, - "Maximum Bandwidth could not be lower than others bandwidth"); + vty_out (vty, + "Maximum Bandwidth could not be lower than others bandwidth\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1874,7 +1873,7 @@ DEFUN (link_params_max_rsv_bw, if (sscanf (argv[idx_bandwidth]->arg, "%g", &bw) != 1) { - vty_outln (vty, "link_params_max_rsv_bw: fscanf: %s", + vty_out (vty, "link_params_max_rsv_bw: fscanf: %s\n", safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } @@ -1882,8 +1881,8 @@ DEFUN (link_params_max_rsv_bw, /* Check that bandwidth is not greater than maximum bandwidth parameter */ if (bw > iflp->max_bw) { - vty_outln (vty, - "Maximum Reservable Bandwidth could not be greater than Maximum Bandwidth (%g)", + vty_out (vty, + "Maximum Reservable Bandwidth could not be greater than Maximum Bandwidth (%g)\n", iflp->max_bw); return CMD_WARNING_CONFIG_FAILED; } @@ -1911,14 +1910,14 @@ DEFUN (link_params_unrsv_bw, /* We don't have to consider about range check here. */ if (sscanf (argv[idx_number]->arg, "%d", &priority) != 1) { - vty_outln (vty, "link_params_unrsv_bw: fscanf: %s", + vty_out (vty, "link_params_unrsv_bw: fscanf: %s\n", safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } if (sscanf (argv[idx_bandwidth]->arg, "%g", &bw) != 1) { - vty_outln (vty, "link_params_unrsv_bw: fscanf: %s", + vty_out (vty, "link_params_unrsv_bw: fscanf: %s\n", safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } @@ -1926,8 +1925,8 @@ DEFUN (link_params_unrsv_bw, /* Check that bandwidth is not greater than maximum bandwidth parameter */ if (bw > iflp->max_bw) { - vty_outln (vty, - "UnReserved Bandwidth could not be greater than Maximum Bandwidth (%g)", + vty_out (vty, + "UnReserved Bandwidth could not be greater than Maximum Bandwidth (%g)\n", iflp->max_bw); return CMD_WARNING_CONFIG_FAILED; } @@ -1951,7 +1950,7 @@ DEFUN (link_params_admin_grp, if (sscanf (argv[idx_bitpattern]->arg, "0x%lx", &value) != 1) { - vty_outln (vty, "link_params_admin_grp: fscanf: %s", + vty_out (vty, "link_params_admin_grp: fscanf: %s\n", safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } @@ -1995,7 +1994,7 @@ DEFUN (link_params_inter_as, if (!inet_aton (argv[idx_ipv4]->arg, &addr)) { - vty_outln (vty, "Please specify Router-Addr by A.B.C.D"); + vty_out (vty, "Please specify Router-Addr by A.B.C.D\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2069,7 +2068,7 @@ DEFUN (link_params_delay, if (IS_PARAM_SET(iflp, LP_MM_DELAY) && (delay <= iflp->min_delay || delay >= iflp->max_delay)) { - vty_outln (vty, "Average delay should be comprise between Min (%d) and Max (%d) delay", + vty_out (vty, "Average delay should be comprise between Min (%d) and Max (%d) delay\n", iflp->min_delay, iflp->max_delay); return CMD_WARNING_CONFIG_FAILED; } @@ -2094,7 +2093,7 @@ DEFUN (link_params_delay, /* Check new delays value coherency */ if (delay <= low || delay >= high) { - vty_outln (vty, "Average delay should be comprise between Min (%d) and Max (%d) delay", + vty_out (vty, "Average delay should be comprise between Min (%d) and Max (%d) delay\n", low, high); return CMD_WARNING_CONFIG_FAILED; } @@ -2190,7 +2189,7 @@ DEFUN (link_params_pkt_loss, if (sscanf (argv[idx_percentage]->arg, "%g", &fval) != 1) { - vty_outln (vty, "link_params_pkt_loss: fscanf: %s", + vty_out (vty, "link_params_pkt_loss: fscanf: %s\n", safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } @@ -2231,15 +2230,15 @@ DEFUN (link_params_res_bw, if (sscanf (argv[idx_bandwidth]->arg, "%g", &bw) != 1) { - vty_outln (vty, "link_params_res_bw: fscanf: %s",safe_strerror(errno)); + vty_out (vty, "link_params_res_bw: fscanf: %s\n",safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } /* Check that bandwidth is not greater than maximum bandwidth parameter */ if (bw > iflp->max_bw) { - vty_outln (vty, - "Residual Bandwidth could not be greater than Maximum Bandwidth (%g)", + vty_out (vty, + "Residual Bandwidth could not be greater than Maximum Bandwidth (%g)\n", iflp->max_bw); return CMD_WARNING_CONFIG_FAILED; } @@ -2277,15 +2276,15 @@ DEFUN (link_params_ava_bw, if (sscanf (argv[idx_bandwidth]->arg, "%g", &bw) != 1) { - vty_outln (vty, "link_params_ava_bw: fscanf: %s",safe_strerror(errno)); + vty_out (vty, "link_params_ava_bw: fscanf: %s\n",safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } /* Check that bandwidth is not greater than maximum bandwidth parameter */ if (bw > iflp->max_bw) { - vty_outln (vty, - "Available Bandwidth could not be greater than Maximum Bandwidth (%g)", + vty_out (vty, + "Available Bandwidth could not be greater than Maximum Bandwidth (%g)\n", iflp->max_bw); return CMD_WARNING_CONFIG_FAILED; } @@ -2323,15 +2322,15 @@ DEFUN (link_params_use_bw, if (sscanf (argv[idx_bandwidth]->arg, "%g", &bw) != 1) { - vty_outln (vty, "link_params_use_bw: fscanf: %s",safe_strerror(errno)); + vty_out (vty, "link_params_use_bw: fscanf: %s\n",safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } /* Check that bandwidth is not greater than maximum bandwidth parameter */ if (bw > iflp->max_bw) { - vty_outln (vty, - "Utilised Bandwidth could not be greater than Maximum Bandwidth (%g)", + vty_out (vty, + "Utilised Bandwidth could not be greater than Maximum Bandwidth (%g)\n", iflp->max_bw); return CMD_WARNING_CONFIG_FAILED; } @@ -2372,13 +2371,13 @@ ip_address_install (struct vty *vty, struct interface *ifp, ret = str2prefix_ipv4 (addr_str, &cp); if (ret <= 0) { - vty_outln (vty, "%% Malformed address "); + vty_out (vty, "%% Malformed address \n"); return CMD_WARNING_CONFIG_FAILED; } if (ipv4_martian(&cp.prefix)) { - vty_outln (vty, "%% Invalid address"); + vty_out (vty, "%% Invalid address\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2429,7 +2428,7 @@ ip_address_install (struct vty *vty, struct interface *ifp, ret = if_set_prefix (ifp, ifc); if (ret < 0) { - vty_outln (vty, "%% Can't set interface IP address: %s.", + vty_out (vty, "%% Can't set interface IP address: %s.\n", safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } @@ -2456,7 +2455,7 @@ ip_address_uninstall (struct vty *vty, struct interface *ifp, ret = str2prefix_ipv4 (addr_str, &cp); if (ret <= 0) { - vty_outln (vty, "%% Malformed address "); + vty_out (vty, "%% Malformed address \n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2464,7 +2463,7 @@ ip_address_uninstall (struct vty *vty, struct interface *ifp, ifc = connected_check (ifp, (struct prefix *) &cp); if (! ifc) { - vty_outln (vty, "%% Can't find address"); + vty_out (vty, "%% Can't find address\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2487,7 +2486,7 @@ ip_address_uninstall (struct vty *vty, struct interface *ifp, ret = if_unset_prefix (ifp, ifc); if (ret < 0) { - vty_outln (vty, "%% Can't unset interface IP address: %s.", + vty_out (vty, "%% Can't unset interface IP address: %s.\n", safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } @@ -2572,13 +2571,13 @@ ipv6_address_install (struct vty *vty, struct interface *ifp, ret = str2prefix_ipv6 (addr_str, &cp); if (ret <= 0) { - vty_outln (vty, "%% Malformed address "); + vty_out (vty, "%% Malformed address \n"); return CMD_WARNING_CONFIG_FAILED; } if (ipv6_martian(&cp.prefix)) { - vty_outln (vty, "%% Invalid address"); + vty_out (vty, "%% Invalid address\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2625,7 +2624,7 @@ ipv6_address_install (struct vty *vty, struct interface *ifp, if (ret < 0) { - vty_outln (vty, "%% Can't set interface IP address: %s.", + vty_out (vty, "%% Can't set interface IP address: %s.\n", safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } @@ -2665,7 +2664,7 @@ ipv6_address_uninstall (struct vty *vty, struct interface *ifp, ret = str2prefix_ipv6 (addr_str, &cp); if (ret <= 0) { - vty_outln (vty, "%% Malformed address "); + vty_out (vty, "%% Malformed address \n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2673,7 +2672,7 @@ ipv6_address_uninstall (struct vty *vty, struct interface *ifp, ifc = connected_check (ifp, (struct prefix *) &cp); if (! ifc) { - vty_outln (vty, "%% Can't find address"); + vty_out (vty, "%% Can't find address\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2696,7 +2695,7 @@ ipv6_address_uninstall (struct vty *vty, struct interface *ifp, ret = if_prefix_delete_ipv6 (ifp, ifc); if (ret < 0) { - vty_outln (vty, "%% Can't unset interface IP address: %s.", + vty_out (vty, "%% Can't unset interface IP address: %s.\n", safe_strerror(errno)); return CMD_WARNING_CONFIG_FAILED; } @@ -2742,23 +2741,23 @@ link_params_config_write (struct vty *vty, struct interface *ifp) struct if_link_params *iflp = ifp->link_params; - vty_outln (vty, " link-params"); - vty_outln (vty, " enable"); + vty_out (vty, " link-params\n"); + vty_out (vty, " enable\n"); if (IS_PARAM_SET(iflp, LP_TE_METRIC) && iflp->te_metric != ifp->metric) - vty_outln (vty, " metric %u",iflp->te_metric); + vty_out (vty, " metric %u\n",iflp->te_metric); if (IS_PARAM_SET(iflp, LP_MAX_BW) && iflp->max_bw != iflp->default_bw) - vty_outln (vty, " max-bw %g", iflp->max_bw); + vty_out (vty, " max-bw %g\n", iflp->max_bw); if (IS_PARAM_SET(iflp, LP_MAX_RSV_BW) && iflp->max_rsv_bw != iflp->default_bw) - vty_outln (vty, " max-rsv-bw %g", iflp->max_rsv_bw); + vty_out (vty, " max-rsv-bw %g\n", iflp->max_rsv_bw); if (IS_PARAM_SET(iflp, LP_UNRSV_BW)) { for (i = 0; i < 8; i++) if (iflp->unrsv_bw[i] != iflp->default_bw) - vty_outln (vty, " unrsv-bw %d %g", + vty_out (vty, " unrsv-bw %d %g\n", i, iflp->unrsv_bw[i]); } if (IS_PARAM_SET(iflp, LP_ADM_GRP)) - vty_outln (vty, " admin-grp 0x%x", iflp->admin_grp); + vty_out (vty, " admin-grp 0x%x\n", iflp->admin_grp); if (IS_PARAM_SET(iflp, LP_DELAY)) { vty_out(vty, " delay %u", iflp->av_delay); @@ -2767,22 +2766,22 @@ link_params_config_write (struct vty *vty, struct interface *ifp) vty_out(vty, " min %u", iflp->min_delay); vty_out(vty, " max %u", iflp->max_delay); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } if (IS_PARAM_SET(iflp, LP_DELAY_VAR)) - vty_outln (vty, " delay-variation %u", iflp->delay_var); + vty_out (vty, " delay-variation %u\n", iflp->delay_var); if (IS_PARAM_SET(iflp, LP_PKT_LOSS)) - vty_outln (vty, " packet-loss %g", iflp->pkt_loss); + vty_out (vty, " packet-loss %g\n", iflp->pkt_loss); if (IS_PARAM_SET(iflp, LP_AVA_BW)) - vty_outln (vty, " ava-bw %g", iflp->ava_bw); + vty_out (vty, " ava-bw %g\n", iflp->ava_bw); if (IS_PARAM_SET(iflp, LP_RES_BW)) - vty_outln (vty, " res-bw %g", iflp->res_bw); + vty_out (vty, " res-bw %g\n", iflp->res_bw); if (IS_PARAM_SET(iflp, LP_USE_BW)) - vty_outln (vty, " use-bw %g", iflp->use_bw); + vty_out (vty, " use-bw %g\n", iflp->use_bw); if (IS_PARAM_SET(iflp, LP_RMT_AS)) - vty_outln (vty, " neighbor %s as %u", inet_ntoa(iflp->rmt_ip), + vty_out (vty, " neighbor %s as %u\n", inet_ntoa(iflp->rmt_ip), iflp->rmt_as); - vty_outln (vty, " exit-link-params"); + vty_out (vty, " exit-link-params\n"); return 0; } @@ -2808,28 +2807,28 @@ if_config_write (struct vty *vty) vrf = vrf_lookup_by_id (ifp->vrf_id); if (ifp->vrf_id == VRF_DEFAULT) - vty_outln (vty, "interface %s", ifp->name); + vty_out (vty, "interface %s\n", ifp->name); else - vty_outln (vty, "interface %s vrf %s", ifp->name,vrf->name); + vty_out (vty, "interface %s vrf %s\n", ifp->name,vrf->name); if (if_data) { if (if_data->shutdown == IF_ZEBRA_SHUTDOWN_ON) - vty_outln (vty, " shutdown"); + vty_out (vty, " shutdown\n"); zebra_ptm_if_write(vty, if_data); } if (ifp->desc) - vty_outln (vty, " description %s",ifp->desc); + vty_out (vty, " description %s\n",ifp->desc); /* Assign bandwidth here to avoid unnecessary interface flap while processing config script */ if (ifp->bandwidth != 0) - vty_outln (vty, " bandwidth %u", ifp->bandwidth); + vty_out (vty, " bandwidth %u\n", ifp->bandwidth); if (!CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_LINKDETECTION)) - vty_outln (vty, " no link-detect"); + vty_out (vty, " no link-detect\n"); for (ALL_LIST_ELEMENTS_RO (ifp->connected, addrnode, ifc)) { @@ -2844,14 +2843,14 @@ if_config_write (struct vty *vty) if (ifc->label) vty_out (vty, " label %s", ifc->label); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } if (if_data) { if (if_data->multicast != IF_ZEBRA_MULTICAST_UNSPEC) - vty_outln (vty, " %smulticast", + vty_out (vty, " %smulticast\n", if_data->multicast == IF_ZEBRA_MULTICAST_ON ? "" : "no "); } @@ -2865,7 +2864,7 @@ if_config_write (struct vty *vty) link_params_config_write (vty, ifp); - vty_outln (vty, "!"); + vty_out (vty, "!\n"); } return 0; } diff --git a/zebra/irdp_interface.c b/zebra/irdp_interface.c index 5fce704af..323e94818 100644 --- a/zebra/irdp_interface.c +++ b/zebra/irdp_interface.c @@ -343,28 +343,28 @@ void irdp_config_write (struct vty *vty, struct interface *ifp) if(irdp->flags & IF_ACTIVE || irdp->flags & IF_SHUTDOWN) { if( irdp->flags & IF_SHUTDOWN) - vty_outln (vty, " ip irdp shutdown "); + vty_out (vty, " ip irdp shutdown \n"); if( irdp->flags & IF_BROADCAST) - vty_outln (vty, " ip irdp broadcast"); + vty_out (vty, " ip irdp broadcast\n"); else - vty_outln (vty, " ip irdp multicast"); + vty_out (vty, " ip irdp multicast\n"); - vty_outln (vty, " ip irdp preference %ld", + vty_out (vty, " ip irdp preference %ld\n", irdp->Preference); for (ALL_LIST_ELEMENTS_RO (irdp->AdvPrefList, node, adv)) - vty_outln (vty, " ip irdp address %s preference %d", + vty_out (vty, " ip irdp address %s preference %d\n", inet_2a(adv->ip.s_addr, b1), adv->pref); - vty_outln (vty, " ip irdp holdtime %d", + vty_out (vty, " ip irdp holdtime %d\n", irdp->Lifetime); - vty_outln (vty, " ip irdp minadvertinterval %ld", + vty_out (vty, " ip irdp minadvertinterval %ld\n", irdp->MinAdvertInterval); - vty_outln (vty, " ip irdp maxadvertinterval %ld", + vty_out (vty, " ip irdp maxadvertinterval %ld\n", irdp->MaxAdvertInterval); } @@ -478,8 +478,8 @@ DEFUN (ip_irdp_minadvertinterval, return CMD_SUCCESS; } else { - vty_outln (vty, "%% MinAdvertInterval must be less than or equal to " - "MaxAdvertInterval"); + vty_out (vty, "%% MinAdvertInterval must be less than or equal to " + "MaxAdvertInterval\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -505,8 +505,8 @@ DEFUN (ip_irdp_maxadvertinterval, return CMD_SUCCESS; } else { - vty_outln (vty, "%% MaxAdvertInterval must be greater than or equal to " - "MinAdvertInterval"); + vty_out (vty, "%% MaxAdvertInterval must be greater than or equal to " + "MinAdvertInterval\n"); return CMD_WARNING_CONFIG_FAILED; } } diff --git a/zebra/redistribute.c b/zebra/redistribute.c index be7da2565..97616a2a9 100644 --- a/zebra/redistribute.c +++ b/zebra/redistribute.c @@ -695,7 +695,7 @@ zebra_import_table_config (struct vty *vty) if (rmap_name) vty_out(vty, " route-map %s", rmap_name); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); write = 1; } } diff --git a/zebra/router-id.c b/zebra/router-id.c index 164c79b35..e23178cb7 100644 --- a/zebra/router-id.c +++ b/zebra/router-id.c @@ -202,10 +202,10 @@ router_id_write (struct vty *vty) if (zvrf->rid_user_assigned.u.prefix4.s_addr) { if (zvrf_id (zvrf) == VRF_DEFAULT) - vty_outln (vty, "router-id %s", + vty_out (vty, "router-id %s\n", inet_ntoa(zvrf->rid_user_assigned.u.prefix4)); else - vty_outln (vty, "router-id %s vrf %s", + vty_out (vty, "router-id %s vrf %s\n", inet_ntoa (zvrf->rid_user_assigned.u.prefix4), zvrf_name(zvrf)); } diff --git a/zebra/rtadv.c b/zebra/rtadv.c index a15a736db..589ecc949 100644 --- a/zebra/rtadv.c +++ b/zebra/rtadv.c @@ -877,8 +877,8 @@ DEFUN (ipv6_nd_suppress_ra, if (if_is_loopback (ifp) || CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_VRF_LOOPBACK)) { - vty_outln (vty, - "Cannot configure IPv6 Router Advertisements on this interface"); + vty_out (vty, + "Cannot configure IPv6 Router Advertisements on this interface\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -901,8 +901,8 @@ DEFUN (no_ipv6_nd_suppress_ra, if (if_is_loopback (ifp) || CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_VRF_LOOPBACK)) { - vty_outln (vty, - "Cannot configure IPv6 Router Advertisements on this interface"); + vty_out (vty, + "Cannot configure IPv6 Router Advertisements on this interface\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -931,8 +931,8 @@ DEFUN (ipv6_nd_ra_interval_msec, interval = strtoul(argv[idx_number]->arg, NULL, 10); if ((zif->rtadv.AdvDefaultLifetime != -1 && interval > (unsigned)zif->rtadv.AdvDefaultLifetime * 1000)) { - vty_outln (vty, - "This ra-interval would conflict with configured ra-lifetime!"); + vty_out (vty, + "This ra-interval would conflict with configured ra-lifetime!\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -968,8 +968,8 @@ DEFUN (ipv6_nd_ra_interval, interval = strtoul(argv[idx_number]->arg, NULL, 10); if ((zif->rtadv.AdvDefaultLifetime != -1 && interval > (unsigned)zif->rtadv.AdvDefaultLifetime)) { - vty_outln (vty, - "This ra-interval would conflict with configured ra-lifetime!"); + vty_out (vty, + "This ra-interval would conflict with configured ra-lifetime!\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1036,8 +1036,8 @@ DEFUN (ipv6_nd_ra_lifetime, * MaxRtrAdvInterval and 9000 seconds. -- RFC4861, 6.2.1 */ if ((lifetime != 0 && lifetime * 1000 < zif->rtadv.MaxRtrAdvInterval)) { - vty_outln (vty, - "This ra-lifetime would conflict with configured ra-interval"); + vty_out (vty, + "This ra-lifetime would conflict with configured ra-interval\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1333,7 +1333,7 @@ DEFUN (ipv6_nd_prefix, ret = str2prefix_ipv6 (prefix, &rp.prefix); if (!ret) { - vty_outln (vty, "Malformed IPv6 prefix"); + vty_out (vty, "Malformed IPv6 prefix\n"); return CMD_WARNING_CONFIG_FAILED; } apply_mask_ipv6 (&rp.prefix); /* RFC4861 4.6.2 */ @@ -1349,7 +1349,7 @@ DEFUN (ipv6_nd_prefix, rp.AdvPreferredLifetime = strmatch (preflifetime, "infinite") ? UINT32_MAX : strtoll (preflifetime, NULL, 10); if (rp.AdvPreferredLifetime > rp.AdvValidLifetime) { - vty_outln (vty, "Invalid preferred lifetime"); + vty_out (vty, "Invalid preferred lifetime\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -1386,7 +1386,7 @@ DEFUN (no_ipv6_nd_prefix, ret = str2prefix_ipv6 (prefix, &rp.prefix); if (!ret) { - vty_outln (vty, "Malformed IPv6 prefix"); + vty_out (vty, "Malformed IPv6 prefix\n"); return CMD_WARNING_CONFIG_FAILED; } apply_mask_ipv6 (&rp.prefix); /* RFC4861 4.6.2 */ @@ -1394,7 +1394,7 @@ DEFUN (no_ipv6_nd_prefix, ret = rtadv_prefix_reset (zebra_if, &rp); if (!ret) { - vty_outln (vty, "Non-existant IPv6 prefix"); + vty_out (vty, "Non-existant IPv6 prefix\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1495,49 +1495,49 @@ rtadv_config_write (struct vty *vty, struct interface *ifp) CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_VRF_LOOPBACK))) { if (zif->rtadv.AdvSendAdvertisements) - vty_outln (vty, " no ipv6 nd suppress-ra"); + vty_out (vty, " no ipv6 nd suppress-ra\n"); } interval = zif->rtadv.MaxRtrAdvInterval; if (interval % 1000) - vty_outln (vty, " ipv6 nd ra-interval msec %d",interval); + vty_out (vty, " ipv6 nd ra-interval msec %d\n",interval); else if (interval != RTADV_MAX_RTR_ADV_INTERVAL) - vty_outln (vty, " ipv6 nd ra-interval %d",interval / 1000); + vty_out (vty, " ipv6 nd ra-interval %d\n",interval / 1000); if (zif->rtadv.AdvIntervalOption) - vty_outln (vty, " ipv6 nd adv-interval-option"); + vty_out (vty, " ipv6 nd adv-interval-option\n"); if (zif->rtadv.AdvDefaultLifetime != -1) - vty_outln (vty, " ipv6 nd ra-lifetime %d",zif->rtadv.AdvDefaultLifetime); + vty_out (vty, " ipv6 nd ra-lifetime %d\n",zif->rtadv.AdvDefaultLifetime); if (zif->rtadv.HomeAgentPreference) - vty_outln (vty, " ipv6 nd home-agent-preference %u", + vty_out (vty, " ipv6 nd home-agent-preference %u\n", zif->rtadv.HomeAgentPreference); if (zif->rtadv.HomeAgentLifetime != -1) - vty_outln (vty, " ipv6 nd home-agent-lifetime %u", + vty_out (vty, " ipv6 nd home-agent-lifetime %u\n", zif->rtadv.HomeAgentLifetime); if (zif->rtadv.AdvHomeAgentFlag) - vty_outln (vty, " ipv6 nd home-agent-config-flag"); + vty_out (vty, " ipv6 nd home-agent-config-flag\n"); if (zif->rtadv.AdvReachableTime) - vty_outln (vty, " ipv6 nd reachable-time %d", + vty_out (vty, " ipv6 nd reachable-time %d\n", zif->rtadv.AdvReachableTime); if (zif->rtadv.AdvManagedFlag) - vty_outln (vty, " ipv6 nd managed-config-flag"); + vty_out (vty, " ipv6 nd managed-config-flag\n"); if (zif->rtadv.AdvOtherConfigFlag) - vty_outln (vty, " ipv6 nd other-config-flag"); + vty_out (vty, " ipv6 nd other-config-flag\n"); if (zif->rtadv.DefaultPreference != RTADV_PREF_MEDIUM) - vty_outln (vty, " ipv6 nd router-preference %s", + vty_out (vty, " ipv6 nd router-preference %s\n", rtadv_pref_strs[zif->rtadv.DefaultPreference]); if (zif->rtadv.AdvLinkMTU) - vty_outln (vty, " ipv6 nd mtu %d", zif->rtadv.AdvLinkMTU); + vty_out (vty, " ipv6 nd mtu %d\n", zif->rtadv.AdvLinkMTU); for (ALL_LIST_ELEMENTS_RO (zif->rtadv.AdvPrefixList, node, rprefix)) { @@ -1561,7 +1561,7 @@ rtadv_config_write (struct vty *vty, struct interface *ifp) vty_out (vty, " no-autoconfig"); if (rprefix->AdvRouterAddressFlag) vty_out (vty, " router-address"); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c index 3e408c929..d04aff2d3 100644 --- a/zebra/zebra_fpm.c +++ b/zebra/zebra_fpm.c @@ -1438,7 +1438,7 @@ zfpm_start_stats_timer (void) */ #define ZFPM_SHOW_STAT(counter) \ do { \ - vty_outln (vty, "%-40s %10lu %16lu", #counter, total_stats.counter, \ + vty_out (vty, "%-40s %10lu %16lu\n", #counter, total_stats.counter, \ zfpm_g->last_ivl_stats.counter); \ } while (0) @@ -1451,8 +1451,8 @@ zfpm_show_stats (struct vty *vty) zfpm_stats_t total_stats; time_t elapsed; - vty_outln (vty, "%s%-40s %10s Last %2d secs%s", VTYNL, "Counter", - "Total", ZFPM_STATS_IVL_SECS, VTYNL); + vty_out (vty, "\n%-40s %10s Last %2d secs\n\n", "Counter", + "Total", ZFPM_STATS_IVL_SECS); /* * Compute the total stats up to this instant. @@ -1490,7 +1490,7 @@ zfpm_show_stats (struct vty *vty) elapsed = zfpm_get_elapsed_time (zfpm_g->last_stats_clear_time); - vty_outln (vty, "%sStats were cleared %lu seconds ago", VTYNL, + vty_out (vty, "\nStats were cleared %lu seconds ago\n", (unsigned long)elapsed); } @@ -1502,7 +1502,7 @@ zfpm_clear_stats (struct vty *vty) { if (!zfpm_is_enabled ()) { - vty_outln (vty, "The FPM module is not enabled..."); + vty_out (vty, "The FPM module is not enabled...\n"); return; } @@ -1515,7 +1515,7 @@ zfpm_clear_stats (struct vty *vty) zfpm_g->last_stats_clear_time = monotime(NULL); - vty_outln (vty, "Cleared FPM stats"); + vty_out (vty, "Cleared FPM stats\n"); } /* @@ -1671,7 +1671,7 @@ static int fpm_remote_srv_write (struct vty *vty) if (zfpm_g->fpm_server != FPM_DEFAULT_IP || zfpm_g->fpm_port != FPM_DEFAULT_PORT) - vty_outln (vty,"fpm connection ip %s port %d", inet_ntoa (in), + vty_out (vty,"fpm connection ip %s port %d\n", inet_ntoa (in), zfpm_g->fpm_port); return 0; diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c index 510d79693..3c8503878 100644 --- a/zebra/zebra_mpls.c +++ b/zebra/zebra_mpls.c @@ -530,18 +530,18 @@ fec_print (zebra_fec_t *fec, struct vty *vty) rn = fec->rn; prefix2str(&rn->p, buf, BUFSIZ); - vty_outln (vty, "%s", buf); + vty_out (vty, "%s\n", buf); vty_out(vty, " Label: %s", label2str(fec->label, buf, BUFSIZ)); if (fec->label_index != MPLS_INVALID_LABEL_INDEX) vty_out(vty, ", Label Index: %u", fec->label_index); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); if (!list_isempty(fec->client_list)) { vty_out(vty, " Client list:"); for (ALL_LIST_ELEMENTS_RO(fec->client_list, node, client)) vty_out(vty, " %s(fd %d)", zebra_route_string(client->proto), client->sock); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } @@ -1398,7 +1398,7 @@ nhlfe_print (zebra_nhlfe_t *nhlfe, struct vty *vty) if (!nexthop || !nexthop->nh_label) // unexpected return; - vty_outln (vty, " type: %s remote label: %s distance: %d", + vty_out (vty, " type: %s remote label: %s distance: %d\n", nhlfe_type2str(nhlfe->type), label2str(nexthop->nh_label->label[0], buf, BUFSIZ), nhlfe->distance); @@ -1422,7 +1422,7 @@ nhlfe_print (zebra_nhlfe_t *nhlfe, struct vty *vty) } vty_out(vty, "%s", CHECK_FLAG (nhlfe->flags, NHLFE_FLAG_INSTALLED) ? " (installed)" : ""); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } /* @@ -1436,7 +1436,7 @@ lsp_print (zebra_lsp_t *lsp, void *ctxt) vty = (struct vty *) ctxt; - vty_outln (vty, "Local label: %u%s", + vty_out (vty, "Local label: %u%s\n", lsp->ile.in_label, CHECK_FLAG(lsp->flags, LSP_FLAG_INSTALLED) ? " (installed)" : ""); @@ -2238,7 +2238,7 @@ zebra_mpls_write_fec_config (struct vty *vty, struct zebra_vrf *zvrf) write = 1; prefix2str(&rn->p, buf, BUFSIZ); - vty_outln (vty, "mpls label bind %s %s", buf, + vty_out (vty, "mpls label bind %s %s\n", buf, label2str(fec->label, lstr, BUFSIZ)); } } @@ -2809,7 +2809,7 @@ zebra_mpls_print_lsp (struct vty *vty, struct zebra_vrf *zvrf, mpls_label_t labe if (use_json) { json = lsp_json(lsp); - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } @@ -2840,15 +2840,15 @@ zebra_mpls_print_lsp_table (struct vty *vty, struct zebra_vrf *zvrf, json_object_object_add(json, label2str(lsp->ile.in_label, buf, BUFSIZ), lsp_json(lsp)); - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else { - vty_outln (vty, " Inbound Outbound"); - vty_outln (vty, " Label Type Nexthop Label"); - vty_outln (vty, "-------- ------- --------------- --------"); + vty_out (vty, " Inbound Outbound\n"); + vty_out (vty, " Label Type Nexthop Label\n"); + vty_out (vty, "-------- ------- --------------- --------\n"); for (ALL_LIST_ELEMENTS_RO(lsp_list, node, lsp)) { @@ -2871,11 +2871,11 @@ zebra_mpls_print_lsp_table (struct vty *vty, struct zebra_vrf *zvrf, break; } - vty_outln (vty, " %8d", nexthop->nh_label->label[0]); + vty_out (vty, " %8d\n", nexthop->nh_label->label[0]); } } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } list_delete (lsp_list); @@ -2913,7 +2913,7 @@ zebra_mpls_write_lsp_config (struct vty *vty, struct zebra_vrf *zvrf) break; } - vty_outln (vty, "mpls lsp %u %s %s", + vty_out (vty, "mpls lsp %u %s %s\n", slsp->ile.in_label, buf, lstr); } } @@ -2963,7 +2963,7 @@ zebra_mpls_write_label_block_config (struct vty *vty, struct zebra_vrf *zvrf) if ((zvrf->mpls_srgb.start_label != MPLS_DEFAULT_MIN_SRGB_LABEL) || (zvrf->mpls_srgb.end_label != MPLS_DEFAULT_MAX_SRGB_LABEL)) { - vty_outln (vty, "mpls label global-block %u %u", + vty_out (vty, "mpls label global-block %u %u\n", zvrf->mpls_srgb.start_label,zvrf->mpls_srgb.end_label); } diff --git a/zebra/zebra_mpls_vty.c b/zebra/zebra_mpls_vty.c index a7031f692..938e8ef7c 100644 --- a/zebra/zebra_mpls_vty.c +++ b/zebra/zebra_mpls_vty.c @@ -53,20 +53,20 @@ zebra_mpls_transit_lsp (struct vty *vty, int add_cmd, const char *inlabel_str, if (!mpls_enabled) { - vty_outln (vty,"%% MPLS not turned on in kernel, ignoring command"); + vty_out (vty,"%% MPLS not turned on in kernel, ignoring command\n"); return CMD_WARNING_CONFIG_FAILED; } zvrf = vrf_info_lookup(VRF_DEFAULT); if (!zvrf) { - vty_outln (vty, "%% Default VRF does not exist"); + vty_out (vty, "%% Default VRF does not exist\n"); return CMD_WARNING_CONFIG_FAILED; } if (!inlabel_str) { - vty_outln (vty, "%% No Label Information"); + vty_out (vty, "%% No Label Information\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -74,7 +74,7 @@ zebra_mpls_transit_lsp (struct vty *vty, int add_cmd, const char *inlabel_str, label = atoi(inlabel_str); if (!IS_MPLS_UNRESERVED_LABEL(label)) { - vty_outln (vty, "%% Invalid label"); + vty_out (vty, "%% Invalid label\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -82,12 +82,12 @@ zebra_mpls_transit_lsp (struct vty *vty, int add_cmd, const char *inlabel_str, { if (!gate_str) { - vty_outln (vty, "%% No Nexthop Information"); + vty_out (vty, "%% No Nexthop Information\n"); return CMD_WARNING_CONFIG_FAILED; } if (!outlabel_str) { - vty_outln (vty, "%% No Outgoing label Information"); + vty_out (vty, "%% No Outgoing label Information\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -108,7 +108,7 @@ zebra_mpls_transit_lsp (struct vty *vty, int add_cmd, const char *inlabel_str, gtype = NEXTHOP_TYPE_IPV4; else { - vty_outln (vty, "%% Invalid nexthop"); + vty_out (vty, "%% Invalid nexthop\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -133,7 +133,7 @@ zebra_mpls_transit_lsp (struct vty *vty, int add_cmd, const char *inlabel_str, if (!zebra_mpls_lsp_label_consistent (zvrf, in_label, out_label, gtype, &gate, 0)) { - vty_outln (vty,"%% Label value not consistent"); + vty_out (vty,"%% Label value not consistent\n"); return CMD_WARNING_CONFIG_FAILED; } #endif /* HAVE_CUMULUS */ @@ -146,7 +146,7 @@ zebra_mpls_transit_lsp (struct vty *vty, int add_cmd, const char *inlabel_str, if (ret) { - vty_outln (vty, "%% LSP cannot be %s", + vty_out (vty, "%% LSP cannot be %s\n", add_cmd ? "added" : "deleted"); return CMD_WARNING_CONFIG_FAILED; } @@ -218,7 +218,7 @@ zebra_mpls_bind (struct vty *vty, int add_cmd, const char *prefix, zvrf = vrf_info_lookup(VRF_DEFAULT); if (!zvrf) { - vty_outln (vty, "%% Default VRF does not exist"); + vty_out (vty, "%% Default VRF does not exist\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -226,7 +226,7 @@ zebra_mpls_bind (struct vty *vty, int add_cmd, const char *prefix, ret = str2prefix(prefix, &p); if (ret <= 0) { - vty_outln (vty, "%% Malformed address"); + vty_out (vty, "%% Malformed address\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -234,7 +234,7 @@ zebra_mpls_bind (struct vty *vty, int add_cmd, const char *prefix, { if (!label_str) { - vty_outln (vty, "%% No label binding specified"); + vty_out (vty, "%% No label binding specified\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -252,12 +252,12 @@ zebra_mpls_bind (struct vty *vty, int add_cmd, const char *prefix, label = atoi(label_str); if (!IS_MPLS_UNRESERVED_LABEL(label)) { - vty_outln (vty, "%% Invalid label"); + vty_out (vty, "%% Invalid label\n"); return CMD_WARNING_CONFIG_FAILED; } if (zebra_mpls_label_already_bound (zvrf, label)) { - vty_outln (vty,"%% Label already bound to a FEC"); + vty_out (vty,"%% Label already bound to a FEC\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -269,7 +269,7 @@ zebra_mpls_bind (struct vty *vty, int add_cmd, const char *prefix, if (ret) { - vty_outln (vty, "%% FEC to label binding cannot be %s", + vty_out (vty, "%% FEC to label binding cannot be %s\n", add_cmd ? "added" : "deleted"); return CMD_WARNING_CONFIG_FAILED; } @@ -874,7 +874,7 @@ DEFUN (show_mpls_fec, ret = str2prefix(argv[3]->arg, &p); if (ret <= 0) { - vty_outln (vty, "%% Malformed address"); + vty_out (vty, "%% Malformed address\n"); return CMD_WARNING; } zebra_mpls_print_fec (vty, zvrf, &p); @@ -925,7 +925,7 @@ DEFUN (show_mpls_status, "MPLS information\n" "MPLS status\n") { - vty_outln (vty, "MPLS support enabled: %s", + vty_out (vty, "MPLS support enabled: %s\n", (mpls_enabled) ? "yes" : "no (mpls kernel extensions not detected)"); return CMD_SUCCESS; } @@ -942,7 +942,7 @@ zebra_mpls_global_block (struct vty *vty, int add_cmd, zvrf = zebra_vrf_lookup_by_id(VRF_DEFAULT); if (!zvrf) { - vty_outln (vty, "%% Default VRF does not exist"); + vty_out (vty, "%% Default VRF does not exist\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -950,7 +950,7 @@ zebra_mpls_global_block (struct vty *vty, int add_cmd, { if (!start_label_str || !end_label_str) { - vty_outln (vty, "%% Labels not specified"); + vty_out (vty, "%% Labels not specified\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -959,12 +959,12 @@ zebra_mpls_global_block (struct vty *vty, int add_cmd, if (!IS_MPLS_UNRESERVED_LABEL(start_label) || !IS_MPLS_UNRESERVED_LABEL(end_label)) { - vty_outln (vty, "%% Invalid label"); + vty_out (vty, "%% Invalid label\n"); return CMD_WARNING_CONFIG_FAILED; } if (end_label < start_label) { - vty_outln (vty,"%% End label is less than Start label"); + vty_out (vty,"%% End label is less than Start label\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -975,7 +975,7 @@ zebra_mpls_global_block (struct vty *vty, int add_cmd, if (ret) { - vty_outln (vty, "%% Global label block could not be %s", + vty_out (vty, "%% Global label block could not be %s\n", add_cmd ? "added" : "deleted"); return CMD_WARNING_CONFIG_FAILED; } diff --git a/zebra/zebra_ptm.c b/zebra/zebra_ptm.c index 9a7b029dd..39779793f 100644 --- a/zebra/zebra_ptm.c +++ b/zebra/zebra_ptm.c @@ -374,7 +374,7 @@ void zebra_ptm_write (struct vty *vty) { if (ptm_cb.ptm_enable) - vty_outln (vty, "ptm-enable"); + vty_out (vty, "ptm-enable\n"); return; } @@ -1089,9 +1089,9 @@ zebra_ptm_show_status(struct vty *vty, struct interface *ifp) { vty_out (vty, " PTM status: "); if (ifp->ptm_enable) { - vty_outln (vty, "%s",zebra_ptm_get_status_str(ifp->ptm_status)); + vty_out (vty, "%s\n",zebra_ptm_get_status_str(ifp->ptm_status)); } else { - vty_outln (vty, "disabled"); + vty_out (vty, "disabled\n"); } } @@ -1161,5 +1161,5 @@ void zebra_ptm_if_write (struct vty *vty, struct zebra_if *zebra_ifp) { if (zebra_ifp->ptm_enable == ZEBRA_IF_PTM_ENABLE_OFF) - vty_outln (vty, " no ptm-enable"); + vty_out (vty, " no ptm-enable\n"); } diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c index 12bb19935..c82712b9c 100644 --- a/zebra/zebra_rnh.c +++ b/zebra/zebra_rnh.c @@ -993,7 +993,7 @@ print_nh (struct nexthop *nexthop, struct vty *vty) default: break; } - vty_out(vty, "%s", VTYNL); + vty_out(vty, "\n"); } static void @@ -1006,20 +1006,18 @@ print_rnh (struct route_node *rn, struct vty *vty) char buf[BUFSIZ]; rnh = rn->info; - vty_out(vty, "%s%s%s", inet_ntop(rn->p.family, &rn->p.u.prefix, buf, BUFSIZ), - CHECK_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED) ? "(Connected)" : "", - VTYNL); + vty_out(vty, "%s%s\n", inet_ntop(rn->p.family, &rn->p.u.prefix, buf, BUFSIZ), + CHECK_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED) ? "(Connected)" : ""); if (rnh->state) { - vty_out(vty, " resolved via %s%s", - zebra_route_string(rnh->state->type), VTYNL); + vty_out(vty, " resolved via %s\n", + zebra_route_string(rnh->state->type)); for (nexthop = rnh->state->nexthop; nexthop; nexthop = nexthop->next) print_nh(nexthop, vty); } else - vty_out(vty, " unresolved%s%s", - CHECK_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED) ? "(Connected)" : "", - VTYNL); + vty_out(vty, " unresolved%s\n", + CHECK_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED) ? "(Connected)" : ""); vty_out(vty, " Client list:"); for (ALL_LIST_ELEMENTS_RO(rnh->client_list, node, client)) @@ -1027,5 +1025,5 @@ print_rnh (struct route_node *rn, struct vty *vty) client->sock, rnh->filtered[client->proto] ? "(filtered)" : ""); if (!list_isempty(rnh->zebra_static_route_list)) vty_out(vty, " zebra%s", rnh->filtered[ZEBRA_ROUTE_STATIC] ? "(filtered)" : ""); - vty_out(vty, "%s", VTYNL); + vty_out(vty, "\n"); } diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c index 9b4b52427..a7b47165d 100644 --- a/zebra/zebra_routemap.c +++ b/zebra/zebra_routemap.c @@ -73,10 +73,10 @@ zebra_route_match_add(struct vty *vty, switch (ret) { case RMAP_RULE_MISSING: - vty_outln (vty, "%% Zebra Can't find rule."); + vty_out (vty, "%% Zebra Can't find rule.\n"); return CMD_WARNING_CONFIG_FAILED; case RMAP_COMPILE_ERROR: - vty_outln (vty, "%% Zebra Argument is malformed."); + vty_out (vty, "%% Zebra Argument is malformed.\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -121,10 +121,10 @@ zebra_route_match_delete (struct vty *vty, switch (ret) { case RMAP_RULE_MISSING: - vty_outln (vty, "%% Zebra Can't find rule."); + vty_out (vty, "%% Zebra Can't find rule.\n"); return CMD_WARNING_CONFIG_FAILED; case RMAP_COMPILE_ERROR: - vty_outln (vty, "%% Zebra Argument is malformed."); + vty_out (vty, "%% Zebra Argument is malformed.\n"); return CMD_WARNING_CONFIG_FAILED; } } @@ -302,7 +302,7 @@ DEFUN (match_source_protocol, i = proto_name2num(proto); if (i < 0) { - vty_outln (vty, "invalid protocol name \"%s\"", proto); + vty_out (vty, "invalid protocol name \"%s\"\n", proto); return CMD_WARNING_CONFIG_FAILED; } return zebra_route_match_add (vty, "source-protocol", proto, RMAP_EVENT_MATCH_ADDED); @@ -350,7 +350,7 @@ DEFUN (set_src, { if (inet_pton(AF_INET6, argv[idx_ip]->arg, &src.ipv6) != 1) { - vty_outln (vty, "%% not a valid IPv4/v6 address"); + vty_out (vty, "%% not a valid IPv4/v6 address\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -367,7 +367,7 @@ DEFUN (set_src, if (!zebra_check_addr(&p)) { - vty_outln (vty, "%% not a valid source IPv4/v6 address"); + vty_out (vty, "%% not a valid source IPv4/v6 address\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -386,7 +386,7 @@ DEFUN (set_src, if (!pif) { - vty_outln (vty, "%% not a local address"); + vty_out (vty, "%% not a local address\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -459,7 +459,7 @@ DEFUN (ip_protocol, i = proto_name2num(proto); if (i < 0) { - vty_outln (vty, "invalid protocol name \"%s\"", proto); + vty_out (vty, "invalid protocol name \"%s\"\n", proto); return CMD_WARNING_CONFIG_FAILED; } if (proto_rm[AFI_IP][i]) @@ -500,7 +500,7 @@ DEFUN (no_ip_protocol, if (i < 0) { - vty_outln (vty, "invalid protocol name \"%s\"", proto); + vty_out (vty, "invalid protocol name \"%s\"\n", proto); return CMD_WARNING_CONFIG_FAILED; } @@ -529,20 +529,20 @@ DEFUN (show_ip_protocol, { int i; - vty_outln (vty, "Protocol : route-map "); - vty_outln (vty, "------------------------"); + vty_out (vty, "Protocol : route-map \n"); + vty_out (vty, "------------------------\n"); for (i=0;i<ZEBRA_ROUTE_MAX;i++) { if (proto_rm[AFI_IP][i]) - vty_outln (vty, "%-10s : %-10s", zebra_route_string(i), + vty_out (vty, "%-10s : %-10s\n", zebra_route_string(i), proto_rm[AFI_IP][i]); else - vty_outln (vty, "%-10s : none", zebra_route_string(i)); + vty_out (vty, "%-10s : none\n", zebra_route_string(i)); } if (proto_rm[AFI_IP][i]) - vty_outln (vty, "%-10s : %-10s", "any",proto_rm[AFI_IP][i]); + vty_out (vty, "%-10s : %-10s\n", "any",proto_rm[AFI_IP][i]); else - vty_outln (vty, "%-10s : none", "any"); + vty_out (vty, "%-10s : none\n", "any"); return CMD_SUCCESS; } @@ -566,7 +566,7 @@ DEFUN (ipv6_protocol, i = proto_name2num(proto); if (i < 0) { - vty_outln (vty, "invalid protocol name \"%s\"", proto); + vty_out (vty, "invalid protocol name \"%s\"\n", proto); return CMD_WARNING_CONFIG_FAILED; } if (proto_rm[AFI_IP6][i]) @@ -606,7 +606,7 @@ DEFUN (no_ipv6_protocol, i = proto_name2num(proto); if (i < 0) { - vty_outln (vty, "invalid protocol name \"%s\"", proto); + vty_out (vty, "invalid protocol name \"%s\"\n", proto); return CMD_WARNING_CONFIG_FAILED; } if (!proto_rm[AFI_IP6][i]) @@ -635,20 +635,20 @@ DEFUN (show_ipv6_protocol, { int i; - vty_outln (vty, "Protocol : route-map "); - vty_outln (vty, "------------------------"); + vty_out (vty, "Protocol : route-map \n"); + vty_out (vty, "------------------------\n"); for (i=0;i<ZEBRA_ROUTE_MAX;i++) { if (proto_rm[AFI_IP6][i]) - vty_outln (vty, "%-10s : %-10s", zebra_route_string(i), + vty_out (vty, "%-10s : %-10s\n", zebra_route_string(i), proto_rm[AFI_IP6][i]); else - vty_outln (vty, "%-10s : none", zebra_route_string(i)); + vty_out (vty, "%-10s : none\n", zebra_route_string(i)); } if (proto_rm[AFI_IP6][i]) - vty_outln (vty, "%-10s : %-10s", "any",proto_rm[AFI_IP6][i]); + vty_out (vty, "%-10s : %-10s\n", "any",proto_rm[AFI_IP6][i]); else - vty_outln (vty, "%-10s : none", "any"); + vty_out (vty, "%-10s : none\n", "any"); return CMD_SUCCESS; } @@ -672,7 +672,7 @@ DEFUN (ip_protocol_nht_rmap, i = proto_name2num(proto); if (i < 0) { - vty_outln (vty, "invalid protocol name \"%s\"", proto); + vty_out (vty, "invalid protocol name \"%s\"\n", proto); return CMD_WARNING_CONFIG_FAILED; } if (nht_rm[AFI_IP][i]) @@ -707,7 +707,7 @@ DEFUN (no_ip_protocol_nht_rmap, if (i < 0) { - vty_outln (vty, "invalid protocol name \"%s\"", proto); + vty_out (vty, "invalid protocol name \"%s\"\n", proto); return CMD_WARNING_CONFIG_FAILED; } @@ -733,20 +733,20 @@ DEFUN (show_ip_protocol_nht, { int i; - vty_outln (vty, "Protocol : route-map "); - vty_outln (vty, "------------------------"); + vty_out (vty, "Protocol : route-map \n"); + vty_out (vty, "------------------------\n"); for (i=0;i<ZEBRA_ROUTE_MAX;i++) { if (nht_rm[AFI_IP][i]) - vty_outln (vty, "%-10s : %-10s", zebra_route_string(i), + vty_out (vty, "%-10s : %-10s\n", zebra_route_string(i), nht_rm[AFI_IP][i]); else - vty_outln (vty, "%-10s : none", zebra_route_string(i)); + vty_out (vty, "%-10s : none\n", zebra_route_string(i)); } if (nht_rm[AFI_IP][i]) - vty_outln (vty, "%-10s : %-10s", "any",nht_rm[AFI_IP][i]); + vty_out (vty, "%-10s : %-10s\n", "any",nht_rm[AFI_IP][i]); else - vty_outln (vty, "%-10s : none", "any"); + vty_out (vty, "%-10s : none\n", "any"); return CMD_SUCCESS; } @@ -770,7 +770,7 @@ DEFUN (ipv6_protocol_nht_rmap, i = proto_name2num(proto); if (i < 0) { - vty_outln (vty, "invalid protocol name \"%s\"", proto); + vty_out (vty, "invalid protocol name \"%s\"\n", proto); return CMD_WARNING_CONFIG_FAILED; } if (nht_rm[AFI_IP6][i]) @@ -801,13 +801,13 @@ DEFUN (no_ipv6_protocol_nht_rmap, i = proto_name2num(proto); if (i < 0) { - vty_outln (vty, "invalid protocol name \"%s\"", proto); + vty_out (vty, "invalid protocol name \"%s\"\n", proto); return CMD_WARNING_CONFIG_FAILED; } if (nht_rm[AFI_IP6][i] && rmap && strcmp(rmap, nht_rm[AFI_IP6][i])) { - vty_outln (vty, "invalid route-map \"%s\"", rmap); + vty_out (vty, "invalid route-map \"%s\"\n", rmap); return CMD_WARNING_CONFIG_FAILED; } @@ -832,20 +832,20 @@ DEFUN (show_ipv6_protocol_nht, { int i; - vty_outln (vty, "Protocol : route-map "); - vty_outln (vty, "------------------------"); + vty_out (vty, "Protocol : route-map \n"); + vty_out (vty, "------------------------\n"); for (i=0;i<ZEBRA_ROUTE_MAX;i++) { if (nht_rm[AFI_IP6][i]) - vty_outln (vty, "%-10s : %-10s", zebra_route_string(i), + vty_out (vty, "%-10s : %-10s\n", zebra_route_string(i), nht_rm[AFI_IP6][i]); else - vty_outln (vty, "%-10s : none", zebra_route_string(i)); + vty_out (vty, "%-10s : none\n", zebra_route_string(i)); } if (nht_rm[AFI_IP][i]) - vty_outln (vty, "%-10s : %-10s", "any",nht_rm[AFI_IP6][i]); + vty_out (vty, "%-10s : %-10s\n", "any",nht_rm[AFI_IP6][i]); else - vty_outln (vty, "%-10s : none", "any"); + vty_out (vty, "%-10s : none\n", "any"); return CMD_SUCCESS; } @@ -1294,7 +1294,7 @@ void zebra_route_map_write_delay_timer (struct vty *vty) { if (vty && (zebra_rmap_update_timer != ZEBRA_RMAP_DEFAULT_UPDATE_TIMER)) - vty_outln (vty, "zebra route-map delay-timer %d", + vty_out (vty, "zebra route-map delay-timer %d\n", zebra_rmap_update_timer); return; } @@ -1431,40 +1431,40 @@ zebra_routemap_config_write_protocol (struct vty *vty) for (i=0;i<ZEBRA_ROUTE_MAX;i++) { if (proto_rm[AFI_IP][i]) - vty_outln (vty, "ip protocol %s route-map %s", zebra_route_string(i), + vty_out (vty, "ip protocol %s route-map %s\n", zebra_route_string(i), proto_rm[AFI_IP][i]); if (proto_rm[AFI_IP6][i]) - vty_outln (vty, "ipv6 protocol %s route-map %s", zebra_route_string(i), + vty_out (vty, "ipv6 protocol %s route-map %s\n", zebra_route_string(i), proto_rm[AFI_IP6][i]); if (nht_rm[AFI_IP][i]) - vty_outln (vty, "ip nht %s route-map %s", zebra_route_string(i), + vty_out (vty, "ip nht %s route-map %s\n", zebra_route_string(i), nht_rm[AFI_IP][i]); if (nht_rm[AFI_IP6][i]) - vty_outln (vty, "ipv6 nht %s route-map %s", zebra_route_string(i), + vty_out (vty, "ipv6 nht %s route-map %s\n", zebra_route_string(i), nht_rm[AFI_IP6][i]); } if (proto_rm[AFI_IP][ZEBRA_ROUTE_MAX]) - vty_outln (vty, "ip protocol %s route-map %s", "any", + vty_out (vty, "ip protocol %s route-map %s\n", "any", proto_rm[AFI_IP][ZEBRA_ROUTE_MAX]); if (proto_rm[AFI_IP6][ZEBRA_ROUTE_MAX]) - vty_outln (vty, "ipv6 protocol %s route-map %s", "any", + vty_out (vty, "ipv6 protocol %s route-map %s\n", "any", proto_rm[AFI_IP6][ZEBRA_ROUTE_MAX]); if (nht_rm[AFI_IP][ZEBRA_ROUTE_MAX]) - vty_outln (vty, "ip nht %s route-map %s", "any", + vty_out (vty, "ip nht %s route-map %s\n", "any", nht_rm[AFI_IP][ZEBRA_ROUTE_MAX]); if (nht_rm[AFI_IP6][ZEBRA_ROUTE_MAX]) - vty_outln (vty, "ipv6 nht %s route-map %s", "any", + vty_out (vty, "ipv6 nht %s route-map %s\n", "any", nht_rm[AFI_IP6][ZEBRA_ROUTE_MAX]); if (zebra_rmap_update_timer != ZEBRA_RMAP_DEFAULT_UPDATE_TIMER) - vty_outln (vty, "zebra route-map delay-timer %d", + vty_out (vty, "zebra route-map delay-timer %d\n", zebra_rmap_update_timer); } diff --git a/zebra/zebra_vrf.c b/zebra/zebra_vrf.c index 165689267..bedecf009 100644 --- a/zebra/zebra_vrf.c +++ b/zebra/zebra_vrf.c @@ -524,8 +524,8 @@ vrf_config_write (struct vty *vty) zvrf = vrf->info; if (! zvrf || strcmp (zvrf_name (zvrf), VRF_DEFAULT_NAME)) { - vty_outln (vty, "vrf %s", zvrf_name(zvrf)); - vty_outln (vty, "!"); + vty_out (vty, "vrf %s\n", zvrf_name(zvrf)); + vty_out (vty, "!\n"); } } return 0; diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 363c31283..90bb21c66 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -79,7 +79,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, ret = str2prefix (dest_str, &p); if (ret <= 0) { - vty_outln (vty, "%% Malformed address"); + vty_out (vty, "%% Malformed address\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -89,7 +89,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, ret = inet_aton (mask_str, &mask); if (ret == 0) { - vty_outln (vty, "%% Malformed address"); + vty_out (vty, "%% Malformed address\n"); return CMD_WARNING_CONFIG_FAILED; } p.prefixlen = ip_masklen (mask); @@ -113,7 +113,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, if (!zvrf) { - vty_outln (vty, "%% vrf %s is not defined", vrf_id_str); + vty_out (vty, "%% vrf %s is not defined\n", vrf_id_str); return CMD_WARNING_CONFIG_FAILED; } @@ -122,8 +122,8 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, { if (!mpls_enabled) { - vty_outln (vty, - "%% MPLS not turned on in kernel, ignoring command"); + vty_out (vty, + "%% MPLS not turned on in kernel, ignoring command\n"); return CMD_WARNING_CONFIG_FAILED; } int rc = mpls_str2label (label_str, &snh_label.num_labels, @@ -132,14 +132,14 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, { switch (rc) { case -1: - vty_outln (vty, "%% Malformed label(s)"); + vty_out (vty, "%% Malformed label(s)\n"); break; case -2: - vty_outln (vty, "%% Cannot use reserved label(s) (%d-%d)", + vty_out (vty, "%% Cannot use reserved label(s) (%d-%d)\n", MPLS_MIN_RESERVED_LABEL,MPLS_MAX_RESERVED_LABEL); break; case -3: - vty_outln (vty, "%% Too many labels. Enter %d or fewer", + vty_out (vty, "%% Too many labels. Enter %d or fewer\n", MPLS_MAX_LABELS); break; } @@ -152,7 +152,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, { if (flag_str) { - vty_outln (vty, "%% can not have flag %s with Null0", flag_str); + vty_out (vty, "%% can not have flag %s with Null0\n", flag_str); return CMD_WARNING_CONFIG_FAILED; } if (add_cmd) @@ -176,7 +176,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, SET_FLAG (flag, ZEBRA_FLAG_BLACKHOLE); break; default: - vty_outln (vty, "%% Malformed flag %s ", flag_str); + vty_out (vty, "%% Malformed flag %s \n", flag_str); return CMD_WARNING_CONFIG_FAILED; } } @@ -201,7 +201,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, struct interface *ifp = if_lookup_by_name (gate_str, zvrf_id (zvrf)); if (!ifp) { - vty_outln (vty, "%% Unknown interface: %s", gate_str); + vty_out (vty, "%% Unknown interface: %s\n", gate_str); ifindex = IFINDEX_DELETED; } else @@ -286,7 +286,7 @@ DEFUN (ip_multicast_mode, multicast_mode_ipv4_set (MCAST_MIX_PFXLEN); else { - vty_outln (vty, "Invalid mode specified"); + vty_out (vty, "Invalid mode specified\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -340,7 +340,7 @@ DEFUN (show_ip_rpf_addr, ret = inet_aton (argv[idx_ipv4]->arg, &addr); if (ret == 0) { - vty_outln (vty, "%% Malformed address"); + vty_out (vty, "%% Malformed address\n"); return CMD_WARNING; } @@ -349,7 +349,7 @@ DEFUN (show_ip_rpf_addr, if (re) vty_show_ip_route_detail (vty, rn, 1); else - vty_outln (vty, "%% No match for RPF lookup"); + vty_out (vty, "%% No match for RPF lookup\n"); return CMD_SUCCESS; } @@ -655,9 +655,8 @@ vty_show_ip_route_detail (struct vty *vty, struct route_node *rn, int mcast) : " using Unicast RIB"; } - vty_out (vty, "Routing entry for %s%s%s", - srcdest_rnode2str(rn, buf, sizeof(buf)), mcast_info, - VTYNL); + vty_out (vty, "Routing entry for %s%s\n", + srcdest_rnode2str(rn, buf, sizeof(buf)), mcast_info); vty_out (vty, " Known via \"%s", zebra_route_string (re->type)); if (re->instance) vty_out (vty, "[%d]", re->instance); @@ -680,7 +679,7 @@ vty_show_ip_route_detail (struct vty *vty, struct route_node *rn, int mcast) vty_out (vty, ", blackhole"); if (CHECK_FLAG (re->flags, ZEBRA_FLAG_REJECT)) vty_out (vty, ", reject"); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); if (re->type == ZEBRA_ROUTE_RIP || re->type == ZEBRA_ROUTE_OSPF @@ -708,7 +707,7 @@ vty_show_ip_route_detail (struct vty *vty, struct route_node *rn, int mcast) vty_out (vty, "%02dw%dd%02dh", tm->tm_yday/7, tm->tm_yday - ((tm->tm_yday/7) * 7), tm->tm_hour); - vty_out (vty, " ago%s", VTYNL); + vty_out (vty, " ago\n"); } for (ALL_NEXTHOPS(re->nexthop, nexthop)) @@ -787,9 +786,9 @@ vty_show_ip_route_detail (struct vty *vty, struct route_node *rn, int mcast) nexthop->nh_label->label, buf, sizeof buf, 1)); } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } } @@ -1076,7 +1075,7 @@ vty_show_ip_route (struct vty *vty, struct route_node *rn, struct route_entry *r tm->tm_yday/7, tm->tm_yday - ((tm->tm_yday/7) * 7), tm->tm_hour); } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } } @@ -1105,18 +1104,18 @@ do_show_ip_route (struct vty *vty, const char *vrf_name, afi_t afi, safi_t safi, if (!(zvrf = zebra_vrf_lookup_by_name (vrf_name))) { if (use_json) - vty_outln (vty, "{}"); + vty_out (vty, "{}\n"); else - vty_outln (vty, "vrf %s not defined", vrf_name); + vty_out (vty, "vrf %s not defined\n", vrf_name); return CMD_SUCCESS; } if (zvrf_id (zvrf) == VRF_UNKNOWN) { if (use_json) - vty_outln (vty, "{}"); + vty_out (vty, "{}\n"); else - vty_outln (vty, "vrf %s inactive", vrf_name); + vty_out (vty, "vrf %s inactive\n", vrf_name); return CMD_SUCCESS; } @@ -1124,7 +1123,7 @@ do_show_ip_route (struct vty *vty, const char *vrf_name, afi_t afi, safi_t safi, if (! table) { if (use_json) - vty_outln (vty, "{}"); + vty_out (vty, "{}\n"); return CMD_SUCCESS; } @@ -1181,7 +1180,7 @@ do_show_ip_route (struct vty *vty, const char *vrf_name, afi_t afi, safi_t safi, vty_out (vty, SHOW_ROUTE_V6_HEADER); if (zvrf_id (zvrf) != VRF_DEFAULT) - vty_outln (vty, "%sVRF %s:", VTYNL, + vty_out (vty, "\nVRF %s:\n", zvrf_name(zvrf)); first = 0; @@ -1201,7 +1200,7 @@ do_show_ip_route (struct vty *vty, const char *vrf_name, afi_t afi, safi_t safi, if (use_json) { - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } @@ -1242,7 +1241,7 @@ DEFUN (show_ip_nht_vrf_all, RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) if ((zvrf = vrf->info) != NULL) { - vty_outln (vty, "%sVRF %s:", VTYNL, zvrf_name(zvrf)); + vty_out (vty, "\nVRF %s:\n", zvrf_name(zvrf)); zebra_print_rnh_table(zvrf_id (zvrf), AF_INET, vty, RNH_NEXTHOP_TYPE); } @@ -1282,7 +1281,7 @@ DEFUN (show_ipv6_nht_vrf_all, RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) if ((zvrf = vrf->info) != NULL) { - vty_outln (vty, "%sVRF %s:", VTYNL, zvrf_name(zvrf)); + vty_out (vty, "\nVRF %s:\n", zvrf_name(zvrf)); zebra_print_rnh_table(zvrf_id (zvrf), AF_INET6, vty, RNH_NEXTHOP_TYPE); } @@ -1438,7 +1437,7 @@ DEFUN (show_ip_route, if (type < 0) { - vty_outln (vty, "Unknown route type"); + vty_out (vty, "Unknown route type\n"); return CMD_WARNING; } } @@ -1491,7 +1490,7 @@ DEFUN (show_ip_route_addr, if (ret <= 0) { - vty_outln (vty, "%% Malformed IPv4 address"); + vty_out (vty, "%% Malformed IPv4 address\n"); return CMD_WARNING; } @@ -1502,7 +1501,7 @@ DEFUN (show_ip_route_addr, rn = route_node_match (table, (struct prefix *) &p); if (! rn) { - vty_outln (vty, "%% Network not in table"); + vty_out (vty, "%% Network not in table\n"); return CMD_WARNING; } @@ -1540,7 +1539,7 @@ DEFUN (show_ip_route_prefix, if (ret <= 0) { - vty_outln (vty, "%% Malformed IPv4 address"); + vty_out (vty, "%% Malformed IPv4 address\n"); return CMD_WARNING; } @@ -1551,7 +1550,7 @@ DEFUN (show_ip_route_prefix, rn = route_node_match (table, (struct prefix *) &p); if (! rn || rn->p.prefixlen != p.prefixlen) { - vty_outln (vty, "%% Network not in table"); + vty_out (vty, "%% Network not in table\n"); return CMD_WARNING; } @@ -1600,7 +1599,7 @@ vty_show_ip_route_summary (struct vty *vty, struct route_table *table) } } - vty_outln (vty, "%-20s %-20s %s (vrf %s)", + vty_out (vty, "%-20s %-20s %s (vrf %s)\n", "Route Source", "Routes", "FIB", zvrf_name(((rib_table_info_t *)table->info)->zvrf)); @@ -1611,21 +1610,21 @@ vty_show_ip_route_summary (struct vty *vty, struct route_table *table) { if (i == ZEBRA_ROUTE_BGP) { - vty_outln (vty, "%-20s %-20d %-20d ", "ebgp", + vty_out (vty, "%-20s %-20d %-20d \n", "ebgp", rib_cnt[ZEBRA_ROUTE_BGP],fib_cnt[ZEBRA_ROUTE_BGP]); - vty_outln (vty, "%-20s %-20d %-20d ", "ibgp", + vty_out (vty, "%-20s %-20d %-20d \n", "ibgp", rib_cnt[ZEBRA_ROUTE_IBGP],fib_cnt[ZEBRA_ROUTE_IBGP]); } else - vty_outln (vty, "%-20s %-20d %-20d ", zebra_route_string(i), + vty_out (vty, "%-20s %-20d %-20d \n", zebra_route_string(i), rib_cnt[i], fib_cnt[i]); } } - vty_outln (vty, "------"); - vty_outln (vty, "%-20s %-20d %-20d ", "Totals", rib_cnt[ZEBRA_ROUTE_TOTAL], + vty_out (vty, "------\n"); + vty_out (vty, "%-20s %-20d %-20d \n", "Totals", rib_cnt[ZEBRA_ROUTE_TOTAL], fib_cnt[ZEBRA_ROUTE_TOTAL]); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } /* @@ -1678,7 +1677,7 @@ vty_show_ip_route_summary_prefix (struct vty *vty, struct route_table *table) } } - vty_outln (vty, "%-20s %-20s %s (vrf %s)", + vty_out (vty, "%-20s %-20s %s (vrf %s)\n", "Route Source", "Prefix Routes", "FIB", zvrf_name(((rib_table_info_t *)table->info)->zvrf)); @@ -1688,22 +1687,22 @@ vty_show_ip_route_summary_prefix (struct vty *vty, struct route_table *table) { if (i == ZEBRA_ROUTE_BGP) { - vty_outln (vty, "%-20s %-20d %-20d ", "ebgp", + vty_out (vty, "%-20s %-20d %-20d \n", "ebgp", rib_cnt[ZEBRA_ROUTE_BGP] - rib_cnt[ZEBRA_ROUTE_IBGP], fib_cnt[ZEBRA_ROUTE_BGP] - fib_cnt[ZEBRA_ROUTE_IBGP]); - vty_outln (vty, "%-20s %-20d %-20d ", "ibgp", + vty_out (vty, "%-20s %-20d %-20d \n", "ibgp", rib_cnt[ZEBRA_ROUTE_IBGP],fib_cnt[ZEBRA_ROUTE_IBGP]); } else - vty_outln (vty, "%-20s %-20d %-20d ", zebra_route_string(i), + vty_out (vty, "%-20s %-20d %-20d \n", zebra_route_string(i), rib_cnt[i], fib_cnt[i]); } } - vty_outln (vty, "------"); - vty_outln (vty, "%-20s %-20d %-20d ", "Totals", rib_cnt[ZEBRA_ROUTE_TOTAL], + vty_out (vty, "------\n"); + vty_out (vty, "%-20s %-20d %-20d \n", "Totals", rib_cnt[ZEBRA_ROUTE_TOTAL], fib_cnt[ZEBRA_ROUTE_TOTAL]); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } /* Show route summary. */ @@ -1778,7 +1777,7 @@ DEFUN (show_ip_route_vrf_all_addr, ret = str2prefix_ipv4 (argv[idx_ipv4]->arg, &p); if (ret <= 0) { - vty_outln (vty, "%% Malformed IPv4 address"); + vty_out (vty, "%% Malformed IPv4 address\n"); return CMD_WARNING; } @@ -1820,7 +1819,7 @@ DEFUN (show_ip_route_vrf_all_prefix, ret = str2prefix_ipv4 (argv[idx_ipv4_prefixlen]->arg, &p); if (ret <= 0) { - vty_outln (vty, "%% Malformed IPv4 address"); + vty_out (vty, "%% Malformed IPv4 address\n"); return CMD_WARNING; } @@ -1956,7 +1955,7 @@ static_config (struct vty *vty, afi_t afi, safi_t safi, const char *cmd) mpls_label2str (si->snh_label.num_labels, si->snh_label.label, buf, sizeof buf, 0)); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); write = 1; } @@ -1990,7 +1989,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, ret = str2prefix (dest_str, &p); if (ret <= 0) { - vty_outln (vty, "%% Malformed address"); + vty_out (vty, "%% Malformed address\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -1999,7 +1998,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, ret = str2prefix (src_str, &src); if (ret <= 0 || src.family != AF_INET6) { - vty_outln (vty, "%% Malformed source address"); + vty_out (vty, "%% Malformed source address\n"); return CMD_WARNING_CONFIG_FAILED; } src_p = (struct prefix_ipv6*)&src; @@ -2027,7 +2026,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, if (!zvrf) { - vty_outln (vty, "%% vrf %s is not defined", vrf_id_str); + vty_out (vty, "%% vrf %s is not defined\n", vrf_id_str); return CMD_WARNING_CONFIG_FAILED; } @@ -2037,8 +2036,8 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, { if (!mpls_enabled) { - vty_outln (vty, - "%% MPLS not turned on in kernel, ignoring command"); + vty_out (vty, + "%% MPLS not turned on in kernel, ignoring command\n"); return CMD_WARNING_CONFIG_FAILED; } int rc = mpls_str2label (label_str, &snh_label.num_labels, @@ -2047,14 +2046,14 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, { switch (rc) { case -1: - vty_outln (vty, "%% Malformed label(s)"); + vty_out (vty, "%% Malformed label(s)\n"); break; case -2: - vty_outln (vty, "%% Cannot use reserved label(s) (%d-%d)", + vty_out (vty, "%% Cannot use reserved label(s) (%d-%d)\n", MPLS_MIN_RESERVED_LABEL,MPLS_MAX_RESERVED_LABEL); break; case -3: - vty_outln (vty, "%% Too many labels. Enter %d or fewer", + vty_out (vty, "%% Too many labels. Enter %d or fewer\n", MPLS_MAX_LABELS); break; } @@ -2067,7 +2066,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, { if (flag_str) { - vty_outln (vty, "%% can not have flag %s with Null0", flag_str); + vty_out (vty, "%% can not have flag %s with Null0\n", flag_str); return CMD_WARNING_CONFIG_FAILED; } if (add_cmd) @@ -2091,7 +2090,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, SET_FLAG (flag, ZEBRA_FLAG_BLACKHOLE); break; default: - vty_outln (vty, "%% Malformed flag %s ", flag_str); + vty_out (vty, "%% Malformed flag %s \n", flag_str); return CMD_WARNING_CONFIG_FAILED; } } @@ -2102,7 +2101,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, address. */ if (ret != 1) { - vty_outln (vty, "%% Malformed address"); + vty_out (vty, "%% Malformed address\n"); return CMD_WARNING_CONFIG_FAILED; } type = STATIC_IPV6_GATEWAY_IFINDEX; @@ -2110,7 +2109,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, ifp = if_lookup_by_name (ifname, zvrf_id (zvrf)); if (!ifp) { - vty_outln (vty, "%% Malformed Interface name %s", ifname); + vty_out (vty, "%% Malformed Interface name %s\n", ifname); return CMD_WARNING_CONFIG_FAILED; } ifindex = ifp->ifindex; @@ -2128,7 +2127,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, ifp = if_lookup_by_name (gate_str, zvrf_id (zvrf)); if (!ifp) { - vty_outln (vty, "%% Malformed Interface name %s", gate_str); + vty_out (vty, "%% Malformed Interface name %s\n", gate_str); ifindex = IFINDEX_DELETED; } else @@ -2616,7 +2615,7 @@ DEFUN (show_ipv6_route, if (type < 0) { - vty_outln (vty, "Unknown route type"); + vty_out (vty, "Unknown route type\n"); return CMD_WARNING; } } @@ -2669,7 +2668,7 @@ DEFUN (show_ipv6_route_addr, if (ret <= 0) { - vty_outln (vty, "Malformed IPv6 address"); + vty_out (vty, "Malformed IPv6 address\n"); return CMD_WARNING; } @@ -2680,7 +2679,7 @@ DEFUN (show_ipv6_route_addr, rn = route_node_match (table, (struct prefix *) &p); if (! rn) { - vty_outln (vty, "%% Network not in table"); + vty_out (vty, "%% Network not in table\n"); return CMD_WARNING; } @@ -2716,7 +2715,7 @@ DEFUN (show_ipv6_route_prefix, if (ret <= 0) { - vty_outln (vty, "Malformed IPv6 prefix"); + vty_out (vty, "Malformed IPv6 prefix\n"); return CMD_WARNING; } @@ -2727,7 +2726,7 @@ DEFUN (show_ipv6_route_prefix, rn = route_node_match (table, (struct prefix *) &p); if (! rn || rn->p.prefixlen != p.prefixlen) { - vty_outln (vty, "%% Network not in table"); + vty_out (vty, "%% Network not in table\n"); return CMD_WARNING; } @@ -2851,7 +2850,7 @@ DEFUN (show_ipv6_route_vrf_all_addr, ret = str2prefix_ipv6 (argv[idx_ipv6]->arg, &p); if (ret <= 0) { - vty_outln (vty, "Malformed IPv6 address"); + vty_out (vty, "Malformed IPv6 address\n"); return CMD_WARNING; } @@ -2893,7 +2892,7 @@ DEFUN (show_ipv6_route_vrf_all_prefix, ret = str2prefix_ipv6 (argv[idx_ipv6_prefixlen]->arg, &p); if (ret <= 0) { - vty_outln (vty, "Malformed IPv6 prefix"); + vty_out (vty, "Malformed IPv6 prefix\n"); return CMD_WARNING; } @@ -3038,7 +3037,7 @@ DEFUN (show_vrf, vty_out (vty, "inactive"); else vty_out (vty, "id %u table %u", zvrf_id (zvrf), zvrf->table_id); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } @@ -3083,14 +3082,14 @@ DEFUN (ip_zebra_import_table_distance, if (!is_zebra_valid_kernel_table(table_id)) { - vty_outln (vty, "Invalid routing table ID, %d. Must be in range 1-252", + vty_out (vty, "Invalid routing table ID, %d. Must be in range 1-252\n", table_id); return CMD_WARNING; } if (is_zebra_main_routing_table(table_id)) { - vty_outln (vty, "Invalid routing table ID, %d. Must be non-default table", + vty_out (vty, "Invalid routing table ID, %d. Must be non-default table\n", table_id); return CMD_WARNING; } @@ -3119,13 +3118,13 @@ DEFUN (no_ip_zebra_import_table, if (!is_zebra_valid_kernel_table(table_id)) { - vty_outln (vty,"Invalid routing table ID. Must be in range 1-252"); + vty_out (vty,"Invalid routing table ID. Must be in range 1-252\n"); return CMD_WARNING; } if (is_zebra_main_routing_table(table_id)) { - vty_outln (vty, "Invalid routing table ID, %d. Must be non-default table", + vty_out (vty, "Invalid routing table ID, %d. Must be non-default table\n", table_id); return CMD_WARNING; } @@ -3140,18 +3139,18 @@ static int config_write_protocol (struct vty *vty) { if (allow_delete) - vty_outln (vty, "allow-external-route-update"); + vty_out (vty, "allow-external-route-update\n"); if (zebra_rnh_ip_default_route) - vty_outln (vty, "ip nht resolve-via-default"); + vty_out (vty, "ip nht resolve-via-default\n"); if (zebra_rnh_ipv6_default_route) - vty_outln (vty, "ipv6 nht resolve-via-default"); + vty_out (vty, "ipv6 nht resolve-via-default\n"); enum multicast_mode ipv4_multicast_mode = multicast_mode_ipv4_get (); if (ipv4_multicast_mode != MCAST_NO_CONFIG) - vty_outln (vty, "ip multicast rpf-lookup-mode %s", + vty_out (vty, "ip multicast rpf-lookup-mode %s\n", ipv4_multicast_mode == MCAST_URIB_ONLY ? "urib-only" : ipv4_multicast_mode == MCAST_MRIB_ONLY ? "mrib-only" : ipv4_multicast_mode == MCAST_MIX_MRIB_FIRST ? "mrib-then-urib" : ipv4_multicast_mode == MCAST_MIX_DISTANCE ? "lower-distance" : "longer-prefix"); zebra_routemap_config_write_protocol(vty); diff --git a/zebra/zserv.c b/zebra/zserv.c index 17ec7dd88..e3c8ea0dd 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -2676,57 +2676,57 @@ zebra_show_client_detail (struct vty *vty, struct zserv *client) vty_out (vty, "Client: %s", zebra_route_string(client->proto)); if (client->instance) vty_out (vty, " Instance: %d", client->instance); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); - vty_outln (vty, "------------------------ "); - vty_outln (vty, "FD: %d ", client->sock); - vty_outln (vty, "Route Table ID: %d ", client->rtm_table); + vty_out (vty, "------------------------ \n"); + vty_out (vty, "FD: %d \n", client->sock); + vty_out (vty, "Route Table ID: %d \n", client->rtm_table); - vty_outln (vty, "Connect Time: %s ", + vty_out (vty, "Connect Time: %s \n", zserv_time_buf(&client->connect_time, cbuf, ZEBRA_TIME_BUF)); if (client->nh_reg_time) { - vty_outln (vty, "Nexthop Registry Time: %s ", + vty_out (vty, "Nexthop Registry Time: %s \n", zserv_time_buf(&client->nh_reg_time, nhbuf, ZEBRA_TIME_BUF)); if (client->nh_last_upd_time) - vty_outln (vty, "Nexthop Last Update Time: %s ", + vty_out (vty, "Nexthop Last Update Time: %s \n", zserv_time_buf(&client->nh_last_upd_time, mbuf, ZEBRA_TIME_BUF)); else - vty_outln (vty, "No Nexthop Update sent"); + vty_out (vty, "No Nexthop Update sent\n"); } else - vty_outln (vty, "Not registered for Nexthop Updates"); + vty_out (vty, "Not registered for Nexthop Updates\n"); - vty_outln (vty, "Last Msg Rx Time: %s ", + vty_out (vty, "Last Msg Rx Time: %s \n", zserv_time_buf(&client->last_read_time, rbuf, ZEBRA_TIME_BUF)); - vty_outln (vty, "Last Msg Tx Time: %s ", + vty_out (vty, "Last Msg Tx Time: %s \n", zserv_time_buf(&client->last_write_time, wbuf, ZEBRA_TIME_BUF)); if (client->last_read_time) - vty_outln (vty, "Last Rcvd Cmd: %s ", + vty_out (vty, "Last Rcvd Cmd: %s \n", zserv_command_string(client->last_read_cmd)); if (client->last_write_time) - vty_outln (vty, "Last Sent Cmd: %s ", + vty_out (vty, "Last Sent Cmd: %s \n", zserv_command_string(client->last_write_cmd)); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); - vty_outln (vty, "Type Add Update Del "); - vty_outln (vty, "================================================== "); - vty_outln (vty, "IPv4 %-12d%-12d%-12d", client->v4_route_add_cnt, + vty_out (vty, "Type Add Update Del \n"); + vty_out (vty, "================================================== \n"); + vty_out (vty, "IPv4 %-12d%-12d%-12d\n", client->v4_route_add_cnt, client->v4_route_upd8_cnt, client->v4_route_del_cnt); - vty_outln (vty, "IPv6 %-12d%-12d%-12d", client->v6_route_add_cnt, + vty_out (vty, "IPv6 %-12d%-12d%-12d\n", client->v6_route_add_cnt, client->v6_route_upd8_cnt, client->v6_route_del_cnt); - vty_outln (vty, "Redist:v4 %-12d%-12d%-12d", client->redist_v4_add_cnt, 0, + vty_out (vty, "Redist:v4 %-12d%-12d%-12d\n", client->redist_v4_add_cnt, 0, client->redist_v4_del_cnt); - vty_outln (vty, "Redist:v6 %-12d%-12d%-12d", client->redist_v6_add_cnt, 0, + vty_out (vty, "Redist:v6 %-12d%-12d%-12d\n", client->redist_v6_add_cnt, 0, client->redist_v6_del_cnt); - vty_outln (vty, "Connected %-12d%-12d%-12d", client->ifadd_cnt, 0, + vty_out (vty, "Connected %-12d%-12d%-12d\n", client->ifadd_cnt, 0, client->ifdel_cnt); - vty_outln (vty, "BFD peer %-12d%-12d%-12d", client->bfd_peer_add_cnt, + vty_out (vty, "BFD peer %-12d%-12d%-12d\n", client->bfd_peer_add_cnt, client->bfd_peer_upd8_cnt, client->bfd_peer_del_cnt); - vty_outln (vty, "Interface Up Notifications: %d",client->ifup_cnt); - vty_outln (vty, "Interface Down Notifications: %d",client->ifdown_cnt); + vty_out (vty, "Interface Up Notifications: %d\n",client->ifup_cnt); + vty_out (vty, "Interface Down Notifications: %d\n",client->ifdown_cnt); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return; } @@ -2736,7 +2736,7 @@ zebra_show_client_brief (struct vty *vty, struct zserv *client) char cbuf[ZEBRA_TIME_BUF], rbuf[ZEBRA_TIME_BUF]; char wbuf[ZEBRA_TIME_BUF]; - vty_outln (vty, "%-8s%12s %12s%12s%8d/%-8d%8d/%-8d", + vty_out (vty, "%-8s%12s %12s%12s%8d/%-8d%8d/%-8d\n", zebra_route_string(client->proto), zserv_time_buf(&client->connect_time, cbuf, ZEBRA_TIME_BUF), zserv_time_buf(&client->last_read_time, rbuf, ZEBRA_TIME_BUF), @@ -2771,7 +2771,7 @@ DEFUN (show_table, SHOW_STR "default routing table to use for all clients\n") { - vty_outln (vty, "table %d",zebrad.rtm_table_default); + vty_out (vty, "table %d\n",zebrad.rtm_table_default); return CMD_SUCCESS; } @@ -2811,7 +2811,7 @@ DEFUN (ip_forwarding, if (ret == 0) { - vty_outln (vty, "Can't turn on IP forwarding"); + vty_out (vty, "Can't turn on IP forwarding\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2833,7 +2833,7 @@ DEFUN (no_ip_forwarding, if (ret != 0) { - vty_outln (vty, "Can't turn off IP forwarding"); + vty_out (vty, "Can't turn off IP forwarding\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -2848,14 +2848,14 @@ DEFUN (show_zebra, { struct vrf *vrf; - vty_outln (vty, - " Route Route Neighbor LSP LSP"); - vty_outln (vty, - "VRF Installs Removals Updates Installs Removals"); + vty_out (vty, + " Route Route Neighbor LSP LSP\n"); + vty_out (vty, + "VRF Installs Removals Updates Installs Removals\n"); RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) { struct zebra_vrf *zvrf = vrf->info; - vty_outln (vty,"%-25s %10" PRIu64 " %10" PRIu64 " %10" PRIu64 " %10" PRIu64 " %10" PRIu64 "", + vty_out (vty,"%-25s %10" PRIu64 " %10" PRIu64 " %10" PRIu64 " %10" PRIu64 " %10" PRIu64 "\n", vrf->name, zvrf->installs, zvrf->removals, zvrf->neigh_updates, zvrf->lsp_installs,zvrf->lsp_removals); } @@ -2892,15 +2892,15 @@ DEFUN (show_zebra_client_summary, struct listnode *node; struct zserv *client; - vty_outln (vty, - "Name Connect Time Last Read Last Write IPv4 Routes IPv6 Routes "); - vty_outln (vty, - "--------------------------------------------------------------------------------"); + vty_out (vty, + "Name Connect Time Last Read Last Write IPv4 Routes IPv6 Routes \n"); + vty_out (vty, + "--------------------------------------------------------------------------------\n"); for (ALL_LIST_ELEMENTS_RO (zebrad.client_list, node, client)) zebra_show_client_brief(vty, client); - vty_outln (vty, "Routes column shows (added+updated)/deleted"); + vty_out (vty, "Routes column shows (added+updated)/deleted\n"); return CMD_SUCCESS; } @@ -2909,7 +2909,7 @@ static int config_write_table (struct vty *vty) { if (zebrad.rtm_table_default) - vty_outln (vty, "table %d",zebrad.rtm_table_default); + vty_out (vty, "table %d\n",zebrad.rtm_table_default); return 0; } @@ -2934,9 +2934,9 @@ DEFUN (show_ip_forwarding, ret = ipforward (); if (ret == 0) - vty_outln (vty, "IP forwarding is off"); + vty_out (vty, "IP forwarding is off\n"); else - vty_outln (vty, "IP forwarding is on"); + vty_out (vty, "IP forwarding is on\n"); return CMD_SUCCESS; } @@ -2955,16 +2955,16 @@ DEFUN (show_ipv6_forwarding, switch (ret) { case -1: - vty_outln (vty, "ipv6 forwarding is unknown"); + vty_out (vty, "ipv6 forwarding is unknown\n"); break; case 0: - vty_outln (vty, "ipv6 forwarding is %s", "off"); + vty_out (vty, "ipv6 forwarding is %s\n", "off"); break; case 1: - vty_outln (vty, "ipv6 forwarding is %s", "on"); + vty_out (vty, "ipv6 forwarding is %s\n", "on"); break; default: - vty_outln (vty, "ipv6 forwarding is %s", "off"); + vty_out (vty, "ipv6 forwarding is %s\n", "off"); break; } return CMD_SUCCESS; @@ -2984,7 +2984,7 @@ DEFUN (ipv6_forwarding, if (ret == 0) { - vty_outln (vty, "Can't turn on IPv6 forwarding"); + vty_out (vty, "Can't turn on IPv6 forwarding\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3006,7 +3006,7 @@ DEFUN (no_ipv6_forwarding, if (ret != 0) { - vty_outln (vty, "Can't turn off IPv6 forwarding"); + vty_out (vty, "Can't turn off IPv6 forwarding\n"); return CMD_WARNING_CONFIG_FAILED; } @@ -3021,10 +3021,10 @@ config_write_forwarding (struct vty *vty) router_id_write (vty); if (!ipforward ()) - vty_outln (vty, "no ip forwarding"); + vty_out (vty, "no ip forwarding\n"); if (!ipforward_ipv6 ()) - vty_outln (vty, "no ipv6 forwarding"); - vty_outln (vty, "!"); + vty_out (vty, "no ipv6 forwarding\n"); + vty_out (vty, "!\n"); return 0; } |