From 83ca9a605eb51b675fa19247acf23e93c7abf590 Mon Sep 17 00:00:00 2001 From: Francois Dumontet Date: Tue, 29 Aug 2023 17:53:26 +0200 Subject: bgpd: add [no] bgp snmp traps rfc4273 command There is no cli command to prevent the router to send traps implemented in the rfc4273. If not done, when introducing the traps from bgp4v2mib, traps will be send for each of the two mibs: there will be redundancy in the sent information. Add a new command: - [no] bgp snmp traps rfc4273 Using this command will allow or not the notification of the following traps: - bgpEstablishedNotification - bgpBackwardTransNotification Signed-off-by: Francois Dumontet --- bgpd/bgp_vty.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'bgpd/bgp_vty.c') diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 8144d6e7b..49213bcfb 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -128,6 +128,7 @@ DEFINE_HOOK(bgp_inst_config_write, (bgp, vty)); DEFINE_HOOK(bgp_snmp_update_last_changed, (struct bgp *bgp), (bgp)); DEFINE_HOOK(bgp_snmp_init_stats, (struct bgp *bgp), (bgp)); +DEFINE_HOOK(bgp_snmp_traps_config_write, (struct vty * vty), (vty)); static struct peer_group *listen_range_exists(struct bgp *bgp, struct prefix *range, int exact); @@ -18477,6 +18478,8 @@ int bgp_config_write(struct vty *vty) safi_t safi; uint32_t tovpn_sid_index = 0; + hook_call(bgp_snmp_traps_config_write, vty); + if (bm->rmap_update_timer != RMAP_DEFAULT_UPDATE_TIMER) vty_out(vty, "bgp route-map delay-timer %u\n", bm->rmap_update_timer); -- cgit v1.2.3