HP-UX SNAplus2 R7 NOF Programmer's Guide

Writing NOF Applications
Target For NOF Verbs
2.3 Writing Portable Applications
The following guidelines are provided for writing SNAplus2 NOF applications so that they will be portable to other
environments:
Include the NOF header le without any path name prex. This enables the application to be used in an
environment with a different le system. Use include options on the compiler to locate the le (see Section
2.1.2,
Compiling and Linking the NOF Application or Section 2.2.2, Compiling and Linking the NOF Application).
Use the symbolic constant names for parameter values and return codes, not the numeric values shown in the
header le; this ensures that the correct value will be used regardless of the way these values are stored in
memory.
Include a check for return codes other than those applicable to your current operating system (for example using
a default case in a switch statement), and provide appropriate diagnostics.
Ensure that any parameters shown as reserved are set to
0 (zero).
2.4 Target For NOF Verbs
A NOF verb can be directed to any of the following targets:
A running node (to manage the nodes resources)
The node on a server where the SNAplus2 software is running but where the node has not been started (to start
the node, to query the nodes stored conguration, or to modify the conguration so that the changes take effect
when the node is restarted)
The domain conguration le (to manage domain resources)
The sna.net le (to manage the SNAplus2 servers that can act as backup masters if the master server is not
available)
The target for a particular NOF verb is identied by the target_handle parameter used on the NOF call. An
application acquires a target handle using different NOF verbs depending on the target, as follows:
Running node or node on running server
The application issues CONNECT_NODE, specifying the name of the required node, with a null target handle;
SNAplus2 returns a target handle for this node as one of the VCB parameters for CONNECT_NODE.
Domain configuration file
The application issues OPEN_FILE with a null target handle; SNAplus2 returns a target handle for the le
as one of the VCB parameters for OPEN_FILE.
sna.net file
The application issues OPEN_FILE with a null target handle; SNAplus2 returns a target handle for the le
as one of the VCB parameters for OPEN_FILE.
Some NOF verbs can be issued only to particular target types:
DEFINE_NODE cannot be issued to a running node; it must be issued to a server where the node is not running.
Verbs associated with node resources, such as DEFINE_LOCAL_LU, must be issued to a node.
START_* and STOP_* verbs, to start and stop node resources, must be issued to a running node.
Verbs associated with domain resources, such as DEFINE_EMULATOR_USER, must be issued to the domain
conguration le.
74