unsigned long conf_bgp_debug_graceful_restart;
unsigned long conf_bgp_debug_evpn_mh;
unsigned long conf_bgp_debug_bfd;
+unsigned long conf_bgp_debug_cond_adv;
+unsigned long conf_bgp_debug_optimal_route_reflection;
unsigned long term_bgp_debug_as4;
unsigned long term_bgp_debug_neighbor_events;
unsigned long term_bgp_debug_graceful_restart;
unsigned long term_bgp_debug_evpn_mh;
unsigned long term_bgp_debug_bfd;
+unsigned long term_bgp_debug_cond_adv;
+unsigned long term_bgp_debug_optimal_route_reflection;
struct list *bgp_debug_neighbor_events_peers = NULL;
struct list *bgp_debug_keepalive_peers = NULL;
{BGP_NOTIFY_OPEN_AUTH_FAILURE, "/Authentication Failure"},
{BGP_NOTIFY_OPEN_UNACEP_HOLDTIME, "/Unacceptable Hold Time"},
{BGP_NOTIFY_OPEN_UNSUP_CAPBL, "/Unsupported Capability"},
+ {BGP_NOTIFY_OPEN_ROLE_MISMATCH, "/Role Mismatch"},
{0}};
static const struct message bgp_notify_update_msg[] = {
/* Dump attribute. */
bool bgp_dump_attr(struct attr *attr, char *buf, size_t size)
{
- char addrbuf[BUFSIZ];
-
if (!attr)
return false;
/* Add MP case. */
if (attr->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL
|| attr->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL)
- snprintf(buf + strlen(buf), size - strlen(buf),
- ", mp_nexthop %s",
- inet_ntop(AF_INET6, &attr->mp_nexthop_global, addrbuf,
- BUFSIZ));
+ snprintfrr(buf + strlen(buf), size - strlen(buf),
+ ", mp_nexthop %pI6", &attr->mp_nexthop_global);
if (attr->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL)
- snprintf(buf + strlen(buf), size - strlen(buf), "(%s)",
- inet_ntop(AF_INET6, &attr->mp_nexthop_local, addrbuf,
- BUFSIZ));
+ snprintfrr(buf + strlen(buf), size - strlen(buf), "(%pI6)",
+ &attr->mp_nexthop_local);
if (attr->mp_nexthop_len == BGP_ATTR_NHLEN_IPV4)
snprintfrr(buf, size, "nexthop %pI4", &attr->nexthop);
snprintf(buf + strlen(buf), size - strlen(buf),
", localpref %u", attr->local_pref);
+ if (CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_AIGP)))
+ snprintf(buf + strlen(buf), size - strlen(buf),
+ ", aigp-metric %" PRIu64,
+ (unsigned long long)bgp_attr_get_aigp_metric(attr));
+
if (CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC)))
snprintf(buf + strlen(buf), size - strlen(buf), ", metric %u",
attr->med);
return CMD_SUCCESS;
}
-#ifndef VTYSH_EXTRACT_PL
#include "bgpd/bgp_debug_clippy.c"
-#endif
DEFPY (debug_bgp_update_prefix_afi_safi,
debug_bgp_update_prefix_afi_safi_cmd,
return CMD_SUCCESS;
}
-DEFUN (debug_bgp_allow_martians,
- debug_bgp_allow_martians_cmd,
- "debug bgp allow-martians",
- DEBUG_STR
- BGP_STR
- "BGP allow martian next hops\n")
-{
- if (vty->node == CONFIG_NODE)
- DEBUG_ON(allow_martians, ALLOW_MARTIANS);
- else {
- TERM_DEBUG_ON(allow_martians, ALLOW_MARTIANS);
- vty_out(vty, "BGP allow_martian next hop debugging is on\n");
- }
- return CMD_SUCCESS;
-}
-
-DEFUN (no_debug_bgp_allow_martians,
- no_debug_bgp_allow_martians_cmd,
- "no debug bgp allow-martians",
- NO_STR
- DEBUG_STR
- BGP_STR
- "BGP allow martian next hops\n")
-{
- if (vty->node == CONFIG_NODE)
- DEBUG_OFF(allow_martians, ALLOW_MARTIANS);
- else {
- TERM_DEBUG_OFF(allow_martians, ALLOW_MARTIANS);
- vty_out(vty, "BGP allow martian next hop debugging is off\n");
- }
- return CMD_SUCCESS;
-}
-
-
/* debug bgp update-groups */
DEFUN (debug_bgp_update_groups,
debug_bgp_update_groups_cmd,
return CMD_SUCCESS;
}
+DEFPY (debug_bgp_optimal_route_reflection,
+ debug_bgp_optimal_route_reflection_cmd,
+ "[no$no] debug bgp optimal-route-reflection",
+ NO_STR
+ DEBUG_STR
+ BGP_STR
+ BGP_ORR_DEBUG)
+{
+ if (vty->node == CONFIG_NODE) {
+ if (no)
+ DEBUG_OFF(optimal_route_reflection, ORR);
+ else
+ DEBUG_ON(optimal_route_reflection, ORR);
+ } else {
+ if (no) {
+ TERM_DEBUG_OFF(optimal_route_reflection, ORR);
+ vty_out(vty,
+ "BGP Optimal Route Reflection debugging is off\n");
+ } else {
+ TERM_DEBUG_ON(optimal_route_reflection, ORR);
+ vty_out(vty,
+ "BGP Optimal Route Reflection debugging is on\n");
+ }
+ }
+ return CMD_SUCCESS;
+}
+
DEFUN (debug_bgp_labelpool,
debug_bgp_labelpool_cmd,
"debug bgp labelpool",
return CMD_SUCCESS;
}
+DEFPY (debug_bgp_cond_adv,
+ debug_bgp_cond_adv_cmd,
+ "[no$no] debug bgp conditional-advertisement",
+ NO_STR
+ DEBUG_STR
+ BGP_STR
+ "BGP conditional advertisement\n")
+{
+ if (vty->node == CONFIG_NODE) {
+ if (no)
+ DEBUG_OFF(cond_adv, COND_ADV);
+ else
+ DEBUG_ON(cond_adv, COND_ADV);
+ } else {
+ if (no) {
+ TERM_DEBUG_OFF(cond_adv, COND_ADV);
+ vty_out(vty,
+ "BGP conditional advertisement debugging is off\n");
+ } else {
+ TERM_DEBUG_ON(cond_adv, COND_ADV);
+ vty_out(vty,
+ "BGP conditional advertisement debugging is on\n");
+ }
+ }
+ return CMD_SUCCESS;
+}
+
DEFUN (no_debug_bgp,
no_debug_bgp_cmd,
"no debug bgp",
TERM_DEBUG_OFF(evpn_mh, EVPN_MH_ES);
TERM_DEBUG_OFF(evpn_mh, EVPN_MH_RT);
TERM_DEBUG_OFF(bfd, BFD_LIB);
+ TERM_DEBUG_OFF(cond_adv, COND_ADV);
+ TERM_DEBUG_OFF(optimal_route_reflection, ORR);
vty_out(vty, "All possible debugging has been turned off\n");
if (BGP_DEBUG(bfd, BFD_LIB))
vty_out(vty, " BGP BFD library debugging is on\n");
+ if (BGP_DEBUG(cond_adv, COND_ADV))
+ vty_out(vty,
+ " BGP conditional advertisement debugging is on\n");
+
+ if (BGP_DEBUG(optimal_route_reflection, ORR))
+ vty_out(vty,
+ " BGP Optimal Route Reflection debugging is on\n");
+
+ cmd_show_lib_debugs(vty);
+
return CMD_SUCCESS;
}
write++;
}
+ if (CONF_BGP_DEBUG(cond_adv, COND_ADV)) {
+ vty_out(vty, "debug bgp conditional-advertisement\n");
+ write++;
+ }
+
+ if (CONF_BGP_DEBUG(optimal_route_reflection, ORR)) {
+ vty_out(vty, "debug bgp optimal-route-reflection\n");
+ write++;
+ }
+
return write;
}
install_element(CONFIG_NODE, &debug_bgp_update_cmd);
install_element(ENABLE_NODE, &debug_bgp_zebra_cmd);
install_element(CONFIG_NODE, &debug_bgp_zebra_cmd);
- install_element(ENABLE_NODE, &debug_bgp_allow_martians_cmd);
- install_element(CONFIG_NODE, &debug_bgp_allow_martians_cmd);
install_element(ENABLE_NODE, &debug_bgp_update_groups_cmd);
install_element(CONFIG_NODE, &debug_bgp_update_groups_cmd);
install_element(ENABLE_NODE, &debug_bgp_bestpath_prefix_cmd);
install_element(CONFIG_NODE, &no_debug_bgp_update_cmd);
install_element(ENABLE_NODE, &no_debug_bgp_zebra_cmd);
install_element(CONFIG_NODE, &no_debug_bgp_zebra_cmd);
- install_element(ENABLE_NODE, &no_debug_bgp_allow_martians_cmd);
- install_element(CONFIG_NODE, &no_debug_bgp_allow_martians_cmd);
install_element(ENABLE_NODE, &no_debug_bgp_update_groups_cmd);
install_element(CONFIG_NODE, &no_debug_bgp_update_groups_cmd);
install_element(ENABLE_NODE, &no_debug_bgp_cmd);
/* debug bgp bfd */
install_element(ENABLE_NODE, &debug_bgp_bfd_cmd);
install_element(CONFIG_NODE, &debug_bgp_bfd_cmd);
+
+ /* debug bgp conditional advertisement */
+ install_element(ENABLE_NODE, &debug_bgp_cond_adv_cmd);
+ install_element(CONFIG_NODE, &debug_bgp_cond_adv_cmd);
+
+ /* debug bgp optimal route reflection */
+ install_element(ENABLE_NODE, &debug_bgp_optimal_route_reflection_cmd);
+ install_element(CONFIG_NODE, &debug_bgp_optimal_route_reflection_cmd);
}
/* Return true if this prefix is on the per_prefix_list of prefixes to debug
struct bgp_route_evpn *overlay_index,
char *str, int size)
{
- char rd_buf[RD_ADDRSTRLEN];
char tag_buf[30];
char overlay_index_buf[INET6_ADDRSTRLEN + 14];
const struct prefix_evpn *evp;
}
if (prd)
- snprintfrr(str, size, "RD %s %pFX%s%s%s %s %s",
- prefix_rd2str(prd, rd_buf, sizeof(rd_buf)), pu.p,
+ snprintfrr(str, size, "RD %pRD %pFX%s%s%s %s %s", prd, pu.p,
overlay_index_buf, tag_buf, pathid_buf, afi2str(afi),
safi2str(safi));
else if (safi == SAFI_FLOWSPEC) {