diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2017-07-13 17:49:13 +0200 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2017-07-13 20:29:22 +0200 |
commit | 5c7571d43f57317b0827ac82fbebc4cdc6865be0 (patch) | |
tree | 2bc63ccbd805abc9689e9f3345e34871558d5c26 /babeld | |
parent | lib: move \n vs. \r\n handling into vty code (diff) | |
download | frr-5c7571d43f57317b0827ac82fbebc4cdc6865be0.tar.xz frr-5c7571d43f57317b0827ac82fbebc4cdc6865be0.zip |
*: ditch vty_outln(), part 1 of 2
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'babeld')
-rw-r--r-- | babeld/babel_interface.c | 74 | ||||
-rw-r--r-- | babeld/babel_zebra.c | 20 | ||||
-rw-r--r-- | babeld/babeld.c | 12 |
3 files changed, 53 insertions, 53 deletions
diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c index fe8fde92e..5d60f4193 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; } @@ -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; } @@ -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_out (vty, " Babel protocol is running on this interface\n"); vty_outln (vty, " Operating mode is \"%s\"", 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); @@ -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) { @@ -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_zebra.c b/babeld/babel_zebra.c index 3a7a52ccc..a41908285 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; } @@ -243,7 +243,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; } @@ -277,7 +277,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; } @@ -307,7 +307,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; } @@ -324,7 +324,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 @@ -335,12 +335,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; @@ -384,13 +384,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++; } |