2023-02-08 13:17:09 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2002-12-13 21:15:29 +01:00
|
|
|
/* BGP4 SNMP support
|
2017-05-13 10:25:29 +02:00
|
|
|
* Copyright (C) 1999, 2000 Kunihiro Ishiguro
|
|
|
|
*/
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
#include <zebra.h>
|
|
|
|
|
2003-03-18 01:03:05 +01:00
|
|
|
#include <net-snmp/net-snmp-config.h>
|
2008-05-13 20:03:32 +02:00
|
|
|
#include <net-snmp/net-snmp-includes.h>
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
#include "if.h"
|
|
|
|
#include "log.h"
|
|
|
|
#include "prefix.h"
|
|
|
|
#include "command.h"
|
2022-02-28 16:40:31 +01:00
|
|
|
#include "event.h"
|
2002-12-13 21:15:29 +01:00
|
|
|
#include "smux.h"
|
2016-01-07 16:03:01 +01:00
|
|
|
#include "filter.h"
|
2016-06-12 17:52:50 +02:00
|
|
|
#include "hook.h"
|
|
|
|
#include "libfrr.h"
|
2021-04-21 11:19:39 +02:00
|
|
|
#include "lib/version.h"
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
#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"
|
2022-11-13 20:57:22 +01:00
|
|
|
#include "bgpd/bgp_snmp.h"
|
|
|
|
#include "bgpd/bgp_snmp_bgp4.h"
|
|
|
|
#include "bgpd/bgp_snmp_bgp4v2.h"
|
2020-09-18 11:24:22 +02:00
|
|
|
#include "bgpd/bgp_mplsvpn_snmp.h"
|
2014-06-04 06:53:35 +02:00
|
|
|
|
2023-03-07 20:14:41 +01:00
|
|
|
static int bgp_snmp_init(struct event_loop *tm)
|
2016-06-12 17:52:50 +02:00
|
|
|
{
|
|
|
|
smux_init(tm);
|
2022-11-13 20:57:22 +01:00
|
|
|
bgp_snmp_bgp4_init(tm);
|
|
|
|
bgp_snmp_bgp4v2_init(tm);
|
2020-09-18 11:24:22 +02:00
|
|
|
bgp_mpls_l3vpn_module_init();
|
2016-06-12 17:52:50 +02:00
|
|
|
return 0;
|
|
|
|
}
|
2016-06-12 17:32:23 +02:00
|
|
|
|
2016-06-12 17:52:50 +02:00
|
|
|
static int bgp_snmp_module_init(void)
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
2019-08-09 19:53:01 +02:00
|
|
|
hook_register(peer_status_changed, bgpTrapEstablished);
|
2016-06-12 17:32:23 +02:00
|
|
|
hook_register(peer_backward_transition, bgpTrapBackwardTransition);
|
2016-06-12 17:52:50 +02:00
|
|
|
hook_register(frr_late_init, bgp_snmp_init);
|
|
|
|
return 0;
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
2016-06-12 17:52:50 +02:00
|
|
|
|
|
|
|
FRR_MODULE_SETUP(.name = "bgpd_snmp", .version = FRR_VERSION,
|
|
|
|
.description = "bgpd AgentX SNMP module",
|
|
|
|
.init = bgp_snmp_module_init,
|
2021-02-21 07:07:15 +01:00
|
|
|
);
|