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

Global declarations

Next, your peer program will have to declare this global variable in the foomib.c file:

    char   *myname = "foosmuxd";
replacing the string ``foo'' with the identifying string you chose for your peer.

Now, for each MIB module managed by this peer, put one entry in the triples[] table. In this example, there is only the one foo MIB module for the sake of simplicity. init_foo and sync_foo are functions implemented in this file for the foo MIB module.

    int init_foo(), sync_foo();

struct triple triples[] = { {"foo", NULL, readWrite, init_foo, sync_foo}, {NULL} };

Then, for each single instance leaf object in your MIB, create a variable with the same name. Use the appropriate C data type. If the variable is read-write, also make a ``new_name'' variable of the same data type. The ``new_name'' is used by the SMUX peer to implement an SMUX ``commit'' or ``rollback'' SOutPDU.
   static char             *productName;
   static int              boardStatus;
   static int              new_boardStatus;
   static struct in_addr	exampleIpAddr;
   static struct in_addr	new_exampleIpAddr;
   static int	        newflag_exampleIpAddr;
   static OID              exampleObjectID;
   static OID              new_exampleObjectID;
   static int              numberLines;
Next, create a structure for each table in your MIB. For each element of the structure use the same name as in the MIB. Use the appropriate C data type. If the variable is read-write, also make a ``new_name'' variable of the same data type. The ``new_name'' is used by the peer to implement an SMUX ``commit'' or ``rollback'' SOutPDU.
    struct sltable {
  	 int             serialLineNumber;
  	 int             serialLineBaudRate;
  	 int             new_serialLineBaudRate;
  	 char            serialLineTermLocation[LOCATIONSIZE];
  	 char            new_serialLineTermLocation[LOCATIONSIZE];
  	 int             newflag_serialLineTermLocation;
    }                serialLineTable[MAXTABLESIZE];

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004