summaryrefslogtreecommitdiff
path: root/bgpd/bgp_vty.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgp_vty.c')
-rw-r--r--bgpd/bgp_vty.c56
1 files changed, 52 insertions, 4 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 09f9667a9a..31524e2221 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -5746,17 +5746,24 @@ DEFPY (neighbor_capability_fqdn,
"Advertise fqdn capability to the peer\n")
{
struct peer *peer;
+ int ret;
peer = peer_and_group_lookup_vty(vty, neighbor);
if (!peer)
return CMD_WARNING_CONFIG_FAILED;
if (no)
- return peer_flag_unset_vty(vty, neighbor,
+ ret = peer_flag_unset_vty(vty, neighbor,
PEER_FLAG_CAPABILITY_FQDN);
else
- return peer_flag_set_vty(vty, neighbor,
+ ret = peer_flag_set_vty(vty, neighbor,
PEER_FLAG_CAPABILITY_FQDN);
+
+ bgp_capability_send(peer, AFI_IP, SAFI_UNICAST, CAPABILITY_CODE_FQDN,
+ no ? CAPABILITY_ACTION_UNSET
+ : CAPABILITY_ACTION_SET);
+
+ return ret;
}
/* neighbor capability extended next hop encoding */
@@ -6466,6 +6473,32 @@ ALIAS_HIDDEN(
"Send Standard Community attributes\n"
"Send Large Community attributes\n")
+DEFPY (neighbor_ecommunity_rpki,
+ neighbor_ecommunity_rpki_cmd,
+ "[no$no] neighbor <A.B.C.D|X:X::X:X|WORD>$neighbor send-community extended rpki",
+ NO_STR
+ NEIGHBOR_STR
+ NEIGHBOR_ADDR_STR2
+ "Send Community attribute to this neighbor\n"
+ "Send Extended Community attributes\n"
+ "Send RPKI Extended Community attributes\n")
+{
+ struct peer *peer;
+ afi_t afi = bgp_node_afi(vty);
+ safi_t safi = bgp_node_safi(vty);
+
+ peer = peer_and_group_lookup_vty(vty, neighbor);
+ if (!peer)
+ return CMD_WARNING_CONFIG_FAILED;
+
+ if (no)
+ return peer_af_flag_unset_vty(vty, neighbor, afi, safi,
+ PEER_FLAG_SEND_EXT_COMMUNITY_RPKI);
+ else
+ return peer_af_flag_set_vty(vty, neighbor, afi, safi,
+ PEER_FLAG_SEND_EXT_COMMUNITY_RPKI);
+}
+
/* neighbor soft-reconfig. */
DEFUN (neighbor_soft_reconfiguration,
neighbor_soft_reconfiguration_cmd,
@@ -17658,8 +17691,8 @@ bool peergroup_flag_check(struct peer *peer, uint64_t flag)
return !!CHECK_FLAG(peer->flags_override, flag);
}
-static bool peergroup_af_flag_check(struct peer *peer, afi_t afi, safi_t safi,
- uint64_t flag)
+bool peergroup_af_flag_check(struct peer *peer, afi_t afi, safi_t safi,
+ uint64_t flag)
{
if (!peer_group_active(peer)) {
if (CHECK_FLAG(peer->af_flags_invert[afi][safi], flag))
@@ -18435,6 +18468,12 @@ static void bgp_config_write_peer_af(struct vty *vty, struct bgp *bgp,
if (flag_slcomm)
vty_out(vty, " no neighbor %s send-community large\n",
addr);
+
+ if (peergroup_af_flag_check(peer, afi, safi,
+ PEER_FLAG_SEND_EXT_COMMUNITY_RPKI))
+ vty_out(vty,
+ " no neighbor %s send-community extended rpki\n",
+ addr);
}
/* Default information */
@@ -20320,6 +20359,15 @@ void bgp_vty_init(void)
install_element(BGP_VPNV6_NODE, &neighbor_send_community_type_cmd);
install_element(BGP_VPNV6_NODE, &no_neighbor_send_community_cmd);
install_element(BGP_VPNV6_NODE, &no_neighbor_send_community_type_cmd);
+ install_element(BGP_NODE, &neighbor_ecommunity_rpki_cmd);
+ install_element(BGP_IPV4_NODE, &neighbor_ecommunity_rpki_cmd);
+ install_element(BGP_IPV4M_NODE, &neighbor_ecommunity_rpki_cmd);
+ install_element(BGP_IPV4L_NODE, &neighbor_ecommunity_rpki_cmd);
+ install_element(BGP_IPV6_NODE, &neighbor_ecommunity_rpki_cmd);
+ install_element(BGP_IPV6M_NODE, &neighbor_ecommunity_rpki_cmd);
+ install_element(BGP_IPV6L_NODE, &neighbor_ecommunity_rpki_cmd);
+ install_element(BGP_VPNV4_NODE, &neighbor_ecommunity_rpki_cmd);
+ install_element(BGP_VPNV6_NODE, &neighbor_ecommunity_rpki_cmd);
/* "neighbor route-reflector" commands.*/
install_element(BGP_NODE, &neighbor_route_reflector_client_hidden_cmd);