For each SNMP table defined in the MIB, mibgen generates:
A class containing the SNMP view of the table.
A skeletal MBean representing a table entry, with it's interface.
A metadata file corresponding to the skeletal MBean.
This class contains all the management of the table index. The class is also prefixed with Table followed by the name of the table.
For each table in a MIB, mibgen generates an MBean representing a table entry. These skeletal MBeans need to be completed by adding implementation specific code (access methods). The generated code is initialized with default values for table entry fields. Therefore, if you compile the generated code directly, you will obtain a running agent. In this case, values returned by the agent when querying the MIBs will not be meaningful.
MBeans generated from table entries are named using the entry names specified in the MIB definition.
In addition to generating skeletal MBeans to represent each table entry, mibgen generates a Java file containing the SNMP view of the MBean. Metadata files do not need to be modified. For metadata files, the Meta suffix is added.
The mibgen compiler generates a specific class for each enumerated type defined in the MIB. This class contains all the possible values defined in the enumerated type. The generated class extends the generic class Enumerated, defined in the com.sun.jdmk package. The HTML adaptor is able to use the Enumerated class to display all the labels contained in an enumeration. The mibgen tool is able to handle enumerated types defined as part of a type definition or in-line definition.
Generated code representing SNMP enumerated types is prefixed with Enum followed by the type name or the variable name for in-line definition.
The mibgen tool has an option -p <prefix> that allows you to prefix the names of all generated files with a specific string.
For example, in MIB II, TCP connection states are represented by an enumeration containing all the possible states for a TCP connection. The mibgen tool generates a Java class named EnumTcpConnState to represent the enumeration.