From 4a500725a1d9155c580ba15129c7856c832d60eb Mon Sep 17 00:00:00 2001 From: Vojtech Vilimek Date: Wed, 21 Aug 2024 11:31:24 +0200 Subject: [PATCH] SNMP The BIRD protocol SNMP makes it possible to retrieve management information through SNMP. This is accomplished by implementing AgentX protocol. The BIRD acts as an AgentX subagent, registers to master agent and provides management information. Master agent handles SNMP communication and forwards request to registered subagents. You will therefore need an additional component -- a SNMP daemon capable of acting as AgentX master agent. In theory, the information consumer don't have to support SNMP and could be very simple master agent for logging/monitoring the BIRD state. For more detail see provided documentation. This commit is squashed version of development history. Full development history could be found on branch `proto-snmp'. --- configure.ac | 2 +- doc/bird.sgml | 352 +++++++ doc/snmp.conf.example | 5 + doc/snmpd.conf.example | 18 + nest/protocol.h | 7 +- proto/Doc | 1 + proto/snmp/Doc | 5 + proto/snmp/Makefile | 8 + proto/snmp/bgp4_mib.c | 1009 ++++++++++++++++++++ proto/snmp/bgp4_mib.h | 97 ++ proto/snmp/config.Y | 171 ++++ proto/snmp/mib_tree.c | 877 +++++++++++++++++ proto/snmp/mib_tree.h | 122 +++ proto/snmp/snmp.c | 686 ++++++++++++++ proto/snmp/snmp.h | 174 ++++ proto/snmp/snmp_test.c | 1965 +++++++++++++++++++++++++++++++++++++++ proto/snmp/snmp_utils.c | 972 +++++++++++++++++++ proto/snmp/snmp_utils.h | 127 +++ proto/snmp/subagent.c | 1426 ++++++++++++++++++++++++++++ proto/snmp/subagent.h | 359 +++++++ 20 files changed, 8379 insertions(+), 4 deletions(-) create mode 100644 doc/snmp.conf.example create mode 100644 doc/snmpd.conf.example create mode 100644 proto/snmp/Doc create mode 100644 proto/snmp/Makefile create mode 100644 proto/snmp/bgp4_mib.c create mode 100644 proto/snmp/bgp4_mib.h create mode 100644 proto/snmp/config.Y create mode 100644 proto/snmp/mib_tree.c create mode 100644 proto/snmp/mib_tree.h create mode 100644 proto/snmp/snmp.c create mode 100644 proto/snmp/snmp.h create mode 100644 proto/snmp/snmp_test.c create mode 100644 proto/snmp/snmp_utils.c create mode 100644 proto/snmp/snmp_utils.h create mode 100644 proto/snmp/subagent.c create mode 100644 proto/snmp/subagent.h diff --git a/configure.ac b/configure.ac index 0ed4d2d7..65bbd20b 100644 --- a/configure.ac +++ b/configure.ac @@ -312,7 +312,7 @@ if test "$enable_mpls_kernel" != no ; then fi fi -all_protocols="aggregator $proto_bfd babel bgp l3vpn mrt ospf perf pipe radv rip rpki static" +all_protocols="aggregator $proto_bfd babel bgp l3vpn mrt ospf perf pipe radv rip rpki snmp static" all_protocols=`echo $all_protocols | sed 's/ /,/g'` diff --git a/doc/bird.sgml b/doc/bird.sgml index e2050c13..954fc7ed 100644 --- a/doc/bird.sgml +++ b/doc/bird.sgml @@ -6198,6 +6198,358 @@ protocol static { } +SNMP +