SNMP Subagent Programmer's Guide
Binding
5-2 119728—SNMP Subagent Programmer’s Guide
Creating Executable Subagents
Then invoke the C compiler. The following invocation line compiles the Hello World
source code in helloc into a file named helloo:
c /in helloc, out $s.#cc.hello/ helloo; &
ssv0 "$system.system", &
ssv1 "zsnmpsdk", &
ssv2 "[#defaults/current/]", &
wide
The OUT option names a spooler destination for the compiler listing. The SSV pragmas
provide a list of search subvolumes for files specified in include directives. The WIDE
pragma instructs the compiler to use the wide-data model; always specify this pragma
when compiling subagent source files.
When your subagent source code is in multiple files, you can merge the files at compile
time by using the include directive. The System Time Manager sample subagent merges
the access functions defined in accessfc with the main program in systimec in this
fashion. Alternatively, you can compile subagent source files separately, then merge
them during the binding phase, as described in the next subsection.
Refer to the C Reference Manual for complete information about using the C compiler.
Binding
Link the C compiler output files and run-time library routines together by using the
Binder utility. The following Binder invocation line invokes a command file containing
commands that link the object files for the Static Directory sample subagent with the
run-time library without tracing (PEERLIBO). The command file is named BINSTAT,
and the Binder listing is sent to $S.#BIND.FIXEDLS:
BIND / IN BINDSTAT, OUT $S.#BIND.FIXEDLS/
BINDSTAT contains these Binder commands:
SET SYMBOLS ON;
SET INSPECT ON;
SET SAVEABEND OFF;
MODE NOUPSHIFT;
ADD * FROM FIXEDLSO;
ADD * FROM DIRO;
ADD * FROM ZSNMPSDK.PEERLIBO;
SELECT SEARCH $SYSTEM.SYSTEM.CWIDE;
SELECT LIST * OFF;
SET HEAP 4000 BYTES;
BUILD FIXEDLS!