HP-UX SNAplus2 R7 NOF Programmer's Guide
Writing NOF Applications
HP-UX Considerations
Note
The NOF VCBs contain many parameters marked as “reserved”; some of these are
used internally by the SNAplus2 software, and others are not used in this version
but may be used in future versions. Your application must not attempt to access any
of these reserved parameters; instead, it must set the entire contents of the VCB to
zero to ensure that all of these parameters are zero, before it sets other parameters
that are used by the verb. This ensures that SNAplus2 will not misinterpret any of
its internally-used parameters, and also that your application will continue to work
with future SNAplus2 versions in which these parameters may be used to provide
new functions.
To set the VCB contents to zero, use
memset:
memset(nofvcb, 0, sizeof(nofvcb));
Returned Values
The nof entry point does not have a return value. When the call returns, the application should examine the return
code in the VCB to determine whether the verb completed successfully and to determine parameters it needs for
further verbs. In particular, when the CONNECT_NODE or OPEN_FILE verb completes successfully, the VCB
contains the
target_handle that the application should use when issuing subsequent verbs.
Using the Synchronous Entry Point
Only one synchronous verb can be outstanding at any time for each target handle. A synchronous verb fails with
the primary return code
AP_STATE_CHECK
and secondary return code
AP_SYNC_PENDING if another synchronous
verb for the same target handle is in progress.
Asynchronous Entry Point: nof_async
An application uses nof_async to issue a NOF verb asynchronously. The application also supplies a pointer to
a callback routine. SNAplus2 returns control to the application immediately with a returned value that indicates
whether verb processing is still in progress or has completed. In most cases, verb processing is still in progress
when control returns to the application. In these cases, SNAplus2 uses the application-supplied callback routine to
return the results of the verb processing at a later time. In some cases, verb processing is complete when SNAplus2
returns control to the application, so SNAplus2 does not use the application’s callback routine.
Function Call
AP_UINT16 nof_async(
AP_UINT32 target_handle,
void * nofvcb,
NOF_CALLBACK (*comp_proc),
AP_CORR corr
);
typedef void (*NOF_CALLBACK) (
AP_UINT32 target_handle,
void * nofvcb,
AP_CORR corr
AP_UINT32 indic_length
);
typedef union ap_corr {
void * corr_p;
AP_UINT32 corr_l;
AP_INT32 corr_i;
} AP_CORR;
65