OSI/AS Programming Manual
Example 2: Presentation Layer and ACSE
Sample Programs
056783 Tandem Computers Incorporated E–73
-- 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 TO pres_context_list.znum^elements-1 DO
BEGIN
pres_context_result_list.zelement[pc].zts^name ':='
pres_context_list.zelement[pc].zts^name FOR
1 ELEMENTS;
END;
--
-- Get ACSE associate indication user data.
--
CALL retrieve_user_data;
--
-- Set the ACSE application context name for this request.
-- { iso standard 8571 application-context(1) iso-ftam(1) }
--
acse_appl_context_name.znum^elements := 5;
acse_appl_context_name.zobj^id[0] := 1;
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 up ACSE associate response 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
, "connectrsp" -- data
] -> @user_data_ptr;
user_data.element.zlen :=
@user_data_ptr - @user_data.value;