The demo_module_1 code example is provided to help you understand how to modify the code generated by the mib2c command to perform a scalar data retrieval. The demo_module_1 code example is located by default in the directory /usr/demo/sma_snmp/demo_module_1.
The README_demo_module_1 file contains instructions that describe how to perform the following tasks:
Generate code templates from a MIB that contains scalar objects
Compile source files to generate a shared library object that implements a module
Set up the agent to dynamically load the module
Test the module with snmp commands to show that the module is functioning as expected
The demo_module_1 is set up to allow you to generate code templates me1LoadGroup.c and me1LoadGroup.h. You can then compare the generated files to the files demo_module_1.c and demo_module_1.h. The mib2c utility generates me1LoadGroup.c, which contains the init_me1LoadGroup() function. You should compare this function to the init_demo_module_1() function in the demo_module_1.c file.
The demo_module_1.c and demo_module_1.h files have been modified appropriately to retrieve scalar data. You can use these files as a model for learning how to work with scalar data in your own module. The instructions then explain how to compile the modified source files to create a functioning module.