HP-UX SNAplus2 R7 NOF Programmer's Guide

Writing NOF Applications
Windows Considerations
target_handle
For NOF indications, SNAplus2 passes the target handle that was supplied with the REGIS-
TER_INDICATION_SINK verb. For completion of verbs, this parameter is undened.
nofvcb
One of the following:
For NOF indications, a pointer to a VCB supplied by SNAplus2.
For completion of verbs, a pointer to the VCB supplied by the application. The VCB now includes the
returned parameters set by SNAplus2.
corr
The correlator value supplied by the application. This value enables the application to correlate the returned
information with its other processing.
The callback routine need not use all of these parameters (except as described in Section 2.1.1,
NOF API Entry
Points for HP-UX). The callback routine can perform all the necessary processing on the returned parameters, or it
can simply set a variable to inform the NOF application that the verb has completed.
Returned Values
The callback function does not return any values.
Using the Callback Routine for Indications
Although the application allocates the VCBs for NOF verbs, SNAplus2 allocates the VCBs for indications.
Therefore, the application has access to the VCB information only from within the callback routine; the VCB
pointer that SNAplus2 supplies to the callback routine is not valid outside the callback routine. The application
must either complete all the required processing from within the callback routine, or make a copy of any VCB data
that it needs to use outside this routine.
In the event that the NOF application needs to make a copy of the data supplied on the callback routine and the
NOF application is using signal-based scheduling mode, an operating system limitation may prohibit memory allo-
cation. In this case, some memory must be preallocated before the REGISTER_INDICATION_SINK verb is issued.
Scope of Target Handle
Each application that needs to use NOF must issue the CONNECT_NODE verb to obtain its own handle. No two
NOF applications can use the same NOF target handle.
In particular, if the application that issued CONNECT_NODE later forks to create a child process, the child process
cannot issue any NOF verbs that use the target handle obtained by the parent process. However, the child process
can issue another CONNECT_NODE to obtain its own target handle.
2.1.2 Compiling and Linking the NOF Application
To compile and link 32bit applications, use the following options:
+DA1.0 -I /usr/include/sna -L /opt/sna/lib -lnof -lsna -lpthread
To compile and link 64bit applications, use the following options:
+DA2.0w -I /usr/include/sna -L /opt/sna/lib/pa20_64 -lnof -lsna -lpthread
2.2 Windows Considerations
WINDOWS
68