]> git.proxmox.com Git - mirror_frr.git/blob - bgpd/bgp_snmp.c
Merge pull request #12339 from anlancs/fix/bgpd-null-show
[mirror_frr.git] / bgpd / bgp_snmp.c
1 /* BGP4 SNMP support
2 * Copyright (C) 1999, 2000 Kunihiro Ishiguro
3 *
4 * This file is part of GNU Zebra.
5 *
6 * GNU Zebra is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2, or (at your option) any
9 * later version.
10 *
11 * GNU Zebra is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include <zebra.h>
22
23 #include <net-snmp/net-snmp-config.h>
24 #include <net-snmp/net-snmp-includes.h>
25
26 #include "if.h"
27 #include "log.h"
28 #include "prefix.h"
29 #include "command.h"
30 #include "thread.h"
31 #include "smux.h"
32 #include "filter.h"
33 #include "hook.h"
34 #include "libfrr.h"
35 #include "lib/version.h"
36
37 #include "bgpd/bgpd.h"
38 #include "bgpd/bgp_table.h"
39 #include "bgpd/bgp_aspath.h"
40 #include "bgpd/bgp_attr.h"
41 #include "bgpd/bgp_route.h"
42 #include "bgpd/bgp_fsm.h"
43 #include "bgpd/bgp_snmp.h"
44 #include "bgpd/bgp_snmp_bgp4.h"
45 #include "bgpd/bgp_snmp_bgp4v2.h"
46 #include "bgpd/bgp_mplsvpn_snmp.h"
47
48 static int bgp_snmp_init(struct thread_master *tm)
49 {
50 smux_init(tm);
51 bgp_snmp_bgp4_init(tm);
52 bgp_snmp_bgp4v2_init(tm);
53 bgp_mpls_l3vpn_module_init();
54 return 0;
55 }
56
57 static int bgp_snmp_module_init(void)
58 {
59 hook_register(peer_status_changed, bgpTrapEstablished);
60 hook_register(peer_backward_transition, bgpTrapBackwardTransition);
61 hook_register(frr_late_init, bgp_snmp_init);
62 return 0;
63 }
64
65 FRR_MODULE_SETUP(.name = "bgpd_snmp", .version = FRR_VERSION,
66 .description = "bgpd AgentX SNMP module",
67 .init = bgp_snmp_module_init,
68 );