summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_snmp.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-09 13:16:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-09 13:16:35 +0000
commite2bbf175a2184bd76f6c54ccf8456babeb1a46fc (patch)
treef0b76550d6e6f500ada964a3a4ee933a45e5a6f1 /bgpd/bgp_snmp.c
parentInitial commit. (diff)
downloadfrr-e2bbf175a2184bd76f6c54ccf8456babeb1a46fc.tar.xz
frr-e2bbf175a2184bd76f6c54ccf8456babeb1a46fc.zip
Adding upstream version 9.1.upstream/9.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'bgpd/bgp_snmp.c')
-rw-r--r--bgpd/bgp_snmp.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/bgpd/bgp_snmp.c b/bgpd/bgp_snmp.c
new file mode 100644
index 0000000..ce9442c
--- /dev/null
+++ b/bgpd/bgp_snmp.c
@@ -0,0 +1,53 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/* BGP4 SNMP support
+ * Copyright (C) 1999, 2000 Kunihiro Ishiguro
+ */
+
+#include <zebra.h>
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+
+#include "if.h"
+#include "log.h"
+#include "prefix.h"
+#include "command.h"
+#include "frrevent.h"
+#include "smux.h"
+#include "filter.h"
+#include "hook.h"
+#include "libfrr.h"
+#include "lib/version.h"
+
+#include "bgpd/bgpd.h"
+#include "bgpd/bgp_table.h"
+#include "bgpd/bgp_aspath.h"
+#include "bgpd/bgp_attr.h"
+#include "bgpd/bgp_route.h"
+#include "bgpd/bgp_fsm.h"
+#include "bgpd/bgp_snmp.h"
+#include "bgpd/bgp_snmp_bgp4.h"
+#include "bgpd/bgp_snmp_bgp4v2.h"
+#include "bgpd/bgp_mplsvpn_snmp.h"
+
+static int bgp_snmp_init(struct event_loop *tm)
+{
+ smux_init(tm);
+ bgp_snmp_bgp4_init(tm);
+ bgp_snmp_bgp4v2_init(tm);
+ bgp_mpls_l3vpn_module_init();
+ return 0;
+}
+
+static int bgp_snmp_module_init(void)
+{
+ hook_register(peer_status_changed, bgpTrapEstablished);
+ hook_register(peer_backward_transition, bgpTrapBackwardTransition);
+ hook_register(frr_late_init, bgp_snmp_init);
+ return 0;
+}
+
+FRR_MODULE_SETUP(.name = "bgpd_snmp", .version = FRR_VERSION,
+ .description = "bgpd AgentX SNMP module",
+ .init = bgp_snmp_module_init,
+);