summaryrefslogtreecommitdiffstats
path: root/bgpd/rfapi/bgp_rfapi_cfg.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/rfapi/bgp_rfapi_cfg.c')
-rw-r--r--bgpd/rfapi/bgp_rfapi_cfg.c511
1 files changed, 242 insertions, 269 deletions
diff --git a/bgpd/rfapi/bgp_rfapi_cfg.c b/bgpd/rfapi/bgp_rfapi_cfg.c
index 417620804..63ef671e0 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_out (vty, "VNC not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "VNC not configured");
return CMD_WARNING;
}
@@ -345,7 +345,7 @@ set_ecom_list (
ecomadd = ecommunity_str2com (argv[0]->arg, ECOMMUNITY_ROUTE_TARGET, 0);
if (!ecomadd)
{
- vty_out (vty, "Malformed community-list value%s", VTY_NEWLINE);
+ vty_outln (vty, "Malformed community-list value");
if (ecom)
ecommunity_free (&ecom);
return CMD_WARNING;
@@ -435,13 +435,13 @@ DEFUN (vnc_defaults_rd,
if (!argv[1]->arg[8] || *end)
{
- vty_out (vty, "%% Malformed rd%s", VTY_NEWLINE);
+ vty_outln (vty, "%% Malformed rd");
return CMD_WARNING;
}
if (value32 > 0xffff)
{
- vty_out (vty, "%% Malformed rd (must be less than %u%s",
- 0x0ffff, VTY_NEWLINE);
+ vty_outln (vty, "%% Malformed rd (must be less than %u",
+ 0x0ffff);
return CMD_WARNING;
}
@@ -460,7 +460,7 @@ DEFUN (vnc_defaults_rd,
ret = str2prefix_rd (argv[1]->arg, &prd);
if (!ret)
{
- vty_out (vty, "%% Malformed rd%s", VTY_NEWLINE);
+ vty_outln (vty, "%% Malformed rd");
return CMD_WARNING;
}
}
@@ -491,15 +491,14 @@ DEFUN (vnc_defaults_l2rd,
value = value_l & 0xff;
if (!argv[1]->arg[0] || *end)
{
- vty_out (vty, "%% Malformed l2 nve ID \"%s\"%s", argv[1]->arg,
- VTY_NEWLINE);
+ vty_outln (vty, "%% Malformed l2 nve ID \"%s\"",argv[1]->arg);
return CMD_WARNING;
}
if ((value_l < 1) || (value_l > 0xff))
{
- vty_out (vty,
- "%% Malformed l2 nve id (must be greater than 0 and less than %u%s",
- 0x100, VTY_NEWLINE);
+ vty_outln (vty,
+ "%% Malformed l2 nve id (must be greater than 0 and less than %u",
+ 0x100);
return CMD_WARNING;
}
}
@@ -801,20 +800,20 @@ DEFUN (vnc_redistribute_rh_roo_localadmin,
if (!bgp->rfapi_cfg)
{
- vty_out (vty, "RFAPI not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "RFAPI not configured");
return CMD_WARNING;
}
localadmin = strtoul (argv[4]->arg, &endptr, 0);
if (!argv[4]->arg[0] || *endptr)
{
- vty_out (vty, "%% Malformed value%s", VTY_NEWLINE);
+ vty_outln (vty, "%% Malformed value");
return CMD_WARNING;
}
if (localadmin > 0xffff)
{
- vty_out (vty, "%% Value out of range (0-%d)%s", 0xffff, VTY_NEWLINE);
+ vty_outln (vty, "%% Value out of range (0-%d)", 0xffff);
return CMD_WARNING;
}
@@ -857,7 +856,7 @@ DEFUN (vnc_redistribute_mode,
if (!bgp->rfapi_cfg)
{
- vty_out (vty, "RFAPI not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "RFAPI not configured");
return CMD_WARNING;
}
@@ -877,7 +876,7 @@ DEFUN (vnc_redistribute_mode,
break;
default:
- vty_out (vty, "unknown redistribute mode%s", VTY_NEWLINE);
+ vty_outln (vty, "unknown redistribute mode");
return CMD_WARNING;
}
@@ -912,13 +911,13 @@ DEFUN (vnc_redistribute_protocol,
if (!bgp->rfapi_cfg)
{
- vty_out (vty, "RFAPI not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "RFAPI not configured");
return CMD_WARNING;
}
if (rfapi_str2route_type (argv[2]->arg, argv[3]->arg, &afi, &type))
{
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
+ vty_outln (vty, "%% Invalid route type");
return CMD_WARNING;
}
@@ -960,13 +959,13 @@ DEFUN (vnc_no_redistribute_protocol,
if (!bgp->rfapi_cfg)
{
- vty_out (vty, "RFAPI not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "RFAPI not configured");
return CMD_WARNING;
}
if (rfapi_str2route_type (argv[3]->arg, argv[4]->arg, &afi, &type))
{
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
+ vty_outln (vty, "%% Invalid route type");
return CMD_WARNING;
}
@@ -1001,13 +1000,13 @@ DEFUN (vnc_redistribute_bgp_exterior,
if (!bgp->rfapi_cfg)
{
- vty_out (vty, "RFAPI not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "RFAPI not configured");
return CMD_WARNING;
}
if (rfapi_str2route_type (argv[2]->arg, "bgp-direct-to-nve-groups", &afi, &type))
{
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
+ vty_outln (vty, "%% Invalid route type");
return CMD_WARNING;
}
@@ -1033,7 +1032,7 @@ DEFUN (vnc_redistribute_nvegroup,
if (!bgp->rfapi_cfg)
{
- vty_out (vty, "rfapi not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "rfapi not configured");
return CMD_WARNING;
}
@@ -1066,7 +1065,7 @@ DEFUN (vnc_redistribute_no_nvegroup,
if (!bgp->rfapi_cfg)
{
- vty_out (vty, "rfapi not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "rfapi not configured");
return CMD_WARNING;
}
@@ -1096,7 +1095,7 @@ DEFUN (vnc_redistribute_lifetime,
if (!bgp->rfapi_cfg)
{
- vty_out (vty, "rfapi not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "rfapi not configured");
return CMD_WARNING;
}
@@ -1136,7 +1135,7 @@ DEFUN (vnc_redist_bgpdirect_no_prefixlist,
if (!(hc = bgp->rfapi_cfg))
{
- vty_out (vty, "rfapi not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "rfapi not configured");
return CMD_WARNING;
}
@@ -1189,7 +1188,7 @@ DEFUN (vnc_redist_bgpdirect_prefixlist,
if (!(hc = bgp->rfapi_cfg))
{
- vty_out (vty, "rfapi not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "rfapi not configured");
return CMD_WARNING;
}
@@ -1239,7 +1238,7 @@ DEFUN (vnc_redist_bgpdirect_no_routemap,
if (!(hc = bgp->rfapi_cfg))
{
- vty_out (vty, "rfapi not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "rfapi not configured");
return CMD_WARNING;
}
@@ -1279,7 +1278,7 @@ DEFUN (vnc_redist_bgpdirect_routemap,
if (!(hc = bgp->rfapi_cfg))
{
- vty_out (vty, "rfapi not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "rfapi not configured");
return CMD_WARNING;
}
@@ -1324,7 +1323,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_no_prefixlist,
if (!bgp->rfapi_cfg)
{
- vty_out (vty, "rfapi not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "rfapi not configured");
return CMD_WARNING;
}
@@ -1332,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_out (vty, "Current NVE group no longer exists%s", VTY_NEWLINE);
+ vty_outln (vty, "Current NVE group no longer exists");
return CMD_WARNING;
}
@@ -1373,7 +1372,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_prefixlist,
if (!bgp->rfapi_cfg)
{
- vty_out (vty, "rfapi not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "rfapi not configured");
return CMD_WARNING;
}
@@ -1381,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_out (vty, "Current NVE group no longer exists%s", VTY_NEWLINE);
+ vty_outln (vty, "Current NVE group no longer exists");
return CMD_WARNING;
}
@@ -1421,7 +1420,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_no_routemap,
if (!bgp->rfapi_cfg)
{
- vty_out (vty, "rfapi not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "rfapi not configured");
return CMD_WARNING;
}
@@ -1429,7 +1428,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_no_routemap,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_out (vty, "Current NVE group no longer exists%s", VTY_NEWLINE);
+ vty_outln (vty, "Current NVE group no longer exists");
return CMD_WARNING;
}
@@ -1457,7 +1456,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_routemap,
if (!bgp->rfapi_cfg)
{
- vty_out (vty, "rfapi not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "rfapi not configured");
return CMD_WARNING;
}
@@ -1465,7 +1464,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_routemap,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_out (vty, "Current NVE group no longer exists%s", VTY_NEWLINE);
+ vty_outln (vty, "Current NVE group no longer exists");
return CMD_WARNING;
}
@@ -1506,7 +1505,7 @@ DEFUN (vnc_export_mode,
if (!bgp->rfapi_cfg)
{
- vty_out (vty, "VNC not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "VNC not configured");
return CMD_WARNING;
}
@@ -1528,13 +1527,13 @@ DEFUN (vnc_export_mode,
newmode = BGP_VNC_CONFIG_EXPORT_BGP_MODE_RH;
break;
default:
- vty_out (vty, "Invalid mode specified%s", VTY_NEWLINE);
+ vty_outln (vty, "Invalid mode specified");
return CMD_WARNING;
}
if (newmode == oldmode)
{
- vty_out (vty, "Mode unchanged%s", VTY_NEWLINE);
+ vty_outln (vty, "Mode unchanged");
return CMD_SUCCESS;
}
@@ -1552,8 +1551,7 @@ DEFUN (vnc_export_mode,
/*
* export to zebra with RH mode is not yet implemented
*/
- vty_out (vty, "Changing modes for zebra export not implemented yet%s",
- VTY_NEWLINE);
+ vty_outln (vty,"Changing modes for zebra export not implemented yet");
return CMD_WARNING;
oldmode = bgp->rfapi_cfg->flags & BGP_VNC_CONFIG_EXPORT_ZEBRA_MODE_BITS;
@@ -1593,7 +1591,7 @@ DEFUN (vnc_export_mode,
}
break;
default:
- vty_out (vty, "Invalid mode%s", VTY_NEWLINE);
+ vty_outln (vty, "Invalid mode");
return CMD_WARNING;
}
}
@@ -1628,7 +1626,7 @@ DEFUN (vnc_export_nvegroup,
if (!bgp->rfapi_cfg)
{
- vty_out (vty, "rfapi not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "rfapi not configured");
return CMD_WARNING;
}
@@ -1730,7 +1728,7 @@ DEFUN (vnc_no_export_nvegroup,
if (!bgp->rfapi_cfg)
{
- vty_out (vty, "rfapi not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "rfapi not configured");
return CMD_WARNING;
}
@@ -1791,7 +1789,7 @@ DEFUN (vnc_nve_group_export_no_prefixlist,
if (!bgp->rfapi_cfg)
{
- vty_out (vty, "rfapi not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "rfapi not configured");
return CMD_WARNING;
}
@@ -1799,7 +1797,7 @@ DEFUN (vnc_nve_group_export_no_prefixlist,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_out (vty, "Current NVE group no longer exists%s", VTY_NEWLINE);
+ vty_outln (vty, "Current NVE group no longer exists");
return CMD_WARNING;
}
@@ -1860,7 +1858,7 @@ DEFUN (vnc_nve_group_export_prefixlist,
if (!bgp->rfapi_cfg)
{
- vty_out (vty, "rfapi not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "rfapi not configured");
return CMD_WARNING;
}
@@ -1868,7 +1866,7 @@ DEFUN (vnc_nve_group_export_prefixlist,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_out (vty, "Current NVE group no longer exists%s", VTY_NEWLINE);
+ vty_outln (vty, "Current NVE group no longer exists");
return CMD_WARNING;
}
@@ -1917,7 +1915,7 @@ DEFUN (vnc_nve_group_export_no_routemap,
if (!bgp->rfapi_cfg)
{
- vty_out (vty, "rfapi not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "rfapi not configured");
return CMD_WARNING;
}
@@ -1925,7 +1923,7 @@ DEFUN (vnc_nve_group_export_no_routemap,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_out (vty, "Current NVE group no longer exists%s", VTY_NEWLINE);
+ vty_outln (vty, "Current NVE group no longer exists");
return CMD_WARNING;
}
@@ -1976,7 +1974,7 @@ DEFUN (vnc_nve_group_export_routemap,
if (!bgp->rfapi_cfg)
{
- vty_out (vty, "rfapi not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "rfapi not configured");
return CMD_WARNING;
}
@@ -1984,7 +1982,7 @@ DEFUN (vnc_nve_group_export_routemap,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_out (vty, "Current NVE group no longer exists%s", VTY_NEWLINE);
+ vty_outln (vty, "Current NVE group no longer exists");
return CMD_WARNING;
}
@@ -2027,7 +2025,7 @@ DEFUN (vnc_nve_export_no_prefixlist,
if (!(hc = bgp->rfapi_cfg))
{
- vty_out (vty, "rfapi not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "rfapi not configured");
return CMD_WARNING;
}
@@ -2089,7 +2087,7 @@ DEFUN (vnc_nve_export_prefixlist,
if (!(hc = bgp->rfapi_cfg))
{
- vty_out (vty, "rfapi not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "rfapi not configured");
return CMD_WARNING;
}
@@ -2136,7 +2134,7 @@ DEFUN (vnc_nve_export_no_routemap,
if (!(hc = bgp->rfapi_cfg))
{
- vty_out (vty, "rfapi not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "rfapi not configured");
return CMD_WARNING;
}
@@ -2188,7 +2186,7 @@ DEFUN (vnc_nve_export_routemap,
if (!(hc = bgp->rfapi_cfg))
{
- vty_out (vty, "rfapi not configured%s", VTY_NEWLINE);
+ vty_outln (vty, "rfapi not configured");
return CMD_WARNING;
}
@@ -2611,8 +2609,7 @@ bgp_rfapi_delete_nve_group (
vty_out (vty, " un=");
rfapiPrintRfapiIpAddr (vty, &rfd->un_addr);
if (vty)
- vty_out (vty, " to new group \"%s\"%s", rfd->rfg->name,
- VTY_NEWLINE);
+ vty_outln (vty, " to new group \"%s\"",rfd->rfg->name);
}
}
@@ -2626,7 +2623,7 @@ bgp_rfapi_delete_nve_group (
vty_out (vty, " un=");
rfapiPrintRfapiIpAddr (vty, &rfd->un_addr);
if (vty)
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_outln (vty, "");
}
list_delete (orphaned_nves);
}
@@ -2650,8 +2647,7 @@ bgp_rfapi_delete_named_nve_group (
if (!rfg)
{
if (vty)
- vty_out (vty, "No NVE group named \"%s\"%s", rfg_name,
- VTY_NEWLINE);
+ vty_outln (vty, "No NVE group named \"%s\"",rfg_name);
return CMD_WARNING;
}
}
@@ -2741,20 +2737,20 @@ DEFUN (vnc_nve_group_prefix,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_out (vty, "Current NVE group no longer exists%s", VTY_NEWLINE);
+ vty_outln (vty, "Current NVE group no longer exists");
return CMD_WARNING;
}
if (!str2prefix (argv[2]->arg, &p))
{
- vty_out (vty, "Malformed prefix \"%s\"%s", argv[2]->arg, VTY_NEWLINE);
+ vty_outln (vty, "Malformed prefix \"%s\"", argv[2]->arg);
return CMD_WARNING;
}
afi = family2afi (p.family);
if (!afi)
{
- vty_out (vty, "Unsupported address family%s", VTY_NEWLINE);
+ vty_outln (vty, "Unsupported address family");
return CMD_WARNING;
}
@@ -2780,9 +2776,9 @@ DEFUN (vnc_nve_group_prefix,
/*
* different group name: fail
*/
- vty_out (vty, "nve group \"%s\" already has \"%s\" prefix %s%s",
+ vty_outln (vty, "nve group \"%s\" already has \"%s\" prefix %s",
((struct rfapi_nve_group_cfg *) (rn->info))->name,
- argv[1]->arg, argv[2]->arg, VTY_NEWLINE);
+ argv[1]->arg, argv[2]->arg);
return CMD_WARNING;
}
else
@@ -2860,7 +2856,7 @@ DEFUN (vnc_nve_group_rt_import,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_out (vty, "Current NVE group no longer exists%s", VTY_NEWLINE);
+ vty_outln (vty, "Current NVE group no longer exists");
return CMD_WARNING;
}
@@ -2926,7 +2922,7 @@ DEFUN (vnc_nve_group_rt_export,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_out (vty, "Current NVE group no longer exists%s", VTY_NEWLINE);
+ vty_outln (vty, "Current NVE group no longer exists");
return CMD_WARNING;
}
@@ -2964,7 +2960,7 @@ DEFUN (vnc_nve_group_rt_both,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_out (vty, "Current NVE group no longer exists%s", VTY_NEWLINE);
+ vty_outln (vty, "Current NVE group no longer exists");
return CMD_WARNING;
}
@@ -3045,7 +3041,7 @@ DEFUN (vnc_nve_group_l2rd,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_out (vty, "Current NVE group no longer exists%s", VTY_NEWLINE);
+ vty_outln (vty, "Current NVE group no longer exists");
return CMD_WARNING;
}
@@ -3061,15 +3057,14 @@ DEFUN (vnc_nve_group_l2rd,
if (!argv[1]->arg[0] || *end)
{
- vty_out (vty, "%% Malformed l2 nve ID \"%s\"%s", argv[1]->arg,
- VTY_NEWLINE);
+ vty_outln (vty, "%% Malformed l2 nve ID \"%s\"",argv[1]->arg);
return CMD_WARNING;
}
if ((value_l < 1) || (value_l > 0xff))
{
- vty_out (vty,
- "%% Malformed l2 nve id (must be greater than 0 and less than %u%s",
- 0x100, VTY_NEWLINE);
+ vty_outln (vty,
+ "%% Malformed l2 nve id (must be greater than 0 and less than %u",
+ 0x100);
return CMD_WARNING;
}
@@ -3093,7 +3088,7 @@ DEFUN (vnc_nve_group_no_l2rd,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_out (vty, "Current NVE group no longer exists%s", VTY_NEWLINE);
+ vty_outln (vty, "Current NVE group no longer exists");
return CMD_WARNING;
}
@@ -3118,7 +3113,7 @@ DEFUN (vnc_nve_group_rd,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_out (vty, "Current NVE group no longer exists%s", VTY_NEWLINE);
+ vty_outln (vty, "Current NVE group no longer exists");
return CMD_WARNING;
}
@@ -3134,13 +3129,13 @@ DEFUN (vnc_nve_group_rd,
if (!argv[1]->arg[8] || *end)
{
- vty_out (vty, "%% Malformed rd%s", VTY_NEWLINE);
+ vty_outln (vty, "%% Malformed rd");
return CMD_WARNING;
}
if (value32 > 0xffff)
{
- vty_out (vty, "%% Malformed rd (must be less than %u%s",
- 0x0ffff, VTY_NEWLINE);
+ vty_outln (vty, "%% Malformed rd (must be less than %u",
+ 0x0ffff);
return CMD_WARNING;
}
@@ -3159,7 +3154,7 @@ DEFUN (vnc_nve_group_rd,
ret = str2prefix_rd (argv[1]->arg, &prd);
if (!ret)
{
- vty_out (vty, "%% Malformed rd%s", VTY_NEWLINE);
+ vty_outln (vty, "%% Malformed rd");
return CMD_WARNING;
}
}
@@ -3194,7 +3189,7 @@ DEFUN (vnc_nve_group_responselifetime,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_out (vty, "Current NVE group no longer exists%s", VTY_NEWLINE);
+ vty_outln (vty, "Current NVE group no longer exists");
return CMD_WARNING;
}
@@ -3300,7 +3295,7 @@ DEFUN (vnc_no_vrf_policy,
if (!bgp)
{
- vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
+ vty_outln (vty, "No BGP process is configured");
return CMD_WARNING;
}
return bgp_rfapi_delete_named_nve_group (vty, bgp, argv[2]->arg, RFAPI_GROUP_CFG_VRF);
@@ -3319,7 +3314,7 @@ DEFUN (vnc_vrf_policy_label,
if (!bgp)
{
- vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
+ vty_outln (vty, "No BGP process is configured");
return CMD_WARNING;
}
@@ -3327,7 +3322,7 @@ DEFUN (vnc_vrf_policy_label,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_out (vty, "Current NVE group no longer exists%s", VTY_NEWLINE);
+ vty_outln (vty, "Current NVE group no longer exists");
return CMD_WARNING;
}
@@ -3360,7 +3355,7 @@ DEFUN (vnc_vrf_policy_no_label,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_out (vty, "Current VRF group no longer exists%s", VTY_NEWLINE);
+ vty_outln (vty, "Current VRF group no longer exists");
return CMD_WARNING;
}
@@ -3395,7 +3390,7 @@ DEFUN (vnc_vrf_policy_nexthop,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_out (vty, "Current VRF no longer exists%s", VTY_NEWLINE);
+ vty_outln (vty, "Current VRF no longer exists");
return CMD_WARNING;
}
@@ -3445,7 +3440,7 @@ DEFUN (vnc_vrf_policy_rt_import,
if (!bgp)
{
- vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
+ vty_outln (vty, "No BGP process is configured");
return CMD_WARNING;
}
@@ -3453,7 +3448,7 @@ DEFUN (vnc_vrf_policy_rt_import,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_out (vty, "Current NVE group no longer exists%s", VTY_NEWLINE);
+ vty_outln (vty, "Current NVE group no longer exists");
return CMD_WARNING;
}
@@ -3517,7 +3512,7 @@ DEFUN (vnc_vrf_policy_rt_export,
if (!bgp)
{
- vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
+ vty_outln (vty, "No BGP process is configured");
return CMD_WARNING;
}
@@ -3525,7 +3520,7 @@ DEFUN (vnc_vrf_policy_rt_export,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_out (vty, "Current NVE group no longer exists%s", VTY_NEWLINE);
+ vty_outln (vty, "Current NVE group no longer exists");
return CMD_WARNING;
}
@@ -3561,7 +3556,7 @@ DEFUN (vnc_vrf_policy_rt_both,
if (!bgp)
{
- vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
+ vty_outln (vty, "No BGP process is configured");
return CMD_WARNING;
}
@@ -3569,7 +3564,7 @@ DEFUN (vnc_vrf_policy_rt_both,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_out (vty, "Current NVE group no longer exists%s", VTY_NEWLINE);
+ vty_outln (vty, "Current NVE group no longer exists");
return CMD_WARNING;
}
@@ -3649,7 +3644,7 @@ DEFUN (vnc_vrf_policy_rd,
if (!bgp)
{
- vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
+ vty_outln (vty, "No BGP process is configured");
return CMD_WARNING;
}
@@ -3657,7 +3652,7 @@ DEFUN (vnc_vrf_policy_rd,
if (!listnode_lookup (bgp->rfapi_cfg->nve_groups_sequential, rfg))
{
/* Not in list anymore */
- vty_out (vty, "Current NVE group no longer exists%s", VTY_NEWLINE);
+ vty_outln (vty, "Current NVE group no longer exists");
return CMD_WARNING;
}
@@ -3673,13 +3668,13 @@ DEFUN (vnc_vrf_policy_rd,
if (!*(argv[1]->arg + 5) || *end)
{
- vty_out (vty, "%% Malformed rd%s", VTY_NEWLINE);
+ vty_outln (vty, "%% Malformed rd");
return CMD_WARNING;
}
if (value32 > 0xffff)
{
- vty_out (vty, "%% Malformed rd (must be less than %u%s",
- 0x0ffff, VTY_NEWLINE);
+ vty_outln (vty, "%% Malformed rd (must be less than %u",
+ 0x0ffff);
return CMD_WARNING;
}
@@ -3698,7 +3693,7 @@ DEFUN (vnc_vrf_policy_rd,
ret = str2prefix_rd (argv[1]->arg, &prd);
if (!ret)
{
- vty_out (vty, "%% Malformed rd%s", VTY_NEWLINE);
+ vty_outln (vty, "%% Malformed rd");
return CMD_WARNING;
}
}
@@ -3816,8 +3811,7 @@ bgp_rfapi_delete_named_l2_group (
if (!rfg)
{
if (vty)
- vty_out (vty, "No L2 group named \"%s\"%s", rfg_name,
- VTY_NEWLINE);
+ vty_outln (vty, "No L2 group named \"%s\"",rfg_name);
return CMD_WARNING;
}
}
@@ -3842,7 +3836,7 @@ DEFUN (vnc_no_l2_group,
if (!bgp)
{
- vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
+ vty_outln (vty, "No BGP process is configured");
return CMD_WARNING;
}
return bgp_rfapi_delete_named_l2_group (vty, bgp, argv[3]->arg);
@@ -3860,7 +3854,7 @@ DEFUN (vnc_l2_group_lni,
if (!bgp)
{
- vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
+ vty_outln (vty, "No BGP process is configured");
return CMD_WARNING;
}
@@ -3868,7 +3862,7 @@ DEFUN (vnc_l2_group_lni,
if (!listnode_lookup (bgp->rfapi_cfg->l2_groups, rfg))
{
/* Not in list anymore */
- vty_out (vty, "Current L2 group no longer exists%s", VTY_NEWLINE);
+ vty_outln (vty, "Current L2 group no longer exists");
return CMD_WARNING;
}
@@ -3889,7 +3883,7 @@ DEFUN (vnc_l2_group_labels,
if (!bgp)
{
- vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
+ vty_outln (vty, "No BGP process is configured");
return CMD_WARNING;
}
@@ -3897,7 +3891,7 @@ DEFUN (vnc_l2_group_labels,
if (!listnode_lookup (bgp->rfapi_cfg->l2_groups, rfg))
{
/* Not in list anymore */
- vty_out (vty, "Current L2 group no longer exists%s", VTY_NEWLINE);
+ vty_outln (vty, "Current L2 group no longer exists");
return CMD_WARNING;
}
@@ -3934,7 +3928,7 @@ DEFUN (vnc_l2_group_no_labels,
if (!bgp)
{
- vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
+ vty_outln (vty, "No BGP process is configured");
return CMD_WARNING;
}
@@ -3942,14 +3936,14 @@ DEFUN (vnc_l2_group_no_labels,
if (!listnode_lookup (bgp->rfapi_cfg->l2_groups, rfg))
{
/* Not in list anymore */
- vty_out (vty, "Current L2 group no longer exists%s", VTY_NEWLINE);
+ vty_outln (vty, "Current L2 group no longer exists");
return CMD_WARNING;
}
ll = rfg->labels;
if (ll == NULL)
{
- vty_out (vty, "Label no longer associated with group%s", VTY_NEWLINE);
+ vty_outln (vty, "Label no longer associated with group");
return CMD_WARNING;
}
@@ -3991,13 +3985,13 @@ DEFUN (vnc_l2_group_rt,
do_export = 1;
break;
default:
- vty_out (vty, "Unknown option, %s%s", argv[1]->arg, VTY_NEWLINE);
+ vty_outln (vty, "Unknown option, %s", argv[1]->arg);
return CMD_ERR_NO_MATCH;
}
if (!bgp)
{
- vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
+ vty_outln (vty, "No BGP process is configured");
return CMD_WARNING;
}
@@ -4005,7 +3999,7 @@ DEFUN (vnc_l2_group_rt,
if (!listnode_lookup (bgp->rfapi_cfg->l2_groups, rfg))
{
/* Not in list anymore */
- vty_out (vty, "Current L2 group no longer exists%s", VTY_NEWLINE);
+ vty_outln (vty, "Current L2 group no longer exists");
return CMD_WARNING;
}
@@ -4281,20 +4275,20 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
if (bgp->rfapi == NULL || hc == NULL)
return write;
- vty_out (vty, "!%s", VTY_NEWLINE);
+ vty_outln (vty, "!");
for (ALL_LIST_ELEMENTS (hc->nve_groups_sequential, node, nnode, rfg))
if (rfg->type == RFAPI_GROUP_CFG_VRF)
{
++write;
- vty_out (vty, " vrf-policy %s%s", rfg->name, VTY_NEWLINE);
+ vty_outln (vty, " vrf-policy %s", rfg->name);
if (rfg->label <= MPLS_LABEL_MAX)
{
- vty_out (vty, " label %u%s", rfg->label, VTY_NEWLINE);
+ vty_outln (vty, " label %u", rfg->label);
}
if (CHECK_FLAG (rfg->flags, RFAPI_RFG_VPN_NH_SELF))
{
- vty_out (vty, " nexthop self%s", VTY_NEWLINE);
+ vty_outln (vty, " nexthop self");
}
else
@@ -4310,7 +4304,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
}
else
{
- vty_out (vty, " nexthop %s%s", buf, VTY_NEWLINE);
+ vty_outln (vty, " nexthop %s", buf);
}
}
}
@@ -4328,7 +4322,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
value = ((rfg->rd.val[6] << 8) & 0x0ff00) |
(rfg->rd.val[7] & 0x0ff);
- vty_out (vty, " rd auto:nh:%d%s", value, VTY_NEWLINE);
+ vty_outln (vty, " rd auto:nh:%d", value);
}
else
@@ -4338,11 +4332,11 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
!buf[0] || buf[BUFSIZ - 1])
{
- vty_out (vty, "!Error: Can't convert rd%s", VTY_NEWLINE);
+ vty_outln (vty, "!Error: Can't convert rd");
}
else
{
- vty_out (vty, " rd %s%s", buf, VTY_NEWLINE);
+ vty_outln (vty, " rd %s", buf);
}
}
}
@@ -4352,7 +4346,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_out (vty, " rt both %s%s", b, VTY_NEWLINE);
+ vty_outln (vty, " rt both %s", b);
XFREE (MTYPE_ECOMMUNITY_STR, b);
}
else
@@ -4361,14 +4355,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_out (vty, " rt import %s%s", b, VTY_NEWLINE);
+ vty_outln (vty, " rt import %s", 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_out (vty, " rt export %s%s", b, VTY_NEWLINE);
+ vty_outln (vty, " rt export %s", b);
XFREE (MTYPE_ECOMMUNITY_STR, b);
}
}
@@ -4383,15 +4377,13 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
if (rfg->plist_export_bgp_name[afi])
{
- vty_out (vty, " export bgp %s prefix-list %s%s",
- afistr, rfg->plist_export_bgp_name[afi],
- VTY_NEWLINE);
+ vty_outln (vty, " export bgp %s prefix-list %s",
+ afistr,rfg->plist_export_bgp_name[afi]);
}
if (rfg->plist_export_zebra_name[afi])
{
- vty_out (vty, " export zebra %s prefix-list %s%s",
- afistr, rfg->plist_export_zebra_name[afi],
- VTY_NEWLINE);
+ vty_outln (vty, " export zebra %s prefix-list %s",
+ afistr,rfg->plist_export_zebra_name[afi]);
}
/*
* currently we only support redist plists for bgp-direct.
@@ -4400,50 +4392,46 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
*/
if (rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT][afi])
{
- vty_out (vty, " redistribute bgp-direct %s prefix-list %s%s",
+ vty_outln (vty, " redistribute bgp-direct %s prefix-list %s",
afistr,
- rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT][afi],
- VTY_NEWLINE);
+ rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT][afi]);
}
if (rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT][afi])
{
- vty_out (vty,
- " redistribute bgp-direct-to-nve-groups %s prefix-list %s%s",
+ vty_outln (vty,
+ " redistribute bgp-direct-to-nve-groups %s prefix-list %s",
afistr,
- rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT]
- [afi], VTY_NEWLINE);
+ rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT][afi]);
}
}
if (rfg->routemap_export_bgp_name)
{
- vty_out (vty, " export bgp route-map %s%s",
- rfg->routemap_export_bgp_name, VTY_NEWLINE);
+ vty_outln (vty, " export bgp route-map %s",
+ rfg->routemap_export_bgp_name);
}
if (rfg->routemap_export_zebra_name)
{
- vty_out (vty, " export zebra route-map %s%s",
- rfg->routemap_export_zebra_name, VTY_NEWLINE);
+ vty_outln (vty, " export zebra route-map %s",
+ rfg->routemap_export_zebra_name);
}
if (rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT])
{
- vty_out (vty, " redistribute bgp-direct route-map %s%s",
- rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT],
- VTY_NEWLINE);
+ vty_outln (vty, " redistribute bgp-direct route-map %s",
+ rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT]);
}
if (rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT])
{
- vty_out (vty,
- " redistribute bgp-direct-to-nve-groups route-map %s%s",
- rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT],
- VTY_NEWLINE);
+ vty_outln (vty,
+ " redistribute bgp-direct-to-nve-groups route-map %s",
+ rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT]);
}
- vty_out (vty, " exit-vrf-policy%s", VTY_NEWLINE);
- vty_out (vty, "!%s", VTY_NEWLINE);
+ vty_outln (vty, " exit-vrf-policy");
+ vty_outln (vty, "!");
}
if (hc->flags & BGP_VNC_CONFIG_ADV_UN_METHOD_ENCAP)
{
- vty_out (vty, " vnc advertise-un-method encap-safi%s", VTY_NEWLINE);
+ vty_outln (vty, " vnc advertise-un-method encap-safi");
write++;
}
@@ -4453,7 +4441,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_out (vty, "!%s", VTY_NEWLINE);
+ vty_outln (vty, "!");
if (hc->l2_groups)
{
@@ -4464,10 +4452,10 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
struct listnode *lnode;
void *data;
++write;
- vty_out (vty, " vnc l2-group %s%s", rfg->name, VTY_NEWLINE);
+ vty_outln (vty, " vnc l2-group %s", rfg->name);
if (rfg->logical_net_id != 0)
- vty_out (vty, " logical-network-id %u%s", rfg->logical_net_id,
- VTY_NEWLINE);
+ vty_outln (vty, " logical-network-id %u",
+ rfg->logical_net_id);
if (rfg->labels != NULL && listhead (rfg->labels) != NULL)
{
vty_out (vty, " labels ");
@@ -4475,7 +4463,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
{
vty_out (vty, "%hu ", (uint16_t) ((uintptr_t) data));
}
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_outln (vty, "");
}
if (rfg->rt_import_list && rfg->rt_export_list &&
@@ -4483,7 +4471,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_out (vty, " rt both %s%s", b, VTY_NEWLINE);
+ vty_outln (vty, " rt both %s", b);
XFREE (MTYPE_ECOMMUNITY_STR, b);
}
else
@@ -4492,14 +4480,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_out (vty, " rt import %s%s", b, VTY_NEWLINE);
+ vty_outln (vty, " rt import %s", 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_out (vty, " rt export %s%s", b, VTY_NEWLINE);
+ vty_outln (vty, " rt export %s", b);
XFREE (MTYPE_ECOMMUNITY_STR, b);
}
}
@@ -4510,8 +4498,8 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
RFAPI_RFP_CFG_GROUP_L2,
rfg->name,
rfg->rfp_cfg);
- vty_out (vty, " exit-vnc%s", VTY_NEWLINE);
- vty_out (vty, "!%s", VTY_NEWLINE);
+ vty_outln (vty, " exit-vnc");
+ vty_outln (vty, "!");
}
}
@@ -4523,7 +4511,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
++write;
- vty_out (vty, " vnc defaults%s", VTY_NEWLINE);
+ vty_outln (vty, " vnc defaults");
if (hc->default_rd.prefixlen)
{
@@ -4537,7 +4525,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_out (vty, " rd auto:vn:%d%s", value, VTY_NEWLINE);
+ vty_outln (vty, " rd auto:vn:%d", value);
}
else
@@ -4547,11 +4535,11 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
!buf[0] || buf[BUFSIZ - 1])
{
- vty_out (vty, "!Error: Can't convert rd%s", VTY_NEWLINE);
+ vty_outln (vty, "!Error: Can't convert rd");
}
else
{
- vty_out (vty, " rd %s%s", buf, VTY_NEWLINE);
+ vty_outln (vty, " rd %s", buf);
}
}
}
@@ -4562,7 +4550,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, "%s", VTY_NEWLINE);
+ vty_outln (vty, "");
}
if (hc->default_rt_import_list && hc->default_rt_export_list &&
ecommunity_cmp (hc->default_rt_import_list,
@@ -4570,7 +4558,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_out (vty, " rt both %s%s", b, VTY_NEWLINE);
+ vty_outln (vty, " rt both %s", b);
XFREE (MTYPE_ECOMMUNITY_STR, b);
}
else
@@ -4579,14 +4567,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_out (vty, " rt import %s%s", b, VTY_NEWLINE);
+ vty_outln (vty, " rt import %s", 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_out (vty, " rt export %s%s", b, VTY_NEWLINE);
+ vty_outln (vty, " rt export %s", b);
XFREE (MTYPE_ECOMMUNITY_STR, b);
}
}
@@ -4597,15 +4585,15 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
RFAPI_RFP_CFG_GROUP_DEFAULT,
NULL,
bgp->rfapi_cfg->default_rfp_cfg);
- vty_out (vty, " exit-vnc%s", VTY_NEWLINE);
- vty_out (vty, "!%s", VTY_NEWLINE);
+ vty_outln (vty, " exit-vnc");
+ vty_outln (vty, "!");
}
for (ALL_LIST_ELEMENTS (hc->nve_groups_sequential, node, nnode, rfg))
if (rfg->type == RFAPI_GROUP_CFG_NVE)
{
++write;
- vty_out (vty, " vnc nve-group %s%s", rfg->name, VTY_NEWLINE);
+ vty_outln (vty, " vnc nve-group %s", rfg->name);
if (rfg->vn_prefix.family && rfg->vn_node)
{
@@ -4615,11 +4603,11 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
prefix2str (&rfg->vn_prefix, buf, BUFSIZ);
if (!buf[0] || buf[BUFSIZ - 1])
{
- vty_out (vty, "!Error: Can't convert prefix%s", VTY_NEWLINE);
+ vty_outln (vty, "!Error: Can't convert prefix");
}
else
{
- vty_out (vty, " prefix %s %s%s", "vn", buf, VTY_NEWLINE);
+ vty_outln (vty, " prefix %s %s", "vn", buf);
}
}
@@ -4630,11 +4618,11 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
prefix2str (&rfg->un_prefix, buf, BUFSIZ);
if (!buf[0] || buf[BUFSIZ - 1])
{
- vty_out (vty, "!Error: Can't convert prefix%s", VTY_NEWLINE);
+ vty_outln (vty, "!Error: Can't convert prefix");
}
else
{
- vty_out (vty, " prefix %s %s%s", "un", buf, VTY_NEWLINE);
+ vty_outln (vty, " prefix %s %s", "un", buf);
}
}
@@ -4652,7 +4640,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
value = ((rfg->rd.val[6] << 8) & 0x0ff00) |
(rfg->rd.val[7] & 0x0ff);
- vty_out (vty, " rd auto:vn:%d%s", value, VTY_NEWLINE);
+ vty_outln (vty, " rd auto:vn:%d", value);
}
else
@@ -4662,11 +4650,11 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
!buf[0] || buf[BUFSIZ - 1])
{
- vty_out (vty, "!Error: Can't convert rd%s", VTY_NEWLINE);
+ vty_outln (vty, "!Error: Can't convert rd");
}
else
{
- vty_out (vty, " rd %s%s", buf, VTY_NEWLINE);
+ vty_outln (vty, " rd %s", buf);
}
}
}
@@ -4677,7 +4665,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, "%s", VTY_NEWLINE);
+ vty_outln (vty, "");
}
if (rfg->rt_import_list && rfg->rt_export_list &&
@@ -4686,7 +4674,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_out (vty, " rt both %s%s", b, VTY_NEWLINE);
+ vty_outln (vty, " rt both %s", b);
XFREE (MTYPE_ECOMMUNITY_STR, b);
}
else
@@ -4696,14 +4684,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_out (vty, " rt import %s%s", b, VTY_NEWLINE);
+ vty_outln (vty, " rt import %s", 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_out (vty, " rt export %s%s", b, VTY_NEWLINE);
+ vty_outln (vty, " rt export %s", b);
XFREE (MTYPE_ECOMMUNITY_STR, b);
}
}
@@ -4718,15 +4706,13 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
if (rfg->plist_export_bgp_name[afi])
{
- vty_out (vty, " export bgp %s prefix-list %s%s",
- afistr, rfg->plist_export_bgp_name[afi],
- VTY_NEWLINE);
+ vty_outln (vty, " export bgp %s prefix-list %s",
+ afistr,rfg->plist_export_bgp_name[afi]);
}
if (rfg->plist_export_zebra_name[afi])
{
- vty_out (vty, " export zebra %s prefix-list %s%s",
- afistr, rfg->plist_export_zebra_name[afi],
- VTY_NEWLINE);
+ vty_outln (vty, " export zebra %s prefix-list %s",
+ afistr,rfg->plist_export_zebra_name[afi]);
}
/*
* currently we only support redist plists for bgp-direct.
@@ -4735,43 +4721,39 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
*/
if (rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT][afi])
{
- vty_out (vty, " redistribute bgp-direct %s prefix-list %s%s",
+ vty_outln (vty, " redistribute bgp-direct %s prefix-list %s",
afistr,
- rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT][afi],
- VTY_NEWLINE);
+ rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT][afi]);
}
if (rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT][afi])
{
- vty_out (vty,
- " redistribute bgp-direct-to-nve-groups %s prefix-list %s%s",
+ vty_outln (vty,
+ " redistribute bgp-direct-to-nve-groups %s prefix-list %s",
afistr,
- rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT]
- [afi], VTY_NEWLINE);
+ rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT][afi]);
}
}
if (rfg->routemap_export_bgp_name)
{
- vty_out (vty, " export bgp route-map %s%s",
- rfg->routemap_export_bgp_name, VTY_NEWLINE);
+ vty_outln (vty, " export bgp route-map %s",
+ rfg->routemap_export_bgp_name);
}
if (rfg->routemap_export_zebra_name)
{
- vty_out (vty, " export zebra route-map %s%s",
- rfg->routemap_export_zebra_name, VTY_NEWLINE);
+ vty_outln (vty, " export zebra route-map %s",
+ rfg->routemap_export_zebra_name);
}
if (rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT])
{
- vty_out (vty, " redistribute bgp-direct route-map %s%s",
- rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT],
- VTY_NEWLINE);
+ vty_outln (vty, " redistribute bgp-direct route-map %s",
+ rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT]);
}
if (rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT])
{
- vty_out (vty,
- " redistribute bgp-direct-to-nve-groups route-map %s%s",
- rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT],
- VTY_NEWLINE);
+ vty_outln (vty,
+ " redistribute bgp-direct-to-nve-groups route-map %s",
+ rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT_EXT]);
}
if (bgp->rfapi->rfp_methods.cfg_group_cb)
write +=
@@ -4779,8 +4761,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_out (vty, " exit-vnc%s", VTY_NEWLINE);
- vty_out (vty, "!%s", VTY_NEWLINE);
+ vty_outln (vty, " exit-vnc");
+ vty_outln (vty, "!");
}
} /* have listen ports */
@@ -4789,24 +4771,24 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
*/
if (VNC_EXPORT_BGP_GRP_ENABLED (hc))
{
- vty_out (vty, " vnc export bgp mode group-nve%s", VTY_NEWLINE);
+ vty_outln (vty, " vnc export bgp mode group-nve");
}
else if (VNC_EXPORT_BGP_RH_ENABLED (hc))
{
- vty_out (vty, " vnc export bgp mode registering-nve%s", VTY_NEWLINE);
+ vty_outln (vty, " vnc export bgp mode registering-nve");
}
else if (VNC_EXPORT_BGP_CE_ENABLED (hc))
{
- vty_out (vty, " vnc export bgp mode ce%s", VTY_NEWLINE);
+ vty_outln (vty, " vnc export bgp mode ce");
}
if (VNC_EXPORT_ZEBRA_GRP_ENABLED (hc))
{
- vty_out (vty, " vnc export zebra mode group-nve%s", VTY_NEWLINE);
+ vty_outln (vty, " vnc export zebra mode group-nve");
}
else if (VNC_EXPORT_ZEBRA_RH_ENABLED (hc))
{
- vty_out (vty, " vnc export zebra mode registering-nve%s", VTY_NEWLINE);
+ vty_outln (vty, " vnc export zebra mode registering-nve");
}
if (hc->rfg_export_direct_bgp_l)
@@ -4814,8 +4796,8 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
for (ALL_LIST_ELEMENTS (hc->rfg_export_direct_bgp_l, node, nnode, rfgn))
{
- vty_out (vty, " vnc export bgp group-nve group %s%s",
- rfgn->name, VTY_NEWLINE);
+ vty_outln (vty, " vnc export bgp group-nve group %s",
+ rfgn->name);
}
}
@@ -4824,28 +4806,28 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
for (ALL_LIST_ELEMENTS (hc->rfg_export_zebra_l, node, nnode, rfgn))
{
- vty_out (vty, " vnc export zebra group-nve group %s%s",
- rfgn->name, VTY_NEWLINE);
+ vty_outln (vty, " vnc export zebra group-nve group %s",
+ rfgn->name);
}
}
if (hc->rfg_redist_name)
{
- vty_out (vty, " vnc redistribute nve-group %s%s",
- hc->rfg_redist_name, VTY_NEWLINE);
+ vty_outln (vty, " vnc redistribute nve-group %s",
+ hc->rfg_redist_name);
}
if (hc->redist_lifetime)
{
- vty_out (vty, " vnc redistribute lifetime %d%s",
- hc->redist_lifetime, VTY_NEWLINE);
+ vty_outln (vty, " vnc redistribute lifetime %d",
+ hc->redist_lifetime);
}
if (hc->resolve_nve_roo_local_admin !=
BGP_VNC_CONFIG_RESOLVE_NVE_ROO_LOCAL_ADMIN_DEFAULT)
{
- vty_out (vty, " vnc redistribute resolve-nve roo-ec-local-admin %d%s",
- hc->resolve_nve_roo_local_admin, VTY_NEWLINE);
+ vty_outln (vty, " vnc redistribute resolve-nve roo-ec-local-admin %d",
+ hc->resolve_nve_roo_local_admin);
}
if (hc->redist_mode) /* ! default */
@@ -4866,7 +4848,7 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
}
if (s)
{
- vty_out (vty, " vnc redistribute mode %s%s", s, VTY_NEWLINE);
+ vty_outln (vty, " vnc redistribute mode %s", s);
}
}
@@ -4880,36 +4862,35 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
if (hc->plist_export_bgp_name[afi])
{
- vty_out (vty, " vnc export bgp %s prefix-list %s%s",
- afistr, hc->plist_export_bgp_name[afi], VTY_NEWLINE);
+ vty_outln (vty, " vnc export bgp %s prefix-list %s",
+ afistr, hc->plist_export_bgp_name[afi]);
}
if (hc->plist_export_zebra_name[afi])
{
- vty_out (vty, " vnc export zebra %s prefix-list %s%s",
- afistr, hc->plist_export_zebra_name[afi], VTY_NEWLINE);
+ vty_outln (vty, " vnc export zebra %s prefix-list %s",
+ afistr, hc->plist_export_zebra_name[afi]);
}
if (hc->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT][afi])
{
- vty_out (vty, " vnc redistribute bgp-direct %s prefix-list %s%s",
- afistr, hc->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT][afi],
- VTY_NEWLINE);
+ vty_outln (vty, " vnc redistribute bgp-direct %s prefix-list %s",
+ afistr,hc->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT][afi]);
}
}
if (hc->routemap_export_bgp_name)
{
- vty_out (vty, " vnc export bgp route-map %s%s",
- hc->routemap_export_bgp_name, VTY_NEWLINE);
+ vty_outln (vty, " vnc export bgp route-map %s",
+ hc->routemap_export_bgp_name);
}
if (hc->routemap_export_zebra_name)
{
- vty_out (vty, " vnc export zebra route-map %s%s",
- hc->routemap_export_zebra_name, VTY_NEWLINE);
+ vty_outln (vty, " vnc export zebra route-map %s",
+ hc->routemap_export_zebra_name);
}
if (hc->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT])
{
- vty_out (vty, " vnc redistribute bgp-direct route-map %s%s",
- hc->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT], VTY_NEWLINE);
+ vty_outln (vty, " vnc redistribute bgp-direct route-map %s",
+ hc->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT]);
}
for (afi = AFI_IP; afi < AFI_MAX; ++afi)
@@ -4921,16 +4902,16 @@ bgp_rfapi_cfg_write (struct vty *vty, struct bgp *bgp)
if (type == ZEBRA_ROUTE_BGP_DIRECT_EXT &&
hc->redist_bgp_exterior_view_name)
{
- vty_out (vty, " vnc redistribute %s %s view %s%s",
+ vty_outln (vty, " vnc redistribute %s %s view %s",
((afi == AFI_IP) ? "ipv4" : "ipv6"),
zebra_route_string (type),
- hc->redist_bgp_exterior_view_name, VTY_NEWLINE);
+ hc->redist_bgp_exterior_view_name);
}
else
{
- vty_out (vty, " vnc redistribute %s %s%s",
+ vty_outln (vty, " vnc redistribute %s %s",
((afi == AFI_IP) ? "ipv4" : "ipv6"),
- zebra_route_string (type), VTY_NEWLINE);
+ zebra_route_string(type));
}
}
}
@@ -4947,12 +4928,10 @@ bgp_rfapi_show_summary (struct bgp *bgp, struct vty *vty)
if (hc == NULL)
return;
- vty_out (vty, "%-39s %-19s %s%s", "VNC Advertise method:",
+ vty_outln (vty, "%-39s %-19s %s", "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)" : ""), VTY_NEWLINE);
+ ((hc->flags & BGP_VNC_CONFIG_ADV_UN_METHOD_ENCAP) == (BGP_VNC_CONFIG_ADV_UN_METHOD_ENCAP & BGP_VNC_CONFIG_FLAGS_DEFAULT) ? "(default)" : ""));
/* export */
vty_out (vty, "%-39s ", "Export from VNC:");
/*
@@ -5016,8 +4995,8 @@ 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_out (vty, "%-19s %s%s", (redist ? "" : "Off"),
- (redist ? "" : "(default)"), VTY_NEWLINE);
+ vty_outln (vty, "%-19s %s", (redist ? "" : "Off"),
+ (redist ? "" : "(default)"));
/* Redistribution */
redist = 0;
@@ -5035,34 +5014,28 @@ bgp_rfapi_show_summary (struct bgp *bgp, struct vty *vty)
}
}
}
- vty_out (vty, "%-19s %s%s", (redist ? "" : "Off"),
- (redist ? "" : "(default)"), VTY_NEWLINE);
+ vty_outln (vty, "%-19s %s", (redist ? "" : "Off"),
+ (redist ? "" : "(default)"));
- vty_out (vty, "%-39s %3u%-16s %s%s", "RFP Registration Hold-Down Factor:",
+ vty_outln (vty, "%-39s %3u%-16s %s", "RFP Registration Hold-Down Factor:",
hc->rfp_cfg.holddown_factor, "%",
- (hc->rfp_cfg.holddown_factor ==
- RFAPI_RFP_CFG_DEFAULT_HOLDDOWN_FACTOR ? "(default)" : ""),
- VTY_NEWLINE);
- vty_out (vty, "%-39s %-19s %s%s", "RFP Updated responses:",
+ (hc->rfp_cfg.holddown_factor == RFAPI_RFP_CFG_DEFAULT_HOLDDOWN_FACTOR ? "(default)" : ""));
+ vty_outln (vty, "%-39s %-19s %s", "RFP Updated responses:",
(hc->rfp_cfg.use_updated_response == 0 ? "Off" : "On"),
- (hc->rfp_cfg.use_updated_response == 0 ? "(default)" : ""),
- VTY_NEWLINE);
- vty_out (vty, "%-39s %-19s %s%s", "RFP Removal responses:",
+ (hc->rfp_cfg.use_updated_response == 0 ? "(default)" : ""));
+ vty_outln (vty, "%-39s %-19s %s", "RFP Removal responses:",
(hc->rfp_cfg.use_removes == 0 ? "Off" : "On"),
- (hc->rfp_cfg.use_removes == 0 ? "(default)" : ""), VTY_NEWLINE);
- vty_out (vty, "%-39s %-19s %s%s", "RFP Full table download:",
+ (hc->rfp_cfg.use_removes == 0 ? "(default)" : ""));
+ vty_outln (vty, "%-39s %-19s %s", "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)" : ""), VTY_NEWLINE);
+ (hc->rfp_cfg.download_type == RFAPI_RFP_DOWNLOAD_PARTIAL ? "(default)" : ""));
sprintf (tmp, "%u seconds", hc->rfp_cfg.ftd_advertisement_interval);
- vty_out (vty, "%-39s %-19s %s%s", " Advertisement Interval:", tmp,
- (hc->rfp_cfg.ftd_advertisement_interval ==
- RFAPI_RFP_CFG_DEFAULT_FTD_ADVERTISEMENT_INTERVAL
- ? "(default)" : ""), VTY_NEWLINE);
- vty_out (vty, "%-39s %d seconds%s", "Default RFP response lifetime:",
- hc->default_response_lifetime, VTY_NEWLINE);
- vty_out (vty, "%s", VTY_NEWLINE);
+ vty_outln (vty, "%-39s %-19s %s", " 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:",
+ hc->default_response_lifetime);
+ vty_outln (vty, "");
return;
}