SourceForge.net Logo

org.netsnmp
Class MIB

java.lang.Object
  |
  +--org.netsnmp.MIB

public class MIB
extends Object

Handling class for loading MIB modules and translating text descriptions into OIDs. Methods here roughly correspond to those found in the netsnmp mib_api. (see man(3) mib_api) By default the following modules are read at startup:

 IP-MIB, IF-MIB, TCP-MIB, UDP-MIB, SNMPv2-MIB, RFC1213-MIB, UCD-SNMP-MIB
 

Author:
Andrew E. Page aepage@users.sourceforge.net

Nested Class Summary
static class MIB.leaf
           
 
Method Summary
static int addMIBDir(String dir)
          add a directory to search for mib modules.
static MIB.leaf findLeaf(MIB.leaf[] leaves, int id)
           
static MIB.leaf[] findLeaves(OID oid)
           
static void readMIB(String fname)
          Reads and parses a new MIB file, making the definitions within available for lookup.
static void readModule(String module)
          Reads and parses a MIB module
static OID readObjID(String descriptor)
          looks up and translates the text description
static OID readObjIDOrAbort(String descriptor)
          looks up a MIB or aborts.
static MIB.leaf[] treeHead()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addMIBDir

public static int addMIBDir(String dir)
add a directory to search for mib modules. NOTE: does not load any files or modules.

Returns:
number of files found in directory

findLeaf

public static MIB.leaf findLeaf(MIB.leaf[] leaves,
                                int id)
                         throws MIBItemNotFound
MIBItemNotFound

findLeaves

public static MIB.leaf[] findLeaves(OID oid)
                             throws MIBItemNotFound
MIBItemNotFound

readMIB

public static void readMIB(String fname)
                    throws FileNotFoundException
Reads and parses a new MIB file, making the definitions within available for lookup.

Parameters:
fname - path name of the file read
FileNotFoundException

readModule

public static void readModule(String module)
Reads and parses a MIB module

Parameters:
module - of the module to be parsed

readObjID

public static OID readObjID(String descriptor)
                     throws MIBItemNotFound
looks up and translates the text description

MIBItemNotFound

readObjIDOrAbort

public static OID readObjIDOrAbort(String descriptor)
looks up a MIB or aborts. Recommended use is for static initializers.


treeHead

public static MIB.leaf[] treeHead()

SourceForge.net Logo