aftp_set_userid

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

AFTP_ENTRY aftp_set_userid(
IN AFTP_HANDLE_TYPE
connection_id,
IN unsigned char AFTP_PTR
userid,
IN AFTP_LENGTH_TYPE
length,
OUT AFTP_RETURN_CODE_TYPE AFTP_PTR
return_code
);

Parameters

connection_id
An AFTP connection object originally created with aftp_create.
userid
The user identifier to be used on the connection. The user identifier can be from 1 through 8 bytes long.
length
The length of the userid 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;
    static unsigned char AFTP_PTR userid = "LBONANNO";
    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 user ID for the AFTP connection.
     */

    aftp_set_userid(
        connection_id,
        userid,
        (AFTP_LENGTH_TYPE)strlen(userid),
        &aftp_rc);

    if (aftp_rc != AFTP_RC_OK) {
        fprintf(stderr, "Error setting user ID.\n");
    }
}
 

Line Flows

None.