aftp_set_security_type

The aftp_set_security_type call specifies the type of APPC conversation security to be used. This call can only be invoked prior to the establishment of a connection to the AFTP server. When a connection is open, the APPC security type cannot be changed. If AFTP_SECURITY_PROGRAM is used for the security type, a user identifier and password must also be set using aftp_set_userid and aftp_set_password before connecting to the AFTP server.

AFTP_ENTRY aftp_set_security_type(
IN AFTP_HANDLE_TYPE
connection_id,
IN AFTP_SECURITY_TYPE
security_type,
OUT AFTP_RETURN_CODE_TYPE AFTP_PTR
return_code
);

Parameters

connection_id
An AFTP connection object originally created with aftp_create.
security_type
The security to be used when connecting to the AFTP server.
AFTP_SECURITY_NONE
No APPC conversation security is used. This is the default unless CPI-C side information is set otherwise.
AFTP_SECURITY_SAME
The local security information determined at logon time will be transferred to the AFTP server.
AFTP_SECURITY_PROGRAM
A user identifier and password will be sent to be verified by the AFTP server. You must use the aftp_set_userid and aftp_set_password calls with this security type, or the connection attempt will fail.
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;

    /*
     * Before issuing the example call, you must have:
     *    a connection_id, use:  aftp_create()
     *
     * You cannot have an open connection.
     */

    /*
     * Set the APPC conversation security type for the
     * AFTP connection.
     */

    aftp_set_security_type(
        connection_id,
        AFTP_SECURITY_SAME,
        &aftp_rc);

    if (aftp_rc != AFTP_RC_OK) {
        fprintf(stderr, "Error setting AFTP security type.\n");
    }
}
 

Line Flows

None.