This is a discussion on MIB Coding - SNMP ; I have created this small MIB just for testing. The MIB is such as follows: MY-PER-MIB DEFINITIONS ::= BEGIN IMPORTS MODULE-IDENTITY, OBJECT-TYPE Integer32 FROM SNMPv2-SMI DisplayString FROM SNMPv2-TC; personal OBJECT IDENTIFIER ::= { enterprises 5555 } myPerMIB MODULE-IDENTITY LAST-UPDATED "9912090000Z" ...
I have created this small MIB just for testing. The MIB is such as
follows:
MY-PER-MIB DEFINITIONS ::= BEGIN
IMPORTS
MODULE-IDENTITY, OBJECT-TYPE
Integer32 FROM SNMPv2-SMI
DisplayString FROM SNMPv2-TC;
personal OBJECT IDENTIFIER ::= { enterprises 5555 }
myPerMIB MODULE-IDENTITY
LAST-UPDATED "9912090000Z"
ORGANIZATION "My personal MIB"
CONTACT-INFO
"Contact ME
"
DESCRIPTION
"Personal"
REVISION "9912090000Z"
DESCRIPTION
"SMIv2 version converted from older MIB definitions."
::= { personal 8888 }
myPerMIBobjects OBJECT IDENTIFIER ::= { myPerMIB 1 }
sandbox OBJECT IDENTIFIER ::= { myPerMIBobjects 1 }
sandboxA OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Object 1"
::= { sandbox 1 }
sandboxB OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Object 2"
::= { sandbox 2 }
END
I have been able to use mib2c to get the corresponding .c and .h
template files. What I want to ask is that under sandnoxA can I use
simple C codes such as this:
....
....
case SANDBOXA:
printf("\nHi, you r now using sandboxA");
....
....
in the myPerMIB.c file. And how can I use the .c files along with the
MIB file so that I can use the MIB file to get the corresponding
output from the c file.
Dave, plase help me regarding this.
Thank you.