OSI/AS Programming Manual
Example 2: Presentation Layer and ACSE
Sample Programs
056783 Tandem Computers Incorporated E–85
/* */
/*--------------------------------------------------------*/
main()
{
 /* */
 /* read startup message, open output, and initialize APS*/
 /* */
 initialize_appl();
 /* */
 /* Set the OSI manager process name. */
 /* */
 memcpy( api_environment.zend_system_name.u_zc.zb
 , "$OMGR "
 , 24
 );
 api_environment.zwaitmode = ZAPS_VAL_NOWAITED;
 /* */
 /* Set the local application name. */
 /* */
 local_appl.zpsap.zpsel.zlen = 0; /* not used */
 local_appl.zpsap.zssel.zlen = 0; /* not used */
 local_appl.zpsap.ztsel.zlen = 0; /* not used */
 local_appl.zpsap.znsap.zlen = 0; /* not used */
 local_appl.zappl_name.zlen = 5;
 memcpy( local_appl.zappl_name.u_zc.zb, "APPL2", 5 );
 /* */
 /* Set the mode and service ID for an ACSE association. */
 /* */
 service_id = ZAPS_VAL_SERVICE_ACSE;
 /* */
 /* Issue attach, informing OSI/AS that the application */
 /* is willing to accept an ACSE associate indication. */
 /* */
 tag = error_attach_proc;
 printf( "APPL2: attach\n" );
 status = APS_ASSOC_ATTACH_( &cepi
 , (int *) &api_environment
 , (int *) &local_appl
 , tag
 , service_id
 );
 wait_for_aps_completion( error_attach_proc );
 if ( status != ZAPS_VAL_STATUS_OK )
 display_aps_status( error_attach_proc );
 /* */
 /* At this point, local-appl and acse_local_ae_title */
 /* are available through APS_ASSOC_GETPARAM_, but */
 /* we can wait for the indication to get them. */
 /* */










