Loading...
Searching...
No Matches
GridFTP Server Control
GridFTP Control API

Manage GridFTP Server Control Connections. More...

## 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.

## 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.

## Typedef Documentation

## globus_ftp_control_server_callback_t

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

## 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 )

Copy of GridFTP command.

This function should be called when the user needs to make a copy of a command structure.

Parameters

  dest | The area of memory that the command structure is copied to.
  src | The command structure to be copied.

## globus_ftp_control_command_destroy()

globus_result_t globus_ftp_control_command_destroy | ( | globus_ftp_control_command_t * | command | ) |

Destroy a GridFTP command.

This function frees up the memory allocated to the command argument.

Parameters

  command | The command structure whose associated memory is to be freed

## 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 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.

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_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.

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_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 clients request.

Parameters

  handle | The control connection to send the response across.
  respspec | A formatted string representing the users 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_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 a error occurs, the callback function is called.

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_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.

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_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.

Parameters

  handle | The handle to destroy.

Returns
  - success
  - invalid handle
  - handle is still in listening state

## 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.

Parameters

  handle | The handle to initialize.

Returns
  - GLOBUS_SUCCESS
  - invalid handle

## 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.

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_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.

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_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.

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.