Difference between revisions of "Template:FAQ:Coding 11"

From Net-SNMP Wiki
Jump to: navigation, search
(5.4 release synchronisation)
m (Latest FAQ revision - preparing for 5.5 release)
 
Line 18: Line 18:
 
used by <CODE>snmptrapd</CODE> to log incoming traps.
 
used by <CODE>snmptrapd</CODE> to log incoming traps.
  
The basic iterator handler is used in a number of modules, such
+
The basic iterator handler is used in  
as the TCP and UDP table implementations (<CODE>mibII/tcpTable &
+
the TCP and UDP table implementations (<CODE>mibII/tcpTable &
 
mibII/udpTable</CODE>), VACM context handling (<CODE>mibII/vacm_context</CODE>) and
 
mibII/udpTable</CODE>), VACM context handling (<CODE>mibII/vacm_context</CODE>) and
 
various tables relating to agent internals (<CODE>agent/*</CODE>).
 
various tables relating to agent internals (<CODE>agent/*</CODE>).
Line 29: Line 29:
 
contrast between the iterator and iterator_access helpers.
 
contrast between the iterator and iterator_access helpers.
  
There are an ever-increasing number of examples based on the
+
There are several examples based on the
 
MfD framework (see <CODE>{if,ip,tcp,udp}-mib/</CODE>).  Much of this
 
MfD framework (see <CODE>{if,ip,tcp,udp}-mib/</CODE>).  Much of this
 
code is not intended to be viewed directly, but individual files
 
code is not intended to be viewed directly, but individual files

Latest revision as of 19:45, 20 July 2009

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/