diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-06-21 03:10:57 +0000 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-06-29 17:31:28 +0000 |
| commit | 96ade3ed7716c89b8047a1c0ab3377985d461cf8 (patch) | |
| tree | 1c3061738c2c0027612b6cdb3e5d5eccb08587bf /zebra/zebra_vty.c | |
| parent | 4d5f445750e01467898eee47796e80d808500d56 (diff) | |
*: use vty_outln
Saves 400 lines
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_vty.c')
| -rw-r--r-- | zebra/zebra_vty.c | 200 |
1 files changed, 94 insertions, 106 deletions
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index c4e8634f2a..49d0868cbf 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_out (vty, "%% Malformed address%s", VTY_NEWLINE); + vty_outln (vty, "%% Malformed address"); 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_out (vty, "%% Malformed address%s", VTY_NEWLINE); + vty_outln (vty, "%% Malformed address"); 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_out (vty, "%% vrf %s is not defined%s", vrf_id_str, VTY_NEWLINE); + vty_outln (vty, "%% vrf %s is not defined", 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_out (vty, "%% MPLS not turned on in kernel, ignoring command%s", - VTY_NEWLINE); + vty_outln (vty, + "%% MPLS not turned on in kernel, ignoring command"); return CMD_WARNING; } int rc = mpls_str2label (label_str, &snh_label.num_labels, @@ -132,16 +132,15 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, { switch (rc) { case -1: - vty_out (vty, "%% Malformed label(s)%s", VTY_NEWLINE); + vty_outln (vty, "%% Malformed label(s)"); break; case -2: - vty_out (vty, "%% Cannot use reserved label(s) (%d-%d)%s", - MPLS_MIN_RESERVED_LABEL, MPLS_MAX_RESERVED_LABEL, - VTY_NEWLINE); + vty_outln (vty, "%% Cannot use reserved label(s) (%d-%d)", + MPLS_MIN_RESERVED_LABEL,MPLS_MAX_RESERVED_LABEL); break; case -3: - vty_out (vty, "%% Too many labels. Enter %d or fewer%s", - MPLS_MAX_LABELS, VTY_NEWLINE); + vty_outln (vty, "%% Too many labels. Enter %d or fewer", + MPLS_MAX_LABELS); break; } return CMD_WARNING; @@ -153,7 +152,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, { if (flag_str) { - vty_out (vty, "%% can not have flag %s with Null0%s", flag_str, VTY_NEWLINE); + vty_outln (vty, "%% can not have flag %s with Null0", flag_str); return CMD_WARNING; } if (add_cmd) @@ -177,7 +176,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, SET_FLAG (flag, ZEBRA_FLAG_BLACKHOLE); break; default: - vty_out (vty, "%% Malformed flag %s %s", flag_str, VTY_NEWLINE); + vty_outln (vty, "%% Malformed flag %s ", flag_str); return CMD_WARNING; } } @@ -202,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_out (vty, "%% Unknown interface: %s%s", gate_str, VTY_NEWLINE); + vty_outln (vty, "%% Unknown interface: %s", gate_str); ifindex = IFINDEX_DELETED; } else @@ -287,7 +286,7 @@ DEFUN (ip_multicast_mode, multicast_mode_ipv4_set (MCAST_MIX_PFXLEN); else { - vty_out (vty, "Invalid mode specified%s", VTY_NEWLINE); + vty_outln (vty, "Invalid mode specified"); return CMD_WARNING; } @@ -341,7 +340,7 @@ DEFUN (show_ip_rpf_addr, ret = inet_aton (argv[idx_ipv4]->arg, &addr); if (ret == 0) { - vty_out (vty, "%% Malformed address%s", VTY_NEWLINE); + vty_outln (vty, "%% Malformed address"); return CMD_WARNING; } @@ -350,7 +349,7 @@ DEFUN (show_ip_rpf_addr, if (re) vty_show_ip_route_detail (vty, rn, 1); else - vty_out (vty, "%% No match for RPF lookup%s", VTY_NEWLINE); + vty_outln (vty, "%% No match for RPF lookup"); return CMD_SUCCESS; } @@ -1115,18 +1114,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_out (vty, "{}%s", VTY_NEWLINE); + vty_outln (vty, "{}"); else - vty_out (vty, "vrf %s not defined%s", vrf_name, VTY_NEWLINE); + vty_outln (vty, "vrf %s not defined", vrf_name); return CMD_SUCCESS; } if (zvrf_id (zvrf) == VRF_UNKNOWN) { if (use_json) - vty_out (vty, "{}%s", VTY_NEWLINE); + vty_outln (vty, "{}"); else - vty_out (vty, "vrf %s inactive%s", vrf_name, VTY_NEWLINE); + vty_outln (vty, "vrf %s inactive", vrf_name); return CMD_SUCCESS; } @@ -1134,7 +1133,7 @@ do_show_ip_route (struct vty *vty, const char *vrf_name, afi_t afi, safi_t safi, if (! table) { if (use_json) - vty_out (vty, "{}%s", VTY_NEWLINE); + vty_outln (vty, "{}"); return CMD_SUCCESS; } @@ -1191,7 +1190,8 @@ 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:%s", VTY_NEWLINE, zvrf_name (zvrf), VTY_NEWLINE); + vty_outln (vty, "%sVRF %s:", VTY_NEWLINE, + zvrf_name(zvrf)); first = 0; } @@ -1210,7 +1210,8 @@ do_show_ip_route (struct vty *vty, const char *vrf_name, afi_t afi, safi_t safi, if (use_json) { - vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTY_NEWLINE); + vty_outln (vty, "%s", + json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } @@ -1250,7 +1251,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:%s", VTY_NEWLINE, zvrf_name (zvrf), VTY_NEWLINE); + vty_outln (vty, "%sVRF %s:", VTY_NEWLINE, zvrf_name(zvrf)); zebra_print_rnh_table(zvrf_id (zvrf), AF_INET, vty, RNH_NEXTHOP_TYPE); } @@ -1290,7 +1291,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:%s", VTY_NEWLINE, zvrf_name (zvrf), VTY_NEWLINE); + vty_outln (vty, "%sVRF %s:", VTY_NEWLINE, zvrf_name(zvrf)); zebra_print_rnh_table(zvrf_id (zvrf), AF_INET6, vty, RNH_NEXTHOP_TYPE); } @@ -1447,7 +1448,7 @@ DEFUN (show_ip_route, if (type < 0) { - vty_out (vty, "Unknown route type%s", VTY_NEWLINE); + vty_outln (vty, "Unknown route type"); return CMD_WARNING; } } @@ -1500,7 +1501,7 @@ DEFUN (show_ip_route_addr, if (ret <= 0) { - vty_out (vty, "%% Malformed IPv4 address%s", VTY_NEWLINE); + vty_outln (vty, "%% Malformed IPv4 address"); return CMD_WARNING; } @@ -1511,7 +1512,7 @@ DEFUN (show_ip_route_addr, rn = route_node_match (table, (struct prefix *) &p); if (! rn) { - vty_out (vty, "%% Network not in table%s", VTY_NEWLINE); + vty_outln (vty, "%% Network not in table"); return CMD_WARNING; } @@ -1549,7 +1550,7 @@ DEFUN (show_ip_route_prefix, if (ret <= 0) { - vty_out (vty, "%% Malformed IPv4 address%s", VTY_NEWLINE); + vty_outln (vty, "%% Malformed IPv4 address"); return CMD_WARNING; } @@ -1560,7 +1561,7 @@ DEFUN (show_ip_route_prefix, rn = route_node_match (table, (struct prefix *) &p); if (! rn || rn->p.prefixlen != p.prefixlen) { - vty_out (vty, "%% Network not in table%s", VTY_NEWLINE); + vty_outln (vty, "%% Network not in table"); return CMD_WARNING; } @@ -1609,10 +1610,9 @@ vty_show_ip_route_summary (struct vty *vty, struct route_table *table) } } - vty_out (vty, "%-20s %-20s %s (vrf %s)%s", + vty_outln (vty, "%-20s %-20s %s (vrf %s)", "Route Source", "Routes", "FIB", - zvrf_name (((rib_table_info_t *)table->info)->zvrf), - VTY_NEWLINE); + zvrf_name(((rib_table_info_t *)table->info)->zvrf)); for (i = 0; i < ZEBRA_ROUTE_MAX; i++) { @@ -1621,23 +1621,21 @@ vty_show_ip_route_summary (struct vty *vty, struct route_table *table) { if (i == ZEBRA_ROUTE_BGP) { - vty_out (vty, "%-20s %-20d %-20d %s", "ebgp", - rib_cnt[ZEBRA_ROUTE_BGP], fib_cnt[ZEBRA_ROUTE_BGP], - VTY_NEWLINE); - vty_out (vty, "%-20s %-20d %-20d %s", "ibgp", - rib_cnt[ZEBRA_ROUTE_IBGP], fib_cnt[ZEBRA_ROUTE_IBGP], - VTY_NEWLINE); + vty_outln (vty, "%-20s %-20d %-20d ", "ebgp", + rib_cnt[ZEBRA_ROUTE_BGP],fib_cnt[ZEBRA_ROUTE_BGP]); + vty_outln (vty, "%-20s %-20d %-20d ", "ibgp", + rib_cnt[ZEBRA_ROUTE_IBGP],fib_cnt[ZEBRA_ROUTE_IBGP]); } else - vty_out (vty, "%-20s %-20d %-20d %s", zebra_route_string(i), - rib_cnt[i], fib_cnt[i], VTY_NEWLINE); + vty_outln (vty, "%-20s %-20d %-20d ", zebra_route_string(i), + rib_cnt[i], fib_cnt[i]); } } - vty_out (vty, "------%s", VTY_NEWLINE); - vty_out (vty, "%-20s %-20d %-20d %s", "Totals", rib_cnt[ZEBRA_ROUTE_TOTAL], - fib_cnt[ZEBRA_ROUTE_TOTAL], VTY_NEWLINE); - vty_out (vty, "%s", VTY_NEWLINE); + vty_outln (vty, "------"); + vty_outln (vty, "%-20s %-20d %-20d ", "Totals", rib_cnt[ZEBRA_ROUTE_TOTAL], + fib_cnt[ZEBRA_ROUTE_TOTAL]); + vty_outln (vty, ""); } /* @@ -1690,10 +1688,9 @@ vty_show_ip_route_summary_prefix (struct vty *vty, struct route_table *table) } } - vty_out (vty, "%-20s %-20s %s (vrf %s)%s", + vty_outln (vty, "%-20s %-20s %s (vrf %s)", "Route Source", "Prefix Routes", "FIB", - zvrf_name (((rib_table_info_t *)table->info)->zvrf), - VTY_NEWLINE); + zvrf_name(((rib_table_info_t *)table->info)->zvrf)); for (i = 0; i < ZEBRA_ROUTE_MAX; i++) { @@ -1701,24 +1698,22 @@ vty_show_ip_route_summary_prefix (struct vty *vty, struct route_table *table) { if (i == ZEBRA_ROUTE_BGP) { - vty_out (vty, "%-20s %-20d %-20d %s", "ebgp", + vty_outln (vty, "%-20s %-20d %-20d ", "ebgp", rib_cnt[ZEBRA_ROUTE_BGP] - rib_cnt[ZEBRA_ROUTE_IBGP], - fib_cnt[ZEBRA_ROUTE_BGP] - fib_cnt[ZEBRA_ROUTE_IBGP], - VTY_NEWLINE); - vty_out (vty, "%-20s %-20d %-20d %s", "ibgp", - rib_cnt[ZEBRA_ROUTE_IBGP], fib_cnt[ZEBRA_ROUTE_IBGP], - VTY_NEWLINE); + fib_cnt[ZEBRA_ROUTE_BGP] - fib_cnt[ZEBRA_ROUTE_IBGP]); + vty_outln (vty, "%-20s %-20d %-20d ", "ibgp", + rib_cnt[ZEBRA_ROUTE_IBGP],fib_cnt[ZEBRA_ROUTE_IBGP]); } else - vty_out (vty, "%-20s %-20d %-20d %s", zebra_route_string(i), - rib_cnt[i], fib_cnt[i], VTY_NEWLINE); + vty_outln (vty, "%-20s %-20d %-20d ", zebra_route_string(i), + rib_cnt[i], fib_cnt[i]); } } - vty_out (vty, "------%s", VTY_NEWLINE); - vty_out (vty, "%-20s %-20d %-20d %s", "Totals", rib_cnt[ZEBRA_ROUTE_TOTAL], - fib_cnt[ZEBRA_ROUTE_TOTAL], VTY_NEWLINE); - vty_out (vty, "%s", VTY_NEWLINE); + vty_outln (vty, "------"); + vty_outln (vty, "%-20s %-20d %-20d ", "Totals", rib_cnt[ZEBRA_ROUTE_TOTAL], + fib_cnt[ZEBRA_ROUTE_TOTAL]); + vty_outln (vty, ""); } /* Show route summary. */ @@ -1793,7 +1788,7 @@ DEFUN (show_ip_route_vrf_all_addr, ret = str2prefix_ipv4 (argv[idx_ipv4]->arg, &p); if (ret <= 0) { - vty_out (vty, "%% Malformed IPv4 address%s", VTY_NEWLINE); + vty_outln (vty, "%% Malformed IPv4 address"); return CMD_WARNING; } @@ -1835,7 +1830,7 @@ DEFUN (show_ip_route_vrf_all_prefix, ret = str2prefix_ipv4 (argv[idx_ipv4_prefixlen]->arg, &p); if (ret <= 0) { - vty_out (vty, "%% Malformed IPv4 address%s", VTY_NEWLINE); + vty_outln (vty, "%% Malformed IPv4 address"); return CMD_WARNING; } @@ -1971,7 +1966,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, "%s", VTY_NEWLINE); + vty_outln (vty, ""); write = 1; } @@ -2005,7 +2000,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, ret = str2prefix (dest_str, &p); if (ret <= 0) { - vty_out (vty, "%% Malformed address%s", VTY_NEWLINE); + vty_outln (vty, "%% Malformed address"); return CMD_WARNING; } @@ -2014,7 +2009,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_out (vty, "%% Malformed source address%s", VTY_NEWLINE); + vty_outln (vty, "%% Malformed source address"); return CMD_WARNING; } src_p = (struct prefix_ipv6*)&src; @@ -2042,7 +2037,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, if (!zvrf) { - vty_out (vty, "%% vrf %s is not defined%s", vrf_id_str, VTY_NEWLINE); + vty_outln (vty, "%% vrf %s is not defined", vrf_id_str); return CMD_WARNING; } @@ -2052,8 +2047,8 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, { if (!mpls_enabled) { - vty_out (vty, "%% MPLS not turned on in kernel, ignoring command%s", - VTY_NEWLINE); + vty_outln (vty, + "%% MPLS not turned on in kernel, ignoring command"); return CMD_WARNING; } int rc = mpls_str2label (label_str, &snh_label.num_labels, @@ -2062,16 +2057,15 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, { switch (rc) { case -1: - vty_out (vty, "%% Malformed label(s)%s", VTY_NEWLINE); + vty_outln (vty, "%% Malformed label(s)"); break; case -2: - vty_out (vty, "%% Cannot use reserved label(s) (%d-%d)%s", - MPLS_MIN_RESERVED_LABEL, MPLS_MAX_RESERVED_LABEL, - VTY_NEWLINE); + vty_outln (vty, "%% Cannot use reserved label(s) (%d-%d)", + MPLS_MIN_RESERVED_LABEL,MPLS_MAX_RESERVED_LABEL); break; case -3: - vty_out (vty, "%% Too many labels. Enter %d or fewer%s", - MPLS_MAX_LABELS, VTY_NEWLINE); + vty_outln (vty, "%% Too many labels. Enter %d or fewer", + MPLS_MAX_LABELS); break; } return CMD_WARNING; @@ -2083,7 +2077,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, { if (flag_str) { - vty_out (vty, "%% can not have flag %s with Null0%s", flag_str, VTY_NEWLINE); + vty_outln (vty, "%% can not have flag %s with Null0", flag_str); return CMD_WARNING; } if (add_cmd) @@ -2107,7 +2101,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, SET_FLAG (flag, ZEBRA_FLAG_BLACKHOLE); break; default: - vty_out (vty, "%% Malformed flag %s %s", flag_str, VTY_NEWLINE); + vty_outln (vty, "%% Malformed flag %s ", flag_str); return CMD_WARNING; } } @@ -2118,7 +2112,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, address. */ if (ret != 1) { - vty_out (vty, "%% Malformed address%s", VTY_NEWLINE); + vty_outln (vty, "%% Malformed address"); return CMD_WARNING; } type = STATIC_IPV6_GATEWAY_IFINDEX; @@ -2126,7 +2120,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_out (vty, "%% Malformed Interface name %s%s", ifname, VTY_NEWLINE); + vty_outln (vty, "%% Malformed Interface name %s", ifname); return CMD_WARNING; } ifindex = ifp->ifindex; @@ -2144,7 +2138,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_out (vty, "%% Malformed Interface name %s%s", gate_str, VTY_NEWLINE); + vty_outln (vty, "%% Malformed Interface name %s", gate_str); ifindex = IFINDEX_DELETED; } else @@ -2641,7 +2635,7 @@ DEFUN (show_ipv6_route, if (type < 0) { - vty_out (vty, "Unknown route type%s", VTY_NEWLINE); + vty_outln (vty, "Unknown route type"); return CMD_WARNING; } } @@ -2694,7 +2688,7 @@ DEFUN (show_ipv6_route_addr, if (ret <= 0) { - vty_out (vty, "Malformed IPv6 address%s", VTY_NEWLINE); + vty_outln (vty, "Malformed IPv6 address"); return CMD_WARNING; } @@ -2705,7 +2699,7 @@ DEFUN (show_ipv6_route_addr, rn = route_node_match (table, (struct prefix *) &p); if (! rn) { - vty_out (vty, "%% Network not in table%s", VTY_NEWLINE); + vty_outln (vty, "%% Network not in table"); return CMD_WARNING; } @@ -2741,7 +2735,7 @@ DEFUN (show_ipv6_route_prefix, if (ret <= 0) { - vty_out (vty, "Malformed IPv6 prefix%s", VTY_NEWLINE); + vty_outln (vty, "Malformed IPv6 prefix"); return CMD_WARNING; } @@ -2752,7 +2746,7 @@ DEFUN (show_ipv6_route_prefix, rn = route_node_match (table, (struct prefix *) &p); if (! rn || rn->p.prefixlen != p.prefixlen) { - vty_out (vty, "%% Network not in table%s", VTY_NEWLINE); + vty_outln (vty, "%% Network not in table"); return CMD_WARNING; } @@ -2876,7 +2870,7 @@ DEFUN (show_ipv6_route_vrf_all_addr, ret = str2prefix_ipv6 (argv[idx_ipv6]->arg, &p); if (ret <= 0) { - vty_out (vty, "Malformed IPv6 address%s", VTY_NEWLINE); + vty_outln (vty, "Malformed IPv6 address"); return CMD_WARNING; } @@ -2918,7 +2912,7 @@ DEFUN (show_ipv6_route_vrf_all_prefix, ret = str2prefix_ipv6 (argv[idx_ipv6_prefixlen]->arg, &p); if (ret <= 0) { - vty_out (vty, "Malformed IPv6 prefix%s", VTY_NEWLINE); + vty_outln (vty, "Malformed IPv6 prefix"); return CMD_WARNING; } @@ -3063,7 +3057,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, "%s", VTY_NEWLINE); + vty_outln (vty, ""); } @@ -3108,15 +3102,15 @@ DEFUN (ip_zebra_import_table_distance, if (!is_zebra_valid_kernel_table(table_id)) { - vty_out(vty, "Invalid routing table ID, %d. Must be in range 1-252%s", - table_id, VTY_NEWLINE); + vty_outln (vty, "Invalid routing table ID, %d. Must be in range 1-252", + table_id); return CMD_WARNING; } if (is_zebra_main_routing_table(table_id)) { - vty_out(vty, "Invalid routing table ID, %d. Must be non-default table%s", - table_id, VTY_NEWLINE); + vty_outln (vty, "Invalid routing table ID, %d. Must be non-default table", + table_id); return CMD_WARNING; } @@ -3144,15 +3138,14 @@ DEFUN (no_ip_zebra_import_table, if (!is_zebra_valid_kernel_table(table_id)) { - vty_out(vty, "Invalid routing table ID. Must be in range 1-252%s", - VTY_NEWLINE); + vty_outln (vty,"Invalid routing table ID. Must be in range 1-252"); return CMD_WARNING; } if (is_zebra_main_routing_table(table_id)) { - vty_out(vty, "Invalid routing table ID, %d. Must be non-default table%s", - table_id, VTY_NEWLINE); + vty_outln (vty, "Invalid routing table ID, %d. Must be non-default table", + table_id); return CMD_WARNING; } @@ -3166,24 +3159,19 @@ static int config_write_protocol (struct vty *vty) { if (allow_delete) - vty_out(vty, "allow-external-route-update%s", VTY_NEWLINE); + vty_outln (vty, "allow-external-route-update"); if (zebra_rnh_ip_default_route) - vty_out(vty, "ip nht resolve-via-default%s", VTY_NEWLINE); + vty_outln (vty, "ip nht resolve-via-default"); if (zebra_rnh_ipv6_default_route) - vty_out(vty, "ipv6 nht resolve-via-default%s", VTY_NEWLINE); + vty_outln (vty, "ipv6 nht resolve-via-default"); enum multicast_mode ipv4_multicast_mode = multicast_mode_ipv4_get (); if (ipv4_multicast_mode != MCAST_NO_CONFIG) - vty_out (vty, "ip multicast rpf-lookup-mode %s%s", - 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", - VTY_NEWLINE); + vty_outln (vty, "ip multicast rpf-lookup-mode %s", + 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); |
