Distributed Systems Network Management (DSNM) Subsystem Interface Development Guide

Sample I Process Program Code
Distributed Systems Network Management (DSNM) Subsystem Interface Development
Guide109759 D-21
Sample User-Written Code for SPIFFY Subsystem
Interface Process
! Set the current input and output lists for processing
! thread and put the inobj on the input.
! Note: The current^in and current^out list pointers may be
! exchanged several times while processing an object.
! Reference after this initialization should always be
! made through the current pointers rather than to the
! things/other^things lists directly.
@cx.current^in := @cx.things;
@cx.current^out := @cx.other^things;
IF _ISNULL (_PUT^LM (cx.current^in,,$LEN (inobj),inobj)) THEN
RETURN _RC^ABORT (ZDSN^ERR^MEMORY);
! Dispatch a proc to process the command.
! Note: All commands begin with (or consist entirely of) a
! TELLABOUT command with the exception of an action command on
! a single object (i.e., no subordinates, no *).
IF _ON (inobj.cf, c^info) THEN
BEGIN
! Command requires info (TELLABOUT) command only.
! Set state where we wish to return to this proc.
_THREAD^STATE := st^done;
_SAVE^THREAD^AND^DISPATCH (@info^cmd^proc, st^new^object,
_EV^STARTUP);
! If _save^thread fails, we fall through to here and ...
RETURN _RC^ABORT (ZDSN^ERR^MEMORY);
END;
! Must be an action command
IF _ANYOFF (inobj.cf, c^anystate) OR _ON (inobj.cf, c^subobj) THEN
BEGIN
! Command requires info as a preliminary to its execution.
_THREAD^STATE := st^prilim^done; ! State to return to this
! proc
_SAVE^THREAD^AND^DISPATCH (@info^cmd^proc, st^new^object,
_EV^STARTUP);
RETURN _RC^ABORT (ZDSN^ERR^MEMORY);
END;
! Can perform action directly
_THREAD^STATE := st^done; ! State to return to this proc
_SAVE^THREAD^AND^DISPATCH (@action^cmd^proc, st^new^object,
_EV^STARTUP);
RETURN _RC^ABORT (ZDSN^ERR^MEMORY);
st^prilim^done ->
! We've done a preliminary command to produce a list of objects
! for the real command. Swap the current input and output lists
! and get on with the main event.
@temp := @cx.current^in;
@cx.current^in := @cx.current^out;
@cx.current^out := @temp;
_THREAD^STATE := st^done; ! Return state
_SAVE^THREAD^AND^DISPATCH (@action^cmd^proc, st^new^object,
_EV^STARTUP);
RETURN _RC^ABORT (ZDSN^ERR^MEMORY);