OSI/AS Programming Manual

Example 2: Presentation Layer and ACSE
Sample Programs
E–86 056783 Tandem Computers Incorporated
/* */
/* Wait for ACSE associate indication. */
/* */
wait_for_event( ZAPS_VAL_EVT_CONNECT_IND );
/* */
/* Get and save the parameters of the associate */
/* indication. */
/* */
error =
APS_ASSOC_GETPARAM_( cepi
, /* conid */
, (int *) &local_appl
, (int *) &remote_appl
, /* connect-result */
, (int *) &session_rqmnts
, /* release-result */
, /* abort-reason */
, &mode
, (int *) &pres_context_list
, (int *) &pres_context_result_list
, (int *) &pres_default_context_name
, /* pres-default-context-result */
, (int *) &acse_appl_context_name
, (int *) &acse_local_ae_title
, (int *) &acse_remote_ae_title
, (int *) &acse_local_invocation_ids
, (int *) &acse_remote_invocation_ids
);
if ( error != ZAPS_ERR_OK )
display_aps_error( error_assoc_getparam_proc );
/* */
/* A real application would check the session-rqmnts, */
/* pres-context-list, and so forth to make sure that */
/* all is well. */
/* */
/* However, in this program we'll accept whatever the */
/* remote application sent. */
/* */
/* */
/* Set the transfer syntax in the */
/* pres-context-result-list. */
/* */
/* We'll just choose the first transfer syntax, */
/* since we know that the first one is acceptable. */
/* */
for (pc = 0; pc < pres_context_list.znum_elements; pc++)
{
memcpy(
&pres_context_result_list.zelement[pc].zts_name
, pres_context_list.zelement[pc].zts_name
, sizeof ( zaps_ddl_obj_id_def )
);
};