GLOBUS_FTP_CONTROL_HANDLE_DESTROY(3)
π NAME π
globus_ftp_control_client β GridFTP Control Client π
- Control Client.
β¨ SYNOPSIS β¨
πΈ Functions πΈ
globus_ftp_control_handle_initβ Initialize a globus ftp handle.
globus_result_t globus_ftp_control_handle_init (globus_ftp_control_handle_t *handle)
globus_ftp_control_handle_destroyβ Destroy a globus ftp handle.
globus_result_t globus_ftp_control_handle_destroy (globus_ftp_control_handle_t *handle)
globus_ftp_control_connectβ Create a new control connection to an FTP server.
globus_result_t globus_ftp_control_connect (globus_ftp_control_handle_t *handle, char *host, unsigned short port, globus_ftp_control_response_callback_t callback, void *callback_arg)
globus_ftp_control_response_destroyβ Free the memory associated with a response.
globus_result_t globus_ftp_control_response_destroy (globus_ftp_control_response_t *response)
globus_ftp_control_response_copyβ Copy a response structure.
globus_result_t globus_ftp_control_response_copy (globus_ftp_control_response_t *src, globus_ftp_control_response_t *dest)
globus_ftp_control_authenticateβ Authenticate the user to the FTP server.
globus_result_t globus_ftp_control_authenticate (globus_ftp_control_handle_t *handle, globus_ftp_control_auth_info_t *auth_info, globus_bool_t use_auth, globus_ftp_control_response_callback_t callback, void *callback_arg)
globus_ftp_control_authenticate_exβ Authenticate the user to the FTP server.
globus_result_t globus_ftp_control_authenticate_ex (globus_ftp_control_handle_t *handle, globus_ftp_control_auth_info_t *auth_info, globus_bool_t use_auth, globus_ftp_control_response_callback_t callback, void *callback_arg)
globus_ftp_control_send_commandβ Send an FTP protocol command.
globus_result_t globus_ftp_control_send_command (globus_ftp_control_handle_t *handle, const char *cmdspec, globus_ftp_control_response_callback_t callback, void *callback_arg,...)
globus_ftp_control_abortβ Send a GridFTP ABORT.
globus_result_t globus_ftp_control_abort (globus_ftp_control_handle_t *handle, globus_ftp_control_response_callback_t callback, void *callback_arg)
globus_ftp_control_quitβ Send a GridFTP QUIT.
globus_result_t globus_ftp_control_quit (globus_ftp_control_handle_t *handle, globus_ftp_control_response_callback_t callback, void *callback_arg)
globus_ftp_control_force_closeβ Force a control connection to close.
globus_result_t globus_ftp_control_force_close (globus_ftp_control_handle_t *handle, globus_ftp_control_response_callback_t callback, void *callback_arg)
globus_ftp_control_auth_info_initβ Initialize authentication information.
globus_result_t globus_ftp_control_auth_info_init (globus_ftp_control_auth_info_t *auth_info, gss_cred_id_t credential_handle, globus_bool_t encrypt, char *user, char *password, char *account, char *subject)
globus_ftp_control_auth_info_compareβ Compare authentication information.
int globus_ftp_control_auth_info_compare (globus_ftp_control_auth_info_t *auth_info_1, globus_ftp_control_auth_info_t *auth_info_2)
globus_ftp_control_client_get_connection_info_exβ Not documented yet.
globus_result_t globus_ftp_control_client_get_connection_info_ex (globus_ftp_control_handle_t *handle, globus_ftp_control_host_port_t *local_info, globus_ftp_control_host_port_t *remote_info)
globus_ftp_control_ipv6_allowβ Not documented yet.
globus_result_t globus_ftp_control_ipv6_allow (globus_ftp_control_handle_t *handle, globus_bool_t allow)
π¦ Detailed Description π¦
Control Client.
π Function Documentation π
π globus_result_t globus_ftp_control_abort
globus_result_t globus_ftp_control_abort (globus_ftp_control_handle_t *handle, globus_ftp_control_response_callback_t callback, void *callback_arg)
okay bestie, this one is literally the Send a GridFTP ABORT girlie. You use it to fire the ABORT message at the FTP server. The tea is that ABORT goes out out-of-band, and it terminates whatever data transfer is currently in progress. π
As a direct result of the ABORT, the data channels used by this control channel get closed. The data command callback gets issued with either a completion reply or a transfer aborted reply. And the ABORT callback also gets invoked, carrying the server's response to the abort command. π
β οΈ Any attempts to register buffers for read or write after anABORThas been sent will fail with a"no transfer in progress"error. So don't do that. π
Parameters
handleβ A pointer to a GridFTP control handle. TheABORTcommand is issued to the server over the control channel associated with this handle.callbackβ The function to be called once the authentication process is complete or when an error occurs.callback_argβ User supplied argument to the callback function
Returns
- Success
- Null handle
- No transfer in progress
Callback errors:
- success
- protocol error
- eof
Expected callback response values:
226Abort successful.500Syntax error, command unrecognized.
Note β The server may send other responses. π
π int globus_ftp_control_auth_info_compare
int globus_ftp_control_auth_info_compare (globus_ftp_control_auth_info_t *auth_info_1, globus_ftp_control_auth_info_t *auth_info_2)
Compare authentication information. This helper function compares two authentication information structures and returns zero if the two structures are deemed equal, and a non-zero value otherwise. β¨
Parameters
auth_info_1β The first authentication structureauth_info_2β The second authentication structure
Returns
0if the structures are equal!0if the structures differ or an error occurred
π globus_result_t globus_ftp_control_auth_info_init
globus_result_t globus_ftp_control_auth_info_init (globus_ftp_control_auth_info_t *auth_info, gss_cred_id_t credential_handle, globus_bool_t encrypt, char *user, char *password, char *account, char *subject)
Initialize authentication information. This helper function initializes an authentication information structure with the values contained in the second to fifth arguments, which may be GLOBUS_NULL. Bestie, listen: no memory is allocated in this function. π
Parameters
auth_infoβ The authentication structure to initialize.credential_handleβ The credential to use for authentication. This may beGSS_C_NO_CREDENTIALto use the user's default credential.encryptβ Boolean whether or not to encrypt the control channel for this handle.userβ The user namepasswordβ The password for the user nameaccountβ The account for the user name/passwordsubjectβ The GSSAPI subject name
Returns
- Error object
GLOBUS_SUCCESS
π globus_result_t globus_ftp_control_authenticate
globus_result_t globus_ftp_control_authenticate (globus_ftp_control_handle_t *handle, globus_ftp_control_auth_info_t *auth_info, globus_bool_t use_auth, globus_ftp_control_response_callback_t callback, void *callback_arg)
Authenticate the user to the FTP server. This will perform the authentication handshake with the FTP server. Depending on which parameters are non-NULL, the authentication may involve GSSAPI credentials, a username, a password, and an account name. π€
Note β Do we want to add attribute arguments for: - specifying type of delegation - gsswrap control messages for integrity or confidentiality
Parameters
handleβ A pointer to a unauthenticated GridFTP control handle. In the case of GSS authentication the GSS security context is stored in this structure.auth_infoβ This structure is used to pass the following information:userβ The user's name for login purposes. If this string is"anonymous","ftp",GLOBUS_NULLor":globus-mapping:"then thepasswordargument is optional. If this string isGLOBUS_NULLor":globus-mapping:"andgss_authis true then the users login is looked by the FTP server host.passwordβ The password for the aboveuserargument. If theuserargument is"anonymous"or"ftp"or ifgss_authis true this string may beGLOBUS_NULL.accountβ This parameter is optional. If not used it should be set toGLOBUS_NULL. It might be needed by firewalls.auth_gssapi_subjectβ The GSSAPI subject name of the server you are connecting to. If this isGLOBUS_NULL, and thegss_authparameter is set toGLOBUS_TRUE, then the name will default to the host name.
use_authβ If set toGLOBUS_TRUEthe above argument indicates that GSS authentication should be used, otherwise cleartext user/password authentication is used.callbackβ The function to be called once the authentication process is complete or when an error occurs.callback_argβ User supplied argument to the callback function
Returns
- success
- Null handle
- Invalid handle
- Handle already authenticated
Callback errors:
- success
- authentication failed
- protocol error
- eof
Expected callback response values:
230User logged in, proceed.232User logged in, authorized by security data exchange.234Security data exchange complete.331User name okay, need password.332Need account for login.336Username okay, need password. Challenge is"...."431Need some unavailable resource to process security.500Syntax error, command unrecognized.530Not logged in.
Note β The server may send other responses. The functionglobus_ftp_control_authenticate_ex()is identical except that theauth_info->req_flagsis used. If delegation flags or any flags other thanGSS_C_MUTUAL_FLAGandGSS_C_CONF_FLAGare desired, they must be set explicitly. It is the caller's responsibility to ensure thatreq_flagsonly contains valid flags. π₯
π globus_result_t globus_ftp_control_authenticate_ex
globus_result_t globus_ftp_control_authenticate_ex (globus_ftp_control_handle_t *handle, globus_ftp_control_auth_info_t *auth_info, globus_bool_t use_auth, globus_ftp_control_response_callback_t callback, void *callback_arg)
Authenticate the user to the FTP server. This will perform the authentication handshake with the FTP server. Depending on which parameters are non-NULL, the authentication may involve GSSAPI credentials, a username, a password, and an account name. π
Note β Do we want to add attribute arguments for: - specifying type of delegation - gsswrap control messages for integrity or confidentiality
Parameters
handleβ A pointer to a unauthenticated GridFTP control handle. In the case of GSS authentication the GSS security context is stored in this structure.auth_infoβ This structure is used to pass the following information:userβ The user's name for login purposes. If this string is"anonymous","ftp",GLOBUS_NULLor":globus-mapping:"then thepasswordargument is optional. If this string isGLOBUS_NULLor":globus-mapping:"andgss_authis true then the users login is looked by the FTP server host.
passwordβ bestie, this is the password for theuserwe just talked about. But heads up: ifuseris"anonymous"or"ftp", or ifgss_authis true, then this lil string is allowed to beGLOBUS_NULL. Slay, no password needed.accountβ totally optional, boo. If you don't need it, set it toGLOBUS_NULL. Firewalls sometimes want it though, so like, don't be surprised.auth_gssapi_subjectβ the GSSAPI subject name of the server you're connecting to. If this isGLOBUS_NULLandgss_authis set toGLOBUS_TRUE, the name just defaults to the host name. Convenient β¨.use_authβ if you set this toGLOBUS_TRUE, the argument above means "hey use GSS authentication". Otherwise it's plain cleartext user/password auth. Choose wisely π .callbackβ the function that gets called once auth is done, or whenever an error happens. Your moment.callback_argβ your own lil user-supplied argument that gets handed to the callback. π
Returns π
- success
- Null handle
- Invalid handle
- Handle already authenticated
Callback errors:
- success
- authentication failed
- protocol error
- eof
Expected callback response values:
230 User logged in, proceed.232 User logged in, authorized by security data exchange.234 Security data exchange complete.331 User name okay, need password.332 Need account for login.336 Username okay, need password. Challenge is "...."431 Need some unavailable resource to process security.500 Syntax error, command unrecognized.530 Not logged in.
Note π«Ά
The server may send other responses. iykyk.
The function globus_ftp_control_authenticate_ex() is literally identical except that the auth_info->req_flags is used. If delegation flags, or any flags other than GSS_C_MUTUAL_FLAG and GSS_C_CONF_FLAG, are what you want, you must set them explicitly. And it is the caller's responsibility to make sure req_flags only contains valid flags. No pressure bestie, just like, correctness.
globus_ftp_control_connect π
globus_result_t globus_ftp_control_connect (globus_ftp_control_handle_t *
handle, char * host, unsigned short port,
globus_ftp_control_response_callback_t callback, void * callback_arg)
Create a new control connection to an FTP server. This is the function you call to kick off an FTP control connection β it makes the socket to the FTP server. Once the connection is made and the server's identification string arrives, your callback gets invoked. Main character energy.
Parameters
handleβ a pointer to an initialized FTP control handle. This handle gets used for all subsequent FTP control operations, so like, treasure it.hostβ the hostname of the FTP server.portβ the TCP port number of the FTP server.callbackβ a function called once the connection to the server is established and a response has been read.callback_argβ parameter to the callback function.
Returns
- success
- Null handle
- Null host
- Illegal port number
- Null callback
- Cannot resolve hostname
- Cannot create socket
Callback errors:
- success
- connection refused
- protocol error
- eof
Expected callback response values:
120 Service ready in nnn minutes.220 Service ready for new user.421 Service not available, closing control connection.500 Syntax error, command unrecognized.
Note
The server may send other responses. π Always.
globus_ftp_control_force_close π
globus_result_t globus_ftp_control_force_close (globus_ftp_control_handle_t
* handle, globus_ftp_control_response_callback_t callback, void *
callback_arg)
Force a control connection to close. It force-closes the control connection without waiting for outstanding commands to complete and without sending QUIT. Yeah. Just like that.
This function closes the control channel to the FTP server. Once the final response callback passed to this function is invoked, the control handle can no longer be used for any GridFTP control operations. Gone. Done. Periodt.
Note
Since this function waits until all other callbacks are completed before calling its own callback, it may not be called in a blocking fashion from another callback. That's a trap bestie, don't fall in.
Parameters
handleβ a pointer to a GridFTP control handle. The quit message is issued to the server over the control channel associated with this handle.callbackβ the function to be called once the authentication process is complete or when an error occurs.callback_argβ user supplied argument to the callback function
Returns
- Success
- Null handle
Callback errors:
- success
- failure
Expected callback response values:
GLOBUS_NULL
globus_ftp_control_handle_destroy πΈ
globus_result_t globus_ftp_control_handle_destroy
(globus_ftp_control_handle_t * handle)
Destroy a globus ftp handle. This frees up all dynamically allocated memory associated with a given globus ftp handle. It also removes the handle from a list used by the module activation/deactivation functions. Important: this should only be called after a call to either globus_ftp_control_force_close or globus_ftp_control_quit. Otherwise, no.
Parameters
handleβ the handle to destroy.
Returns
- success
- invalid handle
- handle is still in connected state
globus_ftp_control_handle_init β¨
globus_result_t globus_ftp_control_handle_init (globus_ftp_control_handle_t
* handle)
Initialize a globus ftp handle. This sets up a globus ftp handle (i.e. initializes all the mutexes and variables). It also enters the handle in a list used by the module activation/deactivation functions. Start here, bestie, it's giving setup.
Parameters
handleβ the handle to initialize.
Returns
GLOBUS_SUCCESS- error object
globus_ftp_control_quit π¦
globus_result_t globus_ftp_control_quit (globus_ftp_control_handle_t *
handle, globus_ftp_control_response_callback_t callback, void *
callback_arg)
Send a GridFTP QUIT. This closes the control channel to the FTP server, the polite way. There should be no transfer commands in progress when this is called. Once the final response callback passed to this function is invoked, the control handle can no longer be used for any GridFTP control operations.
Note
Need to further define behavior for when a QUIT happens during a transfer or command is in progress. (yes, that's literally what the docs say, we're all just living with it)
Since this function waits until all other callbacks are completed before calling its own callback, it may not be called in a blocking fashion from another callback. Same energy as before, same warning.
Parameters
handleβ a pointer to a GridFTP control handle. The quit message is issued to the server over the control channel associated with this handle.callbackβ the function to be called once the authentication process is complete or when an error occurs.callback_argβ user supplied argument to the callback function
Returns
- Success
- Null handle
- Command in progress
Callback errors:
- success
- protocol error
- eof
Expected callback response values:
221 Service closing control connection.500 Syntax error, command unrecognized.
Note
The server may send other responses. π« Obviously.
globus_ftp_control_response_copy π
globus_result_t globus_ftp_control_response_copy
(globus_ftp_control_response_t * src, globus_ftp_control_response_t *
dest)
Copy a response structure. This is a lil helper function which copies one response structure to another. That's it. That's the whole vibe. π
Parameters
srcβ this parameter indicates the response structure to copydestβ this parameter specifies the target response structure
Returns
- Error object
GLOBUS_SUCCESS
globus_ftp_control_response_destroy π
globus_result_t globus_ftp_control_response_destroy
(globus_ftp_control_response_t * response)
Free the memory associated with a response. Another helper function β it frees the memory associated with a response structure. Clean up after yourself, bestie. π§
Parameters
responseβ this parameter indicates the response structure to destroy
Returns
- Error object
GLOBUS_SUCCESS
globus_ftp_control_send_command π₯
globus_result_t globus_ftp_control_send_command (globus_ftp_control_handle_t
* handle, const char * cmdspec, globus_ftp_control_response_callback_t
callback, void * callback_arg, ...)
Send an FTP protocol command. This sends an FTP command and registers a handler to receive the FTP reply (or replies, if an intermediate one gets sent). And when the control channel is gss authenticated, the message and the reply are automatically gss wrapped/unwrapped. Iconic behaviour, honestly. π
Parameters
handleβ a pointer to a GridFTP control handle. The command described by thecmdspecis issued to the server over the control channel associated with this handle.cmdspecβ aprintf-style format string containing the text of the command to send to the server. The optional parameters to the format string are passed after thecallback_argin the function invocation.callbackβ the function to be called once the authentication process is complete or when an error occurs.callback_argβ user supplied argument to the callback function...β parameters which will be substituted into the%escapes in thecmdspecstring.
Returns
- Success
- Null handle
- Command already in progress
Callback errors:
- success
- protocol error
- eof
Expected callback response values:
Any defined in RFC 959, 2228, 2389, draft-ietf-ftpext-mlst-10, or the protocol extensions document. So like, the whole extended universe of responses. π
Author β
Generated automatically by Doxygen for globus_ftp_control from the source code. (So if anything's weird, blame the robots, not me. π)
Okay that's the whole page bestie!! This was globus_ftp_control, Version 9.10, living in the globus_ftp...trol_client(3) manual page β go forth and control your FTP with confidence, no cap. πβ¨ππ¦πΈπ
π«Ά
π¦ where this page comes from
- fedora 43: globus-ftp-control-doc 9.10-9.fc43 Β· Apache-2.0
- fedora 44: globus-ftp-control-doc 9.10-10.fc44 Β· Apache-2.0
- ubuntu resolute: libglobus-ftp-control-doc 9.10-3build2 Β· Apache-2.0
- ubuntu stonking: libglobus-ftp-control-doc 9.10-4 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms