From 817302b875f68005b3dddd5639dfa7a1f0c20192 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Thu, 13 Jul 2017 17:36:03 +0200 Subject: [PATCH 01/14] *: COMMUNITY.md: compatibility foo & deprecation Signed-off-by: David Lamparter --- COMMUNITY.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/COMMUNITY.md b/COMMUNITY.md index b0d087c382..8ab6a624ee 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. From 8867927f0ea63a0a76ac75592da554da995ed9de Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Wed, 12 Jul 2017 16:23:40 +0200 Subject: [PATCH 02/14] lib: vty: warn when using compatibility macros Signed-off-by: David Lamparter --- lib/vty.h | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/lib/vty.h b/lib/vty.h index b4a55180d3..5cd28c0c42 100644 --- a/lib/vty.h +++ b/lib/vty.h @@ -183,13 +183,35 @@ struct vty_arg #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 VTY_NEWLINE VTYNL \ + CPP_WARN("VTY_NEWLINE has been replaced with VTYNL and/or vty_outln().") +#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.") /* Default time out value */ #define VTY_TIMEOUT_DEFAULT 600 From 83eba583d7be5afaf2eba35ce4d391f645af4bfa Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Thu, 13 Jul 2017 17:34:08 +0200 Subject: [PATCH 03/14] lib: move \n vs. \r\n handling into vty code Instead of having an ?: expression embedded in every single caller of vty_out, just expand \n to \r\n in the vty code if neccessary. (Deprecation warnings will be enabled in the next commits which will do the search-and-replace over the codebase.) [This reverts commit 4d5f445 "lib: add vty_outln()"] Signed-off-by: David Lamparter --- lib/buffer.c | 44 ++++++++++++++++++++++++++++++++++++++ lib/buffer.h | 2 ++ lib/vty.c | 56 +++++++++++++++++-------------------------------- lib/vty.h | 15 +++++++------ ospf6d/ospf6d.h | 1 - 5 files changed, 74 insertions(+), 44 deletions(-) diff --git a/lib/buffer.c b/lib/buffer.c index 649677fc93..5d458901ee 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 67ac71cad8..059f2cf338 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/vty.c b/lib/vty.c index e6497b3100..53328248f8 100644 --- a/lib/vty.c +++ b/lib/vty.c @@ -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, diff --git a/lib/vty.h b/lib/vty.h index 5cd28c0c42..ef537b753d 100644 --- a/lib/vty.h +++ b/lib/vty.h @@ -179,9 +179,6 @@ 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 */ #if defined(__ICC) #define CPP_WARN_STR(X) #X @@ -198,8 +195,12 @@ struct vty_arg #define CPP_WARN(text) #endif -#define VTY_NEWLINE VTYNL \ - CPP_WARN("VTY_NEWLINE has been replaced with VTYNL and/or vty_outln().") +#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);} \ @@ -212,6 +213,9 @@ struct vty_arg 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 @@ -239,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/ospf6d/ospf6d.h b/ospf6d/ospf6d.h index 41082e451b..347ad34871 100644 --- a/ospf6d/ospf6d.h +++ b/ospf6d/ospf6d.h @@ -90,7 +90,6 @@ 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) \ { \ From 5c7571d43f57317b0827ac82fbebc4cdc6865be0 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Thu, 13 Jul 2017 17:49:13 +0200 Subject: [PATCH 04/14] *: ditch vty_outln(), part 1 of 2 Signed-off-by: David Lamparter --- babeld/babel_interface.c | 74 ++-- babeld/babel_zebra.c | 20 +- babeld/babeld.c | 12 +- bgpd/bgp_aspath.c | 2 +- bgpd/bgp_attr.c | 2 +- bgpd/bgp_bfd.c | 6 +- bgpd/bgp_damp.c | 20 +- bgpd/bgp_debug.c | 154 ++++---- bgpd/bgp_dump.c | 14 +- bgpd/bgp_evpn_vty.c | 72 ++-- bgpd/bgp_filter.c | 26 +- bgpd/bgp_mplsvpn.c | 64 +-- bgpd/bgp_nexthop.c | 24 +- bgpd/bgp_route.c | 258 ++++++------ bgpd/bgp_routemap.c | 18 +- bgpd/bgp_updgrp.c | 58 +-- bgpd/bgp_updgrp_adv.c | 2 +- bgpd/bgp_updgrp_packet.c | 4 +- bgpd/bgp_vpn.c | 12 +- bgpd/bgp_vty.c | 2 +- bgpd/bgpd.c | 130 +++--- bgpd/rfapi/bgp_rfapi_cfg.c | 370 +++++++++--------- bgpd/rfapi/rfapi.c | 54 +-- bgpd/rfapi/rfapi_vty.c | 92 ++--- bgpd/rfapi/vnc_debug.c | 16 +- eigrpd/eigrp_dump.c | 42 +- eigrpd/eigrp_neighbor.c | 2 +- eigrpd/eigrp_routemap.c | 18 +- eigrpd/eigrp_update.c | 2 +- eigrpd/eigrp_vty.c | 120 +++--- isisd/isis_adjacency.c | 16 +- isisd/isis_circuit.c | 72 ++-- isisd/isis_dynhn.c | 6 +- isisd/isis_lsp.c | 24 +- isisd/isis_mt.c | 4 +- isisd/isis_redist.c | 10 +- isisd/isis_spf.c | 8 +- isisd/isis_te.c | 72 ++-- isisd/isis_vty.c | 82 ++-- isisd/isisd.c | 200 +++++----- ldpd/ldp_debug.c | 34 +- ldpd/ldp_vty_conf.c | 126 +++--- ldpd/ldp_vty_exec.c | 114 +++--- lib/agentx.c | 6 +- lib/bfd.c | 4 +- lib/command.c | 100 ++--- lib/distribute.c | 14 +- lib/filter.c | 38 +- lib/grammar_sandbox.c | 42 +- lib/hash.c | 10 +- lib/if.c | 2 +- lib/if_rmap.c | 10 +- lib/keychain.c | 22 +- lib/memory_vty.c | 36 +- lib/ns.c | 8 +- lib/plist.c | 58 +-- lib/routemap.c | 78 ++-- lib/skiplist.c | 4 +- lib/smux.c | 2 +- lib/spf_backoff.c | 26 +- lib/thread.c | 20 +- lib/vrf.c | 2 +- lib/vty.c | 70 ++-- lib/workqueue.c | 10 +- nhrpd/nhrp_vty.c | 72 ++-- ospf6d/ospf6_area.c | 10 +- ospf6d/ospf6_bfd.c | 4 +- ospf6d/ospf6_interface.c | 2 +- ospf6d/ospf6_spf.c | 2 +- ospf6d/ospf6_top.c | 18 +- ospf6d/ospf6_zebra.c | 6 +- ospfd/ospf_apiserver.c | 2 +- ospfd/ospf_bfd.c | 4 +- ospfd/ospf_dump.c | 90 ++--- ospfd/ospf_opaque.c | 8 +- ospfd/ospf_ri.c | 64 +-- ospfd/ospf_te.c | 92 ++--- ospfd/ospf_vty.c | 38 +- ospfd/ospf_zebra.c | 6 +- pimd/pim_bfd.c | 4 +- pimd/pim_cmd.c | 718 +++++++++++++++++----------------- pimd/pim_msdp.c | 4 +- pimd/pim_rp.c | 14 +- pimd/pim_static.c | 4 +- pimd/pim_vty.c | 86 ++-- pimd/pim_zebra.c | 4 +- pimd/pim_zlookup.c | 4 +- python/clidef.py | 2 +- ripd/rip_debug.c | 22 +- ripd/rip_interface.c | 52 +-- ripd/rip_offset.c | 18 +- ripd/rip_peer.c | 2 +- ripd/rip_zebra.c | 30 +- ripd/ripd.c | 78 ++-- ripngd/ripng_debug.c | 22 +- ripngd/ripng_interface.c | 22 +- ripngd/ripng_offset.c | 18 +- ripngd/ripng_peer.c | 2 +- ripngd/ripng_zebra.c | 24 +- ripngd/ripngd.c | 54 +-- tests/lib/cli/common_cli.c | 4 +- tests/lib/cli/test_cli.c | 8 +- tests/lib/test_heavy.c | 2 +- tests/lib/test_heavy_thread.c | 2 +- tests/lib/test_heavy_wq.c | 2 +- vtysh/vtysh.c | 10 +- watchfrr/watchfrr_vty.c | 4 +- zebra/interface.c | 232 +++++------ zebra/irdp_interface.c | 16 +- zebra/router-id.c | 4 +- zebra/rtadv.c | 54 +-- zebra/zebra_fpm.c | 12 +- zebra/zebra_mpls.c | 24 +- zebra/zebra_mpls_vty.c | 44 +-- zebra/zebra_ptm.c | 8 +- zebra/zebra_routemap.c | 82 ++-- zebra/zebra_vrf.c | 4 +- zebra/zebra_vty.c | 140 +++---- zebra/zserv.c | 94 ++--- 119 files changed, 2684 insertions(+), 2684 deletions(-) diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c index fe8fde92e6..5d60f41939 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 3a7a52ccca..a41908285b 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 e17e00ca56..b2f8176aab 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 f304b3a1b7..95257493b5 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 439469d61e..0114834c57 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 890acb3a47..546fbdeb9b 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 d5a89c1ff5..80cd770451 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, @@ -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); } 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 5538402070..23f49f2c70 100644 --- a/bgpd/bgp_debug.c +++ b/bgpd/bgp_debug.c @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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,7 +1746,7 @@ 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, " BGP allow martian next hop debugging is on\n"); vty_out (vty, VTYNL); 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 eca29a3518..c35da4db76 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; } @@ -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 d22a07ed31..7a8ef12c77 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; } @@ -140,13 +140,13 @@ bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd, SHOW_DISPLAY_OVERLAY) vty_outln(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", + 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%s\n", VTYNL); vty_outln(vty, V4_HEADER); } @@ -253,10 +253,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", + vty_out (vty, "%sDisplayed %ld out of %ld total prefixes\n", VTYNL, output_count, total_count); return CMD_SUCCESS; } @@ -289,7 +289,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 +330,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 +365,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 +381,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 +426,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 +441,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 +457,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 +498,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 +513,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 +557,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 +572,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 +588,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 +635,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 b2f0c3ee25..9b11cd58b2 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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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 b5fbfd8bb6..3efbeb8b49 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; } @@ -637,11 +637,11 @@ bgp_show_mpls_vpn (struct vty *vty, afi_t afi, struct prefix_rd *prd, vty_outln (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", + 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%s\n", VTYNL); vty_outln (vty, V4_HEADER); } @@ -740,16 +740,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", + vty_out (vty, "%sDisplayed %ld routes and %ld total paths\n", VTYNL, output_count, total_count); } @@ -781,7 +781,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 +816,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 +881,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 +920,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 +936,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 +983,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 +999,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 +1016,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 +1060,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 +1075,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 +1121,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 +1137,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 +1153,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_nexthop.c b/bgpd/bgp_nexthop.c index d0c4d2c945..3b7f2e2fc7 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,40 +407,40 @@ 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)); @@ -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,7 +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:", + vty_out (vty, "%sInstance %s:\n", VTYNL, (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT) ? "Default" : bgp->name); bgp_show_nexthops (vty, bgp, 0); diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 12ad65883e..156c0aa359 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; } 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; } @@ -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; } @@ -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; } 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; } @@ -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; } @@ -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; } 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; } ret = str2prefix_rd (rd_str, &prd); if (! ret) { - vty_outln (vty, "%% Malformed rd"); + vty_out (vty, "%% Malformed rd\n"); return CMD_WARNING; } @@ -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; } if( routermac && prefix_str2mac (routermac, NULL) == 0) { - vty_outln (vty, "%% Malformed Router MAC"); + vty_out (vty, "%% Malformed Router MAC\n"); return CMD_WARNING; } 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; } 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; } } @@ -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; } 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; } ret = str2prefix_rd (rd_str, &prd); if (! ret) { - vty_outln (vty, "%% Malformed rd"); + vty_out (vty, "%% Malformed rd\n"); return CMD_WARNING; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } 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; } @@ -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; } 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; } @@ -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; } @@ -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; } @@ -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) @@ -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)"); @@ -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 */ @@ -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); } } @@ -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,11 +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", + vty_out (vty, "%sDisplayed %ld routes and %ld total paths\n", VTYNL, output_count, total_count); } @@ -8064,7 +8064,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; } /* use MPLS and ENCAP specific shows until they are merged */ @@ -8089,14 +8089,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; @@ -8105,7 +8105,7 @@ bgp_show_all_instances_routes_vty (struct vty *vty, afi_t afi, safi_t safi, } else { - vty_outln (vty, "%sInstance %s:", + vty_out (vty, "%sInstance %s:\n", VTYNL, (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT) ? "Default" : bgp->name); } @@ -8114,7 +8114,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 */ @@ -8161,7 +8161,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)) ? ":" : "", @@ -8169,9 +8169,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) @@ -8217,7 +8217,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 @@ -8277,7 +8277,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; } @@ -8364,7 +8364,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); } @@ -8372,7 +8372,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; } } @@ -8428,7 +8428,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; } @@ -8444,7 +8444,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; } @@ -8486,7 +8486,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; } @@ -8527,7 +8527,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; } @@ -8696,8 +8696,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; } @@ -8709,14 +8709,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; } @@ -8801,7 +8801,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; } @@ -8820,7 +8820,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; } @@ -8838,7 +8838,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; } @@ -8856,7 +8856,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; } @@ -8898,7 +8898,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; } @@ -8920,7 +8920,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; } @@ -8942,7 +8942,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; } @@ -8975,11 +8975,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; } } @@ -8995,11 +8995,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; } @@ -9177,7 +9177,7 @@ 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; } @@ -9186,7 +9186,7 @@ bgp_table_stats (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi) ts.table = bgp->rib[afi][safi]; thread_execute (bm->master, bgp_table_stats_walker, &ts, 0); - vty_outln (vty, "BGP %s RIB statistics%s", + vty_out (vty, "BGP %s RIB statistics%s\n", afi_safi_print (afi, safi), VTYNL); for (i = 0; i < BGP_STATS_MAX; i++) @@ -9224,14 +9224,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; @@ -9369,11 +9369,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; } @@ -9404,7 +9404,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 @@ -9412,28 +9412,28 @@ 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", + vty_out (vty, "PfxCt: %ld\n", peer->pcount[afi][safi]); + vty_out (vty, "%sCounts from RIB table walk:%s\n", VTYNL, VTYNL); 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"); } } @@ -9522,7 +9522,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; } @@ -9532,7 +9532,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; } @@ -9562,7 +9562,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)); @@ -9619,11 +9619,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; } @@ -9649,7 +9649,7 @@ show_adj_route (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, vty_outln (vty, BGP_SHOW_SCODE_HEADER, VTYNL); vty_outln (vty, BGP_SHOW_OCODE_HEADER, VTYNL); - vty_outln (vty, "Originating default network 0.0.0.0%s", + vty_out (vty, "Originating default network 0.0.0.0%s\n", VTYNL); } header1 = 0; @@ -9675,7 +9675,7 @@ 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); @@ -9757,12 +9757,12 @@ 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", + vty_out (vty, "%sTotal number of prefixes %ld\n", VTYNL, 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); } @@ -9782,11 +9782,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; } @@ -9796,11 +9796,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; } @@ -9914,9 +9914,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; } } @@ -9926,9 +9926,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; } } @@ -9938,15 +9938,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; @@ -9963,11 +9963,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; } @@ -10016,7 +10016,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; } @@ -10063,7 +10063,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)); @@ -10099,7 +10099,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; } @@ -10151,14 +10151,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; } 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; } @@ -10167,7 +10167,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; } @@ -10437,7 +10437,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; } @@ -10481,7 +10481,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; } } @@ -10490,7 +10490,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; } } @@ -10499,7 +10499,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; } @@ -10620,7 +10620,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; } @@ -10850,7 +10850,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]); } @@ -10862,7 +10862,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_routemap.c b/bgpd/bgp_routemap.c index f2c94371a4..7f535388bb 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; case RMAP_COMPILE_ERROR: - vty_outln (vty, "%% BGP Argument is malformed."); + vty_out (vty, "%% BGP Argument is malformed.\n"); return CMD_WARNING; } } @@ -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) @@ -3886,7 +3886,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; } @@ -4210,7 +4210,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; } @@ -4251,7 +4251,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; } @@ -4362,7 +4362,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; } if (IN6_IS_ADDR_UNSPECIFIED(&addr) || @@ -4370,7 +4370,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; } diff --git a/bgpd/bgp_updgrp.c b/bgpd/bgp_updgrp.c index 722eed91c0..78e5b86be5 100644 --- a/bgpd/bgp_updgrp.c +++ b/bgpd/bgp_updgrp.c @@ -568,13 +568,13 @@ update_group_show_walkcb (struct update_group *updgrp, void *arg) 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" : "", @@ -596,37 +596,37 @@ update_group_show_walkcb (struct update_group *updgrp, void *arg) 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, " 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; @@ -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 c4cb8ae1b3..02de6a1c1c 100644 --- a/bgpd/bgp_updgrp_adv.c +++ b/bgpd/bgp_updgrp_adv.c @@ -250,7 +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", + vty_out (vty, "%sTotal number of prefixes %ld\n", VTYNL, output_count); } diff --git a/bgpd/bgp_updgrp_packet.c b/bgpd/bgp_updgrp_packet.c index dff46a9466..69debf7a41 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 3e62243957..a2665b67b9 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,11 +104,11 @@ 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", + 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%s\n", VTYNL); vty_outln (vty, V4_HEADER); } @@ -191,7 +191,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 83135fb5dc..4aa9922bab 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -1012,7 +1012,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; } } diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index d7ddd5db8a..ca948b2f17 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -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); } } } @@ -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); @@ -7420,62 +7420,62 @@ bgp_config_write (struct vty *vty) /* 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) @@ -7492,12 +7492,12 @@ bgp_config_write (struct vty *vty) /* 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. */ @@ -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)) { @@ -7576,7 +7576,7 @@ bgp_config_write (struct vty *vty) /* 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 14cce2d606..ef8ae1a094 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; } @@ -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; @@ -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; } 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; } @@ -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; } } @@ -496,8 +496,8 @@ DEFUN (vnc_defaults_l2rd, } 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; } @@ -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; } 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; } 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; } @@ -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; } @@ -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; } @@ -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; } 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; } @@ -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; } 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; } @@ -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; } 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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } 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; 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; } } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -2734,7 +2734,7 @@ 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; } @@ -2747,7 +2747,7 @@ DEFUN (vnc_nve_group_prefix, afi = family2afi (p.family); if (!afi) { - vty_outln (vty, "Unsupported address family"); + vty_out (vty, "Unsupported address family\n"); return CMD_WARNING; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -3059,8 +3059,8 @@ DEFUN (vnc_nve_group_l2rd, } 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; } @@ -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; } @@ -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; } @@ -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; } 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; } @@ -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; } } @@ -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; } @@ -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; } 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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } 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; } @@ -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; } } @@ -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; } 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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } 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; } @@ -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; } @@ -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; } @@ -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 @@ -4300,7 +4300,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp) } 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) { @@ -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); } } } @@ -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); } } } @@ -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,26 +5010,26 @@ 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); return; diff --git a/bgpd/rfapi/rfapi.c b/bgpd/rfapi/rfapi.c index ffd4e3e323..f9156863bf 100644 --- a/bgpd/rfapi/rfapi.c +++ b/bgpd/rfapi/rfapi.c @@ -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; } 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; } 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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; #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; } @@ -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; } @@ -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; } h = bgp->rfapi; if (!h) { - vty_outln (vty, "No RFAPI instance"); + vty_out (vty, "No RFAPI instance\n"); return CMD_WARNING; } @@ -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,7 +3837,7 @@ DEFUN (debug_rfapi_show_import, lni = lni_as_ptr; if (first_l2) { - vty_outln (vty, "%sLNI-based Ethernet Tables:", + vty_out (vty, "%sLNI-based Ethernet Tables:\n", VTYNL); first_l2 = 0; } @@ -3889,7 +3889,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; } @@ -3920,12 +3920,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; } if (!bgp->rfapi_cfg) { - vty_outln (vty, "VNC not configured"); + vty_out (vty, "VNC not configured\n"); return CMD_WARNING; } @@ -4191,7 +4191,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 +4216,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_vty.c b/bgpd/rfapi/rfapi_vty.c index d12958a600..dfbffadf36 100644 --- a/bgpd/rfapi/rfapi_vty.c +++ b/bgpd/rfapi/rfapi_vty.c @@ -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; } @@ -2221,7 +2221,7 @@ register_add ( if (!bgp) { if (vty) - vty_outln (vty, "BGP not configured"); + vty_out (vty, "BGP not configured\n"); return CMD_WARNING; } @@ -2230,7 +2230,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; } @@ -2240,12 +2240,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; } 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; } ++argv, --argc; @@ -2255,12 +2255,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; } if (argc <= 1) { - vty_outln (vty,"Missing parameter for local-cost"); + vty_out (vty,"Missing parameter for local-cost\n"); return CMD_WARNING; } ++argv, --argc; @@ -2288,7 +2288,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; } @@ -2316,7 +2316,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 +2337,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 +2351,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 +2360,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 +2373,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 +2401,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; } @@ -2420,7 +2420,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 +2472,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; goto fail; @@ -2480,7 +2480,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; } @@ -2517,9 +2517,9 @@ 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, "Registration failed.\n"); + vty_out (vty, + "Confirm that either the VN or UN address matches a configured NVE group.\n"); return CMD_WARNING; fail: @@ -3138,7 +3138,7 @@ parse_deleter_args ( { if (!arg_vni) { - vty_outln (vty, "Missing VNI"); + vty_out (vty, "Missing VNI\n"); return rc; } if (strcmp (arg_l2addr, "*")) @@ -3705,12 +3705,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 +3718,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 +4395,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 */ } @@ -4507,7 +4507,7 @@ rfapi_vty_show_nve_summary (struct vty *vty, show_nve_summary_t show_type) return 0; notcfg: - vty_outln (vty, "VNC is not configured."); + vty_out (vty, "VNC is not configured.\n"); return CMD_WARNING; } @@ -4576,7 +4576,7 @@ rfapi_show_nves ( /* print out a header */ vty_outln (vty, " " "Active Next Hops"); - vty_outln (vty, "%-15s %-15s %-5s %-5s %-6s %-6s %s", + vty_out (vty, "%-15s %-15s %-5s %-5s %-6s %-6s %s\n", "VN Address", "UN Address", "Regis", "Resps", "Reach", "Remove", "Age"); @@ -4584,7 +4584,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 +4595,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; } @@ -4734,7 +4734,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 +4774,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 +4831,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 +4874,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 +4923,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 +4976,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 +5006,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; } if (!bgp->rfapi || !bgp->rfapi_cfg) { - vty_outln (vty, "VRF support not configured"); + vty_out (vty, "VRF support not configured\n"); return CMD_WARNING; } @@ -5150,7 +5150,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; } @@ -5260,12 +5260,12 @@ 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); @@ -5284,7 +5284,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 e43b152e50..58b762a637 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; } @@ -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; } @@ -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,13 +163,13 @@ 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); } } @@ -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/eigrpd/eigrp_dump.c b/eigrpd/eigrp_dump.c index a32ccb58b0..b57e7f1bcf 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,7 +210,7 @@ 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", + vty_out (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\n", VTYNL, "EIGRP interfaces for AS(",eigrp->AS,")",VTYNL,VTYNL, "Interface", "Bandwidth", "Delay", "Peers", "Xmit Queue", "Mean", @@ -229,7 +229,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,26 +238,26 @@ 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",""); - 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",""); + 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 ", + vty_out (vty, "%s%s%d%s%s%s%-3s %-17s %-20s %-6s %-8s %-6s %-5s %-5s %-5s%s %-41s %-6s %-8s %-6s %-4s %-6s %-5s \n", VTYNL, "EIGRP neighbors for AS(",eigrp->AS,")",VTYNL,VTYNL, "H", "Address", "Interface", "Hold", "Uptime", @@ -275,7 +275,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 +285,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,7 +298,7 @@ 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", + vty_out (vty, "%sEIGRP Topology Table for AS(%d)/ID(%s)%s\n", 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", @@ -334,11 +334,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 +355,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 +369,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 c0bb2afaf5..bf3fc216c0 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 01fc970732..6714569140 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; case RMAP_COMPILE_ERROR: - vty_outln (vty, "%% Argument is malformed."); + vty_out (vty, "%% Argument is malformed.\n"); return CMD_WARNING; } } @@ -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; case RMAP_COMPILE_ERROR: - vty_outln (vty, "%% Argument is malformed."); + vty_out (vty, "%% Argument is malformed.\n"); return CMD_WARNING; } } @@ -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; 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; } } @@ -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; case RMAP_COMPILE_ERROR: - vty_outln (vty, "%% Argument is malformed."); + vty_out (vty, "%% Argument is malformed.\n"); return CMD_WARNING; } } @@ -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; } diff --git a/eigrpd/eigrp_update.c b/eigrpd/eigrp_update.c index 24fd7074fa..93b2ceb9df 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 e283c73653..5fceb85146 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; } @@ -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; } @@ -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; } @@ -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 efe5e6721b..513a3871ca 100644 --- a/isisd/isis_adjacency.c +++ b/isisd/isis_adjacency.c @@ -430,9 +430,9 @@ isis_adj_print_vty (struct isis_adjacency *adj, struct vty *vty, char detail) vty_out (vty, VTYNL); 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)) @@ -460,24 +460,24 @@ isis_adj_print_vty (struct isis_adjacency *adj, struct vty *vty, char detail) 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); diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c index 73affa91dc..fae8cb0d87 100644 --- a/isisd/isis_circuit.c +++ b/isisd/isis_circuit.c @@ -902,7 +902,7 @@ isis_circuit_print_vty (struct isis_circuit *circuit, struct vty *vty, vty_out (vty, VTYNL); 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,7 +910,7 @@ 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", @@ -922,7 +922,7 @@ isis_circuit_print_vty (struct isis_circuit *circuit, struct vty *vty, 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")); } @@ -933,7 +933,7 @@ isis_circuit_print_vty (struct isis_circuit *circuit, struct vty *vty, } 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,7 +941,7 @@ 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", @@ -953,7 +953,7 @@ isis_circuit_print_vty (struct isis_circuit *circuit, struct vty *vty, 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")); } @@ -964,29 +964,29 @@ isis_circuit_print_vty (struct isis_circuit *circuit, struct vty *vty, } 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); } } @@ -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 e124bb4675..35d573d30a 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 d0c4ccc306..2434229aca 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)); } @@ -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 */ diff --git a/isisd/isis_mt.c b/isisd/isis_mt.c index 9c3bc1fe6a..26e02498ba 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 25fdf717b0..f4af3aef21 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; } @@ -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; } @@ -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); diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c index f19c813360..ac6ba59a7a 100644 --- a/isisd/isis_spf.c +++ b/isisd/isis_spf.c @@ -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,7 +1406,7 @@ 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); @@ -1414,8 +1414,8 @@ DEFUN (show_isis_topology, 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); diff --git a/isisd/isis_te.c b/isisd/isis_te.c index c4a0b9230b..613fe8e4f0 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 */ @@ -977,7 +977,7 @@ show_vty_unknown_tlv (struct vty *vty, struct subtlv_header *tlvh) vty_out (vty, VTYNL); } 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; } @@ -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, "---------------%s\n", VTYNL); } 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 f0e2831bff..bccf8d428f 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; } } @@ -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; } @@ -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; } @@ -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; } @@ -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 cf3b325131..c089450cc5 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; } @@ -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,7 +586,7 @@ 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, @@ -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); 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,12 +1398,12 @@ 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]); @@ -1411,28 +1411,28 @@ DEFUN (show_isis_summary, vty_out (vty, " (not used, IETF SPF delay activated)"); vty_out (vty, VTYNL); - 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_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_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); } } @@ -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,7 +1539,7 @@ 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 */ @@ -1560,7 +1560,7 @@ show_isis_database (struct vty *vty, const char *argv, int ui_level) ui_level, area->dynhostname); - vty_outln (vty, " %u LSPs%s", + vty_out (vty, " %u LSPs%s\n", lsp_count, VTYNL); } } @@ -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]), @@ -2224,7 +2224,7 @@ isis_config_write (struct vty *vty) 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 466b6af8b2..c5f444ecd3 100644 --- a/ldpd/ldp_debug.c +++ b/ldpd/ldp_debug.c @@ -105,28 +105,28 @@ 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)"); 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)"); 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, " LDP zebra debugging is on\n"); vty_out (vty, VTYNL); 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 900be046ea..0f86e24a37 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) { @@ -160,15 +160,15 @@ ldp_af_config_write(struct vty *vty, int af, struct ldpd_conf *conf, 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, @@ -218,22 +218,22 @@ ldp_af_config_write(struct vty *vty, int af, struct ldpd_conf *conf, } 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,40 +244,40 @@ 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) { @@ -291,14 +291,14 @@ ldp_config_write(struct vty *vty) } 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"); 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); } @@ -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); } @@ -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); } 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); } 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); } @@ -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); } @@ -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); } 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); } @@ -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); } @@ -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); } @@ -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); } diff --git a/ldpd/ldp_vty_exec.c b/ldpd/ldp_vty_exec.c index c956067023..45c5fedb2e 100644 --- a/ldpd/ldp_vty_exec.c +++ b/ldpd/ldp_vty_exec.c @@ -128,7 +128,7 @@ 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, @@ -214,7 +214,7 @@ show_discovery_msg(struct vty *vty, struct imsg *imsg, vty_out(vty, "%s%46s", VTYNL, " "); break; } - vty_outln (vty, "%9u", adj->holdtime); + vty_out (vty, "%9u\n", adj->holdtime); break; case IMSG_CTL_END: vty_out (vty, VTYNL); @@ -313,18 +313,18 @@ 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); return (1); @@ -512,7 +512,7 @@ show_nbr_msg(struct vty *vty, struct imsg *imsg, struct show_params *params) nbr_state_name(nbr->nbr_state), addr); if (strlen(addr) > 15) vty_out(vty, "%s%48s", VTYNL, " "); - vty_outln (vty, " %8s", log_time(nbr->uptime)); + vty_out (vty, " %8s\n", log_time(nbr->uptime)); break; case IMSG_CTL_END: return (1); @@ -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, 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,13 +611,13 @@ 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); @@ -874,13 +874,13 @@ show_nbr_capabilities(struct vty *vty, struct ctl_nbr *nbr) " - Typed Wildcard (0x050B)%s" " - Unrecognized Notification (0x0603)", VTYNL, VTYNL, VTYNL); - vty_outln (vty, " Capabilities Received:"); + 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,7 +895,7 @@ 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); @@ -1022,7 +1022,7 @@ 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, " %-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; @@ -1069,8 +1069,8 @@ 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: @@ -1089,14 +1089,14 @@ show_lib_detail_msg(struct vty *vty, struct imsg *imsg, struct show_params *para 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); @@ -1235,30 +1235,30 @@ 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, 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, 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); @@ -1340,7 +1340,7 @@ 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; @@ -1540,7 +1540,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 +1584,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 +1612,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 +1643,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,7 +1688,7 @@ 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); @@ -1722,7 +1722,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 +1759,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 +1780,7 @@ ldp_vty_clear_nbr(struct vty *vty, const char *addr_str) if (addr_str && (ldp_get_address(addr_str, &nbr.af, &nbr.raddr) == -1 || bad_addr(nbr.af, &nbr.raddr))) { - vty_outln (vty, "%% Malformed address"); + vty_out (vty, "%% Malformed address\n"); return (CMD_WARNING); } diff --git a/lib/agentx.c b/lib/agentx.c index d058779aff..a2e737fed0 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; } diff --git a/lib/bfd.c b/lib/bfd.c index e6f881c992..34b6aa83c6 100644 --- a/lib/bfd.c +++ b/lib/bfd.c @@ -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"); } diff --git a/lib/command.c b/lib/command.c index 5ca4a0fda9..fb560cb614 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]); } @@ -476,9 +476,9 @@ config_write_host (struct vty *vty) } 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) @@ -491,29 +491,29 @@ config_write_host (struct vty *vty) } 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; } @@ -1149,7 +1149,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; } return CMD_SUCCESS; @@ -1346,10 +1346,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:%s %s\n", VTYNL, FRR_CONFIG_ARGS); return CMD_SUCCESS; @@ -1373,7 +1373,7 @@ DEFUN (config_help, "help", "Description of the interactive help system\n") { - vty_outln (vty, + vty_out (vty, "Quagga VTY provides advanced help feature. When you need help,%s\ anytime at the command line please press '?'.%s\ %s\ @@ -1385,7 +1385,7 @@ 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, + (e.g. 'show me?'.)%s\n", VTYNL, VTYNL, VTYNL, VTYNL, VTYNL, VTYNL, VTYNL, VTYNL, VTYNL, VTYNL, VTYNL, VTYNL); return CMD_SUCCESS; @@ -1455,7 +1455,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; } @@ -1488,25 +1488,25 @@ vty_write_config (struct vty *vty) if (vty->type == VTY_TERM) { - vty_outln (vty, "%sCurrent configuration:",VTYNL); - vty_outln (vty, "!"); + vty_out (vty, "%sCurrent configuration:\n",VTYNL); + 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"); } } @@ -1543,7 +1543,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; } @@ -1578,12 +1578,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; } @@ -1605,13 +1605,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; } @@ -1620,13 +1620,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: @@ -1681,7 +1681,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; } @@ -1694,7 +1694,7 @@ DEFUN (show_startup_config, cp++; *cp = '\0'; - vty_outln (vty, "%s", buf); + vty_out (vty, "%s\n", buf); } fclose (confp); @@ -1721,7 +1721,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; } @@ -1761,8 +1761,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; } @@ -1811,15 +1811,15 @@ DEFUN (config_enable_password, } else { - vty_outln (vty, "Unknown encryption type."); + vty_out (vty, "Unknown encryption type.\n"); return CMD_WARNING; } } 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; } @@ -1968,7 +1968,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); @@ -2040,11 +2040,11 @@ DEFUN (show_logging, zl->filename); vty_out (vty, VTYNL); - 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/distribute.c b/lib/distribute.c index 79d7b18ff5..8bf961e97e 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; } return CMD_SUCCESS; @@ -395,7 +395,7 @@ config_show_distribute (struct vty *vty) if (has_print) vty_out (vty, VTYNL); 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) @@ -416,7 +416,7 @@ config_show_distribute (struct vty *vty) if (has_print) vty_out (vty, VTYNL); else - vty_outln (vty, " nothing"); + vty_out (vty, " nothing\n"); } } @@ -439,7 +439,7 @@ config_show_distribute (struct vty *vty) if (has_print) vty_out (vty, VTYNL); 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) @@ -460,7 +460,7 @@ config_show_distribute (struct vty *vty) if (has_print) vty_out (vty, VTYNL); 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 3cef49b2da..b619b8a47d 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; } @@ -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; } 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; } 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; } @@ -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; } 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; } } @@ -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; } @@ -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; } } @@ -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; } } @@ -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; } @@ -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; } @@ -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,7 +1721,7 @@ 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)); @@ -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,7 +1764,7 @@ 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)); @@ -1860,7 +1860,7 @@ config_write_access_cisco (struct vty *vty, struct filter *mfilter) 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)); @@ -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 9bb672dc53..c3e1898f10 100644 --- a/lib/grammar_sandbox.c +++ b/lib/grammar_sandbox.c @@ -118,7 +118,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++) @@ -126,7 +126,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); @@ -164,13 +164,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); } @@ -178,16 +178,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; } } @@ -401,7 +401,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); @@ -410,13 +410,13 @@ 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%s '%s'\n", prev->el->name, VTYNL, prev->el->string); - vty_outln (vty, " %s%s '%s'", cur->el->name, VTYNL, + vty_out (vty, " %s%s '%s'\n", cur->el->name, VTYNL, cur->el->string); vty_out (vty, VTYNL); ambig++; @@ -428,7 +428,7 @@ DEFUN (grammar_findambig, vty_out (vty, VTYNL); } 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; @@ -465,11 +465,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; } - vty_outln (vty, "node %d", (int)cnode->node); + vty_out (vty, "node %d\n", (int)cnode->node); nodegraph = cnode->cmdgraph; return CMD_SUCCESS; } @@ -534,7 +534,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; @@ -555,12 +555,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, "<count); - vty_outln (vty, "# named: %d%s", tt->nrows - 1, VTYNL); + vty_out (vty, "# allocated: %d\n", _hashes->count); + vty_out (vty, "# named: %d%s\n", tt->nrows - 1, VTYNL); if (tt->nrows > 1) { @@ -472,7 +472,7 @@ DEFUN(show_hash_stats, 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); diff --git a/lib/if.c b/lib/if.c index 1d6a8cb529..2a17638b4a 100644 --- a/lib/if.c +++ b/lib/if.c @@ -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; } VTY_PUSH_CONTEXT (INTERFACE_NODE, ifp); diff --git a/lib/if_rmap.c b/lib/if_rmap.c index 32bebd67ff..49f9da5249 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; } @@ -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; } 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; } 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 9fe887c2c0..aaa8178c88 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; } @@ -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; } @@ -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; } 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; } 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; } @@ -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; } 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; } 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) { @@ -1010,7 +1010,7 @@ keychain_config_write (struct vty *vty) vty_out (vty, VTYNL); } } - vty_outln (vty, "!"); + vty_out (vty, "!\n"); } return 0; diff --git a/lib/memory_vty.c b/lib/memory_vty.c index 5983efbdcc..04909d633a 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,14 @@ DEFUN (show_modules, { struct frrmod_runtime *plug = frrmod_list; - vty_outln (vty, "%-12s %-25s %s%s", + vty_out (vty, "%-12s %-25s %s%s\n", "Module Name", "Version", "Description", VTYNL); 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 +129,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; diff --git a/lib/ns.c b/lib/ns.c index 4d46ecd0af..dbf07b1976 100644 --- a/lib/ns.c +++ b/lib/ns.c @@ -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; @@ -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; } @@ -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 339540a2b5..9f20a412e9 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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; 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; } @@ -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; } @@ -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; } @@ -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; } } @@ -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; } } @@ -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; } @@ -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; } @@ -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); @@ -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; } @@ -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++; @@ -1868,7 +1868,7 @@ config_write_prefix_afi (afi_t afi, struct vty *vty) { 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++; @@ -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); diff --git a/lib/routemap.c b/lib/routemap.c index caba8afd71..fe14a70452 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; 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; } @@ -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; 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; } @@ -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; 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; } @@ -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:%s %s\n", VTYNL, 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,7 +2359,7 @@ 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; } if (su.sin.sin_addr.s_addr == 0 || @@ -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; } 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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } 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; } @@ -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; } 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 5ba1c80e45..fd772b64c8 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 6f4b45f9a3..f8bf01e289 100644 --- a/lib/smux.c +++ b/lib/smux.c @@ -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 7cbb300c5f..10f00426cf 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 4e72d4c96f..e59d68b0e0 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':' ', @@ -148,12 +148,12 @@ cpu_record_print(struct vty *vty, thread_type filter) 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, "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,7 +161,7 @@ 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); } @@ -169,12 +169,12 @@ cpu_record_print(struct vty *vty, thread_type filter) 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, "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); diff --git a/lib/vrf.c b/lib/vrf.c index 6ad8cd91b6..6af3ccc61b 100644 --- a/lib/vrf.c +++ b/lib/vrf.c @@ -555,7 +555,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; } diff --git a/lib/vty.c b/lib/vty.c index 53328248f8..43af31b701 100644 --- a/lib/vty.c +++ b/lib/vty.c @@ -247,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); @@ -385,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; } } @@ -477,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); @@ -933,7 +933,7 @@ vty_complete_command (struct vty *vty) 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; @@ -946,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; @@ -1001,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; } @@ -1018,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); } @@ -1058,11 +1058,11 @@ vty_describe_command (struct vty *vty) 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; } @@ -1100,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 @@ -1139,10 +1139,10 @@ vty_describe_command (struct vty *vty) 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 @@ -1281,13 +1281,13 @@ 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]); @@ -1749,7 +1749,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; @@ -1759,7 +1759,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, + vty_out (vty, "%sUser Access Verification%s\n", VTYNL, VTYNL); /* Setting up terminal. */ @@ -2177,7 +2177,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 { @@ -2320,7 +2320,7 @@ vty_timeout (struct thread *thread) /* Clear buffer*/ buffer_reset (vty->obuf); - vty_outln (vty, "%sVty connection is timed out.", VTYNL); + vty_out (vty, "%sVty connection is timed out.\n", VTYNL); /* Close connection. */ vty->status = VTY_CLOSE; @@ -2801,7 +2801,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; } @@ -2844,7 +2844,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; } @@ -2968,30 +2968,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; } diff --git a/lib/workqueue.c b/lib/workqueue.c index 3749344196..3600df2f23 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 5410027e70..b126f5d6f6 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; } @@ -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; } @@ -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) : "", @@ -690,15 +690,15 @@ static void show_ip_opennhrp_cache(struct nhrp_cache *c, void *pctx) 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)); } @@ -731,14 +731,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%s\n", VTYNL); 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 +750,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 +763,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 +815,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 +838,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 +857,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) { @@ -871,7 +871,7 @@ static int interface_config_write(struct vty *vty) vty_out (vty, VTYNL); } 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 +880,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 +909,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_area.c b/ospf6d/ospf6_area.c index 826a66ccc6..ee4d7559ee 100644 --- a/ospf6d/ospf6_area.c +++ b/ospf6d/ospf6_area.c @@ -396,18 +396,18 @@ ospf6_area_show (struct vty *vty, struct ospf6_area *oa) 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"); } @@ -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; } @@ -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; } diff --git a/ospf6d/ospf6_bfd.c b/ospf6d/ospf6_bfd.c index 6ca56869d5..f460bf0653 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_interface.c b/ospf6d/ospf6_interface.c index e91c249845..16784ad64a 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -1307,7 +1307,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; } diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c index 0b8a5e4767..35b90f2803 100644 --- a/ospf6d/ospf6_spf.c +++ b/ospf6d/ospf6_spf.c @@ -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 268b7a60a2..34af891f12 100644 --- a/ospf6d/ospf6_top.c +++ b/ospf6d/ospf6_top.c @@ -811,7 +811,7 @@ ospf6_show (struct vty *vty, struct ospf6 *o) /* 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" @@ -854,9 +854,9 @@ ospf6_show (struct vty *vty, struct ospf6 *o) 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); @@ -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 @@ -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 : ""); } @@ -1027,13 +1027,13 @@ config_write_ospf6 (struct vty *vty) 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) @@ -1042,7 +1042,7 @@ config_write_ospf6 (struct vty *vty) /* 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); diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c index ea36ceabdf..ff00bc7a5a 100644 --- a/ospf6d/ospf6_zebra.c +++ b/ospf6d/ospf6_zebra.c @@ -683,7 +683,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; } @@ -731,14 +731,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; } rn = route_node_lookup (o->distance_table, (struct prefix *) &p); if (!rn) { - vty_outln (vty, "Cant't find specified prefix"); + vty_out (vty, "Cant't find specified prefix\n"); return CMD_WARNING; } diff --git a/ospfd/ospf_apiserver.c b/ospfd/ospf_apiserver.c index d09290e520..c2e158931e 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: "); diff --git a/ospfd/ospf_bfd.c b/ospfd/ospf_bfd.c index f8fa9bbb3b..1bcffea6fd 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 3947d5182c..7d0c9d6baf 100644 --- a/ospfd/ospf_dump.c +++ b/ospfd/ospf_dump.c @@ -1568,90 +1568,90 @@ 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, + vty_out (vty, "%sOSPF Instance: %d%s\n", VTYNL, ospf->instance, VTYNL); - 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); @@ -1722,56 +1722,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 +1779,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 +1796,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 +1806,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 +1821,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 09d218f81b..f3db6afd15 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 1fb52a94b5..bb745d0c2e 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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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 aafc0a98eb..5739578f55 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, "---------------%s\n", VTYNL); } 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 bc98da45ee..b2f9b21f40 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -3267,9 +3267,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)); } @@ -3375,16 +3375,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 +3393,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 +3401,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 +3414,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)); } } @@ -4769,10 +4769,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)" : "")); @@ -4790,14 +4790,14 @@ show_ip_ospf_database_header (struct vty *vty, struct ospf_lsa *lsa) vty_out (vty, VTYNL); } - 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%s\n", ntohs (lsa->data->length), VTYNL); } const char *link_type_desc[] = @@ -7071,7 +7071,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; } diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c index 715f240617..fa628f81ee 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; } @@ -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; } 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; } diff --git a/pimd/pim_bfd.c b/pimd/pim_bfd.c index 2a90eea3b6..af8a8e2c52 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 b0afc7828a..811617b9da 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, @@ -227,8 +227,8 @@ static void pim_show_assert_internal(struct vty *vty) "eATD: Evaluate AssertTrackingDesired%s", VTYNL, VTYNL, VTYNL, VTYNL); - 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 +245,7 @@ static void pim_show_assert_internal(struct vty *vty) ch_src_str, sizeof(ch_src_str)); pim_inet4_dump("", 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 +264,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 +289,7 @@ static void pim_show_assert_metric(struct vty *vty) pim_inet4_dump("", 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 +308,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 +345,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 +431,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 +480,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,19 +491,19 @@ 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); @@ -522,8 +522,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 +556,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 +569,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,42 +659,42 @@ 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, "Uptime : %s\n", uptime); + vty_out (vty, "Version : %d\n", 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, "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, "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, VTYNL); vty_out (vty, VTYNL); - vty_outln (vty, "Timers"); - vty_outln (vty, "------"); - vty_outln (vty, "Group Membership Interval : %lis", + 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, "Startup Query Interval : %ds\n", sqi); vty_out (vty, VTYNL); vty_out (vty, VTYNL); @@ -704,12 +704,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 +721,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 +751,7 @@ static void igmp_show_interface_join(struct vty *vty) pim_inet4_dump("", ij->group_addr, group_str, sizeof(group_str)); pim_inet4_dump("", 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,21 +925,21 @@ 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); @@ -949,15 +949,15 @@ 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("", 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); } @@ -966,13 +966,13 @@ static void pim_show_interfaces_single(struct vty *vty, const char *ifname, u_ch vty_out (vty, VTYNL); } - 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, "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, VTYNL); vty_out (vty, VTYNL); @@ -983,15 +983,15 @@ 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("", up->sg.src, src_str, sizeof(src_str)); pim_inet4_dump("", 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); } } @@ -1002,45 +1002,45 @@ static void pim_show_interfaces_single(struct vty *vty, const char *ifname, u_ch vty_out (vty, VTYNL); } - 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, "Generation ID : %08x\n", pim_ifp->pim_generation_id); vty_out (vty, VTYNL); vty_out (vty, VTYNL); 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_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); @@ -1048,12 +1048,12 @@ static void pim_show_interfaces_single(struct vty *vty, const char *ifname, u_ch } 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 +1105,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 +1134,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)); } } @@ -1154,15 +1154,15 @@ static void pim_show_interface_traffic (struct vty *vty, u_char uj) else { vty_out (vty, VTYNL); - vty_outln (vty, "%-12s%-17s%-17s%-17s%-17s%-17s%-17s", "Interface", + 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 +1193,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 +1208,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); } @@ -1228,15 +1228,15 @@ static void pim_show_interface_traffic_single (struct vty *vty, const char *ifna else { vty_out (vty, VTYNL); - vty_outln (vty, "%-12s%-17s%-17s%-17s%-17s%-17s%-17s", "Interface", + 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 +1272,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 +1287,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 +1315,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 +1374,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 +1387,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,29 +1512,29 @@ 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); @@ -1543,13 +1543,13 @@ static void pim_show_neighbors_single(struct vty *vty, const char *neighbor, 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_neighbor) - vty_outln (vty, "%% No such interface or neighbor"); + vty_out (vty, "%% No such interface or neighbor\n"); } } } @@ -1572,7 +1572,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", + vty_out (vty, "%sInstalled Source Group IIF OIL\n", VTYNL); } @@ -1695,7 +1695,7 @@ pim_show_state(struct vty *vty, const char *src_or_group, const char *group, 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 { @@ -1723,7 +1723,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 +1755,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 +1771,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 +1782,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 +1817,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 +1905,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 +1973,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 +1987,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 +2007,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 +2051,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 +2064,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 +2081,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 +2118,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 +2128,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); } @@ -2201,8 +2201,8 @@ static void pim_show_rpf(struct vty *vty, u_char uj) } 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, + "Source Group RpfIface RpfAddress RibNextHop Metric Pref\n"); } for (ALL_LIST_ELEMENTS_RO(pim_upstream_list, up_node, up)) { @@ -2239,7 +2239,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 +2251,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); } @@ -2288,14 +2288,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 +2315,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 +2368,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 +2383,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 +2394,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 +2433,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 +2454,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 +2494,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 +2514,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 +2548,7 @@ static void igmp_show_source_retransmission(struct vty *vty) pim_inet4_dump("", 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 +3113,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 +3128,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 +3163,7 @@ DEFUN (show_ip_pim_nexthop_lookup, pim_addr_dump ("", &grp, grp_str, sizeof (grp_str)); pim_addr_dump ("", &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; @@ -3198,8 +3198,8 @@ static void show_multicast_interfaces(struct vty *vty) vty_out (vty, VTYNL); - 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; @@ -3226,7 +3226,7 @@ static void show_multicast_interfaces(struct vty *vty) 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,11 +3249,11 @@ 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); @@ -3262,17 +3262,17 @@ DEFUN (show_ip_multicast, pim_zlookup_show_ip_multicast (vty); vty_out (vty, VTYNL); - vty_outln (vty, "Maximum highest VifIndex: %d", + 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, "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); @@ -3312,8 +3312,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 +3424,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 +3444,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 +3531,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 +3550,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 +3562,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); } @@ -3589,8 +3589,8 @@ static void show_mroute_count(struct vty *vty) vty_out (vty, VTYNL); - 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 +3605,7 @@ static void show_mroute_count(struct vty *vty) pim_inet4_dump("", c_oil->oil.mfcc_mcastgrp, group_str, sizeof(group_str)); pim_inet4_dump("", 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 +3627,7 @@ static void show_mroute_count(struct vty *vty) pim_inet4_dump("", s_route->c_oil.oil.mfcc_mcastgrp, group_str, sizeof(group_str)); pim_inet4_dump("", 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 +3668,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.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 : "", @@ -3701,8 +3701,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 +3719,14 @@ static void show_ssmpingd(struct vty *vty) pim_inet4_dump("", 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("", 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 +3756,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; } 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; } 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; } 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; } 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; } 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; } 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; } @@ -4042,19 +4042,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; } 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; } 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; } @@ -4104,13 +4104,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; @@ -4155,7 +4155,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; @@ -4172,12 +4172,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 +4218,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 +4258,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 +4277,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; } 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; } @@ -4307,14 +4307,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; } 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; } @@ -4388,7 +4388,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; } @@ -4473,7 +4473,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; } @@ -4482,14 +4482,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; } 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; } @@ -4520,7 +4520,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; } @@ -4529,14 +4529,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; } 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; } @@ -4704,21 +4704,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; } 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; } 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; } @@ -4746,8 +4746,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; @@ -4845,8 +4845,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; } @@ -4905,8 +4905,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; } @@ -4949,7 +4949,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; } @@ -4978,7 +4978,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; } @@ -5021,7 +5021,7 @@ 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; } @@ -5039,7 +5039,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; } @@ -5084,7 +5084,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; } @@ -5101,7 +5101,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; } @@ -5129,7 +5129,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; } @@ -5137,7 +5137,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; } @@ -5145,7 +5145,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; } @@ -5176,7 +5176,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; } @@ -5184,7 +5184,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; } @@ -5192,13 +5192,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; } 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; } @@ -5227,7 +5227,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; } @@ -5235,7 +5235,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; } @@ -5243,7 +5243,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; } @@ -5275,7 +5275,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; } @@ -5283,7 +5283,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; } @@ -5291,13 +5291,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; } 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; } @@ -5322,7 +5322,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; } } @@ -5352,7 +5352,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; } @@ -5597,22 +5597,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 +5632,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 +5882,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; } @@ -5892,13 +5892,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:CMD_SUCCESS; @@ -6022,14 +6022,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; } 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; } @@ -6039,16 +6039,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:CMD_SUCCESS; @@ -6075,7 +6075,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; } @@ -6085,10 +6085,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:CMD_SUCCESS; @@ -6114,7 +6114,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; } @@ -6124,16 +6124,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:CMD_SUCCESS; @@ -6160,7 +6160,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; } @@ -6170,13 +6170,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:CMD_SUCCESS; @@ -6203,7 +6203,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; } @@ -6213,13 +6213,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:CMD_SUCCESS; @@ -6249,10 +6249,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:CMD_SUCCESS; @@ -6268,10 +6268,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 : CMD_SUCCESS; @@ -6299,7 +6299,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 +6334,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 +6357,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 +6402,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 +6425,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 +6496,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_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_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, " 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); } } 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 +6568,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 +6610,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,13 +6677,13 @@ 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, "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, VTYNL); } } @@ -6708,7 +6708,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 +6752,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 +6780,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 71a2869818..170692e7f0 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("", 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_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 324541caa0..28300dbdff 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 a35bb60f46..d373581fec 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 5526881d2b..ccfd446969 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("", 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; } @@ -262,20 +262,20 @@ int pim_interface_config_write(struct vty *vty) char src_str[INET_ADDRSTRLEN]; pim_inet4_dump("", 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("", 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 908c0a1f8b..b4fff97120 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, ""); + vty_out (vty, "\n"); } } diff --git a/pimd/pim_zlookup.c b/pimd/pim_zlookup.c index e7ffe0f4ad..f405a39c9d 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, ""); + vty_out (vty, "\n"); } } diff --git a/python/clidef.py b/python/clidef.py index 1bf3c24aa2..069d80fb70 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 775fe3879e..a88837d906 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 4ce1b9b655..d713fe6fe4 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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } 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; } if (ri->key_chain) { - vty_outln (vty, "%% key-chain configuration exists"); + vty_out (vty, "%% key-chain configuration exists\n"); return CMD_WARNING; } @@ -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; } @@ -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) { @@ -1886,14 +1886,14 @@ rip_interface_config_write (struct vty *vty) } 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 c047bb7768..97b405607e 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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } 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 636aa80a9a..7f494a0981 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 31204872ac..c7923df4a1 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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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 c07831fdd5..3ee259baa8 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; } 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; } 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; } @@ -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; } 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; } @@ -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; } 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; } 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; } @@ -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; } @@ -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; } 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; } @@ -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; } @@ -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; } @@ -3561,16 +3561,16 @@ DEFUN (show_ip_rip_status, vty_outln (vty, "Routing Protocol is \"rip\""); 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. */ @@ -3581,12 +3581,12 @@ DEFUN (show_ip_rip_status, 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 +3607,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 +3627,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 +3656,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 +3677,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 +3694,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 +3705,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 9ba0e10e46..f08265600c 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 d739540c2d..2abf2f9a9f 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; } @@ -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; } @@ -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 51385dd930..e0ca0666bd 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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } 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 51f1a40097..03f3b4e05f 100644 --- a/ripngd/ripng_peer.c +++ b/ripngd/ripng_peer.c @@ -193,7 +193,7 @@ 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), + vty_out (vty, " %s %s%14s %10d %10d %10d %s\n", inet6_ntoa (peer->addr), VTYNL, " ", peer->recv_badpackets, peer->recv_badroutes, ZEBRA_RIPNG_DISTANCE_DEFAULT, diff --git a/ripngd/ripng_zebra.c b/ripngd/ripng_zebra.c index 465d33992f..725336aff3 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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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 bfec173efc..affb12b8ae 100644 --- a/ripngd/ripngd.c +++ b/ripngd/ripngd.c @@ -2113,16 +2113,16 @@ DEFUN (show_ipv6_ripng_status, vty_outln (vty, "Routing Protocol is \"RIPng\""); 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. */ @@ -2131,9 +2131,9 @@ DEFUN (show_ipv6_ripng_status, vty_out (vty, VTYNL); 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 +2144,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 +2260,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; } apply_mask_ipv6 (&p); @@ -2268,7 +2268,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; } @@ -2294,7 +2294,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; } apply_mask_ipv6 (&p); @@ -2302,7 +2302,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; } @@ -2329,7 +2329,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; } @@ -2337,7 +2337,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; } @@ -2363,14 +2363,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; } 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; } route_unlock_node (rn); @@ -2680,7 +2680,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; } @@ -2697,7 +2697,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; } @@ -2720,16 +2720,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 +2740,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,7 +2759,7 @@ 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); diff --git a/tests/lib/cli/common_cli.c b/tests/lib/cli/common_cli.c index 728ae8cb04..f1b07ce228 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 43366d49e2..a4d3fb4e8e 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 810d9fda78..382d1623f3 100644 --- a/tests/lib/test_heavy.c +++ b/tests/lib/test_heavy.c @@ -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 80c54a827f..9e1d70adc1 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 13641f6edd..18b80d0810 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 f02bd0c888..794708683f 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -2528,9 +2528,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, "%sCurrent configuration:\n",VTYNL); + vty_out (vty, "!\n"); for (i = 0; i < array_size(vtysh_client); i++) if ((argc < 3 ) || (strmatch (vtysh_client[i].name, argv[2]->text))) @@ -2552,7 +2552,7 @@ DEFUN (vtysh_write_terminal, fp = NULL; } - vty_outln (vty, "end"); + vty_out (vty, "end\n"); return CMD_SUCCESS; } @@ -2785,7 +2785,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; } diff --git a/watchfrr/watchfrr_vty.c b/watchfrr/watchfrr_vty.c index 819d896afa..276e186c40 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/interface.c b/zebra/interface.c index b8426c6890..e2def4a499 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -976,11 +976,11 @@ 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) @@ -990,32 +990,32 @@ nd_dump_vty (struct vty *vty, struct interface *ifp) vty_outln (vty, " ND router advertisements are sent every " "%d seconds",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_out (vty, + " ND router advertisements lifetime tracks ra-interval\n"); vty_outln (vty, " ND router advertisement default router preference is " "%s",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."); 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, "%s flags: %s\n", VTYNL, 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; @@ -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); @@ -1147,18 +1147,18 @@ if_dump_vty (struct vty *vty, struct interface *ifp) vty_out (vty, VTYNL); } 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,7 +1169,7 @@ 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); @@ -1186,10 +1186,10 @@ if_dump_vty (struct vty *vty, struct interface *ifp) 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); @@ -1199,7 +1199,7 @@ if_dump_vty (struct vty *vty, struct interface *ifp) 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 */ @@ -1213,7 +1213,7 @@ if_dump_vty (struct vty *vty, struct interface *ifp) (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," @@ -1222,10 +1222,10 @@ if_dump_vty (struct vty *vty, struct interface *ifp) (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 (). */ @@ -1234,17 +1234,17 @@ if_dump_vty (struct vty *vty, struct interface *ifp) 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; @@ -1458,7 +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, + vty_out (vty, "%s\tVRF %u%s\n", VTYNL, vrf->vrf_id, VTYNL); if_show_description (vty, vrf->vrf_id); } @@ -1480,7 +1480,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; } if_refresh (ifp); @@ -1506,7 +1506,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; } if_refresh (ifp); @@ -1572,7 +1572,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; } if_refresh (ifp); @@ -1598,7 +1598,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; } if_refresh (ifp); @@ -1630,7 +1630,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; } @@ -1832,7 +1832,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; } @@ -1850,8 +1850,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; } @@ -1874,7 +1874,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; } @@ -1882,8 +1882,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; } @@ -1911,14 +1911,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; } 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; } @@ -1926,8 +1926,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; } @@ -1951,7 +1951,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; } @@ -1995,7 +1995,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; } @@ -2069,7 +2069,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; } @@ -2094,7 +2094,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; } @@ -2190,7 +2190,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; } @@ -2231,15 +2231,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; } /* 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; } @@ -2277,15 +2277,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; } /* 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; } @@ -2323,15 +2323,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; } /* 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; } @@ -2372,13 +2372,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; } if (ipv4_martian(&cp.prefix)) { - vty_outln (vty, "%% Invalid address"); + vty_out (vty, "%% Invalid address\n"); return CMD_WARNING; } @@ -2429,7 +2429,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; } @@ -2456,7 +2456,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; } @@ -2464,7 +2464,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; } @@ -2487,7 +2487,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; } @@ -2572,13 +2572,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; } if (ipv6_martian(&cp.prefix)) { - vty_outln (vty, "%% Invalid address"); + vty_out (vty, "%% Invalid address\n"); return CMD_WARNING; } @@ -2625,7 +2625,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; } @@ -2665,7 +2665,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; } @@ -2673,7 +2673,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; } @@ -2696,7 +2696,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; } @@ -2742,23 +2742,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); @@ -2770,19 +2770,19 @@ link_params_config_write (struct vty *vty, struct interface *ifp) vty_out (vty, VTYNL); } 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 +2808,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)) { @@ -2851,7 +2851,7 @@ if_config_write (struct vty *vty) 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 +2865,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 ca932ac43c..4f19a873b7 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); } diff --git a/zebra/router-id.c b/zebra/router-id.c index 07caef7abe..7e3e286318 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 677189751d..1ba8dd7d1f 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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } 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; } } @@ -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; } 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; } @@ -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)) { diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c index 3e408c929c..b765b51b93 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,7 +1451,7 @@ 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", + vty_out (vty, "%s%-40s %10s Last %2d secs%s\n", VTYNL, "Counter", "Total", ZFPM_STATS_IVL_SECS, VTYNL); /* @@ -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, "%sStats were cleared %lu seconds ago\n", VTYNL, (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 510d796937..d78c1629be 100644 --- a/zebra/zebra_mpls.c +++ b/zebra/zebra_mpls.c @@ -530,7 +530,7 @@ 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); @@ -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); @@ -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,7 +2871,7 @@ 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]); } } @@ -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 6c2dbca3a2..41e3aac9a3 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; } 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; } if (!inlabel_str) { - vty_outln (vty, "%% No Label Information"); + vty_out (vty, "%% No Label Information\n"); return CMD_WARNING; } @@ -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; } @@ -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; } if (!outlabel_str) { - vty_outln (vty, "%% No Outgoing label Information"); + vty_out (vty, "%% No Outgoing label Information\n"); return CMD_WARNING; } } @@ -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; } } @@ -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; } #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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } 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; } } @@ -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; } @@ -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; } @@ -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; } @@ -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; } 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; } @@ -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; } diff --git a/zebra/zebra_ptm.c b/zebra/zebra_ptm.c index 9a7b029dd8..39779793f9 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_routemap.c b/zebra/zebra_routemap.c index c4f417d883..fc21ada3a4 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; case RMAP_COMPILE_ERROR: - vty_outln (vty, "%% Zebra Argument is malformed."); + vty_out (vty, "%% Zebra Argument is malformed.\n"); return CMD_WARNING; } } @@ -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; case RMAP_COMPILE_ERROR: - vty_outln (vty, "%% Zebra Argument is malformed."); + vty_out (vty, "%% Zebra Argument is malformed.\n"); return CMD_WARNING; } } @@ -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; } @@ -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; } @@ -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; } @@ -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;iinfo; 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 6ba4c1b9d5..1da288cca0 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; } @@ -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; } 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; } @@ -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; } 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; } 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; } } @@ -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; } @@ -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; } @@ -1107,18 +1107,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; } @@ -1126,7 +1126,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; } @@ -1183,7 +1183,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, "%sVRF %s:\n", VTYNL, zvrf_name(zvrf)); first = 0; @@ -1203,7 +1203,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); } @@ -1244,7 +1244,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, "%sVRF %s:\n", VTYNL, zvrf_name(zvrf)); zebra_print_rnh_table(zvrf_id (zvrf), AF_INET, vty, RNH_NEXTHOP_TYPE); } @@ -1284,7 +1284,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, "%sVRF %s:\n", VTYNL, zvrf_name(zvrf)); zebra_print_rnh_table(zvrf_id (zvrf), AF_INET6, vty, RNH_NEXTHOP_TYPE); } @@ -1440,7 +1440,7 @@ DEFUN (show_ip_route, if (type < 0) { - vty_outln (vty, "Unknown route type"); + vty_out (vty, "Unknown route type\n"); return CMD_WARNING; } } @@ -1493,7 +1493,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; } @@ -1504,7 +1504,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; } @@ -1542,7 +1542,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; } @@ -1553,7 +1553,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; } @@ -1602,7 +1602,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)); @@ -1613,19 +1613,19 @@ 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); } @@ -1680,7 +1680,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)); @@ -1690,20 +1690,20 @@ 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); } @@ -1780,7 +1780,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; } @@ -1822,7 +1822,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; } @@ -1992,7 +1992,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; } @@ -2001,7 +2001,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; } src_p = (struct prefix_ipv6*)&src; @@ -2029,7 +2029,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; } @@ -2039,8 +2039,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; } int rc = mpls_str2label (label_str, &snh_label.num_labels, @@ -2049,14 +2049,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; } @@ -2069,7 +2069,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; } if (add_cmd) @@ -2093,7 +2093,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; } } @@ -2104,7 +2104,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; } type = STATIC_IPV6_GATEWAY_IFINDEX; @@ -2112,7 +2112,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; } ifindex = ifp->ifindex; @@ -2130,7 +2130,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 @@ -2618,7 +2618,7 @@ DEFUN (show_ipv6_route, if (type < 0) { - vty_outln (vty, "Unknown route type"); + vty_out (vty, "Unknown route type\n"); return CMD_WARNING; } } @@ -2671,7 +2671,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; } @@ -2682,7 +2682,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; } @@ -2718,7 +2718,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; } @@ -2729,7 +2729,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; } @@ -2853,7 +2853,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; } @@ -2895,7 +2895,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; } @@ -3085,14 +3085,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; } @@ -3121,13 +3121,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; } @@ -3142,18 +3142,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 3da94459f7..bee70f9517 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -2678,53 +2678,53 @@ zebra_show_client_detail (struct vty *vty, struct zserv *client) vty_out (vty, " Instance: %d", client->instance); vty_out (vty, VTYNL); - 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_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); 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; } @@ -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; } @@ -2848,10 +2848,10 @@ 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; @@ -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; } @@ -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; } @@ -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; } From 181039f3d7a5f59ed31274210a9626f2cc5f673e Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Thu, 13 Jul 2017 18:50:29 +0200 Subject: [PATCH 05/14] *: ditch vty_outln(), part 2 of 2 Signed-off-by: David Lamparter --- babeld/babel_interface.c | 10 +++---- babeld/babel_main.c | 4 +-- bgpd/bgp_evpn_vty.c | 8 +++--- bgpd/bgp_mplsvpn.c | 4 +-- bgpd/bgp_mplsvpn.h | 6 ++-- bgpd/bgp_route.c | 36 ++++++++++++------------ bgpd/bgp_route.h | 8 +++--- bgpd/bgp_updgrp.c | 12 ++++---- bgpd/bgp_updgrp_adv.c | 12 ++++---- bgpd/bgp_vpn.c | 2 +- bgpd/rfapi/bgp_rfapi_cfg.c | 14 +++++----- bgpd/rfapi/rfapi.c | 20 +++++++------- bgpd/rfapi/rfapi_vty.c | 38 +++++++++++++------------- eigrpd/eigrp_dump.c | 6 ++-- isisd/isis_circuit.c | 16 +++++------ isisd/isis_lsp.c | 18 ++++++------ isisd/isis_spf.c | 4 +-- isisd/isis_vty.c | 56 +++++++++++++++++++------------------- isisd/isisd.c | 12 ++++---- ldpd/ldp_debug.c | 8 +++--- ldpd/ldp_vty_conf.c | 16 +++++------ ldpd/ldp_vty_exec.c | 20 +++++++------- lib/bfd.c | 4 +-- lib/filter.c | 4 +-- lib/if.c | 4 +-- lib/routemap.c | 4 +-- lib/thread.c | 8 +++--- lib/vty.c | 4 +-- lib/vty.h | 2 +- nhrpd/nhrp_vty.c | 6 ++-- pimd/pim_cmd.c | 16 +++++------ ripd/ripd.c | 6 ++-- ripngd/ripngd.c | 8 +++--- zebra/interface.c | 40 +++++++++++++-------------- zebra/irdp_interface.c | 8 +++--- zebra/zebra_routemap.c | 20 +++++++------- zebra/zserv.c | 2 +- 37 files changed, 233 insertions(+), 233 deletions(-) diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c index 5d60f41939..831df9b688 100644 --- a/babeld/babel_interface.c +++ b/babeld/babel_interface.c @@ -879,7 +879,7 @@ show_babel_interface_sub (struct vty *vty, struct interface *ifp) } babel_ifp = babel_get_if_nfo (ifp); vty_out (vty, " Babel protocol is running on this interface\n"); - vty_outln (vty, " Operating mode is \"%s\"", + vty_out (vty, " Operating mode is \"%s\"\n", CHECK_FLAG(babel_ifp->flags, BABEL_IF_WIRED) ? "wired" : "wireless"); vty_out (vty, " Split horizon mode is %s\n", CHECK_FLAG(babel_ifp->flags, BABEL_IF_SPLIT_HORIZON) ? "On" : "Off"); @@ -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, @@ -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), diff --git a/babeld/babel_main.c b/babeld/babel_main.c index eb2909b40e..725b2b4321 100644 --- a/babeld/babel_main.c +++ b/babeld/babel_main.c @@ -377,7 +377,7 @@ babel_save_state_file(void) void show_babel_main_configuration (struct vty *vty) { - vty_outln (vty, + vty_out (vty, "state file = %s%s" "configuration file = %s%s" "protocol informations:%s" @@ -386,7 +386,7 @@ show_babel_main_configuration (struct vty *vty) "vty address = %s%s" "vty port = %d%s" "id = %s%s" - "kernel_metric = %d", + "kernel_metric = %d\n", state_file, VTYNL, babel_config_file ? babel_config_file : babel_config_default, VTYNL, diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c index 7a8ef12c77..603171138e 100644 --- a/bgpd/bgp_evpn_vty.c +++ b/bgpd/bgp_evpn_vty.c @@ -135,10 +135,10 @@ 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_out (vty, "BGP table version is 0, local router ID is %s\n", @@ -148,7 +148,7 @@ bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd, vty_out (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete%s\n", VTYNL); - vty_outln(vty, V4_HEADER); + vty_out(vty, V4_HEADER); } } header = 0; @@ -224,7 +224,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; } diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c index 3efbeb8b49..979ff6bfe5 100644 --- a/bgpd/bgp_mplsvpn.c +++ b/bgpd/bgp_mplsvpn.c @@ -634,7 +634,7 @@ 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_out (vty, "BGP table version is 0, local router ID is %s\n", @@ -643,7 +643,7 @@ bgp_show_mpls_vpn (struct vty *vty, afi_t afi, struct prefix_rd *prd, "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal\n"); vty_out (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete%s\n", VTYNL); - vty_outln (vty, V4_HEADER); + vty_out (vty, V4_HEADER); } } header = 0; diff --git a/bgpd/bgp_mplsvpn.h b/bgpd/bgp_mplsvpn.h index 4ba4597d06..98806abc36 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_route.c b/bgpd/bgp_route.c index 156c0aa359..c7e26a0a67 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -7768,8 +7768,8 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p, } #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; } @@ -9644,10 +9644,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); vty_out (vty, "Originating default network 0.0.0.0%s\n", VTYNL); @@ -9677,15 +9677,15 @@ show_adj_route (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, { 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) @@ -9719,10 +9719,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; } @@ -9730,7 +9730,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; } diff --git a/bgpd/bgp_route.h b/bgpd/bgp_route.h index 0c77cc1ee0..54a56456dc 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_updgrp.c b/bgpd/bgp_updgrp.c index 78e5b86be5..fac446a79b 100644 --- a/bgpd/bgp_updgrp.c +++ b/bgpd/bgp_updgrp.c @@ -564,7 +564,7 @@ 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) @@ -585,14 +585,14 @@ 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, " 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); } @@ -609,7 +609,7 @@ update_group_show_walkcb (struct update_group *updgrp, void *arg) subgrp->peer_refreshes_combined); vty_out (vty, " Merge checks triggered: %u\n", subgrp->merge_checks_triggered); - vty_outln (vty, " Version: %" PRIu64 "", subgrp->version); + vty_out (vty, " Version: %" PRIu64 "\n", subgrp->version); vty_out (vty, " Packet queue length: %d\n", bpacket_queue_length(SUBGRP_PKTQ(subgrp))); vty_out (vty, " Total packets enqueued: %u\n", @@ -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); } diff --git a/bgpd/bgp_updgrp_adv.c b/bgpd/bgp_updgrp_adv.c index 02de6a1c1c..aa3a53098e 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) @@ -266,7 +266,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_vpn.c b/bgpd/bgp_vpn.c index a2665b67b9..e829c9cf2b 100644 --- a/bgpd/bgp_vpn.c +++ b/bgpd/bgp_vpn.c @@ -110,7 +110,7 @@ show_adj_route_vpn (struct vty *vty, struct peer *peer, struct prefix_rd *prd, "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal\n"); vty_out (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete%s\n", VTYNL); - vty_outln (vty, V4_HEADER); + vty_out (vty, V4_HEADER); } header = 0; } diff --git a/bgpd/rfapi/bgp_rfapi_cfg.c b/bgpd/rfapi/bgp_rfapi_cfg.c index ef8ae1a094..233734f14a 100644 --- a/bgpd/rfapi/bgp_rfapi_cfg.c +++ b/bgpd/rfapi/bgp_rfapi_cfg.c @@ -491,7 +491,7 @@ 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; } if ((value_l < 1) || (value_l > 0xff)) @@ -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); } } @@ -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; } } @@ -2740,7 +2740,7 @@ DEFUN (vnc_nve_group_prefix, 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; } @@ -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; @@ -3054,7 +3054,7 @@ 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; } if ((value_l < 1) || (value_l > 0xff)) @@ -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; } } diff --git a/bgpd/rfapi/rfapi.c b/bgpd/rfapi/rfapi.c index f9156863bf..c78045d1e8 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; } 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; } @@ -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; } 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; } rfapiQprefix2Rprefix (&pfx, &hpfx); @@ -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; } 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; } 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; } optary[opt_next].type = RFAPI_VN_OPTION_TYPE_L2ADDR; @@ -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; } 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; } rfapiQprefix2Rprefix (&pfx, &hpfx); @@ -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; } diff --git a/bgpd/rfapi/rfapi_vty.c b/bgpd/rfapi/rfapi_vty.c index dfbffadf36..9cb6ccbd97 100644 --- a/bgpd/rfapi/rfapi_vty.c +++ b/bgpd/rfapi/rfapi_vty.c @@ -2296,13 +2296,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; } @@ -2410,8 +2410,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; } optary[opt_next].v.l2addr.logical_net_id = strtoul(arg_vni, NULL, @@ -3129,7 +3129,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; } } @@ -3145,7 +3145,7 @@ parse_deleter_args ( { 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 +3161,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; } @@ -4574,8 +4574,8 @@ rfapi_show_nves ( if (!printed) { /* print out a header */ - vty_outln (vty, - " " "Active Next Hops"); + vty_out (vty, + " Active Next Hops\n"); vty_out (vty, "%-15s %-15s %-5s %-5s %-6s %-6s %s\n", "VN Address", "UN Address", @@ -4653,12 +4653,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; } @@ -5019,31 +5019,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; } 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; } 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; } 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; } if (!str2prefix (arg_prefix, &pfx)) { - vty_outln (vty, "Malformed prefix \"%s\"", + vty_out (vty, "Malformed prefix \"%s\"\n", arg_prefix); return CMD_WARNING; } @@ -5057,7 +5057,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; } @@ -5085,7 +5085,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; } @@ -5272,7 +5272,7 @@ vnc_clear_vrf (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; } diff --git a/eigrpd/eigrp_dump.c b/eigrpd/eigrp_dump.c index b57e7f1bcf..7ba234d0ff 100644 --- a/eigrpd/eigrp_dump.c +++ b/eigrpd/eigrp_dump.c @@ -300,8 +300,8 @@ show_ip_eigrp_topology_header (struct vty *vty, struct eigrp *eigrp) vty_out (vty, "%sEIGRP Topology Table for AS(%d)/ID(%s)%s\n", 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", + vty_out (vty, "Codes: P - Passive, A - Active, U - Update, Q - Query, " + "R - Reply%s r - reply Status, s - sia Status%s\n", VTYNL, VTYNL); } @@ -315,7 +315,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); } diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c index fae8cb0d87..aeaedbe3e1 100644 --- a/isisd/isis_circuit.c +++ b/isisd/isis_circuit.c @@ -912,13 +912,13 @@ isis_circuit_print_vty (struct isis_circuit *circuit, struct vty *vty, { 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) @@ -943,13 +943,13 @@ isis_circuit_print_vty (struct isis_circuit *circuit, struct vty *vty, { 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) diff --git a/isisd/isis_lsp.c b/isisd/isis_lsp.c index 2434229aca..c320ff79a0 100644 --- a/isisd/isis_lsp.c +++ b/isisd/isis_lsp.c @@ -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)), @@ -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); } diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c index ac6ba59a7a..a85cef6405 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) { diff --git a/isisd/isis_vty.c b/isisd/isis_vty.c index bccf8d428f..784f29f0e5 100644 --- a/isisd/isis_vty.c +++ b/isisd/isis_vty.c @@ -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; } @@ -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; } @@ -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; } diff --git a/isisd/isisd.c b/isisd/isisd.c index c089450cc5..7436d9f93a 100644 --- a/isisd/isisd.c +++ b/isisd/isisd.c @@ -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; } @@ -589,8 +589,8 @@ show_isis_neighbor_common (struct vty *vty, const char *id, char detail) 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)) { @@ -1543,8 +1543,8 @@ show_isis_database (struct vty *vty, const char *argv, int ui_level) 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) diff --git a/ldpd/ldp_debug.c b/ldpd/ldp_debug.c index c5f444ecd3..bf2de7b686 100644 --- a/ldpd/ldp_debug.c +++ b/ldpd/ldp_debug.c @@ -116,13 +116,13 @@ ldp_vty_show_debugging(struct vty *vty) if (LDP_DEBUG(event, EVENT)) 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_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_out (vty," LDP messages debugging is on (outbound)\n"); if (LDP_DEBUG(zebra, ZEBRA)) diff --git a/ldpd/ldp_vty_conf.c b/ldpd/ldp_vty_conf.c index 0f86e24a37..753ac802db 100644 --- a/ldpd/ldp_vty_conf.c +++ b/ldpd/ldp_vty_conf.c @@ -171,8 +171,8 @@ ldp_af_config_write(struct vty *vty, int af, struct ldpd_conf *conf, 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') { @@ -282,12 +282,12 @@ ldp_config_write(struct vty *vty) 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) @@ -333,8 +333,8 @@ ldp_l2vpn_pw_config_write(struct vty *vty, struct l2vpn_pw *pw) 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_out (vty," ! Incomplete config, specify a pw-id\n"); } diff --git a/ldpd/ldp_vty_exec.c b/ldpd/ldp_vty_exec.c index 45c5fedb2e..368edebe59 100644 --- a/ldpd/ldp_vty_exec.c +++ b/ldpd/ldp_vty_exec.c @@ -564,8 +564,8 @@ show_nbr_detail_msg(struct vty *vty, struct imsg *imsg, log_addr(nbr->af, &nbr->raddr),ntohs(nbr->rport)); 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_out(vty, " State: %s; Downstream-Unsolicited\n", nbr_state_name(nbr->nbr_state)); @@ -869,10 +869,10 @@ 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" + vty_out (vty, " Capabilities Sent:%s" " - Dynamic Announcement (0x0506)%s" " - Typed Wildcard (0x050B)%s" - " - Unrecognized Notification (0x0603)", + " - Unrecognized Notification (0x0603)\n", VTYNL, VTYNL, VTYNL); vty_out (vty, " Capabilities Received:\n"); if (nbr->flags & F_NBR_CAP_DYNAMIC) @@ -1242,8 +1242,8 @@ show_l2vpn_binding_msg(struct vty *vty, struct imsg *imsg, if (pw->local_label != NO_LABEL) { 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_out (vty, "%-8sMTU: %u\n", "",pw->local_ifmtu); } else @@ -1253,8 +1253,8 @@ show_l2vpn_binding_msg(struct vty *vty, struct imsg *imsg, if (pw->remote_label != NO_LABEL) { 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_out (vty, "%-8sMTU: %u\n", "",pw->remote_ifmtu); } else @@ -1694,11 +1694,11 @@ ldp_vty_show_capabilities(struct vty *vty, int json) return (0); } - vty_outln (vty, + vty_out (vty, "Supported LDP Capabilities%s" " * Dynamic Announcement (0x0506)%s" " * Typed Wildcard (0x050B)%s" - " * Unrecognized Notification (0x0603)%s", VTYNL, + " * Unrecognized Notification (0x0603)%s\n", VTYNL, VTYNL, VTYNL, VTYNL); return (0); diff --git a/lib/bfd.c b/lib/bfd.c index 34b6aa83c6..f429ef3e7a 100644 --- a/lib/bfd.c +++ b/lib/bfd.c @@ -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); diff --git a/lib/filter.c b/lib/filter.c index b619b8a47d..ae4b0b3b0c 100644 --- a/lib/filter.c +++ b/lib/filter.c @@ -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; } diff --git a/lib/if.c b/lib/if.c index 2a17638b4a..d694067816 100644 --- a/lib/if.c +++ b/lib/if.c @@ -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; } diff --git a/lib/routemap.c b/lib/routemap.c index fe14a70452..6e483234a6 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -2365,8 +2365,8 @@ DEFUN (set_ip_nexthop, 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; } diff --git a/lib/thread.c b/lib/thread.c index e59d68b0e0..10727dd078 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -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; } } diff --git a/lib/vty.c b/lib/vty.c index 43af31b701..8ff8280d48 100644 --- a/lib/vty.c +++ b/lib/vty.c @@ -1331,8 +1331,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 } diff --git a/lib/vty.h b/lib/vty.h index ef537b753d..2e2449fe82 100644 --- a/lib/vty.h +++ b/lib/vty.h @@ -215,7 +215,7 @@ struct vty_arg 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...)") */ + CPP_WARN("vty_outln is no longer useful, use vty_out(...\\n...)") /* Default time out value */ #define VTY_TIMEOUT_DEFAULT 600 diff --git a/nhrpd/nhrp_vty.c b/nhrpd/nhrp_vty.c index b126f5d6f6..ba1ef7ece3 100644 --- a/nhrpd/nhrp_vty.c +++ b/nhrpd/nhrp_vty.c @@ -677,10 +677,10 @@ 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, + vty_out(ctx->vty, "Type: %s%s" "Flags:%s%s%s" - "Protocol-Address: %s/%zu", + "Protocol-Address: %s/%zu\n", nhrp_cache_type_str[c->cur.type], VTYNL, (c->cur.peer && c->cur.peer->online) ? " up": "", @@ -702,7 +702,7 @@ static void show_ip_opennhrp_cache(struct nhrp_cache *c, void *pctx) 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, diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index 811617b9da..85e276aa09 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -220,11 +220,11 @@ static void pim_show_assert_internal(struct vty *vty) struct pim_ifchannel *ch; struct in_addr ifaddr; - vty_outln (vty, + vty_out (vty, "CA: CouldAssert%s" "ECA: Evaluate CouldAssert%s" "ATD: AssertTrackingDesired%s" - "eATD: Evaluate AssertTrackingDesired%s", + "eATD: Evaluate AssertTrackingDesired%s\n", VTYNL, VTYNL, VTYNL, VTYNL); vty_out (vty, @@ -2149,14 +2149,14 @@ 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, + vty_out (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", + "Nexthop Lookups Avoided: %lld\n", 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, @@ -2177,10 +2177,10 @@ 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, + vty_out (vty, "Scan OIL - Last: %s Events: %lld%s" "MFC Add - Last: %s Events: %lld%s" - "MFC Del - Last: %s Events: %lld", + "MFC Del - Last: %s Events: %lld\n", uptime_scan_oil, (long long) qpim_scan_oil_events, VTYNL, uptime_mroute_add, (long long) qpim_mroute_add_events, VTYNL, uptime_mroute_del, (long long)qpim_mroute_del_events); @@ -5025,8 +5025,8 @@ DEFUN_HIDDEN (interface_ip_pim_ssm, return CMD_WARNING; } - 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; } diff --git a/ripd/ripd.c b/ripd/ripd.c index 3ee259baa8..e590d48392 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -3474,11 +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" + vty_out (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", + " Network Next Hop Metric From Tag Time\n", VTYNL, VTYNL, VTYNL, VTYNL, VTYNL); for (np = route_top (rip->table); np; np = route_next (np)) @@ -3558,7 +3558,7 @@ 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_out (vty, " next due in %lu seconds\n", diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c index affb12b8ae..2519b75f4d 100644 --- a/ripngd/ripngd.c +++ b/ripngd/ripngd.c @@ -2004,11 +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" + vty_out (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", + " Network Next Hop Via Metric Tag Time\n", VTYNL, VTYNL, VTYNL, VTYNL, VTYNL); @@ -2030,7 +2030,7 @@ DEFUN (show_ipv6_ripng, 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); } @@ -2110,7 +2110,7 @@ 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_out (vty, " next due in %lu seconds\n", diff --git a/zebra/interface.c b/zebra/interface.c index e2def4a499..291a792748 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -984,27 +984,27 @@ nd_dump_vty (struct vty *vty, struct interface *ifp) 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_out (vty, " ND router advertisements live for %d seconds\n", rtadv->AdvDefaultLifetime); else vty_out (vty, " ND router advertisements lifetime tracks ra-interval\n"); - vty_outln (vty, " ND router advertisement default router preference is " - "%s",rtadv_pref_strs[rtadv->DefaultPreference]); + vty_out (vty, " ND router advertisement default router preference is " + "%s\n",rtadv_pref_strs[rtadv->DefaultPreference]); if (rtadv->AdvManagedFlag) vty_out (vty," Hosts use DHCP to obtain routable addresses.\n"); else 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_out (vty, " Home Agent lifetime is %u seconds\n", rtadv->HomeAgentLifetime); @@ -1175,13 +1175,13 @@ if_dump_vty (struct vty *vty, struct interface *ifp) #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); @@ -1193,8 +1193,8 @@ if_dump_vty (struct vty *vty, struct interface *ifp) 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); @@ -1206,8 +1206,8 @@ if_dump_vty (struct vty *vty, struct interface *ifp) #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, @@ -1216,8 +1216,8 @@ if_dump_vty (struct vty *vty, struct interface *ifp) 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); @@ -1229,8 +1229,8 @@ if_dump_vty (struct vty *vty, struct interface *ifp) (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); diff --git a/zebra/irdp_interface.c b/zebra/irdp_interface.c index 4f19a873b7..3c727ecb72 100644 --- a/zebra/irdp_interface.c +++ b/zebra/irdp_interface.c @@ -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; } } @@ -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; } } diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c index fc21ada3a4..ab1643e50d 100644 --- a/zebra/zebra_routemap.c +++ b/zebra/zebra_routemap.c @@ -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; } return zebra_route_match_add (vty, "source-protocol", proto, RMAP_EVENT_MATCH_ADDED); @@ -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; } 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; } @@ -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; } 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; } if (!proto_rm[AFI_IP6][i]) @@ -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; } 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; } @@ -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; } 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; } 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; } diff --git a/zebra/zserv.c b/zebra/zserv.c index bee70f9517..a89f4f5915 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -2855,7 +2855,7 @@ DEFUN (show_zebra, 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); } From 6b18e3b2e0dd57375f6908b40089a30bbf8f683f Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Thu, 13 Jul 2017 19:06:52 +0200 Subject: [PATCH 06/14] ospf6d: VNL -> VTYNL Signed-off-by: David Lamparter --- lib/vty.h | 2 +- ospf6d/ospf6_abr.c | 14 ++-- ospf6d/ospf6_area.c | 44 +++++------ ospf6d/ospf6_asbr.c | 36 ++++----- ospf6d/ospf6_flood.c | 2 +- ospf6d/ospf6_interface.c | 90 +++++++++++------------ ospf6d/ospf6_intra.c | 38 +++++----- ospf6d/ospf6_lsa.c | 66 ++++++++--------- ospf6d/ospf6_message.c | 18 ++--- ospf6d/ospf6_neighbor.c | 60 +++++++-------- ospf6d/ospf6_route.c | 74 +++++++++---------- ospf6d/ospf6_spf.c | 10 +-- ospf6d/ospf6_top.c | 56 +++++++------- ospf6d/ospf6_zebra.c | 26 +++---- ospf6d/ospf6d.c | 154 +++++++++++++++++++-------------------- 15 files changed, 345 insertions(+), 345 deletions(-) diff --git a/lib/vty.h b/lib/vty.h index 2e2449fe82..27deaea3ef 100644 --- a/lib/vty.h +++ b/lib/vty.h @@ -196,7 +196,7 @@ struct vty_arg #endif #define VNL "\n" \ -/* CPP_WARN("VNL has been replaced with \\n.") */ + CPP_WARN("VNL has been replaced with \\n.") #define VTYNL "\n" \ /* CPP_WARN("VTYNL has been replaced with \\n.") */ #define VTY_NEWLINE "\n" \ diff --git a/ospf6d/ospf6_abr.c b/ospf6d/ospf6_abr.c index 7ef7fdd94a..4048acbd61 100644 --- a/ospf6d/ospf6_abr.c +++ b/ospf6d/ospf6_abr.c @@ -1067,15 +1067,15 @@ ospf6_inter_area_prefix_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) OSPF6_LSA_HEADER_END (lsa->header); vty_out (vty, " Metric: %lu%s", - (u_long) OSPF6_ABR_SUMMARY_METRIC (prefix_lsa), VNL); + (u_long) OSPF6_ABR_SUMMARY_METRIC (prefix_lsa), VTYNL); 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%s", buf, VTYNL); vty_out (vty, " Prefix: %s%s", ospf6_inter_area_prefix_lsa_get_prefix_str (lsa, buf, sizeof(buf), - 0), VNL); + 0), VTYNL); 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, " Options: %s%s", buf, VTYNL); vty_out (vty, " Metric: %lu%s", - (u_long) OSPF6_ABR_SUMMARY_METRIC (router_lsa), VNL); + (u_long) OSPF6_ABR_SUMMARY_METRIC (router_lsa), VTYNL); 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%s", buf, VTYNL); 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%s", VTYNL); return 0; } diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c index ee4d7559ee..c1222a2c2e 100644 --- a/ospf6d/ospf6_area.c +++ b/ospf6d/ospf6_area.c @@ -371,25 +371,25 @@ 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%s", oa->name, VTYNL); 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]%s", oa->name, VTYNL); } else { - vty_out (vty, " Area %s[Stub]%s", oa->name, VNL); + vty_out (vty, " Area %s[Stub]%s", oa->name, VTYNL); } } vty_out (vty, " Number of Area scoped LSAs is %u%s", - oa->lsdb->count, VNL); + oa->lsdb->count, VTYNL); 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, "%s", VTYNL); if (oa->ts_spf.tv_sec || oa->ts_spf.tv_usec) { @@ -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%s", str, VTYNL); \ 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%s", argv[idx_ipv6_prefixlen]->arg, VTYNL); 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%s", argv[idx_ipv6]->arg, VTYNL); 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.%s", argv[idx_ipv6]->arg, VTYNL); 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, "%s", VTYNL); } 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%s", oa->name, VTYNL); else - vty_out (vty, " area %s stub%s", oa->name, VNL); + vty_out (vty, " area %s stub%s", oa->name, VTYNL); } if (PREFIX_NAME_IN (oa)) vty_out (vty, " area %s filter-list prefix %s in%s", - oa->name, PREFIX_NAME_IN (oa), VNL); + oa->name, PREFIX_NAME_IN (oa), VTYNL); if (PREFIX_NAME_OUT (oa)) vty_out (vty, " area %s filter-list prefix %s out%s", - oa->name, PREFIX_NAME_OUT (oa), VNL); + oa->name, PREFIX_NAME_OUT (oa), VTYNL); if (IMPORT_NAME (oa)) vty_out (vty, " area %s import-list %s%s", - oa->name, IMPORT_NAME (oa), VNL); + oa->name, IMPORT_NAME (oa), VTYNL); if (EXPORT_NAME (oa)) vty_out (vty, " area %s export-list %s%s", - oa->name, EXPORT_NAME (oa), VNL); + oa->name, EXPORT_NAME (oa), VTYNL); } } @@ -832,7 +832,7 @@ DEFUN (show_ipv6_ospf6_spf_tree, if (route == NULL) { vty_out (vty, "LS entry for root not found in area %s%s", - oa->name, VNL); + oa->name, VTYNL); continue; } root = (struct ospf6_vertex *) route->route_option; @@ -866,13 +866,13 @@ 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%s", argv[idx_ipv4]->arg, VTYNL); 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%s", argv[idx_ipv4]->arg, VTYNL); return CMD_SUCCESS; } @@ -880,7 +880,7 @@ DEFUN (show_ipv6_ospf6_area_spf_tree, if (route == NULL) { vty_out (vty, "LS entry for root not found in area %s%s", - oa->name, VNL); + oa->name, VTYNL); 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%s", argv[idx_ipv4_2]->arg, VTYNL); 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%s", argv[idx_ipv4_2]->arg, VTYNL); return CMD_SUCCESS; } diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c index 302d8c9865..6c50f7040f 100644 --- a/ospf6d/ospf6_asbr.c +++ b/ospf6d/ospf6_asbr.c @@ -760,10 +760,10 @@ ospf6_redistribute_config_write (struct vty *vty) if (ospf6->rmap[type].name) vty_out (vty, " redistribute %s route-map %s%s", - ZROUTE_NAME (type), ospf6->rmap[type].name, VNL); + ZROUTE_NAME (type), ospf6->rmap[type].name, VTYNL); else vty_out (vty, " redistribute %s%s", - ZROUTE_NAME (type), VNL); + ZROUTE_NAME (type), VTYNL); } 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:%s", VTYNL); for (type = 0; type < ZEBRA_ROUTE_MAX; type++) { if (type == ZEBRA_ROUTE_OSPF6) @@ -801,12 +801,12 @@ ospf6_redistribute_show_config (struct vty *vty) vty_out (vty, " %d: %s with route-map \"%s\"%s%s", nroute[type], ZROUTE_NAME (type), ospf6->rmap[type].name, (ospf6->rmap[type].map ? "" : " (not found !)"), - VNL); + VTYNL); else vty_out (vty, " %d: %s%s", nroute[type], - ZROUTE_NAME (type), VNL); + ZROUTE_NAME (type), VTYNL); } - vty_out (vty, "Total %d routes%s", total, VNL); + vty_out (vty, "Total %d routes%s", total, VTYNL); } @@ -1082,13 +1082,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.%s", VTYNL); break; case RMAP_COMPILE_ERROR: - vty_out (vty, "OSPF6 Argument is malformed.%s", VNL); + vty_out (vty, "OSPF6 Argument is malformed.%s", VTYNL); break; default: - vty_out (vty, "OSPF6 route-map add set failed.%s", VNL); + vty_out (vty, "OSPF6 route-map add set failed.%s", VTYNL); break; } return CMD_WARNING; @@ -1247,35 +1247,35 @@ 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, " Bits: %s%s", buf, VTYNL); vty_out (vty, " Metric: %5lu%s", (u_long) OSPF6_ASBR_METRIC (external), - VNL); + VTYNL); ospf6_prefix_options_printbuf (external->prefix.prefix_options, buf, sizeof (buf)); vty_out (vty, " Prefix Options: %s%s", buf, - VNL); + VTYNL); vty_out (vty, " Referenced LSType: %d%s", ntohs (external->prefix.prefix_refer_lstype), - VNL); + VTYNL); vty_out (vty, " Prefix: %s%s", - ospf6_as_external_lsa_get_prefix_str (lsa, buf, sizeof(buf), 0), VNL); + ospf6_as_external_lsa_get_prefix_str (lsa, buf, sizeof(buf), 0), VTYNL); /* 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); + VTYNL); } /* 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); + ospf6_as_external_lsa_get_tag (lsa), VTYNL); } return 0; @@ -1302,7 +1302,7 @@ ospf6_asbr_external_route_show (struct vty *vty, struct ospf6_route *route) prefix, id, route->path.metric_type, (u_long) (route->path.metric_type == 2 ? route->path.u.cost_e2 : route->path.cost), - forwarding, VNL); + forwarding, VTYNL); } DEFUN (show_ipv6_ospf6_redistribute, @@ -1399,7 +1399,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%s", VTYNL); return 0; } diff --git a/ospf6d/ospf6_flood.c b/ospf6d/ospf6_flood.c index 8a8dcfcd20..8434795257 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%s", VTYNL); return 0; } diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index 16784ad64a..29cfe12c7c 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -919,18 +919,18 @@ ospf6_interface_show (struct vty *vty, struct interface *ifp) 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); + VTYNL); + vty_out (vty, " Interface ID: %d%s", ifp->ifindex, VTYNL); if (ifp->info == NULL) { - vty_out (vty, " OSPF not enabled on this interface%s", VNL); + vty_out (vty, " OSPF not enabled on this interface%s", VTYNL); return 0; } else oi = (struct ospf6_interface *) ifp->info; - vty_out (vty, " Internet Address:%s", VNL); + vty_out (vty, " Internet Address:%s", VTYNL); for (ALL_LIST_ELEMENTS_RO (ifp->connected, i, c)) { @@ -940,15 +940,15 @@ ospf6_interface_show (struct vty *vty, struct interface *ifp) { case AF_INET: vty_out (vty, " inet : %s%s", strbuf, - VNL); + VTYNL); break; case AF_INET6: vty_out (vty, " inet6: %s%s", strbuf, - VNL); + VTYNL); break; default: vty_out (vty, " ??? : %s%s", strbuf, - VNL); + VTYNL); break; } } @@ -956,32 +956,32 @@ ospf6_interface_show (struct vty *vty, struct interface *ifp) if (oi->area) { vty_out (vty, " Instance ID %d, Interface MTU %d (autodetect: %d)%s", - oi->instance_id, oi->ifmtu, ifp->mtu6, VNL); + oi->instance_id, oi->ifmtu, ifp->mtu6, VTYNL); vty_out (vty, " MTU mismatch detection: %s%s", oi->mtu_ignore ? - "disabled" : "enabled", VNL); + "disabled" : "enabled", VTYNL); inet_ntop (AF_INET, &oi->area->area_id, strbuf, sizeof (strbuf)); vty_out (vty, " Area ID %s, Cost %u%s", strbuf, oi->cost, - VNL); + VTYNL); } else - vty_out (vty, " Not Attached to Area%s", VNL); + vty_out (vty, " Not Attached to Area%s", VTYNL); vty_out (vty, " State %s, Transmit Delay %d sec, Priority %d%s", ospf6_interface_state_str[oi->state], oi->transdelay, oi->priority, - VNL); - vty_out (vty, " Timer intervals configured:%s", VNL); + VTYNL); + vty_out (vty, " Timer intervals configured:%s", VTYNL); vty_out (vty, " Hello %d, Dead %d, Retransmit %d%s", oi->hello_interval, oi->dead_interval, oi->rxmt_interval, - VNL); + VTYNL); 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%s", drouter, bdrouter, VTYNL); vty_out (vty, " Number of I/F scoped LSAs is %u%s", - oi->lsdb->count, VNL); + oi->lsdb->count, VTYNL); monotime(&now); @@ -992,10 +992,10 @@ ospf6_interface_show (struct vty *vty, struct interface *ifp) vty_out (vty, " %d Pending LSAs for LSUpdate in Time %s [thread %s]%s", oi->lsupdate_list->count, duration, (oi->thread_send_lsupdate ? "on" : "off"), - VNL); + VTYNL); 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%s", lsa->name, VTYNL); timerclear (&res); if (oi->thread_send_lsack) @@ -1004,10 +1004,10 @@ ospf6_interface_show (struct vty *vty, struct interface *ifp) vty_out (vty, " %d Pending LSAs for LSAck in Time %s [thread %s]%s", oi->lsack_list->count, duration, (oi->thread_send_lsack ? "on" : "off"), - VNL); + VTYNL); 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%s", lsa->name, VTYNL); ospf6_bfd_show_info(vty, oi->bfd_info, 1); return 0; } @@ -1032,7 +1032,7 @@ DEFUN (show_ipv6_ospf6_interface, if (ifp == NULL) { vty_out (vty, "No such Interface: %s%s", argv[idx_ifname]->arg, - VNL); + VTYNL); return CMD_WARNING; } ospf6_interface_show (vty, ifp); @@ -1068,14 +1068,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%s", argv[idx_ifname]->arg, VTYNL); 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%s", argv[idx_ifname]->arg, VTYNL); return CMD_WARNING; } @@ -1146,7 +1146,7 @@ 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); + ifp->name, ifp->mtu6, VTYNL); return CMD_WARNING; } @@ -1156,7 +1156,7 @@ DEFUN (ipv6_ospf6_ifmtu, if (iobuflen < ifmtu) { vty_out (vty, "%s's ifmtu is adjusted to I/O buffer size (%d).%s", - ifp->name, iobuflen, VNL); + ifp->name, iobuflen, VTYNL); oi->ifmtu = oi->c_ifmtu = iobuflen; } else @@ -1204,7 +1204,7 @@ DEFUN (no_ipv6_ospf6_ifmtu, if (iobuflen < ifp->mtu) { vty_out (vty, "%s's ifmtu is adjusted to I/O buffer size (%d).%s", - ifp->name, iobuflen, VNL); + ifp->name, iobuflen, VTYNL); oi->ifmtu = iobuflen; } else @@ -1250,7 +1250,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%s", lcost, VTYNL); return CMD_WARNING; } @@ -1770,62 +1770,62 @@ config_write_ospf6_interface (struct vty *vty) continue; vty_out (vty, "interface %s%s", - oi->interface->name, VNL); + oi->interface->name, VTYNL); if (ifp->desc) - vty_out (vty, " description %s%s", ifp->desc, VNL); + vty_out (vty, " description %s%s", ifp->desc, VTYNL); if (oi->c_ifmtu) - vty_out (vty, " ipv6 ospf6 ifmtu %d%s", oi->c_ifmtu, VNL); + vty_out (vty, " ipv6 ospf6 ifmtu %d%s", oi->c_ifmtu, VTYNL); if (CHECK_FLAG (oi->flag, OSPF6_INTERFACE_NOAUTOCOST)) vty_out (vty, " ipv6 ospf6 cost %d%s", - oi->cost, VNL); + oi->cost, VTYNL); if (oi->hello_interval != OSPF6_INTERFACE_HELLO_INTERVAL) vty_out (vty, " ipv6 ospf6 hello-interval %d%s", - oi->hello_interval, VNL); + oi->hello_interval, VTYNL); if (oi->dead_interval != OSPF6_INTERFACE_DEAD_INTERVAL) vty_out (vty, " ipv6 ospf6 dead-interval %d%s", - oi->dead_interval, VNL); + oi->dead_interval, VTYNL); if (oi->rxmt_interval != OSPF6_INTERFACE_RXMT_INTERVAL) vty_out (vty, " ipv6 ospf6 retransmit-interval %d%s", - oi->rxmt_interval, VNL); + oi->rxmt_interval, VTYNL); if (oi->priority != OSPF6_INTERFACE_PRIORITY) vty_out (vty, " ipv6 ospf6 priority %d%s", - oi->priority, VNL); + oi->priority, VTYNL); if (oi->transdelay != OSPF6_INTERFACE_TRANSDELAY) vty_out (vty, " ipv6 ospf6 transmit-delay %d%s", - oi->transdelay, VNL); + oi->transdelay, VTYNL); if (oi->instance_id != OSPF6_INTERFACE_INSTANCE_ID) vty_out (vty, " ipv6 ospf6 instance-id %d%s", - oi->instance_id, VNL); + oi->instance_id, VTYNL); if (oi->plist_name) vty_out (vty, " ipv6 ospf6 advertise prefix-list %s%s", - oi->plist_name, VNL); + oi->plist_name, VTYNL); if (CHECK_FLAG (oi->flag, OSPF6_INTERFACE_PASSIVE)) - vty_out (vty, " ipv6 ospf6 passive%s", VNL); + vty_out (vty, " ipv6 ospf6 passive%s", VTYNL); if (oi->mtu_ignore) - vty_out (vty, " ipv6 ospf6 mtu-ignore%s", VNL); + vty_out (vty, " ipv6 ospf6 mtu-ignore%s", VTYNL); 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%s", VTYNL); else if (oi->type == OSPF_IFTYPE_BROADCAST) - vty_out (vty, " ipv6 ospf6 network broadcast%s", VNL); + vty_out (vty, " ipv6 ospf6 network broadcast%s", VTYNL); } ospf6_bfd_write_config(vty, oi); - vty_out (vty, "!%s", VNL); + vty_out (vty, "!%s", VTYNL); } return 0; } @@ -1922,7 +1922,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%s", argv[idx_ifname]->arg, VTYNL); return CMD_WARNING; } ospf6_interface_clear (vty, ifp); @@ -1966,7 +1966,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%s", VTYNL); return 0; } diff --git a/ospf6d/ospf6_intra.c b/ospf6d/ospf6_intra.c index 6acd45b7c1..a693e8bd04 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%s", bits, options, VTYNL); start = (char *) router_lsa + sizeof (struct ospf6_router_lsa); end = (char *) lsa->header + ntohs (lsa->header->length); @@ -126,16 +126,16 @@ ospf6_router_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) snprintf (name, sizeof (name), "Unknown (%#x)", lsdesc->type); vty_out (vty, " Type: %s Metric: %d%s", - name, ntohs (lsdesc->metric), VNL); + name, ntohs (lsdesc->metric), VTYNL); vty_out (vty, " Interface ID: %s%s", inet_ntop (AF_INET, &lsdesc->interface_id, - buf, sizeof (buf)), VNL); + buf, sizeof (buf)), VTYNL); vty_out (vty, " Neighbor Interface ID: %s%s", inet_ntop (AF_INET, &lsdesc->neighbor_interface_id, - buf, sizeof (buf)), VNL); + buf, sizeof (buf)), VTYNL); vty_out (vty, " Neighbor Router ID: %s%s", inet_ntop (AF_INET, &lsdesc->neighbor_router_id, - buf, sizeof (buf)), VNL); + buf, sizeof (buf)), VTYNL); } 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%s", options, VTYNL); 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%s", buf, VTYNL); } return 0; } @@ -624,9 +624,9 @@ ospf6_link_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) 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); + link_lsa->priority, options, VTYNL); + vty_out (vty, " LinkLocal Address: %s%s", buf, VTYNL); + vty_out (vty, " Number of Prefix: %d%s", prefixnum, VTYNL); start = (char *) link_lsa + sizeof (struct ospf6_link_lsa); end = (char *) lsa->header + ntohs (lsa->header->length); @@ -646,14 +646,14 @@ ospf6_link_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) 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); + p, mc, la, nu, VTYNL); 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); + buf, prefix->prefix_length, VTYNL); } return 0; @@ -825,14 +825,14 @@ 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%s", prefixnum, VTYNL); 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); + VTYNL); start = (char *) intra_prefix_lsa + sizeof (struct ospf6_intra_prefix_lsa); end = (char *) lsa->header + ntohs (lsa->header->length); @@ -852,14 +852,14 @@ ospf6_intra_prefix_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) 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); + p, mc, la, nu, VTYNL); 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); + buf, prefix->prefix_length, VTYNL); } return 0; @@ -1793,18 +1793,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%s", VTYNL); 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%s", buf, VTYNL); } 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%s", buf, VTYNL); } return 0; } diff --git a/ospf6d/ospf6_lsa.c b/ospf6d/ospf6_lsa.c index 624acb9c69..401d29c57b 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:%s", VTYNL); for (current = start; current < end; current ++) { if ((current - start) % 16 == 0) - vty_out (vty, "%s ", VNL); + vty_out (vty, "%s ", VTYNL); 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, "%s%s", VTYNL, VTYNL); return 0; } @@ -383,7 +383,7 @@ ospf6_lsa_show_summary_header (struct vty *vty) { vty_out (vty, "%-4s %-15s%-15s%4s %8s %30s%s", "Type", "LSId", "AdvRouter", "Age", "SeqNum", - "Payload", VNL); + "Payload", VTYNL); } void @@ -412,7 +412,7 @@ ospf6_lsa_show_summary (struct vty *vty, struct ospf6_lsa *lsa) 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), VTYNL); } else if (type != OSPF6_LSTYPE_UNKNOWN) { @@ -423,7 +423,7 @@ 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%s", tmpbuf, buf, VTYNL); cnt++; } } @@ -432,7 +432,7 @@ ospf6_lsa_show_summary (struct vty *vty, struct ospf6_lsa *lsa) vty_out (vty, "%-4s %-15s%-15s%4hu %8lx%s", 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), VTYNL); } } @@ -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, "%s", VTYNL); + vty_out (vty, "%s:%s", lsa->name, VTYNL); for (current = start; current < end; current ++) { if ((current - start) % 16 == 0) - vty_out (vty, "%s ", VNL); + vty_out (vty, "%s ", VTYNL); 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, "%s%s", VTYNL, VTYNL); 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, "%s", VTYNL); 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); + ospf6_lstype_name (lsa->header->type), VTYNL); + vty_out (vty, "Link State ID: %s%s", id, VTYNL); + vty_out (vty, "Advertising Router: %s%s", adv_router, VTYNL); vty_out (vty, "LS Sequence Number: %#010lx%s", - (u_long) ntohl (lsa->header->seqnum), VNL); + (u_long) ntohl (lsa->header->seqnum), VTYNL); vty_out (vty, "CheckSum: %#06hx Length: %hu%s", 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); + ntohs (lsa->header->length), VTYNL); + vty_out (vty, "Flag: %x %s", lsa->flag, VTYNL); + vty_out (vty, "Lock: %d %s", lsa->lock, VTYNL); + vty_out (vty, "ReTx Count: %d%s", lsa->retrans_count, VTYNL); vty_out (vty, "Threads: Expire: 0x%p, Refresh: 0x%p %s", - (void *)lsa->expire, (void *)lsa->refresh, VNL); - vty_out (vty, "%s", VNL); + (void *)lsa->expire, (void *)lsa->refresh, VTYNL); + vty_out (vty, "%s", VTYNL); return; } @@ -512,22 +512,22 @@ ospf6_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) 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); + ospf6_lstype_name (lsa->header->type), VTYNL); + vty_out (vty, "Link State ID: %s%s", id, VTYNL); + vty_out (vty, "Advertising Router: %s%s", adv_router, VTYNL); vty_out (vty, "LS Sequence Number: %#010lx%s", - (u_long) ntohl (lsa->header->seqnum), VNL); + (u_long) ntohl (lsa->header->seqnum), VTYNL); vty_out (vty, "CheckSum: %#06hx Length: %hu%s", ntohs (lsa->header->checksum), - ntohs (lsa->header->length), VNL); - vty_out (vty, "Duration: %s%s", duration, VNL); + ntohs (lsa->header->length), VTYNL); + vty_out (vty, "Duration: %s%s", duration, VTYNL); 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, "%s", VTYNL); } /* OSPFv3 LSA creation/deletion function */ @@ -938,16 +938,16 @@ config_write_ospf6_debug_lsa (struct vty *vty) continue; if (CHECK_FLAG (handler->debug, OSPF6_LSA_DEBUG)) vty_out (vty, "debug ospf6 lsa %s%s", - ospf6_lsa_handler_name (handler), VNL); + ospf6_lsa_handler_name (handler), VTYNL); if (CHECK_FLAG (handler->debug, OSPF6_LSA_DEBUG_ORIGINATE)) vty_out (vty, "debug ospf6 lsa %s originate%s", - ospf6_lsa_handler_name (handler), VNL); + ospf6_lsa_handler_name (handler), VTYNL); if (CHECK_FLAG (handler->debug, OSPF6_LSA_DEBUG_EXAMIN)) vty_out (vty, "debug ospf6 lsa %s examine%s", - ospf6_lsa_handler_name (handler), VNL); + ospf6_lsa_handler_name (handler), VTYNL); if (CHECK_FLAG (handler->debug, OSPF6_LSA_DEBUG_FLOOD)) vty_out (vty, "debug ospf6 lsa %s flooding%s", - ospf6_lsa_handler_name (handler), VNL); + ospf6_lsa_handler_name (handler), VTYNL); } return 0; diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c index 9bd337ba12..adf39de826 100644 --- a/ospf6d/ospf6_message.c +++ b/ospf6d/ospf6_message.c @@ -2459,41 +2459,41 @@ 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%s", VTYNL); 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%s", VTYNL); 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%s", VTYNL); 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%s", VTYNL); 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%s", VTYNL); 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%s", VTYNL); 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%s", type_str[i], VTYNL); else if (IS_OSPF6_DEBUG_MESSAGE (i, SEND)) vty_out (vty, "debug ospf6 message %s send%s", type_str[i], - VNL); + VTYNL); else if (IS_OSPF6_DEBUG_MESSAGE (i, RECV)) vty_out (vty, "debug ospf6 message %s recv%s", type_str[i], - VNL); + VTYNL); } return 0; diff --git a/ospf6d/ospf6_neighbor.c b/ospf6d/ospf6_neighbor.c index c58922b0ea..7e691f091a 100644 --- a/ospf6d/ospf6_neighbor.c +++ b/ospf6d/ospf6_neighbor.c @@ -675,14 +675,14 @@ ospf6_neighbor_show (struct vty *vty, struct ospf6_neighbor *on) /* vty_out (vty, "%-15s %3d %11s %6s/%-12s %11s %s[%s]%s", "Neighbor ID", "Pri", "DeadTime", "State", "", "Duration", - "I/F", "State", VNL); + "I/F", "State", VTYNL); */ vty_out (vty, "%-15s %3d %11s %8s/%-12s %11s %s[%s]%s", router_id, on->priority, deadtime, ospf6_neighbor_state_str[on->state], nstate, duration, on->ospf6_if->interface->name, - ospf6_interface_state_str[on->ospf6_if->state], VNL); + ospf6_interface_state_str[on->ospf6_if->state], VTYNL); } static void @@ -696,7 +696,7 @@ ospf6_neighbor_show_drchoice (struct vty *vty, struct ospf6_neighbor *on) /* vty_out (vty, "%-15s %6s/%-11s %-15s %-15s %s[%s]%s", "RouterID", "State", "Duration", "DR", "BDR", "I/F", - "State", VNL); + "State", VTYNL); */ inet_ntop (AF_INET, &on->router_id, router_id, sizeof (router_id)); @@ -711,7 +711,7 @@ ospf6_neighbor_show_drchoice (struct vty *vty, struct ospf6_neighbor *on) 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); + VTYNL); } static void @@ -732,45 +732,45 @@ ospf6_neighbor_show_detail (struct vty *vty, struct ospf6_neighbor *on) timerstring (&res, duration, sizeof (duration)); vty_out (vty, " Neighbor %s%s", on->name, - VNL); + VTYNL); vty_out (vty, " Area %s via interface %s (ifindex %d)%s", on->ospf6_if->area->name, on->ospf6_if->interface->name, on->ospf6_if->interface->ifindex, - VNL); + VTYNL); vty_out (vty, " His IfIndex: %d Link-local address: %s%s", on->ifindex, linklocal_addr, - VNL); + VTYNL); vty_out (vty, " State %s for a duration of %s%s", ospf6_neighbor_state_str[on->state], duration, - VNL); + VTYNL); vty_out (vty, " His choice of DR/BDR %s/%s, Priority %d%s", drouter, bdrouter, on->priority, - VNL); + VTYNL); vty_out (vty, " DbDesc status: %s%s%s SeqNum: %#lx%s", (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); + VTYNL); vty_out (vty, " Summary-List: %d LSAs%s", on->summary_list->count, - VNL); + VTYNL); 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%s", lsa->name, VTYNL); vty_out (vty, " Request-List: %d LSAs%s", on->request_list->count, - VNL); + VTYNL); 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%s", lsa->name, VTYNL); vty_out (vty, " Retrans-List: %d LSAs%s", on->retrans_list->count, - VNL); + VTYNL); 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%s", lsa->name, VTYNL); timerclear (&res); if (on->thread_send_dbdesc) @@ -779,10 +779,10 @@ ospf6_neighbor_show_detail (struct vty *vty, struct ospf6_neighbor *on) vty_out (vty, " %d Pending LSAs for DbDesc in Time %s [thread %s]%s", on->dbdesc_list->count, duration, (on->thread_send_dbdesc ? "on" : "off"), - VNL); + VTYNL); 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%s", lsa->name, VTYNL); timerclear (&res); if (on->thread_send_lsreq) @@ -791,10 +791,10 @@ ospf6_neighbor_show_detail (struct vty *vty, struct ospf6_neighbor *on) vty_out (vty, " %d Pending LSAs for LSReq in Time %s [thread %s]%s", on->request_list->count, duration, (on->thread_send_lsreq ? "on" : "off"), - VNL); + VTYNL); 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%s", lsa->name, VTYNL); timerclear (&res); if (on->thread_send_lsupdate) @@ -803,10 +803,10 @@ ospf6_neighbor_show_detail (struct vty *vty, struct ospf6_neighbor *on) vty_out (vty, " %d Pending LSAs for LSUpdate in Time %s [thread %s]%s", on->lsupdate_list->count, duration, (on->thread_send_lsupdate ? "on" : "off"), - VNL); + VTYNL); 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%s", lsa->name, VTYNL); timerclear (&res); if (on->thread_send_lsack) @@ -815,10 +815,10 @@ ospf6_neighbor_show_detail (struct vty *vty, struct ospf6_neighbor *on) vty_out (vty, " %d Pending LSAs for LSAck in Time %s [thread %s]%s", on->lsack_list->count, duration, (on->thread_send_lsack ? "on" : "off"), - VNL); + VTYNL); 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%s", lsa->name, VTYNL); ospf6_bfd_show_info(vty, on->bfd_info, 0); } @@ -854,11 +854,11 @@ DEFUN (show_ipv6_ospf6_neighbor, if (showfunc == ospf6_neighbor_show) vty_out (vty, "%-15s %3s %11s %8s/%-12s %11s %s[%s]%s", "Neighbor ID", "Pri", "DeadTime", "State", "IfState", "Duration", - "I/F", "State", VNL); + "I/F", "State", VTYNL); else if (showfunc == ospf6_neighbor_show_drchoice) vty_out (vty, "%-15s %8s/%-11s %-15s %-15s %s[%s]%s", "RouterID", "State", "Duration", "DR", "BDR", "I/F", - "State", VNL); + "State", VTYNL); for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, i, oa)) for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) @@ -893,7 +893,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); + VTYNL); return CMD_SUCCESS; } @@ -1016,11 +1016,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%s", VTYNL); else if (IS_OSPF6_DEBUG_NEIGHBOR (STATE)) - vty_out (vty, "debug ospf6 neighbor state%s", VNL); + vty_out (vty, "debug ospf6 neighbor state%s", VTYNL); else if (IS_OSPF6_DEBUG_NEIGHBOR (EVENT)) - vty_out (vty, "debug ospf6 neighbor event%s", VNL); + vty_out (vty, "debug ospf6 neighbor event%s", VTYNL); return 0; } diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c index a6bb099ddd..3784565a94 100644 --- a/ospf6d/ospf6_route.c +++ b/ospf6d/ospf6_route.c @@ -1047,12 +1047,12 @@ ospf6_route_show (struct vty *vty, struct ospf6_route *route) (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, VTYNL); i++; } else vty_out (vty, "%c%1s %2s %-30s %-25s %6.*s %s%s", - ' ', "", "", "", nexthop, IFNAMSIZ, ifname, "", VNL); + ' ', "", "", "", nexthop, IFNAMSIZ, ifname, "", VTYNL); } } @@ -1078,21 +1078,21 @@ 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%s", destination, VTYNL); /* destination type */ vty_out (vty, "Destination type: %s%s", OSPF6_DEST_TYPE_NAME (route->type), - VNL); + VTYNL); /* 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%s", duration, VTYNL); 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%s", duration, VTYNL); /* Debugging info */ vty_out (vty, "Lock: %d Flags: %s%s%s%s%s", route->lock, @@ -1100,19 +1100,19 @@ ospf6_route_show_detail (struct vty *vty, struct ospf6_route *route) (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); + VTYNL); vty_out (vty, "Memory: prev: %p this: %p next: %p%s", - (void *)route->prev, (void *)route, (void *)route->next, VNL); + (void *)route->prev, (void *)route, (void *)route->next, VTYNL); /* 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%s", area_id, VTYNL); /* Path type */ vty_out (vty, "Path Type: %s%s", - OSPF6_PATH_TYPE_NAME (route->path.type), VNL); + OSPF6_PATH_TYPE_NAME (route->path.type), VTYNL); /* LS Origin */ inet_ntop (AF_INET, &route->path.origin.id, id, sizeof (id)); @@ -1120,35 +1120,35 @@ ospf6_route_show_detail (struct vty *vty, struct ospf6_route *route) sizeof (adv_router)); vty_out (vty, "LS Origin: %s Id: %s Adv: %s%s", ospf6_lstype_name (route->path.origin.type), - id, adv_router, VNL); + id, adv_router, VTYNL); /* Options */ ospf6_options_printbuf (route->path.options, options, sizeof (options)); - vty_out (vty, "Options: %s%s", options, VNL); + vty_out (vty, "Options: %s%s", options, VTYNL); /* 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%s", capa, VTYNL); /* Prefix Options */ - vty_out (vty, "Prefix Options: xxx%s", VNL); + vty_out (vty, "Prefix Options: xxx%s", VTYNL); /* Metrics */ vty_out (vty, "Metric Type: %d%s", route->path.metric_type, - VNL); + VTYNL); vty_out (vty, "Metric: %d (%d)%s", - route->path.cost, route->path.u.cost_e2, VNL); + route->path.cost, route->path.u.cost_e2, VTYNL); /* Nexthops */ - vty_out (vty, "Nexthop:%s", VNL); + vty_out (vty, "Nexthop:%s", VTYNL); 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%s", nexthop, IFNAMSIZ, ifname, VTYNL); } - vty_out (vty, "%s", VNL); + vty_out (vty, "%s", VTYNL); } static void @@ -1184,14 +1184,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%s", number, VTYNL); + vty_out (vty, "Number of Destination: %d%s", destination, VTYNL); + vty_out (vty, "Number of Alternative routes: %d%s", alternative, VTYNL); + vty_out (vty, "Number of Equal Cost Multi Path: %d%s", ecmp, VTYNL); 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); + OSPF6_PATH_TYPE_NAME (i), pathtype[i], VTYNL); } } @@ -1364,7 +1364,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%s", argv[i]->arg, VTYNL); return CMD_SUCCESS; } @@ -1401,7 +1401,7 @@ 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); + "Type", "Router-ID", "Net-ID", "Rtr-Bits", "Options", "Cost", VTYNL); } static void @@ -1421,11 +1421,11 @@ ospf6_linkstate_show (struct vty *vty, struct ospf6_route *route) if (ntohl (id)) vty_out (vty, "%-7s %-15s %-15s %-8s %-14s %lu%s", "Network", routername, idname, rbits, options, - (unsigned long) route->path.cost, VNL); + (unsigned long) route->path.cost, VTYNL); else vty_out (vty, "%-7s %-15s %-15s %-8s %-14s %lu%s", "Router", routername, idname, rbits, options, - (unsigned long) route->path.cost, VNL); + (unsigned long) route->path.cost, VTYNL); } @@ -1502,7 +1502,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%s", argv[i]->arg, VTYNL); return CMD_SUCCESS; } @@ -1514,11 +1514,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%s", argv[i]->arg, VTYNL); return CMD_SUCCESS; } - vty_out (vty, "Malformed argument: %s%s", argv[i]->arg, VNL); + vty_out (vty, "Malformed argument: %s%s", argv[i]->arg, VTYNL); return CMD_SUCCESS; } @@ -1539,7 +1539,7 @@ 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); + "Router-ID", "Rtr-Bits", "Options", "Path-Type", "Area", VTYNL); } void @@ -1555,10 +1555,10 @@ ospf6_brouter_show (struct vty *vty, struct ospf6_route *route) 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); */ + "Router-ID", "Rtr-Bits", "Options", "Path-Type", "Area", VTYNL); */ vty_out (vty, "%-15s %-8s %-14s %-10s %-15s%s", adv, rbits, options, OSPF6_PATH_TYPE_NAME (route->path.type), - area, VNL); + area, VTYNL); } DEFUN (debug_ospf6_route, @@ -1619,11 +1619,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%s", VTYNL); if (IS_OSPF6_DEBUG_ROUTE (INTRA)) - vty_out (vty, "debug ospf6 route intra-area%s", VNL); + vty_out (vty, "debug ospf6 route intra-area%s", VTYNL); if (IS_OSPF6_DEBUG_ROUTE (INTER)) - vty_out (vty, "debug ospf6 route inter-area%s", VNL); + vty_out (vty, "debug ospf6 route inter-area%s", VTYNL); return 0; } diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c index 35b90f2803..6338b06f68 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]%s", prefix, v->name, v->cost, VTYNL); 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%s", VTYNL); 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%s", VTYNL); if (IS_OSPF6_DEBUG_SPF (TIME)) - vty_out (vty, "debug ospf6 spf time%s", VNL); + vty_out (vty, "debug ospf6 spf time%s", VTYNL); if (IS_OSPF6_DEBUG_SPF (DATABASE)) - vty_out (vty, "debug ospf6 spf database%s", VNL); + vty_out (vty, "debug ospf6 spf database%s", VTYNL); return 0; } diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c index 34af891f12..f5abead8cf 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%s", VTYNL); 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%s", argv[idx_ipv4]->arg, VTYNL); return CMD_SUCCESS; } @@ -589,14 +589,14 @@ DEFUN (ospf6_interface_area, if (oi->area) { vty_out (vty, "%s already attached to Area %s%s", - oi->interface->name, oi->area->name, VNL); + oi->interface->name, oi->area->name, VTYNL); 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%s", argv[idx_ipv4]->arg, VTYNL); 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%s", argv[idx_ifname]->arg, VTYNL); 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%s", ifp->name, VTYNL); 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%s", argv[idx_ipv4]->arg, VTYNL); 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%s", argv[idx_ipv4]->arg, VTYNL); 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); + oi->interface->name, oi->area->name, VTYNL); return CMD_SUCCESS; } @@ -800,13 +800,13 @@ 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); + router_id, VTYNL); /* 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%s", duration, VTYNL); /* Redistribute configuration */ /* XXX */ @@ -818,10 +818,10 @@ ospf6_show (struct vty *vty, struct ospf6 *o) " 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); + o->spf_delay, VTYNL, + o->spf_holdtime, VTYNL, + o->spf_max_holdtime, VTYNL, + o->spf_hold_multiplier, VTYNL); vty_out(vty, " SPF algorithm "); if (o->ts_spf.tv_sec || o->ts_spf.tv_usec) @@ -829,27 +829,27 @@ 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 executed %s ago, reason %s%s", buf, rbuf, VTYNL); vty_out (vty, " Last SPF duration %lld sec %lld usec%s", (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, VTYNL); } else - vty_out(vty, "has not been run$%s", VNL); + vty_out(vty, "has not been run$%s", VTYNL); 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); + (o->t_spf_calc ? "due in " : "is "), buf, VTYNL); if (CHECK_FLAG (o->flag, OSPF6_STUB_ROUTER)) - vty_out (vty, " Router Is Stub Router%s", VNL); + vty_out (vty, " Router Is Stub Router%s", VTYNL); /* LSAs */ vty_out (vty, " Number of AS scoped LSAs is %u%s", - o->lsdb->count, VNL); + o->lsdb->count, VTYNL); /* Areas */ vty_out (vty, " Number of areas in this router is %u%s", - listcount (o->area_list), VNL); + listcount (o->area_list), VTYNL); if (CHECK_FLAG(o->config_flags, OSPF6_LOG_ADJACENCY_CHANGES)) { @@ -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%s", VTYNL); } return; } @@ -1019,9 +1019,9 @@ 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%s", VTYNL); if (ospf6->router_id_static != 0) - vty_out (vty, " router-id %s%s", router_id, VNL); + vty_out (vty, " router-id %s%s", router_id, VTYNL); /* log-adjacency-changes flag print. */ if (CHECK_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_CHANGES)) @@ -1038,7 +1038,7 @@ config_write_ospf6 (struct vty *vty) if (ospf6->ref_bandwidth != OSPF6_REFERENCE_BANDWIDTH) vty_out (vty, " auto-cost reference-bandwidth %d%s", ospf6->ref_bandwidth, - VNL); + VTYNL); /* LSA timers print. */ if (ospf6->lsa_minarrival != OSPF_MIN_LS_ARRIVAL) @@ -1054,9 +1054,9 @@ config_write_ospf6 (struct vty *vty) { for (ALL_LIST_ELEMENTS_RO (oa->if_list, k, oi)) vty_out (vty, " interface %s area %s%s", - oi->interface->name, oa->name, VNL); + oi->interface->name, oa->name, VTYNL); } - vty_out (vty, "!%s", VNL); + vty_out (vty, "!%s", VTYNL); return 0; } diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c index ff00bc7a5a..9a1866139f 100644 --- a/ospf6d/ospf6_zebra.c +++ b/ospf6d/ospf6_zebra.c @@ -315,23 +315,23 @@ DEFUN (show_zebra, int i; if (zclient == NULL) { - vty_out (vty, "Not connected to zebra%s", VNL); + vty_out (vty, "Not connected to zebra%s", VTYNL); return CMD_SUCCESS; } - vty_out (vty, "Zebra Infomation%s", VNL); + vty_out (vty, "Zebra Infomation%s", VTYNL); vty_out (vty, " enable: %d fail: %d%s", - zclient->enable, zclient->fail, VNL); + zclient->enable, zclient->fail, VTYNL); vty_out (vty, " redistribute default: %d%s", vrf_bitmap_check (zclient->default_information, VRF_DEFAULT), - VNL); + VTYNL); 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, "%s", VTYNL); return CMD_SUCCESS; } @@ -341,15 +341,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%s", VTYNL); + vty_out (vty, "!%s", VTYNL); } 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%s", VTYNL); + vty_out (vty, " no redistribute ospf6%s", VTYNL); + vty_out (vty, "!%s", VTYNL); } return 0; } @@ -905,13 +905,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%s", VTYNL); else { if (IS_OSPF6_DEBUG_ZEBRA (SEND)) - vty_out (vty, "debug ospf6 zebra send%s", VNL); + vty_out (vty, "debug ospf6 zebra send%s", VTYNL); if (IS_OSPF6_DEBUG_ZEBRA (RECV)) - vty_out (vty, "debug ospf6 zebra recv%s", VNL); + vty_out (vty, "debug ospf6 zebra recv%s", VTYNL); } return 0; } diff --git a/ospf6d/ospf6d.c b/ospf6d/ospf6d.c index 1ccf7ce7a9..ce03322f79 100644 --- a/ospf6d/ospf6d.c +++ b/ospf6d/ospf6d.c @@ -84,7 +84,7 @@ DEFUN (show_version_ospf6, ) { vty_out (vty, "Zebra OSPF6d Version: %s%s", - ospf6_daemon_version, VNL); + ospf6_daemon_version, VTYNL); return CMD_SUCCESS; } @@ -110,7 +110,7 @@ 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, "!%s", VTYNL); return 0; } @@ -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, VTYNL, oa->name, VTYNL, VTYNL); 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, VTYNL, + oi->interface->name, oa->name, VTYNL, VTYNL); 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, VTYNL, VTYNL, VTYNL); ospf6_lsdb_show (vty, level, NULL, NULL, NULL, o->lsdb); - vty_out (vty, "%s", VNL); + vty_out (vty, "%s", VTYNL); 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, VTYNL, oa->name, VTYNL, VTYNL); 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, VTYNL, + oi->interface->name, oa->name, VTYNL, VTYNL); 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, VTYNL, VTYNL, VTYNL); 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, "%s", VTYNL); 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, VTYNL, oa->name, VTYNL, VTYNL); 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, VTYNL, + oi->interface->name, oa->name, VTYNL, VTYNL); 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, VTYNL, VTYNL, VTYNL); ospf6_lsdb_show (vty, level, NULL, &id, NULL, o->lsdb); - vty_out (vty, "%s", VNL); + vty_out (vty, "%s", VTYNL); 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, VTYNL, oa->name, VTYNL, VTYNL); 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, VTYNL, + oi->interface->name, oa->name, VTYNL, VTYNL); 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, VTYNL, VTYNL, VTYNL); ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb); - vty_out (vty, "%s", VNL); + vty_out (vty, "%s", VTYNL); 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, VTYNL, oa->name, VTYNL, VTYNL); 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, VTYNL, + oi->interface->name, oa->name, VTYNL, VTYNL); 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, VTYNL, VTYNL, VTYNL); 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, "%s", VTYNL); 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, VTYNL, oa->name, VTYNL, VTYNL); 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, VTYNL, + oi->interface->name, oa->name, VTYNL, VTYNL); 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, VTYNL, VTYNL, VTYNL); 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, "%s", VTYNL); 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, VTYNL, oa->name, VTYNL, VTYNL); 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, VTYNL, + oi->interface->name, oa->name, VTYNL, VTYNL); 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, VTYNL, VTYNL, VTYNL); ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb); - vty_out (vty, "%s", VNL); + vty_out (vty, "%s", VTYNL); 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, VTYNL, oa->name, VTYNL, VTYNL); 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, VTYNL, + oi->interface->name, oa->name, VTYNL, VTYNL); 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, VTYNL, VTYNL, VTYNL); ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb); - vty_out (vty, "%s", VNL); + vty_out (vty, "%s", VTYNL); 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, VTYNL, oa->name, VTYNL, VTYNL); 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, VTYNL, + oi->interface->name, oa->name, VTYNL, VTYNL); 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, VTYNL, VTYNL, VTYNL); 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, "%s", VTYNL); 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, VTYNL, oa->name, VTYNL, VTYNL); 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, VTYNL, + oi->interface->name, oa->name, VTYNL, VTYNL); 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, VTYNL, VTYNL, VTYNL); 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, "%s", VTYNL); 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, VTYNL, oa->name, VTYNL, VTYNL); 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, VTYNL, + oi->interface->name, oa->name, VTYNL, VTYNL); 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, VTYNL, VTYNL, VTYNL); ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb); - vty_out (vty, "%s", VNL); + vty_out (vty, "%s", VTYNL); 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, VTYNL, oa->name, VTYNL, VTYNL); 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, VTYNL, + oi->interface->name, oa->name, VTYNL, VTYNL); 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, VTYNL, VTYNL, VTYNL); 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, "%s", VTYNL); 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, VTYNL, oa->name, VTYNL, VTYNL); 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, VTYNL, + oi->interface->name, oa->name, VTYNL, VTYNL); 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, VTYNL, VTYNL, VTYNL); 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, "%s", VTYNL); 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, VTYNL, oa->name, VTYNL, VTYNL); 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, VTYNL, + oi->interface->name, oa->name, VTYNL, VTYNL); 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, VTYNL, VTYNL, VTYNL); 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, "%s", VTYNL); 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%s", argv[4]->arg, VTYNL); return CMD_SUCCESS; } @@ -1158,11 +1158,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); + VTYNL, oa->name, VTYNL, VTYNL); ospf6_linkstate_table_show (vty, idx_ipv4, argc, argv, oa->spf_table); } - vty_out (vty, "%s", VNL); + vty_out (vty, "%s", VTYNL); return CMD_SUCCESS; } @@ -1186,11 +1186,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); + VTYNL, oa->name, VTYNL, VTYNL); ospf6_linkstate_table_show (vty, idx_detail, argc, argv, oa->spf_table); } - vty_out (vty, "%s", VNL); + vty_out (vty, "%s", VTYNL); return CMD_SUCCESS; } From 6d3c2ed4edb863d108239132b3e01daf07024f65 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Thu, 13 Jul 2017 19:04:25 +0200 Subject: [PATCH 07/14] *: remove VTYNL, part 1 of 6 Signed-off-by: David Lamparter --- bgpd/bgp_damp.c | 4 +- bgpd/bgp_debug.c | 4 +- bgpd/bgp_filter.c | 2 +- bgpd/bgp_mplsvpn.c | 2 +- bgpd/bgp_nexthop.c | 2 +- bgpd/bgp_open.c | 2 +- bgpd/bgp_route.c | 36 ++++++------- bgpd/bgp_updgrp.c | 2 +- bgpd/bgp_vpn.c | 2 +- bgpd/bgpd.c | 20 ++++---- bgpd/rfapi/bgp_rfapi_cfg.c | 10 ++-- bgpd/rfapi/rfapi_vty.c | 18 +++---- bgpd/rfapi/vnc_debug.c | 2 +- bgpd/rfp-example/librfp/rfp_example.c | 2 +- isisd/isis_adjacency.c | 16 +++--- isisd/isis_circuit.c | 12 ++--- isisd/isis_lsp.c | 2 +- isisd/isis_redist.c | 4 +- isisd/isis_spf.c | 12 ++--- isisd/isis_te.c | 2 +- isisd/isisd.c | 18 +++---- ldpd/ldp_debug.c | 2 +- ldpd/ldp_vty_conf.c | 10 ++-- ldpd/ldp_vty_exec.c | 20 ++++---- lib/bfd.c | 2 +- lib/command.c | 16 +++--- lib/distribute.c | 8 +-- lib/filter.c | 10 ++-- lib/grammar_sandbox.c | 8 +-- lib/keychain.c | 4 +- lib/plist.c | 10 ++-- lib/thread.c | 2 +- lib/vty.c | 20 ++++---- nhrpd/nhrp_vty.c | 2 +- ospf6d/ospf6_top.c | 4 +- ospfd/ospf_apiserver.c | 2 +- ospfd/ospf_dump.c | 2 +- ospfd/ospf_vty.c | 6 +-- pimd/pim_cmd.c | 74 +++++++++++++-------------- pimd/pim_vty.c | 2 +- ripd/rip_interface.c | 2 +- ripd/ripd.c | 4 +- ripngd/ripngd.c | 8 +-- vtysh/vtysh.c | 4 +- zebra/interface.c | 16 +++--- zebra/redistribute.c | 2 +- zebra/rtadv.c | 2 +- zebra/zebra_mpls.c | 8 +-- zebra/zebra_vty.c | 8 +-- zebra/zserv.c | 6 +-- 50 files changed, 219 insertions(+), 219 deletions(-) diff --git a/bgpd/bgp_damp.c b/bgpd/bgp_damp.c index 80cd770451..d276de6eb4 100644 --- a/bgpd/bgp_damp.c +++ b/bgpd/bgp_damp.c @@ -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"); } } @@ -707,7 +707,7 @@ bgp_show_dampening_parameters (struct vty *vty, afi_t afi, safi_t safi) (long long)damp->max_suppress_time / 60); vty_out (vty, "Max supress penalty: %u\n", damp->ceiling); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } else vty_out (vty, "dampening not enabled for %s\n", diff --git a/bgpd/bgp_debug.c b/bgpd/bgp_debug.c index 23f49f2c70..b2c91c9136 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 @@ -1747,7 +1747,7 @@ DEFUN (show_debugging_bgp, if (BGP_DEBUG (allow_martians, ALLOW_MARTIANS)) vty_out (vty, " BGP allow martian next hop debugging is on\n"); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } diff --git a/bgpd/bgp_filter.c b/bgpd/bgp_filter.c index 9b11cd58b2..8968e22b08 100644 --- a/bgpd/bgp_filter.c +++ b/bgpd/bgp_filter.c @@ -538,7 +538,7 @@ DEFUN (no_ip_as_path, if (asfilter == NULL) { - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return CMD_WARNING; } diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c index 979ff6bfe5..0a4d589b86 100644 --- a/bgpd/bgp_mplsvpn.c +++ b/bgpd/bgp_mplsvpn.c @@ -703,7 +703,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; } diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c index 3b7f2e2fc7..e2d93e9f37 100644 --- a/bgpd/bgp_nexthop.c +++ b/bgpd/bgp_nexthop.c @@ -444,7 +444,7 @@ bgp_show_nexthops (struct vty *vty, struct bgp *bgp, int detail) } tbuf = time(NULL) - (bgp_clock() - bnc->last_update); vty_out (vty, " Last update: %s", ctime(&tbuf)); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } } diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c index 86befd3e84..d6ed441dfd 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 c7e26a0a67..b4bdab3161 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -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)) @@ -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 */ @@ -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 */ @@ -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) @@ -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) @@ -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) @@ -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,7 +7764,7 @@ 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" @@ -8249,7 +8249,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"); } } } @@ -9245,7 +9245,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; } @@ -10672,7 +10672,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; } @@ -10719,7 +10719,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) @@ -10794,7 +10794,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. */ @@ -10828,7 +10828,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; diff --git a/bgpd/bgp_updgrp.c b/bgpd/bgp_updgrp.c index fac446a79b..b8971dcd69 100644 --- a/bgpd/bgp_updgrp.c +++ b/bgpd/bgp_updgrp.c @@ -584,7 +584,7 @@ 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_out (vty, "\n"); vty_out (vty, " Update-subgroup %" PRIu64 ":\n", subgrp->id); vty_out (vty, " Created: %s", timestamp_string (subgrp->uptime)); diff --git a/bgpd/bgp_vpn.c b/bgpd/bgp_vpn.c index e829c9cf2b..e1fed31a11 100644 --- a/bgpd/bgp_vpn.c +++ b/bgpd/bgp_vpn.c @@ -170,7 +170,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; } diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index ca948b2f17..2dd81d4070 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -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 */ @@ -7016,7 +7016,7 @@ 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. */ @@ -7163,7 +7163,7 @@ 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. */ @@ -7191,7 +7191,7 @@ 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. */ @@ -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; } @@ -7416,7 +7416,7 @@ 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)) @@ -7487,7 +7487,7 @@ 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. */ @@ -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 */ @@ -7570,7 +7570,7 @@ 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. */ diff --git a/bgpd/rfapi/bgp_rfapi_cfg.c b/bgpd/rfapi/bgp_rfapi_cfg.c index 233734f14a..495765ba6b 100644 --- a/bgpd/rfapi/bgp_rfapi_cfg.c +++ b/bgpd/rfapi/bgp_rfapi_cfg.c @@ -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); } @@ -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 && @@ -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, @@ -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 && @@ -5031,7 +5031,7 @@ bgp_rfapi_show_summary (struct bgp *bgp, struct vty *vty) (hc->rfp_cfg.ftd_advertisement_interval == RFAPI_RFP_CFG_DEFAULT_FTD_ADVERTISEMENT_INTERVAL ? "(default)" : "")); 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_vty.c b/bgpd/rfapi/rfapi_vty.c index 9cb6ccbd97..2137aaad3c 100644 --- a/bgpd/rfapi/rfapi_vty.c +++ b/bgpd/rfapi/rfapi_vty.c @@ -2516,7 +2516,7 @@ register_add ( } vnc_zlog_debug_verbose ("%s: rfapi_register failed", __func__); - vty_out (vty, VTYNL); + 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"); @@ -4459,10 +4459,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 +4474,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,7 +4502,7 @@ 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; @@ -4616,7 +4616,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); @@ -4713,7 +4713,7 @@ rfapi_show_registrations ( } if (!printed) { - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } diff --git a/bgpd/rfapi/vnc_debug.c b/bgpd/rfapi/vnc_debug.c index 58b762a637..21627a20a5 100644 --- a/bgpd/rfapi/vnc_debug.c +++ b/bgpd/rfapi/vnc_debug.c @@ -173,7 +173,7 @@ DEFUN (show_debugging_bgp_vnc, vncdebug[i].name); } } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } diff --git a/bgpd/rfp-example/librfp/rfp_example.c b/bgpd/rfp-example/librfp/rfp_example.c index a0ba829087..451be7770c 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/isisd/isis_adjacency.c b/isisd/isis_adjacency.c index 513a3871ca..e4a4e0c426 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,13 +421,13 @@ 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_out (vty, " Topologies:\n"); @@ -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,7 +455,7 @@ 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) { @@ -480,7 +480,7 @@ isis_adj_print_vty (struct isis_adjacency *adj, struct vty *vty, char detail) 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 aeaedbe3e1..d07ea27c44 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,12 +894,12 @@ 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_out (vty, " Level-1 Information:\n"); @@ -928,7 +928,7 @@ isis_circuit_print_vty (struct isis_circuit *circuit, struct vty *vty, } else { - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } if (circuit->is_type & IS_LEVEL_2) @@ -959,7 +959,7 @@ isis_circuit_print_vty (struct isis_circuit *circuit, struct vty *vty, } else { - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } if (circuit->ip_addrs && listcount (circuit->ip_addrs) > 0) @@ -990,7 +990,7 @@ isis_circuit_print_vty (struct isis_circuit *circuit, struct vty *vty, } } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } return; } diff --git a/isisd/isis_lsp.c b/isisd/isis_lsp.c index c320ff79a0..ed376058b1 100644 --- a/isisd/isis_lsp.c +++ b/isisd/isis_lsp.c @@ -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_redist.c b/isisd/isis_redist.c index f4af3aef21..9846686ef1 100644 --- a/isisd/isis_redist.c +++ b/isisd/isis_redist.c @@ -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 a85cef6405..4b5592c159 100644 --- a/isisd/isis_spf.c +++ b/isisd/isis_spf.c @@ -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"); } } @@ -1409,7 +1409,7 @@ DEFUN (show_isis_topology, 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) @@ -1418,11 +1418,11 @@ DEFUN (show_isis_topology, "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 613fe8e4f0..47377bd7ae 100644 --- a/isisd/isis_te.c +++ b/isisd/isis_te.c @@ -974,7 +974,7 @@ show_vty_unknown_tlv (struct vty *vty, struct subtlv_header *tlvh) else rtn++; } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } else vty_out (vty, " Unknown TLV: [type(%#.2x), length(%#.2x)]\n", diff --git a/isisd/isisd.c b/isisd/isisd.c index 7436d9f93a..f64f98a7da 100644 --- a/isisd/isisd.c +++ b/isisd/isisd.c @@ -1374,7 +1374,7 @@ DEFUN (show_isis_summary, vty_out (vty, "Up time : "); vty_out_timestr(vty, isis->uptime); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); if (isis->area_list) vty_out (vty, "Number of areas : %d\n",isis->area_list->count); @@ -1409,12 +1409,12 @@ DEFUN (show_isis_summary, 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_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_out (vty, " last run duration : %u usec\n", (u_int32_t)spftree->last_run_duration); @@ -1427,7 +1427,7 @@ DEFUN (show_isis_summary, vty_out (vty, " last run elapsed : "); vty_out_timestr(vty, spftree->last_run_timestamp); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); vty_out (vty, " last run duration : %llu msec\n", (unsigned long long)spftree->last_run_duration); @@ -1436,7 +1436,7 @@ DEFUN (show_isis_summary, spftree->runcount); } } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -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,7 +2218,7 @@ isis_config_write (struct vty *vty) else vty_out(vty, "send-only"); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); write++; } diff --git a/ldpd/ldp_debug.c b/ldpd/ldp_debug.c index bf2de7b686..269b014068 100644 --- a/ldpd/ldp_debug.c +++ b/ldpd/ldp_debug.c @@ -127,7 +127,7 @@ ldp_vty_show_debugging(struct vty *vty) vty_out (vty," LDP messages debugging is on (outbound)\n"); if (LDP_DEBUG(zebra, ZEBRA)) vty_out (vty, " LDP zebra debugging is on\n"); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return (CMD_SUCCESS); } diff --git a/ldpd/ldp_vty_conf.c b/ldpd/ldp_vty_conf.c index 753ac802db..0443d62ca8 100644 --- a/ldpd/ldp_vty_conf.c +++ b/ldpd/ldp_vty_conf.c @@ -155,7 +155,7 @@ 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 && @@ -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,7 +214,7 @@ 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) diff --git a/ldpd/ldp_vty_exec.c b/ldpd/ldp_vty_exec.c index 368edebe59..476b9b1735 100644 --- a/ldpd/ldp_vty_exec.c +++ b/ldpd/ldp_vty_exec.c @@ -135,7 +135,7 @@ show_interface_msg(struct vty *vty, struct imsg *imsg, iface->adj_cnt); break; case IMSG_CTL_END: - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return (1); default: break; @@ -217,7 +217,7 @@ show_discovery_msg(struct vty *vty, struct imsg *imsg, vty_out (vty, "%9u\n", adj->holdtime); break; case IMSG_CTL_END: - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return (1); default: break; @@ -326,7 +326,7 @@ show_discovery_detail_msg(struct vty *vty, struct imsg *imsg, vty_out(vty, "%s", ifaces_buffer); vty_out (vty, " Targeted Hellos:\n"); vty_out(vty, "%s", tnbrs_buffer); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return (1); default: break; @@ -620,7 +620,7 @@ show_nbr_detail_msg(struct vty *vty, struct imsg *imsg, 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); @@ -898,10 +898,10 @@ show_nbr_capabilities_msg(struct vty *vty, struct imsg *imsg, struct show_params 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; @@ -1027,7 +1027,7 @@ show_lib_msg(struct vty *vty, struct imsg *imsg, struct show_params *params) rt->in_use ? "yes" : "no"); break; case IMSG_CTL_END: - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return (1); default: break; @@ -1099,7 +1099,7 @@ show_lib_detail_msg(struct vty *vty, struct imsg *imsg, struct show_params *para vty_out (vty, "%-8sNo remote bindings\n",""); break; case IMSG_CTL_END: - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return (1); default: break; @@ -1261,7 +1261,7 @@ show_l2vpn_binding_msg(struct vty *vty, struct imsg *imsg, vty_out (vty," Remote Label: unassigned\n"); break; case IMSG_CTL_END: - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return (1); default: break; @@ -1345,7 +1345,7 @@ show_l2vpn_pw_msg(struct vty *vty, struct imsg *imsg, struct show_params *params (pw->status ? "UP" : "DOWN")); break; case IMSG_CTL_END: - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return (1); default: break; diff --git a/lib/bfd.c b/lib/bfd.c index f429ef3e7a..4fbb93ebd4 100644 --- a/lib/bfd.c +++ b/lib/bfd.c @@ -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/command.c b/lib/command.c index fb560cb614..ad197468a5 100644 --- a/lib/command.c +++ b/lib/command.c @@ -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,7 +472,7 @@ 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) @@ -487,7 +487,7 @@ 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) @@ -1421,7 +1421,7 @@ permute (struct graph_node *start, struct vty *vty) } if (gn == start) vty_out (vty, "..."); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } else { @@ -2012,7 +2012,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) @@ -2020,7 +2020,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) @@ -2028,7 +2028,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) || @@ -2038,7 +2038,7 @@ 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_out (vty, "Protocol name: %s\n", zl->protoname); diff --git a/lib/distribute.c b/lib/distribute.c index 8bf961e97e..691b67e83f 100644 --- a/lib/distribute.c +++ b/lib/distribute.c @@ -393,7 +393,7 @@ config_show_distribute (struct vty *vty) DISTRIBUTE_V6_OUT, has_print); } if (has_print) - vty_out (vty, VTYNL); + vty_out (vty, "\n"); else vty_out (vty, " not set\n"); @@ -414,7 +414,7 @@ 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_out (vty, " nothing\n"); } @@ -437,7 +437,7 @@ config_show_distribute (struct vty *vty) DISTRIBUTE_V6_IN, has_print); } if (has_print) - vty_out (vty, VTYNL); + vty_out (vty, "\n"); else vty_out (vty, " not set\n"); @@ -458,7 +458,7 @@ 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_out (vty, " nothing\n"); } diff --git a/lib/filter.c b/lib/filter.c index ae4b0b3b0c..9967308f66 100644 --- a/lib/filter.c +++ b/lib/filter.c @@ -1727,7 +1727,7 @@ filter_show (struct vty *vty, const char *name, afi_t afi) 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"); } } } @@ -1770,7 +1770,7 @@ filter_show (struct vty *vty, const char *name, afi_t afi) 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,7 +1855,7 @@ 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 { @@ -1866,7 +1866,7 @@ config_write_access_cisco (struct vty *vty, struct filter *mfilter) 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 diff --git a/lib/grammar_sandbox.c b/lib/grammar_sandbox.c index c3e1898f10..edf55fba99 100644 --- a/lib/grammar_sandbox.c +++ b/lib/grammar_sandbox.c @@ -418,14 +418,14 @@ DEFUN (grammar_findambig, prev->el->string); vty_out (vty, " %s%s '%s'\n", cur->el->name, VTYNL, 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_out (vty, "%d ambiguous commands found.\n", ambig); @@ -543,7 +543,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); @@ -569,7 +569,7 @@ pretty_print_graph (struct vty *vty, struct graph_node *start, int level, } } else - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } static void diff --git a/lib/keychain.c b/lib/keychain.c index aaa8178c88..9b7b0877e4 100644 --- a/lib/keychain.c +++ b/lib/keychain.c @@ -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,7 +1007,7 @@ 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_out (vty, "!\n"); diff --git a/lib/plist.c b/lib/plist.c index 9f20a412e9..3a9d26064d 100644 --- a/lib/plist.c +++ b/lib/plist.c @@ -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"); } } } @@ -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; @@ -1858,7 +1858,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++; } /* vty_out (vty, "!%s", VTYNL); */ @@ -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++; } } @@ -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/thread.c b/lib/thread.c index 10727dd078..df524d4aed 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -147,7 +147,7 @@ cpu_record_print(struct vty *vty, thread_type filter) memset (underline, '-', sizeof (underline)); underline[sizeof(underline)] = '\0'; - vty_out (vty, VTYNL); + 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):"); diff --git a/lib/vty.c b/lib/vty.c index 8ff8280d48..0c7a5524c9 100644 --- a/lib/vty.c +++ b/lib/vty.c @@ -714,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; @@ -724,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) { @@ -929,7 +929,7 @@ vty_complete_command (struct vty *vty) cmd_free_strvec (vline); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); switch (ret) { case CMD_ERR_AMBIGUOUS: @@ -969,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); @@ -1052,7 +1052,7 @@ 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) @@ -1125,7 +1125,7 @@ vty_describe_command (struct vty *vty) vty_out(vty, " %s", item); XFREE(MTYPE_COMPLETION, item); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } vector_free(varcomps); } @@ -1170,7 +1170,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) { @@ -1294,7 +1294,7 @@ vty_telnet_option (struct vty *vty, unsigned char *buf, int nbytes) break; } } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); #endif /* TELNET_OPTION_DEBUG */ @@ -1590,7 +1590,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': diff --git a/nhrpd/nhrp_vty.c b/nhrpd/nhrp_vty.c index ba1ef7ece3..a11d109f39 100644 --- a/nhrpd/nhrp_vty.c +++ b/nhrpd/nhrp_vty.c @@ -868,7 +868,7 @@ 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_out (vty, " tunnel source %s\n", diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c index f5abead8cf..fd91410fa9 100644 --- a/ospf6d/ospf6_top.c +++ b/ospf6d/ospf6_top.c @@ -859,7 +859,7 @@ ospf6_show (struct vty *vty, struct ospf6 *o) 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); @@ -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)) diff --git a/ospfd/ospf_apiserver.c b/ospfd/ospf_apiserver.c index c2e158931e..2b72abcd75 100644 --- a/ospfd/ospf_apiserver.c +++ b/ospfd/ospf_apiserver.c @@ -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_dump.c b/ospfd/ospf_dump.c index 7d0c9d6baf..61b4a2ff14 100644 --- a/ospfd/ospf_dump.c +++ b/ospfd/ospf_dump.c @@ -1653,7 +1653,7 @@ show_debugging_ospf_common (struct vty *vty, struct ospf *ospf) if (IS_DEBUG_OSPF (nssa, NSSA) == OSPF_DEBUG_NSSA) vty_out (vty, " OSPF NSSA debugging is on\n"); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index b2f9b21f40..b0405f098a 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -4726,7 +4726,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; @@ -4788,7 +4788,7 @@ 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_out (vty, " LS Type: %s\n", lookup_msg(ospf_lsa_type_msg, lsa->data->type, NULL)); @@ -8362,7 +8362,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. */ diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index 85e276aa09..a69e617b44 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -505,8 +505,8 @@ static void pim_print_ifp_flags(struct vty *vty, struct interface *ifp, int mloo 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) @@ -665,8 +665,8 @@ static void igmp_show_interfaces_single(struct vty *vty, const char *ifname, u_c inet_ntoa(pim_ifp->primary_address)); vty_out (vty, "Uptime : %s\n", uptime); vty_out (vty, "Version : %d\n", pim_ifp->igmp_version); - vty_out (vty, VTYNL); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); + vty_out (vty, "\n"); vty_out (vty, "Querier\n"); vty_out (vty, "-------\n"); @@ -675,8 +675,8 @@ static void igmp_show_interfaces_single(struct vty *vty, const char *ifname, u_c 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, VTYNL); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); + vty_out (vty, "\n"); vty_out (vty, "Timers\n"); vty_out (vty, "------\n"); @@ -695,8 +695,8 @@ static void igmp_show_interfaces_single(struct vty *vty, const char *ifname, u_c vty_out (vty, "Robustness Variable : %d\n", igmp->querier_robustness_variable); vty_out (vty, "Startup Query Interval : %ds\n", sqi); - vty_out (vty, VTYNL); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); + vty_out (vty, "\n"); pim_print_ifp_flags(vty, ifp, mloop); } @@ -941,7 +941,7 @@ static void pim_show_interfaces_single(struct vty *vty, const char *ifname, u_ch } else { vty_out (vty, "Address : %s\n", inet_ntoa(ifaddr)); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); // PIM neighbors print_header = 1; @@ -962,8 +962,8 @@ static void pim_show_interfaces_single(struct vty *vty, const char *ifname, u_ch } if (!print_header) { - vty_out (vty, VTYNL); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); + vty_out (vty, "\n"); } vty_out (vty, "Designated Router\n"); @@ -973,8 +973,8 @@ static void pim_show_interfaces_single(struct vty *vty, const char *ifname, u_ch 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, VTYNL); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); + vty_out (vty, "\n"); // FHR print_header = 1; @@ -998,8 +998,8 @@ static void pim_show_interfaces_single(struct vty *vty, const char *ifname, u_ch } if (!print_header) { - vty_out (vty, VTYNL); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); + vty_out (vty, "\n"); } vty_out (vty, "Hellos\n"); @@ -1014,8 +1014,8 @@ static void pim_show_interfaces_single(struct vty *vty, const char *ifname, u_ch vty_out (vty, "Send Failed : %d\n", pim_ifp->pim_ifstat_hello_sendfail); vty_out (vty, "Generation ID : %08x\n", pim_ifp->pim_generation_id); - vty_out (vty, VTYNL); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); + vty_out (vty, "\n"); pim_print_ifp_flags(vty, ifp, mloop); @@ -1029,8 +1029,8 @@ static void pim_show_interfaces_single(struct vty *vty, const char *ifname, u_ch pim_if_effective_override_interval_msec(ifp)); 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_out (vty, "LAN Prune Delay\n"); vty_out (vty, "---------------\n"); @@ -1042,8 +1042,8 @@ static void pim_show_interfaces_single(struct vty *vty, const char *ifname, u_ch pim_ifp->pim_override_interval_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"); } } @@ -1153,7 +1153,7 @@ static void pim_show_interface_traffic (struct vty *vty, u_char uj) json = json_object_new_object (); else { - vty_out (vty, VTYNL); + vty_out (vty, "\n"); vty_out (vty, "%-12s%-17s%-17s%-17s%-17s%-17s%-17s\n", "Interface", " HELLO", " JOIN", " PRUNE", " REGISTER", " REGISTER-STOP", " ASSERT"); @@ -1227,7 +1227,7 @@ static void pim_show_interface_traffic_single (struct vty *vty, const char *ifna json = json_object_new_object (); else { - vty_out (vty, VTYNL); + vty_out (vty, "\n"); vty_out (vty, "%-12s%-17s%-17s%-17s%-17s%-17s%-17s\n", "Interface", " HELLO", " JOIN", " PRUNE", " REGISTER", " REGISTER-STOP", " ASSERT"); @@ -1537,7 +1537,7 @@ static void pim_show_neighbors_single(struct vty *vty, const char *neighbor, u_c 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"); } } } @@ -1690,7 +1690,7 @@ 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"); } @@ -1699,7 +1699,7 @@ pim_show_state(struct vty *vty, const char *src_or_group, const char *group, u_c 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"); } } @@ -2200,7 +2200,7 @@ 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_out (vty, "\n"); vty_out (vty, "Source Group RpfIface RpfAddress RibNextHop Metric Pref\n"); } @@ -2277,7 +2277,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; } @@ -3196,7 +3196,7 @@ static void show_multicast_interfaces(struct vty *vty) struct listnode *node; struct interface *ifp; - vty_out (vty, VTYNL); + vty_out (vty, "\n"); vty_out (vty, "Interface Address ifi Vif PktsIn PktsOut BytesIn BytesOut\n"); @@ -3256,16 +3256,16 @@ DEFUN (show_ip_multicast, 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_out (vty, "\n"); vty_out (vty, "Maximum highest VifIndex: %d\n", PIM_MAX_USABLE_VIFS); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); vty_out (vty, "Upstream Join Timer: %d secs\n", qpim_t_periodic); vty_out (vty, "Join/Prune Holdtime: %d secs\n", @@ -3275,11 +3275,11 @@ DEFUN (show_ip_multicast, 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); @@ -3587,7 +3587,7 @@ 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_out (vty, "Source Group LastUsed Packets Bytes WrongIf \n"); @@ -6515,7 +6515,7 @@ ip_msdp_show_peers_detail(struct vty *vty, const char *peer, u_char uj) mp->ka_tx_cnt, mp->ka_rx_cnt); vty_out (vty, " SAs : %10d %10d\n", mp->sa_tx_cnt, mp->sa_rx_cnt); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } @@ -6684,7 +6684,7 @@ ip_msdp_show_sa_entry_detail(struct pim_msdp_sa *sa, const char *src_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, VTYNL); + vty_out (vty, "\n"); } } diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c index ccfd446969..81b49c630c 100644 --- a/pimd/pim_vty.c +++ b/pimd/pim_vty.c @@ -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 */ diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c index d713fe6fe4..bff8a4ce2c 100644 --- a/ripd/rip_interface.c +++ b/ripd/rip_interface.c @@ -1882,7 +1882,7 @@ 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) diff --git a/ripd/ripd.c b/ripd/ripd.c index e590d48392..5bbab7e4cd 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -3534,7 +3534,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; } @@ -3576,7 +3576,7 @@ DEFUN (show_ip_rip_status, /* 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)); diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c index 2519b75f4d..4b5567f770 100644 --- a/ripngd/ripngd.c +++ b/ripngd/ripngd.c @@ -2026,7 +2026,7 @@ 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, " "); @@ -2051,7 +2051,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 +2089,7 @@ DEFUN (show_ipv6_ripng, ripng_vty_out_uptime (vty, rinfo); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } @@ -2128,7 +2128,7 @@ DEFUN (show_ipv6_ripng_status, /* 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_out (vty, " receive version %d \n",ripng->version); diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 794708683f..02606b88a9 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -815,7 +815,7 @@ vtysh_rl_describe (void) fprintf (stdout, " %s", item); XFREE (MTYPE_COMPLETION, item); } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } vector_free (varcomps); } @@ -2832,7 +2832,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/zebra/interface.c b/zebra/interface.c index 291a792748..550f6fc247 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) @@ -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)) @@ -1144,7 +1144,7 @@ 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_out (vty, " Link Delay Variation %u (micro-sec.)\n", @@ -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"); } } @@ -2767,7 +2767,7 @@ 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_out (vty, " delay-variation %u\n", iflp->delay_var); @@ -2844,7 +2844,7 @@ if_config_write (struct vty *vty) if (ifc->label) vty_out (vty, " label %s", ifc->label); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } } diff --git a/zebra/redistribute.c b/zebra/redistribute.c index 1b34e46ec4..a82c57b603 100644 --- a/zebra/redistribute.c +++ b/zebra/redistribute.c @@ -698,7 +698,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/rtadv.c b/zebra/rtadv.c index 1ba8dd7d1f..c4fe4ac84e 100644 --- a/zebra/rtadv.c +++ b/zebra/rtadv.c @@ -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_mpls.c b/zebra/zebra_mpls.c index d78c1629be..3c8503878c 100644 --- a/zebra/zebra_mpls.c +++ b/zebra/zebra_mpls.c @@ -534,14 +534,14 @@ fec_print (zebra_fec_t *fec, struct vty *vty) 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"); } } @@ -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"); } /* @@ -2875,7 +2875,7 @@ zebra_mpls_print_lsp_table (struct vty *vty, struct zebra_vrf *zvrf, } } - vty_out (vty, VTYNL); + vty_out (vty, "\n"); } list_delete (lsp_list); diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 1da288cca0..3810cc8dd1 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -1627,7 +1627,7 @@ vty_show_ip_route_summary (struct vty *vty, struct route_table *table) 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"); } /* @@ -1705,7 +1705,7 @@ vty_show_ip_route_summary_prefix (struct vty *vty, struct route_table *table) 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. */ @@ -1958,7 +1958,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; } @@ -3040,7 +3040,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"); } diff --git a/zebra/zserv.c b/zebra/zserv.c index a89f4f5915..d64ce81557 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -2676,7 +2676,7 @@ 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_out (vty, "------------------------ \n"); vty_out (vty, "FD: %d \n", client->sock); @@ -2707,7 +2707,7 @@ zebra_show_client_detail (struct vty *vty, struct zserv *client) if (client->last_write_time) vty_out (vty, "Last Sent Cmd: %s \n", zserv_command_string(client->last_write_cmd)); - vty_out (vty, VTYNL); + vty_out (vty, "\n"); vty_out (vty, "Type Add Update Del \n"); vty_out (vty, "================================================== \n"); @@ -2726,7 +2726,7 @@ zebra_show_client_detail (struct vty *vty, struct zserv *client) 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; } From 26a429fe8e49c67a375886a99a3687417379d19e Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Thu, 13 Jul 2017 19:12:39 +0200 Subject: [PATCH 08/14] *: remove VTYNL, part 2 of 6 Signed-off-by: David Lamparter --- bgpd/bgp_vty.c | 348 +++++++++++++++++------------------ bgpd/rfapi/bgp_rfapi_cfg.c | 14 +- lib/if.c | 3 +- lib/plist.c | 2 +- lib/smux.c | 2 +- lib/vrf.c | 3 +- lib/vty.c | 2 +- ospf6d/ospf6_abr.c | 2 +- ospf6d/ospf6_area.c | 4 +- ospf6d/ospf6_asbr.c | 10 +- ospf6d/ospf6_flood.c | 2 +- ospf6d/ospf6_interface.c | 20 +- ospf6d/ospf6_intra.c | 2 +- ospf6d/ospf6_lsa.c | 10 +- ospf6d/ospf6_message.c | 12 +- ospf6d/ospf6_neighbor.c | 6 +- ospf6d/ospf6_route.c | 12 +- ospf6d/ospf6_spf.c | 8 +- ospf6d/ospf6_top.c | 12 +- ospf6d/ospf6_zebra.c | 22 +-- ospf6d/ospf6d.c | 34 ++-- ospf6d/ospf6d.h | 2 +- ospfd/ospf_vty.c | 361 ++++++++++++++++--------------------- ospfd/ospf_vty.h | 4 +- ripngd/ripngd.c | 8 +- zebra/debug.c | 38 ++-- zebra/zebra_rnh.c | 4 +- zebra/zebra_vty.c | 10 +- 28 files changed, 442 insertions(+), 515 deletions(-) diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 4aa9922bab..59fec7fb8a 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -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; } @@ -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; } @@ -737,7 +733,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 +790,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; } return CMD_SUCCESS; @@ -875,13 +871,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; } 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; } } @@ -906,14 +902,13 @@ 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; case BGP_ERR_AS_MISMATCH: vty_out (vty, "BGP is already running; AS is %u%s", as, VTYNL); return CMD_WARNING; case BGP_ERR_INSTANCE_MISMATCH: - vty_out (vty, "BGP instance name and AS number mismatch%s", VTYNL); + vty_out (vty, "BGP instance name and AS number mismatch\n"); vty_out (vty, "BGP instance is already running; AS is %u%s", as, VTYNL); return CMD_WARNING; @@ -951,13 +946,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; } 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; } } @@ -972,7 +967,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; } } @@ -1041,7 +1036,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; } @@ -1120,8 +1115,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; } @@ -1326,8 +1320,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; } @@ -1356,7 +1349,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; @@ -1597,7 +1590,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 +1618,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; } @@ -1760,8 +1752,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; } else @@ -2454,7 +2445,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; } @@ -2462,8 +2453,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; } @@ -2486,15 +2476,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; } 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; } @@ -2530,7 +2519,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; } @@ -2538,8 +2527,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; } @@ -2548,7 +2536,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; } @@ -2651,8 +2639,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; } return CMD_SUCCESS; @@ -2662,8 +2649,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; } ret = peer_remote_as (bgp, &su, NULL, &as, as_type, afi, safi); @@ -2714,7 +2700,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; } @@ -2794,7 +2780,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; } @@ -2896,7 +2882,7 @@ 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; } @@ -2945,7 +2931,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; } } @@ -2956,8 +2942,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; } @@ -3001,7 +2986,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; } return CMD_SUCCESS; @@ -3024,7 +3009,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; } return CMD_SUCCESS; @@ -3059,7 +3044,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; } return CMD_SUCCESS; @@ -3333,8 +3318,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; } @@ -3342,8 +3326,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; } } @@ -3351,7 +3334,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; } @@ -3397,7 +3380,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; } @@ -4637,8 +4620,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; } else @@ -6291,7 +6273,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; } } @@ -6300,7 +6282,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; } @@ -6526,11 +6508,11 @@ 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. */ @@ -6564,7 +6546,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; } @@ -6890,7 +6872,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)) @@ -6934,7 +6916,7 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi, { 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, " Delay in progress\n"); } else { @@ -6982,9 +6964,9 @@ 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); @@ -7010,13 +6992,13 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi, VTYNL); 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"); } } @@ -7111,7 +7093,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"); } } } @@ -7143,7 +7125,7 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int 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); @@ -7185,7 +7167,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) @@ -7208,7 +7190,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; @@ -7236,9 +7218,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 @@ -7251,7 +7233,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)) { @@ -7260,7 +7242,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; @@ -7278,7 +7260,7 @@ bgp_show_all_instances_summary_vty (struct vty *vty, afi_t afi, safi_t safi, } if (use_json) - vty_out (vty, "}%s", VTYNL); + vty_out (vty, "}\n"); } @@ -7302,9 +7284,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; } @@ -7455,7 +7437,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"); } } @@ -7481,7 +7463,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"); } } } @@ -7702,7 +7684,7 @@ bgp_show_peer_afi (struct vty *vty, struct peer *p, afi_t afi, safi_t safi, } 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) @@ -7710,7 +7692,7 @@ 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) @@ -7750,45 +7732,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)) @@ -7797,13 +7779,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)) { @@ -7814,22 +7796,22 @@ 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) @@ -7898,10 +7880,10 @@ bgp_show_peer_afi (struct vty *vty, struct peer *p, afi_t afi, safi_t safi, 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"); } } @@ -7988,9 +7970,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 @@ -8005,9 +7987,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"); } } @@ -8158,7 +8140,7 @@ 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"); @@ -8169,7 +8151,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js /* 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)); @@ -8184,7 +8166,7 @@ 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)); @@ -8430,7 +8412,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) @@ -8442,14 +8424,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++) @@ -8465,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_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) || @@ -8479,7 +8461,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"); } } } @@ -8494,7 +8476,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 */ @@ -8507,7 +8489,7 @@ 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)) { @@ -8535,7 +8517,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 */ @@ -8548,7 +8530,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 */ @@ -8561,7 +8543,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 */ @@ -8574,7 +8556,7 @@ 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)) { @@ -8596,7 +8578,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"); } } } @@ -8659,7 +8641,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: "); @@ -8675,7 +8657,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++) { @@ -8689,7 +8671,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"); } if (p->t_gr_restart) @@ -8727,10 +8709,10 @@ 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, " Message statistics:\n"); + vty_out (vty, " Inq depth is 0\n"); vty_out (vty, " Outq depth is %lu%s", (unsigned long) p->obuf->count, VTYNL); - vty_out (vty, " Sent Rcvd%s", VTYNL); + vty_out (vty, " Sent Rcvd\n"); 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); @@ -8771,10 +8753,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 */ @@ -8803,7 +8785,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, "lastReset", "never"); else - vty_out (vty, " Last reset never%s", VTYNL); + vty_out (vty, " Last reset never\n"); } else { @@ -8900,7 +8882,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"); } } } @@ -8910,7 +8892,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) { @@ -9074,7 +9056,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js p->v_routeadv, thread_timer_remain_second (p->t_routeadv), VTYNL); 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", p->t_read ? "on" : "off", @@ -9087,7 +9069,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); @@ -9146,7 +9128,7 @@ 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) @@ -9156,7 +9138,7 @@ bgp_show_neighbor (struct vty *vty, struct bgp *bgp, enum show_type type, } else { - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } return CMD_SUCCESS; @@ -9171,7 +9153,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)) { @@ -9194,7 +9176,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; @@ -9213,7 +9195,7 @@ bgp_show_all_instances_neighbors_vty (struct vty *vty, u_char use_json) } if (use_json) - vty_out (vty, "}%s", VTYNL); + vty_out (vty, "}\n"); } static int @@ -9245,7 +9227,7 @@ bgp_show_neighbor_vty (struct vty *vty, const char *name, 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; } @@ -9335,7 +9317,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; } @@ -9361,7 +9343,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 *)) @@ -9390,7 +9372,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 *)) @@ -9818,9 +9800,9 @@ bgp_show_one_peer_group (struct vty *vty, struct peer_group *group) } 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:"); @@ -9834,9 +9816,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++) @@ -9867,7 +9849,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)) @@ -9920,7 +9902,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; } @@ -9939,7 +9921,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; } @@ -9984,7 +9966,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; } bgp_redist_add(bgp, AFI_IP, type, 0); @@ -10014,7 +9996,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; } @@ -10049,7 +10031,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; } metric = strtoul(argv[idx_number]->arg, NULL, 10); @@ -10088,7 +10070,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; } metric = strtoul(argv[idx_number]->arg, NULL, 10); @@ -10130,7 +10112,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; } metric = strtoul(argv[idx_number]->arg, NULL, 10); @@ -10420,7 +10402,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; } return bgp_redistribute_unset (bgp, AFI_IP, type, 0); @@ -10450,7 +10432,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; } @@ -10475,7 +10457,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; } @@ -10502,7 +10484,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; } metric = strtoul(argv[idx_number]->arg, NULL, 10); @@ -10533,7 +10515,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; } metric = strtoul(argv[idx_number]->arg, NULL, 10); @@ -10565,7 +10547,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; } metric = strtoul(argv[idx_number]->arg, NULL, 10); @@ -10594,7 +10576,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; } @@ -10637,7 +10619,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"); } } } @@ -11801,16 +11783,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; } } @@ -12047,7 +12029,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; } @@ -12079,7 +12061,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; } @@ -12391,7 +12373,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; } @@ -12628,7 +12610,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; } diff --git a/bgpd/rfapi/bgp_rfapi_cfg.c b/bgpd/rfapi/bgp_rfapi_cfg.c index 495765ba6b..90d195d50f 100644 --- a/bgpd/rfapi/bgp_rfapi_cfg.c +++ b/bgpd/rfapi/bgp_rfapi_cfg.c @@ -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; } @@ -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; } @@ -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; } } @@ -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)); } @@ -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; } @@ -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; } rfg->name = strdup (argv[1]->arg); @@ -4296,7 +4296,7 @@ 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 { diff --git a/lib/if.c b/lib/if.c index d694067816..e6a957a958 100644 --- a/lib/if.c +++ b/lib/if.c @@ -745,8 +745,7 @@ DEFUN_NOSH (no_interface, 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; } diff --git a/lib/plist.c b/lib/plist.c index 3a9d26064d..0c04b6247e 100644 --- a/lib/plist.c +++ b/lib/plist.c @@ -1861,7 +1861,7 @@ config_write_prefix_afi (afi_t afi, struct vty *vty) vty_out (vty, "\n"); write++; } - /* vty_out (vty, "!%s", VTYNL); */ + /* vty_out (vty, "!\n"); */ } for (plist = master->str.head; plist; plist = plist->next) diff --git a/lib/smux.c b/lib/smux.c index f8bf01e289..64b406bd67 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; } diff --git a/lib/vrf.c b/lib/vrf.c index 6af3ccc61b..7fe5d9a87d 100644 --- a/lib/vrf.c +++ b/lib/vrf.c @@ -507,8 +507,7 @@ DEFUN_NOSH (no_vrf, 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; } diff --git a/lib/vty.c b/lib/vty.c index 0c7a5524c9..db0fbdd6d4 100644 --- a/lib/vty.c +++ b/lib/vty.c @@ -938,7 +938,7 @@ vty_complete_command (struct vty *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; diff --git a/ospf6d/ospf6_abr.c b/ospf6d/ospf6_abr.c index 4048acbd61..b1f2401d58 100644 --- a/ospf6d/ospf6_abr.c +++ b/ospf6d/ospf6_abr.c @@ -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", VTYNL); + vty_out (vty, "debug ospf6 abr\n"); return 0; } diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c index c1222a2c2e..7ee5c9b6e4 100644 --- a/ospf6d/ospf6_area.c +++ b/ospf6d/ospf6_area.c @@ -389,7 +389,7 @@ ospf6_area_show (struct vty *vty, struct ospf6_area *oa) 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", VTYNL); + vty_out (vty, "\n"); if (oa->ts_spf.tv_sec || oa->ts_spf.tv_usec) { @@ -583,7 +583,7 @@ 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", VTYNL); + vty_out (vty, "\n"); } if (IS_AREA_STUB (oa)) diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c index 6c50f7040f..57b1e94815 100644 --- a/ospf6d/ospf6_asbr.c +++ b/ospf6d/ospf6_asbr.c @@ -789,7 +789,7 @@ ospf6_redistribute_show_config (struct vty *vty) total++; } - vty_out (vty, "Redistributing External Routes from:%s", VTYNL); + vty_out (vty, "Redistributing External Routes from:\n"); for (type = 0; type < ZEBRA_ROUTE_MAX; type++) { if (type == ZEBRA_ROUTE_OSPF6) @@ -1082,13 +1082,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", VTYNL); + vty_out (vty, "OSPF6 Can't find rule.\n"); break; case RMAP_COMPILE_ERROR: - vty_out (vty, "OSPF6 Argument is malformed.%s", VTYNL); + vty_out (vty, "OSPF6 Argument is malformed.\n"); break; default: - vty_out (vty, "OSPF6 route-map add set failed.%s", VTYNL); + vty_out (vty, "OSPF6 route-map add set failed.\n"); break; } return CMD_WARNING; @@ -1399,7 +1399,7 @@ int config_write_ospf6_debug_asbr (struct vty *vty) { if (IS_OSPF6_DEBUG_ASBR) - vty_out (vty, "debug ospf6 asbr%s", VTYNL); + vty_out (vty, "debug ospf6 asbr\n"); return 0; } diff --git a/ospf6d/ospf6_flood.c b/ospf6d/ospf6_flood.c index 8434795257..f816c6f48d 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", VTYNL); + vty_out (vty, "debug ospf6 flooding\n"); return 0; } diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index 29cfe12c7c..c5026e2f77 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -924,13 +924,13 @@ ospf6_interface_show (struct vty *vty, struct interface *ifp) if (ifp->info == NULL) { - vty_out (vty, " OSPF not enabled on this interface%s", VTYNL); + 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", VTYNL); + vty_out (vty, " Internet Address:\n"); for (ALL_LIST_ELEMENTS_RO (ifp->connected, i, c)) { @@ -965,13 +965,13 @@ ospf6_interface_show (struct vty *vty, struct interface *ifp) VTYNL); } else - vty_out (vty, " Not Attached to Area%s", VTYNL); + vty_out (vty, " Not Attached to Area\n"); vty_out (vty, " State %s, Transmit Delay %d sec, Priority %d%s", ospf6_interface_state_str[oi->state], oi->transdelay, oi->priority, VTYNL); - vty_out (vty, " Timer intervals configured:%s", VTYNL); + vty_out (vty, " Timer intervals configured:\n"); vty_out (vty, " Hello %d, Dead %d, Retransmit %d%s", oi->hello_interval, oi->dead_interval, oi->rxmt_interval, VTYNL); @@ -1810,22 +1810,22 @@ config_write_ospf6_interface (struct vty *vty) oi->plist_name, VTYNL); if (CHECK_FLAG (oi->flag, OSPF6_INTERFACE_PASSIVE)) - vty_out (vty, " ipv6 ospf6 passive%s", VTYNL); + vty_out (vty, " ipv6 ospf6 passive\n"); if (oi->mtu_ignore) - vty_out (vty, " ipv6 ospf6 mtu-ignore%s", VTYNL); + 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", VTYNL); + 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", VTYNL); + vty_out (vty, " ipv6 ospf6 network broadcast\n"); } ospf6_bfd_write_config(vty, oi); - vty_out (vty, "!%s", VTYNL); + vty_out (vty, "!\n"); } return 0; } @@ -1966,7 +1966,7 @@ int config_write_ospf6_debug_interface (struct vty *vty) { if (IS_OSPF6_DEBUG_INTERFACE) - vty_out (vty, "debug ospf6 interface%s", VTYNL); + vty_out (vty, "debug ospf6 interface\n"); return 0; } diff --git a/ospf6d/ospf6_intra.c b/ospf6d/ospf6_intra.c index a693e8bd04..2f4e06e1e3 100644 --- a/ospf6d/ospf6_intra.c +++ b/ospf6d/ospf6_intra.c @@ -1793,7 +1793,7 @@ config_write_ospf6_debug_brouter (struct vty *vty) { char buf[16]; if (IS_OSPF6_DEBUG_BROUTER) - vty_out (vty, "debug ospf6 border-routers%s", VTYNL); + 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, diff --git a/ospf6d/ospf6_lsa.c b/ospf6d/ospf6_lsa.c index 401d29c57b..90ba0dc74f 100644 --- a/ospf6d/ospf6_lsa.c +++ b/ospf6d/ospf6_lsa.c @@ -54,7 +54,7 @@ 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", VTYNL); + vty_out (vty, " Unknown contents:\n"); for (current = start; current < end; current ++) { if ((current - start) % 16 == 0) @@ -445,7 +445,7 @@ 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", VTYNL); + vty_out (vty, "\n"); vty_out (vty, "%s:%s", lsa->name, VTYNL); for (current = start; current < end; current ++) @@ -474,7 +474,7 @@ 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", VTYNL); + vty_out (vty, "\n"); vty_out (vty, "Age: %4hu Type: %s%s", ospf6_lsa_age_current (lsa), ospf6_lstype_name (lsa->header->type), VTYNL); vty_out (vty, "Link State ID: %s%s", id, VTYNL); @@ -489,7 +489,7 @@ ospf6_lsa_show_internal (struct vty *vty, struct ospf6_lsa *lsa) vty_out (vty, "ReTx Count: %d%s", lsa->retrans_count, VTYNL); vty_out (vty, "Threads: Expire: 0x%p, Refresh: 0x%p %s", (void *)lsa->expire, (void *)lsa->refresh, VTYNL); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return; } @@ -527,7 +527,7 @@ ospf6_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) handler = &unknown_handler; (*handler->show) (vty, lsa); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } /* OSPFv3 LSA creation/deletion function */ diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c index adf39de826..b087802b31 100644 --- a/ospf6d/ospf6_message.c +++ b/ospf6d/ospf6_message.c @@ -2459,29 +2459,29 @@ config_write_ospf6_debug_message (struct vty *vty) if (s == 0x3f && r == 0x3f) { - vty_out (vty, "debug ospf6 message all%s", VTYNL); + vty_out (vty, "debug ospf6 message all\n"); return 0; } if (s == 0x3f && r == 0) { - vty_out (vty, "debug ospf6 message all send%s", VTYNL); + 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", VTYNL); + 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", VTYNL); + 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", VTYNL); + 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", VTYNL); + vty_out (vty, "no debug ospf6 message unknown recv\n"); for (i = 1; i < 6; i++) { diff --git a/ospf6d/ospf6_neighbor.c b/ospf6d/ospf6_neighbor.c index 7e691f091a..99f5830bfe 100644 --- a/ospf6d/ospf6_neighbor.c +++ b/ospf6d/ospf6_neighbor.c @@ -1016,11 +1016,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", VTYNL); + vty_out (vty, "debug ospf6 neighbor\n"); else if (IS_OSPF6_DEBUG_NEIGHBOR (STATE)) - vty_out (vty, "debug ospf6 neighbor state%s", VTYNL); + vty_out (vty, "debug ospf6 neighbor state\n"); else if (IS_OSPF6_DEBUG_NEIGHBOR (EVENT)) - vty_out (vty, "debug ospf6 neighbor event%s", VTYNL); + vty_out (vty, "debug ospf6 neighbor event\n"); return 0; } diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c index 3784565a94..1befbe248b 100644 --- a/ospf6d/ospf6_route.c +++ b/ospf6d/ospf6_route.c @@ -1131,7 +1131,7 @@ ospf6_route_show_detail (struct vty *vty, struct ospf6_route *route) vty_out (vty, "Router Bits: %s%s", capa, VTYNL); /* Prefix Options */ - vty_out (vty, "Prefix Options: xxx%s", VTYNL); + vty_out (vty, "Prefix Options: xxx\n"); /* Metrics */ vty_out (vty, "Metric Type: %d%s", route->path.metric_type, @@ -1140,7 +1140,7 @@ ospf6_route_show_detail (struct vty *vty, struct ospf6_route *route) route->path.cost, route->path.u.cost_e2, VTYNL); /* Nexthops */ - vty_out (vty, "Nexthop:%s", VTYNL); + vty_out (vty, "Nexthop:\n"); for (ALL_LIST_ELEMENTS_RO (route->nh_list, node, nh)) { /* nexthop */ @@ -1148,7 +1148,7 @@ ospf6_route_show_detail (struct vty *vty, struct ospf6_route *route) ifname = ifindex2ifname (nh->ifindex, VRF_DEFAULT); vty_out (vty, " %s %.*s%s", nexthop, IFNAMSIZ, ifname, VTYNL); } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } static void @@ -1619,11 +1619,11 @@ int config_write_ospf6_debug_route (struct vty *vty) { if (IS_OSPF6_DEBUG_ROUTE (TABLE)) - vty_out (vty, "debug ospf6 route table%s", VTYNL); + vty_out (vty, "debug ospf6 route table\n"); if (IS_OSPF6_DEBUG_ROUTE (INTRA)) - vty_out (vty, "debug ospf6 route intra-area%s", VTYNL); + vty_out (vty, "debug ospf6 route intra-area\n"); if (IS_OSPF6_DEBUG_ROUTE (INTER)) - vty_out (vty, "debug ospf6 route inter-area%s", VTYNL); + vty_out (vty, "debug ospf6 route inter-area\n"); return 0; } diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c index 6338b06f68..c9f1740a9a 100644 --- a/ospf6d/ospf6_spf.c +++ b/ospf6d/ospf6_spf.c @@ -748,7 +748,7 @@ ospf6_spf_display_subtree (struct vty *vty, const char *prefix, int rest, next_prefix = (char *) malloc (len); if (next_prefix == NULL) { - vty_out (vty, "malloc failed%s", VTYNL); + 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", VTYNL); + vty_out (vty, "debug ospf6 spf process\n"); if (IS_OSPF6_DEBUG_SPF (TIME)) - vty_out (vty, "debug ospf6 spf time%s", VTYNL); + vty_out (vty, "debug ospf6 spf time\n"); if (IS_OSPF6_DEBUG_SPF (DATABASE)) - vty_out (vty, "debug ospf6 spf database%s", VTYNL); + vty_out (vty, "debug ospf6 spf database\n"); return 0; } diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c index fd91410fa9..9040e4ab9f 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", VTYNL); + vty_out (vty, "OSPFv3 is not configured\n"); else { ospf6_delete (ospf6); @@ -835,13 +835,13 @@ ospf6_show (struct vty *vty, struct ospf6 *o) (long long)o->ts_spf_duration.tv_usec, VTYNL); } else - vty_out(vty, "has not been run$%s", VTYNL); + 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, VTYNL); if (CHECK_FLAG (o->flag, OSPF6_STUB_ROUTER)) - vty_out (vty, " Router Is Stub Router%s", VTYNL); + vty_out (vty, " Router Is Stub Router\n"); /* LSAs */ vty_out (vty, " Number of AS scoped LSAs is %u%s", @@ -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", VTYNL); + vty_out (vty, " stub-router administrative\n"); } return; } @@ -1019,7 +1019,7 @@ 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", VTYNL); + vty_out (vty, "router ospf6\n"); if (ospf6->router_id_static != 0) vty_out (vty, " router-id %s%s", router_id, VTYNL); @@ -1056,7 +1056,7 @@ config_write_ospf6 (struct vty *vty) vty_out (vty, " interface %s area %s%s", oi->interface->name, oa->name, VTYNL); } - vty_out (vty, "!%s", VTYNL); + vty_out (vty, "!\n"); return 0; } diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c index 9a1866139f..3ca9182f0c 100644 --- a/ospf6d/ospf6_zebra.c +++ b/ospf6d/ospf6_zebra.c @@ -315,11 +315,11 @@ DEFUN (show_zebra, int i; if (zclient == NULL) { - vty_out (vty, "Not connected to zebra%s", VTYNL); + vty_out (vty, "Not connected to zebra\n"); return CMD_SUCCESS; } - vty_out (vty, "Zebra Infomation%s", VTYNL); + vty_out (vty, "Zebra Infomation\n"); vty_out (vty, " enable: %d fail: %d%s", zclient->enable, zclient->fail, VTYNL); vty_out (vty, " redistribute default: %d%s", @@ -331,7 +331,7 @@ DEFUN (show_zebra, if (vrf_bitmap_check (zclient->redist[AFI_IP6][i], VRF_DEFAULT)) vty_out (vty, " %s", zebra_route_string(i)); } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -341,15 +341,15 @@ config_write_ospf6_zebra (struct vty *vty) { if (! zclient->enable) { - vty_out (vty, "no router zebra%s", VTYNL); - vty_out (vty, "!%s", VTYNL); + 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", VTYNL); - vty_out (vty, " no redistribute ospf6%s", VTYNL); - vty_out (vty, "!%s", VTYNL); + vty_out (vty, "router zebra\n"); + vty_out (vty, " no redistribute ospf6\n"); + vty_out (vty, "!\n"); } return 0; } @@ -905,13 +905,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", VTYNL); + vty_out (vty, "debug ospf6 zebra\n"); else { if (IS_OSPF6_DEBUG_ZEBRA (SEND)) - vty_out (vty, "debug ospf6 zebra send%s", VTYNL); + vty_out (vty, "debug ospf6 zebra send\n"); if (IS_OSPF6_DEBUG_ZEBRA (RECV)) - vty_out (vty, "debug ospf6 zebra recv%s", VTYNL); + vty_out (vty, "debug ospf6 zebra recv\n"); } return 0; } diff --git a/ospf6d/ospf6d.c b/ospf6d/ospf6d.c index ce03322f79..a7153893c0 100644 --- a/ospf6d/ospf6d.c +++ b/ospf6d/ospf6d.c @@ -110,7 +110,7 @@ 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", VTYNL); + vty_out (vty, "!\n"); return 0; } @@ -206,7 +206,7 @@ DEFUN (show_ipv6_ospf6_database, vty_out (vty, AS_LSDB_TITLE_FORMAT, VTYNL, VTYNL, VTYNL); ospf6_lsdb_show (vty, level, NULL, NULL, NULL, o->lsdb); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -277,7 +277,7 @@ DEFUN (show_ipv6_ospf6_database_type, break; } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -330,7 +330,7 @@ DEFUN (show_ipv6_ospf6_database_id, vty_out (vty, AS_LSDB_TITLE_FORMAT, VTYNL, VTYNL, VTYNL); ospf6_lsdb_show (vty, level, NULL, &id, NULL, o->lsdb); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -381,7 +381,7 @@ DEFUN (show_ipv6_ospf6_database_router, vty_out (vty, AS_LSDB_TITLE_FORMAT, VTYNL, VTYNL, VTYNL); ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -457,7 +457,7 @@ DEFUN (show_ipv6_ospf6_database_type_id, break; } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -534,7 +534,7 @@ DEFUN (show_ipv6_ospf6_database_type_router, break; } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -589,7 +589,7 @@ DEFUN (show_ipv6_ospf6_database_id_router, vty_out (vty, AS_LSDB_TITLE_FORMAT, VTYNL, VTYNL, VTYNL); ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -644,7 +644,7 @@ DEFUN (show_ipv6_ospf6_database_adv_router_linkstate_id, vty_out (vty, AS_LSDB_TITLE_FORMAT, VTYNL, VTYNL, VTYNL); ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -721,7 +721,7 @@ DEFUN (show_ipv6_ospf6_database_type_id_router, break; } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -801,7 +801,7 @@ DEFUN (show_ipv6_ospf6_database_type_adv_router_linkstate_id, break; } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -848,7 +848,7 @@ DEFUN (show_ipv6_ospf6_database_self_originated, vty_out (vty, AS_LSDB_TITLE_FORMAT, VTYNL, VTYNL, VTYNL); ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -923,7 +923,7 @@ DEFUN (show_ipv6_ospf6_database_type_self_originated, break; } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -1001,7 +1001,7 @@ DEFUN (show_ipv6_ospf6_database_type_self_originated_linkstate_id, break; } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -1078,7 +1078,7 @@ DEFUN (show_ipv6_ospf6_database_type_id_self_originated, break; } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -1162,7 +1162,7 @@ DEFUN (show_ipv6_ospf6_linkstate, ospf6_linkstate_table_show (vty, idx_ipv4, argc, argv, oa->spf_table); } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -1190,7 +1190,7 @@ DEFUN (show_ipv6_ospf6_linkstate_detail, ospf6_linkstate_table_show (vty, idx_detail, argc, argv, oa->spf_table); } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } diff --git a/ospf6d/ospf6d.h b/ospf6d/ospf6d.h index 347ad34871..2da11d0abf 100644 --- a/ospf6d/ospf6d.h +++ b/ospf6d/ospf6d.h @@ -93,7 +93,7 @@ extern struct thread_master *master; #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_vty.c b/ospfd/ospf_vty.c index b0405f098a..60fb352b97 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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } @@ -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; } 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; } @@ -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; } @@ -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; } @@ -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; } @@ -1037,15 +1031,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; } 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; } @@ -1157,22 +1150,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; } 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; } 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; } @@ -1257,14 +1249,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; } 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; } @@ -1303,14 +1295,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; } 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; } @@ -1421,8 +1413,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; } @@ -1451,8 +1442,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; } @@ -1518,8 +1508,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; } @@ -1658,7 +1647,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; } @@ -1701,7 +1690,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; } @@ -2205,7 +2194,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; } @@ -2247,7 +2236,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; } @@ -2292,7 +2281,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; } @@ -2335,7 +2324,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; } @@ -2549,7 +2538,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; } @@ -2580,8 +2569,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 +2597,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; } @@ -2677,7 +2666,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,7 +2703,7 @@ 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", @@ -2761,27 +2750,22 @@ show_ip_ospf_area (struct vty *vty, struct ospf_area *area, json_object *json_ar { vty_out (vty, " It is an NSSA configuration. %s Elected NSSA/ABR performs type-7/type-5 LSA translation. %s", VTYNL, VTYNL); 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,11 +2789,9 @@ 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", ospf_timer_dump (area->t_stub_router, timebuf, @@ -2856,11 +2838,11 @@ show_ip_ospf_area (struct vty *vty, struct ospf_area *area, json_object *json_ar /* 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" @@ -2909,7 +2891,7 @@ show_ip_ospf_area (struct vty *vty, struct ospf_area *area, json_object *json_ar 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 @@ -2982,8 +2964,8 @@ 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, " Supports only single TOS (TOS0) routes\n"); + vty_out (vty, " This implementation conforms to RFC2328\n"); vty_out (vty, " RFC1583Compatibility flag is %s%s", CHECK_FLAG (ospf->config, OSPF_RFC1583_COMPATIBLE) ? "enabled" : "disabled", VTYNL); @@ -3017,8 +2999,7 @@ 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); @@ -3077,7 +3058,7 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) VTYNL); } else - vty_out (vty, "has not been run%s", VTYNL); + vty_out (vty, "has not been run\n"); } if (use_json) @@ -3178,14 +3159,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. */ @@ -3199,7 +3180,7 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) json_object_free(json); } else - vty_out (vty, "%s",VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -3293,13 +3274,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; } } @@ -3454,7 +3434,7 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface } else vty_out (vty, " "); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } if (use_json) @@ -3502,7 +3482,7 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface 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) @@ -3566,7 +3546,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 { @@ -3586,7 +3566,7 @@ show_ip_ospf_interface_common (struct vty *vty, struct ospf *ospf, int argc, json_object_free(json); } else - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -3748,7 +3728,7 @@ show_ip_ospf_neighbor_common (struct vty *vty, struct ospf *ospf, u_char use_jso json_object_free(json); } else - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -3860,7 +3840,7 @@ show_ip_ospf_neighbor_all_common (struct vty *vty, struct ospf *ospf, u_char use json_object_free(json); } else - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -3935,7 +3915,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; } @@ -3955,7 +3935,7 @@ show_ip_ospf_neighbor_int_common (struct vty *vty, struct ospf *ospf, int arg_ba json_object_free(json); } else - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -4142,8 +4122,7 @@ 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, " Most recent state change statistics:\n"); vty_out (vty, " Progressive change %s ago%s", ospf_timeval_dump (&res, timebuf, sizeof(timebuf)), VTYNL); @@ -4309,7 +4288,7 @@ show_ip_ospf_neighbor_id_common (struct vty *vty, struct ospf *ospf, 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; } @@ -4327,7 +4306,7 @@ show_ip_ospf_neighbor_id_common (struct vty *vty, struct ospf *ospf, json_object_free(json); } else - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -4419,7 +4398,7 @@ show_ip_ospf_neighbor_detail_common (struct vty *vty, struct ospf *ospf, u_char json_object_free(json); } else - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -4516,7 +4495,7 @@ show_ip_ospf_neighbor_detail_all_common (struct vty *vty, struct ospf *ospf, u_c } else { - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } return CMD_SUCCESS; @@ -4592,7 +4571,7 @@ show_ip_ospf_neighbor_int_detail_common (struct vty *vty, struct ospf *ospf, if (!ifp) { if (!use_json) - vty_out (vty, "No such interface.%s", VTYNL); + vty_out (vty, "No such interface.\n"); return CMD_WARNING; } @@ -4620,7 +4599,7 @@ show_ip_ospf_neighbor_int_detail_common (struct vty *vty, struct ospf *ospf, json_object_free(json); } else - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); return CMD_SUCCESS; } @@ -4846,10 +4825,10 @@ show_ip_ospf_database_router_links (struct vty *vty, 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, " Number of TOS metrics: 0\n"); vty_out (vty, " TOS 0 Metric: %d%s", ntohs (rl->link[i].metric), VTYNL); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } } @@ -4867,7 +4846,7 @@ show_router_lsa_detail (struct vty *vty, struct ospf_lsa *lsa) VTYNL, VTYNL); show_ip_ospf_database_router_links (vty, rl); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } return 0; @@ -4894,7 +4873,7 @@ show_network_lsa_detail (struct vty *vty, struct ospf_lsa *lsa) vty_out (vty, " Attached Router: %s%s", inet_ntoa (nl->routers[i]), VTYNL); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } return 0; @@ -4914,7 +4893,7 @@ show_summary_lsa_detail (struct vty *vty, struct ospf_lsa *lsa) VTYNL); vty_out (vty, " TOS: 0 Metric: %d%s", GET_METRIC (sl->metric), VTYNL); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } return 0; @@ -4934,7 +4913,7 @@ show_summary_asbr_lsa_detail (struct vty *vty, struct ospf_lsa *lsa) 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, "\n"); } return 0; @@ -4955,7 +4934,7 @@ show_as_external_lsa_detail (struct vty *vty, struct ospf_lsa *lsa) vty_out (vty, " Metric Type: %s%s", 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, " TOS: 0\n"); vty_out (vty, " Metric: %d%s", GET_METRIC (al->e[0].metric), VTYNL); vty_out (vty, " Forward Address: %s%s", @@ -5007,7 +4986,7 @@ show_as_nssa_lsa_detail (struct vty *vty, struct ospf_lsa *lsa) vty_out (vty, " Metric Type: %s%s", 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, " TOS: 0\n"); vty_out (vty, " Metric: %d%s", GET_METRIC (al->e[0].metric), VTYNL); vty_out (vty, " NSSA: Forward Address: %s%s", @@ -5034,7 +5013,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; } @@ -5211,7 +5190,7 @@ show_ip_ospf_database_summary (struct vty *vty, struct ospf *ospf, int self) LSDB_LOOP (AREA_LSDB (area, type), rn, lsa) show_lsa_summary (vty, lsa, self); - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } } } @@ -5238,11 +5217,11 @@ show_ip_ospf_database_summary (struct vty *vty, struct ospf *ospf, int self) 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 @@ -5265,7 +5244,7 @@ show_ip_ospf_database_maxage (struct vty *vty, struct ospf *ospf) 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, "\n"); } } } @@ -5555,8 +5534,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; } @@ -5580,7 +5558,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; } @@ -5605,8 +5583,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; } @@ -5647,15 +5624,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; } 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; } params->auth_type = OSPF_AUTH_NOTSET; @@ -5678,7 +5654,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; } /* @@ -5737,15 +5713,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; } 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; } @@ -5817,8 +5792,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; } @@ -5863,8 +5837,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; } @@ -5925,8 +5898,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; } @@ -5992,8 +5964,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; } @@ -6060,8 +6031,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; } @@ -6115,8 +6085,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; } @@ -6187,8 +6156,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; } @@ -6214,8 +6182,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; } @@ -6314,8 +6281,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; } @@ -6393,8 +6359,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; } @@ -6440,8 +6405,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; } @@ -6492,7 +6456,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; } @@ -6620,8 +6584,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; } @@ -6682,8 +6645,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; } @@ -6753,8 +6715,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; } @@ -6800,8 +6761,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; } @@ -6857,8 +6817,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; } @@ -6903,8 +6862,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; } @@ -6981,13 +6939,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; } 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; } @@ -7018,7 +6975,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; } } @@ -7203,15 +7160,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; } 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; } @@ -7268,15 +7223,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; } 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; } @@ -7638,8 +7591,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; } params = ospf_get_if_params (ifp, addr); @@ -7681,8 +7633,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; } params = ospf_get_if_params (ifp, addr); @@ -7870,8 +7821,7 @@ config_write_stub_router (struct vty *vty, struct ospf *ospf) { 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 +7836,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) @@ -7928,7 +7877,7 @@ show_ip_ospf_route_network (struct vty *vty, struct route_table *rt) } } } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } static void @@ -7940,8 +7889,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) { @@ -7981,7 +7929,7 @@ show_ip_ospf_route_router (struct vty *vty, struct route_table *rtrs) } } } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } static void @@ -7992,8 +7940,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) { @@ -8028,7 +7975,7 @@ show_ip_ospf_route_external (struct vty *vty, struct route_table *rt) } } } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } static int @@ -8040,7 +7987,7 @@ show_ip_ospf_border_routers_common (struct vty *vty, struct ospf *ospf) 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 +7997,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; } @@ -8100,7 +8047,7 @@ show_ip_ospf_route_common (struct vty *vty, struct ospf *ospf) 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 +8060,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,7 +8148,7 @@ config_write_interface (struct vty *vty) if (ifp->ifindex == IFINDEX_DELETED) continue; - vty_out (vty, "!%s", VTYNL); + vty_out (vty, "!\n"); vty_out (vty, "interface %s%s", ifp->name, VTYNL); if (ifp->desc) @@ -8223,7 +8170,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 +8205,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 +8216,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 +8226,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 +8235,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 +8245,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 +8264,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 +8274,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 +8285,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 +8295,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. */ @@ -8378,7 +8325,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"); } @@ -8488,7 +8435,7 @@ 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, @@ -8513,7 +8460,7 @@ 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)) @@ -8554,7 +8501,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; @@ -8651,7 +8598,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"); } } @@ -8703,7 +8650,7 @@ config_write_ospf_distribute (struct vty *vty, struct ospf *ospf) ROUTEMAP_NAME (red)); } - vty_out (vty, "%s", VTYNL); + vty_out (vty, "\n"); } } @@ -8733,7 +8680,7 @@ 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)) @@ -8764,7 +8711,7 @@ ospf_config_write (struct vty *vty) if (ospf->instance) vty_out (vty, "router ospf %d%s", ospf->instance, VTYNL); else - vty_out (vty, "router ospf%s", VTYNL); + vty_out (vty, "router ospf\n"); write++; @@ -8785,18 +8732,18 @@ ospf_config_write (struct vty *vty) 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) @@ -8841,7 +8788,7 @@ ospf_config_write (struct vty *vty) /* 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) @@ -9098,7 +9045,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 0bb5b6f3f0..7b888f439c 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,7 +39,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; \ } \ if (OSPF_IS_AREA_ID_BACKBONE ((V))) \ diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c index 4b5567f770..b90e289873 100644 --- a/ripngd/ripngd.c +++ b/ripngd/ripngd.c @@ -2425,7 +2425,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; } @@ -2460,7 +2460,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; } @@ -2493,7 +2493,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; } @@ -2577,7 +2577,7 @@ 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, diff --git a/zebra/debug.c b/zebra/debug.c index ba2a9ad2a3..50c1f4dcb6 100644 --- a/zebra/debug.c +++ b/zebra/debug.c @@ -39,10 +39,10 @@ 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) { @@ -66,24 +66,24 @@ DEFUN (show_debugging_zebra, } 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,7 +353,7 @@ 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) @@ -380,43 +380,43 @@ config_write_debug (struct vty *vty) } 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/zebra_rnh.c b/zebra/zebra_rnh.c index 5dc504b41b..7b0d7bd786 100644 --- a/zebra/zebra_rnh.c +++ b/zebra/zebra_rnh.c @@ -996,7 +996,7 @@ print_nh (struct nexthop *nexthop, struct vty *vty) default: break; } - vty_out(vty, "%s", VTYNL); + vty_out(vty, "\n"); } static void @@ -1030,5 +1030,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_vty.c b/zebra/zebra_vty.c index 3810cc8dd1..0dad125d14 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -681,7 +681,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 @@ -709,7 +709,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_RO(re->nexthop, nexthop, tnexthop, recursing)) @@ -788,9 +788,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"); } } @@ -1078,7 +1078,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"); } } From 61b7d449bd022b0455f148ee9187293a62afdfcb Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Thu, 13 Jul 2017 19:20:20 +0200 Subject: [PATCH 09/14] *: remove VTYNL, part 3 of 6 Signed-off-by: David Lamparter --- bgpd/bgp_evpn_vty.c | 6 ++---- bgpd/bgp_mplsvpn.c | 6 ++---- bgpd/bgp_nexthop.c | 3 +-- bgpd/bgp_route.c | 29 +++++++++++-------------- bgpd/bgp_updgrp_adv.c | 3 +-- bgpd/bgp_vpn.c | 3 +-- bgpd/bgp_vty.c | 34 +++++++++++------------------ bgpd/bgpd.c | 2 +- bgpd/rfapi/rfapi.c | 3 +-- eigrpd/eigrp_dump.c | 9 +++----- isisd/isis_te.c | 4 ++-- ldpd/ldp_vty_exec.c | 6 +++--- lib/command.c | 30 ++++++++++++-------------- lib/if.c | 2 +- lib/routemap.c | 2 +- lib/vty.c | 5 ++--- nhrpd/nhrp_vty.c | 2 +- ospf6d/ospf6_lsa.c | 8 +++---- ospf6d/ospf6d.c | 6 ++---- ospfd/ospf_dump.c | 2 +- ospfd/ospf_te.c | 2 +- ospfd/ospf_vty.c | 50 +++++++++++++++++++------------------------ pimd/pim_cmd.c | 3 +-- vtysh/vtysh.c | 2 +- zebra/interface.c | 4 ++-- zebra/zebra_fpm.c | 4 ++-- zebra/zebra_vty.c | 6 +++--- 27 files changed, 100 insertions(+), 136 deletions(-) diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c index 603171138e..a76e499f8c 100644 --- a/bgpd/bgp_evpn_vty.c +++ b/bgpd/bgp_evpn_vty.c @@ -146,8 +146,7 @@ bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd, 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%s\n", - VTYNL); + "Origin codes: i - IGP, e - EGP, ? - incomplete\n\n"); vty_out(vty, V4_HEADER); } } @@ -256,8 +255,7 @@ bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd, vty_out (vty, "No prefixes displayed, %ld exist\n", total_count); else - vty_out (vty, "%sDisplayed %ld out of %ld total prefixes\n", - VTYNL, output_count, total_count); + vty_out (vty, "\nDisplayed %ld out of %ld total prefixes\n", output_count, total_count); return CMD_SUCCESS; } diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c index 0a4d589b86..c1db9fed2f 100644 --- a/bgpd/bgp_mplsvpn.c +++ b/bgpd/bgp_mplsvpn.c @@ -641,8 +641,7 @@ bgp_show_mpls_vpn (struct vty *vty, afi_t afi, struct prefix_rd *prd, inet_ntoa(bgp->router_id)); 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%s\n", - VTYNL); + vty_out (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete\n\n"); vty_out (vty, V4_HEADER); } } @@ -749,8 +748,7 @@ bgp_show_mpls_vpn (struct vty *vty, afi_t afi, struct prefix_rd *prd, if (output_count == 0) vty_out (vty, "No prefixes displayed, %ld exist\n", total_count); else - vty_out (vty, "%sDisplayed %ld routes and %ld total paths\n", - VTYNL, output_count, total_count); + vty_out (vty, "\nDisplayed %ld routes and %ld total paths\n", output_count, total_count); } return CMD_SUCCESS; diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c index e2d93e9f37..45ccb37434 100644 --- a/bgpd/bgp_nexthop.c +++ b/bgpd/bgp_nexthop.c @@ -478,8 +478,7 @@ bgp_show_all_instances_nexthops_vty (struct vty *vty) for (ALL_LIST_ELEMENTS (bm->bgp, node, nnode, bgp)) { - vty_out (vty, "%sInstance %s:\n", - 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_route.c b/bgpd/bgp_route.c index b4bdab3161..80161412d4 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -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, " "); } @@ -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, " "); } @@ -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 { @@ -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 { @@ -8043,8 +8043,7 @@ bgp_show_table (struct vty *vty, struct bgp *bgp, struct bgp_table *table, total_count); } else - vty_out (vty, "%sDisplayed %ld routes and %ld total paths\n", - VTYNL, output_count, total_count); + vty_out (vty, "\nDisplayed %ld routes and %ld total paths\n", output_count, total_count); } return CMD_SUCCESS; @@ -8105,8 +8104,7 @@ bgp_show_all_instances_routes_vty (struct vty *vty, afi_t afi, safi_t safi, } else { - vty_out (vty, "%sInstance %s:\n", - 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); @@ -9422,8 +9420,7 @@ bgp_peer_counts (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, u_c } vty_out (vty, "PfxCt: %ld\n", peer->pcount[afi][safi]); - vty_out (vty, "%sCounts from RIB table walk:%s\n", - VTYNL, VTYNL); + vty_out (vty, "\nCounts from RIB table walk:\n\n"); for (i = 0; i < PCOUNT_MAX; i++) vty_out (vty, "%20s: %-10d\n", pcount_strs[i], pcounts.count[i]); @@ -9649,8 +9646,7 @@ show_adj_route (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, vty_out (vty, BGP_SHOW_SCODE_HEADER); vty_out (vty, BGP_SHOW_OCODE_HEADER); - vty_out (vty, "Originating default network 0.0.0.0%s\n", - VTYNL); + vty_out (vty, "Originating default network 0.0.0.0\n\n"); } header1 = 0; } @@ -9757,8 +9753,7 @@ 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_out (vty, "%sTotal number of prefixes %ld\n", - VTYNL, output_count); + vty_out (vty, "\nTotal number of prefixes %ld\n", output_count); } if (use_json) { diff --git a/bgpd/bgp_updgrp_adv.c b/bgpd/bgp_updgrp_adv.c index aa3a53098e..6524e8435a 100644 --- a/bgpd/bgp_updgrp_adv.c +++ b/bgpd/bgp_updgrp_adv.c @@ -250,8 +250,7 @@ subgrp_show_adjq_vty (struct update_subgroup *subgrp, struct vty *vty, } } if (output_count != 0) - vty_out (vty, "%sTotal number of prefixes %ld\n", - VTYNL, output_count); + vty_out (vty, "\nTotal number of prefixes %ld\n", output_count); } static int diff --git a/bgpd/bgp_vpn.c b/bgpd/bgp_vpn.c index e1fed31a11..c7f8ae3c0d 100644 --- a/bgpd/bgp_vpn.c +++ b/bgpd/bgp_vpn.c @@ -108,8 +108,7 @@ show_adj_route_vpn (struct vty *vty, struct peer *peer, struct prefix_rd *prd, inet_ntoa(bgp->router_id)); 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%s\n", - VTYNL); + vty_out (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete\n\n"); vty_out (vty, V4_HEADER); } header = 0; diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 59fec7fb8a..e84a7f005e 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -6628,8 +6628,7 @@ DEFUN (show_bgp_vrfs, 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%s", count, VTYNL); } return CMD_SUCCESS; @@ -7111,7 +7110,7 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi, else { if (count) - vty_out (vty, "%sTotal number of neighbors %d%s", VTYNL, + vty_out (vty, "\nTotal number of neighbors %d%s", count, VTYNL); else { @@ -7198,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:%s", afi_safi_print(afi, safi), VTYNL); } } bgp_show_summary (vty, bgp, afi, safi, use_json, json); @@ -7251,8 +7249,7 @@ 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:%s", (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT) ? "Default" : bgp->name, VTYNL); } @@ -8493,7 +8490,7 @@ 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, " 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", @@ -8564,7 +8561,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js 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, " Address families by peer:\n "); for (afi = AFI_IP ; afi < AFI_MAX ; afi++) for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++) @@ -8865,7 +8862,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js 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++); @@ -8874,7 +8871,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) { @@ -9185,8 +9182,7 @@ 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:%s", (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT) ? "Default" : bgp->name, VTYNL); @@ -9403,8 +9399,7 @@ 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, + vty_out (vty, "\nInstance %s:%s", (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT) ? "Default" : bgp->name, VTYNL); update_group_show(bgp, afi, safi, vty, 0); @@ -9789,14 +9784,11 @@ 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%s", group->name, conf->as, VTYNL); } 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%s", group->name, group->bgp->as, VTYNL); } else { - vty_out (vty, "%sBGP peer-group %s%s", - VTYNL, group->name, VTYNL); + vty_out (vty, "\nBGP peer-group %s%s", group->name, VTYNL); } if ((group->bgp->as == conf->as) || (conf->as_type == AS_INTERNAL)) diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 2dd81d4070..54d4a66ad3 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -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) { diff --git a/bgpd/rfapi/rfapi.c b/bgpd/rfapi/rfapi.c index c78045d1e8..6e2f3f2b88 100644 --- a/bgpd/rfapi/rfapi.c +++ b/bgpd/rfapi/rfapi.c @@ -3837,8 +3837,7 @@ DEFUN (debug_rfapi_show_import, lni = lni_as_ptr; if (first_l2) { - vty_out (vty, "%sLNI-based Ethernet Tables:\n", - VTYNL); + vty_out (vty, "\nLNI-based Ethernet Tables:\n"); first_l2 = 0; } snprintf (buf, BUFSIZ, "L2VPN LNI=%u", lni); diff --git a/eigrpd/eigrp_dump.c b/eigrpd/eigrp_dump.c index 7ba234d0ff..70716d1667 100644 --- a/eigrpd/eigrp_dump.c +++ b/eigrpd/eigrp_dump.c @@ -210,8 +210,7 @@ void show_ip_eigrp_interface_header (struct vty *vty, struct eigrp *eigrp) { - vty_out (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\n", - VTYNL, + vty_out (vty, "\n%s%d%s%s%s %-10s %-10s %-10s %-6s %-12s %-7s %-14s %-12s %-8s %-8s %-8s%s %-39s %-12s %-7s %-14s %-12s %-8s\n", "EIGRP interfaces for AS(",eigrp->AS,")",VTYNL,VTYNL, "Interface", "Bandwidth", "Delay", "Peers", "Xmit Queue", "Mean", "Pacing Time", "Multicast", "Pending", "Hello", "Holdtime", @@ -257,8 +256,7 @@ show_ip_eigrp_interface_detail (struct vty *vty, struct eigrp *eigrp, void show_ip_eigrp_neighbor_header (struct vty *vty, struct eigrp *eigrp) { - vty_out (vty, "%s%s%d%s%s%s%-3s %-17s %-20s %-6s %-8s %-6s %-5s %-5s %-5s%s %-41s %-6s %-8s %-6s %-4s %-6s %-5s \n", - VTYNL, + vty_out (vty, "\n%s%d%s%s%s%-3s %-17s %-20s %-6s %-8s %-6s %-5s %-5s %-5s%s %-41s %-6s %-8s %-6s %-4s %-6s %-5s \n", "EIGRP neighbors for AS(",eigrp->AS,")",VTYNL,VTYNL, "H", "Address", "Interface", "Hold", "Uptime", "SRTT", "RTO", "Q", "Seq", VTYNL @@ -298,8 +296,7 @@ show_ip_eigrp_topology_header (struct vty *vty, struct eigrp *eigrp) struct in_addr router_id; router_id.s_addr = eigrp->router_id; - vty_out (vty, "%sEIGRP Topology Table for AS(%d)/ID(%s)%s\n", - VTYNL, eigrp->AS, inet_ntoa(router_id), VTYNL); + vty_out (vty, "\nEIGRP Topology Table for AS(%d)/ID(%s)%s\n", eigrp->AS, inet_ntoa(router_id), VTYNL); vty_out (vty, "Codes: P - Passive, A - Active, U - Update, Q - Query, " "R - Reply%s r - reply Status, s - sia Status%s\n", VTYNL, VTYNL); diff --git a/isisd/isis_te.c b/isisd/isis_te.c index 47377bd7ae..e26bb6e46b 100644 --- a/isisd/isis_te.c +++ b/isisd/isis_te.c @@ -968,7 +968,7 @@ 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 @@ -1299,7 +1299,7 @@ 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_out (vty, "---------------%s\n", VTYNL); + vty_out (vty, "---------------\n\n"); } else { diff --git a/ldpd/ldp_vty_exec.c b/ldpd/ldp_vty_exec.c index 476b9b1735..ed87e21387 100644 --- a/ldpd/ldp_vty_exec.c +++ b/ldpd/ldp_vty_exec.c @@ -211,7 +211,7 @@ 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_out (vty, "%9u\n", adj->holdtime); @@ -511,7 +511,7 @@ 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_out(vty, "\n%48s", " "); vty_out (vty, " %8s\n", log_time(nbr->uptime)); break; case IMSG_CTL_END: @@ -1021,7 +1021,7 @@ 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_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"); diff --git a/lib/command.c b/lib/command.c index ad197468a5..c9fbaf47be 100644 --- a/lib/command.c +++ b/lib/command.c @@ -1349,7 +1349,7 @@ DEFUN (show_version, vty_out (vty, "%s %s (%s).\n", FRR_FULL_NAME, FRR_VERSION, host.name ? host.name : ""); vty_out (vty, "%s%s\n", FRR_COPYRIGHT, GIT_INFO); - vty_out (vty, "configured with:%s %s\n", VTYNL, + vty_out (vty, "configured with:\n %s\n", FRR_CONFIG_ARGS); return CMD_SUCCESS; @@ -1374,20 +1374,18 @@ DEFUN (config_help, "Description of the interactive help system\n") { vty_out (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\n", VTYNL, VTYNL, VTYNL, - VTYNL, VTYNL, VTYNL, VTYNL, VTYNL, - VTYNL, VTYNL, VTYNL, VTYNL); + "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; } @@ -1488,7 +1486,7 @@ vty_write_config (struct vty *vty) if (vty->type == VTY_TERM) { - vty_out (vty, "%sCurrent configuration:\n",VTYNL); + vty_out (vty, "\nCurrent configuration:\n"); vty_out (vty, "!\n"); } diff --git a/lib/if.c b/lib/if.c index e6a957a958..18da3f2f37 100644 --- a/lib/if.c +++ b/lib/if.c @@ -818,7 +818,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, + vty_out (vty, "\nVRF %u%s%s", vrf->vrf_id, VTYNL, VTYNL); for (ALL_LIST_ELEMENTS_RO (vrf->iflist, node, ifp)) diff --git a/lib/routemap.c b/lib/routemap.c index 6e483234a6..5e5f804bf0 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -1003,7 +1003,7 @@ vty_show_route_map_entry (struct vty *vty, struct route_map *map) /* Description */ if (index->description) - vty_out (vty, " Description:%s %s\n", VTYNL, + vty_out (vty, " Description:\n %s\n", index->description); /* Match clauses */ diff --git a/lib/vty.c b/lib/vty.c index db0fbdd6d4..fea1842bf7 100644 --- a/lib/vty.c +++ b/lib/vty.c @@ -1759,8 +1759,7 @@ vty_create (int vty_sock, union sockunion *su) /* Say hello to the world. */ vty_hello (vty); if (! no_password_check) - vty_out (vty, "%sUser Access Verification%s\n", VTYNL, - VTYNL); + vty_out (vty, "\nUser Access Verification\n\n"); /* Setting up terminal. */ vty_will_echo (vty); @@ -2320,7 +2319,7 @@ vty_timeout (struct thread *thread) /* Clear buffer*/ buffer_reset (vty->obuf); - vty_out (vty, "%sVty connection is timed out.\n", VTYNL); + vty_out (vty, "\nVty connection is timed out.\n"); /* Close connection. */ vty->status = VTY_CLOSE; diff --git a/nhrpd/nhrp_vty.c b/nhrpd/nhrp_vty.c index a11d109f39..01300cb5cb 100644 --- a/nhrpd/nhrp_vty.c +++ b/nhrpd/nhrp_vty.c @@ -731,7 +731,7 @@ 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_out (vty, "Status: ok%s\n", 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); diff --git a/ospf6d/ospf6_lsa.c b/ospf6d/ospf6_lsa.c index 90ba0dc74f..3f6263563d 100644 --- a/ospf6d/ospf6_lsa.c +++ b/ospf6d/ospf6_lsa.c @@ -58,7 +58,7 @@ ospf6_unknown_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) for (current = start; current < end; current ++) { if ((current - start) % 16 == 0) - vty_out (vty, "%s ", VTYNL); + 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", VTYNL, VTYNL); + vty_out (vty, "\n\n"); return 0; } @@ -451,7 +451,7 @@ ospf6_lsa_show_dump (struct vty *vty, struct ospf6_lsa *lsa) for (current = start; current < end; current ++) { if ((current - start) % 16 == 0) - vty_out (vty, "%s ", VTYNL); + 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", VTYNL, VTYNL); + vty_out (vty, "\n\n"); return; } diff --git a/ospf6d/ospf6d.c b/ospf6d/ospf6d.c index a7153893c0..bee7828a9a 100644 --- a/ospf6d/ospf6d.c +++ b/ospf6d/ospf6d.c @@ -1157,8 +1157,7 @@ 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", - VTYNL, oa->name, VTYNL, VTYNL); + vty_out (vty, "\n SPF Result in Area %s%s%s", oa->name, VTYNL, VTYNL); ospf6_linkstate_table_show (vty, idx_ipv4, argc, argv, oa->spf_table); } @@ -1185,8 +1184,7 @@ 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", - VTYNL, oa->name, VTYNL, VTYNL); + vty_out (vty, "\n SPF Result in Area %s%s%s", oa->name, VTYNL, VTYNL); ospf6_linkstate_table_show (vty, idx_detail, argc, argv, oa->spf_table); } diff --git a/ospfd/ospf_dump.c b/ospfd/ospf_dump.c index 61b4a2ff14..8707960aef 100644 --- a/ospfd/ospf_dump.c +++ b/ospfd/ospf_dump.c @@ -1568,7 +1568,7 @@ show_debugging_ospf_common (struct vty *vty, struct ospf *ospf) int i; if (ospf->instance) - vty_out (vty, "%sOSPF Instance: %d%s\n", VTYNL, ospf->instance, + vty_out (vty, "\nOSPF Instance: %d%s\n", ospf->instance, VTYNL); vty_out (vty, "OSPF debugging status:\n"); diff --git a/ospfd/ospf_te.c b/ospfd/ospf_te.c index 5739578f55..c34d97ff29 100644 --- a/ospfd/ospf_te.c +++ b/ospfd/ospf_te.c @@ -2585,7 +2585,7 @@ 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_out (vty, "---------------%s\n", VTYNL); + vty_out (vty, "---------------\n\n"); } else { diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 60fb352b97..e0cbc842ec 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -806,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); @@ -2748,7 +2747,7 @@ 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. \n"); else if (area->NSSATranslatorState) @@ -2918,7 +2917,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, + vty_out (vty, "\nOSPF Instance: %d%s%s", ospf->instance, VTYNL, VTYNL); } } @@ -3517,7 +3516,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, + vty_out (vty, "\nOSPF Instance: %d%s%s", ospf->instance, VTYNL, VTYNL); } @@ -3622,8 +3621,7 @@ 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%s", "Neighbor ID", "Pri", "State", "Dead Time", "Address", "Interface", "RXmtL", "RqstL", "DBsmL", VTYNL); @@ -3715,7 +3713,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, + vty_out (vty, "\nOSPF Instance: %d%s%s", ospf->instance, VTYNL, VTYNL); } @@ -3795,7 +3793,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, + vty_out (vty, "\nOSPF Instance: %d%s%s", ospf->instance, VTYNL, VTYNL); } @@ -3905,7 +3903,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, + vty_out (vty, "\nOSPF Instance: %d%s%s", ospf->instance, VTYNL, VTYNL); } @@ -4280,7 +4278,7 @@ 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, + vty_out (vty, "\nOSPF Instance: %d%s%s", ospf->instance, VTYNL, VTYNL); } @@ -4368,7 +4366,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, + vty_out (vty, "\nOSPF Instance: %d%s%s", ospf->instance, VTYNL, VTYNL); } @@ -4460,7 +4458,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, + vty_out (vty, "\nOSPF Instance: %d%s%s", ospf->instance, VTYNL, VTYNL); } @@ -4563,7 +4561,7 @@ 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, + vty_out (vty, "\nOSPF Instance: %d%s%s", ospf->instance, VTYNL, VTYNL); } @@ -5099,8 +5097,7 @@ show_lsa_detail (struct vty *vty, struct ospf *ospf, int type, default: for (ALL_LIST_ELEMENTS_RO (ospf->areas, node, area)) { - vty_out (vty, "%s %s (Area %s)%s%s", - VTYNL, show_database_desc[type], + vty_out (vty, "\n %s (Area %s)%s%s", show_database_desc[type], ospf_area_desc_string (area), VTYNL, VTYNL); show_lsa_detail_proc (vty, AREA_LSDB (area, type), id, adv_router); } @@ -5147,8 +5144,7 @@ show_lsa_detail_adv_router (struct vty *vty, struct ospf *ospf, int type, default: for (ALL_LIST_ELEMENTS_RO (ospf->areas, node, area)) { - vty_out (vty, "%s %s (Area %s)%s%s", - VTYNL, show_database_desc[type], + vty_out (vty, "\n %s (Area %s)%s%s", show_database_desc[type], ospf_area_desc_string (area), VTYNL, VTYNL); show_lsa_detail_adv_router_proc (vty, AREA_LSDB (area, type), adv_router); @@ -5229,8 +5225,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)) { @@ -5277,10 +5272,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, + vty_out (vty, "\nOSPF Instance: %d%s", ospf->instance, VTYNL); - vty_out (vty, "%s OSPF Router with ID (%s)%s%s", VTYNL, + vty_out (vty, "\n OSPF Router with ID (%s)%s%s", inet_ntoa (ospf->router_id), VTYNL, VTYNL); /* Show all LSA. */ @@ -5436,10 +5431,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, + vty_out (vty, "\nOSPF Instance: %d%s", ospf->instance, VTYNL); - vty_out (vty, "%s OSPF Router with ID (%s)%s%s", VTYNL, + vty_out (vty, "\n OSPF Router with ID (%s)%s%s", inet_ntoa (ospf->router_id), VTYNL, VTYNL); /* Set database type to show. */ @@ -6952,8 +6947,7 @@ DEFUN (ip_ospf_area, if (OSPF_IF_PARAM_CONFIGURED(params, if_area)) { 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; } @@ -7982,7 +7976,7 @@ 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, + vty_out (vty, "\nOSPF Instance: %d%s%s", ospf->instance, VTYNL, VTYNL); if (ospf->new_table == NULL) @@ -8042,7 +8036,7 @@ 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, + vty_out (vty, "\nOSPF Instance: %d%s%s", ospf->instance, VTYNL, VTYNL); if (ospf->new_table == NULL) diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index a69e617b44..4bc367e408 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -1572,8 +1572,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_out (vty, "%sInstalled Source Group IIF OIL\n", - VTYNL); + vty_out (vty, "\nInstalled Source Group IIF OIL\n"); } for (ALL_LIST_ELEMENTS_RO(pim_channel_oil_list, node, c_oil)) { diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 02606b88a9..fe84e7ecb1 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -2529,7 +2529,7 @@ DEFUN (vtysh_write_terminal, fp = stdout; vty_out (vty, "Building configuration...\n"); - vty_out (vty, "%sCurrent configuration:\n",VTYNL); + vty_out (vty, "\nCurrent configuration:\n"); vty_out (vty, "!\n"); for (i = 0; i < array_size(vtysh_client); i++) diff --git a/zebra/interface.c b/zebra/interface.c index 550f6fc247..171dcf69c6 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -1077,7 +1077,7 @@ 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_out (vty, "%s flags: %s\n", VTYNL, + vty_out (vty, "\n flags: %s\n", if_flag_dump(ifp->flags)); /* Hardware address. */ @@ -1458,7 +1458,7 @@ DEFUN (show_interface_desc_vrf_all, RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) if (!list_isempty (vrf->iflist)) { - vty_out (vty, "%s\tVRF %u%s\n", VTYNL, vrf->vrf_id, + vty_out (vty, "\n\tVRF %u%s\n", vrf->vrf_id, VTYNL); if_show_description (vty, vrf->vrf_id); } diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c index b765b51b93..a6d022dd59 100644 --- a/zebra/zebra_fpm.c +++ b/zebra/zebra_fpm.c @@ -1451,7 +1451,7 @@ zfpm_show_stats (struct vty *vty) zfpm_stats_t total_stats; time_t elapsed; - vty_out (vty, "%s%-40s %10s Last %2d secs%s\n", VTYNL, "Counter", + vty_out (vty, "\n%-40s %10s Last %2d secs%s\n", "Counter", "Total", ZFPM_STATS_IVL_SECS, VTYNL); /* @@ -1490,7 +1490,7 @@ zfpm_show_stats (struct vty *vty) elapsed = zfpm_get_elapsed_time (zfpm_g->last_stats_clear_time); - vty_out (vty, "%sStats were cleared %lu seconds ago\n", VTYNL, + vty_out (vty, "\nStats were cleared %lu seconds ago\n", (unsigned long)elapsed); } diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 0dad125d14..6e4c1b1850 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -1183,7 +1183,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_out (vty, "%sVRF %s:\n", VTYNL, + vty_out (vty, "\nVRF %s:\n", zvrf_name(zvrf)); first = 0; @@ -1244,7 +1244,7 @@ DEFUN (show_ip_nht_vrf_all, RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) if ((zvrf = vrf->info) != NULL) { - vty_out (vty, "%sVRF %s:\n", 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); } @@ -1284,7 +1284,7 @@ DEFUN (show_ipv6_nht_vrf_all, RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) if ((zvrf = vrf->info) != NULL) { - vty_out (vty, "%sVRF %s:\n", 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); } From 55f70b671f064c315887ec9dd46382eefdc40b78 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Thu, 13 Jul 2017 19:42:42 +0200 Subject: [PATCH 10/14] *: remove VTYNL, part 4 of 6 Signed-off-by: David Lamparter --- bgpd/bgp_route.c | 4 +- bgpd/bgp_vty.c | 597 ++++++++++++++++++-------------------- eigrpd/eigrp_dump.c | 2 +- isisd/isisd.c | 4 +- lib/hash.c | 4 +- lib/if.c | 11 +- lib/memory_vty.c | 5 +- lib/ns.c | 8 +- lib/vrf.c | 2 +- lib/vrf.h | 4 +- lib/vty.c | 10 +- ospf6d/ospf6_abr.c | 18 +- ospf6d/ospf6_area.c | 54 ++-- ospf6d/ospf6_asbr.c | 40 ++- ospf6d/ospf6_interface.c | 120 ++++---- ospf6d/ospf6_intra.c | 57 ++-- ospf6d/ospf6_lsa.c | 76 ++--- ospf6d/ospf6_message.c | 8 +- ospf6d/ospf6_neighbor.c | 99 +++---- ospf6d/ospf6_route.c | 95 +++---- ospf6d/ospf6_spf.c | 2 +- ospf6d/ospf6_top.c | 53 ++-- ospf6d/ospf6_zebra.c | 9 +- ospf6d/ospf6d.c | 10 +- ospfd/ospf_dump.c | 3 +- ospfd/ospf_vty.c | 599 ++++++++++++++++++--------------------- ospfd/ospf_vty.h | 4 +- ripngd/ripngd.c | 19 +- zebra/debug.c | 30 +- zebra/interface.c | 3 +- zebra/zebra_fpm.c | 4 +- zebra/zebra_rnh.c | 14 +- zebra/zebra_vty.c | 5 +- 33 files changed, 906 insertions(+), 1067 deletions(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 80161412d4..9a64c62af8 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -9184,8 +9184,8 @@ bgp_table_stats (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi) ts.table = bgp->rib[afi][safi]; thread_execute (bm->master, bgp_table_stats_walker, &ts, 0); - vty_out (vty, "BGP %s RIB statistics%s\n", - afi_safi_print (afi, safi), VTYNL); + vty_out (vty, "BGP %s RIB statistics\n\n", + afi_safi_print (afi, safi)); for (i = 0; i < BGP_STATS_MAX; i++) { diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index e84a7f005e..cf4ee26379 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; } @@ -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; } } @@ -519,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; } return CMD_SUCCESS; @@ -543,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; @@ -606,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; } } @@ -640,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; } @@ -703,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; } @@ -724,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; } } @@ -905,12 +904,12 @@ DEFUN_NOSH (router_bgp, vty_out (vty, "Please specify 'bgp multiple-instance' first\n"); return CMD_WARNING; 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; case BGP_ERR_INSTANCE_MISMATCH: vty_out (vty, "BGP instance name and AS number mismatch\n"); - vty_out (vty, "BGP instance is already running; AS is %u%s", - as, VTYNL); + vty_out (vty, "BGP instance is already running; AS is %u\n", + as); return CMD_WARNING; } @@ -1183,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; } @@ -1409,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; } @@ -1443,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; } @@ -1578,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) @@ -2467,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; } } @@ -2554,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)) { @@ -2564,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); } } } @@ -2659,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; 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; } return bgp_vty_return (vty, ret); @@ -3310,7 +3309,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; } } @@ -3342,7 +3341,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; } @@ -6031,8 +6030,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; } @@ -6264,7 +6263,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; } } @@ -6518,9 +6517,9 @@ DEFUN (show_bgp_views, /* 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; @@ -6571,7 +6570,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) @@ -6610,10 +6609,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) @@ -6622,13 +6620,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, "\nTotal number of VRFs (including default): %d%s", count, VTYNL); + vty_out (vty, "\nTotal number of VRFs (including default): %d\n", count); } return CMD_SUCCESS; @@ -6647,139 +6645,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; } @@ -6905,30 +6881,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, " 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); } } } @@ -6971,24 +6947,21 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi, bgp_table_version(bgp->rib[afi][safi]), VTYNL); 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.\n"); @@ -7104,30 +7077,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, "\nTotal number of neighbors %d%s", - 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); 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\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); } } @@ -7197,7 +7170,7 @@ bgp_show_summary_afi_safi (struct vty *vty, struct bgp *bgp, int afi, int safi, } else { - vty_out (vty, "\n%s Summary:%s", 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); @@ -7249,9 +7222,9 @@ bgp_show_all_instances_summary_vty (struct vty *vty, afi_t afi, safi_t safi, } else { - vty_out (vty, "\nInstance %s:%s", + 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); } @@ -7665,19 +7638,18 @@ 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, " Packet Queue length %d\n", + bpacket_queue_virtual_length(paf)); } else { @@ -7696,8 +7668,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_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, @@ -7709,8 +7681,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, @@ -7812,67 +7784,59 @@ bgp_show_peer_afi (struct vty *vty, struct peer *p, afi_t afi, safi_t safi, /* 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]) @@ -7996,7 +7960,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) @@ -8012,10 +7976,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); } } @@ -8043,8 +8006,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]) { @@ -8056,7 +8019,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); } } } @@ -8141,9 +8104,8 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js /* 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) @@ -8167,17 +8129,17 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js /* 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. */ @@ -8493,8 +8455,8 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js 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)); } } @@ -8559,8 +8521,8 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js { int restart_af_count = 0; - vty_out (vty, " Remote Restart timer is %d seconds%s", - p->v_gr_restart, 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++) @@ -8672,12 +8634,12 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js } 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) @@ -8708,18 +8670,18 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js /* Packet counts. */ vty_out (vty, " Message statistics:\n"); vty_out (vty, " Inq depth is 0\n"); - vty_out (vty, " Outq depth is %lu%s", (unsigned long) p->obuf->count, VTYNL); + 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%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, " 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) @@ -8739,8 +8701,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) @@ -8774,8 +8736,7 @@ 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) { @@ -8835,9 +8796,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 @@ -8855,8 +8816,8 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js } 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) @@ -8899,17 +8860,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); } } @@ -8926,11 +8886,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 @@ -8940,8 +8900,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); } } @@ -8954,10 +8914,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. */ @@ -8969,10 +8928,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. */ @@ -8993,18 +8951,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"); } } @@ -9037,28 +8991,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\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 @@ -9130,7 +9082,7 @@ bgp_show_neighbor (struct vty *vty, struct bgp *bgp, enum show_type type, 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 @@ -9182,10 +9134,9 @@ bgp_show_all_instances_neighbors_vty (struct vty *vty, u_char use_json) } else { - vty_out (vty, "\nInstance %s:%s", + 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); } @@ -9219,7 +9170,7 @@ 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 @@ -9326,8 +9277,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. */ @@ -9355,8 +9306,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. */ @@ -9399,9 +9350,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, "\nInstance %s:%s", - (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); } } @@ -9784,11 +9734,11 @@ 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, "\nBGP peer-group %s, remote AS %d%s", 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, "\nBGP peer-group %s, remote AS %d%s", 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, "\nBGP peer-group %s%s", group->name, VTYNL); + vty_out (vty, "\nBGP peer-group %s\n", group->name); } if ((group->bgp->as == conf->as) || (conf->as_type == AS_INTERNAL)) @@ -9825,15 +9775,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); } } } @@ -9852,9 +9802,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); } } @@ -11961,25 +11911,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); } } @@ -12306,25 +12255,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); } } @@ -12542,25 +12490,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); } } @@ -12644,21 +12591,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++; } @@ -12668,19 +12613,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++; } @@ -12691,19 +12636,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/eigrpd/eigrp_dump.c b/eigrpd/eigrp_dump.c index 70716d1667..75c49fb4b2 100644 --- a/eigrpd/eigrp_dump.c +++ b/eigrpd/eigrp_dump.c @@ -296,7 +296,7 @@ show_ip_eigrp_topology_header (struct vty *vty, struct eigrp *eigrp) struct in_addr router_id; router_id.s_addr = eigrp->router_id; - vty_out (vty, "\nEIGRP Topology Table for AS(%d)/ID(%s)%s\n", eigrp->AS, inet_ntoa(router_id), 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%s r - reply Status, s - sia Status%s\n", VTYNL, VTYNL); diff --git a/isisd/isisd.c b/isisd/isisd.c index f64f98a7da..473b6594e1 100644 --- a/isisd/isisd.c +++ b/isisd/isisd.c @@ -1560,8 +1560,8 @@ show_isis_database (struct vty *vty, const char *argv, int ui_level) ui_level, area->dynhostname); - vty_out (vty, " %u LSPs%s\n", - lsp_count, VTYNL); + vty_out (vty, " %u LSPs\n\n", + lsp_count); } } } diff --git a/lib/hash.c b/lib/hash.c index fb6d96ca76..71f200d851 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -462,13 +462,13 @@ DEFUN(show_hash_stats, vty_out (vty, "%s\n", underln); vty_out (vty, "# allocated: %d\n", _hashes->count); - vty_out (vty, "# named: %d%s\n", tt->nrows - 1, VTYNL); + 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); + vty_out (vty, "%s\n", table); XFREE (MTYPE_TMP, table); } else diff --git a/lib/if.c b/lib/if.c index 18da3f2f37..718ec7f016 100644 --- a/lib/if.c +++ b/lib/if.c @@ -739,7 +739,7 @@ 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; } @@ -792,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; @@ -818,8 +817,7 @@ DEFUN (show_address_vrf_all, if (!vrf->iflist || !listcount (vrf->iflist)) continue; - vty_out (vty, "\nVRF %u%s%s", vrf->vrf_id, VTYNL, - VTYNL); + vty_out (vty, "\nVRF %u\n\n", vrf->vrf_id); for (ALL_LIST_ELEMENTS_RO (vrf->iflist, node, ifp)) { @@ -828,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/memory_vty.c b/lib/memory_vty.c index 04909d633a..f65952e8a6 100644 --- a/lib/memory_vty.c +++ b/lib/memory_vty.c @@ -108,9 +108,8 @@ DEFUN (show_modules, { struct frrmod_runtime *plug = frrmod_list; - vty_out (vty, "%-12s %-25s %s%s\n", - "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; diff --git a/lib/ns.c b/lib/ns.c index dbf07b1976..4e7192c149 100644 --- a/lib/ns.c +++ b/lib/ns.c @@ -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; } @@ -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; } diff --git a/lib/vrf.c b/lib/vrf.c index 7fe5d9a87d..585341a40d 100644 --- a/lib/vrf.c +++ b/lib/vrf.c @@ -501,7 +501,7 @@ 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; } diff --git a/lib/vrf.h b/lib/vrf.h index 8baa15c96f..dcbc9b5e6c 100644 --- a/lib/vrf.h +++ b/lib/vrf.h @@ -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; \ diff --git a/lib/vty.c b/lib/vty.c index fea1842bf7..3841704120 100644 --- a/lib/vty.c +++ b/lib/vty.c @@ -1130,9 +1130,9 @@ vty_describe_command (struct vty *vty) 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 */ } @@ -2700,9 +2700,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; } @@ -2944,7 +2944,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++; } diff --git a/ospf6d/ospf6_abr.c b/ospf6d/ospf6_abr.c index b1f2401d58..314fe48732 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), VTYNL); + 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, VTYNL); + 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), VTYNL); + 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, VTYNL); - vty_out (vty, " Metric: %lu%s", - (u_long) OSPF6_ABR_SUMMARY_METRIC (router_lsa), VTYNL); + 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, VTYNL); + vty_out (vty, " Destination Router ID: %s\n", buf); return 0; } diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c index 7ee5c9b6e4..102eb5e0e1 100644 --- a/ospf6d/ospf6_area.c +++ b/ospf6d/ospf6_area.c @@ -371,20 +371,20 @@ 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, VTYNL); + vty_out (vty, " Area %s\n", oa->name); else { if (oa->no_summary) { - vty_out (vty, " Area %s[Stub, No Summary]%s", oa->name, VTYNL); + vty_out (vty, " Area %s[Stub, No Summary]\n", oa->name); } else { - vty_out (vty, " Area %s[Stub]%s", oa->name, VTYNL); + vty_out (vty, " Area %s[Stub]\n", oa->name); } } - vty_out (vty, " Number of Area scoped LSAs is %u%s", - oa->lsdb->count, VTYNL); + 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)) @@ -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, VTYNL); \ + 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, VTYNL); + 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, VTYNL); + 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, VTYNL); + vty_out (vty, "Range %s does not exists.\n", argv[idx_ipv6]->arg); return CMD_SUCCESS; } @@ -589,22 +589,22 @@ ospf6_area_config_write (struct vty *vty) if (IS_AREA_STUB (oa)) { if (oa->no_summary) - vty_out (vty, " area %s stub no-summary%s", oa->name, VTYNL); + vty_out (vty, " area %s stub no-summary\n", oa->name); else - vty_out (vty, " area %s stub%s", oa->name, VTYNL); + 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), VTYNL); + 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), VTYNL); + 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), VTYNL); + 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), VTYNL); + 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, VTYNL); + 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, VTYNL); + 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, VTYNL); + 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, VTYNL); + 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, VTYNL); + 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, VTYNL); + vty_out (vty, "No such Area: %s\n", argv[idx_ipv4_2]->arg); return CMD_SUCCESS; } diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c index 57b1e94815..37c7807958 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, VTYNL); + 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), VTYNL); + vty_out (vty, " redistribute %s\n", + ZROUTE_NAME (type)); } return 0; @@ -803,10 +803,10 @@ ospf6_redistribute_show_config (struct vty *vty) (ospf6->rmap[type].map ? "" : " (not found !)"), VTYNL); else - vty_out (vty, " %d: %s%s", nroute[type], - ZROUTE_NAME (type), VTYNL); + vty_out (vty, " %d: %s\n", nroute[type], + ZROUTE_NAME (type)); } - vty_out (vty, "Total %d routes%s", total, VTYNL); + vty_out (vty, "Total %d routes\n", total); } @@ -1247,28 +1247,24 @@ 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, VTYNL); - vty_out (vty, " Metric: %5lu%s", (u_long) OSPF6_ASBR_METRIC (external), - VTYNL); + 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, - VTYNL); + vty_out (vty, " Prefix Options: %s\n", buf); - vty_out (vty, " Referenced LSType: %d%s", - ntohs (external->prefix.prefix_refer_lstype), - VTYNL); + 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), VTYNL); + 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), - VTYNL); + vty_out (vty, " Forwarding-Address: %s\n", + ospf6_as_external_lsa_get_prefix_str (lsa, buf, sizeof(buf), 1)); } /* Tag */ @@ -1297,12 +1293,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, VTYNL); + forwarding); } DEFUN (show_ipv6_ospf6_redistribute, diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index c5026e2f77..adfc148795 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -917,10 +917,9 @@ 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, - VTYNL); - vty_out (vty, " Interface ID: %d%s", ifp->ifindex, VTYNL); + 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) { @@ -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, - VTYNL); + vty_out (vty, " inet : %s\n", strbuf); break; case AF_INET6: - vty_out (vty, " inet6: %s%s", strbuf, - VTYNL); + vty_out (vty, " inet6: %s\n", strbuf); break; default: - vty_out (vty, " ??? : %s%s", strbuf, - VTYNL); + 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, VTYNL); - vty_out (vty, " MTU mismatch detection: %s%s", oi->mtu_ignore ? - "disabled" : "enabled", VTYNL); + 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, - VTYNL); + vty_out (vty, " Area ID %s, Cost %u\n", strbuf, oi->cost); } else 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, - VTYNL); + oi->transdelay, oi->priority); vty_out (vty, " Timer intervals configured:\n"); - vty_out (vty, " Hello %d, Dead %d, Retransmit %d%s", - oi->hello_interval, oi->dead_interval, oi->rxmt_interval, - VTYNL); + 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, VTYNL); + 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, VTYNL); + 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"), - VTYNL); + (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, VTYNL); + 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"), - VTYNL); + (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, VTYNL); + 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, - VTYNL); + 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, VTYNL); + 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, VTYNL); + 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, VTYNL); + vty_out (vty, "%s's ospf6 ifmtu cannot go beyond physical mtu (%d)\n", + ifp->name, ifp->mtu6); return CMD_WARNING; } @@ -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, VTYNL); + 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, VTYNL); + 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, VTYNL); + vty_out (vty, "Cost %ld is out of range\n", lcost); return CMD_WARNING; } @@ -1769,45 +1759,45 @@ config_write_ospf6_interface (struct vty *vty) if (oi == NULL) continue; - vty_out (vty, "interface %s%s", - oi->interface->name, VTYNL); + vty_out (vty, "interface %s\n", + oi->interface->name); if (ifp->desc) - vty_out (vty, " description %s%s", ifp->desc, VTYNL); + vty_out (vty, " description %s\n", ifp->desc); if (oi->c_ifmtu) - vty_out (vty, " ipv6 ospf6 ifmtu %d%s", oi->c_ifmtu, VTYNL); + 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, VTYNL); + 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, VTYNL); + 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, VTYNL); + 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, VTYNL); + 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, VTYNL); + 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, VTYNL); + 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, VTYNL); + 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, VTYNL); + 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\n"); @@ -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, VTYNL); + vty_out (vty, "No such Interface: %s\n", argv[idx_ifname]->arg); return CMD_WARNING; } ospf6_interface_clear (vty, ifp); diff --git a/ospf6d/ospf6_intra.c b/ospf6d/ospf6_intra.c index 2f4e06e1e3..41271d8028 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, VTYNL); + 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), VTYNL); - 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)), VTYNL); - 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)), VTYNL); - 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)), VTYNL); + 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, VTYNL); + 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, VTYNL); + 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, VTYNL); - vty_out (vty, " LinkLocal Address: %s%s", buf, VTYNL); - vty_out (vty, " Number of Prefix: %d%s", prefixnum, VTYNL); + 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, VTYNL); + 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, VTYNL); + 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, VTYNL); + 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, - VTYNL); + 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, VTYNL); + 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, VTYNL); + vty_out (vty, " Prefix: %s/%d\n", + buf, prefix->prefix_length); } return 0; @@ -1798,13 +1797,13 @@ config_write_ospf6_debug_brouter (struct vty *vty) { 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, VTYNL); + 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, VTYNL); + 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 3f6263563d..7817448b78 100644 --- a/ospf6d/ospf6_lsa.c +++ b/ospf6d/ospf6_lsa.c @@ -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", VTYNL); + "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), VTYNL); + 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, VTYNL); + 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), VTYNL); + (u_long) ntohl (lsa->header->seqnum)); } } @@ -446,7 +446,7 @@ ospf6_lsa_show_dump (struct vty *vty, struct ospf6_lsa *lsa) end = (u_char *) lsa->header + ntohs (lsa->header->length); vty_out (vty, "\n"); - vty_out (vty, "%s:%s", lsa->name, VTYNL); + vty_out (vty, "%s:\n", lsa->name); for (current = start; current < end; current ++) { @@ -475,20 +475,20 @@ ospf6_lsa_show_internal (struct vty *vty, struct ospf6_lsa *lsa) adv_router, sizeof (adv_router)); vty_out (vty, "\n"); - vty_out (vty, "Age: %4hu Type: %s%s", ospf6_lsa_age_current (lsa), - ospf6_lstype_name (lsa->header->type), VTYNL); - vty_out (vty, "Link State ID: %s%s", id, VTYNL); - vty_out (vty, "Advertising Router: %s%s", adv_router, VTYNL); - vty_out (vty, "LS Sequence Number: %#010lx%s", - (u_long) ntohl (lsa->header->seqnum), VTYNL); - 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), VTYNL); - vty_out (vty, "Flag: %x %s", lsa->flag, VTYNL); - vty_out (vty, "Lock: %d %s", lsa->lock, VTYNL); - vty_out (vty, "ReTx Count: %d%s", lsa->retrans_count, VTYNL); - vty_out (vty, "Threads: Expire: 0x%p, Refresh: 0x%p %s", - (void *)lsa->expire, (void *)lsa->refresh, VTYNL); + 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,16 +511,16 @@ 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), VTYNL); - vty_out (vty, "Link State ID: %s%s", id, VTYNL); - vty_out (vty, "Advertising Router: %s%s", adv_router, VTYNL); - vty_out (vty, "LS Sequence Number: %#010lx%s", - (u_long) ntohl (lsa->header->seqnum), VTYNL); - 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), VTYNL); - vty_out (vty, "Duration: %s%s", duration, VTYNL); + ntohs (lsa->header->length)); + vty_out (vty, "Duration: %s\n", duration); handler = ospf6_get_lsa_handler (lsa->header->type); if (handler->show == NULL) @@ -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), VTYNL); + 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), VTYNL); + 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), VTYNL); + 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), VTYNL); + 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 b087802b31..5924afc38f 100644 --- a/ospf6d/ospf6_message.c +++ b/ospf6d/ospf6_message.c @@ -2487,13 +2487,11 @@ config_write_ospf6_debug_message (struct vty *vty) { if (IS_OSPF6_DEBUG_MESSAGE (i, SEND) && IS_OSPF6_DEBUG_MESSAGE (i, RECV)) - vty_out (vty, "debug ospf6 message %s%s", type_str[i], VTYNL); + 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], - VTYNL); + 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], - VTYNL); + 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 99f5830bfe..fec9929277 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", VTYNL); + "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], VTYNL); + 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", VTYNL); + "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], - VTYNL); + 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, - VTYNL); - 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, - VTYNL); - vty_out (vty, " His IfIndex: %d Link-local address: %s%s", - on->ifindex, linklocal_addr, - VTYNL); - vty_out (vty, " State %s for a duration of %s%s", - ospf6_neighbor_state_str[on->state], duration, - VTYNL); - vty_out (vty, " His choice of DR/BDR %s/%s, Priority %d%s", - drouter, bdrouter, on->priority, - VTYNL); - 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), - VTYNL); + "Master" : "Slave"), (u_long) ntohl (on->dbdesc_seqnum)); - vty_out (vty, " Summary-List: %d LSAs%s", on->summary_list->count, - VTYNL); + 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, VTYNL); + vty_out (vty, " %s\n", lsa->name); - vty_out (vty, " Request-List: %d LSAs%s", on->request_list->count, - VTYNL); + 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, VTYNL); + vty_out (vty, " %s\n", lsa->name); - vty_out (vty, " Retrans-List: %d LSAs%s", on->retrans_list->count, - VTYNL); + 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, VTYNL); + 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"), - VTYNL); + (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, VTYNL); + 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"), - VTYNL); + (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, VTYNL); + 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"), - VTYNL); + (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, VTYNL); + 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"), - VTYNL); + (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, VTYNL); + 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", VTYNL); + "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", VTYNL); + "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, - VTYNL); + vty_out (vty, "Router-ID is not parsable: %s\n", argv[idx_ipv4]->arg); return CMD_SUCCESS; } diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c index 1befbe248b..7b01c69a86 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, VTYNL); + destination, nexthop, IFNAMSIZ, ifname, duration); i++; } else - vty_out (vty, "%c%1s %2s %-30s %-25s %6.*s %s%s", - ' ', "", "", "", nexthop, IFNAMSIZ, ifname, "", VTYNL); + vty_out (vty, "%c%1s %2s %-30s %-25s %6.*s %s\n", + ' ', "", "", "", nexthop, IFNAMSIZ, ifname, ""); } } @@ -1078,66 +1078,63 @@ 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, VTYNL); + vty_out (vty, "Destination: %s\n", destination); /* destination type */ - vty_out (vty, "Destination type: %s%s", - OSPF6_DEST_TYPE_NAME (route->type), - VTYNL); + 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, VTYNL); + 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, VTYNL); + 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" : "-"), - VTYNL); - vty_out (vty, "Memory: prev: %p this: %p next: %p%s", - (void *)route->prev, (void *)route, (void *)route->next, VTYNL); + (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, VTYNL); + 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), VTYNL); + 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, VTYNL); + id, adv_router); /* Options */ ospf6_options_printbuf (route->path.options, options, sizeof (options)); - vty_out (vty, "Options: %s%s", options, VTYNL); + 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, VTYNL); + vty_out (vty, "Router Bits: %s\n", capa); /* Prefix Options */ vty_out (vty, "Prefix Options: xxx\n"); /* Metrics */ - vty_out (vty, "Metric Type: %d%s", route->path.metric_type, - VTYNL); - vty_out (vty, "Metric: %d (%d)%s", - route->path.cost, route->path.u.cost_e2, VTYNL); + 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:\n"); @@ -1146,7 +1143,7 @@ ospf6_route_show_detail (struct vty *vty, struct ospf6_route *route) /* 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, VTYNL); + vty_out (vty, " %s %.*s\n", nexthop, IFNAMSIZ, ifname); } vty_out (vty, "\n"); } @@ -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, VTYNL); - vty_out (vty, "Number of Destination: %d%s", destination, VTYNL); - vty_out (vty, "Number of Alternative routes: %d%s", alternative, VTYNL); - vty_out (vty, "Number of Equal Cost Multi Path: %d%s", ecmp, VTYNL); + 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], VTYNL); + 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, VTYNL); + 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", VTYNL); + 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, VTYNL); + (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, VTYNL); + (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, VTYNL); + 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, VTYNL); + vty_out (vty, "Malformed argument: %s\n", argv[i]->arg); return CMD_SUCCESS; } - vty_out (vty, "Malformed argument: %s%s", argv[i]->arg, VTYNL); + 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", VTYNL); + 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", VTYNL); */ - 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, VTYNL); + area); } DEFUN (debug_ospf6_route, diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c index c9f1740a9a..a1a5fbd700 100644 --- a/ospf6d/ospf6_spf.c +++ b/ospf6d/ospf6_spf.c @@ -742,7 +742,7 @@ 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, VTYNL); + vty_out (vty, "%s+-%s [%d]\n", prefix, v->name, v->cost); len = strlen (prefix) + 4; next_prefix = (char *) malloc (len); diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c index 9040e4ab9f..6acaf35e98 100644 --- a/ospf6d/ospf6_top.c +++ b/ospf6d/ospf6_top.c @@ -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, VTYNL); + 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, VTYNL); + 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, VTYNL); + 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, VTYNL); + 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, VTYNL); + 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, VTYNL); + 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, VTYNL); + 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, VTYNL); + vty_out (vty, "Wrong Area-ID: %s is attached to area %s\n", + oi->interface->name, oi->area->name); return CMD_SUCCESS; } @@ -799,14 +799,14 @@ 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, VTYNL); + 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, VTYNL); + vty_out (vty, " Running %s\n", duration); /* Redistribute configuration */ /* XXX */ @@ -829,27 +829,27 @@ 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, VTYNL); - 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, VTYNL); + (long long)o->ts_spf_duration.tv_usec); } else 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, VTYNL); + 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\n"); /* LSAs */ - vty_out (vty, " Number of AS scoped LSAs is %u%s", - o->lsdb->count, VTYNL); + 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), VTYNL); + 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)) { @@ -1021,7 +1021,7 @@ config_write_ospf6 (struct vty *vty) inet_ntop (AF_INET, &ospf6->router_id_static, router_id, sizeof (router_id)); vty_out (vty, "router ospf6\n"); if (ospf6->router_id_static != 0) - vty_out (vty, " router-id %s%s", router_id, VTYNL); + vty_out (vty, " router-id %s\n", router_id); /* log-adjacency-changes flag print. */ if (CHECK_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_CHANGES)) @@ -1037,8 +1037,7 @@ config_write_ospf6 (struct vty *vty) } if (ospf6->ref_bandwidth != OSPF6_REFERENCE_BANDWIDTH) - vty_out (vty, " auto-cost reference-bandwidth %d%s", ospf6->ref_bandwidth, - VTYNL); + vty_out (vty, " auto-cost reference-bandwidth %d\n", ospf6->ref_bandwidth); /* LSA timers print. */ if (ospf6->lsa_minarrival != OSPF_MIN_LS_ARRIVAL) @@ -1053,8 +1052,8 @@ 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, VTYNL); + vty_out (vty, " interface %s area %s\n", + oi->interface->name, oa->name); } vty_out (vty, "!\n"); return 0; diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c index 3ca9182f0c..b609b4bb20 100644 --- a/ospf6d/ospf6_zebra.c +++ b/ospf6d/ospf6_zebra.c @@ -320,11 +320,10 @@ DEFUN (show_zebra, } vty_out (vty, "Zebra Infomation\n"); - vty_out (vty, " enable: %d fail: %d%s", - zclient->enable, zclient->fail, VTYNL); - vty_out (vty, " redistribute default: %d%s", - vrf_bitmap_check (zclient->default_information, VRF_DEFAULT), - VTYNL); + 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++) { diff --git a/ospf6d/ospf6d.c b/ospf6d/ospf6d.c index bee7828a9a..13fb0ae3ca 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, VTYNL); + vty_out (vty, "Zebra OSPF6d Version: %s\n", + ospf6_daemon_version); 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, VTYNL); + vty_out (vty, "No Route found for Router ID: %s\n", argv[4]->arg); return CMD_SUCCESS; } @@ -1157,7 +1157,7 @@ DEFUN (show_ipv6_ospf6_linkstate, for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, node, oa)) { - vty_out (vty, "\n SPF Result in Area %s%s%s", oa->name, VTYNL, VTYNL); + 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); } @@ -1184,7 +1184,7 @@ DEFUN (show_ipv6_ospf6_linkstate_detail, for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, node, oa)) { - vty_out (vty, "\n SPF Result in Area %s%s%s", oa->name, VTYNL, VTYNL); + 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); } diff --git a/ospfd/ospf_dump.c b/ospfd/ospf_dump.c index 8707960aef..f233f79c00 100644 --- a/ospfd/ospf_dump.c +++ b/ospfd/ospf_dump.c @@ -1568,8 +1568,7 @@ show_debugging_ospf_common (struct vty *vty, struct ospf *ospf) int i; if (ospf->instance) - vty_out (vty, "\nOSPF Instance: %d%s\n", ospf->instance, - VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); vty_out (vty, "OSPF debugging status:\n"); diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index e0cbc842ec..98d36bb504 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -815,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; } @@ -868,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; } ck = ospf_crypt_key_new (); @@ -886,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; } @@ -1052,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]) { @@ -1184,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]) { @@ -2705,8 +2703,8 @@ show_ip_ospf_area (struct vty *vty, struct ospf_area *area, json_object *json_ar 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"); } } @@ -2792,9 +2790,9 @@ show_ip_ospf_area (struct vty *vty, struct ospf_area *area, json_object *json_ar if (CHECK_FLAG(area->stub_router_state, OSPF_AREA_ADMIN_STUB_ROUTED)) 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))); } } @@ -2848,26 +2846,26 @@ show_ip_ospf_area (struct vty *vty, struct ospf_area *area, json_object *json_ar " this area: %d%s", area->full_vls, VTYNL); /* 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) @@ -2879,12 +2877,12 @@ 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) @@ -2917,8 +2915,7 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) } else { - vty_out (vty, "\nOSPF Instance: %d%s%s", ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); } } @@ -2929,9 +2926,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 */ @@ -2945,9 +2941,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))); } } @@ -2965,9 +2961,9 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) { 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%s", + vty_out (vty, " RFC1583Compatibility flag is %s\n", CHECK_FLAG (ospf->config, OSPF_RFC1583_COMPATIBLE) ? - "enabled" : "disabled", VTYNL); + "enabled" : "disabled"); } if (use_json) @@ -2979,9 +2975,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 */ @@ -3000,11 +2995,11 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json) { 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); } } @@ -3049,12 +3044,10 @@ 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\n"); @@ -3078,23 +3071,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. */ @@ -3103,8 +3095,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)) { @@ -3125,9 +3117,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) @@ -3139,17 +3131,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)) { @@ -3175,7 +3167,7 @@ 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 @@ -3405,8 +3397,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,11 +3446,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) @@ -3472,9 +3463,8 @@ 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 */ { @@ -3490,9 +3480,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); } } @@ -3516,8 +3505,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, "\nOSPF Instance: %d%s%s", ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); } if (argc == iface_argv) @@ -3561,7 +3549,7 @@ 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 @@ -3621,10 +3609,9 @@ DEFUN (show_ip_ospf_instance_interface, static void show_ip_ospf_neighbour_header (struct vty *vty) { - vty_out (vty, "\n%-15s %3s %-15s %9s %-15s %-20s %5s %5s %5s%s", + 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 @@ -3685,10 +3672,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)); } } } @@ -3713,8 +3699,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, "\nOSPF Instance: %d%s%s", ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); } for (ALL_LIST_ELEMENTS_RO (ospf->oiflist, node, oi)) @@ -3722,7 +3707,7 @@ 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 @@ -3793,8 +3778,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, "\nOSPF Instance: %d%s%s", ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); } for (ALL_LIST_ELEMENTS_RO (ospf->oiflist, node, oi)) @@ -3824,9 +3808,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); } } } @@ -3834,7 +3818,7 @@ 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 @@ -3903,8 +3887,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, "\nOSPF Instance: %d%s%s", 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); @@ -3929,7 +3912,7 @@ 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 @@ -3996,8 +3979,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) @@ -4006,8 +3989,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) @@ -4023,13 +4006,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) @@ -4039,9 +4022,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) @@ -4050,8 +4032,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); @@ -4079,8 +4061,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) @@ -4089,8 +4071,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) @@ -4106,7 +4088,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) { @@ -4121,9 +4103,8 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, else { vty_out (vty, " Most recent state change statistics:\n"); - vty_out (vty, " Progressive change %s ago%s", - ospf_timeval_dump (&res, timebuf, sizeof(timebuf)), - VTYNL); + vty_out (vty, " Progressive change %s ago\n", + ospf_timeval_dump (&res, timebuf, sizeof(timebuf))); } } @@ -4141,10 +4122,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 : "??")); } } @@ -4158,7 +4138,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) @@ -4167,8 +4147,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) @@ -4183,30 +4163,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) @@ -4215,8 +4194,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) @@ -4225,8 +4204,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) @@ -4235,8 +4214,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) @@ -4245,8 +4224,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) { @@ -4278,8 +4257,7 @@ 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, "\nOSPF Instance: %d%s%s", ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); } ret = inet_aton (argv[arg_base]->arg, &router_id); @@ -4300,7 +4278,7 @@ 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 @@ -4366,8 +4344,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, "\nOSPF Instance: %d%s%s", ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); } for (ALL_LIST_ELEMENTS_RO (ospf->oiflist, node, oi)) @@ -4392,7 +4369,7 @@ 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 @@ -4458,8 +4435,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, "\nOSPF Instance: %d%s%s", ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); } for (ALL_LIST_ELEMENTS_RO (ospf->oiflist, node, oi)) @@ -4488,7 +4464,7 @@ 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 @@ -4561,8 +4537,7 @@ 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, "\nOSPF Instance: %d%s%s", 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); @@ -4593,7 +4568,7 @@ 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 @@ -4774,7 +4749,7 @@ show_ip_ospf_database_header (struct vty *vty, struct ospf_lsa *lsa) 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%s\n", ntohs (lsa->data->length), VTYNL); + vty_out (vty, " Length: %d\n\n", ntohs (lsa->data->length)); } const char *link_type_desc[] = @@ -4817,15 +4792,15 @@ 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, " 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%s", - ntohs (rl->link[i].metric), VTYNL); + vty_out (vty, " TOS 0 Metric: %d\n", + ntohs (rl->link[i].metric)); vty_out (vty, "\n"); } } @@ -4840,8 +4815,7 @@ 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, "\n"); @@ -4862,14 +4836,14 @@ 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, "\n"); } @@ -4887,10 +4861,8 @@ 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, " Network Mask: /%d\n", ip_masklen (sl->mask)); + vty_out (vty, " TOS: 0 Metric: %d\n", GET_METRIC (sl->metric)); vty_out (vty, "\n"); } @@ -4907,10 +4879,9 @@ 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, " Network Mask: /%d\n", + ip_masklen (sl->mask)); + vty_out (vty, " TOS: 0 Metric: %d\n", GET_METRIC (sl->metric)); vty_out (vty, "\n"); } @@ -4927,16 +4898,16 @@ 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); + "2 (Larger than any link state path)" : "1"); vty_out (vty, " TOS: 0\n"); - 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); + 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); @@ -4979,16 +4950,16 @@ 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); + "2 (Larger than any link state path)" : "1"); vty_out (vty, " TOS: 0\n"); - 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); + 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); @@ -5089,16 +5060,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, "\n %s (Area %s)%s%s", 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; @@ -5135,17 +5105,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, "\n %s (Area %s)%s%s", 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); } @@ -5177,11 +5146,10 @@ 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); @@ -5204,11 +5172,9 @@ 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); @@ -5233,12 +5199,12 @@ 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, "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"); } } @@ -5272,11 +5238,10 @@ show_ip_ospf_database_common (struct vty *vty, struct ospf *ospf, struct in_addr id, adv_router; if (ospf->instance) - vty_out (vty, "\nOSPF Instance: %d%s", ospf->instance, - VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n", ospf->instance); - vty_out (vty, "\n OSPF Router with ID (%s)%s%s", - 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) @@ -5431,11 +5396,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, "\nOSPF Instance: %d%s", ospf->instance, - VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n", ospf->instance); - vty_out (vty, "\n OSPF Router with ID (%s)%s%s", - 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) @@ -5904,7 +5868,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; } @@ -5972,7 +5936,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; } @@ -7806,11 +7770,11 @@ 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)) @@ -7843,14 +7807,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; @@ -7862,12 +7826,12 @@ 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)); } } } @@ -7901,24 +7865,21 @@ 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)); } } } @@ -7959,13 +7920,12 @@ 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)); } } } @@ -7976,8 +7936,7 @@ static int show_ip_ospf_border_routers_common (struct vty *vty, struct ospf *ospf) { if (ospf->instance) - vty_out (vty, "\nOSPF Instance: %d%s%s", ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); if (ospf->new_table == NULL) { @@ -8036,8 +7995,7 @@ static int show_ip_ospf_route_common (struct vty *vty, struct ospf *ospf) { if (ospf->instance) - vty_out (vty, "\nOSPF Instance: %d%s%s", ospf->instance, - VTYNL, VTYNL); + vty_out (vty, "\nOSPF Instance: %d\n\n", ospf->instance); if (ospf->new_table == NULL) { @@ -8143,11 +8101,9 @@ config_write_interface (struct vty *vty) continue; vty_out (vty, "!\n"); - vty_out (vty, "interface %s%s", ifp->name, - VTYNL); + 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++; @@ -8366,9 +8322,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; @@ -8392,16 +8348,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) @@ -8432,8 +8387,8 @@ config_write_ospf_area (struct vty *vty, struct ospf *ospf) 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)) @@ -8458,20 +8413,20 @@ config_write_ospf_area (struct vty *vty, struct ospf *ospf) } 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; @@ -8527,24 +8482,22 @@ 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)) @@ -8603,8 +8556,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; } @@ -8619,9 +8571,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) @@ -8659,7 +8611,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 @@ -8680,10 +8632,9 @@ config_write_ospf_distance (struct vty *vty, struct ospf *ospf) 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; } @@ -8703,7 +8654,7 @@ 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\n"); @@ -8714,13 +8665,13 @@ 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)) @@ -8744,38 +8695,38 @@ ospf_config_write (struct vty *vty) { 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); + 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); @@ -8789,9 +8740,9 @@ ospf_config_write (struct vty *vty) && 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)) { @@ -8806,10 +8757,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. */ diff --git a/ospfd/ospf_vty.h b/ospfd/ospf_vty.h index 7b888f439c..ba7b24ed95 100644 --- a/ospfd/ospf_vty.h +++ b/ospfd/ospf_vty.h @@ -44,8 +44,8 @@ } \ 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/ripngd/ripngd.c b/ripngd/ripngd.c index b90e289873..eb2d1a6930 100644 --- a/ripngd/ripngd.c +++ b/ripngd/ripngd.c @@ -2579,14 +2579,12 @@ DEFUN (show_ipv6_protocols, 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"); @@ -2766,14 +2764,11 @@ ripng_config_write (struct vty *vty) } #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/zebra/debug.c b/zebra/debug.c index 50c1f4dcb6..5abd111426 100644 --- a/zebra/debug.c +++ b/zebra/debug.c @@ -48,20 +48,17 @@ DEFUN (show_debugging_zebra, { 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" : ""); } } @@ -360,21 +357,18 @@ config_write_debug (struct vty *vty) { 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++; } } diff --git a/zebra/interface.c b/zebra/interface.c index 171dcf69c6..d7b2ebfe47 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -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_out (vty, "\n\tVRF %u%s\n", vrf->vrf_id, - VTYNL); + vty_out (vty, "\n\tVRF %u\n\n", vrf->vrf_id); if_show_description (vty, vrf->vrf_id); } diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c index a6d022dd59..d04aff2d39 100644 --- a/zebra/zebra_fpm.c +++ b/zebra/zebra_fpm.c @@ -1451,8 +1451,8 @@ zfpm_show_stats (struct vty *vty) zfpm_stats_t total_stats; time_t elapsed; - vty_out (vty, "\n%-40s %10s Last %2d secs%s\n", "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. diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c index 7b0d7bd786..78ca4d5f6f 100644 --- a/zebra/zebra_rnh.c +++ b/zebra/zebra_rnh.c @@ -1009,20 +1009,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)) diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 6e4c1b1850..6aaf7c86f9 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -656,9 +656,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); From cdda2010369cdcc2ffce5cb70ea112a13aacd9c3 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Thu, 13 Jul 2017 19:50:33 +0200 Subject: [PATCH 11/14] *: remove VTYNL, part 5 of 6 Signed-off-by: David Lamparter --- babeld/babel_main.c | 29 ++++---- bgpd/bgp_vty.c | 21 +++--- bgpd/bgpd.c | 164 ++++++++++++++++++++--------------------- bgpd/rfapi/rfapi.c | 2 +- bgpd/rfapi/rfapi_rib.c | 28 ++++--- bgpd/rfapi/rfapi_vty.c | 27 ++++--- ospf6d/ospf6_asbr.c | 5 +- 7 files changed, 134 insertions(+), 142 deletions(-) diff --git a/babeld/babel_main.c b/babeld/babel_main.c index 725b2b4321..517489f15f 100644 --- a/babeld/babel_main.c +++ b/babeld/babel_main.c @@ -378,24 +378,21 @@ void show_babel_main_configuration (struct vty *vty) { vty_out (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" + "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, VTYNL, + 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/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index cf4ee26379..851a223159 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -616,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; } } @@ -3414,7 +3414,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; } @@ -6943,8 +6943,8 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi, if (bgp->v_maxmed_admin) 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\n", ents, @@ -7088,8 +7088,8 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi, 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\n", afi_safi_print(afi, safi)); @@ -7646,8 +7646,8 @@ bgp_show_peer_afi (struct vty *vty, struct peer *p, afi_t afi, safi_t safi, 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, " 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)); } @@ -8811,7 +8811,7 @@ 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 @@ -9112,8 +9112,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; } diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 54d4a66ad3..7432ed19ac 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); } } @@ -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. */ @@ -7023,61 +7023,61 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp, 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); } } } @@ -7170,8 +7170,8 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp, 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. */ @@ -7198,16 +7198,16 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp, 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" : ""); } } } diff --git a/bgpd/rfapi/rfapi.c b/bgpd/rfapi/rfapi.c index 6e2f3f2b88..1b44cf6c0a 100644 --- a/bgpd/rfapi/rfapi.c +++ b/bgpd/rfapi/rfapi.c @@ -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); diff --git a/bgpd/rfapi/rfapi_rib.c b/bgpd/rfapi/rfapi_rib.c index 5c3976a0c1..2635ffeb59 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,11 +2500,10 @@ rfapiRibShowResponses ( { ++printedheader; - fp (out, "%s[%s]%s", + fp (out, "%s[%s]\n", VTYNL, - show_removed ? "Removed" : "Active", VTYNL); - fp (out, "%-15s %-15s%s", "Querying VN", "Querying UN", - VTYNL); + show_removed ? "Removed" : "Active"); + fp (out, "%-15s %-15s\n", "Querying VN", "Querying UN"); fp (out, " %-20s %-15s %-15s %4s %-8s %-8s%s", "Prefix", "Registered VN", "Registered UN", "Cost", "Lifetime", @@ -2523,14 +2522,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 +2540,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 2137aaad3c..06df51644c 100644 --- a/bgpd/rfapi/rfapi_vty.c +++ b/bgpd/rfapi/rfapi_vty.c @@ -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; } diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c index 37c7807958..795c7f5ffa 100644 --- a/ospf6d/ospf6_asbr.c +++ b/ospf6d/ospf6_asbr.c @@ -798,10 +798,9 @@ 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 !)"), - VTYNL); + (ospf6->rmap[type].map ? "" : " (not found !)")); else vty_out (vty, " %d: %s\n", nroute[type], ZROUTE_NAME (type)); From 625e016d14073dfefb69c0fa36cddb81fbe034ed Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Thu, 13 Jul 2017 20:17:06 +0200 Subject: [PATCH 12/14] *: remove VTYNL, part 6 of 6 Signed-off-by: David Lamparter --- bgpd/rfapi/rfapi_rib.c | 11 ++-- bgpd/rfapi/rfapi_vty.c | 4 +- eigrpd/eigrp_dump.c | 17 +++--- ldpd/ldp_vty_exec.c | 56 ++++++++++--------- lib/grammar_sandbox.c | 4 +- lib/hash.c | 2 +- lib/route_types.pl | 12 ++--- lib/thread.c | 4 +- lib/vrf.c | 4 +- lib/vty.h | 4 +- nhrpd/nhrp_vty.c | 6 +-- ospf6d/ospf6_asbr.c | 4 +- ospf6d/ospf6_top.c | 16 +++--- ospf6d/ospf6d.c | 118 ++++++++++++++++++++--------------------- ospfd/ospf_vty.c | 57 ++++++++++---------- pimd/pim_cmd.c | 46 ++++++++-------- ripd/ripd.c | 11 ++-- ripngd/ripng_peer.c | 4 +- ripngd/ripngd.c | 12 ++--- tests/lib/test_heavy.c | 2 +- 20 files changed, 189 insertions(+), 205 deletions(-) diff --git a/bgpd/rfapi/rfapi_rib.c b/bgpd/rfapi/rfapi_rib.c index 2635ffeb59..380b047577 100644 --- a/bgpd/rfapi/rfapi_rib.c +++ b/bgpd/rfapi/rfapi_rib.c @@ -2500,19 +2500,18 @@ rfapiRibShowResponses ( { ++printedheader; - fp (out, "%s[%s]\n", - VTYNL, + 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%s", + 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) { diff --git a/bgpd/rfapi/rfapi_vty.c b/bgpd/rfapi/rfapi_vty.c index 06df51644c..1b55fbbda9 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 diff --git a/eigrpd/eigrp_dump.c b/eigrpd/eigrp_dump.c index 75c49fb4b2..9e18c0dca2 100644 --- a/eigrpd/eigrp_dump.c +++ b/eigrpd/eigrp_dump.c @@ -210,11 +210,11 @@ void show_ip_eigrp_interface_header (struct vty *vty, struct eigrp *eigrp) { - vty_out (vty, "\n%s%d%s%s%s %-10s %-10s %-10s %-6s %-12s %-7s %-14s %-12s %-8s %-8s %-8s%s %-39s %-12s %-7s %-14s %-12s %-8s\n", - "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"); } @@ -256,11 +256,11 @@ show_ip_eigrp_interface_detail (struct vty *vty, struct eigrp *eigrp, void show_ip_eigrp_neighbor_header (struct vty *vty, struct eigrp *eigrp) { - vty_out (vty, "\n%s%d%s%s%s%-3s %-17s %-20s %-6s %-8s %-6s %-5s %-5s %-5s%s %-41s %-6s %-8s %-6s %-4s %-6s %-5s \n", - "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 @@ -298,8 +298,7 @@ show_ip_eigrp_topology_header (struct vty *vty, struct eigrp *eigrp) 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%s r - reply Status, s - sia Status%s\n", - VTYNL, VTYNL); + "R - Reply\n r - reply Status, s - sia Status\n\n"); } void diff --git a/ldpd/ldp_vty_exec.c b/ldpd/ldp_vty_exec.c index ed87e21387..bec1375bd2 100644 --- a/ldpd/ldp_vty_exec.c +++ b/ldpd/ldp_vty_exec.c @@ -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; @@ -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; } } @@ -869,11 +869,10 @@ show_nbr_detail_msg_json(struct imsg *imsg, struct show_params *params, void show_nbr_capabilities(struct vty *vty, struct ctl_nbr *nbr) { - vty_out (vty, " Capabilities Sent:%s" - " - Dynamic Announcement (0x0506)%s" - " - Typed Wildcard (0x050B)%s" - " - Unrecognized Notification (0x0603)\n", - VTYNL, VTYNL, VTYNL); + 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_out (vty," - Dynamic Announcement (0x0506)\n"); @@ -1077,15 +1076,15 @@ show_lib_detail_msg(struct vty *vty, struct imsg *imsg, struct show_params *para 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) { @@ -1695,11 +1694,10 @@ ldp_vty_show_capabilities(struct vty *vty, int json) } vty_out (vty, - "Supported LDP Capabilities%s" - " * Dynamic Announcement (0x0506)%s" - " * Typed Wildcard (0x050B)%s" - " * Unrecognized Notification (0x0603)%s\n", VTYNL, - VTYNL, VTYNL, VTYNL); + "Supported LDP Capabilities\n" + " * Dynamic Announcement (0x0506)\n" + " * Typed Wildcard (0x050B)\n" + " * Unrecognized Notification (0x0603)\n\n"); return (0); } diff --git a/lib/grammar_sandbox.c b/lib/grammar_sandbox.c index edf55fba99..f6bc3e772c 100644 --- a/lib/grammar_sandbox.c +++ b/lib/grammar_sandbox.c @@ -414,9 +414,9 @@ DEFUN (grammar_findambig, if (same) { vty_out (vty, "'%s' AMBIGUOUS:\n", cur->cmd); - vty_out (vty, " %s%s '%s'\n", prev->el->name, VTYNL, + vty_out (vty, " %s\n '%s'\n", prev->el->name, prev->el->string); - vty_out (vty, " %s%s '%s'\n", cur->el->name, VTYNL, + vty_out (vty, " %s\n '%s'\n", cur->el->name, cur->el->string); vty_out (vty, "\n"); ambig++; diff --git a/lib/hash.c b/lib/hash.c index 71f200d851..166bc7a260 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -467,7 +467,7 @@ DEFUN(show_hash_stats, if (tt->nrows > 1) { ttable_colseps (tt, 0, RIGHT, true, '|'); - char *table = ttable_dump (tt, VTYNL); + char *table = ttable_dump (tt, "\n"); vty_out (vty, "%s\n", table); XFREE (MTYPE_TMP, table); } diff --git a/lib/route_types.pl b/lib/route_types.pl index 29bcd3a672..9d50acaaed 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/thread.c b/lib/thread.c index df524d4aed..710ecc2a09 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -163,12 +163,12 @@ cpu_record_print(struct vty *vty, thread_type filter) else 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_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):"); diff --git a/lib/vrf.c b/lib/vrf.c index 585341a40d..03214736c2 100644 --- a/lib/vrf.c +++ b/lib/vrf.c @@ -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; } diff --git a/lib/vty.h b/lib/vty.h index 27deaea3ef..66450065f2 100644 --- a/lib/vty.h +++ b/lib/vty.h @@ -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; \ } @@ -198,7 +198,7 @@ struct vty_arg #define VNL "\n" \ CPP_WARN("VNL has been replaced with \\n.") #define VTYNL "\n" \ -/* CPP_WARN("VTYNL has been replaced with \\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);} \ diff --git a/nhrpd/nhrp_vty.c b/nhrpd/nhrp_vty.c index 01300cb5cb..2c680d1082 100644 --- a/nhrpd/nhrp_vty.c +++ b/nhrpd/nhrp_vty.c @@ -678,14 +678,12 @@ static void show_ip_opennhrp_cache(struct nhrp_cache *c, void *pctx) return; vty_out(ctx->vty, - "Type: %s%s" - "Flags:%s%s%s" + "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))); diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c index 795c7f5ffa..038ac53d6f 100644 --- a/ospf6d/ospf6_asbr.c +++ b/ospf6d/ospf6_asbr.c @@ -1269,8 +1269,8 @@ ospf6_as_external_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) /* 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), VTYNL); + vty_out (vty, " Tag: %"ROUTE_TAG_PRI"\n", + ospf6_as_external_lsa_get_tag (lsa)); } return 0; diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c index 6acaf35e98..9e0b86b7ba 100644 --- a/ospf6d/ospf6_top.c +++ b/ospf6d/ospf6_top.c @@ -814,14 +814,14 @@ ospf6_show (struct vty *vty, struct ospf6 *o) 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, VTYNL, - o->spf_holdtime, VTYNL, - o->spf_max_holdtime, VTYNL, - o->spf_hold_multiplier, VTYNL); + 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) diff --git a/ospf6d/ospf6d.c b/ospf6d/ospf6d.c index 13fb0ae3ca..c4a4990317 100644 --- a/ospf6d/ospf6d.c +++ b/ospf6d/ospf6d.c @@ -115,11 +115,11 @@ config_write_ospf6_debug (struct vty *vty) } #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, VTYNL, oa->name, VTYNL, VTYNL); + vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name); ospf6_lsdb_show (vty, level, NULL, NULL, NULL, oa->lsdb); } @@ -197,13 +197,13 @@ DEFUN (show_ipv6_ospf6_database, { for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) { - vty_out (vty, IF_LSDB_TITLE_FORMAT, VTYNL, - oi->interface->name, oa->name, VTYNL, VTYNL); + 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, VTYNL, VTYNL, VTYNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, NULL, NULL, NULL, o->lsdb); vty_out (vty, "\n"); @@ -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, VTYNL, oa->name, VTYNL, VTYNL); + 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, VTYNL, - oi->interface->name, oa->name, VTYNL, VTYNL); + 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, VTYNL, VTYNL, VTYNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, &type, NULL, NULL, o->lsdb); break; @@ -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, VTYNL, oa->name, VTYNL, VTYNL); + vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name); ospf6_lsdb_show (vty, level, NULL, &id, NULL, oa->lsdb); } @@ -321,13 +321,13 @@ DEFUN (show_ipv6_ospf6_database_id, { for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) { - vty_out (vty, IF_LSDB_TITLE_FORMAT, VTYNL, - oi->interface->name, oa->name, VTYNL, VTYNL); + 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, VTYNL, VTYNL, VTYNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, NULL, &id, NULL, o->lsdb); vty_out (vty, "\n"); @@ -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, VTYNL, oa->name, VTYNL, VTYNL); + vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name); ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oa->lsdb); } @@ -372,13 +372,13 @@ DEFUN (show_ipv6_ospf6_database_router, { for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) { - vty_out (vty, IF_LSDB_TITLE_FORMAT, VTYNL, - oi->interface->name, oa->name, VTYNL, VTYNL); + 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, VTYNL, VTYNL, VTYNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb); vty_out (vty, "\n"); @@ -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, VTYNL, oa->name, VTYNL, VTYNL); + 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, VTYNL, - oi->interface->name, oa->name, VTYNL, VTYNL); + 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, VTYNL, VTYNL, VTYNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, &type, &id, NULL, o->lsdb); break; @@ -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, VTYNL, oa->name, VTYNL, VTYNL); + 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, VTYNL, - oi->interface->name, oa->name, VTYNL, VTYNL); + 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, VTYNL, VTYNL, VTYNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, o->lsdb); break; @@ -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, VTYNL, oa->name, VTYNL, VTYNL); + vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name); ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oa->lsdb); } @@ -580,13 +580,13 @@ DEFUN (show_ipv6_ospf6_database_id_router, { for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) { - vty_out (vty, IF_LSDB_TITLE_FORMAT, VTYNL, - oi->interface->name, oa->name, VTYNL, VTYNL); + 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, VTYNL, VTYNL, VTYNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb); vty_out (vty, "\n"); @@ -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, VTYNL, oa->name, VTYNL, VTYNL); + vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name); ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oa->lsdb); } @@ -635,13 +635,13 @@ 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, VTYNL, - oi->interface->name, oa->name, VTYNL, VTYNL); + 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, VTYNL, VTYNL, VTYNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb); vty_out (vty, "\n"); @@ -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, VTYNL, oa->name, VTYNL, VTYNL); + 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, VTYNL, - oi->interface->name, oa->name, VTYNL, VTYNL); + 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, VTYNL, VTYNL, VTYNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb); break; @@ -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, VTYNL, oa->name, VTYNL, VTYNL); + 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, VTYNL, - oi->interface->name, oa->name, VTYNL, VTYNL); + 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, VTYNL, VTYNL, VTYNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb); break; @@ -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, VTYNL, oa->name, VTYNL, VTYNL); + vty_out (vty, AREA_LSDB_TITLE_FORMAT, oa->name); ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oa->lsdb); } @@ -839,13 +839,13 @@ DEFUN (show_ipv6_ospf6_database_self_originated, { for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) { - vty_out (vty, IF_LSDB_TITLE_FORMAT, VTYNL, - oi->interface->name, oa->name, VTYNL, VTYNL); + 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, VTYNL, VTYNL, VTYNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb); vty_out (vty, "\n"); @@ -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, VTYNL, oa->name, VTYNL, VTYNL); + 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, VTYNL, - oi->interface->name, oa->name, VTYNL, VTYNL); + 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, VTYNL, VTYNL, VTYNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, o->lsdb); break; @@ -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, VTYNL, oa->name, VTYNL, VTYNL); + 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, VTYNL, - oi->interface->name, oa->name, VTYNL, VTYNL); + 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, VTYNL, VTYNL, VTYNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb); break; @@ -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, VTYNL, oa->name, VTYNL, VTYNL); + 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, VTYNL, - oi->interface->name, oa->name, VTYNL, VTYNL); + 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, VTYNL, VTYNL, VTYNL); + vty_out (vty, AS_LSDB_TITLE_FORMAT); ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb); break; diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 98d36bb504..89fd7971f0 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -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; } @@ -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; } @@ -1356,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; } @@ -2716,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) { @@ -2830,7 +2829,7 @@ 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 "); @@ -2843,7 +2842,7 @@ show_ip_ospf_area (struct vty *vty, struct ospf_area *area, json_object *json_ar 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\n", @@ -3013,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) @@ -3104,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. */ @@ -4909,8 +4908,8 @@ show_as_external_lsa_detail (struct vty *vty, struct ospf_lsa *lsa) 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; @@ -4961,8 +4960,8 @@ show_as_nssa_lsa_detail (struct vty *vty, struct ospf_lsa *lsa) 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; @@ -7906,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; } @@ -8502,10 +8501,10 @@ config_write_virtual_link (struct vty *vty, struct ospf *ospf) 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); } } @@ -8694,7 +8693,7 @@ ospf_config_write (struct vty *vty) if (ospf->ref_bandwidth != OSPF_DEFAULT_REF_BANDWIDTH) { vty_out (vty, "! Important: ensure reference bandwidth " - "is consistent across all routers%s", VTYNL); + "is consistent across all routers\n"); vty_out (vty, " auto-cost reference-bandwidth %d\n", ospf->ref_bandwidth); } diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index 4bc367e408..94f7d1534b 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -221,11 +221,10 @@ static void pim_show_assert_internal(struct vty *vty) struct in_addr ifaddr; vty_out (vty, - "CA: CouldAssert%s" - "ECA: Evaluate CouldAssert%s" - "ATD: AssertTrackingDesired%s" - "eATD: Evaluate AssertTrackingDesired%s\n", - VTYNL, VTYNL, VTYNL, VTYNL); + "CA: CouldAssert\n" + "ECA: Evaluate CouldAssert\n" + "ATD: AssertTrackingDesired\n" + "eATD: Evaluate AssertTrackingDesired\n\n"); vty_out (vty, "Interface Address Source Group CA eCA ATD eATD\n"); @@ -2149,19 +2148,19 @@ static void show_rpf_refresh_stats(struct vty *vty, time_t now, json_object *jso json_object_int_add(json, "nexthopLookupsAvoided", nexthop_lookups_avoided); } else { vty_out (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" + "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, 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, + 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,11 +2176,11 @@ static void show_scan_oil_stats(struct vty *vty, time_t now) pim_time_uptime_begin(uptime_mroute_del, sizeof(uptime_mroute_del), now, qpim_mroute_del_last); vty_out (vty, - "Scan OIL - Last: %s Events: %lld%s" - "MFC Add - Last: %s Events: %lld%s" + "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, VTYNL, - uptime_mroute_add, (long long) qpim_mroute_add_events, VTYNL, + 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); } @@ -3214,13 +3213,12 @@ 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; diff --git a/ripd/ripd.c b/ripd/ripd.c index 5bbab7e4cd..c93d16647c 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -3474,12 +3474,11 @@ DEFUN (show_ip_rip, if (! rip) return CMD_SUCCESS; - vty_out (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\n", - 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) diff --git a/ripngd/ripng_peer.c b/ripngd/ripng_peer.c index 03f3b4e05f..f27c33f37c 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_out (vty, " %s %s%14s %10d %10d %10d %s\n", 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/ripngd.c b/ripngd/ripngd.c index eb2d1a6930..0b1faae03d 100644 --- a/ripngd/ripngd.c +++ b/ripngd/ripngd.c @@ -2004,13 +2004,11 @@ DEFUN (show_ipv6_ripng, return CMD_SUCCESS; /* Header of display. */ - vty_out (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\n", - 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)) { diff --git a/tests/lib/test_heavy.c b/tests/lib/test_heavy.c index 382d1623f3..c6f6bbba2a 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 From 50790e72fb676f6f5d6a775552770aba8b2e59cc Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Fri, 14 Jul 2017 13:09:47 +0200 Subject: [PATCH 13/14] *: remove vty_outln again (PRs merged to master added another few vty_outln() calls) Signed-off-by: David Lamparter --- bgpd/bgp_routemap.c | 4 ++-- bgpd/bgp_vty.c | 12 ++++++------ lib/grammar_sandbox.c | 2 +- lib/hash.c | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index de2a8764c8..b31a731543 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -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; } @@ -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; } diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index b5cbd35460..5539446169 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -2739,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; } @@ -2891,7 +2891,7 @@ DEFUN (neighbor_peer_group, 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; } @@ -3662,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; } @@ -3707,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; } @@ -5159,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; } } @@ -5189,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; } diff --git a/lib/grammar_sandbox.c b/lib/grammar_sandbox.c index 81c2ca5c30..9f4c071abf 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) diff --git a/lib/hash.c b/lib/hash.c index 47f336c1e9..7c355b2d83 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; } From 28b672fcd33f328964c91f0a3d06cd904bddad42 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Fri, 14 Jul 2017 13:18:14 +0200 Subject: [PATCH 14/14] lib, vtysh: remove now-useless newline arg It's always \n now, hooray. Signed-off-by: David Lamparter --- lib/command.c | 7 +++---- lib/command.h | 2 +- lib/vty.c | 2 +- vtysh/vtysh.c | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/command.c b/lib/command.c index 454f0957c5..6d304fc12b 100644 --- a/lib/command.c +++ b/lib/command.c @@ -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; } diff --git a/lib/command.h b/lib/command.h index f712407b7f..5bde830015 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/vty.c b/lib/vty.c index 9439e38834..3785070860 100644 --- a/lib/vty.c +++ b/lib/vty.c @@ -1118,7 +1118,7 @@ vty_describe_command (struct vty *vty) if (vector_active (varcomps) > 0) { - char *ac = cmd_variable_comp2str(varcomps, vty->width, "\n"); + char *ac = cmd_variable_comp2str(varcomps, vty->width); vty_out(vty, "%s\n", ac); XFREE(MTYPE_TMP, ac); } diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 5f89afdd03..e4bf5b257a 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); }