aftp_extract_destination

The aftp_extract_destination call extracts the destination of the AFTP server. If the aftp_set_destination call has not been invoked, the AFTP default destination value is returned.

AFTP_ENTRY aftp_extract_destination(
IN AFTP_HANDLE_TYPE
connection_id,
OUT unsigned char AFTP_PTR
destination,
IN AFTP_LENGTH_TYPE
destination_size,
OUT AFTP_LENGTH_TYPE AFTP_PTR
returned_length,
OUT AFTP_RETURN_CODE_TYPE AFTP_PTR
return_code
);

Parameters

connection_id
An AFTP connection object originally created with aftp_create.
destination
Buffer into which the name of the AFTP server is written. This parameter can be either a symbolic destination name or a partner LU name.

See the APPC Application Suite User's Guide for information about specifying destinations in the APPC Application Suite.

destination_size
The size of the buffer in which the destination will be stored.

Use the AFTP_FQLU_NAME_SIZE constant to define the length of this buffer. Add 1 to the size if you want to be able to add a null terminator to the text in the buffer.

returned_length
The actual length of the destination parameter in bytes.
return_code
The return code issued for this function. See AFTP Return Codes for the list of possible return codes.

Example

{
    AFTP_HANDLE_TYPE              connection_id;
    AFTP_RETURN_CODE_TYPE         aftp_rc;
    unsigned char                 destname[AFTP_FQLU_NAME_SIZE+1];
    AFTP_LENGTH_TYPE              returned_length;

    /*
     * Before issuing the example call, you must have:
     *    a connection_id, use:  aftp_create()
     */

    /*
     * Extract the destination name for AFTP.
     */

    aftp_extract_destination(
        connection_id,
        destname,
        (AFTP_LENGTH_TYPE)sizeof(destname)-1,
        &returned_length,
        &aftp_rc);
    if (aftp_rc != AFTP_RC_OK) {
        fprintf(stderr, "Error extracting AFTP destination.\n");
    }
}
 

Line Flows

None.