DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Developing SMUX peers for SNMP agents

#define statements

Whether or not you choose to compile your MIB module, the next step is to modify the file foomib.c by adding the appropriate #define statements. This file is a collection of data and functions to implement a MIB module for the peer. If you compiled the MIB module by executing the make command on it, you can use your version of foosmuxd.defs as a reference when making these modifications.

Begin by modifying all occurrences of the string ``foo'' to the identifying string you chose for your peer.

Then, for every leaf object ID in your MIB module, create a #define with the same name and set the value equal to the last octet of the object ID. In foomib.c the upper case #define convention is followed. The following #define statements are for the leaves of the enterprises.foo.serialBoard MIB module:

    #define    PRODUCTNAME     1    /* serialBoard.1 */
    #define    BOARDSTATUS     2    /* serialBoard.2 */
    #define    EXAMPLEIPADDR   3    /* serialBoard.3 */
    #define    EXAMPLEOBJECTID 4    /* serialBoard.4 */
    #define    NUMBERLINES     5    /* serialBoard.5 */
The three #define statements shown below are for the leaves of the enterprises.foo.serialBoard.serialLineTable.serialLineEntry MIB module:
    #define    SERIALLINENUMBER       1    /* serialLineEntry.1 */
    #define    SERIALLINEBAUDRATE     2    /* serialLineEntry.2 */
    #define    SERIALLINETERMLOCATION 3    /* serialLineEntry.3 */
Now, for each label that is associated with an object type, create a #define to represent the same value as shown in your MIB module. The following #define statements are for boardStatus and serialLineStatus:
    #define ENABLED     1
    #define DISABLED    2
The following #defines are for serialLineBaudRate:
    #define BAUD1200   1
    #define BAUD2400   2
    #define BAUD9600   3
    #define BAUD19800  4
This #define is for the maximum size of the serialLineTable:
    #define MAXTABLESIZE    64

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005