bernat at luffy
May 24, 2012, 1:56 AM
[RFC] AgentX support for Quagga
Here is a serie of patches adding AgentX support to Quagga.
The first patch is not related to AgentX support. It just fixes Quagge
compilation when using a separate build directory.
The second patch removes some cruft left from a migration from
UCD-SNMP (I think). This is just a small cleanup.
The third patch makes use of "net-snmp-config" in place of linking to
-lnetsnmp. It removes explicit link to -lcrypto. If needed, this will
be added by "net-snmp-config". "net-snmp-config" exists since at least
The fourth patch separates SMUX specific stuff from generic SNMP
stuff. smux.h now only contains the interface to SMUX for the
daemons. Everything else has been moved to smux.c. The idea is for
another SNMP implementation to provide the appropriate smux_*
functions. snmp.c is a new file containing oid_* functions (they are
independant of the SNMP implementation).
The last patch adds AgentX support by providing the appropriate smux_*
functions. This patch does not modify daemons. Because Net-SNMP hides
its internals, it is not possible to disable AgentX support once
enabled. This should not be a problem, because, like with SMUX, the
commands are not exported to vtysh and therefore, I suppose there is
no way to call "no agentx".
Also, the event loop is modified (in thread.c). NetSNMP hides the
appropriate file descriptors and timers.
The documentation has not been updated. This should be easy enough
once I am done with the other details.
The big problem now is traps. Currently, I do not send any trap with
AgentX. The SMUX implementation only sends SNMPv1 traps using the SMUX
peer OID as an enterprise OID. I think this is not the right way to do
it. Both OSPF-MIB (through OSPF-TRAP-MIB) and BGP-MIB defines
notifications. A notification is some kind of SNMPv2 TRAP. Let me
explain. With a SNMPv1 trap, you have: an enterprise OID, a generic
trap code (always 6 in our case) and a specific trap code. With a
notification, all those are replaced by a snmptrap OID.
It is possible to transform SNMPv1 trap to SNMPv2 trap and
vice-versa. However, if I just do this, I will continue to use
inappropriate enterprise OID (the SMUX peer OID). I should use the
appropriate notification objects, as defined in MIB.
My first proposition was to change smux_trap() signature to include
the appropriate enterprise OID (used to build snmp trap OID). Then, I
will also update the SMUX implementation. There are two drawbacks:
- daemons maintained outside of Quagga will also need to update (if
they use traps)
- people receiving traps will need to update their configuration to
use the correct OID instead of the previous ones.
Another proposition will be to just keep the SMUX peer OID. People may
change it to the appropriate value (since I will not use it as a SMUX
peer OID) to get correct snmp trap OID. For BGP and OSPF, this will
work because all traps are rooted at the same OID. I can however
provide a "smux_inform()" function allowing to override the enterprise
Any though? And any comment on the patches in general?
Quagga-dev mailing list
Quagga-dev [at] lists