FTAM/9000 Programmer's Guide

358 Chapter 10
Example Programs
Managing FTAM Connections Example
/*
** Activate “ftam_init”.
**
** Get the parameters for ft_aeactivation.
** Call ft_aeactivation and verify the outcome.
*/
(void)printf(“Activating ftam_init...\n”);
aea_parm_in( & my_ae_name, & return_event_name, & aea_input_dcb,
& aea_inout_dcb, & ae_label );
res = ft_aeactivation(my_ae_name, return_event_name, aea_input_dcb,
& aea_inout_dcb, & ae_label);
if (res != SUCCESS)
error_handler(aea_inout_dcb->result, diag);
/*
** Free memory.
*/
res = ft_dfdcb((Octet *)aea_inout_dcb, & outcome);
if (res != SUCCESS)
error_handler(outcome, diag);
/*
** Establish a connection with the responder.
**
** Get the parameters for ft_connect.
** Call ft_connect and verify the outcome.
*/
(void)printf(“Establishing a connection with the responder...\n”);
con_parm_in( & return_event_name, & called_ae_name, & con_input_dcb,
& con_inout_dcb, & connection_id );
res = ft_connect(ae_label, return_event_name, called_ae_name,
con_input_dcb, & con_inout_dcb, & connection_id);
if (res != SUCCESS)
error_handler(con_inout_dcb->result,
con_inout_dcb->connect_out_info->diagnostic);
/*
** Free memory.
*/
res = ft_dfdcb((Octet *)con_input_dcb, & outcome);
if (res != SUCCESS)
error_handler(outcome, diag);
res = ft_dfdcb((Octet *)con_inout_dcb, & outcome);
if (res != SUCCESS)
error_handler(outcome, diag);
/*
** Release the connection with the responder.
**
** Get the parameters for ft_rrequest.
** Call ft_rrequest and verify the outcome.
*/
(void)printf(“Releasing the connection with the responder...\n”);
rre_parm_in( & return_event_name, & rre_input_dcb, & rre_inout_dcb );
res = ft_rrequest(connection_id, return_event_name, rre_input_dcb,
& rre_inout_dcb);
if (res != SUCCESS)
error_handler(rre_inout_dcb->result, diag);
/*
** Free memory.
*/
res = ft_dfdcb((Octet *)rre_inout_dcb, & outcome);
if (res != SUCCESS)
error_handler(outcome, diag);