Skip to content

bgpd: new vpn-policy CLI#1913

Merged
donaldsharp merged 3 commits intoFRRouting:masterfrom
LabNConsulting:working/master/bgp-vpn-leak-cli
Mar 20, 2018
Merged

bgpd: new vpn-policy CLI#1913
donaldsharp merged 3 commits intoFRRouting:masterfrom
LabNConsulting:working/master/bgp-vpn-leak-cli

Conversation

@gpziemba
Copy link
Copy Markdown
Contributor

@gpziemba gpziemba commented Mar 16, 2018

PR #1739 added code to leak routes between (default VRF) VPN safi and unicast RIBs in any VRF. That set of changes included temporary CLI including vpn-policy blocks to specify RD/RT/label/&c. After considerable discussion, we arrived at a consensus CLI shown below.

The code of this PR implements the vpn-specific parts of this syntax:

router bgp <as> [vrf <FOO>]
    address-family <afi> unicast
        rd (vpn|evpn) export (AS:NN | IP:nn)
        label (vpn|evpn) export (0..1048575)
        rt (vpn|evpn) (import|export|both) RTLIST...
        nexthop vpn (import|export) (A.B.C.D | X:X::X:X)
        route-map (vpn|evpn|vrf NAME) (import|export) MAP

        [no] import|export [vpn|evpn|evpn8]
        [no] import|export vrf NAME

User documentation of the vpn-specific parts of the above syntax is in PR #1937

@NetDEF-CI
Copy link
Copy Markdown
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-2944/

This is a comment from an EXPERIMENTAL automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.


Warnings Generated during build:

Checkout code: Successful with additional warnings:

