HP-UX SNAplus2 R7 NOF Programmer's Guide
Writing NOF Applications
HP-UX Considerations
Returned Values
The asynchronous entry point returns one of the following values:
AP_COMPLETED
The verb has already completed. The application can examine the parameters in the VCB to determine
whether the verb completed successfully. SNAplus2 does not call the supplied callback routine for this verb.
AP_IN_PROGRESS
The verb has not yet completed. The application can continue with other processing, including issuing other
NOF verbs, provided that they do not depend on the completion of the current verb. However, the application
should not attempt to examine or modify the parameters in the VCB supplied to this verb.
SNAplus2 calls the supplied callback routine to indicate when the verb processing completes. The application
can then examine the VCB parameters.
Using the Asynchronous Entry Point
When using the asynchronous entry point, note the following:
• If an application specifies a null pointer in the
comp_proc parameter, the verb will complete synchronously (as
though the application issued the verb using the synchronous entry point).
• If the call to
nof_async is made from within an application callback, specifying a null pointer in the comp_proc
parameter is not permitted. In such cases, SNAplus2 rejects the verb with a primary return code value of
AP_PARAMETER_CHECK and a secondary return code value of
AP_SYNC_NOT_ALLOWED.
• The application must not attempt to use or modify any parameters in the VCB until the callback routine has
been called.
• Multiple verbs do not necessarily complete in the order in which they were issued. In particular, if an application
issues an asynchronous verb followed by a synchronous verb, the completion of the synchronous verb does not
guarantee that the asynchronous verb has already completed.
The Callback Routine Specified on the nof_async Entry Point
When using the asynchronous NOF API entry point, the application must supply a pointer to a callback routine.
SNAplus2 uses this callback routine both for completion of a verb and also for returning NOF indications. (The
REGISTER_INDICATION_SINK verb is also issued as an asynchronous verb that specifies a callback routine; the
callback is called each time the indication is received. For other NOF verbs, an indication is received when the verb
completes.) The application must examine the opcode parameter in the VCB to determine which event is contained
in the callback routine.
This section describes how SNAplus2 uses the callback routine and the functions that the callback routine must
perform.
Callback Function
NOF_CALLBACK (*comp_proc);
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;
Supplied Parameters
SNAplus2 calls the callback routine with the following parameters:
67