Home
You are not currently signed in.

MIB Smithy

  1. Up to Table of Contents

Compiling MIB Files and Modules

A MIB Compiler is an application that performs some degree of validation of a specified MIB Module (checking such things as type usage, consistent size/range refinements and undefined symbols), and translates the MIB from its normal ASN.1 format to a format that is easier for other applications to interpret.

Some compilers (typically those that accompany SNMP Agent Development Libraries), rather than simply reformatting the MIB Modules into an easier parse format, output source code templates to be edited, compiled, and linked to the development libraries. Such "source code generators" accelerate development time by automating those parts of a project necessary to make the agent aware of the objects in a MIB and handle SNMP requests on those objects, leaving to the developer the task of implementing the object-specific semantics detailed in the MIB specification.

The extent to which a MIB is validated in this process varies between implementations, as does the output format. MIB Smithy, for example, performs over 560 individual checks for nearly every aspect of a MIB design, including cross-checking types and usage between multiple modules that reference one another, as well as use of technically valid features of ASN.1 or the SMI that are known to be unsupported or problematic for other MIB compilers or tools.

MIB Smithy's compiler has built-in support for compiling to an extended version of the MOSY (.defs file) format . MOSY started as freely available MIB compiler that is in used and supported by a variety of applications and compilers; however, the common implementation's validation of MIB modules is fairly limited, and it does not do any cross-checking between MIB modules. Using MIB Smithy in place of MOSY allows you to perform much more extensive checks on your MIB modules while still being compatible with applications that use the MOSY format .

MIB Smithy Professional also allows development of custom output formats using the APIs provided by MIB Smithy SDK. These can be used for compiling to virtually any format desired, including custom source code generation.

Validating MIB Files/Modules

MIB Smithy provides interfaces for validating MIB modules on a per-file or per-project bases, where each file may contain one or more MIB modules and each project typically contains all MIB modules supported by a particular device, and any dependencies (IMPORTS) they may have. MIB Smithy is capable of compiling and validating modules with or without all dependencies present. If dependencies are present, they are fully validated and cross-checked; however, warnings will be issued for any dependencies that are not present. To be completely sure your MIB modules are valid, you should be sure to have all dependencies loaded into the project at validation time.

The Build Settings dialog can also be used to configure which files are only dependencies, which are present in the project only for the purpose of fully validating your main MIB module(s), but for which no compiler output (other than any error and warning messages) is desired.

To validate a single MIB file or module:

Select the file or module using the Project Tree. Then, either use the iconValidate item in the Build Menu or click on the iconValidate button in the Toolbar.

To validate all MIB files/modules in the project:

Either use the iconValidate All item in the Build Menu or click on the iconValidate All button in the Toolbar. Each file will be validated in the order it appears in the Project Tree.

Compiling MIB Files/Modules

Compiling MIB Files and Modules is very similar to validating MIB Files and Modules. When you compile a file or module with MIB Smithy, it will first automatically validate the file using the same methods and features as validating only. If validation for a particular file fails due to one or more errors, then compiling also fails and no output file is generated.

If any one of several modules in an individual file fail the validation phase, no output will be generated for any module in that file. It will not, however, prevent the output of other modules in other files that are validated successfully. If validation is successful, then MIB Smithy will generate output according to the output format and directories configured in the Build Settings dialog.

The default build settings create one or more MOSY format .defs files containing "condensed" versions of the MIB modules that are easier for programmers to write parsers for. The output file name is is the same as the name of the module compiled, with a '.defs' extension added. Thus, for example, compiling rfc2579.mib containing module SNMPv2-TC results in a file named 'SNMPv2-TC.defs'.

To compile a single MIB file or module:

Select the file or module using the Project Tree. Then, either use the iconCompile item in the Build Menu, click on the iconCompile button in the Toolbar, or right-click on the file in the Project Tree and select 'Compile'.

To compile all MIB files/modules in the project:

Either use the iconBuild or Rebuild All items in the Build Menu or click on the iconBuild button in the Toolbar. Each file will be validated and compiled in the order it appears in the Project Tree.

  1. Up to Table of Contents