15.2. The MIB Skeleton: mib2c

Net-SNMP kindly provides a utility that can read an MIB file and produce skeleton code for an agent extension. Later in this chapter, we'll show you how to flesh out this skeleton into a complete implementation of your MIB.


Net-SNMP provides multiple output code styles for mib2c; we will be using the older UCD-SNMP code style. The newer, so-called "MIB for Dummies" style is not what this chapter describes. We have chosen to use the older style because it's sufficient for our needs (and it's also where our experience lies).

Before we can run mib2c, you'll need to install the SNMP Perl module, which is provided in the Net-SNMP tarball. When you ran make earlier, it decompressed this tarball and created the directory ...

Get Linux Appliance Design now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.