.TH "globus_ftp_control_server" 3 "Tue Jul 5 2022" "Version 9.10" "globus_ftp_control" \" -*- nroff -*- .ad l .nh .SH NAME globus_ftp_control_server \- GridFTP Server Control .PP \- Manage GridFTP Server Control Connections\&. .SH SYNOPSIS .br .PP .SS "Typedefs" .in +1c .ti -1c .RI "typedef void(* \fBglobus_ftp_control_server_callback_t\fP) (void *callback_arg, struct globus_ftp_control_server_s *server_handle, globus_object_t *error)" .br .RI "Server callback\&. " .in -1c .SS "Functions" .in +1c .ti -1c .RI "globus_result_t \fBglobus_ftp_control_server_handle_init\fP (globus_ftp_control_server_t *handle)" .br .RI "Initialize a GridFTP server handle\&. " .ti -1c .RI "globus_result_t \fBglobus_ftp_control_server_handle_destroy\fP (globus_ftp_control_server_t *handle)" .br .RI "Destroy a GridFTP server handle\&. " .ti -1c .RI "globus_result_t \fBglobus_ftp_control_server_listen\fP (globus_ftp_control_server_t *server_handle, unsigned short *port, \fBglobus_ftp_control_server_callback_t\fP callback, void *callback_arg)" .br .RI "Listen on for FTP Client Connections\&. " .ti -1c .RI "globus_result_t \fBglobus_ftp_control_server_listen_ex\fP (globus_ftp_control_server_t *server_handle, globus_io_attr_t *attr, unsigned short *port, \fBglobus_ftp_control_server_callback_t\fP callback, void *callback_arg)" .br .RI "Listen on for FTP Client Connections\&. " .ti -1c .RI "globus_result_t \fBglobus_ftp_control_command_init\fP (globus_ftp_control_command_t *command, char *raw_command, \fBglobus_ftp_control_auth_info_t\fP *auth_info)" .br .RI "Initialize a GridFTP command\&. " .ti -1c .RI "globus_result_t \fBglobus_ftp_control_command_destroy\fP (globus_ftp_control_command_t *command)" .br .RI "Destroy a GridFTP command\&. " .ti -1c .RI "globus_result_t \fBglobus_ftp_control_command_copy\fP (globus_ftp_control_command_t *dest, globus_ftp_control_command_t *src)" .br .RI "Copy of GridFTP command\&. " .ti -1c .RI "globus_result_t \fBglobus_ftp_control_server_stop\fP (globus_ftp_control_server_t *listener, \fBglobus_ftp_control_server_callback_t\fP callback, void *callback_arg)" .br .RI "Stop listening for GridFTP client connections\&. " .ti -1c .RI "globus_result_t \fBglobus_ftp_control_server_accept\fP (globus_ftp_control_server_t *listener, globus_ftp_control_handle_t *handle, \fBglobus_ftp_control_callback_t\fP callback, void *callback_arg)" .br .RI "Accept a Client Connection\&. " .ti -1c .RI "globus_result_t \fBglobus_ftp_control_server_authenticate\fP (globus_ftp_control_handle_t *handle, \fBglobus_ftp_control_auth_requirements_t\fP auth_requirements, \fBglobus_ftp_control_auth_callback_t\fP callback, void *callback_arg)" .br .RI "Authenticate a GridFTP Client Connection\&. " .ti -1c .RI "globus_result_t \fBglobus_ftp_control_read_commands\fP (globus_ftp_control_handle_t *handle, \fBglobus_ftp_control_command_callback_t\fP callback, void *callback_arg)" .br .RI "Read GridFTP commands\&. " .ti -1c .RI "globus_result_t \fBglobus_ftp_control_send_response\fP (globus_ftp_control_handle_t *handle, const char *respspec, \fBglobus_ftp_control_callback_t\fP callback, void *callback_arg,\&.\&.\&.)" .br .RI "Send a GridFTP response\&. " .in -1c .SH "Detailed Description" .PP Manage GridFTP Server Control Connections\&. .SH "Typedef Documentation" .PP .SS "typedef void(* globus_ftp_control_server_callback_t) (void *callback_arg, struct globus_ftp_control_server_s *server_handle, globus_object_t *error)" .PP Server callback\&. A function with this signature can be used as general callbacks for the GridFTP server API\&. .PP \fBParameters\fP .RS 4 \fIserver_handle\fP The server handle associated with callback\&. .br \fIerror\fP Indicates if the operation completed successfully or if a failure occurred\&. .br \fIcallback_arg\fP The user argument passed to the callback function\&. .RE .PP .SH "Function Documentation" .PP .SS "globus_result_t globus_ftp_control_command_copy (globus_ftp_control_command_t * dest, globus_ftp_control_command_t * src)" .PP Copy of GridFTP command\&. This function should be called when the user needs to make a copy of a command structure\&. .PP \fBParameters\fP .RS 4 \fIdest\fP The area of memory that the command structure is copied to\&. .br \fIsrc\fP The command structure to be copied\&. .RE .PP .SS "globus_result_t globus_ftp_control_command_destroy (globus_ftp_control_command_t * command)" .PP Destroy a GridFTP command\&. This function frees up the memory allocated to the command argument\&. .PP \fBParameters\fP .RS 4 \fIcommand\fP The command structure whose associated memory is to be freed .RE .PP .SS "globus_result_t globus_ftp_control_command_init (globus_ftp_control_command_t * command, char * raw_command, \fBglobus_ftp_control_auth_info_t\fP * auth_info)" .PP Initialize a GridFTP command\&. This function initializes a command structure based on a null terminated string representing one line of input from the client\&. The command structure is used as a convenience to determine what command the client issued\&. This function parses a command string sent by a client and populates the command argument appropriately\&. In the GSSAPI case it will also decode and unwrap the command before parsing it\&. .br .PP \fBParameters\fP .RS 4 \fIcommand\fP A pointer to the command structure to be initialized .br \fIraw_command\fP A null terminated line of client input\&. Should contain one command\&. .br \fIauth_info\fP Authentication information needed for unwrapping a command .RE .PP .SS "globus_result_t globus_ftp_control_read_commands (globus_ftp_control_handle_t * handle, \fBglobus_ftp_control_command_callback_t\fP callback, void * callback_arg)" .PP Read GridFTP commands\&. This function begins reading control commands on a globus_ftp_control_handle_t\&. When a command is read the callback function is called\&. .PP \fBParameters\fP .RS 4 \fIhandle\fP The control connection handle that commands will be read from\&. Prior to calling this the function globus_ftp_control_handle_t must be populated via a call to globus_ftp_control_accept()\&. .br \fIcallback\fP The user callback that will be called when commands are read\&. .br \fIcallback_arg\fP The user argument passed to the callback\&. .RE .PP .SS "globus_result_t globus_ftp_control_send_response (globus_ftp_control_handle_t * handle, const char * respspec, \fBglobus_ftp_control_callback_t\fP callback, void * callback_arg, \&.\&.\&.)" .PP Send a GridFTP response\&. This function sends a GridFTP formatted response to the client\&. .br When a command callback is received the user calls this function to respond to the clients request\&. .PP \fBParameters\fP .RS 4 \fIhandle\fP The control connection to send the response across\&. .br \fIrespspec\fP A formatted string representing the users response\&. .br \fIcallback\fP The user callback that will be called when the response has been sent\&. .br \fIcallback_arg\fP The user argument passed to the callback\&. .RE .PP .SS "globus_result_t globus_ftp_control_server_accept (globus_ftp_control_server_t * listener, globus_ftp_control_handle_t * handle, \fBglobus_ftp_control_callback_t\fP callback, void * callback_arg)" .PP Accept a Client Connection\&. This function is called to accept a connection request from a client\&. .PP When the listen callback is called (see globus_ftp_control_server_listen) a client has requested a connection\&. This function must be called to accept that user connection request\&. Once the connection is established or if a error occurs, the callback function is called\&. .PP \fBParameters\fP .RS 4 \fIlistener\fP The server object that received the connection request\&. .br \fIhandle\fP The control connection object\&. This structure will be populated and passed to the callback when the client is authorized\&. This structure represents the control connection between the server and client\&. It will be used to read commands from the client and send responses to the client\&.] .br \fIcallback\fP The function called when the client connection has been accepted\&. .br \fIcallback_arg\fP The user argument passed to the callback\&. .RE .PP \fBNote\fP .RS 4 This functions assumes the server and control handles have been initialized prior to calling this function\&. .RE .PP .SS "globus_result_t globus_ftp_control_server_authenticate (globus_ftp_control_handle_t * handle, \fBglobus_ftp_control_auth_requirements_t\fP auth_requirements, \fBglobus_ftp_control_auth_callback_t\fP callback, void * callback_arg)" .PP Authenticate a GridFTP Client Connection\&. This function is called to authenticate a connection from a client\&. .PP After a client connection has been accepted (using the globus_ftp_control_server_accept call), this function should be called to authenticate the client\&. The caller of this function may specify certain authentication requirements using the auth_requirements parameter\&. .PP \fBParameters\fP .RS 4 \fIhandle\fP The control connection object\&. This structure will be populated and passed to the callback when the client is authorized\&. This structure represents the control connection between the server and client\&. It will be used to read commands from the client and send responses to the client\&.] .br \fIauth_requirements\fP This structure represents the authentication requirements that the user has for a given connection\&. For example GridFTP user name, password, and account\&. .br \fIcallback\fP The function called when the client authentication has been accepted or rejected\&. .br \fIcallback_arg\fP The user argument passed to the callback\&. .RE .PP \fBNote\fP .RS 4 It is up to the user of this function to send the reply to the last command of the authentication sequence\&. .PP This functions assumes the server and control handles have been initialized prior to calling this function\&. .RE .PP .SS "globus_result_t globus_ftp_control_server_handle_destroy (globus_ftp_control_server_t * handle)" .PP Destroy a GridFTP server handle\&. This function will free up all dynamically allocated memory associated with a given globus ftp server handle\&. It will also remove the handle from a list used by the module activation/deactivation functions\&. This function should only be called after a call to globus_ftp_control_server_stop\&. .PP \fBParameters\fP .RS 4 \fIhandle\fP The handle to destroy\&. .RE .PP \fBReturns\fP .RS 4 .IP "\(bu" 2 success .IP "\(bu" 2 invalid handle .IP "\(bu" 2 handle is still in listening state .PP .RE .PP .SS "globus_result_t globus_ftp_control_server_handle_init (globus_ftp_control_server_t * handle)" .PP Initialize a GridFTP server handle\&. This function will set up (i\&.e\&. initialize all mutexes and variables) a globus ftp server handle\&. It will also enter the handle in a list used by the module activation/deactivation functions\&. .PP \fBParameters\fP .RS 4 \fIhandle\fP The handle to initialize\&. .RE .PP \fBReturns\fP .RS 4 .IP "\(bu" 2 GLOBUS_SUCCESS .IP "\(bu" 2 invalid handle .PP .RE .PP .SS "globus_result_t globus_ftp_control_server_listen (globus_ftp_control_server_t * server_handle, unsigned short * port, \fBglobus_ftp_control_server_callback_t\fP callback, void * callback_arg)" .PP Listen on for FTP Client Connections\&. This function starts the listening on *port for connections from ftp clients\&. When a connection request is made callback is called and passed callback_arg\&. Upon return from this function the server_handle structure is initialized\&. .PP \fBParameters\fP .RS 4 \fIserver_handle\fP A pointer to a initialized server handle\&. .br \fIport\fP A pointer to the port to listen on\&. If the initial value is zero it will be set to the default value\&. .br \fIcallback\fP The callback function called when connection requests are made\&. .br \fIcallback_arg\fP The user argument passed to the callback function when connection requests are made\&. .RE .PP \fBNote\fP .RS 4 I'm not providing any mechanism for making sure that this function is only called once\&. Is this needed? .RE .PP .SS "globus_result_t globus_ftp_control_server_listen_ex (globus_ftp_control_server_t * server_handle, globus_io_attr_t * attr, unsigned short * port, \fBglobus_ftp_control_server_callback_t\fP callback, void * callback_arg)" .PP Listen on for FTP Client Connections\&. This function starts the listening on *port for connections from ftp clients\&. When a connection request is made callback is called and passed callback_arg\&. Upon return from this function the server_handle structure is initialized\&. .PP This is an extendend version of \fBglobus_ftp_control_server_listen()\fP that provides additional control over the listening socket\&. .PP \fBParameters\fP .RS 4 \fIserver_handle\fP A pointer to a initialized server handle\&. .br \fIattr\fP A pointer to a globus_io_attr_t providing additional attributes for the listening socket\&. .br \fIport\fP A pointer to the port to listen on\&. If the initial value is zero it will be set to the default value\&. .br \fIcallback\fP The callback function called when connection requests are made\&. .br \fIcallback_arg\fP The user argument passed to the callback function when connection requests are made\&. .RE .PP \fBNote\fP .RS 4 I'm not providing any mechanism for making sure that this function is only called once\&. Is this needed? .RE .PP .SS "globus_result_t globus_ftp_control_server_stop (globus_ftp_control_server_t * listener, \fBglobus_ftp_control_server_callback_t\fP callback, void * callback_arg)" .PP Stop listening for GridFTP client connections\&. This function stops listening on the given listener object for client connections\&. All existing client connections are left open\&. .PP \fBParameters\fP .RS 4 \fIlistener\fP the globus_ftp_control_server_t object that should no longer listen for connections\&. .br \fIcallback\fP The user callback that will be called when the server structure is no longer listening\&. .br \fIcallback_arg\fP The user argument that is passed into callback\&. .RE .PP .SH "Author" .PP Generated automatically by Doxygen for globus_ftp_control from the source code\&.