O'Reilly logo

Practical VoIP Using VOCAL by Luan Dang, Cullen Jennings, David Kelly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating New Agent Code

This section explains how to work with your code.

Agent Extensibility

The agent that comes with this package is extensible through use of shell scripts and other methods. See the configuration manual pages (like SNMPd.conf) and the EXAMPLE.conf file for details.

You can also extend the agent by writing C code directly. The agent is extremely modular in nature and you need only create new files, reconfigure, and recompile. No modifications of the distributed source files are necessary. For details on how to go about this, see: http://www.csc.liv.ac.uk/~daves/Misc/UCD/guide.html, agent/mibgroup/examples/example.c, and agent/mibgroup/examples/example.h. Also, see the local/mib2c program and its readme file for help in turning a textual MIB description into a C code template.

example.h: Interface Information

The following are the requirements for the example.h file:

  • Declaration of the initialization function init_example (optional).

  • Declaration of the function(s) for retrieving variable information (var_example).

  • Declaration of the function(s) for setting variable information (if appropriate).

  • Declaration of the function(s) for parsing the SNMPd.conf file (optional).

  • A call to config_parse_dot_conf() to explain to the .conf parser which tokens we want to parse (optional).

  • Definitions of the MIB group magic numbers declarations of the public functions.

  • A list of the variables in the group, including type information, mapping between magic numbers and OID subidentifiers within ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required