diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-07-14 14:52:45 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-07-14 14:52:45 +0200 |
commit | 2850f0ea580764393ae1253ef87a57d772dafafd (patch) | |
tree | 855a3dca8ef223561892a62f8ef3adef89ff84eb | |
parent | Merge remote-tracking branch 'origin/master' into evpn_plus_struct_attr (diff) | |
download | frr-2850f0ea580764393ae1253ef87a57d772dafafd.tar.xz frr-2850f0ea580764393ae1253ef87a57d772dafafd.zip |
bgpd, zebra: Cleanup warnings from new code
1) Clean up VTY_NEWLINE -> \n
2) Remove usages of VTY_GET_INTEGER
Signed-off-by: Donald Sharp
-rw-r--r-- | bgpd/bgp_evpn_vty.c | 213 | ||||
-rw-r--r-- | bgpd/bgp_route.c | 17 | ||||
-rw-r--r-- | zebra/debug.c | 2 | ||||
-rw-r--r-- | zebra/interface.c | 22 | ||||
-rw-r--r-- | zebra/zebra_vty.c | 24 | ||||
-rw-r--r-- | zebra/zebra_vxlan.c | 133 |
6 files changed, 201 insertions, 210 deletions
diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c index fc4944a6d..b5a58f014 100644 --- a/bgpd/bgp_evpn_vty.c +++ b/bgpd/bgp_evpn_vty.c @@ -123,12 +123,11 @@ display_import_rt (struct vty *vty, struct irt_node *irt) return; } - vty_out (vty, "%s", VTY_NEWLINE); - vty_out (vty, "List of VNIs importing routes with this route-target:%s", - VTY_NEWLINE); + vty_out (vty, "\n"); + vty_out (vty, "List of VNIs importing routes with this route-target:\n"); for (ALL_LIST_ELEMENTS (irt->vnis, node, nnode, tmp_vpn)) - vty_out (vty, " %u%s", tmp_vpn->vni, VTY_NEWLINE); + vty_out (vty, " %u\n", tmp_vpn->vni); } static void @@ -170,25 +169,22 @@ bgp_evpn_show_route_rd_header (struct vty *vty, struct bgp_node *rd_rn) break; } - vty_out (vty, "%s", VTY_NEWLINE); + vty_out (vty, "\n"); } static void bgp_evpn_show_route_header (struct vty *vty, struct bgp *bgp) { - char ri_header[] = " Network Next Hop Metric LocPrf Weight Path%s"; + char ri_header[] = " Network Next Hop Metric LocPrf Weight Path\n"; - vty_out (vty, "BGP table version is 0, local router ID is %s%s", - inet_ntoa (bgp->router_id), VTY_NEWLINE); + vty_out (vty, "BGP table version is 0, local router ID is %s\n", + inet_ntoa (bgp->router_id)); vty_out (vty, "Status codes: s suppressed, d damped, h history, " - "* valid, > best, i - internal%s", VTY_NEWLINE); - vty_out (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete%s", - VTY_NEWLINE); - vty_out (vty, "EVPN type-2 prefix: [2]:[ESI]:[EthTag]:[MAClen]:[MAC]:[IPlen]:[IP]%s", - VTY_NEWLINE); - vty_out (vty, "EVPN type-3 prefix: [3]:[EthTag]:[IPlen]:[OrigIP]%s%s", - VTY_NEWLINE, VTY_NEWLINE); - vty_out (vty, ri_header, VTY_NEWLINE); + "* valid, > best, i - internal\n"); + vty_out (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete\n"); + vty_out (vty, "EVPN type-2 prefix: [2]:[ESI]:[EthTag]:[MAClen]:[MAC]:[IPlen]:[IP]\n"); + vty_out (vty, "EVPN type-3 prefix: [3]:[EthTag]:[IPlen]:[OrigIP]\n\n"); + vty_out (vty, "%s", ri_header); } static void @@ -202,27 +198,26 @@ display_vni (struct vty *vty, struct bgpevpn *vpn) vty_out (vty, "VNI: %d", vpn->vni); if (is_vni_live (vpn)) vty_out (vty, " (known to the kernel)"); - vty_out (vty, "%s", VTY_NEWLINE); + vty_out (vty, "\n"); - vty_out (vty, " RD: %s%s", - prefix_rd2str (&vpn->prd, buf1, RD_ADDRSTRLEN), - VTY_NEWLINE); - vty_out (vty, " Originator IP: %s%s", - inet_ntoa(vpn->originator_ip), VTY_NEWLINE); + vty_out (vty, " RD: %s\n", + prefix_rd2str (&vpn->prd, buf1, RD_ADDRSTRLEN)); + vty_out (vty, " Originator IP: %s\n", + inet_ntoa(vpn->originator_ip)); - vty_out (vty, " Import Route Target:%s", VTY_NEWLINE); + vty_out (vty, " Import Route Target:\n"); for (ALL_LIST_ELEMENTS (vpn->import_rtl, node, nnode, ecom)) { ecom_str = ecommunity_ecom2str (ecom, ECOMMUNITY_FORMAT_ROUTE_MAP, 0); - vty_out (vty, " %s%s", ecom_str, VTY_NEWLINE); + vty_out (vty, " %s\n", ecom_str); XFREE (MTYPE_ECOMMUNITY_STR, ecom_str); } - vty_out (vty, " Export Route Target:%s", VTY_NEWLINE); + vty_out (vty, " Export Route Target:\n"); for (ALL_LIST_ELEMENTS (vpn->export_rtl, node, nnode, ecom)) { ecom_str = ecommunity_ecom2str (ecom, ECOMMUNITY_FORMAT_ROUTE_MAP, 0); - vty_out (vty, " %s%s", ecom_str, VTY_NEWLINE); + vty_out (vty, " %s\n", ecom_str); XFREE (MTYPE_ECOMMUNITY_STR, ecom_str); } } @@ -273,12 +268,12 @@ show_vni_routes (struct bgp *bgp, struct bgpevpn *vpn, int type, } if (prefix_cnt == 0) - vty_out (vty, "No EVPN prefixes %sexist for this VNI%s", - type ? "(of requested type) " : "", VTY_NEWLINE); + vty_out (vty, "No EVPN prefixes %sexist for this VNI\n", + type ? "(of requested type) " : ""); else - vty_out (vty, "%sDisplayed %u prefixes (%u paths)%s%s", - VTY_NEWLINE, prefix_cnt, path_cnt, - type ? " (of requested type)" : "", VTY_NEWLINE); + vty_out (vty, "\nDisplayed %u prefixes (%u paths)%s\n", + prefix_cnt, path_cnt, + type ? " (of requested type)" : ""); } static void @@ -288,7 +283,7 @@ show_vni_routes_hash (struct hash_backet *backet, void *arg) struct vni_walk_ctx *wctx = arg; struct vty *vty = wctx->vty; - vty_out (vty, "%sVNI: %d%s%s", VTY_NEWLINE, vpn->vni, VTY_NEWLINE, VTY_NEWLINE); + vty_out (vty, "\nVNI: %d\n\n", vpn->vni); show_vni_routes (wctx->bgp, vpn, 0, wctx->vty, wctx->vtep_ip); } @@ -338,7 +333,7 @@ show_vni_entry (struct hash_backet *backet, struct vty *vty) XFREE (MTYPE_ECOMMUNITY_STR, ecom_str); break; } - vty_out (vty, "%s", VTY_NEWLINE); + vty_out (vty, "\n"); } #endif /* HAVE_CUMULUS */ @@ -1385,7 +1380,7 @@ evpn_show_route_vni_multicast (struct vty *vty, struct bgp *bgp, vpn = bgp_evpn_lookup_vni (bgp, vni); if (!vpn) { - vty_out (vty, "VNI not found%s", VTY_NEWLINE); + vty_out (vty, "VNI not found\n"); return; } @@ -1394,7 +1389,7 @@ evpn_show_route_vni_multicast (struct vty *vty, struct bgp *bgp, rn = bgp_node_lookup (vpn->route_table, (struct prefix *)&p); if (!rn || !rn->info) { - vty_out (vty, "%% Network not in table%s", VTY_NEWLINE); + vty_out (vty, "%% Network not in table\n"); return; } @@ -1408,8 +1403,8 @@ evpn_show_route_vni_multicast (struct vty *vty, struct bgp *bgp, path_cnt++; } - vty_out (vty, "%sDisplayed %u paths for requested prefix%s", - VTY_NEWLINE, path_cnt, VTY_NEWLINE); + vty_out (vty, "\nDisplayed %u paths for requested prefix\n", + path_cnt); } /* @@ -1436,7 +1431,7 @@ evpn_show_route_vni_macip (struct vty *vty, struct bgp *bgp, vpn = bgp_evpn_lookup_vni (bgp, vni); if (!vpn) { - vty_out (vty, "VNI not found%s", VTY_NEWLINE); + vty_out (vty, "VNI not found\n"); return; } @@ -1445,7 +1440,7 @@ evpn_show_route_vni_macip (struct vty *vty, struct bgp *bgp, rn = bgp_node_lookup (vpn->route_table, (struct prefix *)&p); if (!rn || !rn->info) { - vty_out (vty, "%% Network not in table%s", VTY_NEWLINE); + vty_out (vty, "%% Network not in table\n"); return; } @@ -1459,8 +1454,8 @@ evpn_show_route_vni_macip (struct vty *vty, struct bgp *bgp, path_cnt++; } - vty_out (vty, "%sDisplayed %u paths for requested prefix%s", - VTY_NEWLINE, path_cnt, VTY_NEWLINE); + vty_out (vty, "\nDisplayed %u paths for requested prefix\n", + path_cnt); } /* @@ -1478,7 +1473,7 @@ evpn_show_routes_vni (struct vty *vty, struct bgp *bgp, vpn = bgp_evpn_lookup_vni (bgp, vni); if (!vpn) { - vty_out (vty, "VNI not found%s", VTY_NEWLINE); + vty_out (vty, "VNI not found\n"); return; } @@ -1512,7 +1507,7 @@ evpn_show_route_rd_macip (struct vty *vty, struct bgp *bgp, (struct prefix *)&p, prd); if (!rn || !rn->info) { - vty_out (vty, "%% Network not in table%s", VTY_NEWLINE); + vty_out (vty, "%% Network not in table\n"); return; } @@ -1526,8 +1521,8 @@ evpn_show_route_rd_macip (struct vty *vty, struct bgp *bgp, path_cnt++; } - vty_out (vty, "%sDisplayed %u paths for requested prefix%s", - VTY_NEWLINE, path_cnt, VTY_NEWLINE); + vty_out (vty, "\nDisplayed %u paths for requested prefix\n", + path_cnt); } /* @@ -1573,9 +1568,9 @@ evpn_show_route_rd (struct vty *vty, struct bgp *bgp, if (rd_header) { vty_out (vty, "EVPN type-2 prefix: [2]:[ESI]:[EthTag]:[MAClen]:" - "[MAC]%s", VTY_NEWLINE); + "[MAC]\n"); vty_out (vty, "EVPN type-3 prefix: [3]:[EthTag]:[IPlen]:" - "[OrigIP]%s%s", VTY_NEWLINE, VTY_NEWLINE); + "[OrigIP]\n\n"); rd_header = 0; } @@ -1594,12 +1589,12 @@ evpn_show_route_rd (struct vty *vty, struct bgp *bgp, } if (prefix_cnt == 0) - vty_out (vty, "No prefixes exist with this RD%s%s", - type ? " (of requested type)" : "", VTY_NEWLINE); + vty_out (vty, "No prefixes exist with this RD%s\n", + type ? " (of requested type)" : ""); else - vty_out (vty, "%sDisplayed %u prefixes (%u paths) with this RD%s%s", - VTY_NEWLINE, prefix_cnt, path_cnt, - type ? " (of requested type)" : "", VTY_NEWLINE); + vty_out (vty, "\nDisplayed %u prefixes (%u paths) with this RD%s\n", + prefix_cnt, path_cnt, + type ? " (of requested type)" : ""); } /* @@ -1675,12 +1670,12 @@ evpn_show_all_routes (struct vty *vty, struct bgp *bgp, int type) } if (prefix_cnt == 0) - vty_out (vty, "No EVPN prefixes %sexist%s", - type ? "(of requested type) " : "", VTY_NEWLINE); + vty_out (vty, "No EVPN prefixes %sexist\n", + type ? "(of requested type) " : ""); else - vty_out (vty, "%sDisplayed %u prefixes (%u paths)%s%s", - VTY_NEWLINE, prefix_cnt, path_cnt, - type ? " (of requested type)" : "", VTY_NEWLINE); + vty_out (vty, "\nDisplayed %u prefixes (%u paths)%s\n", + prefix_cnt, path_cnt, + type ? " (of requested type)" : ""); } /* @@ -1694,7 +1689,7 @@ evpn_show_vni (struct vty *vty, struct bgp *bgp, vni_t vni) vpn = bgp_evpn_lookup_vni (bgp, vni); if (!vpn) { - vty_out (vty, "VNI not found%s", VTY_NEWLINE); + vty_out (vty, "VNI not found\n"); return; } @@ -1712,11 +1707,10 @@ evpn_show_all_vnis (struct vty *vty, struct bgp *bgp) num_vnis = hashcount(bgp->vnihash); if (!num_vnis) return; - vty_out(vty, "Number of VNIs: %u%s", - num_vnis, VTY_NEWLINE); - vty_out(vty, "Flags: * - Kernel %s", VTY_NEWLINE); - vty_out(vty, " %-10s %-15s %-21s %-25s %-25s%s", - "VNI", "Orig IP", "RD", "Import RT", "Export RT", VTY_NEWLINE); + vty_out(vty, "Number of VNIs: %u\n", num_vnis); + vty_out(vty, "Flags: * - Kernel \n"); + vty_out(vty, " %-10s %-15s %-21s %-25s %-25s\n", + "VNI", "Orig IP", "RD", "Import RT", "Export RT"); hash_iterate (bgp->vnihash, (void (*) (struct hash_backet *, void *)) show_vni_entry, vty); @@ -1758,18 +1752,17 @@ write_vni_config (struct vty *vty, struct bgpevpn *vpn, int *write) if (is_vni_configured (vpn)) { bgp_config_write_family_header (vty, afi, safi, write); - vty_out (vty, " vni %d%s", vpn->vni, VTY_NEWLINE); + vty_out (vty, " vni %d\n", vpn->vni); if (is_rd_configured (vpn)) - vty_out (vty, " rd %s%s", - prefix_rd2str (&vpn->prd, buf1, RD_ADDRSTRLEN), - VTY_NEWLINE); + vty_out (vty, " rd %s\n", + prefix_rd2str (&vpn->prd, buf1, RD_ADDRSTRLEN)); if (is_import_rt_configured (vpn)) { for (ALL_LIST_ELEMENTS (vpn->import_rtl, node, nnode, ecom)) { ecom_str = ecommunity_ecom2str (ecom, ECOMMUNITY_FORMAT_ROUTE_MAP, 0); - vty_out (vty, " route-target import %s%s", ecom_str, VTY_NEWLINE); + vty_out (vty, " route-target import %s\n", ecom_str); XFREE (MTYPE_ECOMMUNITY_STR, ecom_str); } } @@ -1779,12 +1772,12 @@ write_vni_config (struct vty *vty, struct bgpevpn *vpn, int *write) for (ALL_LIST_ELEMENTS (vpn->export_rtl, node, nnode, ecom)) { ecom_str = ecommunity_ecom2str (ecom, ECOMMUNITY_FORMAT_ROUTE_MAP, 0); - vty_out (vty, " route-target export %s%s", ecom_str, VTY_NEWLINE); + vty_out (vty, " route-target export %s\n", ecom_str); XFREE (MTYPE_ECOMMUNITY_STR, ecom_str); } } - vty_out (vty, " exit-vni%s", VTY_NEWLINE); + vty_out (vty, " exit-vni\n"); } } @@ -1838,8 +1831,8 @@ DEFUN (show_bgp_evpn_vni, if (!bgp) return CMD_WARNING; - vty_out (vty, "Advertise All VNI flag: %s%s", - bgp->advertise_all_vni? "Enabled" : "Disabled", VTY_NEWLINE); + vty_out (vty, "Advertise All VNI flag: %s\n", + bgp->advertise_all_vni? "Enabled" : "Disabled"); evpn_show_all_vnis (vty, bgp); return CMD_SUCCESS; @@ -1861,7 +1854,7 @@ DEFUN (show_bgp_evpn_vni_num, if (!bgp) return CMD_WARNING; - VTY_GET_INTEGER_RANGE ("VNI", vni, argv[4]->arg, 1, VNI_MAX); + vni = strtoul(argv[4]->arg, NULL, 10); evpn_show_vni (vty, bgp, vni); return CMD_SUCCESS; @@ -1939,7 +1932,7 @@ DEFUN (show_bgp_evpn_route_rd, ret = str2prefix_rd (argv[5]->arg, &prd); if (! ret) { - vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE); + vty_out (vty, "%% Malformed Route Distinguisher\n"); return CMD_WARNING; } @@ -1984,12 +1977,12 @@ DEFUN (show_bgp_evpn_route_rd_macip, ret = str2prefix_rd (argv[5]->arg, &prd); if (! ret) { - vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE); + vty_out (vty, "%% Malformed Route Distinguisher\n"); return CMD_WARNING; } if (!prefix_str2mac (argv[7]->arg, &mac)) { - vty_out (vty, "%% Malformed MAC address%s", VTY_NEWLINE); + vty_out (vty, "%% Malformed MAC address\n"); return CMD_WARNING; } memset (&ip, 0, sizeof (ip)); @@ -1997,7 +1990,7 @@ DEFUN (show_bgp_evpn_route_rd_macip, { if (str2ipaddr (argv[9]->arg, &ip) != 0) { - vty_out (vty, "%% Malformed IP address%s", VTY_NEWLINE); + vty_out (vty, "%% Malformed IP address\n"); return CMD_WARNING; } } @@ -2032,7 +2025,7 @@ DEFUN (show_bgp_evpn_route_vni, vtep_ip.s_addr = 0; - VTY_GET_INTEGER_RANGE ("VNI", vni, argv[5]->arg, 1, VNI_MAX); + vni = strtoul(argv[5]->arg, NULL, 10); if (argc == 8 && argv[6]->arg) { @@ -2049,7 +2042,7 @@ DEFUN (show_bgp_evpn_route_vni, { if (!inet_aton (argv[7]->arg, &vtep_ip)) { - vty_out (vty, "%% Malformed VTEP IP address%s", VTY_NEWLINE); + vty_out (vty, "%% Malformed VTEP IP address\n"); return CMD_WARNING; } } @@ -2084,10 +2077,10 @@ DEFUN (show_bgp_evpn_route_vni_macip, if (!bgp) return CMD_WARNING; - VTY_GET_INTEGER_RANGE ("VNI", vni, argv[5]->arg, 1, VNI_MAX); + vni = strtoul(argv[5]->arg, NULL, 10); if (!prefix_str2mac (argv[7]->arg, &mac)) { - vty_out (vty, "%% Malformed MAC address%s", VTY_NEWLINE); + vty_out (vty, "%% Malformed MAC address\n"); return CMD_WARNING; } memset (&ip, 0, sizeof (ip)); @@ -2095,7 +2088,7 @@ DEFUN (show_bgp_evpn_route_vni_macip, { if (str2ipaddr (argv[9]->arg, &ip) != 0) { - vty_out (vty, "%% Malformed IP address%s", VTY_NEWLINE); + vty_out (vty, "%% Malformed IP address\n"); return CMD_WARNING; } } @@ -2125,11 +2118,11 @@ DEFUN (show_bgp_evpn_route_vni_multicast, if (!bgp) return CMD_WARNING; - VTY_GET_INTEGER_RANGE ("VNI", vni, argv[5]->arg, 1, VNI_MAX); + vni = strtoul(argv[5]->arg, NULL, 10); ret = inet_aton (argv[7]->arg, &orig_ip); if (!ret) { - vty_out (vty, "%% Malformed Originating Router IP address%s", VTY_NEWLINE); + vty_out (vty, "%% Malformed Originating Router IP address\n"); return CMD_WARNING; } @@ -2161,7 +2154,7 @@ DEFUN (show_bgp_evpn_route_vni_all, { if (!inet_aton (argv[7]->arg, &vtep_ip)) { - vty_out (vty, "%% Malformed VTEP IP address%s", VTY_NEWLINE); + vty_out (vty, "%% Malformed VTEP IP address\n"); return CMD_WARNING; } } @@ -2201,13 +2194,13 @@ DEFUN_NOSH (bgp_evpn_vni, if (!bgp) return CMD_WARNING; - VTY_GET_INTEGER_RANGE ("VNI", vni, argv[1]->arg, 1, VNI_MAX); + vni = strtoul(argv[1]->arg, NULL, 10); /* Create VNI, or mark as configured. */ vpn = evpn_create_update_vni (bgp, vni); if (!vpn) { - vty_out (vty, "%% Failed to create VNI %s", VTY_NEWLINE); + vty_out (vty, "%% Failed to create VNI \n"); return CMD_WARNING; } @@ -2229,18 +2222,18 @@ DEFUN (no_bgp_evpn_vni, if (!bgp) return CMD_WARNING; - VTY_GET_INTEGER_RANGE ("VNI", vni, argv[2]->arg, 1, VNI_MAX); + vni = strtoul(argv[2]->arg, NULL, 10); /* Check if we should disallow. */ vpn = bgp_evpn_lookup_vni (bgp, vni); if (!vpn) { - vty_out (vty, "%% Specified VNI does not exist%s", VTY_NEWLINE); + vty_out (vty, "%% Specified VNI does not exist\n"); return CMD_WARNING; } if (!is_vni_configured (vpn)) { - vty_out (vty, "%% Specified VNI is not configured%s", VTY_NEWLINE); + vty_out (vty, "%% Specified VNI is not configured\n"); return CMD_WARNING; } @@ -2275,7 +2268,7 @@ DEFUN (bgp_evpn_vni_rd, ret = str2prefix_rd (argv[1]->arg, &prd); if (! ret) { - vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE); + vty_out (vty, "%% Malformed Route Distinguisher\n"); return CMD_WARNING; } @@ -2306,20 +2299,20 @@ DEFUN (no_bgp_evpn_vni_rd, ret = str2prefix_rd (argv[2]->arg, &prd); if (! ret) { - vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE); + vty_out (vty, "%% Malformed Route Distinguisher\n"); return CMD_WARNING; } /* Check if we should disallow. */ if (!is_rd_configured (vpn)) { - vty_out (vty, "%% RD is not configured for this VNI%s", VTY_NEWLINE); + vty_out (vty, "%% RD is not configured for this VNI\n"); return CMD_WARNING; } if (!bgp_evpn_rd_matches_existing(vpn, &prd)) { - vty_out (vty, "%% RD specified does not match configuration for this VNI%s", VTY_NEWLINE); + vty_out (vty, "%% RD specified does not match configuration for this VNI\n"); return CMD_WARNING; } @@ -2342,7 +2335,7 @@ DEFUN (no_bgp_evpn_vni_rd_without_val, /* Check if we should disallow. */ if (!is_rd_configured (vpn)) { - vty_out (vty, "%% RD is not configured for this VNI%s", VTY_NEWLINE); + vty_out (vty, "%% RD is not configured for this VNI\n"); return CMD_WARNING; } @@ -2396,7 +2389,7 @@ DEFUN (bgp_evpn_vni_rt, rt_type = RT_TYPE_BOTH; else { - vty_out (vty, "%% Invalid Route Target type%s", VTY_NEWLINE); + vty_out (vty, "%% Invalid Route Target type\n"); return CMD_WARNING; } @@ -2408,7 +2401,7 @@ DEFUN (bgp_evpn_vni_rt, ecommunity_str(ecomadd); if (!ecomadd) { - vty_out (vty, "%% Malformed Route Target list%s", VTY_NEWLINE); + vty_out (vty, "%% Malformed Route Target list\n"); return CMD_WARNING; } @@ -2425,7 +2418,7 @@ DEFUN (bgp_evpn_vni_rt, ecommunity_str(ecomadd); if (!ecomadd) { - vty_out (vty, "%% Malformed Route Target list%s", VTY_NEWLINE); + vty_out (vty, "%% Malformed Route Target list\n"); return CMD_WARNING; } @@ -2463,7 +2456,7 @@ DEFUN (no_bgp_evpn_vni_rt, rt_type = RT_TYPE_BOTH; else { - vty_out (vty, "%% Invalid Route Target type%s", VTY_NEWLINE); + vty_out (vty, "%% Invalid Route Target type\n"); return CMD_WARNING; } @@ -2473,7 +2466,7 @@ DEFUN (no_bgp_evpn_vni_rt, { if (!is_import_rt_configured (vpn)) { - vty_out (vty, "%% Import RT is not configured for this VNI%s", VTY_NEWLINE); + vty_out (vty, "%% Import RT is not configured for this VNI\n"); return CMD_WARNING; } } @@ -2481,7 +2474,7 @@ DEFUN (no_bgp_evpn_vni_rt, { if (!is_export_rt_configured (vpn)) { - vty_out (vty, "%% Export RT is not configured for this VNI%s", VTY_NEWLINE); + vty_out (vty, "%% Export RT is not configured for this VNI\n"); return CMD_WARNING; } } @@ -2489,7 +2482,7 @@ DEFUN (no_bgp_evpn_vni_rt, { if (!is_import_rt_configured (vpn) && !is_export_rt_configured (vpn)) { - vty_out (vty, "%% Import/Export RT is not configured for this VNI%s", VTY_NEWLINE); + vty_out (vty, "%% Import/Export RT is not configured for this VNI\n"); return CMD_WARNING; } } @@ -2498,7 +2491,7 @@ DEFUN (no_bgp_evpn_vni_rt, ecommunity_str(ecomdel); if (!ecomdel) { - vty_out (vty, "%% Malformed Route Target list%s", VTY_NEWLINE); + vty_out (vty, "%% Malformed Route Target list\n"); return CMD_WARNING; } @@ -2506,7 +2499,7 @@ DEFUN (no_bgp_evpn_vni_rt, { if (!bgp_evpn_rt_matches_existing (vpn->import_rtl, ecomdel)) { - vty_out (vty, "%% RT specified does not match configuration for this VNI%s", VTY_NEWLINE); + vty_out (vty, "%% RT specified does not match configuration for this VNI\n"); return CMD_WARNING; } evpn_unconfigure_import_rt (bgp, vpn, ecomdel); @@ -2515,7 +2508,7 @@ DEFUN (no_bgp_evpn_vni_rt, { if (!bgp_evpn_rt_matches_existing (vpn->export_rtl, ecomdel)) { - vty_out (vty, "%% RT specified does not match configuration for this VNI%s", VTY_NEWLINE); + vty_out (vty, "%% RT specified does not match configuration for this VNI\n"); return CMD_WARNING; } evpn_unconfigure_export_rt (bgp, vpn, ecomdel); @@ -2538,7 +2531,7 @@ DEFUN (no_bgp_evpn_vni_rt, if (! found_ecomdel) { - vty_out (vty, "%% RT specified does not match configuration for this VNI%s", VTY_NEWLINE); + vty_out (vty, "%% RT specified does not match configuration for this VNI\n"); return CMD_WARNING; } } @@ -2571,7 +2564,7 @@ DEFUN (no_bgp_evpn_vni_rt_without_val, } else { - vty_out (vty, "%% Invalid Route Target type%s", VTY_NEWLINE); + vty_out (vty, "%% Invalid Route Target type\n"); return CMD_WARNING; } @@ -2580,7 +2573,7 @@ DEFUN (no_bgp_evpn_vni_rt_without_val, { if (!is_import_rt_configured (vpn)) { - vty_out (vty, "%% Import RT is not configured for this VNI%s", VTY_NEWLINE); + vty_out (vty, "%% Import RT is not configured for this VNI\n"); return CMD_WARNING; } } @@ -2588,7 +2581,7 @@ DEFUN (no_bgp_evpn_vni_rt_without_val, { if (!is_export_rt_configured (vpn)) { - vty_out (vty, "%% Export RT is not configured for this VNI%s", VTY_NEWLINE); + vty_out (vty, "%% Export RT is not configured for this VNI\n"); return CMD_WARNING; } } @@ -2623,7 +2616,7 @@ bgp_config_write_evpn_info (struct vty *vty, struct bgp *bgp, afi_t afi, if (bgp->advertise_all_vni) { bgp_config_write_family_header (vty, afi, safi, write); - vty_out (vty, " advertise-all-vni%s", VTY_NEWLINE); + vty_out (vty, " advertise-all-vni\n"); } } diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 00708c487..88b63107e 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -7254,7 +7254,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p, bgp_evpn_label2str (&binfo->extra->label, tag_buf, sizeof (tag_buf)); vty_out (vty, " VNI %s", tag_buf); } - vty_out (vty, "%s", VTY_NEWLINE); + vty_out (vty, "\n"); if (binfo->extra && binfo->extra->parent) { struct bgp_info *parent_ri; @@ -7265,10 +7265,10 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p, if (rn && rn->prn) { prn = rn->prn; - vty_out (vty, " Imported from %s:%s%s", + vty_out (vty, " Imported from %s:%s\n", prefix_rd2str ((struct prefix_rd *)&prn->p, buf1, RD_ADDRSTRLEN), - buf2, VTY_NEWLINE); + buf2); } } } @@ -7761,7 +7761,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p, /* Line 6 display Large community */ if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES)) - vty_outln (vty, " Large Community: %s\n", + vty_out (vty, " Large Community: %s\n", attr->lcommunity->str); /* Line 7 display Originator, Cluster-id */ @@ -8329,19 +8329,18 @@ route_vty_out_detail_header (struct vty *vty, struct bgp *bgp, { #if defined (HAVE_CUMULUS) if (safi == SAFI_EVPN) - vty_out (vty, "BGP routing table entry for %s%s%s%s", + vty_out (vty, "BGP routing table entry for %s%s%s\n", prd ? prefix_rd2str (prd, buf1, RD_ADDRSTRLEN) : "", prd ? ":" : "", bgp_evpn_route2str ((struct prefix_evpn *)p, - buf3, sizeof (buf3)), - VTY_NEWLINE); + buf3, sizeof (buf3))); else - vty_out (vty, "BGP routing table entry for %s%s%s/%d%s", + vty_out (vty, "BGP routing table entry for %s%s%s/%d\n", ((safi == SAFI_MPLS_VPN || safi == SAFI_ENCAP) ? prefix_rd2str (prd, buf1, RD_ADDRSTRLEN) : ""), safi == SAFI_MPLS_VPN ? ":" : "", inet_ntop (p->family, &p->u.prefix, buf2, INET6_ADDRSTRLEN), - p->prefixlen, VTY_NEWLINE); + p->prefixlen); #else if (p->family == AF_ETHERNET) prefix2str (p, buf2, INET6_ADDRSTRLEN); diff --git a/zebra/debug.c b/zebra/debug.c index 763bf359b..1c3cf9a3d 100644 --- a/zebra/debug.c +++ b/zebra/debug.c @@ -439,7 +439,7 @@ config_write_debug (struct vty *vty) } if (IS_ZEBRA_DEBUG_VXLAN) { - vty_out (vty, "debug zebra vxlan%s", VTY_NEWLINE); + vty_out (vty, "debug zebra vxlan\n"); write++; } return write; diff --git a/zebra/interface.c b/zebra/interface.c index fb856165b..9618e9bb1 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -1209,23 +1209,23 @@ if_dump_vty (struct vty *vty, struct interface *ifp) connected_dump_vty (vty, connected); } - vty_out(vty, " Interface Type %s%s", - zebra_ziftype_2str (zebra_if->zif_type), VTY_NEWLINE); + vty_out(vty, " Interface Type %s\n", + zebra_ziftype_2str (zebra_if->zif_type)); if (IS_ZEBRA_IF_BRIDGE (ifp)) { struct zebra_l2info_bridge *bridge_info; bridge_info = &zebra_if->l2info.br; - vty_out(vty, " Bridge VLAN-aware: %s%s", - bridge_info->vlan_aware ? "yes" : "no", VTY_NEWLINE); + vty_out(vty, " Bridge VLAN-aware: %s\n", + bridge_info->vlan_aware ? "yes" : "no"); } else if (IS_ZEBRA_IF_VLAN(ifp)) { struct zebra_l2info_vlan *vlan_info; vlan_info = &zebra_if->l2info.vl; - vty_out(vty, " VLAN Id %u%s", - vlan_info->vid, VTY_NEWLINE); + vty_out(vty, " VLAN Id %u\n", + vlan_info->vid); } else if (IS_ZEBRA_IF_VXLAN (ifp)) { @@ -1237,7 +1237,7 @@ if_dump_vty (struct vty *vty, struct interface *ifp) vty_out(vty, " VTEP IP: %s", inet_ntoa (vxlan_info->vtep_ip)); if (vxlan_info->access_vlan) vty_out(vty, " Access VLAN Id %u", vxlan_info->access_vlan); - vty_out(vty, "%s", VTY_NEWLINE); + vty_out(vty, "\n"); } if (IS_ZEBRA_IF_BRIDGE_SLAVE (ifp)) @@ -1246,13 +1246,13 @@ if_dump_vty (struct vty *vty, struct interface *ifp) br_slave = &zebra_if->brslave_info; if (br_slave->bridge_ifindex != IFINDEX_INTERNAL) - vty_out(vty, " Master (bridge) ifindex %u%s", - br_slave->bridge_ifindex, VTY_NEWLINE); + vty_out(vty, " Master (bridge) ifindex %u\n", + br_slave->bridge_ifindex); } if (zebra_if->link_ifindex != IFINDEX_INTERNAL) - vty_out(vty, " Link ifindex %u%s", - zebra_if->link_ifindex, VTY_NEWLINE); + vty_out(vty, " Link ifindex %u\n", + zebra_if->link_ifindex); if (HAS_LINK_PARAMS(ifp)) { diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 52d404aee..b1da38a7b 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -3074,7 +3074,7 @@ DEFUN (show_evpn_vni_vni, struct zebra_vrf *zvrf; vni_t vni; - VTY_GET_INTEGER_RANGE ("VNI", vni, argv[3]->arg, 1, VNI_MAX); + vni = strtoul(argv[3]->arg, NULL, 10); zvrf = vrf_info_lookup(VRF_DEFAULT); zebra_vxlan_print_vni(vty, zvrf, vni); return CMD_SUCCESS; @@ -3092,7 +3092,7 @@ DEFUN (show_evpn_mac_vni, struct zebra_vrf *zvrf; vni_t vni; - VTY_GET_INTEGER_RANGE ("VNI", vni, argv[4]->arg, 1, VNI_MAX); + vni = strtoul(argv[4]->arg, NULL, 10); zvrf = vrf_info_lookup(VRF_DEFAULT); zebra_vxlan_print_macs_vni(vty, zvrf, vni); return CMD_SUCCESS; @@ -3130,7 +3130,7 @@ DEFUN (show_evpn_mac_vni_all_vtep, if (!inet_aton (argv[6]->arg, &vtep_ip)) { - vty_out (vty, "%% Malformed VTEP IP address%s", VTY_NEWLINE); + vty_out (vty, "%% Malformed VTEP IP address\n"); return CMD_WARNING; } zvrf = vrf_info_lookup(VRF_DEFAULT); @@ -3155,10 +3155,10 @@ DEFUN (show_evpn_mac_vni_mac, vni_t vni; struct ethaddr mac; - VTY_GET_INTEGER_RANGE ("VNI", vni, argv[4]->arg, 1, VNI_MAX); + vni = strtoul(argv[4]->arg, NULL, 10); if (!prefix_str2mac (argv[6]->arg, &mac)) { - vty_out (vty, "%% Malformed MAC address%s", VTY_NEWLINE); + vty_out (vty, "%% Malformed MAC address"); return CMD_WARNING; } zvrf = vrf_info_lookup(VRF_DEFAULT); @@ -3181,10 +3181,10 @@ DEFUN (show_evpn_mac_vni_vtep, vni_t vni; struct in_addr vtep_ip; - VTY_GET_INTEGER_RANGE ("VNI", vni, argv[4]->arg, 1, VNI_MAX); + vni = strtoul(argv[4]->arg, NULL, 10); if (!inet_aton (argv[6]->arg, &vtep_ip)) { - vty_out (vty, "%% Malformed VTEP IP address%s", VTY_NEWLINE); + vty_out (vty, "%% Malformed VTEP IP address\n"); return CMD_WARNING; } @@ -3205,7 +3205,7 @@ DEFUN (show_evpn_neigh_vni, struct zebra_vrf *zvrf; vni_t vni; - VTY_GET_INTEGER_RANGE ("VNI", vni, argv[4]->arg, 1, VNI_MAX); + vni = strtoul(argv[4]->arg, NULL, 10); zvrf = vrf_info_lookup(VRF_DEFAULT); zebra_vxlan_print_neigh_vni(vty, zvrf, vni); return CMD_SUCCESS; @@ -3242,10 +3242,10 @@ DEFUN (show_evpn_neigh_vni_neigh, vni_t vni; struct ipaddr ip; - VTY_GET_INTEGER_RANGE ("VNI", vni, argv[4]->arg, 1, VNI_MAX); + vni = strtoul(argv[4]->arg, NULL, 10); if (str2ipaddr (argv[6]->arg, &ip) != 0) { - vty_out (vty, "%% Malformed Neighbor address%s", VTY_NEWLINE); + vty_out (vty, "%% Malformed Neighbor address\n"); return CMD_WARNING; } zvrf = vrf_info_lookup(VRF_DEFAULT); @@ -3268,10 +3268,10 @@ DEFUN (show_evpn_neigh_vni_vtep, vni_t vni; struct in_addr vtep_ip; - VTY_GET_INTEGER_RANGE ("VNI", vni, argv[4]->arg, 1, VNI_MAX); + vni = strtoul(argv[4]->arg, NULL, 10); if (!inet_aton (argv[6]->arg, &vtep_ip)) { - vty_out (vty, "%% Malformed VTEP IP address%s", VTY_NEWLINE); + vty_out (vty, "%% Malformed VTEP IP address\n"); return CMD_WARNING; } diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index 5eca8dc5d..7df31cb93 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -220,12 +220,12 @@ zvni_print_neigh (zebra_neigh_t *n, void *ctxt) ipaddr2str (&n->ip, buf2, sizeof(buf2)), vty = (struct vty *) ctxt; - vty_out(vty, "IP: %s%s", - ipaddr2str (&n->ip, buf2, sizeof(buf2)), VTY_NEWLINE); + vty_out(vty, "IP: %s\n", + ipaddr2str (&n->ip, buf2, sizeof(buf2))); vty_out(vty, " MAC: %s", prefix_mac2str (&n->emac, buf1, sizeof (buf1))); if (CHECK_FLAG(n->flags, ZEBRA_NEIGH_REMOTE)) vty_out(vty, " Remote VTEP: %s", inet_ntoa (n->r_vtep_ip)); - vty_out(vty, "%s", VTY_NEWLINE); + vty_out(vty, "\n"); } /* @@ -250,8 +250,8 @@ zvni_print_neigh_hash (struct hash_backet *backet, void *ctxt) if (CHECK_FLAG(n->flags, ZEBRA_NEIGH_LOCAL) && !(wctx->flags & SHOW_REMOTE_NEIGH_FROM_VTEP)) { - vty_out(vty, "%*s %-6s %-17s %s", - -wctx->addr_width, buf2, "local", buf1, VTY_NEWLINE); + vty_out(vty, "%*s %-6s %-17s\n", + -wctx->addr_width, buf2, "local", buf1); wctx->count++; } else @@ -261,20 +261,20 @@ zvni_print_neigh_hash (struct hash_backet *backet, void *ctxt) if (IPV4_ADDR_SAME(&n->r_vtep_ip, &wctx->r_vtep_ip)) { if (wctx->count == 0) - vty_out(vty, "%*s %-6s %-17s %-21s%s", + vty_out(vty, "%*s %-6s %-17s %-21s\n", -wctx->addr_width, "Neighbor", "Type", "MAC", - "Remote VTEP", VTY_NEWLINE); - vty_out(vty, "%*s %-6s %-17s %-21s%s", + "Remote VTEP"); + vty_out(vty, "%*s %-6s %-17s %-21s\n", -wctx->addr_width, buf2, "remote", buf1, - inet_ntoa (n->r_vtep_ip), VTY_NEWLINE); + inet_ntoa (n->r_vtep_ip)); wctx->count++; } } else { - vty_out(vty, "%*s %-6s %-17s %-21s%s", + vty_out(vty, "%*s %-6s %-17s %-21s\n", -wctx->addr_width, buf2, "remote", buf1, - inet_ntoa (n->r_vtep_ip), VTY_NEWLINE); + inet_ntoa (n->r_vtep_ip)); wctx->count++; } } @@ -297,8 +297,8 @@ zvni_print_neigh_hash_all_vni (struct hash_backet *backet, void *ctxt) return; num_neigh = hashcount(zvni->neigh_table); - vty_out(vty, "%sVNI %u #ARP (IPv4 and IPv6, local and remote) %u%s%s", - VTY_NEWLINE, zvni->vni, num_neigh, VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "\nVNI %u #ARP (IPv4 and IPv6, local and remote) %u\n\n", + zvni->vni, num_neigh); if (!num_neigh) return; @@ -312,9 +312,9 @@ zvni_print_neigh_hash_all_vni (struct hash_backet *backet, void *ctxt) wctx.addr_width = 15; hash_iterate(zvni->neigh_table, zvni_find_neigh_addr_width, &wctx); - vty_out(vty, "%*s %-6s %-17s %-21s%s", + vty_out(vty, "%*s %-6s %-17s %-21s\n", -wctx.addr_width, "IP", "Type", "MAC", - "Remote VTEP", VTY_NEWLINE); + "Remote VTEP"); hash_iterate(zvni->neigh_table, zvni_print_neigh_hash, &wctx); } @@ -328,8 +328,8 @@ zvni_print_mac (zebra_mac_t *mac, void *ctxt) char buf1[20]; vty = (struct vty *) ctxt; - vty_out(vty, "MAC: %s%s", - prefix_mac2str (&mac->macaddr, buf1, sizeof (buf1)), VTY_NEWLINE); + vty_out(vty, "MAC: %s", + prefix_mac2str (&mac->macaddr, buf1, sizeof (buf1))); if (CHECK_FLAG(mac->flags, ZEBRA_MAC_LOCAL)) { struct zebra_ns *zns; @@ -351,7 +351,7 @@ zvni_print_mac (zebra_mac_t *mac, void *ctxt) inet_ntoa (mac->fwd_info.r_vtep_ip)); } vty_out(vty, " ARP ref: %u", mac->neigh_refcnt); - vty_out(vty, "%s", VTY_NEWLINE); + vty_out(vty, "\n"); } /* @@ -389,7 +389,7 @@ zvni_print_mac_hash (struct hash_backet *backet, void *ctxt) buf1, "local", ifp->name); if (vid) vty_out(vty, " %-5u", vid); - vty_out(vty, "%s", VTY_NEWLINE); + vty_out(vty, "\n"); wctx->count++; } else @@ -401,24 +401,23 @@ zvni_print_mac_hash (struct hash_backet *backet, void *ctxt) { if (wctx->count == 0) { - vty_out(vty, "%sVNI %u%s%s", - VTY_NEWLINE, wctx->zvni->vni,VTY_NEWLINE, VTY_NEWLINE); - vty_out(vty, "%-17s %-6s %-21s %-5s%s", + vty_out(vty, "\nVNI %u", + wctx->zvni->vni); + vty_out(vty, "%-17s %-6s %-21s %-5s", "MAC", "Type", "Intf/Remote VTEP", - "VLAN", VTY_NEWLINE); + "VLAN"); } - vty_out(vty, "%-17s %-6s %-21s%s", + vty_out(vty, "%-17s %-6s %-21s", buf1, "remote", - inet_ntoa (mac->fwd_info.r_vtep_ip), - VTY_NEWLINE); + inet_ntoa (mac->fwd_info.r_vtep_ip)); wctx->count++; } } else { - vty_out(vty, "%-17s %-6s %-21s%s", + vty_out(vty, "%-17s %-6s %-21s", buf1, "remote", - inet_ntoa (mac->fwd_info.r_vtep_ip), VTY_NEWLINE); + inet_ntoa (mac->fwd_info.r_vtep_ip)); wctx->count++; } } @@ -451,10 +450,10 @@ zvni_print_mac_hash_all_vni (struct hash_backet *backet, void *ctxt) return; if (!CHECK_FLAG(wctx->flags, SHOW_REMOTE_MAC_FROM_VTEP)) { - vty_out(vty, "%sVNI %u #MACs (local and remote) %u%s%s", - VTY_NEWLINE, zvni->vni, num_macs, VTY_NEWLINE, VTY_NEWLINE); - vty_out(vty, "%-17s %-6s %-21s %-5s%s", - "MAC", "Type", "Intf/Remote VTEP", "VLAN", VTY_NEWLINE); + vty_out(vty, "\nVNI %u #MACs (local and remote) %u\n\n", + zvni->vni, num_macs); + vty_out(vty, "%-17s %-6s %-21s %-5s\n", + "MAC", "Type", "Intf/Remote VTEP", "VLAN"); } hash_iterate(zvni->mac_table, zvni_print_mac_hash, wctx); @@ -473,33 +472,33 @@ zvni_print (zebra_vni_t *zvni, void *ctxt) vty = (struct vty *) ctxt; - vty_out(vty, "VNI: %u%s", zvni->vni, VTY_NEWLINE); + vty_out(vty, "VNI: %u\n", zvni->vni); if (!zvni->vxlan_if) { // unexpected - vty_out(vty, " VxLAN interface: unknown%s", VTY_NEWLINE); + vty_out(vty, " VxLAN interface: unknown\n"); return; } - vty_out(vty, " VxLAN interface: %s ifIndex: %u VTEP IP: %s%s", + vty_out(vty, " VxLAN interface: %s ifIndex: %u VTEP IP: %s\n", zvni->vxlan_if->name, zvni->vxlan_if->ifindex, - inet_ntoa(zvni->local_vtep_ip), VTY_NEWLINE); + inet_ntoa(zvni->local_vtep_ip)); if (!zvni->vteps) { - vty_out(vty, " No remote VTEPs known for this VNI%s", VTY_NEWLINE); + vty_out(vty, " No remote VTEPs known for this VNI\n"); } else { - vty_out(vty, " Remote VTEPs for this VNI:%s", VTY_NEWLINE); + vty_out(vty, " Remote VTEPs for this VNI:\n"); for (zvtep = zvni->vteps; zvtep; zvtep = zvtep->next) - vty_out(vty, " %s%s", - inet_ntoa (zvtep->vtep_ip), VTY_NEWLINE); + vty_out(vty, " %s\n", + inet_ntoa (zvtep->vtep_ip)); } num_macs = hashcount(zvni->mac_table); - vty_out(vty, " Number of MACs (local and remote) known for this VNI: %u%s", - num_macs, VTY_NEWLINE); + vty_out(vty, " Number of MACs (local and remote) known for this VNI: %u\n", + num_macs); num_neigh = hashcount(zvni->neigh_table); vty_out(vty, " Number of ARPs (IPv4 and IPv6, local and remote) " - "known for this VNI: %u%s", num_neigh, VTY_NEWLINE); + "known for this VNI: %u", num_neigh); } /* @@ -529,11 +528,11 @@ zvni_print_hash (struct hash_backet *backet, void *ctxt) num_macs = hashcount(zvni->mac_table); num_neigh = hashcount(zvni->neigh_table); - vty_out(vty, "%-10u %-21s %-15s %-8u %-8u %-15u%s", + vty_out(vty, "%-10u %-21s %-15s %-8u %-8u %-15u\n", zvni->vni, zvni->vxlan_if ? zvni->vxlan_if->name : "unknown", inet_ntoa(zvni->local_vtep_ip), - num_macs, num_neigh, num_vteps, VTY_NEWLINE); + num_macs, num_neigh, num_vteps); } /* @@ -1779,7 +1778,7 @@ zebra_vxlan_print_neigh_vni (struct vty *vty, struct zebra_vrf *zvrf, vni_t vni) zvni = zvni_lookup (zvrf, vni); if (!zvni) { - vty_out (vty, "%% VNI %u does not exist%s", vni, VTY_NEWLINE); + vty_out (vty, "%% VNI %u does not exist\n", vni); return; } num_neigh = hashcount(zvni->neigh_table); @@ -1796,11 +1795,11 @@ zebra_vxlan_print_neigh_vni (struct vty *vty, struct zebra_vrf *zvrf, vni_t vni) wctx.addr_width = 15; hash_iterate(zvni->neigh_table, zvni_find_neigh_addr_width, &wctx); - vty_out(vty, "Number of ARPs (local and remote) known for this VNI: %u%s", - num_neigh, VTY_NEWLINE); - vty_out(vty, "%*s %-6s %-17s %-21s%s", + vty_out(vty, "Number of ARPs (local and remote) known for this VNI: %u\n", + num_neigh); + vty_out(vty, "%*s %-6s %-17s %-21s\n", -wctx.addr_width, "IP", "Type", "MAC", - "Remote VTEP", VTY_NEWLINE); + "Remote VTEP"); hash_iterate(zvni->neigh_table, zvni_print_neigh_hash, &wctx); } @@ -1831,14 +1830,14 @@ zebra_vxlan_print_specific_neigh_vni (struct vty *vty, struct zebra_vrf *zvrf, zvni = zvni_lookup (zvrf, vni); if (!zvni) { - vty_out (vty, "%% VNI %u does not exist%s", vni, VTY_NEWLINE); + vty_out (vty, "%% VNI %u does not exist", vni); return; } n = zvni_neigh_lookup (zvni, ip); if (!n) { - vty_out (vty, "%% Requested neighbor does not exist in VNI %u%s", - vni, VTY_NEWLINE); + vty_out (vty, "%% Requested neighbor does not exist in VNI %u\n", + vni); return; } @@ -1862,7 +1861,7 @@ zebra_vxlan_print_neigh_vni_vtep (struct vty *vty, struct zebra_vrf *zvrf, zvni = zvni_lookup (zvrf, vni); if (!zvni) { - vty_out (vty, "%% VNI %u does not exist%s", vni, VTY_NEWLINE); + vty_out (vty, "%% VNI %u does not exist\n", vni); return; } num_neigh = hashcount(zvni->neigh_table); @@ -1893,7 +1892,7 @@ zebra_vxlan_print_macs_vni (struct vty *vty, struct zebra_vrf *zvrf, vni_t vni) zvni = zvni_lookup (zvrf, vni); if (!zvni) { - vty_out (vty, "%% VNI %u does not exist%s", vni, VTY_NEWLINE); + vty_out (vty, "%% VNI %u does not exist\n", vni); return; } num_macs = hashcount(zvni->mac_table); @@ -1904,10 +1903,10 @@ zebra_vxlan_print_macs_vni (struct vty *vty, struct zebra_vrf *zvrf, vni_t vni) wctx.zvni = zvni; wctx.vty = vty; - vty_out(vty, "Number of MACs (local and remote) known for this VNI: %u%s", - num_macs, VTY_NEWLINE); - vty_out(vty, "%-17s %-6s %-21s %-5s%s", - "MAC", "Type", "Intf/Remote VTEP", "VLAN", VTY_NEWLINE); + vty_out(vty, "Number of MACs (local and remote) known for this VNI: %u\n", + num_macs); + vty_out(vty, "%-17s %-6s %-21s %-5s\n", + "MAC", "Type", "Intf/Remote VTEP", "VLAN"); hash_iterate(zvni->mac_table, zvni_print_mac_hash, &wctx); } @@ -1960,14 +1959,14 @@ zebra_vxlan_print_specific_mac_vni (struct vty *vty, struct zebra_vrf *zvrf, zvni = zvni_lookup (zvrf, vni); if (!zvni) { - vty_out (vty, "%% VNI %u does not exist%s", vni, VTY_NEWLINE); + vty_out (vty, "%% VNI %u does not exist\n", vni); return; } mac = zvni_mac_lookup (zvni, macaddr); if (!mac) { - vty_out (vty, "%% Requested MAC does not exist in VNI %u%s", - vni, VTY_NEWLINE); + vty_out (vty, "%% Requested MAC does not exist in VNI %u\n", + vni); return; } @@ -1990,7 +1989,7 @@ zebra_vxlan_print_macs_vni_vtep (struct vty *vty, struct zebra_vrf *zvrf, zvni = zvni_lookup (zvrf, vni); if (!zvni) { - vty_out (vty, "%% VNI %u does not exist%s", vni, VTY_NEWLINE); + vty_out (vty, "%% VNI %u does not exist\n", vni); return; } num_macs = hashcount(zvni->mac_table); @@ -2018,7 +2017,7 @@ zebra_vxlan_print_vni (struct vty *vty, struct zebra_vrf *zvrf, vni_t vni) zvni = zvni_lookup (zvrf, vni); if (!zvni) { - vty_out (vty, "%% VNI %u does not exist%s", vni, VTY_NEWLINE); + vty_out (vty, "%% VNI %u does not exist\n", vni); return; } zvni_print (zvni, (void *)vty); @@ -2037,10 +2036,10 @@ zebra_vxlan_print_vnis (struct vty *vty, struct zebra_vrf *zvrf) num_vnis = hashcount(zvrf->vni_table); if (!num_vnis) return; - vty_out(vty, "Number of VNIs: %u%s", num_vnis, VTY_NEWLINE); - vty_out(vty, "%-10s %-21s %-15s %-8s %-8s %-15s%s", + vty_out(vty, "Number of VNIs: %u\n", num_vnis); + vty_out(vty, "%-10s %-21s %-15s %-8s %-8s %-15s\n", "VNI", "VxLAN IF", "VTEP IP", "# MACs", "# ARPs", - "# Remote VTEPs", VTY_NEWLINE); + "# Remote VTEPs"); hash_iterate(zvrf->vni_table, zvni_print_hash, vty); } |