return CMD_SUCCESS;
}
+/* BGP route print out function */
+DEFPY (show_ip_bgp_link_state, show_ip_bgp_link_state_cmd,
+ "show [ip] bgp [<view|vrf> VIEWVRFNAME] link-state link-state\
+ [all$all]\
+ [version (1-4294967295)\
+ |detail-routes$detail_routes\
+ ] [json$uj [detail$detail_json] | wide$wide]",
+ SHOW_STR IP_STR BGP_STR BGP_INSTANCE_HELP_STR
+ BGP_AF_STR
+ BGP_AF_MODIFIER_STR
+ "Display the entries for all address families\n"
+ "Display prefixes with matching version numbers\n"
+ "Version number and above\n"
+ "Display detailed version of all routes\n"
+ JSON_STR
+ "Display detailed version of JSON output\n"
+ "Increase table width for longer prefixes\n")
+{
+ afi_t afi = AFI_LINKSTATE;
+ safi_t safi = SAFI_LINKSTATE;
+ enum bgp_show_type sh_type = bgp_show_type_normal;
+ void *output_arg = NULL;
+ struct bgp *bgp = NULL;
+ int idx = 0;
+ uint16_t show_flags = 0;
+ enum rpki_states rpki_target_state = RPKI_NOT_BEING_USED;
+
+ if (uj) {
+ argc--;
+ SET_FLAG(show_flags, BGP_SHOW_OPT_JSON);
+ }
+
+ if (detail_json)
+ SET_FLAG(show_flags, BGP_SHOW_OPT_JSON_DETAIL);
+
+ if (detail_routes)
+ SET_FLAG(show_flags, BGP_SHOW_OPT_ROUTES_DETAIL);
+
+ if (wide)
+ SET_FLAG(show_flags, BGP_SHOW_OPT_WIDE);
+
+ bgp_vty_find_and_parse_afi_safi_bgp(vty, argv, argc, &idx, &afi, &safi,
+ &bgp, uj);
+ if (!idx)
+ return CMD_WARNING;
+
+ /* Display prefixes with matching version numbers */
+ if (argv_find(argv, argc, "version", &idx)) {
+ sh_type = bgp_show_type_prefix_version;
+ output_arg = argv[idx + 1]->arg;
+ }
+
+ return bgp_show(vty, bgp, afi, safi, sh_type, output_arg, show_flags,
+ rpki_target_state);
+}
+
DEFUN (show_ip_bgp_route,
show_ip_bgp_route_cmd,
"show [ip] bgp [<view|vrf> VIEWVRFNAME] ["BGP_AFI_CMD_STR" ["BGP_SAFI_WITH_LABEL_CMD_STR"]]<A.B.C.D|A.B.C.D/M|X:X::X:X|X:X::X:X/M> [<bestpath|multipath>] [rpki <valid|invalid|notfound>] [json]",
DEFUN (show_ip_bgp_regexp,
show_ip_bgp_regexp_cmd,
- "show [ip] bgp [<view|vrf> VIEWVRFNAME] ["BGP_AFI_CMD_STR" ["BGP_SAFI_WITH_LABEL_CMD_STR"]] regexp REGEX [json]",
+ "show [ip] bgp [<view|vrf> VIEWVRFNAME] ["BGP_AFI_WITH_LS_CMD_STR" ["BGP_SAFI_WITH_LABEL_LS_CMD_STR"]] regexp REGEX [json]",
SHOW_STR
IP_STR
BGP_STR
BGP_INSTANCE_HELP_STR
- BGP_AFI_HELP_STR
- BGP_SAFI_WITH_LABEL_HELP_STR
+ BGP_AFI_WITH_LS_HELP_STR
+ BGP_SAFI_WITH_LABEL_LS_HELP_STR
"Display routes matching the AS path regular expression\n"
"A regular-expression (1234567890_^|[,{}() ]$*+.?-\\) to match the BGP AS paths\n"
JSON_STR)
DEFPY(show_ip_bgp_instance_neighbor_advertised_route,
show_ip_bgp_instance_neighbor_advertised_route_cmd,
- "show [ip] bgp [<view|vrf> VIEWVRFNAME] [" BGP_AFI_CMD_STR " [" BGP_SAFI_WITH_LABEL_CMD_STR "]] [all$all] neighbors <A.B.C.D|X:X::X:X|WORD> <advertised-routes|received-routes|filtered-routes> [route-map RMAP_NAME$route_map] [<A.B.C.D/M|X:X::X:X/M>$prefix | detail$detail] [json$uj | wide$wide]",
+ "show [ip] bgp [<view|vrf> VIEWVRFNAME] [" BGP_AFI_WITH_LS_CMD_STR " [" BGP_SAFI_WITH_LABEL_LS_CMD_STR "]] [all$all] neighbors <A.B.C.D|X:X::X:X|WORD> <advertised-routes|received-routes|filtered-routes> [route-map RMAP_NAME$route_map] [<A.B.C.D/M|X:X::X:X/M>$prefix | detail$detail] [json$uj | wide$wide]",
SHOW_STR
IP_STR
BGP_STR
BGP_INSTANCE_HELP_STR
- BGP_AFI_HELP_STR
- BGP_SAFI_WITH_LABEL_HELP_STR
+ BGP_AFI_WITH_LS_HELP_STR
+ BGP_SAFI_WITH_LABEL_LS_HELP_STR
"Display the entries for all address families\n"
"Detailed information on TCP and BGP neighbor connections\n"
"Neighbor to display information about\n"
if (!idx)
return CMD_WARNING;
+ if (afi == AFI_LINKSTATE && prefix_str) {
+ vty_out(vty,
+ "The prefix option cannot be selected with AFI Link-State\n");
+ return CMD_WARNING;
+ }
+
/* neighbors <A.B.C.D|X:X::X:X|WORD> */
argv_find(argv, argc, "neighbors", &idx);
peerstr = argv[++idx]->arg;
install_element(VIEW_NODE, &show_ip_bgp_l2vpn_evpn_statistics_cmd);
install_element(VIEW_NODE, &show_ip_bgp_dampening_params_cmd);
install_element(VIEW_NODE, &show_ip_bgp_cmd);
+ install_element(VIEW_NODE, &show_ip_bgp_link_state_cmd);
install_element(VIEW_NODE, &show_ip_bgp_route_cmd);
install_element(VIEW_NODE, &show_ip_bgp_regexp_cmd);
install_element(VIEW_NODE, &show_ip_bgp_statistics_all_cmd);
/* `show [ip] bgp summary' commands. */
DEFPY(show_ip_bgp_summary, show_ip_bgp_summary_cmd,
- "show [ip] bgp [<view|vrf> VIEWVRFNAME] [" BGP_AFI_CMD_STR
- " [" BGP_SAFI_WITH_LABEL_CMD_STR
+ "show [ip] bgp [<view|vrf> VIEWVRFNAME] [" BGP_AFI_WITH_LS_CMD_STR
+ " [" BGP_SAFI_WITH_LABEL_LS_CMD_STR
"]] [all$all] summary [established|failed] [<neighbor <A.B.C.D|X:X::X:X|WORD>|remote-as <ASNUM|internal|external>>] [terse] [wide] [json$uj]",
- SHOW_STR IP_STR BGP_STR BGP_INSTANCE_HELP_STR BGP_AFI_HELP_STR
- BGP_SAFI_WITH_LABEL_HELP_STR
+ SHOW_STR IP_STR BGP_STR BGP_INSTANCE_HELP_STR BGP_AFI_WITH_LS_HELP_STR
+ BGP_SAFI_WITH_LABEL_LS_HELP_STR
"Display the entries for all address families\n"
"Summary of BGP neighbor status\n"
"Show only sessions in Established state\n"
#define BGP_AF_MODIFIER_STR "Address Family modifier\n"
#define BGP_AFI_CMD_STR "<ipv4|ipv6>"
#define BGP_AFI_HELP_STR BGP_AF_STR BGP_AF_STR
+#define BGP_AFI_WITH_LS_CMD_STR "<ipv4|ipv6|link-state>"
+#define BGP_AFI_WITH_LS_HELP_STR BGP_AF_STR BGP_AF_STR BGP_AF_STR
#define BGP_SAFI_CMD_STR "<unicast|multicast|vpn>"
#define BGP_SAFI_HELP_STR \
BGP_AF_MODIFIER_STR BGP_AF_MODIFIER_STR BGP_AF_MODIFIER_STR
BGP_AF_MODIFIER_STR BGP_AF_MODIFIER_STR BGP_AF_MODIFIER_STR \
BGP_AF_MODIFIER_STR BGP_AF_MODIFIER_STR
+#define BGP_SAFI_WITH_LABEL_LS_CMD_STR \
+ "<unicast|multicast|vpn|labeled-unicast|flowspec|link-state>"
+#define BGP_SAFI_WITH_LABEL_LS_HELP_STR \
+ BGP_AF_MODIFIER_STR BGP_AF_MODIFIER_STR BGP_AF_MODIFIER_STR \
+ BGP_AF_MODIFIER_STR BGP_AF_MODIFIER_STR BGP_AF_MODIFIER_STR
+
#define BGP_SELF_ORIG_CMD_STR "self-originate"
#define BGP_SELF_ORIG_HELP_STR "Display only self-originated routes\n"