Implementing an SMUX peer
In the previous section,
we described the interaction between a management station,
an SNMP agent and an SMUX
peer, and discussed how the SMUX protocol works.
This section describes the tasks required to implement
an SMUX peer:
-
defining and (optionally) compiling MIB modules
-
making #define statements
-
declaring global variables
-
writing the ``get'' and ``set'' functions
-
compiling, executing, and testing the program
The SMUX API contains a reference
peer called foosmuxd
which you can modify for your SMUX peer.
foosmuxd is a ``dummy'' peer, in that it
pretends to manage an imaginary multi-port serial board;
because the serial board doesn't actually exist,
foosmuxd ``gets'' hard-coded data.
If your peer needs to communicate with
a device or to read/write a file in order to manage the device,
you have to add this capability to foosmuxd.
If you are developing your own peer, you should replace
all occurrences of the string ``foo'' with your company name or
some string which uniquely describes your peer.
The foo SMUX
peer daemon is implemented with the following five files:
-
The foo MIB module is described in this file
in concise MIB format.
This MIB module is a simplified one that pretends
to be for a multi-port serial board;
a real MIB module would be much larger.
This is the input file for the MIB
compiler mosy.
If you are writing your own MIB
module you must modify this file.
-
This file implements the foo
MIB module.
It contains functions which
allow the MIB objects to be read and written.
If you are writing your own peer you must modify this file.
-
This file contains the
SMUX
peer main() function and the infinite
loop of the daemon. The data structures and functions in foomib.c
are used by the code in this file.
If you are writing your own
SMUX
peer you will probably not need
to modify this file.
-
This is the make file for the foo
SMUX
peer daemon.
If you are writing your own
SMUX
peer you will need to modify
this file to refer to your files instead of the ``foo'' files.
-
This is a header filed used by foomib.c and foosmuxd.c.
You will only need to modify this file if you wish to define
enterprise-specific traps. See the sections
``Peer sends trap to agent''
and
``Generating traps''
for more information.
Next topic:
MIB modules
Previous topic:
Terminating an SMUX association
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003