Template:FAQ:Coding 11
Most of the MIB modules shipped with the Net-SNMP agent still use the v4 "traditional" MIB module API, but a few use one of the newer v5 helper-based handlers.
The dataset handler is used in the two DISMAN-EVENT-MIB modules
(disman/mteEventTable
and disman/mteEventNotificationTable
), as
well as the 'snmptrapd'
implementation of logging incoming traps
(apps/notification_log
)
The basic iterator handler is used in a number of modules, such
as the latest TCP and UDP table implementations (mibII/tcpTable &
mibII/udpTable
), VACM context handling (mibII/vacm_context
) and
various tables relating to agent internals (agent/*
). These show
a number of different approaches to using the iterator helper, so
it's worth comparing them.
The two examples/netSnmpHostsTable*
modules provide a contrast
between the iterator and iterator_access helpers.
The Net-SNMP agent does not currently include any MIB modules
using the array-user
container-based helper. The best examples
of this are to be found in the net-policy project.
See http://net-policy.sourceforge.net/