return bgp_show (vty, bgp, afi, safi, bgp_show_type_lcommunity_list, list, uj);
}
+DEFUN (show_ip_bgp_large_community_list,
+ show_ip_bgp_large_community_list_cmd,
+ "show [ip] bgp [<view|vrf> WORD] [<ipv4|ipv6> [<unicast|multicast|vpn|encap>]] large-community-list <(1-500)|WORD> [json]",
+ SHOW_STR
+ IP_STR
+ BGP_STR
+ BGP_INSTANCE_HELP_STR
+ "Address Family\n"
+ "Address Family\n"
+ "Address Family modifier\n"
+ "Address Family modifier\n"
+ "Address Family modifier\n"
+ "Address Family modifier\n"
+ "Display routes matching the large-community-list\n"
+ "large-community-list number\n"
+ "large-community-list name\n"
+ JSON_STR)
+{
+ char *vrf = NULL;
+ afi_t afi = AFI_IP6;
+ safi_t safi = SAFI_UNICAST;
+ int idx = 0;
+
+ if (argv_find (argv, argc, "ip", &idx))
+ afi = AFI_IP;
+ if (argv_find (argv, argc, "view", &idx) || argv_find (argv, argc, "vrf", &idx))
+ vrf = argv[++idx]->arg;
+ if (argv_find (argv, argc, "ipv4", &idx) || argv_find (argv, argc, "ipv6", &idx))
+ {
+ afi = strmatch(argv[idx]->text, "ipv6") ? AFI_IP6 : AFI_IP;
+ if (argv_find (argv, argc, "unicast", &idx) || argv_find (argv, argc, "multicast", &idx))
+ safi = bgp_vty_safi_from_arg (argv[idx]->text);
+ }
+
+ int uj = use_json (argc, argv);
+
+ struct bgp *bgp = bgp_lookup_by_name (vrf);
+ if (bgp == NULL)
+ {
+ vty_out (vty, "Can't find BGP instance %s%s", vrf, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ argv_find (argv, argc, "large-community-list", &idx);
+ return bgp_show_lcommunity_list (vty, bgp, argv[idx+1]->arg, afi, safi, uj);
+}
+DEFUN (show_ip_bgp_large_community,
+ show_ip_bgp_large_community_cmd,
+ "show [ip] bgp [<view|vrf> WORD] [<ipv4|ipv6> [<unicast|multicast|vpn|encap>]] large-community [AA:BB:CC] [json]",
+ SHOW_STR
+ IP_STR
+ BGP_STR
+ BGP_INSTANCE_HELP_STR
+ "Address Family\n"
+ "Address Family\n"
+ "Address Family modifier\n"
+ "Address Family modifier\n"
+ "Address Family modifier\n"
+ "Address Family modifier\n"
+ "Display routes matching the large-communities\n"
+ "List of large-community numbers\n"
+ JSON_STR)
+{
+ char *vrf = NULL;
+ afi_t afi = AFI_IP6;
+ safi_t safi = SAFI_UNICAST;
+ int idx = 0;
+
+ if (argv_find (argv, argc, "ip", &idx))
+ afi = AFI_IP;
+ if (argv_find (argv, argc, "view", &idx) || argv_find (argv, argc, "vrf", &idx))
+ vrf = argv[++idx]->arg;
+ if (argv_find (argv, argc, "ipv4", &idx) || argv_find (argv, argc, "ipv6", &idx))
+ {
+ afi = strmatch(argv[idx]->text, "ipv6") ? AFI_IP6 : AFI_IP;
+ if (argv_find (argv, argc, "unicast", &idx) || argv_find (argv, argc, "multicast", &idx))
+ safi = bgp_vty_safi_from_arg (argv[idx]->text);
+ }
+
+ int uj = use_json (argc, argv);
+
+ struct bgp *bgp = bgp_lookup_by_name (vrf);
+ if (bgp == NULL)
+ {
+ vty_out (vty, "Can't find BGP instance %s%s", vrf, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ argv_find (argv, argc, "large-community", &idx);
+ if (strmatch(argv[idx+1]->text, "AA:BB:CC"))
+ return bgp_show_lcommunity (vty, bgp, argc, argv, afi, safi, uj);
+ else
+ return bgp_show (vty, bgp, afi, safi, bgp_show_type_lcommunity_all, NULL, uj);
+}
+
/* BGP route print out function. */
DEFUN (show_ip_bgp_ipv4,
show_ip_bgp_ipv4_cmd,
|filter-list WORD\
|community [<AA:NN|local-AS|no-advertise|no-export> [exact-match]]\
|community-list <(1-500)|WORD> [exact-match]\
- |large-community [<AA:BB:CC>...]\
- |large-community-list <(1-500)|WORD>\
|A.B.C.D/M longer-prefixes\
|X:X::X:X/M longer-prefixes>\
] [json]",
"community-list number\n"
"community-list name\n"
"Exact match of the communities\n"
- "Display routes matching the large-communities\n"
- "large-community number\n"
- "large-community number\n"
- "large-community number\n"
- "large-community number\n"
- "Display routes matching the large-community-list\n"
- "large-community-list number\n"
- "large-community-list name\n"
"IPv4 prefix\n"
"Display route and more specific routes\n"
"IPv6 prefix\n"
exact_match = 1;
return bgp_show_community_list (vty, vrf, clist_number_or_name, exact_match, afi, safi);
}
- else if (strmatch(argv[idx]->text, "large-community"))
- {
- if (strmatch(argv[idx+1]->text, "<AA:BB:CC>"))
- return bgp_show_lcommunity (vty, bgp, argc, argv, afi, safi, uj);
- else
- return bgp_show (vty, bgp, afi, safi, bgp_show_type_lcommunity_all, NULL, uj);
- }
- else if (strmatch(argv[idx]->text, "large-community-list"))
- {
- return bgp_show_lcommunity_list (vty, bgp, argv[idx+1]->arg, afi, safi, uj);
- }
/* prefix-longer */
else if (argv[idx]->type == IPV4_TKN || argv[idx]->type == IPV6_TKN)
return bgp_show_prefix_longer (vty, vrf, argv[idx + 1]->arg, afi, safi, bgp_show_type_prefix_longer);
/* IPv4 Multicast Mode */
install_element (BGP_IPV4M_NODE, &bgp_damp_set_cmd);
install_element (BGP_IPV4M_NODE, &bgp_damp_unset_cmd);
+
+ /* Large Communities */
+ install_element (VIEW_NODE, &show_ip_bgp_large_community_list_cmd);
+ install_element (VIEW_NODE, &show_ip_bgp_large_community_cmd);
}
void
DEFUN (match_lcommunity,
match_lcommunity_cmd,
- "match large-community [(1-99)|(100-500)|WORD]",
+ "match large-community [<(1-99)|(100-500)|WORD>]",
MATCH_STR
"Match BGP large community list\n"
"Large Community-list number (standard)\n"
DEFUN (no_match_lcommunity,
no_match_lcommunity_cmd,
- "no match large-community [(1-99)|(100-500)|WORD]",
+ "no match large-community [<(1-99)|(100-500)|WORD>]",
NO_STR
MATCH_STR
"Match BGP large community list\n"
DEFUN (no_set_lcommunity,
no_set_lcommunity_cmd,
- "no set large-community <none|[AA:BB:CC...]>",
+ "no set large-community none",
NO_STR
SET_STR
"BGP large community attribute\n"
- "No community attribute\n"
- "Large community\n"
- "Large community in AA:BB:CC... format or additive\n")
+ "No community attribute\n")
{
return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
"large-community", NULL);
}
+DEFUN (no_set_lcommunity1,
+ no_set_lcommunity1_cmd,
+ "no set large-community AA:BB:CC...",
+ NO_STR
+ SET_STR
+ "BGP large community attribute\n"
+ "Large community in AA:BB:CC... format or additive\n")
+{
+ return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
+ "large-community", NULL);
+}
DEFUN (set_lcommunity_delete,
set_lcommunity_delete_cmd,
DEFUN (no_set_lcommunity_delete,
no_set_lcommunity_delete_cmd,
- "no set large-comm-list [<(1-99|(100-500)|word)> delete]",
+ "no set large-comm-list <(1-99|(100-500)|WORD)> [delete]",
NO_STR
SET_STR
"set BGP large community list (for deletion)\n"
install_element (RMAP_NODE, &set_lcommunity_cmd);
install_element (RMAP_NODE, &set_lcommunity_none_cmd);
install_element (RMAP_NODE, &no_set_lcommunity_cmd);
+ install_element (RMAP_NODE, &no_set_lcommunity1_cmd);
install_element (RMAP_NODE, &set_lcommunity_delete_cmd);
install_element (RMAP_NODE, &no_set_lcommunity_delete_cmd);
install_element (RMAP_NODE, &set_ecommunity_rt_cmd);
DEFUN (ip_lcommunity_list_standard,
ip_lcommunity_list_standard_cmd,
- "ip large-community-list (1-99) <deny|permit> [AA:BB:CC...]",
+ "ip large-community-list (1-99) <deny|permit>",
+ IP_STR
+ LCOMMUNITY_LIST_STR
+ "Large Community list number (standard)\n"
+ "Specify large community to reject\n"
+ "Specify large community to accept\n"
+ LCOMMUNITY_VAL_STR)
+{
+ return lcommunity_list_set_vty (vty, argc, argv, LARGE_COMMUNITY_LIST_STANDARD, 0);
+}
+
+DEFUN (ip_lcommunity_list_standard1,
+ ip_lcommunity_list_standard1_cmd,
+ "ip large-community-list (1-99) <deny|permit> AA:BB:CC...",
IP_STR
LCOMMUNITY_LIST_STR
"Large Community list number (standard)\n"
DEFUN (ip_lcommunity_list_name_standard,
ip_lcommunity_list_name_standard_cmd,
- "ip large-community-list standard WORD <deny|permit> [AA:BB.CC...]",
+ "ip large-community-list standard WORD <deny|permit>",
+ IP_STR
+ LCOMMUNITY_LIST_STR
+ "Specify standard large-community-list\n"
+ "Large Community list name\n"
+ "Specify large community to reject\n"
+ "Specify large community to accept\n")
+{
+ return lcommunity_list_set_vty (vty, argc, argv, LARGE_COMMUNITY_LIST_STANDARD, 1);
+}
+
+DEFUN (ip_lcommunity_list_name_standard1,
+ ip_lcommunity_list_name_standard1_cmd,
+ "ip large-community-list standard WORD <deny|permit> AA:BB:CC...",
IP_STR
LCOMMUNITY_LIST_STR
"Specify standard large-community-list\n"
/* Large Community List */
install_element (CONFIG_NODE, &ip_lcommunity_list_standard_cmd);
+ install_element (CONFIG_NODE, &ip_lcommunity_list_standard1_cmd);
install_element (CONFIG_NODE, &ip_lcommunity_list_expanded_cmd);
install_element (CONFIG_NODE, &ip_lcommunity_list_name_standard_cmd);
+ install_element (CONFIG_NODE, &ip_lcommunity_list_name_standard1_cmd);
install_element (CONFIG_NODE, &ip_lcommunity_list_name_expanded_cmd);
install_element (CONFIG_NODE, &no_ip_lcommunity_list_standard_all_cmd);
install_element (CONFIG_NODE, &no_ip_lcommunity_list_name_expanded_all_cmd);