summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_debug.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2022-04-30 22:04:58 +0200
committerDonatas Abraitis <donatas@opensourcerouting.org>2022-05-02 08:43:40 +0200
commiteea685b6d30b03b0924c0773b1f3563d95ee621f (patch)
tree367eb007077f597d7fa6ac3e792444d64b44545a /bgpd/bgp_debug.c
parentbgpd: Rename graceful restart constants for R-bit capabilities (diff)
downloadfrr-eea685b6d30b03b0924c0773b1f3563d95ee621f.tar.xz
frr-eea685b6d30b03b0924c0773b1f3563d95ee621f.zip
bgpd: Implement CEASE/Hard Reset notification
Also, add N-Bit (Notification) flag for Graceful Restart. This is a preparation for RFC8538. More information: https://datatracker.ietf.org/doc/html/rfc8538 Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'bgpd/bgp_debug.c')
-rw-r--r--bgpd/bgp_debug.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/bgpd/bgp_debug.c b/bgpd/bgp_debug.c
index 49003e942..0993d6de5 100644
--- a/bgpd/bgp_debug.c
+++ b/bgpd/bgp_debug.c
@@ -49,6 +49,7 @@
#include "bgpd/bgp_evpn_vty.h"
#include "bgpd/bgp_vty.h"
#include "bgpd/bgp_flowspec.h"
+#include "bgpd/bgp_packet.h"
unsigned long conf_bgp_debug_as4;
unsigned long conf_bgp_debug_neighbor_events;
@@ -168,6 +169,7 @@ static const struct message bgp_notify_cease_msg[] = {
{BGP_NOTIFY_CEASE_COLLISION_RESOLUTION,
"/Connection Collision Resolution"},
{BGP_NOTIFY_CEASE_OUT_OF_RESOURCE, "/Out of Resources"},
+ {BGP_NOTIFY_CEASE_HARD_RESET, "/Hard Reset"},
{0}};
static const struct message bgp_notify_route_refresh_msg[] = {
@@ -520,7 +522,7 @@ const char *bgp_notify_admin_message(char *buf, size_t bufsz, uint8_t *data,
/* dump notify packet */
void bgp_notify_print(struct peer *peer, struct bgp_notify *bgp_notify,
- const char *direct)
+ const char *direct, bool hard_reset)
{
const char *subcode_str;
const char *code_str;
@@ -544,7 +546,8 @@ void bgp_notify_print(struct peer *peer, struct bgp_notify *bgp_notify,
if (msg_str) {
zlog_info(
- "%%NOTIFICATION: %s neighbor %s %d/%d (%s%s) \"%s\"",
+ "%%NOTIFICATION%s: %s neighbor %s %d/%d (%s%s) \"%s\"",
+ hard_reset ? "(Hard Reset)" : "",
strcmp(direct, "received") == 0
? "received from"
: "sent to",
@@ -554,7 +557,8 @@ void bgp_notify_print(struct peer *peer, struct bgp_notify *bgp_notify,
} else {
msg_str = bgp_notify->data ? bgp_notify->data : "";
zlog_info(
- "%%NOTIFICATION: %s neighbor %s %d/%d (%s%s) %d bytes %s",
+ "%%NOTIFICATION%s: %s neighbor %s %d/%d (%s%s) %d bytes %s",
+ hard_reset ? "(Hard Reset)" : "",
strcmp(direct, "received") == 0
? "received from"
: "sent to",