<stdin>:105: trailing whitespace.
		if (vpn_leak_from_vpn_active(bgp, afi, NULL) && 
warning: 1 line adds whitespace errors.
Report for bgp_mplsvpn.c
===============================================
> #928: FILE: /tmp/f2/bgp_mplsvpn.c:928:
53c57
< #913: FILE: /tmp/f1/bgp_mplsvpn.c:913:
--
< ERROR: trailing whitespace
< #1147: FILE: /tmp/f1/bgp_mplsvpn.c:1147:
< +^I^Iif (vpn_leak_from_vpn_active(bgp, afi, NULL) && $
---
Report for bgp_vty.c
===============================================
< WARNING: break is not useful after a goto or return
< #73: FILE: /tmp/f1/bgp_vty.c:73:
< +			return BGP_IPV4_NODE;
< +			break;
--
< WARNING: break is not useful after a goto or return
< #76: FILE: /tmp/f1/bgp_vty.c:76:
< +			return BGP_IPV4M_NODE;
< +			break;
--
< WARNING: break is not useful after a goto or return
< #79: FILE: /tmp/f1/bgp_vty.c:79:
< +			return BGP_IPV4L_NODE;
< +			break;
--
< WARNING: break is not useful after a goto or return
< #82: FILE: /tmp/f1/bgp_vty.c:82:
< +			return BGP_VPNV4_NODE;
< +			break;
--
< WARNING: break is not useful after a goto or return
< #86: FILE: /tmp/f1/bgp_vty.c:86:
< +			return BGP_IPV4_NODE;
< +			break;
--
< WARNING: break is not useful after a goto or return
< #93: FILE: /tmp/f1/bgp_vty.c:93:
< +			return BGP_IPV6_NODE;
< +			break;
--
< WARNING: break is not useful after a goto or return
< #96: FILE: /tmp/f1/bgp_vty.c:96:
< +			return BGP_IPV6M_NODE;
< +			break;
--
< WARNING: break is not useful after a goto or return
< #99: FILE: /tmp/f1/bgp_vty.c:99:
< +			return BGP_IPV6L_NODE;
< +			break;
--
< WARNING: break is not useful after a goto or return
< #102: FILE: /tmp/f1/bgp_vty.c:102:
< +			return BGP_VPNV6_NODE;
< +			break;
--
< WARNING: break is not useful after a goto or return
< #106: FILE: /tmp/f1/bgp_vty.c:106:
< +			return BGP_IPV4_NODE;
< +			break;
--
< WARNING: break is not useful after a goto or return
< #111: FILE: /tmp/f1/bgp_vty.c:111:
< +		return BGP_EVPN_NODE;
< +		break;
--
< WARNING: break is not useful after a goto or return
< #115: FILE: /tmp/f1/bgp_vty.c:115:
< +		return BGP_IPV4_NODE;
< +		break;
--
< WARNING: Missing a blank line after declarations
< #126: FILE: /tmp/f1/bgp_vty.c:126:
< +	afi_t afi;
< +	switch (vty->node) {
--
< WARNING: Block comments use * on subsequent lines
< #144: FILE: /tmp/f1/bgp_vty.c:144:
< +/* Utility function to get subsequent address family from current
< +   node.  */
--
< WARNING: Block comments use a trailing */ on a separate line
< #144: FILE: /tmp/f1/bgp_vty.c:144:
< +   node.  */
< 
< WARNING: Missing a blank line after declarations
< #148: FILE: /tmp/f1/bgp_vty.c:148:
< +	safi_t safi;
< +	switch (vty->node) {
--
< WARNING: Missing a blank line after declarations
< #182: FILE: /tmp/f1/bgp_vty.c:182:
< +	afi_t afi = AFI_MAX; /* unknown */
< +	if (strmatch(afi_str, "ipv4"))
--
< WARNING: Missing a blank line after declarations
< #193: FILE: /tmp/f1/bgp_vty.c:193:
< +	int ret = 0;
< +	if (argv_find(argv, argc, "ipv4", index)) {
--
< WARNING: Missing a blank line after declarations
< #209: FILE: /tmp/f1/bgp_vty.c:209:
< +	safi_t safi = SAFI_MAX; /* unknown */
< +	if (strmatch(safi_str, "multicast"))
--
< WARNING: Missing a blank line after declarations
< #224: FILE: /tmp/f1/bgp_vty.c:224:
< +	int ret = 0;
< +	if (argv_find(argv, argc, "unicast", index)) {
--
< WARNING: braces {} are not necessary for single statement blocks
< #353: FILE: /tmp/f1/bgp_vty.c:353:
< +	if (!bgp) {
< +		return NULL;
--
< ERROR: do not use assignment in if condition
< #361: FILE: /tmp/f1/bgp_vty.c:361:
< +			if ((peer = peer_lookup_by_hostname(bgp, ip_str))
< 
< WARNING: braces {} are not necessary for single statement blocks
< #397: FILE: /tmp/f1/bgp_vty.c:397:
< +	if (!bgp) {
< +		return NULL;
--
< WARNING: Block comments use a trailing */ on a separate line
< #407: FILE: /tmp/f1/bgp_vty.c:407:
< +		 * group. */
< 
< WARNING: line over 80 characters
< #443: FILE: /tmp/f1/bgp_vty.c:443:
< +		str = "Peer-group has been shutdown. Activate the peer-group first";
< 
< WARNING: line over 80 characters
< #446: FILE: /tmp/f1/bgp_vty.c:446:
< +		str = "Can't set override-capability and strict-capability-match at the same time";
< 
< WARNING: line over 80 characters
< #476: FILE: /tmp/f1/bgp_vty.c:476:
< +		str = "ebgp-multihop and ttl-security cannot be configured together";
< 
< WARNING: line over 80 characters
< #497: FILE: /tmp/f1/bgp_vty.c:497:
< +		str = "Cannot activate peer for both 'ipv4 unicast' and 'ipv4 labeled-unicast'";
< 
< WARNING: Missing a blank line after declarations
< #766: FILE: /tmp/f1/bgp_vty.c:766:
< +	int idx = 0;
< +	if (argv_find(argv, argc, "cisco", &idx))
--
< ERROR: that open brace { should be on the previous line
< #1265: FILE: /tmp/f1/bgp_vty.c:1265:
< +	if (!wait) /* update-delay <delay> */
< +	{
--
< WARNING: Missing a blank line after declarations
< #1315: FILE: /tmp/f1/bgp_vty.c:1315:
< +	int idx_number = 1;
< +	return bgp_update_delay_config_vty(vty, argv[idx_number]->arg, NULL);
--
< WARNING: Missing a blank line after declarations
< #1327: FILE: /tmp/f1/bgp_vty.c:1327:
< +	int idx_number_2 = 2;
< +	return bgp_update_delay_config_vty(vty, argv[idx_number]->arg,
--
< WARNING: Missing a blank line after declarations
< #1351: FILE: /tmp/f1/bgp_vty.c:1351:
< +		uint32_t quanta = strtoul(num, NULL, 10);
< +		atomic_store_explicit(&bgp->wpkt_quanta, quanta,
--
< WARNING: Missing a blank line after declarations
< #1368: FILE: /tmp/f1/bgp_vty.c:1368:
< +		uint32_t quanta = strtoul(num, NULL, 10);
< +		atomic_store_explicit(&bgp->rpkt_quanta, quanta,
--
< WARNING: Missing a blank line after declarations
< #1402: FILE: /tmp/f1/bgp_vty.c:1402:
< +	int idx_number = 1;
< +	return bgp_wpkt_quanta_config_vty(vty, argv[idx_number]->arg, 1);
--
< WARNING: Missing a blank line after declarations
< #1413: FILE: /tmp/f1/bgp_vty.c:1413:
< +	int idx_number = 2;
< +	return bgp_wpkt_quanta_config_vty(vty, argv[idx_number]->arg, 0);
--
< WARNING: Missing a blank line after declarations
< #1423: FILE: /tmp/f1/bgp_vty.c:1423:
< +	int idx_number = 1;
< +	return bgp_rpkt_quanta_config_vty(vty, argv[idx_number]->arg, 1);
--
< WARNING: Missing a blank line after declarations
< #1434: FILE: /tmp/f1/bgp_vty.c:1434:
< +	int idx_number = 2;
< +	return bgp_rpkt_quanta_config_vty(vty, argv[idx_number]->arg, 0);
--
< WARNING: Missing a blank line after declarations
< #1453: FILE: /tmp/f1/bgp_vty.c:1453:
< +	int idx = 0;
< +	argv_find(argv, argc, "(0-4294967295)", &idx);
--
< WARNING: Missing a blank line after declarations
< #1481: FILE: /tmp/f1/bgp_vty.c:1481:
< +	int idx_number = 1;
< +	return bgp_maxpaths_config_vty(vty, BGP_PEER_EBGP,
--
< WARNING: Missing a blank line after declarations
< #1498: FILE: /tmp/f1/bgp_vty.c:1498:
< +	int idx_number = 2;
< +	return bgp_maxpaths_config_vty(vty, BGP_PEER_IBGP,
--
< WARNING: Missing a blank line after declarations
< #1517: FILE: /tmp/f1/bgp_vty.c:1517:
< +	int idx_number = 2;
< +	return bgp_maxpaths_config_vty(
--
< WARNING: line over 80 characters
< #1726: FILE: /tmp/f1/bgp_vty.c:1726:
< +					    PEER_FLAG_ADDPATH_TX_BESTPATH_PER_AS)) {
< 
< WARNING: else is not generally useful after a break or return
< #1739: FILE: /tmp/f1/bgp_vty.c:1739:
< +			return CMD_WARNING_CONFIG_FAILED;
< +		} else {
< 
< WARNING: Missing a blank line after declarations
< #2083: FILE: /tmp/f1/bgp_vty.c:2083:
< +	int idx = 0;
< +	bgp_flag_set(bgp, BGP_FLAG_ASPATH_MULTIPATH_RELAX);
--
< WARNING: Block comments use a trailing */ on a separate line
< #2086: FILE: /tmp/f1/bgp_vty.c:2086:
< +	 * ignore it */
< 
< WARNING: Missing a blank line after declarations
< #2155: FILE: /tmp/f1/bgp_vty.c:2155:
< +	int idx = 0;
< +	if (argv_find(argv, argc, "confed", &idx))
--
< WARNING: Missing a blank line after declarations
< #2181: FILE: /tmp/f1/bgp_vty.c:2181:
< +	int idx = 0;
< +	if (argv_find(argv, argc, "confed", &idx))
--
< WARNING: Missing a blank line after declarations
< #2478: FILE: /tmp/f1/bgp_vty.c:2478:
< +	char *prefix = argv[idx]->arg;
< +	argv_find(argv, argc, "WORD", &idx);
--
< WARNING: else is not generally useful after a break or return
< #2503: FILE: /tmp/f1/bgp_vty.c:2503:
< +			return CMD_SUCCESS;
< +		else {
--
< WARNING: Missing a blank line after declarations
< #2549: FILE: /tmp/f1/bgp_vty.c:2549:
< +	char *prefix = argv[idx]->arg;
< +	argv_find(argv, argc, "WORD", &idx);
--
< WARNING: Missing a blank line after declarations
< #2718: FILE: /tmp/f1/bgp_vty.c:2718:
< +	int idx_remote_as = 3;
< +	return peer_remote_as_vty(vty, argv[idx_peer]->arg,
--
< WARNING: unnecessary whitespace before a quoted newline
< #2739: FILE: /tmp/f1/bgp_vty.c:2739:
< +		vty_out(vty, "%% Name conflict with peer-group \n");
< 
< WARNING: Missing a blank line after declarations
< #2878: FILE: /tmp/f1/bgp_vty.c:2878:
< +	int idx_remote_as = 4;
< +	return peer_conf_interface_get(vty, argv[idx_word]->arg, AFI_IP,
--
< WARNING: Missing a blank line after declarations
< #2897: FILE: /tmp/f1/bgp_vty.c:2897:
< +	int idx_remote_as = 5;
< +	return peer_conf_interface_get(vty, argv[idx_word]->arg, AFI_IP,
--
< WARNING: unnecessary whitespace before a quoted newline
< #2916: FILE: /tmp/f1/bgp_vty.c:2916:
< +		vty_out(vty, "%% Name conflict with interface: \n");
< 
< WARNING: Block comments use a trailing */ on a separate line
< #2954: FILE: /tmp/f1/bgp_vty.c:2954:
< +			 * interface. */
< 
< WARNING: quoted string split across lines
< #3423: FILE: /tmp/f1/bgp_vty.c:3423:
< +			"%s is directly connected peer, cannot accept disable-"
< +			"connected-check\n",
--
< WARNING: Missing a blank line after declarations
< #3460: FILE: /tmp/f1/bgp_vty.c:3460:
< +	int idx_peer = 1;
< +	return peer_flag_set_vty(vty, argv[idx_peer]->arg, PEER_FLAG_PASSIVE);
--
< WARNING: Missing a blank line after declarations
< #3472: FILE: /tmp/f1/bgp_vty.c:3472:
< +	int idx_peer = 2;
< +	return peer_flag_unset_vty(vty, argv[idx_peer]->arg, PEER_FLAG_PASSIVE);
--
< WARNING: Missing a blank line after declarations
< #3538: FILE: /tmp/f1/bgp_vty.c:3538:
< +	int idx_peer = 1;
< +	return peer_flag_set_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #3552: FILE: /tmp/f1/bgp_vty.c:3552:
< +	int idx_peer = 2;
< +	return peer_flag_unset_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #3565: FILE: /tmp/f1/bgp_vty.c:3565:
< +	int idx_peer = 1;
< +	return peer_flag_set_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #3578: FILE: /tmp/f1/bgp_vty.c:3578:
< +	int idx_peer = 2;
< +	return peer_flag_unset_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #3592: FILE: /tmp/f1/bgp_vty.c:3592:
< +	int idx_peer = 1;
< +	return peer_flag_set_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #3606: FILE: /tmp/f1/bgp_vty.c:3606:
< +	int idx_peer = 2;
< +	return peer_flag_unset_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #3739: FILE: /tmp/f1/bgp_vty.c:3739:
< +	int idx_peer = 1;
< +	return peer_af_flag_set_vty(vty, argv[idx_peer]->arg, bgp_node_afi(vty),
--
< WARNING: Missing a blank line after declarations
< #3758: FILE: /tmp/f1/bgp_vty.c:3758:
< +	int idx_peer = 1;
< +	return peer_af_flag_set_vty(vty, argv[idx_peer]->arg, bgp_node_afi(vty),
--
< WARNING: Missing a blank line after declarations
< #3779: FILE: /tmp/f1/bgp_vty.c:3779:
< +	int idx_peer = 2;
< +	return peer_af_flag_unset_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #3799: FILE: /tmp/f1/bgp_vty.c:3799:
< +	int idx_peer = 2;
< +	return peer_af_flag_unset_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #3820: FILE: /tmp/f1/bgp_vty.c:3820:
< +	int idx_peer = 1;
< +	return peer_af_flag_set_vty(vty, argv[idx_peer]->arg, bgp_node_afi(vty),
--
< WARNING: Missing a blank line after declarations
< #3838: FILE: /tmp/f1/bgp_vty.c:3838:
< +	int idx_peer = 2;
< +	return peer_af_flag_unset_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #3857: FILE: /tmp/f1/bgp_vty.c:3857:
< +	int idx_peer = 1;
< +	return peer_af_flag_set_vty(vty, argv[idx_peer]->arg, bgp_node_afi(vty),
--
< WARNING: Missing a blank line after declarations
< #3876: FILE: /tmp/f1/bgp_vty.c:3876:
< +	int idx_peer = 1;
< +	return peer_af_flag_set_vty(vty, argv[idx_peer]->arg, bgp_node_afi(vty),
--
< WARNING: Missing a blank line after declarations
< #3897: FILE: /tmp/f1/bgp_vty.c:3897:
< +	int idx_peer = 1;
< +	return peer_af_flag_set_vty(vty, argv[idx_peer]->arg, bgp_node_afi(vty),
--
< WARNING: Missing a blank line after declarations
< #3919: FILE: /tmp/f1/bgp_vty.c:3919:
< +	int idx_peer = 1;
< +	return peer_af_flag_set_vty(vty, argv[idx_peer]->arg, bgp_node_afi(vty),
--
< WARNING: Missing a blank line after declarations
< #3942: FILE: /tmp/f1/bgp_vty.c:3942:
< +	int idx_peer = 2;
< +	return peer_af_flag_unset_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #3963: FILE: /tmp/f1/bgp_vty.c:3963:
< +	int idx_peer = 2;
< +	return peer_af_flag_unset_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #3985: FILE: /tmp/f1/bgp_vty.c:3985:
< +	int idx_peer = 2;
< +	return peer_af_flag_unset_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #4008: FILE: /tmp/f1/bgp_vty.c:4008:
< +	int idx_peer = 2;
< +	return peer_af_flag_unset_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #4032: FILE: /tmp/f1/bgp_vty.c:4032:
< +	int idx_peer = 1;
< +	return peer_af_flag_set_vty(vty, argv[idx_peer]->arg, bgp_node_afi(vty),
--
< WARNING: Missing a blank line after declarations
< #4051: FILE: /tmp/f1/bgp_vty.c:4051:
< +	int idx_peer = 2;
< +	return peer_af_flag_unset_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #4174: FILE: /tmp/f1/bgp_vty.c:4174:
< +	int idx_peer = 1;
< +	return peer_af_flag_set_vty(vty, argv[idx_peer]->arg, bgp_node_afi(vty),
--
< WARNING: Missing a blank line after declarations
< #4196: FILE: /tmp/f1/bgp_vty.c:4196:
< +	int idx_peer = 2;
< +	return peer_af_flag_unset_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #4243: FILE: /tmp/f1/bgp_vty.c:4243:
< +	int idx_peer = 2;
< +	return peer_af_flag_unset_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #4288: FILE: /tmp/f1/bgp_vty.c:4288:
< +	int idx_peer = 2;
< +	return peer_af_flag_unset_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #4308: FILE: /tmp/f1/bgp_vty.c:4308:
< +	int idx_peer = 1;
< +	return peer_af_flag_set_vty(vty, argv[idx_peer]->arg, bgp_node_afi(vty),
--
< WARNING: Missing a blank line after declarations
< #4323: FILE: /tmp/f1/bgp_vty.c:4323:
< +	int idx_peer = 2;
< +	return peer_af_flag_unset_vty(vty, argv[idx_peer]->arg,
--
< ERROR: that open brace { should be on the previous line
< #4422: FILE: /tmp/f1/bgp_vty.c:4422:
< +	if (!flags) // no flags means all of them!
< +	{
--
< WARNING: Missing a blank line after declarations
< #4484: FILE: /tmp/f1/bgp_vty.c:4484:
< +	int idx_peer = 1;
< +	return peer_ebgp_multihop_set_vty(vty, argv[idx_peer]->arg, NULL);
--
< WARNING: Missing a blank line after declarations
< #4497: FILE: /tmp/f1/bgp_vty.c:4497:
< +	int idx_number = 3;
< +	return peer_ebgp_multihop_set_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #4511: FILE: /tmp/f1/bgp_vty.c:4511:
< +	int idx_peer = 2;
< +	return peer_ebgp_multihop_unset_vty(vty, argv[idx_peer]->arg);
--
< WARNING: Missing a blank line after declarations
< #4525: FILE: /tmp/f1/bgp_vty.c:4525:
< +	int idx_peer = 1;
< +	return peer_flag_set_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #4539: FILE: /tmp/f1/bgp_vty.c:4539:
< +	int idx_peer = 2;
< +	return peer_flag_unset_vty(vty, argv[idx_peer]->arg,
--
< WARNING: unnecessary whitespace before a quoted newline
< #4614: FILE: /tmp/f1/bgp_vty.c:4614:
< +					"%% Invalid update-source, remove prefix length \n");
< 
< WARNING: else is not generally useful after a break or return
< #4616: FILE: /tmp/f1/bgp_vty.c:4616:
< +				return CMD_WARNING_CONFIG_FAILED;
< +			} else
< 
< WARNING: Missing a blank line after declarations
< #4640: FILE: /tmp/f1/bgp_vty.c:4640:
< +	int idx_peer_2 = 3;
< +	return peer_update_source_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #4654: FILE: /tmp/f1/bgp_vty.c:4654:
< +	int idx_peer = 2;
< +	return peer_update_source_vty(vty, argv[idx_peer]->arg, NULL);
--
< WARNING: Missing a blank line after declarations
< #4685: FILE: /tmp/f1/bgp_vty.c:4685:
< +	int idx_peer = 1;
< +	return peer_default_originate_set_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #4706: FILE: /tmp/f1/bgp_vty.c:4706:
< +	int idx_word = 4;
< +	return peer_default_originate_set_vty(
--
< WARNING: Missing a blank line after declarations
< #4731: FILE: /tmp/f1/bgp_vty.c:4731:
< +	int idx_peer = 2;
< +	return peer_default_originate_set_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #4780: FILE: /tmp/f1/bgp_vty.c:4780:
< +	int idx_number = 3;
< +	return peer_port_vty(vty, argv[idx_ip]->arg, AFI_IP,
--
< WARNING: Missing a blank line after declarations
< #4794: FILE: /tmp/f1/bgp_vty.c:4794:
< +	int idx_ip = 2;
< +	return peer_port_vty(vty, argv[idx_ip]->arg, AFI_IP, NULL);
--
< WARNING: Missing a blank line after declarations
< #4840: FILE: /tmp/f1/bgp_vty.c:4840:
< +	int idx_number = 3;
< +	return peer_weight_set_vty(vty, argv[idx_peer]->arg, bgp_node_afi(vty),
--
< WARNING: Missing a blank line after declarations
< #4860: FILE: /tmp/f1/bgp_vty.c:4860:
< +	int idx_peer = 2;
< +	return peer_weight_unset_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #4880: FILE: /tmp/f1/bgp_vty.c:4880:
< +	int idx_peer = 1;
< +	return peer_flag_set_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #4893: FILE: /tmp/f1/bgp_vty.c:4893:
< +	int idx_peer = 2;
< +	return peer_flag_unset_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #4905: FILE: /tmp/f1/bgp_vty.c:4905:
< +	int idx_ip = 1;
< +	return peer_flag_set_vty(vty, argv[idx_ip]->arg,
--
< WARNING: Missing a blank line after declarations
< #4918: FILE: /tmp/f1/bgp_vty.c:4918:
< +	int idx_ip = 2;
< +	return peer_flag_unset_vty(vty, argv[idx_ip]->arg,
--
< WARNING: Missing a blank line after declarations
< #4968: FILE: /tmp/f1/bgp_vty.c:4968:
< +	int idx_number_2 = 4;
< +	return peer_timers_set_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #4984: FILE: /tmp/f1/bgp_vty.c:4984:
< +	int idx_peer = 2;
< +	return peer_timers_unset_vty(vty, argv[idx_peer]->arg);
--
< WARNING: Missing a blank line after declarations
< #5031: FILE: /tmp/f1/bgp_vty.c:5031:
< +	int idx_number = 4;
< +	return peer_timers_connect_set_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #5046: FILE: /tmp/f1/bgp_vty.c:5046:
< +	int idx_peer = 2;
< +	return peer_timers_connect_unset_vty(vty, argv[idx_peer]->arg);
--
< WARNING: Missing a blank line after declarations
< #5082: FILE: /tmp/f1/bgp_vty.c:5082:
< +	int idx_number = 3;
< +	return peer_advertise_interval_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #5096: FILE: /tmp/f1/bgp_vty.c:5096:
< +	int idx_peer = 2;
< +	return peer_advertise_interval_vty(vty, argv[idx_peer]->arg, NULL, 0);
--
< WARNING: else is not generally useful after a break or return
< #5127: FILE: /tmp/f1/bgp_vty.c:5127:
< +		return CMD_SUCCESS;
< +	} else {
--
< WARNING: Missing a blank line after declarations
< #5179: FILE: /tmp/f1/bgp_vty.c:5179:
< +	int idx_word = 3;
< +	return peer_interface_vty(vty, argv[idx_ip]->arg, argv[idx_word]->arg);
--
< WARNING: Missing a blank line after declarations
< #5192: FILE: /tmp/f1/bgp_vty.c:5192:
< +	int idx_peer = 2;
< +	return peer_interface_vty(vty, argv[idx_peer]->arg, NULL);
--
< WARNING: Missing a blank line after declarations
< #5343: FILE: /tmp/f1/bgp_vty.c:5343:
< +	int idx_in_out = 4;
< +	return peer_prefix_list_set_vty(
--
< WARNING: Missing a blank line after declarations
< #5369: FILE: /tmp/f1/bgp_vty.c:5369:
< +	int idx_in_out = 5;
< +	return peer_prefix_list_unset_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #5440: FILE: /tmp/f1/bgp_vty.c:5440:
< +	int idx_in_out = 4;
< +	return peer_aslist_set_vty(vty, argv[idx_peer]->arg, bgp_node_afi(vty),
--
< WARNING: Missing a blank line after declarations
< #5466: FILE: /tmp/f1/bgp_vty.c:5466:
< +	int idx_in_out = 5;
< +	return peer_aslist_unset_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #5539: FILE: /tmp/f1/bgp_vty.c:5539:
< +	int idx_in_out = 4;
< +	return peer_route_map_set_vty(
--
< WARNING: Missing a blank line after declarations
< #5565: FILE: /tmp/f1/bgp_vty.c:5565:
< +	int idx_in_out = 5;
< +	return peer_route_map_unset_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #5621: FILE: /tmp/f1/bgp_vty.c:5621:
< +	int idx_word = 3;
< +	return peer_unsuppress_map_set_vty(
--
< WARNING: Missing a blank line after declarations
< #5642: FILE: /tmp/f1/bgp_vty.c:5642:
< +	int idx_peer = 2;
< +	return peer_unsuppress_map_unset_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Block comments use * on subsequent lines
< #5702: FILE: /tmp/f1/bgp_vty.c:5702:
< +/* Maximum number of prefix configuration.  prefix count is different
< +   for each peer configuration.  So this configuration can be set for
--
< WARNING: Block comments use a trailing */ on a separate line
< #5703: FILE: /tmp/f1/bgp_vty.c:5703:
< +   each peer configuration. */
< 
< WARNING: Missing a blank line after declarations
< #5714: FILE: /tmp/f1/bgp_vty.c:5714:
< +	int idx_number = 3;
< +	return peer_maximum_prefix_set_vty(
--
< WARNING: Missing a blank line after declarations
< #5737: FILE: /tmp/f1/bgp_vty.c:5737:
< +	int idx_number_2 = 4;
< +	return peer_maximum_prefix_set_vty(
--
< WARNING: Missing a blank line after declarations
< #5762: FILE: /tmp/f1/bgp_vty.c:5762:
< +	int idx_number = 3;
< +	return peer_maximum_prefix_set_vty(
--
< WARNING: Missing a blank line after declarations
< #5789: FILE: /tmp/f1/bgp_vty.c:5789:
< +	int idx_number_2 = 4;
< +	return peer_maximum_prefix_set_vty(
--
< WARNING: Missing a blank line after declarations
< #5817: FILE: /tmp/f1/bgp_vty.c:5817:
< +	int idx_number_2 = 5;
< +	return peer_maximum_prefix_set_vty(
--
< WARNING: Missing a blank line after declarations
< #5847: FILE: /tmp/f1/bgp_vty.c:5847:
< +	int idx_number_3 = 6;
< +	return peer_maximum_prefix_set_vty(
--
< WARNING: Missing a blank line after declarations
< #5878: FILE: /tmp/f1/bgp_vty.c:5878:
< +	int idx_peer = 2;
< +	return peer_maximum_prefix_unset_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #6059: FILE: /tmp/f1/bgp_vty.c:6059:
< +	int idx_peer = 2;
< +	return peer_af_flag_unset_vty(vty, argv[idx_peer]->arg,
--
< WARNING: Missing a blank line after declarations
< #6104: FILE: /tmp/f1/bgp_vty.c:6104:
< +	int idx_peer = 2;
< +	return peer_af_flag_unset_vty(vty, argv[idx_peer]->arg,
--
< WARNING: braces {} are not necessary for single statement blocks
< #6140: FILE: /tmp/f1/bgp_vty.c:6140:
< +	if (*list) {
< +		ecommunity_free(&*list);
--
< WARNING: suspect code indent for conditional statements (8, 12)
< #6182: FILE: /tmp/f1/bgp_vty.c:6182:
< +	if (argv_find(argv, argc, "no", &idx))
< +	    yes = 0;
--
< WARNING: suspect code indent for conditional statements (8, 12)
< #6249: FILE: /tmp/f1/bgp_vty.c:6249:
< +	if (argv_find(argv, argc, "no", &idx))
< +	    yes = 0;
--
< WARNING: suspect code indent for conditional statements (8, 12)
< #6305: FILE: /tmp/f1/bgp_vty.c:6305:
< +	if (argv_find(argv, argc, "no", &idx))
< +	    yes = 0;
--
< WARNING: suspect code indent for conditional statements (8, 12)
< #6390: FILE: /tmp/f1/bgp_vty.c:6390:
< +	if (argv_find(argv, argc, "no", &idx))
< +	    yes = 0;
--
< WARNING: braces {} are not necessary for single statement blocks
< #6407: FILE: /tmp/f1/bgp_vty.c:6407:
< +		if (ret != CMD_SUCCESS) {
< +			return ret;
--
< WARNING: suspect code indent for conditional statements (8, 12)
< #6473: FILE: /tmp/f1/bgp_vty.c:6473:
< +	if (argv_find(argv, argc, "no", &idx))
< +	    yes = 0;
--
< WARNING: suspect code indent for conditional statements (8, 12)
< #6541: FILE: /tmp/f1/bgp_vty.c:6541:
< +	if (argv_find(argv, argc, "no", &idx))
< +	    yes = 0;
--
< WARNING: Comparisons should place the constant on the right side of the test
< #6544: FILE: /tmp/f1/bgp_vty.c:6544:
< +	if (BGP_INSTANCE_TYPE_VRF != bgp->inst_type &&
< 
< WARNING: Comparisons should place the constant on the right side of the test
< #6545: FILE: /tmp/f1/bgp_vty.c:6545:
< +		BGP_INSTANCE_TYPE_DEFAULT != bgp->inst_type) {
< 
< WARNING: line over 80 characters
< #6547: FILE: /tmp/f1/bgp_vty.c:6547:
< +		vty_out(vty, "%% import|export vpn valid only for bgp vrf or default instance\n");
< 
< WARNING: Comparisons should place the constant on the right side of the test
< #6553: FILE: /tmp/f1/bgp_vty.c:6553:
< +	if ((SAFI_UNICAST != safi) || ((AFI_IP != afi) && (AFI_IP6 != afi))) {
< 
< WARNING: line over 80 characters
< #6554: FILE: /tmp/f1/bgp_vty.c:6554:
< +		vty_out(vty, "%% import|export vpn valid only for unicast ipv4|ipv6\n");
< 
< WARNING: Missing a blank line after declarations
< #6599: FILE: /tmp/f1/bgp_vty.c:6599:
< +		safi_t safi = bgp_vty_safi_from_str(argv[2]->text);
< +		if (bgp->inst_type != BGP_INSTANCE_TYPE_DEFAULT
--
< WARNING: Missing a blank line after declarations
< #6623: FILE: /tmp/f1/bgp_vty.c:6623:
< +		safi_t safi = bgp_vty_safi_from_str(argv[2]->text);
< +		if (bgp->inst_type != BGP_INSTANCE_TYPE_DEFAULT
--
< ERROR: do not use assignment in if condition
< #6731: FILE: /tmp/f1/bgp_vty.c:6731:
< +			if ((table = rn->info) != NULL) {
< 
< ERROR: do not use assignment in if condition
< #6732: FILE: /tmp/f1/bgp_vty.c:6732:
< +				if ((rm = bgp_node_match(table, &match))
< 
< ERROR: do not use assignment in if condition
< #6745: FILE: /tmp/f1/bgp_vty.c:6745:
< +		if ((rn = bgp_node_match(rib, &match)) != NULL) {
< 
< ERROR: do not use assignment in if condition
< #7147: FILE: /tmp/f1/bgp_vty.c:7147:
< +	if ((count = mtype_stats_alloc(MTYPE_BGP_ROUTE_EXTRA)))
< 
< ERROR: do not use assignment in if condition
< #7153: FILE: /tmp/f1/bgp_vty.c:7153:
< +	if ((count = mtype_stats_alloc(MTYPE_BGP_STATIC)))
< 
< ERROR: do not use assignment in if condition
< #7158: FILE: /tmp/f1/bgp_vty.c:7158:
< +	if ((count = mtype_stats_alloc(MTYPE_BGP_PACKET)))
< 
< ERROR: do not use assignment in if condition
< #7164: FILE: /tmp/f1/bgp_vty.c:7164:
< +	if ((count = mtype_stats_alloc(MTYPE_BGP_ADJ_IN)))
< 
< ERROR: do not use assignment in if condition
< #7168: FILE: /tmp/f1/bgp_vty.c:7168:
< +	if ((count = mtype_stats_alloc(MTYPE_BGP_ADJ_OUT)))
< 
< ERROR: do not use assignment in if condition
< #7173: FILE: /tmp/f1/bgp_vty.c:7173:
< +	if ((count = mtype_stats_alloc(MTYPE_BGP_NEXTHOP_CACHE)))
< 
< ERROR: do not use assignment in if condition
< #7179: FILE: /tmp/f1/bgp_vty.c:7179:
< +	if ((count = mtype_stats_alloc(MTYPE_BGP_DAMP_INFO)))
< 
< ERROR: do not use assignment in if condition
< #7191: FILE: /tmp/f1/bgp_vty.c:7191:
< +	if ((count = attr_unknown_count()))
< 
< ERROR: do not use assignment in if condition
< #7206: FILE: /tmp/f1/bgp_vty.c:7206:
< +	if ((count = community_count()))
< 
< ERROR: do not use assignment in if condition
< #7210: FILE: /tmp/f1/bgp_vty.c:7210:
< +	if ((count = mtype_stats_alloc(MTYPE_ECOMMUNITY)))
< 
< ERROR: do not use assignment in if condition
< #7214: FILE: /tmp/f1/bgp_vty.c:7214:
< +	if ((count = mtype_stats_alloc(MTYPE_LCOMMUNITY)))
< 
< ERROR: do not use assignment in if condition
< #7220: FILE: /tmp/f1/bgp_vty.c:7220:
< +	if ((count = mtype_stats_alloc(MTYPE_CLUSTER)))
< 
< ERROR: do not use assignment in if condition
< #7231: FILE: /tmp/f1/bgp_vty.c:7231:
< +	if ((count = mtype_stats_alloc(MTYPE_PEER_GROUP)))
< 
< ERROR: do not use assignment in if condition
< #7237: FILE: /tmp/f1/bgp_vty.c:7237:
< +	if ((count = mtype_stats_alloc(MTYPE_HASH)))
< 
< ERROR: do not use assignment in if condition
< #7241: FILE: /tmp/f1/bgp_vty.c:7241:
< +	if ((count = mtype_stats_alloc(MTYPE_HASH_BACKET)))
< 
< ERROR: do not use assignment in if condition
< #7245: FILE: /tmp/f1/bgp_vty.c:7245:
< +	if ((count = mtype_stats_alloc(MTYPE_BGP_REGEXP)))
< 
< WARNING: line over 80 characters
< #7412: FILE: /tmp/f1/bgp_vty.c:7412:
< +							bgp->update_delay_begin_time);
< 
< WARNING: Too many leading tabs - consider code refactoring
< #7417: FILE: /tmp/f1/bgp_vty.c:7417:
< +						if (bgp->update_delay_over) {
< 
< WARNING: line over 80 characters
< #7421: FILE: /tmp/f1/bgp_vty.c:7421:
< +								bgp->update_delay_begin_time);
< 
< WARNING: line over 80 characters
< #7425: FILE: /tmp/f1/bgp_vty.c:7425:
< +								bgp->update_delay_end_time);
< 
< WARNING: line over 80 characters
< #7429: FILE: /tmp/f1/bgp_vty.c:7429:
< +								bgp->update_delay_zebra_resume_time);
< 
< WARNING: line over 80 characters
< #7433: FILE: /tmp/f1/bgp_vty.c:7433:
< +								bgp->update_delay_peers_resume_time);
< 
< WARNING: line over 80 characters
< #7449: FILE: /tmp/f1/bgp_vty.c:7449:
< +							bgp->update_delay_begin_time);
< 
< WARNING: Too many leading tabs - consider code refactoring
< #7453: FILE: /tmp/f1/bgp_vty.c:7453:
< +						if (bgp->update_delay_over) {
< 
< WARNING: line over 80 characters
< #7456: FILE: /tmp/f1/bgp_vty.c:7456:
< +								bgp->update_delay_begin_time);
< 
< WARNING: line over 80 characters
< #7459: FILE: /tmp/f1/bgp_vty.c:7459:
< +								bgp->update_delay_end_time);
< 
< WARNING: line over 80 characters
< #7462: FILE: /tmp/f1/bgp_vty.c:7462:
< +								bgp->update_delay_zebra_resume_time);
< 
< WARNING: line over 80 characters
< #7465: FILE: /tmp/f1/bgp_vty.c:7465:
< +								bgp->update_delay_peers_resume_time);
< 
< ERROR: do not use assignment in if condition
< #7495: FILE: /tmp/f1/bgp_vty.c:7495:
< +				if ((ents = listcount(bgp->group))) {
< 
< ERROR: do not use assignment in if condition
< #7537: FILE: /tmp/f1/bgp_vty.c:7537:
< +				if ((ents = listcount(bgp->group)))
< 
< WARNING: line over 80 characters
< #7545: FILE: /tmp/f1/bgp_vty.c:7545:
< +								      peer_group)));
< 
< WARNING: Block comments use a trailing */ on a separate line
< #7553: FILE: /tmp/f1/bgp_vty.c:7553:
< +				 * 8 characters */
< 
< WARNING: Too many leading tabs - consider code refactoring
< #7734: FILE: /tmp/f1/bgp_vty.c:7734:
< +						if (!is_first)
< 
< WARNING: Too many leading tabs - consider code refactoring
< #7736: FILE: /tmp/f1/bgp_vty.c:7736:
< +						else
< 
< WARNING: else is not generally useful after a break or return
< #7813: FILE: /tmp/f1/bgp_vty.c:7813:
< +			return CMD_SUCCESS;
< +		} else {
--
< WARNING: braces {} are not necessary for single statement blocks
< #7866: FILE: /tmp/f1/bgp_vty.c:7866:
< +	if (argv_find_and_parse_afi(argv, argc, &idx, &afi)) {
< +		argv_find_and_parse_safi(argv, argc, &idx, &safi);
--
< WARNING: line over 80 characters
< #8722: FILE: /tmp/f1/bgp_vty.c:8722:
< +				range = peer_group_lookup_dynamic_neighbor_range(
< 
< WARNING: line over 80 characters
< #8741: FILE: /tmp/f1/bgp_vty.c:8741:
< +				range = peer_group_lookup_dynamic_neighbor_range(
< 
< WARNING: Missing a blank line after declarations
< #8986: FILE: /tmp/f1/bgp_vty.c:8986:
< +						json_object *json_sub = NULL;
< +						json_sub =
--
< WARNING: line over 80 characters
< #8987: FILE: /tmp/f1/bgp_vty.c:8987:
< +							json_object_new_object();
< 
< WARNING: Too many leading tabs - consider code refactoring
< #8991: FILE: /tmp/f1/bgp_vty.c:8991:
< +						if (CHECK_FLAG(
< 
< WARNING: line over 80 characters
< #8994: FILE: /tmp/f1/bgp_vty.c:8994:
< +							    PEER_CAP_ADDPATH_AF_TX_ADV)
< 
< WARNING: line over 80 characters
< #8998: FILE: /tmp/f1/bgp_vty.c:8998:
< +							       PEER_CAP_ADDPATH_AF_TX_RCV)) {
< 
< WARNING: Too many leading tabs - consider code refactoring
< #8999: FILE: /tmp/f1/bgp_vty.c:8999:
< +							if (CHECK_FLAG(
< 
< WARNING: line over 80 characters
< #9001: FILE: /tmp/f1/bgp_vty.c:9001:
< +									    [afi]
< 
< WARNING: line over 80 characters
< #9002: FILE: /tmp/f1/bgp_vty.c:9002:
< +									    [safi],
< 
< WARNING: line over 80 characters
< #9003: FILE: /tmp/f1/bgp_vty.c:9003:
< +								    PEER_CAP_ADDPATH_AF_TX_ADV)
< 
< WARNING: line over 80 characters
< #9006: FILE: /tmp/f1/bgp_vty.c:9006:
< +									       [afi]
< 
< WARNING: line over 80 characters
< #9007: FILE: /tmp/f1/bgp_vty.c:9007:
< +									       [safi],
< 
< WARNING: line over 80 characters
< #9008: FILE: /tmp/f1/bgp_vty.c:9008:
< +								       PEER_CAP_ADDPATH_AF_TX_RCV))
< 
< WARNING: line over 80 characters
< #9009: FILE: /tmp/f1/bgp_vty.c:9009:
< +								json_object_boolean_true_add(
< 
< WARNING: line over 80 characters
< #9010: FILE: /tmp/f1/bgp_vty.c:9010:
< +									json_sub,
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9012: FILE: /tmp/f1/bgp_vty.c:9012:
< +							else if (
< 
< WARNING: line over 80 characters
< #9014: FILE: /tmp/f1/bgp_vty.c:9014:
< +									p->af_cap
< 
< WARNING: line over 80 characters
< #9015: FILE: /tmp/f1/bgp_vty.c:9015:
< +										[afi]
< 
< WARNING: line over 80 characters
< #9016: FILE: /tmp/f1/bgp_vty.c:9016:
< +										[safi],
< 
< WARNING: line over 80 characters
< #9017: FILE: /tmp/f1/bgp_vty.c:9017:
< +									PEER_CAP_ADDPATH_AF_TX_ADV))
< 
< WARNING: line over 80 characters
< #9018: FILE: /tmp/f1/bgp_vty.c:9018:
< +								json_object_boolean_true_add(
< 
< WARNING: line over 80 characters
< #9019: FILE: /tmp/f1/bgp_vty.c:9019:
< +									json_sub,
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9021: FILE: /tmp/f1/bgp_vty.c:9021:
< +							else if (
< 
< WARNING: line over 80 characters
< #9023: FILE: /tmp/f1/bgp_vty.c:9023:
< +									p->af_cap
< 
< WARNING: line over 80 characters
< #9024: FILE: /tmp/f1/bgp_vty.c:9024:
< +										[afi]
< 
< WARNING: line over 80 characters
< #9025: FILE: /tmp/f1/bgp_vty.c:9025:
< +										[safi],
< 
< WARNING: line over 80 characters
< #9026: FILE: /tmp/f1/bgp_vty.c:9026:
< +									PEER_CAP_ADDPATH_AF_TX_RCV))
< 
< WARNING: line over 80 characters
< #9027: FILE: /tmp/f1/bgp_vty.c:9027:
< +								json_object_boolean_true_add(
< 
< WARNING: line over 80 characters
< #9028: FILE: /tmp/f1/bgp_vty.c:9028:
< +									json_sub,
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9032: FILE: /tmp/f1/bgp_vty.c:9032:
< +						if (CHECK_FLAG(
< 
< WARNING: line over 80 characters
< #9035: FILE: /tmp/f1/bgp_vty.c:9035:
< +							    PEER_CAP_ADDPATH_AF_RX_ADV)
< 
< WARNING: line over 80 characters
< #9039: FILE: /tmp/f1/bgp_vty.c:9039:
< +							       PEER_CAP_ADDPATH_AF_RX_RCV)) {
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9040: FILE: /tmp/f1/bgp_vty.c:9040:
< +							if (CHECK_FLAG(
< 
< WARNING: line over 80 characters
< #9042: FILE: /tmp/f1/bgp_vty.c:9042:
< +									    [afi]
< 
< WARNING: line over 80 characters
< #9043: FILE: /tmp/f1/bgp_vty.c:9043:
< +									    [safi],
< 
< WARNING: line over 80 characters
< #9044: FILE: /tmp/f1/bgp_vty.c:9044:
< +								    PEER_CAP_ADDPATH_AF_RX_ADV)
< 
< WARNING: line over 80 characters
< #9047: FILE: /tmp/f1/bgp_vty.c:9047:
< +									       [afi]
< 
< WARNING: line over 80 characters
< #9048: FILE: /tmp/f1/bgp_vty.c:9048:
< +									       [safi],
< 
< WARNING: line over 80 characters
< #9049: FILE: /tmp/f1/bgp_vty.c:9049:
< +								       PEER_CAP_ADDPATH_AF_RX_RCV))
< 
< WARNING: line over 80 characters
< #9050: FILE: /tmp/f1/bgp_vty.c:9050:
< +								json_object_boolean_true_add(
< 
< WARNING: line over 80 characters
< #9051: FILE: /tmp/f1/bgp_vty.c:9051:
< +									json_sub,
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9053: FILE: /tmp/f1/bgp_vty.c:9053:
< +							else if (
< 
< WARNING: line over 80 characters
< #9055: FILE: /tmp/f1/bgp_vty.c:9055:
< +									p->af_cap
< 
< WARNING: line over 80 characters
< #9056: FILE: /tmp/f1/bgp_vty.c:9056:
< +										[afi]
< 
< WARNING: line over 80 characters
< #9057: FILE: /tmp/f1/bgp_vty.c:9057:
< +										[safi],
< 
< WARNING: line over 80 characters
< #9058: FILE: /tmp/f1/bgp_vty.c:9058:
< +									PEER_CAP_ADDPATH_AF_RX_ADV))
< 
< WARNING: line over 80 characters
< #9059: FILE: /tmp/f1/bgp_vty.c:9059:
< +								json_object_boolean_true_add(
< 
< WARNING: line over 80 characters
< #9060: FILE: /tmp/f1/bgp_vty.c:9060:
< +									json_sub,
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9062: FILE: /tmp/f1/bgp_vty.c:9062:
< +							else if (
< 
< WARNING: line over 80 characters
< #9064: FILE: /tmp/f1/bgp_vty.c:9064:
< +									p->af_cap
< 
< WARNING: line over 80 characters
< #9065: FILE: /tmp/f1/bgp_vty.c:9065:
< +										[afi]
< 
< WARNING: line over 80 characters
< #9066: FILE: /tmp/f1/bgp_vty.c:9066:
< +										[safi],
< 
< WARNING: line over 80 characters
< #9067: FILE: /tmp/f1/bgp_vty.c:9067:
< +									PEER_CAP_ADDPATH_AF_RX_RCV))
< 
< WARNING: line over 80 characters
< #9068: FILE: /tmp/f1/bgp_vty.c:9068:
< +								json_object_boolean_true_add(
< 
< WARNING: line over 80 characters
< #9069: FILE: /tmp/f1/bgp_vty.c:9069:
< +									json_sub,
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9073: FILE: /tmp/f1/bgp_vty.c:9073:
< +						if (CHECK_FLAG(
< 
< WARNING: line over 80 characters
< #9076: FILE: /tmp/f1/bgp_vty.c:9076:
< +							    PEER_CAP_ADDPATH_AF_TX_ADV)
< 
< WARNING: line over 80 characters
< #9080: FILE: /tmp/f1/bgp_vty.c:9080:
< +							       PEER_CAP_ADDPATH_AF_TX_RCV)
< 
< WARNING: line over 80 characters
< #9084: FILE: /tmp/f1/bgp_vty.c:9084:
< +							       PEER_CAP_ADDPATH_AF_RX_ADV)
< 
< WARNING: line over 80 characters
< #9088: FILE: /tmp/f1/bgp_vty.c:9088:
< +							       PEER_CAP_ADDPATH_AF_RX_RCV))
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9093: FILE: /tmp/f1/bgp_vty.c:9093:
< +						else
< 
< WARNING: line over 80 characters
< #9158: FILE: /tmp/f1/bgp_vty.c:9158:
< +							json_object_new_object();
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9160: FILE: /tmp/f1/bgp_vty.c:9160:
< +						for (safi = SAFI_UNICAST;
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9162: FILE: /tmp/f1/bgp_vty.c:9162:
< +							if (CHECK_FLAG(
< 
< WARNING: line over 80 characters
< #9164: FILE: /tmp/f1/bgp_vty.c:9164:
< +									    [AFI_IP]
< 
< WARNING: line over 80 characters
< #9165: FILE: /tmp/f1/bgp_vty.c:9165:
< +									    [safi],
< 
< WARNING: line over 80 characters
< #9166: FILE: /tmp/f1/bgp_vty.c:9166:
< +								    PEER_CAP_ENHE_AF_RCV)) {
< 
< WARNING: line over 80 characters
< #9167: FILE: /tmp/f1/bgp_vty.c:9167:
< +								print_store = afi_safi_print(
< 
< WARNING: line over 80 characters
< #9170: FILE: /tmp/f1/bgp_vty.c:9170:
< +								json_object_string_add(
< 
< WARNING: line over 80 characters
< #9171: FILE: /tmp/f1/bgp_vty.c:9171:
< +									json_nxt,
< 
< WARNING: line over 80 characters
< #9172: FILE: /tmp/f1/bgp_vty.c:9172:
< +									print_store,
< 
< WARNING: line over 80 characters
< #9193: FILE: /tmp/f1/bgp_vty.c:9193:
< +							PEER_CAP_REFRESH_NEW_RCV)
< 
< WARNING: line over 80 characters
< #9196: FILE: /tmp/f1/bgp_vty.c:9196:
< +							   PEER_CAP_REFRESH_OLD_RCV))) {
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9197: FILE: /tmp/f1/bgp_vty.c:9197:
< +						if (CHECK_FLAG(
< 
< WARNING: line over 80 characters
< #9199: FILE: /tmp/f1/bgp_vty.c:9199:
< +							    PEER_CAP_REFRESH_OLD_RCV)
< 
< WARNING: line over 80 characters
< #9202: FILE: /tmp/f1/bgp_vty.c:9202:
< +							       PEER_CAP_REFRESH_NEW_RCV))
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9207: FILE: /tmp/f1/bgp_vty.c:9207:
< +						else {
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9208: FILE: /tmp/f1/bgp_vty.c:9208:
< +							if (CHECK_FLAG(
< 
< WARNING: line over 80 characters
< #9210: FILE: /tmp/f1/bgp_vty.c:9210:
< +								    PEER_CAP_REFRESH_OLD_RCV))
< 
< WARNING: line over 80 characters
< #9211: FILE: /tmp/f1/bgp_vty.c:9211:
< +								json_object_string_add(
< 
< WARNING: line over 80 characters
< #9212: FILE: /tmp/f1/bgp_vty.c:9212:
< +									json_cap,
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9215: FILE: /tmp/f1/bgp_vty.c:9215:
< +							else
< 
< WARNING: line over 80 characters
< #9216: FILE: /tmp/f1/bgp_vty.c:9216:
< +								json_object_string_add(
< 
< WARNING: line over 80 characters
< #9217: FILE: /tmp/f1/bgp_vty.c:9217:
< +									json_cap,
< 
< WARNING: line over 80 characters
< #9232: FILE: /tmp/f1/bgp_vty.c:9232:
< +							PEER_CAP_REFRESH_NEW_RCV)
< 
< WARNING: line over 80 characters
< #9235: FILE: /tmp/f1/bgp_vty.c:9235:
< +							   PEER_CAP_REFRESH_OLD_RCV))
< 
< WARNING: Missing a blank line after declarations
< #9244: FILE: /tmp/f1/bgp_vty.c:9244:
< +				json_object *json_multi = NULL;
< +				json_multi = json_object_new_object();
--
< WARNING: Missing a blank line after declarations
< #9250: FILE: /tmp/f1/bgp_vty.c:9250:
< +						json_object *json_exten = NULL;
< +						json_exten =
--
< WARNING: line over 80 characters
< #9251: FILE: /tmp/f1/bgp_vty.c:9251:
< +							json_object_new_object();
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9253: FILE: /tmp/f1/bgp_vty.c:9253:
< +						if (p->afc_adv[afi][safi]
< 
< WARNING: line over 80 characters
< #9255: FILE: /tmp/f1/bgp_vty.c:9255:
< +							json_object_boolean_true_add(
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9258: FILE: /tmp/f1/bgp_vty.c:9258:
< +						else if (p->afc_adv[afi][safi])
< 
< WARNING: line over 80 characters
< #9259: FILE: /tmp/f1/bgp_vty.c:9259:
< +							json_object_boolean_true_add(
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9262: FILE: /tmp/f1/bgp_vty.c:9262:
< +						else if (p->afc_recv[afi][safi])
< 
< WARNING: line over 80 characters
< #9263: FILE: /tmp/f1/bgp_vty.c:9263:
< +							json_object_boolean_true_add(
< 
< WARNING: line over 80 characters
< #9346: FILE: /tmp/f1/bgp_vty.c:9346:
< +							json_object_new_object();
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9354: FILE: /tmp/f1/bgp_vty.c:9354:
< +							if (CHECK_FLAG(
< 
< WARNING: line over 80 characters
< #9356: FILE: /tmp/f1/bgp_vty.c:9356:
< +									    [afi]
< 
< WARNING: line over 80 characters
< #9357: FILE: /tmp/f1/bgp_vty.c:9357:
< +									    [safi],
< 
< WARNING: line over 80 characters
< #9358: FILE: /tmp/f1/bgp_vty.c:9358:
< +								    PEER_CAP_RESTART_AF_RCV)) {
< 
< WARNING: line over 80 characters
< #9360: FILE: /tmp/f1/bgp_vty.c:9360:
< +									json_sub =
< 
< WARNING: line over 80 characters
< #9361: FILE: /tmp/f1/bgp_vty.c:9361:
< +										NULL;
< 
< WARNING: line over 80 characters
< #9363: FILE: /tmp/f1/bgp_vty.c:9363:
< +									json_object_new_object();
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9365: FILE: /tmp/f1/bgp_vty.c:9365:
< +								if (CHECK_FLAG(
< 
< WARNING: line over 80 characters
< #9366: FILE: /tmp/f1/bgp_vty.c:9366:
< +									    p->af_cap
< 
< WARNING: line over 80 characters
< #9367: FILE: /tmp/f1/bgp_vty.c:9367:
< +										    [afi]
< 
< WARNING: line over 80 characters
< #9368: FILE: /tmp/f1/bgp_vty.c:9368:
< +										    [safi],
< 
< WARNING: line over 80 characters
< #9369: FILE: /tmp/f1/bgp_vty.c:9369:
< +									    PEER_CAP_RESTART_AF_PRESERVE_RCV))
< 
< WARNING: line over 80 characters
< #9370: FILE: /tmp/f1/bgp_vty.c:9370:
< +									json_object_boolean_true_add(
< 
< WARNING: line over 80 characters
< #9371: FILE: /tmp/f1/bgp_vty.c:9371:
< +										json_sub,
< 
< WARNING: line over 80 characters
< #9373: FILE: /tmp/f1/bgp_vty.c:9373:
< +								restart_af_count++;
< 
< WARNING: line over 80 characters
< #9374: FILE: /tmp/f1/bgp_vty.c:9374:
< +								json_object_object_add(
< 
< WARNING: line over 80 characters
< #9375: FILE: /tmp/f1/bgp_vty.c:9375:
< +									json_restart,
< 
< WARNING: line over 80 characters
< #9376: FILE: /tmp/f1/bgp_vty.c:9376:
< +									afi_safi_print(
< 
< WARNING: line over 80 characters
< #9377: FILE: /tmp/f1/bgp_vty.c:9377:
< +										afi,
< 
< WARNING: line over 80 characters
< #9378: FILE: /tmp/f1/bgp_vty.c:9378:
< +										safi),
< 
< WARNING: line over 80 characters
< #9379: FILE: /tmp/f1/bgp_vty.c:9379:
< +									json_sub);
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9382: FILE: /tmp/f1/bgp_vty.c:9382:
< +						if (!restart_af_count) {
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9389: FILE: /tmp/f1/bgp_vty.c:9389:
< +						} else
< 
< WARNING: line over 80 characters
< #9414: FILE: /tmp/f1/bgp_vty.c:9414:
< +								PEER_CAP_AS4_ADV)
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9427: FILE: /tmp/f1/bgp_vty.c:9427:
< +						if (CHECK_FLAG(
< 
< WARNING: line over 80 characters
< #9430: FILE: /tmp/f1/bgp_vty.c:9430:
< +							    PEER_CAP_ADDPATH_AF_TX_ADV)
< 
< WARNING: line over 80 characters
< #9434: FILE: /tmp/f1/bgp_vty.c:9434:
< +							       PEER_CAP_ADDPATH_AF_TX_RCV)) {
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9441: FILE: /tmp/f1/bgp_vty.c:9441:
< +							if (CHECK_FLAG(
< 
< WARNING: line over 80 characters
< #9443: FILE: /tmp/f1/bgp_vty.c:9443:
< +									    [afi]
< 
< WARNING: line over 80 characters
< #9444: FILE: /tmp/f1/bgp_vty.c:9444:
< +									    [safi],
< 
< WARNING: line over 80 characters
< #9445: FILE: /tmp/f1/bgp_vty.c:9445:
< +								    PEER_CAP_ADDPATH_AF_TX_ADV))
< 
< WARNING: line over 80 characters
< #9448: FILE: /tmp/f1/bgp_vty.c:9448:
< +									afi_safi_print(
< 
< WARNING: line over 80 characters
< #9449: FILE: /tmp/f1/bgp_vty.c:9449:
< +										afi,
< 
< WARNING: line over 80 characters
< #9450: FILE: /tmp/f1/bgp_vty.c:9450:
< +										safi));
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9452: FILE: /tmp/f1/bgp_vty.c:9452:
< +							if (CHECK_FLAG(
< 
< WARNING: line over 80 characters
< #9454: FILE: /tmp/f1/bgp_vty.c:9454:
< +									    [afi]
< 
< WARNING: line over 80 characters
< #9455: FILE: /tmp/f1/bgp_vty.c:9455:
< +									    [safi],
< 
< WARNING: line over 80 characters
< #9456: FILE: /tmp/f1/bgp_vty.c:9456:
< +								    PEER_CAP_ADDPATH_AF_TX_RCV))
< 
< WARNING: line over 80 characters
< #9459: FILE: /tmp/f1/bgp_vty.c:9459:
< +									CHECK_FLAG(
< 
< WARNING: line over 80 characters
< #9460: FILE: /tmp/f1/bgp_vty.c:9460:
< +										p->af_cap
< 
< WARNING: line over 80 characters
< #9461: FILE: /tmp/f1/bgp_vty.c:9461:
< +											[afi]
< 
< WARNING: line over 80 characters
< #9462: FILE: /tmp/f1/bgp_vty.c:9462:
< +											[safi],
< 
< WARNING: line over 80 characters
< #9463: FILE: /tmp/f1/bgp_vty.c:9463:
< +										PEER_CAP_ADDPATH_AF_TX_ADV)
< 
< WARNING: line over 80 characters
< #9464: FILE: /tmp/f1/bgp_vty.c:9464:
< +										? " and "
< 
< WARNING: line over 80 characters
< #9465: FILE: /tmp/f1/bgp_vty.c:9465:
< +										: "");
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9470: FILE: /tmp/f1/bgp_vty.c:9470:
< +						if (CHECK_FLAG(
< 
< WARNING: line over 80 characters
< #9473: FILE: /tmp/f1/bgp_vty.c:9473:
< +							    PEER_CAP_ADDPATH_AF_RX_ADV)
< 
< WARNING: line over 80 characters
< #9477: FILE: /tmp/f1/bgp_vty.c:9477:
< +							       PEER_CAP_ADDPATH_AF_RX_RCV)) {
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9484: FILE: /tmp/f1/bgp_vty.c:9484:
< +							if (CHECK_FLAG(
< 
< WARNING: line over 80 characters
< #9486: FILE: /tmp/f1/bgp_vty.c:9486:
< +									    [afi]
< 
< WARNING: line over 80 characters
< #9487: FILE: /tmp/f1/bgp_vty.c:9487:
< +									    [safi],
< 
< WARNING: line over 80 characters
< #9488: FILE: /tmp/f1/bgp_vty.c:9488:
< +								    PEER_CAP_ADDPATH_AF_RX_ADV))
< 
< WARNING: line over 80 characters
< #9491: FILE: /tmp/f1/bgp_vty.c:9491:
< +									afi_safi_print(
< 
< WARNING: line over 80 characters
< #9492: FILE: /tmp/f1/bgp_vty.c:9492:
< +										afi,
< 
< WARNING: line over 80 characters
< #9493: FILE: /tmp/f1/bgp_vty.c:9493:
< +										safi));
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9495: FILE: /tmp/f1/bgp_vty.c:9495:
< +							if (CHECK_FLAG(
< 
< WARNING: line over 80 characters
< #9497: FILE: /tmp/f1/bgp_vty.c:9497:
< +									    [afi]
< 
< WARNING: line over 80 characters
< #9498: FILE: /tmp/f1/bgp_vty.c:9498:
< +									    [safi],
< 
< WARNING: line over 80 characters
< #9499: FILE: /tmp/f1/bgp_vty.c:9499:
< +								    PEER_CAP_ADDPATH_AF_RX_RCV))
< 
< WARNING: line over 80 characters
< #9502: FILE: /tmp/f1/bgp_vty.c:9502:
< +									CHECK_FLAG(
< 
< WARNING: line over 80 characters
< #9503: FILE: /tmp/f1/bgp_vty.c:9503:
< +										p->af_cap
< 
< WARNING: line over 80 characters
< #9504: FILE: /tmp/f1/bgp_vty.c:9504:
< +											[afi]
< 
< WARNING: line over 80 characters
< #9505: FILE: /tmp/f1/bgp_vty.c:9505:
< +											[safi],
< 
< WARNING: line over 80 characters
< #9506: FILE: /tmp/f1/bgp_vty.c:9506:
< +										PEER_CAP_ADDPATH_AF_RX_ADV)
< 
< WARNING: line over 80 characters
< #9507: FILE: /tmp/f1/bgp_vty.c:9507:
< +										? " and "
< 
< WARNING: line over 80 characters
< #9508: FILE: /tmp/f1/bgp_vty.c:9508:
< +										: "");
< 
< WARNING: line over 80 characters
< #9528: FILE: /tmp/f1/bgp_vty.c:9528:
< +								PEER_CAP_DYNAMIC_ADV)
< 
< WARNING: line over 80 characters
< #9546: FILE: /tmp/f1/bgp_vty.c:9546:
< +								PEER_CAP_ENHE_ADV)
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9555: FILE: /tmp/f1/bgp_vty.c:9555:
< +						for (safi = SAFI_UNICAST;
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9557: FILE: /tmp/f1/bgp_vty.c:9557:
< +							if (CHECK_FLAG(
< 
< WARNING: line over 80 characters
< #9559: FILE: /tmp/f1/bgp_vty.c:9559:
< +									    [AFI_IP]
< 
< WARNING: line over 80 characters
< #9560: FILE: /tmp/f1/bgp_vty.c:9560:
< +									    [safi],
< 
< WARNING: line over 80 characters
< #9561: FILE: /tmp/f1/bgp_vty.c:9561:
< +								    PEER_CAP_ENHE_AF_RCV))
< 
< WARNING: line over 80 characters
< #9564: FILE: /tmp/f1/bgp_vty.c:9564:
< +									afi_safi_print(
< 
< WARNING: line over 80 characters
< #9565: FILE: /tmp/f1/bgp_vty.c:9565:
< +										AFI_IP,
< 
< WARNING: line over 80 characters
< #9566: FILE: /tmp/f1/bgp_vty.c:9566:
< +										safi));
< 
< WARNING: line over 80 characters
< #9584: FILE: /tmp/f1/bgp_vty.c:9584:
< +						       PEER_CAP_REFRESH_OLD_RCV))
< 
< WARNING: line over 80 characters
< #9588: FILE: /tmp/f1/bgp_vty.c:9588:
< +								PEER_CAP_REFRESH_ADV)
< 
< WARNING: line over 80 characters
< #9593: FILE: /tmp/f1/bgp_vty.c:9593:
< +								 PEER_CAP_REFRESH_OLD_RCV)
< 
< WARNING: line over 80 characters
< #9596: FILE: /tmp/f1/bgp_vty.c:9596:
< +								    PEER_CAP_REFRESH_NEW_RCV))
< 
< WARNING: line over 80 characters
< #9599: FILE: /tmp/f1/bgp_vty.c:9599:
< +									  p->cap,
< 
< WARNING: line over 80 characters
< #9600: FILE: /tmp/f1/bgp_vty.c:9600:
< +									  PEER_CAP_REFRESH_OLD_RCV)
< 
< WARNING: line over 80 characters
< #9601: FILE: /tmp/f1/bgp_vty.c:9601:
< +									  ? "old"
< 
< WARNING: line over 80 characters
< #9602: FILE: /tmp/f1/bgp_vty.c:9602:
< +									  : "new");
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9615: FILE: /tmp/f1/bgp_vty.c:9615:
< +						if (p->afc_adv[afi][safi])
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9618: FILE: /tmp/f1/bgp_vty.c:9618:
< +						if (p->afc_recv[afi][safi])
< 
< WARNING: line over 80 characters
< #9673: FILE: /tmp/f1/bgp_vty.c:9673:
< +								PEER_CAP_RESTART_ADV)
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9689: FILE: /tmp/f1/bgp_vty.c:9689:
< +							if (CHECK_FLAG(
< 
< WARNING: line over 80 characters
< #9691: FILE: /tmp/f1/bgp_vty.c:9691:
< +									    [afi]
< 
< WARNING: line over 80 characters
< #9692: FILE: /tmp/f1/bgp_vty.c:9692:
< +									    [safi],
< 
< WARNING: line over 80 characters
< #9693: FILE: /tmp/f1/bgp_vty.c:9693:
< +								    PEER_CAP_RESTART_AF_RCV)) {
< 
< WARNING: line over 80 characters
< #9696: FILE: /tmp/f1/bgp_vty.c:9696:
< +									restart_af_count
< 
< WARNING: line over 80 characters
< #9697: FILE: /tmp/f1/bgp_vty.c:9697:
< +										? ", "
< 
< WARNING: line over 80 characters
< #9698: FILE: /tmp/f1/bgp_vty.c:9698:
< +										: "",
< 
< WARNING: line over 80 characters
< #9699: FILE: /tmp/f1/bgp_vty.c:9699:
< +									afi_safi_print(
< 
< WARNING: line over 80 characters
< #9700: FILE: /tmp/f1/bgp_vty.c:9700:
< +										afi,
< 
< WARNING: line over 80 characters
< #9701: FILE: /tmp/f1/bgp_vty.c:9701:
< +										safi),
< 
< WARNING: line over 80 characters
< #9702: FILE: /tmp/f1/bgp_vty.c:9702:
< +									CHECK_FLAG(
< 
< WARNING: line over 80 characters
< #9703: FILE: /tmp/f1/bgp_vty.c:9703:
< +										p->af_cap
< 
< WARNING: line over 80 characters
< #9704: FILE: /tmp/f1/bgp_vty.c:9704:
< +											[afi]
< 
< WARNING: line over 80 characters
< #9705: FILE: /tmp/f1/bgp_vty.c:9705:
< +											[safi],
< 
< WARNING: line over 80 characters
< #9706: FILE: /tmp/f1/bgp_vty.c:9706:
< +										PEER_CAP_RESTART_AF_PRESERVE_RCV)
< 
< WARNING: line over 80 characters
< #9707: FILE: /tmp/f1/bgp_vty.c:9707:
< +										? "preserved"
< 
< WARNING: line over 80 characters
< #9708: FILE: /tmp/f1/bgp_vty.c:9708:
< +										: "not preserved");
< 
< WARNING: line over 80 characters
< #9709: FILE: /tmp/f1/bgp_vty.c:9709:
< +								restart_af_count++;
< 
< WARNING: Too many leading tabs - consider code refactoring
< #9711: FILE: /tmp/f1/bgp_vty.c:9711:
< +						if (!restart_af_count)
< 
< WARNING: Missing a blank line after declarations
< #9828: FILE: /tmp/f1/bgp_vty.c:9828:
< +		json_object *json_stat = NULL;
< +		json_stat = json_object_new_object();
--
< WARNING: line over 80 characters
< #10017: FILE: /tmp/f1/bgp_vty.c:10017:
< +						== BGP_NOTIFY_CEASE_ADMIN_SHUTDOWN
< 
< WARNING: line over 80 characters
< #10019: FILE: /tmp/f1/bgp_vty.c:10019:
< +						   == BGP_NOTIFY_CEASE_ADMIN_RESET)
< 
< WARNING: line over 80 characters
< #10053: FILE: /tmp/f1/bgp_vty.c:10053:
< +						== BGP_NOTIFY_CEASE_ADMIN_SHUTDOWN
< 
< WARNING: line over 80 characters
< #10055: FILE: /tmp/f1/bgp_vty.c:10055:
< +						   == BGP_NOTIFY_CEASE_ADMIN_RESET)
< 
< WARNING: Too many leading tabs - consider code refactoring
< #10083: FILE: /tmp/f1/bgp_vty.c:10083:
< +						if (i % 16 == 0) {
< 
< WARNING: braces {} are not necessary for any arm of this statement
< #10083: FILE: /tmp/f1/bgp_vty.c:10083:
< +						if (i % 16 == 0) {
< [...]
--
< WARNING: Too many leading tabs - consider code refactoring
< #10085: FILE: /tmp/f1/bgp_vty.c:10085:
< +						} else if (i % 4 == 0) {
< 
< ERROR: do not use assignment in if condition
< #10386: FILE: /tmp/f1/bgp_vty.c:10386:
< +			if (!(json = json_object_new_object())) {
< 
< WARNING: else is not generally useful after a break or return
< #10452: FILE: /tmp/f1/bgp_vty.c:10452:
< +			return CMD_SUCCESS;
< +		} else {
--
< WARNING: line over 80 characters
< #10462: FILE: /tmp/f1/bgp_vty.c:10462:
< +							JSON_C_TO_STRING_PRETTY));
< 
< WARNING: Block comments use * on subsequent lines
< #10536: FILE: /tmp/f1/bgp_vty.c:10536:
< +/* Show BGP's AS paths internal data.  There are both `show [ip] bgp
< +   paths' and `show ip mbgp paths'.  Those functions results are the
--
< WARNING: Block comments use a trailing */ on a separate line
< #10537: FILE: /tmp/f1/bgp_vty.c:10537:
< +   same.*/
< 
< WARNING: else is not generally useful after a break or return
< #10649: FILE: /tmp/f1/bgp_vty.c:10649:
< +			return CMD_SUCCESS;
< +		} else {
--
< WARNING: braces {} are not necessary for single statement blocks
< #10688: FILE: /tmp/f1/bgp_vty.c:10688:
< +	if (argv_find_and_parse_afi(argv, argc, &idx, &afi)) {
< +		argv_find_and_parse_safi(argv, argc, &idx, &safi);
--
< ERROR: return is not a function, parentheses are not required
< #10697: FILE: /tmp/f1/bgp_vty.c:10697:
< +	return (bgp_show_update_groups(vty, vrf, afi, safi, subgrp_id));
< 
< WARNING: Missing a blank line after declarations
< #10789: FILE: /tmp/f1/bgp_vty.c:10789:
< +	safi_t safiz;
< +	if (sgid)
--
< WARNING: unnecessary whitespace before a quoted newline
< #10893: FILE: /tmp/f1/bgp_vty.c:10893:
< +			vty_out(vty, "    %s %s %s \n", peer->host,
< 
< WARNING: Missing a blank line after declarations
< #10945: FILE: /tmp/f1/bgp_vty.c:10945:
< +	char *vrf, *pg;
< +	vrf = pg = NULL;
--
< WARNING: Missing a blank line after declarations
< #11628: FILE: /tmp/f1/bgp_vty.c:11628:
< +		char buf[RD_ADDRSTRLEN];
< +		vty_out(vty, "%*srd vpn export %s\n", indent, "",
--
< WARNING: Missing a blank line after declarations
< #11636: FILE: /tmp/f1/bgp_vty.c:11636:
< +		char buf[PREFIX_STRLEN];
< +		if (inet_ntop(bgp->vpn_policy[afi].tovpn_nexthop.family,
--
< WARNING: Block comments use a trailing */ on a separate line
< #11743: FILE: /tmp/f1/bgp_vty.c:11743:
< +			 * they'll otherwise show up multiple times */
< 
< ERROR: space required after that close brace '}'
< #11772: FILE: /tmp/f1/bgp_vty.c:11772:
< +	{.completions = NULL}};
< 
< WARNING: Missing a blank line after declarations
< #12971: FILE: /tmp/f1/bgp_vty.c:12971:
< +	int idx = 0;
< +	argv_find(argv, argc, "(1-99)", &idx);
--
< WARNING: Missing a blank line after declarations
< #13013: FILE: /tmp/f1/bgp_vty.c:13013:
< +	int idx = 0;
< +	argv_find(argv, argc, "(1-99)", &idx);
--
< WARNING: Missing a blank line after declarations
< #13052: FILE: /tmp/f1/bgp_vty.c:13052:
< +	int idx = 0;
< +	argv_find(argv, argc, "(100-500)", &idx);
--
< WARNING: Missing a blank line after declarations
< #13094: FILE: /tmp/f1/bgp_vty.c:13094:
< +	int idx = 0;
< +	argv_find(argv, argc, "(100-500)", &idx);
--
< WARNING: Block comments use * on subsequent lines
< #13232: FILE: /tmp/f1/bgp_vty.c:13232:
< +	/* Free temporary community list string allocated by
< +	   argv_concat().  */
--
< WARNING: Block comments use a trailing */ on a separate line
< #13232: FILE: /tmp/f1/bgp_vty.c:13232:
< +	   argv_concat().  */
< 
< WARNING: Block comments use * on subsequent lines
< #13278: FILE: /tmp/f1/bgp_vty.c:13278:
< +	/* Free temporary community list string allocated by
< +	   argv_concat().  */
--
< WARNING: Block comments use a trailing */ on a separate line
< #13278: FILE: /tmp/f1/bgp_vty.c:13278:
< +	   argv_concat().  */
< 
< WARNING: line over 80 characters
< #13476: FILE: /tmp/f1/bgp_vty.c:13476:
< +					entry->style == EXTCOMMUNITY_LIST_STANDARD
< 
< WARNING: line over 80 characters
< #13483: FILE: /tmp/f1/bgp_vty.c:13483:
< +					entry->style == EXTCOMMUNITY_LIST_STANDARD
< 
< WARNING: Missing a blank line after declarations
< #13568: FILE: /tmp/f1/bgp_vty.c:13568:
< +	int idx = 0;
< +	argv_find(argv, argc, "(1-99)", &idx);
--
< WARNING: Missing a blank line after declarations
< #13606: FILE: /tmp/f1/bgp_vty.c:13606:
< +	int idx = 0;
< +	argv_find(argv, argc, "(100-500)", &idx);
--
< WARNING: Missing a blank line after declarations
< #13647: FILE: /tmp/f1/bgp_vty.c:13647:
< +	int idx = 0;
< +	argv_find(argv, argc, "(1-99)", &idx);
--
< WARNING: Missing a blank line after declarations
< #13688: FILE: /tmp/f1/bgp_vty.c:13688:
< +	int idx = 0;
< +	argv_find(argv, argc, "(100-500)", &idx);
--
< WARNING: line over 80 characters
< #13717: FILE: /tmp/f1/bgp_vty.c:13717:
< +					entry->style == EXTCOMMUNITY_LIST_STANDARD
< 
< WARNING: line over 80 characters
< #13724: FILE: /tmp/f1/bgp_vty.c:13724:
< +					entry->style == EXTCOMMUNITY_LIST_STANDARD
< 

CLANG Static Analyzer Summary

  • Github Pull Request 1913, comparing to Git base SHA 911d8ac
  • Base image data for Git 911d8ac does not exist - compare skipped

19 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-2944/artifact/shared/static_analysis/index.html

@LabN-CI
Copy link
Copy Markdown
Collaborator

LabN-CI commented Mar 16, 2018

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/1913 22213f7
Date 03/16/2018
Start 15:34:45
Finish 15:58:12
Run-Time 23:27
Total 1816
Pass 1816
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2018-03-16-15:34:45.txt
Log autoscript-2018-03-16-15:35:36.log.bz2

For details, please contact louberger

@NetDEF-CI
Copy link
Copy Markdown
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-2945/

This is a comment from an EXPERIMENTAL automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.


Warnings Generated during build:

Checkout code: Successful with additional warnings:

<stdin>:105: trailing whitespace.
		if (vpn_leak_from_vpn_active(bgp, afi, NULL) && 
warning: 1 line adds whitespace errors.
Report for bgp_mplsvpn.c
===============================================
> #928: FILE: /tmp/f2/bgp_mplsvpn.c:928:
53c57
< #913: FILE: /tmp/f1/bgp_mplsvpn.c:913:
--
< ERROR: trailing whitespace
< #1147: FILE: /tmp/f1/bgp_mplsvpn.c:1147:
< +^I^Iif (vpn_leak_from_vpn_active(bgp, afi, NULL) && $
---
Report for bgp_vty.c
===============================================
< WARNING: suspect code indent for conditional statements (8, 12)
< #6182: FILE: /tmp/f1/bgp_vty.c:6182:
< +	if (argv_find(argv, argc, "no", &idx))
< +	    yes = 0;
--
< WARNING: suspect code indent for conditional statements (8, 12)
< #6249: FILE: /tmp/f1/bgp_vty.c:6249:
< +	if (argv_find(argv, argc, "no", &idx))
< +	    yes = 0;
--
< WARNING: suspect code indent for conditional statements (8, 12)
< #6305: FILE: /tmp/f1/bgp_vty.c:6305:
< +	if (argv_find(argv, argc, "no", &idx))
< +	    yes = 0;
--
< WARNING: suspect code indent for conditional statements (8, 12)
< #6390: FILE: /tmp/f1/bgp_vty.c:6390:
< +	if (argv_find(argv, argc, "no", &idx))
< +	    yes = 0;
--
< WARNING: suspect code indent for conditional statements (8, 12)
< #6473: FILE: /tmp/f1/bgp_vty.c:6473:
< +	if (argv_find(argv, argc, "no", &idx))
< +	    yes = 0;
--
< WARNING: suspect code indent for conditional statements (8, 12)
< #6541: FILE: /tmp/f1/bgp_vty.c:6541:
< +	if (argv_find(argv, argc, "no", &idx))
< +	    yes = 0;
--
< WARNING: Comparisons should place the constant on the right side of the test
< #6544: FILE: /tmp/f1/bgp_vty.c:6544:
< +	if (BGP_INSTANCE_TYPE_VRF != bgp->inst_type &&
< 
< WARNING: Comparisons should place the constant on the right side of the test
< #6545: FILE: /tmp/f1/bgp_vty.c:6545:
< +		BGP_INSTANCE_TYPE_DEFAULT != bgp->inst_type) {
< 
< WARNING: line over 80 characters
< #6547: FILE: /tmp/f1/bgp_vty.c:6547:
< +		vty_out(vty, "%% import|export vpn valid only for bgp vrf or default instance\n");
< 
< WARNING: Comparisons should place the constant on the right side of the test
< #6553: FILE: /tmp/f1/bgp_vty.c:6553:
< +	if ((SAFI_UNICAST != safi) || ((AFI_IP != afi) && (AFI_IP6 != afi))) {
< 
< WARNING: line over 80 characters
< #6554: FILE: /tmp/f1/bgp_vty.c:6554:
< +		vty_out(vty, "%% import|export vpn valid only for unicast ipv4|ipv6\n");
---

CLANG Static Analyzer Summary

  • Github Pull Request 1913, comparing to Git base SHA 911d8ac

No Changes in Static Analysis warnings compared to base

19 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-2945/artifact/shared/static_analysis/index.html

@qlyoung qlyoung mentioned this pull request Mar 16, 2018
@vivek-cumulus
Copy link
Copy Markdown
Contributor

Hi @paulzlabn - the changes look fine in general from a "vpn" perspective. I have a couple of comments inline.

@@ -107,11 +107,8 @@ static inline int vpn_leak_to_vpn_active(struct bgp *bgp_vrf, afi_t afi,
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this function (vpn_leak_to_vpn_active), there is no check on instance type. Of course, that is not changed in this commit, but I happened to compare with its counterpart below (vpn_leak_from_vpn_active) which has the check.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added check.

@@ -107,11 +107,8 @@ static inline int vpn_leak_to_vpn_active(struct bgp *bgp_vrf, afi_t afi,
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, not modified by this commit, but isn't there a repetition in function vpn_leak_postchange() for the TOVPN case - vpn_leak_from_vrf_update_all() called twice?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed duplicate call, not sure how that sneaked in there. Thanks!

"rt <fromvpn|tovpn|both> RTLIST...",
DEFPY (af_rt_vpn_imexport,
af_rt_vpn_imexport_cmd,
"[no] <rt|route-target> vpn <import|export|both>$direction_str RTLIST...",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears that an add/configure operation will replace RTs and a no/delete operation will remove all RTs. Is that correct? If yes, I need to think about it because I think we'll want "additive" capability and selective delete. Of course, could be added subsequently, but IIRC, we support it now for EVPN.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, current behavior is to replace.

Maybe "add rt vpn ... RTLIST..." or "rt vpn ... + RTLIST..."? It would probably be good to make "add" vs. "replace" semantics explicit.

Are there other parts of the FRR CLI that support additive vs. replacement behavior?

@@ -6477,10 +6418,18 @@ DEFUN (vpn_policy_rt,

vpn_leak_prechange(dir, afi, bgp_get_default(), bgp);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a check on whether import or export is enabled for this VRF or not. Without that, the pre and post change operations may walk routing tables before they bail out. Or maybe it is there some place that I missed? This comment may apply to other handlers too.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added checks.

bgp->vpn_policy[afi].rtlist[dir] = NULL;
}

vpn_leak_postchange(dir, afi, bgp_get_default(), bgp);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the no/delete removes all RTs, isn't postchange operation unnecessary? It bails out if RT is not there way into the code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wary of removing this call here because it would not be obvious (to someone working on the code later) that this optimization can be or has been done. In the interest of avoiding future confusion by preserving a consistent design pattern of "prechange; change; postchange" I would prefer to leave this call in.

@vivek-cumulus
Copy link
Copy Markdown
Contributor

One general comment. RD_SET is currently used to denote both presence of RD and configuration of RD. When auto-RD supported is added later on, these two notions need to be separated out (or the presence checks removed).

@LabN-CI
Copy link
Copy Markdown
Collaborator

LabN-CI commented Mar 18, 2018

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/1913 9347540
Date 03/18/2018
Start 18:16:09
Finish 18:39:15
Run-Time 23:06
Total 1816
Pass 1816
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2018-03-18-18:16:09.txt
Log autoscript-2018-03-18-18:16:57.log.bz2

For details, please contact louberger

@gpziemba
Copy link
Copy Markdown
Contributor Author

@vivek-cumulus wrote:

One general comment. RD_SET is currently used to denote both presence of RD and configuration of RD. When auto-RD supported is added later on, these two notions need to be separated out (or the presence checks removed).

Maybe we could indicate auto-RD via RD_SET + tovpn_rd.family = AF_UNSPEC.

@NetDEF-CI
Copy link
Copy Markdown
Collaborator

Continuous Integration Result: FAILED

See below for issues.
CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-2957/

This is a comment from an EXPERIMENTAL automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Get source and apply patch from patchwork: Successful

Building Stage: Failed

OmniOS amd64 build: Successful
CentOS6 amd64 build: Successful
NetBSD7 amd64 build: Successful
Debian9 amd64 build: Successful
FreeBSD9 amd64 build: Successful
Ubuntu1404 amd64 build: Successful
Ubuntu1204 amd64 build: Successful
Ubuntu 16.04 i386: Successful
FreeBSD11 amd64 build: Successful
Debian8 amd64 build: Successful
NetBSD6 amd64 build: Successful
CentOS7 amd64 build: Successful
FreeBSD10 amd64 build: Successful
Ubuntu1604 amd64 build: Successful
Fedora24 amd64 build: Successful

OpenBSD60 amd64 build: Failed

Make failed for OpenBSD60 amd64 build
see make log in attachment https://ci1.netdef.org/browse/FRR-FRRPULLREQ-2957/artifact/CI011BUILD/ErrorLog/log_make.txt
OpenBSD60 amd64 build: config.status output from configure script can be found at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-2957/artifact/CI011BUILD/config.status/config.status


Warnings Generated during build:

Checkout code: Successful with additional warnings:

OpenBSD60 amd64 build: Failed

Make failed for OpenBSD60 amd64 build
see make log in attachment https://ci1.netdef.org/browse/FRR-FRRPULLREQ-2957/artifact/CI011BUILD/ErrorLog/log_make.txt
OpenBSD60 amd64 build: config.status output from configure script can be found at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-2957/artifact/CI011BUILD/config.status/config.status

Report for bgp_mplsvpn.c
===============================================
> #928: FILE: /tmp/f2/bgp_mplsvpn.c:928:
53c57
< #912: FILE: /tmp/f1/bgp_mplsvpn.c:912:
--
> WARNING: quoted string split across lines
Report for bgp_vty.c
===============================================
< WARNING: Comparisons should place the constant on the right side of the test
< #6545: FILE: /tmp/f1/bgp_vty.c:6545:
< +	if (BGP_INSTANCE_TYPE_VRF != bgp->inst_type &&
< 
< WARNING: Comparisons should place the constant on the right side of the test
< #6546: FILE: /tmp/f1/bgp_vty.c:6546:
< +		BGP_INSTANCE_TYPE_DEFAULT != bgp->inst_type) {
< 
< WARNING: line over 80 characters
< #6548: FILE: /tmp/f1/bgp_vty.c:6548:
< +		vty_out(vty, "%% import|export vpn valid only for bgp vrf or default instance\n");
< 
< WARNING: Comparisons should place the constant on the right side of the test
< #6554: FILE: /tmp/f1/bgp_vty.c:6554:
< +	if ((SAFI_UNICAST != safi) || ((AFI_IP != afi) && (AFI_IP6 != afi))) {
< 
< WARNING: line over 80 characters
< #6555: FILE: /tmp/f1/bgp_vty.c:6555:
< +		vty_out(vty, "%% import|export vpn valid only for unicast ipv4|ipv6\n");
---

@gpziemba
Copy link
Copy Markdown
Contributor Author

NetDEF-CI wrote:

makeinfo --no-split -o 'frr.info' 'frr.texi'
frr.texi:5: warning: unrecognized encoding name `UTF-8'.
gmake[4]: *** [Makefile:32: frr.info] Segmentation fault (core dumped)

Artifact of new doc organization?

@pguibert6WIND
Copy link
Copy Markdown
Member

So this is the VTY for configuring RD/RT per BGP instance.
About multiple VRF for a singleBGP instance, will that ticket respond to this ?
If yes, then will vrf-policy change ?

bgpd/bgp_vty.c Outdated
bgp_imexport_vpn_cmd,
"[no] <import|export>$direction_str vpn",
"Export routes to another routing protocol\n"
"to VPN RIB per vpn-policy")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the correct help strings, we are missing some here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching; fixed.

@donaldsharp
Copy link
Copy Markdown
Member

The first commit really needs a bit more explanation of what it is implementing instead of assuming the person knows what it is.

Have we updated the doc/XXX with these cli changes yet? I do not see it yet.

@gpziemba gpziemba force-pushed the working/master/bgp-vpn-leak-cli branch from 9347540 to dc767ba Compare March 20, 2018 00:10
@NetDEF-CI
Copy link
Copy Markdown
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-2992/

This is a comment from an EXPERIMENTAL automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.


Warnings Generated during build:

Checkout code: Successful with additional warnings:

Report for bgp_mplsvpn.c
===============================================
> #922: FILE: /tmp/f2/bgp_mplsvpn.c:922:
53c57
< #906: FILE: /tmp/f1/bgp_mplsvpn.c:906:
--
> WARNING: quoted string split across lines
Report for bgp_vty.c
===============================================
< WARNING: Comparisons should place the constant on the right side of the test
< #6545: FILE: /tmp/f1/bgp_vty.c:6545:
< +	if (BGP_INSTANCE_TYPE_VRF != bgp->inst_type &&
< 
< WARNING: Comparisons should place the constant on the right side of the test
< #6546: FILE: /tmp/f1/bgp_vty.c:6546:
< +		BGP_INSTANCE_TYPE_DEFAULT != bgp->inst_type) {
< 
< WARNING: line over 80 characters
< #6548: FILE: /tmp/f1/bgp_vty.c:6548:
< +		vty_out(vty, "%% import|export vpn valid only for bgp vrf or default instance\n");
< 
< WARNING: Comparisons should place the constant on the right side of the test
< #6554: FILE: /tmp/f1/bgp_vty.c:6554:
< +	if ((SAFI_UNICAST != safi) || ((AFI_IP != afi) && (AFI_IP6 != afi))) {
< 
< WARNING: line over 80 characters
< #6555: FILE: /tmp/f1/bgp_vty.c:6555:
< +		vty_out(vty, "%% import|export vpn valid only for unicast ipv4|ipv6\n");
---
Report for command.c
===============================================
> #92: FILE: /tmp/f2/command.c:92:
154c162
< #91: FILE: /tmp/f1/command.c:91:

CLANG Static Analyzer Summary

  • Github Pull Request 1913, comparing to Git base SHA 08a4253

No Changes in Static Analysis warnings compared to base

19 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-2992/artifact/shared/static_analysis/index.html

@LabN-CI
Copy link
Copy Markdown
Collaborator

LabN-CI commented Mar 20, 2018

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/1913 dc767ba
Date 03/19/2018
Start 21:24:00
Finish 21:47:03
Run-Time 23:03
Total 1816
Pass 1816
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2018-03-19-21:24:00.txt
Log autoscript-2018-03-19-21:24:46.log.bz2

For details, please contact louberger

@LabN-CI
Copy link
Copy Markdown
Collaborator

LabN-CI commented Mar 20, 2018

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/1913 b4984b2
Date 03/20/2018
Start 00:06:15
Finish 00:29:30
Run-Time 23:15
Total 1813
Pass 1813
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2018-03-20-00:06:15.txt
Log autoscript-2018-03-20-00:07:03.log.bz2

For details, please contact louberger

@gpziemba
Copy link
Copy Markdown
Contributor Author

@pguibert6WIND wrote:

So this is the VTY for configuring RD/RT per BGP instance.
About multiple VRF for a single BGP instance, will that ticket respond to this ?
If yes, then will vrf-policy change ?

I might misunderstand what you are asking, so if I did not answer your question, please let me know.

vrf-policy should no longer be needed.

The code in this PR supports multiple VRFs per bgpd. Here is an example from bgpd.conf:

router bgp 1111
   bgp router-id 1.0.0.1

   neighbor 1.0.0.2 remote-as 1111
   neighbor 1.0.0.2 update-source 1.0.0.1

   address-family ipv4 vpn
     neighbor 1.0.0.2 activate
   exit-address-family

router bgp 5001 vrf GREEN
   bgp router-id 10.0.1.1

   address-family ipv4 unicast
     rd vpn export 1:1
     rt vpn both 1:100
     import vpn
     export vpn
   exit-address-family

router bgp 5002 vrf BLUE
   bgp router-id 10.0.1.1

   address-family ipv4 unicast
     rd vpn export 2:1
     rt vpn both 1:200
     import vpn
     export vpn
   exit-address-family

@NetDEF-CI
Copy link
Copy Markdown
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-2993/

This is a comment from an EXPERIMENTAL automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.


Warnings Generated during build:

Checkout code: Successful with additional warnings:

Report for bgp_mplsvpn.c
===============================================
> #922: FILE: /tmp/f2/bgp_mplsvpn.c:922:
53c57
< #906: FILE: /tmp/f1/bgp_mplsvpn.c:906:
--
> WARNING: quoted string split across lines
Report for bgp_vty.c
===============================================
< WARNING: Comparisons should place the constant on the right side of the test
< #6547: FILE: /tmp/f1/bgp_vty.c:6547:
< +	if (BGP_INSTANCE_TYPE_VRF != bgp->inst_type &&
< 
< WARNING: Comparisons should place the constant on the right side of the test
< #6548: FILE: /tmp/f1/bgp_vty.c:6548:
< +		BGP_INSTANCE_TYPE_DEFAULT != bgp->inst_type) {
< 
< WARNING: line over 80 characters
< #6550: FILE: /tmp/f1/bgp_vty.c:6550:
< +		vty_out(vty, "%% import|export vpn valid only for bgp vrf or default instance\n");
< 
< WARNING: Comparisons should place the constant on the right side of the test
< #6556: FILE: /tmp/f1/bgp_vty.c:6556:
< +	if ((SAFI_UNICAST != safi) || ((AFI_IP != afi) && (AFI_IP6 != afi))) {
< 
< WARNING: line over 80 characters
< #6557: FILE: /tmp/f1/bgp_vty.c:6557:
< +		vty_out(vty, "%% import|export vpn valid only for unicast ipv4|ipv6\n");
---
Report for command.c
===============================================
> #92: FILE: /tmp/f2/command.c:92:
154c162
< #91: FILE: /tmp/f1/command.c:91:

CLANG Static Analyzer Summary

  • Github Pull Request 1913, comparing to Git base SHA 08a4253

No Changes in Static Analysis warnings compared to base

19 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-2993/artifact/shared/static_analysis/index.html

PR FRRouting#1739 added code to leak routes between (default VRF) VPN safi and unicast RIBs in any VRF. That set of changes included temporary CLI including vpn-policy blocks to specify RD/RT/label/&c. After considerable discussion, we arrived at a consensus CLI shown below.

The code of this PR implements the vpn-specific parts of this syntax:

router bgp <as> [vrf <FOO>]
    address-family <afi> unicast
        rd (vpn|evpn) export (AS:NN | IP:nn)
        label (vpn|evpn) export (0..1048575)
        rt (vpn|evpn) (import|export|both) RTLIST...
        nexthop vpn (import|export) (A.B.C.D | X:X::X:X)
        route-map (vpn|evpn|vrf NAME) (import|export) MAP

        [no] import|export [vpn|evpn|evpn8]
        [no] import|export vrf NAME

User documentation of the vpn-specific parts of the above syntax is in PR FRRouting#1937

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
…h fix

    - vpn_leak_to_vpn_active(): check instance type
    - vpn_leak_prechange(): qualify with test for active
    - vpn_leak_postchange(): remove duplicated call to
	vpn_leak_from_vrf_update_all()

    - bgp_vty.c: Avoid null-pointer dereference for command "no rt vpn import"

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
@gpziemba gpziemba force-pushed the working/master/bgp-vpn-leak-cli branch from b4984b2 to c7109e0 Compare March 20, 2018 05:15
@gpziemba
Copy link
Copy Markdown
Contributor Author

@donaldsharp wrote:

The first commit really needs a bit more explanation of what it is implementing instead of assuming the person knows what it is.
Have we updated the doc/XXX with these cli changes yet? I do not see it yet.

Updated message of first commit with more detail. Documentation of new CLI now in PR #1937

@LabN-CI
Copy link
Copy Markdown
Collaborator

LabN-CI commented Mar 20, 2018

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/1913 c7109e0
Date 03/20/2018
Start 01:21:19
Finish 01:44:31
Run-Time 23:12
Total 1816
Pass 1816
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2018-03-20-01:21:19.txt
Log autoscript-2018-03-20-01:22:06.log.bz2

For details, please contact louberger

@NetDEF-CI
Copy link
Copy Markdown
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-2996/

This is a comment from an EXPERIMENTAL automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.


Warnings Generated during build:

Checkout code: Successful with additional warnings:

Report for bgp_mplsvpn.c
===============================================
> #922: FILE: /tmp/f2/bgp_mplsvpn.c:922:
53c57
< #906: FILE: /tmp/f1/bgp_mplsvpn.c:906:
--
> WARNING: quoted string split across lines
Report for bgp_vty.c
===============================================
< WARNING: Comparisons should place the constant on the right side of the test
< #6547: FILE: /tmp/f1/bgp_vty.c:6547:
< +	if (BGP_INSTANCE_TYPE_VRF != bgp->inst_type &&
< 
< WARNING: Comparisons should place the constant on the right side of the test
< #6548: FILE: /tmp/f1/bgp_vty.c:6548:
< +		BGP_INSTANCE_TYPE_DEFAULT != bgp->inst_type) {
< 
< WARNING: line over 80 characters
< #6550: FILE: /tmp/f1/bgp_vty.c:6550:
< +		vty_out(vty, "%% import|export vpn valid only for bgp vrf or default instance\n");
< 
< WARNING: Comparisons should place the constant on the right side of the test
< #6556: FILE: /tmp/f1/bgp_vty.c:6556:
< +	if ((SAFI_UNICAST != safi) || ((AFI_IP != afi) && (AFI_IP6 != afi))) {
< 
< WARNING: line over 80 characters
< #6557: FILE: /tmp/f1/bgp_vty.c:6557:
< +		vty_out(vty, "%% import|export vpn valid only for unicast ipv4|ipv6\n");
---
Report for command.c
===============================================
> #92: FILE: /tmp/f2/command.c:92:
154c162
< #91: FILE: /tmp/f1/command.c:91:

CLANG Static Analyzer Summary

  • Github Pull Request 1913, comparing to Git base SHA 08a4253

No Changes in Static Analysis warnings compared to base

19 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-2996/artifact/shared/static_analysis/index.html

@NetDEF-CI
Copy link
Copy Markdown
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-2997/

This is a comment from an EXPERIMENTAL automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.


Warnings Generated during build:

Checkout code: Successful with additional warnings:

Report for bgp_mplsvpn.c
===============================================
> #922: FILE: /tmp/f2/bgp_mplsvpn.c:922:
53c57
< #906: FILE: /tmp/f1/bgp_mplsvpn.c:906:
--
> WARNING: quoted string split across lines
Report for bgp_vty.c
===============================================
< WARNING: Comparisons should place the constant on the right side of the test
< #6547: FILE: /tmp/f1/bgp_vty.c:6547:
< +	if (BGP_INSTANCE_TYPE_VRF != bgp->inst_type &&
< 
< WARNING: Comparisons should place the constant on the right side of the test
< #6548: FILE: /tmp/f1/bgp_vty.c:6548:
< +		BGP_INSTANCE_TYPE_DEFAULT != bgp->inst_type) {
< 
< WARNING: line over 80 characters
< #6550: FILE: /tmp/f1/bgp_vty.c:6550:
< +		vty_out(vty, "%% import|export vpn valid only for bgp vrf or default instance\n");
< 
< WARNING: Comparisons should place the constant on the right side of the test
< #6556: FILE: /tmp/f1/bgp_vty.c:6556:
< +	if ((SAFI_UNICAST != safi) || ((AFI_IP != afi) && (AFI_IP6 != afi))) {
< 
< WARNING: line over 80 characters
< #6557: FILE: /tmp/f1/bgp_vty.c:6557:
< +		vty_out(vty, "%% import|export vpn valid only for unicast ipv4|ipv6\n");
---
Report for command.c
===============================================
> #92: FILE: /tmp/f2/command.c:92:
154c162
< #91: FILE: /tmp/f1/command.c:91:

CLANG Static Analyzer Summary

  • Github Pull Request 1913, comparing to Git base SHA 08a4253

No Changes in Static Analysis warnings compared to base

19 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-2997/artifact/shared/static_analysis/index.html

@donaldsharp donaldsharp merged commit 18febdb into FRRouting:master Mar 20, 2018
@louberger louberger deleted the working/master/bgp-vpn-leak-cli branch March 17, 2020 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants