OSI/AS Programming Manual
Example 2: Presentation Layer and ACSE
Sample Programs
056783 Tandem Computers Incorporated E–45
, pres_default_context_result
, acse_appl_context_name
, ! acse-local-ae-title !
, acse_remote_ae_title
, ! acse-local-invocation-ids !
, acse_remote_invocation_ids
, acse_result_source
, acse_diagnostic
, ! acse-release-reason !
, ! acse-abort-source !
);
IF ( error <> ZAPS^ERR^OK ) THEN
CALL display_aps_error( error_assoc_getparam_proc );
--
-- A real application would check the session-rqmnts,
-- pres-context-result-list, and so forth to make sure that
-- all is well.
--
--
-- Get associate confirm user data.
--
CALL retrieve_user_data;
--
-- Set up 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;
user_data.value ':=' [ %H04 -- octet string
, 7 -- length
, "datareq" -- data
] -> @user_data_ptr;
user_data.element.zlen :=
@user_data_ptr - @user_data.value;
--
-- Set up the tokens, so they can be given away.
--
give_tokens.zdata := ZAPS^VAL^TOKEN^GIVE;
give_tokens.zrelease := ZAPS^VAL^TOKEN^NOVALUE;
give_tokens.zmajorsync := ZAPS^VAL^TOKEN^NOVALUE;
give_tokens.zminorsync := ZAPS^VAL^TOKEN^NOVALUE;
--
-- Issue P-DATA request, including the P-GIVE-TOKENS
-- by using basic concatenation.
--
print_aps( "APPL1: data request (w/ give tokens) ->" );
status := APS_DATA_REQ_( cepi
, user_data
, ! tag !
, ! data-operation !