GLOBUS_FTP_CONTROL_SERVER_HANDLE_DESTROY(3)

okay bestie, this is the globus_ftp_control_server(3) page from the Library Functions Manual, and it's literally all about managing GridFTP Server Control Connections. no cap, the server side of GridFTP is the moment. πŸ’…βœ¨

✨ NAME ✨

globus_ftp_control_server β€” GridFTP Server Control πŸ’–

  • Manage GridFTP Server Control Connections.

🌸 SYNOPSIS 🌸

Typedefs

typedef void(* globus_ftp_control_server_callback_t) (void *callback_arg, struct globus_ftp_control_server_s *server_handle, globus_object_t *error)

Server callback. A function with this signature can be used as general callbacks for the GridFTP server API. 🫢

Functions

  • globus_result_t globus_ftp_control_server_handle_init (globus_ftp_control_server_t *handle) β€” Initialize a GridFTP server handle.
  • globus_result_t globus_ftp_control_server_handle_destroy (globus_ftp_control_server_t *handle) β€” Destroy a GridFTP server handle.
  • globus_result_t globus_ftp_control_server_listen (globus_ftp_control_server_t *server_handle, unsigned short *port, globus_ftp_control_server_callback_t callback, void *callback_arg) β€” Listen on for FTP Client Connections.
  • globus_result_t globus_ftp_control_server_listen_ex (globus_ftp_control_server_t *server_handle, globus_io_attr_t *attr, unsigned short *port, globus_ftp_control_server_callback_t callback, void *callback_arg) β€” Listen on for FTP Client Connections.
  • globus_result_t globus_ftp_control_command_init (globus_ftp_control_command_t *command, char *raw_command, globus_ftp_control_auth_info_t *auth_info) β€” Initialize a GridFTP command.
  • globus_result_t globus_ftp_control_command_destroy (globus_ftp_control_command_t *command) β€” Destroy a GridFTP command.
  • globus_result_t globus_ftp_control_command_copy (globus_ftp_control_command_t *dest, globus_ftp_control_command_t *src) β€” Copy of GridFTP command.
  • globus_result_t globus_ftp_control_server_stop (globus_ftp_control_server_t *listener, globus_ftp_control_server_callback_t callback, void *callback_arg) β€” Stop listening for GridFTP client connections.
  • globus_result_t globus_ftp_control_server_accept (globus_ftp_control_server_t *listener, globus_ftp_control_handle_t *handle, globus_ftp_control_callback_t callback, void *callback_arg) β€” Accept a Client Connection.
  • globus_result_t globus_ftp_control_server_authenticate (globus_ftp_control_handle_t *handle, globus_ftp_control_auth_requirements_t auth_requirements, globus_ftp_control_auth_callback_t callback, void *callback_arg) β€” Authenticate a GridFTP Client Connection.
  • globus_result_t globus_ftp_control_read_commands (globus_ftp_control_handle_t *handle, globus_ftp_control_command_callback_t callback, void *callback_arg) β€” Read GridFTP commands.
  • globus_result_t globus_ftp_control_send_response (globus_ftp_control_handle_t *handle, const char *respspec, globus_ftp_control_callback_t callback, void *callback_arg,...) β€” Send a GridFTP response.

πŸ’– Detailed Description πŸ’–

Manage GridFTP Server Control Connections. periodt. That's the whole vibe of this page. πŸ¦‹


πŸŽ€ Typedef Documentation πŸŽ€

typedef void(* globus_ftp_control_server_callback_t) (void *callback_arg, struct globus_ftp_control_server_s *server_handle, globus_object_t *error)

Server callback. A function with this signature can be used as general callbacks for the GridFTP server API. ✨

Parameters

  • server_handle β€” The server handle associated with callback.
  • error β€” Indicates if the operation completed successfully or if a failure occurred.
  • callback_arg β€” The user argument passed to the callback function.

✨ Function Documentation ✨

okay bestie, here's the function tea β˜•οΈ every single one, no skips, no cap. we're keeping all the details, just giving them main character energy πŸ’…


πŸ’– globus_result_t globus_ftp_control_command_copy

globus_result_t globus_ftp_control_command_copy
       (globus_ftp_control_command_t * dest, globus_ftp_control_command_t *
       src)

this one is literally just a copy of a GridFTP command πŸ’… call it when you need to clone a command structure, fr fr.

Parameters:

  • dest β€” the area of memory that the command structure is copied to.
  • src β€” the command structure to be copied.

πŸ¦‹ globus_result_t globus_ftp_control_command_destroy

globus_result_t globus_ftp_control_command_destroy
       (globus_ftp_control_command_t * command)

say bye-bye to a GridFTP command 🫢 this one frees up the memory allocated to the command argument. it's giving cleanup era.

Parameters:

  • command β€” the command structure whose associated memory is to be freed

🌸 globus_result_t globus_ftp_control_command_init

globus_result_t globus_ftp_control_command_init
       (globus_ftp_control_command_t * command, char * raw_command,
       globus_ftp_control_auth_info_t * auth_info)

initialize a GridFTP command ✨ this function sets up 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 figure out what command the client issued. it parses a command string sent by a client and populates the command argument appropriately. and in the GSSAPI case it will also decode and unwrap the command before parsing it. the way that it does all that? iconic.

Parameters:

  • command β€” a pointer to the command structure to be initialized
  • raw_command β€” a null terminated line of client input. should contain one command.
  • auth_info β€” authentication information needed for unwrapping a command

πŸŽ€ globus_result_t globus_ftp_control_read_commands

