OSI/AS Programming Manual

Example 2: Presentation Layer and ACSE
Sample Programs
056783 Tandem Computers Incorporated E–43
acse_appl_context_name.zobj^id[1] := 0;
acse_appl_context_name.zobj^id[2] := 8571;
acse_appl_context_name.zobj^id[3] := 1;
acse_appl_context_name.zobj^id[4] := 1;
--
-- Set the mode and service ID for an ACSE association.
--
mode := ZAPS^VAL^MODE^NORMAL;
service_id := ZAPS^VAL^SERVICE^ACSE;
--
-- Set up ACSE associate request user data.
-- Normally, this would be generated by an ASN.1 compiler.
--
user_data.header.znum^elements := 1;
user_data.element.ztype := ZAPS^VAL^DATA^TYPE^VALUE;
user_data.element.zpcid := 1; -- ignored by ACSE
user_data.value ':='
[ %H28 -- EXTERNAL
, 17 -- length
, %H02 -- INTEGER
, 1 -- length of INTEGER
, 1 -- pcid
, %H80 -- single-asn1-type
, 12 -- length of user-info
, %H04 -- octet string
, 10 -- length of octet string
, "connectreq" -- data
] -> @user_data_ptr;
user_data.element.zlen :=
@user_data_ptr - @user_data.value;
--
-- Issue ACSE associate request.
-- (ACSE is being used, so there is no default
-- context name.)
--
print_aps( "APPL1: connect request ->" );
status :=
APS_ASSOC_CONNECTREQ_( cepi
, api_environment
, local_appl
, remote_appl
, session_rqmnts
, ! conid !
, user_data
, ! tag !
, service_id
, mode
, pres_context_list
, ! pres-default-context-name !
, acse_appl_context_name
, ! acse-local-ae-title !
, ! acse-remote-ae-title !
, ! acse-local-invocation-ids !