"Generate an AS_SET\n"
"Do not generate an AS_SET\n")
{
- int idx_as_set = 4;
+ int idx = 0;
struct bgp *bgp;
bgp = vty->index;
/* no-as-set is now the default behavior so we can silently
* ignore it */
- if (argv[idx_as_set]->arg != NULL && strncmp (argv[idx_as_set]->arg, "a", 1) == 0)
+ if (argv_find (argv, argc, "as-set", &idx))
bgp_flag_set (bgp, BGP_FLAG_MULTIPATH_RELAX_AS_SET);
else
bgp_flag_unset (bgp, BGP_FLAG_MULTIPATH_RELAX_AS_SET) ;
"Send Extended Community attributes\n"
"Send Standard Community attributes\n")
{
- int idx_peer = 1;
- int idx_type = 3;
- if (strncmp (argv[idx_type]->arg, "s", 1) == 0)
- return peer_af_flag_set_vty (vty, argv[idx_peer]->arg, bgp_node_afi (vty),
- bgp_node_safi (vty),
- PEER_FLAG_SEND_COMMUNITY);
- if (strncmp (argv[idx_type]->arg, "e", 1) == 0)
- return peer_af_flag_set_vty (vty, argv[idx_peer]->arg, bgp_node_afi (vty),
- bgp_node_safi (vty),
- PEER_FLAG_SEND_EXT_COMMUNITY);
+ int idx = 0;
+ u_int32_t flag = 0;
- return peer_af_flag_set_vty (vty, argv[idx_peer]->arg, bgp_node_afi (vty),
- bgp_node_safi (vty),
- (PEER_FLAG_SEND_COMMUNITY|
- PEER_FLAG_SEND_EXT_COMMUNITY));
+ char *peer = argv[1]->arg;
+
+ if (argv_find (argv, argc, "standard", &idx))
+ SET_FLAG (flag, PEER_FLAG_SEND_COMMUNITY);
+ else if (argv_find (argv, argc, "extended", &idx))
+ SET_FLAG (flag, PEER_FLAG_SEND_EXT_COMMUNITY);
+ else
+ {
+ SET_FLAG (flag, PEER_FLAG_SEND_COMMUNITY);
+ SET_FLAG (flag, PEER_FLAG_SEND_EXT_COMMUNITY);
+ }
+
+ return peer_af_flag_set_vty (vty, peer, bgp_node_afi (vty), bgp_node_safi (vty), flag);
}
DEFUN (no_neighbor_send_community_type,
$ignore{'"address-family vpnv4"'} = "ignore";
$ignore{'"address-family vpnv4 unicast"'} = "ignore";
$ignore{'"address-family ipv4 vrf NAME"'} = "ignore";
-$ignore{'"address-family encap"'} = "ignore";
-$ignore{'"address-family encapv4"'} = "ignore";
+$ignore{'"address-family <encap|encapv4>"'} = "ignore";
$ignore{'"address-family encapv6"'} = "ignore";
$ignore{'"address-family vpnv6"'} = "ignore";
$ignore{'"address-family vpnv6 unicast"'} = "ignore";
return CMD_SUCCESS;
}
-DEFUNSH (VTYSH_BGPD,
- address_family_encap,
- address_family_encap_cmd,
- "address-family encap",
- "Enter Address Family command mode\n"
- "Address Family\n")
-{
- vty->node = BGP_ENCAP_NODE;
- return CMD_SUCCESS;
-}
-
DEFUNSH (VTYSH_BGPD,
address_family_encapv4,
address_family_encapv4_cmd,
- "address-family encapv4",
+ "address-family <encap|encapv4>",
"Enter Address Family command mode\n"
+ "Address Family\n"
"Address Family\n")
{
vty->node = BGP_ENCAP_NODE;
install_element (CONFIG_NODE, &router_bgp_cmd);
install_element (BGP_NODE, &address_family_vpnv4_cmd);
install_element (BGP_NODE, &address_family_vpnv6_cmd);
- install_element (BGP_NODE, &address_family_encap_cmd);
+ install_element (BGP_NODE, &address_family_encapv4_cmd);
install_element (BGP_NODE, &address_family_encapv6_cmd);
#if defined(ENABLE_BGP_VNC)
install_element (BGP_NODE, &vnc_defaults_cmd);