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
|
|
|
|
*
|
|
|
|
* This file is part of GNU Zebra.
|
|
|
|
*
|
|
|
|
* GNU Zebra is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2, or (at your option) any
|
|
|
|
* later version.
|
|
|
|
*
|
|
|
|
* GNU Zebra is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; see the file COPYING; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
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"
|
|
|
|
#include "thread.h"
|
|
|
|
#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
|
|
|
|
2016-06-12 17:52:50 +02:00
|
|
|
static int bgp_snmp_init(struct thread_master *tm)
|
|
|
|
{
|
|
|
|
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
|
|
|
);
|