Previous Page Contents Page Next Page

5 TP Server Verbs

This chapter contains a description of each APPC TP server verb. The following information is provided for each verb:

Note

TP server verbs do not affect APPC conversations or states.

Most parameters supplied to and returned by APPC for the TP Server verbs are hexadecimal values. To simplify coding, these values are represented by meaningful symbolic constants defined in the header file values_c.h, which is included by the TP Server header file tpsrv_c.h. For example, the opcode parameter of the REGISTER_TP_SERVER verb is the hexadecimal value represented by the symbolic constant AP_REGISTER_TP_SERVER.

It is important that you use the symbolic constant and not the hexadecimal value when setting values for supplied parameters, or when testing values of returned parameters. This is because different Solaris systems store these values differently in memory, so the value shown may not be in the format recognized by your system.

The TP server verbs are described in the following order:

REGISTER_TP_SERVER
UNREGISTER_TP_SERVER
REGISTER_TP
UNREGISTER_TP
QUERY_ATTACH
ACCEPT_ATTACH
REJECT_ATTACH
ABORT_ATTACH

5.1 REGISTER_TP_SERVER

The REGISTER_TP_SERVER verb is used to notify SNAP-IX that the application is capable of automatically starting transaction programs (TPs).

5.1.1 VCB Structure: REGISTER_TP_SERVER

The definition of the VCB structure for the REGISTER_TP_SERVER verb is as follows:

typedef struct register_tp_server
{
   AP_UINT16        opcode;
   unsigned char    rsrvd1;                  /* Reserved             */
   unsigned char    rsrvd2;                  /* Reserved             */
   AP_UINT16        primary_rc;
   AP_UINT32        secondary_rc;
   AP_UINT32        tps_id;
   unsigned char    tp_file_updates;
   AP_NOTIFY_CB     notify_cb;
} REGISTER_TP_SERVER;  
  typedef void (*AP_NOTIFY_CB) (
                                unsigned char   reason,
                                unsigned char   attach_id[8],
                                AP_CORR         app_corr
                               );
 
 typedef union ap_corr {
                         void *          corr_p;
                         AP_UINT32       corr_l;
                         AP_INT32        corr_i;
                       } AP_CORR;

5.1.2 Supplied Parameters

The TP supplies the following parameters to APPC:

opcode

AP_REGISTER_TP_SERVER

tp_file_updates

Requests whether the application should be notified when the sna_tps TP configuration file is updated. Possible values are:

AP_YES

The application requests callbacks to notify it that the sna_tps file has been changed.

AP_NO

The application does not require notification of changes to the sna_tps file.

notify_cb

The address of the notification callback function. APPC uses this function in conjunction with the value of the app_corr parameter specified on the REGISTER_TP verb to notify a TP server that one of the following has occurred:

  • A suitable Attach is available

  • The sna_tps TP configuration file has changed (if the application requested this notification by setting the tp_file_updates parameter to AP_YES).

For more information on how the notification callback function is used, see Callback Routine.

5.1.3 Returned Parameters

After the verb executes, APPC returns parameters to indicate whether the execution was successful and, if not, to indicate the reason the execution was not successful.

Successful Execution

If the verb executes successfully, APPC returns the following parameter:

primary_rc

AP_OK

tps_id

A unique identifier for this TP server. After an application registers itself as a TP server, the value of the tps_id parameter is valid for that process only. The value of the tps_id parameter is not valid across process boundaries. If another application tries to use this value of the tps_id parameter on another verb, that verb is rejected with a primary_rc value of AP_PARAMETER_CHECK and a secondary_rc value of AP_BAD_TPS_ID.

Unsuccessful Execution

If the verb does not execute successfully, APPC returns a primary return code parameter to indicate the type of error and a secondary return code parameter to provide specific details about the reason for unsuccessful execution.

Parameter Check

If the verb does not execute because of a parameter error, APPC returns the following parameters:

primary_rc

AP_PARAMETER_CHECK

secondary_rc

Possible values are:

AP_INVALID_CALLBACK

The callback function address was not valid.

Register Failure

If the application cannot be registered as a TP server, APPC returns the following parameters:

primary_rc

AP_REGISTER_FAIL

Other Conditions

If the verb does not execute because other conditions exist, APPC returns the following primary return code. For a list of return codes common to all verbs, see Common Return Codes.

primary_rc

AP_UNEXPECTED_SYSTEM_ERROR

5.1.4 Usage Notes

This section provides additional usage information about the callback routine.

Callback Routine

The application supplies a pointer to a callback routine as one of the parameters to the VCB. This section describes how SNAP-IX uses this routine and the functions that it must perform.

The callback routine is defined as follows:

  typedef void (*AP_NOTIFY_CB) (
                                unsigned char   reason,
                                unsigned char   attach_id[8],
                                AP_CORR         app_corr
                               );
 
 typedef union ap_corr {
                         void *          corr_p;
                         AP_UINT32       corr_l;
                         AP_INT32        corr_i;
                       } AP_CORR;

SNAP-IX calls the routine with the following parameters:

reason

Type of notification. Possible values are:

AP_ATTACH

An Attach has arrived for a TP registered by this TP server. In this case, the attach_id parameter is passed into the notification callback because the arrival of an Attach is used to do one or more of the following:

  • Optionally query for more information about automatically starting a TP

  • Reject the Attach if necessary

  • Identify which TP to automatically start for RECEIVE_ALLOCATE processing

AP_TP_FILE_CHANGE

The sna_tps TP configuration file has been modified.

attach_id

The ID of the attach, as returned by the attach notification callback.

app_corr

The correlator value supplied by the application. This value allows the application to correlate the returned information with its other processing. The meaning of the correlator passed into the notification callback depends on the notification type as indicated by the value of the reason flag:

  • If reason is set to AP_ATTACH , the correlator is the correlator that was specified by the application on the REGISTER_TP verb. This allows the application to correlate the Attach with the correct registered TP.

  • If reason is set to AP_TP_FILE_CHANGE , the correlator is the value of the tps_id parameter on the REGISTER_TP_SERVER verb.

The callback routine need not use all of these parameters. It may perform all the necessary processing on the returned VCB, or it may simply set a variable to inform the main program that the verb has completed.

Previous Page Contents Page Top of Page Next page