diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-07-14 14:24:46 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-07-14 14:24:46 +0200 |
commit | 1ea6b3f237295a7e7dae3a46a4d07b41a6453c04 (patch) | |
tree | a8803b2d31a56e6d5296c1d1880205525a015c45 /bgpd/bgp_mplsvpn.c | |
parent | Merge remote-tracking branch 'origin/master' into evpn_plus_struct_attr (diff) | |
parent | Merge pull request #813 from opensourcerouting/newline-redux (diff) | |
download | frr-1ea6b3f237295a7e7dae3a46a4d07b41a6453c04.tar.xz frr-1ea6b3f237295a7e7dae3a46a4d07b41a6453c04.zip |
Merge remote-tracking branch 'origin/master' into evpn_plus_struct_attr
Diffstat (limited to 'bgpd/bgp_mplsvpn.c')
-rw-r--r-- | bgpd/bgp_mplsvpn.c | 72 |
1 files changed, 35 insertions, 37 deletions
diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c index 3973663e9..3a8398d8a 100644 --- a/bgpd/bgp_mplsvpn.c +++ b/bgpd/bgp_mplsvpn.c @@ -367,7 +367,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; } @@ -393,7 +393,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; } @@ -438,16 +438,15 @@ bgp_show_mpls_vpn (struct vty *vty, afi_t afi, struct prefix_rd *prd, else { if (tags) - vty_outln (vty, V4_HEADER_TAG); + vty_out (vty, V4_HEADER_TAG); else { - vty_outln (vty, "BGP table version is 0, local router ID is %s", + vty_out (vty, "BGP table version is 0, local router ID is %s\n", inet_ntoa(bgp->router_id)); - vty_outln (vty, - "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal"); - vty_outln (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete%s", - VTYNL); - vty_outln (vty, V4_HEADER); + vty_out (vty, + "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal\n"); + vty_out (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete\n\n"); + vty_out (vty, V4_HEADER); } } header = 0; @@ -507,7 +506,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; } @@ -544,17 +543,16 @@ bgp_show_mpls_vpn (struct vty *vty, afi_t afi, struct prefix_rd *prd, if (use_json) { json_object_object_add(json, "routes", json_nroute); - vty_outln (vty, "%s", + vty_out (vty, "%s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY)); json_object_free(json); } else { if (output_count == 0) - vty_outln (vty, "No prefixes displayed, %ld exist", total_count); + vty_out (vty, "No prefixes displayed, %ld exist\n", total_count); else - vty_outln (vty, "%sDisplayed %ld routes and %ld total paths", - VTYNL, output_count, total_count); + vty_out (vty, "\nDisplayed %ld routes and %ld total paths\n", output_count, total_count); } return CMD_SUCCESS; @@ -585,7 +583,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)); @@ -620,7 +618,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); @@ -685,7 +683,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); @@ -724,11 +722,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; } @@ -740,11 +738,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; } @@ -787,11 +785,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; } @@ -803,11 +801,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; } @@ -820,11 +818,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; } @@ -864,11 +862,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); @@ -879,11 +877,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); @@ -925,11 +923,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; } @@ -941,11 +939,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; } @@ -957,11 +955,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; } |