Template:FAQ:Coding 11

From Net-SNMP Wiki
Revision as of 19:45, 20 July 2009 by Dts12 (Talk | contribs) (Latest FAQ revision - preparing for 5.5 release)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Many of the MIB modules shipped with the Net-SNMP agent still use the v4 "traditional" MIB module API, but an increasing number use one of the newer v5 helper-based handlers. All of these can be found under agent/mibgroup

The tdata helper is used in the new DisMan Event, Expression and Schedule MIB modules (see disman/{event,expr,schedule}/*). The similar dataset helper is used in the older DisMan Event MIB implementation (see disman/mteEvent*) and the Notification Log MIB (see notification-log-mib/*), used by snmptrapd to log incoming traps.

The basic iterator handler is used in the 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.

There are several examples based on the MfD framework (see {if,ip,tcp,udp}-mib/). Much of this code is not intended to be viewed directly, but individual files are clearly commented to distinguish between internal implementation and public code.

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/