SNMP Subagent Programmer's Guide
Indexed Trap Generator
2-58 119728—SNMP Subagent Programmer’s Guide
Programming Tutorials
MIB
Example 2-12 shows the MIB definition used by Indexed Trap Generator. The MIB 
defines these objects:
tblTrapCards The number of cards for which entries exist in the table. The 
value for this object is maintained in a field named card_count of 
a structure named “master.”  A manager has read-only access to 
the value of this object.
tblTrapPorts The maximum number of ports associated with any card having 
an entry in the table.  The value for this object is maintained in a 
field named port_count of the “master” structure. This object is 
assigned read-only access.
tblTrapTable The table. It contains an entry for each port of each card.
tblTrapTableEntry A table entry, which contains three objects: cardNumber, 
portNumber, and ratio. Two of the objects, cardNumber and 
portNumber, constitute the index. Note that the next function, 
next_entry(), is named in the INDEX clause. The locator 
function, locate_entry(), is named in the definition of each object 
in the entry. All the entry objects have read-only access.
cardNumber A card number, a value stored in a field named “card” of a 
structure named “mytable.” 
portNumber A port number associated with a particular card, stored in a field 
named “port” of the “mytable” structure.
ratio The computed ratio between the values of cardNumber and 
portNumber.
tableTrap The trap, which contains the values associated with a particular 
entry: cardNumber, portNumber, and ratio.
Example 2-12. Indexed Trap Generator MIB Definition (page 1 of 3)
#include "typessmi"
TBL-TRAP DEFINITIONS ::= BEGIN
-- tblTrap - MIB for sample program illustrating generation of TRAPs
-- for indexed MIB variables
 private OBJECT IDENTIFIER ::= { iso(1) org(3) dod(6) internet(1) 4 }
 enterprises OBJECT IDENTIFIER ::= { private 1 }
 peer OBJECT IDENTIFIER ::= { enterprises 442 }
--Within the 'peer' arc, entire subtrees are dedicated to the following
 peer-products OBJECT IDENTIFIER ::= { peer 1 }
 peer-demos OBJECT IDENTIFIER ::= { peer 2 }