globus_result_t globus_ftp_control_read_commands
       (globus_ftp_control_handle_t * handle,
       globus_ftp_control_command_callback_t callback, void * callback_arg)

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. lowkey obsessed with that flow.

Parameters:

  • handle β€” 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().
  • callback β€” the user callback that will be called when commands are read.
  • callback_arg β€” the user argument passed to the callback.

πŸ’Œ globus_result_t globus_ftp_control_send_response

globus_result_t globus_ftp_control_send_response
       (globus_ftp_control_handle_t * handle, const char * respspec,
       globus_ftp_control_callback_t callback, void * callback_arg,  ...)

send a GridFTP response πŸ’¬ this function sends a GridFTP formatted response to the client. when a command callback is received the user calls this function to respond to the client's request. periodt.

Parameters:

  • handle β€” the control connection to send the response across.
  • respspec β€” a formatted string representing the user's response.
  • callback β€” the user callback that will be called when the response has been sent.
  • callback_arg β€” the user argument passed to the callback.

πŸ‘‘ globus_result_t globus_ftp_control_server_accept

globus_result_t globus_ftp_control_server_accept
       (globus_ftp_control_server_t * listener, globus_ftp_control_handle_t *
       handle, globus_ftp_control_callback_t callback, void * callback_arg)

accept a client connection 🀝 this function is called to accept a connection request from a client.

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 an error occurs, the callback function is called. slay.

Parameters:

  • listener β€” the server object that received the connection request.
  • handle β€” 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.]
  • callback β€” the function called when the client connection has been accepted.
  • callback_arg β€” the user argument passed to the callback.
Note: this functions assumes the server and control handles have been initialized prior to calling this function.

πŸ” globus_result_t globus_ftp_control_server_authenticate

globus_result_t globus_ftp_control_server_authenticate
       (globus_ftp_control_handle_t * handle,
       globus_ftp_control_auth_requirements_t auth_requirements,
       globus_ftp_control_auth_callback_t callback, void * callback_arg)

authenticate a GridFTP client connection πŸ›‘οΈ this function is called to authenticate a connection from a client.

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. it's giving security era.

Parameters:

  • handle β€” 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.]
  • auth_requirements β€” this structure represents the authentication requirements that the user has for a given connection. for example GridFTP user name, password, and account.
  • callback β€” the function called when the client authentication has been accepted or rejected.
  • callback_arg β€” the user argument passed to the callback.
Note: it is up to the user of this function to send the reply to the last command of the authentication sequence. this functions assumes the server and control handles have been initialized prior to calling this function.

🧹 globus_result_t globus_ftp_control_server_handle_destroy

globus_result_t globus_ftp_control_server_handle_destroy
       (globus_ftp_control_server_t * handle)

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. no cap.

Parameters:

  • handle β€” the handle to destroy.

Returns:

  • success
  • invalid handle
  • handle is still in listening state

🌱 globus_result_t globus_ftp_control_server_handle_init

globus_result_t globus_ftp_control_server_handle_init
       (globus_ftp_control_server_t * handle)

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. fresh start energy.

Parameters:

  • handle β€” the handle to initialize.

Returns:

  • GLOBUS_SUCCESS
  • invalid handle

πŸ‘‚ globus_result_t globus_ftp_control_server_listen

globus_result_t globus_ftp_control_server_listen
       (globus_ftp_control_server_t * server_handle, unsigned short * port,
       globus_ftp_control_server_callback_t callback, void * callback_arg)

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. it's giving main character server vibes.

Parameters:

  • server_handle β€” a pointer to a initialized server handle.
  • port β€” a pointer to the port to listen on. if the initial value is zero it will be set to the default value.
  • callback β€” the callback function called when connection requests are made.
  • callback_arg β€” the user argument passed to the callback function when connection requests are made.
Note: I'm not providing any mechanism for making sure that this function is only called once. Is this needed?

πŸ¦‹ globus_result_t globus_ftp_control_server_listen_ex

globus_result_t globus_ftp_control_server_listen_ex
       (globus_ftp_control_server_t * server_handle, globus_io_attr_t * attr,
       unsigned short * port, globus_ftp_control_server_callback_t callback,
       void * callback_arg)

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.

this is an extendend version of globus_ftp_control_server_listen() that provides additional control over the listening socket. yes, "extendend" is a typo in the original, and we're keeping it because it's iconic in its own way πŸ’…

Parameters:

  • server_handle β€” a pointer to a initialized server handle.
  • attr β€” a pointer to a globus_io_attr_t providing additional attributes for the listening socket.
  • port β€” a pointer to the port to listen on. if the initial value is zero it will be set to the default value.
  • callback β€” the callback function called when connection requests are made.
  • callback_arg β€” the user argument passed to the callback function when connection requests are made.
Note: I'm not providing any mechanism for making sure that this function is only called once. Is this needed?

πŸ›‘ globus_result_t globus_ftp_control_server_stop

globus_result_t globus_ftp_control_server_stop (globus_ftp_control_server_t
       * listener, globus_ftp_control_server_callback_t callback, void *
       callback_arg)

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. so like, no new besties, but the old ones stay. periodt.

Parameters:

  • listener β€” the globus_ftp_control_server_t object that should no longer listen for connections.
  • callback β€” the user callback that will be called when the server structure is no longer listening.
  • callback_arg β€” the user argument that is passed into callback.

✨ Author ✨

generated automatically by Doxygen for globus_ftp_control from the source code. it's giving auto-generated realness πŸ“


source: globus_ftp_control Version 9.10, page globus_ftp...trol_server(3) β€” no date on this one, but it's still iconic πŸ’– stay slaying, bestie 🫢

πŸ“¦ where this page comes from