GFAL2 2.22.1
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
File Transfer API

Data Structures

struct  _gfalt_event
 Event message. More...
 

Macros

#define GFAL_TRANSFER_TYPE_STREAMED   "streamed"
 
#define GFAL_TRANSFER_TYPE_PUSH   "3rd push"
 
#define GFAL_TRANSFER_TYPE_PULL   "3rd pull"
 
#define RESOLVE_DNS   "RESOLVE_DNS"
 

Typedefs

typedef struct _gfalt_params_t * gfalt_params_t
 container for transfer related parameters
 
typedef struct _gfalt_transfer_status * gfalt_transfer_status_t
 internal status of a copy file action
 
typedef void(* gfalt_monitor_func) (gfalt_transfer_status_t h, const char *src, const char *dst, gpointer user_data)
 copy gfalt_monitor_transfer This function is called callback_mperiod milli-seconds in order to provide information and a control on the transfers.
 
typedef struct _gfalt_eventgfalt_event_t
 
typedef void(* gfalt_event_func) (const gfalt_event_t e, gpointer user_data)
 

Enumerations

enum  gfal_event_side_t { GFAL_EVENT_SOURCE = 0 , GFAL_EVENT_DESTINATION , GFAL_EVENT_NONE }
 
enum  gfalt_checksum_mode_t { GFALT_CHECKSUM_NONE = 0x00 , GFALT_CHECKSUM_SOURCE = 0x01 , GFALT_CHECKSUM_TARGET = 0x02 , GFALT_CHECKSUM_BOTH = (GFALT_CHECKSUM_SOURCE | GFALT_CHECKSUM_TARGET) }
 

Functions

gfalt_params_t gfalt_params_handle_new (GError **err)
 
void gfalt_params_handle_delete (gfalt_params_t params, GError **err)
 
gfalt_params_t gfalt_params_handle_copy (gfalt_params_t params, GError **err)
 
gint gfalt_set_timeout (gfalt_params_t, guint64 timeout, GError **err)
 
guint64 gfalt_get_timeout (gfalt_params_t handle, GError **err)
 
gint gfalt_set_nbstreams (gfalt_params_t, guint nbstreams, GError **err)
 
guint gfalt_get_nbstreams (gfalt_params_t params, GError **err)
 
gint gfalt_set_tcp_buffer_size (gfalt_params_t, guint64 tcp_buffer_size, GError **err)
 
guint64 gfalt_get_tcp_buffer_size (gfalt_params_t params, GError **err)
 
gint gfalt_set_local_transfer_perm (gfalt_params_t, gboolean local_transfer_status, GError **err)
 
gboolean gfalt_get_local_transfer_perm (gfalt_params_t, GError **err)
 
gint gfalt_set_src_spacetoken (gfalt_params_t params, const char *srm_spacetoken, GError **err)
 
const gchar * gfalt_get_src_spacetoken (gfalt_params_t params, GError **err)
 
gint gfalt_set_dst_spacetoken (gfalt_params_t params, const char *srm_spacetoken, GError **err)
 
const gchar * gfalt_get_dst_spacetoken (gfalt_params_t params, GError **err)
 
gint gfalt_set_replace_existing_file (gfalt_params_t, gboolean replace, GError **err)
 
gboolean gfalt_get_replace_existing_file (gfalt_params_t, GError **err)
 
gint gfalt_set_strict_copy_mode (gfalt_params_t, gboolean strict_mode, GError **err)
 
gboolean gfalt_get_strict_copy_mode (gfalt_params_t, GError **err)
 
 GFAL2_DEPRECATED (gfalt_set_checksum) gint gfalt_set_checksum_check(gfalt_params_t
 
 GFAL2_DEPRECATED (gfalt_get_checksum) gboolean gfalt_get_checksum_check(gfalt_params_t
 
gint gfalt_set_checksum (gfalt_params_t params, gfalt_checksum_mode_t mode, const gchar *type, const gchar *checksum, GError **err)
 
gfalt_checksum_mode_t gfalt_get_checksum (gfalt_params_t params, gchar *type_buff, size_t type_buff_len, gchar *checksum_buff, size_t checksum_buff_len, GError **err)
 
gfalt_checksum_mode_t gfalt_get_checksum_mode (gfalt_params_t params, GError **err)
 
gint gfalt_set_create_parent_dir (gfalt_params_t, gboolean create_parent, GError **err)
 
gboolean gfalt_get_create_parent_dir (gfalt_params_t, GError **err)
 
gint gfalt_set_use_proxy_delegation (gfalt_params_t, gboolean proxy_delegation, GError **err)
 
gboolean gfalt_get_use_proxy_delegation (gfalt_params_t, GError **err)
 
gint gfalt_set_scitag (gfalt_params_t, guint scitag, GError **err)
 
guint gfalt_get_scitag (gfalt_params_t, GError **err)
 
gint gfalt_set_use_evict (gfalt_params_t, gboolean evict, GError **err)
 
gboolean gfalt_get_use_evict (gfalt_params_t, GError **err)
 
gint gfalt_set_stage_request_id (gfalt_params_t, const char *request_id, GError **err)
 
const gchar * gfalt_get_stage_request_id (gfalt_params_t, GError **err)
 
gint gfalt_set_transfer_metadata (gfalt_params_t, const char *metadata, GError **err)
 
const gchar * gfalt_get_transfer_metadata (gfalt_params_t, GError **err)
 
gint gfalt_add_monitor_callback (gfalt_params_t params, gfalt_monitor_func callback, gpointer udata, GDestroyNotify udata_free, GError **err)
 Add a new callback for monitoring the current transfer Adding the same callback with a different udata will just change the udata and the free method, but the callback will not be called twice. In this case, udata_free will be called with the old data. udata_free can be left to NULL.
 
gint gfalt_remove_monitor_callback (gfalt_params_t params, gfalt_monitor_func callback, GError **err)
 Remove an installed monitor callback It will call the method registered to free the user data.
 
gint gfalt_add_event_callback (gfalt_params_t params, gfalt_event_func callback, gpointer udata, GDestroyNotify udata_free, GError **err)
 Add a new callback for event monitoring Adding the same callback with a different udata will just change the udata, but the callback will not be called twice. In this case, udata_free will be called with the old data. udata_free can be left to NULL.
 
gint gfalt_remove_event_callback (gfalt_params_t params, gfalt_event_func callback, GError **err)
 Remove an installed callback It will call the method registered to free the user data.
 
int gfalt_copy_file (gfal2_context_t context, gfalt_params_t params, const char *src, const char *dst, GError **err)
 
int gfalt_copy_bulk (gfal2_context_t context, gfalt_params_t params, size_t nbfiles, const char *const *srcs, const char *const *dsts, const char *const *checksums, GError **op_error, GError ***file_errors)
 bulk copy operation If not provided by the plugin, it will fallback to a serialized implementation Note that file_errors will point to an array of nbfiles pointers to GError, where each one corresponds to the source and destination pair in the same position op_error will contain an error if something happened before file transferring could be attempted
 
gint gfalt_copy_get_status (gfalt_transfer_status_t, GError **err)
 
size_t gfalt_copy_get_average_baudrate (gfalt_transfer_status_t, GError **err)
 
size_t gfalt_copy_get_instant_baudrate (gfalt_transfer_status_t, GError **err)
 
 GFAL2_DEPRECATED (gfalt_copy_get_bytes_transferred) size_t gfalt_copy_get_bytes_transfered(gfalt_transfer_status_t
 
size_t gfalt_copy_get_bytes_transferred (gfalt_transfer_status_t, GError **err)
 
time_t gfalt_copy_get_elapsed_time (gfalt_transfer_status_t, GError **err)
 

Variables

GQuark GFAL_EVENT_PREPARE_ENTER
 Predefined stages.
 
GQuark GFAL_EVENT_PREPARE_EXIT
 
GQuark GFAL_EVENT_TRANSFER_ENTER
 
GQuark GFAL_EVENT_TRANSFER_EXIT
 
GQuark GFAL_EVENT_CLOSE_ENTER
 
GQuark GFAL_EVENT_CLOSE_EXIT
 
GQuark GFAL_EVENT_CHECKSUM_ENTER
 
GQuark GFAL_EVENT_CHECKSUM_EXIT
 
GQuark GFAL_EVENT_CANCEL_ENTER
 
GQuark GFAL_EVENT_CANCEL_EXIT
 
GQuark GFAL_EVENT_OVERWRITE_DESTINATION
 
GQuark GFAL_EVENT_LIST_ENTER
 
GQuark GFAL_EVENT_LIST_ITEM
 
GQuark GFAL_EVENT_LIST_EXIT
 
GQuark GFAL_EVENT_TRANSFER_TYPE
 
GQuark GFAL_EVENT_IPV4
 
GQuark GFAL_EVENT_IPV6
 
GQuark GFAL_EVENT_EVICT
 
GQuark GFAL_EVENT_CLEANUP
 
gboolean value
 
gboolean GError ** err
 
const gchar * chktype
 
const gchar const gchar * checksum
 
gchar * chktype_buff
 
gchar size_t chk_type_len
 
gchar size_t gchar * checksum_buff
 
gchar size_t gchar size_t checksum_len
 

Detailed Description

Macro Definition Documentation

◆ GFAL_TRANSFER_TYPE_STREAMED

#define GFAL_TRANSFER_TYPE_STREAMED   "streamed"

Types for for GFAL_EVENT_TRANSFER_TYPE

◆ RESOLVE_DNS

#define RESOLVE_DNS   "RESOLVE_DNS"

Enable or disable DNS resolution within the copy function

Typedef Documentation

◆ gfalt_event_func

typedef void(* gfalt_event_func) (const gfalt_event_t e, gpointer user_data)

This function is called when a transfer changes its stage.

Parameters
e: Event message.
user_data: external pointer provided before

◆ gfalt_event_t

typedef struct _gfalt_event* gfalt_event_t

Event message

◆ gfalt_monitor_func

typedef void(* gfalt_monitor_func) (gfalt_transfer_status_t h, const char *src, const char *dst, gpointer user_data)

copy gfalt_monitor_transfer This function is called callback_mperiod milli-seconds in order to provide information and a control on the transfers.

Parameters
src: URL of the source file
dst: URL of the dest file
user_data: external pointer provided before

Enumeration Type Documentation

◆ gfal_event_side_t

Trigger of the event

Enumerator
GFAL_EVENT_SOURCE 

Event triggered by the source

GFAL_EVENT_DESTINATION 

Event triggered by the destination

GFAL_EVENT_NONE 

Event triggered by the transfer

◆ gfalt_checksum_mode_t

Checksum verification mode

Enumerator
GFALT_CHECKSUM_NONE 

Don't verify checksum.

GFALT_CHECKSUM_SOURCE 

Compare user provided checksum vs source.

GFALT_CHECKSUM_TARGET 

Compare user provided checksum vs destination.

GFALT_CHECKSUM_BOTH 

Compare user provided checksum vs both, or source checksum vs target checksum.

Function Documentation

◆ GFAL2_DEPRECATED() [1/3]

GFAL2_DEPRECATED ( gfalt_copy_get_bytes_transferred  )

Get the current number of bytes transferred

◆ GFAL2_DEPRECATED() [2/3]

GFAL2_DEPRECATED ( gfalt_get_checksum  )
Deprecated:
Get the checksum verification boolean
Deprecated:
gfalt_get_checksum Get the current user-defined checksum for file content verification If current user-defined checksum is NULL, both of the buffer are set to empty string If the value is set, but not the type, ADLER32 will be assumed

◆ GFAL2_DEPRECATED() [3/3]

GFAL2_DEPRECATED ( gfalt_set_checksum  )
Deprecated:
Equivalent to gfalt_get_checksum_check(params, GFALT_CHECKSUM_BOTH, err) Force additional checksum verification between source and destination an Error is return by the copy function is case of checksum failure.
Warning
for safety reason, even in case of checksum failure the destination file is not removed.
Deprecated:
gfalt_set_checksum Set an user-defined checksum for file content verification Setting NULL & NULL clear the current one. This function requires to enable global checksum verification with gfalt_set_checksum_check
Parameters
param: parameter handle
chktype: checksum type string ( MD5, ADLER32, CRC32, etc... )
checksum: value of checksum in string format
err: GError error report

◆ gfalt_copy_file()

int gfalt_copy_file ( gfal2_context_t  context,
gfalt_params_t  params,
const char *  src,
const char *  dst,
GError **  err 
)
@brief copy function

start a synchronous copy of the file

Parameters
context: gfal2 context
paramsparameter handle ( gfalt_parameters_new )
srcsource URL supported by GFAL
dstdestination URL supported by GFAL
errthe error is put here

◆ gfalt_copy_get_average_baudrate()

size_t gfalt_copy_get_average_baudrate ( gfalt_transfer_status_t  ,
GError **  err 
)

Get an estimation of the average baudrate in bytes/s

◆ gfalt_copy_get_elapsed_time()

time_t gfalt_copy_get_elapsed_time ( gfalt_transfer_status_t  ,
GError **  err 
)

Get the elapsed time since the call to gfalt_copy_file

◆ gfalt_copy_get_instant_baudrate()

size_t gfalt_copy_get_instant_baudrate ( gfalt_transfer_status_t  ,
GError **  err 
)

Get an estimation of the instant baudrate in bytes/s

◆ gfalt_copy_get_status()

gint gfalt_copy_get_status ( gfalt_transfer_status_t  ,
GError **  err 
)

Get a transfer status indicator

◆ gfalt_get_checksum()

gfalt_checksum_mode_t gfalt_get_checksum ( gfalt_params_t  params,
gchar *  type_buff,
size_t  type_buff_len,
gchar *  checksum_buff,
size_t  checksum_buff_len,
GError **  err 
)

Get the checksum configuration

Parameters
type_buffPut in this buffer the configured algorithm (or "\0" if none).
type_buff_lenalgorithm_buffer capacity.
checksum_buffPut in this buffer the configured checksum value ("\0" if none).
checksum_buff_lenchecksum_buff capacity.
errGError error report
Returns
The configured checksum mode
Version
2.13.0

◆ gfalt_get_checksum_mode()

gfalt_checksum_mode_t gfalt_get_checksum_mode ( gfalt_params_t  params,
GError **  err 
)

Get only the checksum mode configured

Returns
The configured checksum mode

◆ gfalt_get_create_parent_dir()

gboolean gfalt_get_create_parent_dir ( gfalt_params_t  ,
GError **  err 
)

Get the parent directory creation value

◆ gfalt_get_dst_spacetoken()

const gchar * gfalt_get_dst_spacetoken ( gfalt_params_t  params,
GError **  err 
)

Get the destination spacetoken for SRM transfers

◆ gfalt_get_local_transfer_perm()

gboolean gfalt_get_local_transfer_perm ( gfalt_params_t  ,
GError **  err 
)

Get the current authorization for the non-third party transfer execution

◆ gfalt_get_nbstreams()

guint gfalt_get_nbstreams ( gfalt_params_t  params,
GError **  err 
)

Get the maximum number of parallels streams to use for the transfer

◆ gfalt_get_replace_existing_file()

gboolean gfalt_get_replace_existing_file ( gfalt_params_t  ,
GError **  err 
)

Get the policy in case of destination file already existing ( replace or cancel ) default : cancel

◆ gfalt_get_scitag()

guint gfalt_get_scitag ( gfalt_params_t  ,
GError **  err 
)

Get the SciTag transfer flow label

◆ gfalt_get_src_spacetoken()

const gchar * gfalt_get_src_spacetoken ( gfalt_params_t  params,
GError **  err 
)

Get the source spacetoken for SRM transfers

◆ gfalt_get_stage_request_id()

const gchar * gfalt_get_stage_request_id ( gfalt_params_t  ,
GError **  err 
)

Get the request id used in the staging operation

◆ gfalt_get_strict_copy_mode()

gboolean gfalt_get_strict_copy_mode ( gfalt_params_t  ,
GError **  err 
)

Get the strict copy mode value

◆ gfalt_get_tcp_buffer_size()

guint64 gfalt_get_tcp_buffer_size ( gfalt_params_t  params,
GError **  err 
)

get the size of the tcp buffer size for network transfer

◆ gfalt_get_timeout()

guint64 gfalt_get_timeout ( gfalt_params_t  handle,
GError **  err 
)

Get the maximum connexion timeout

◆ gfalt_get_transfer_metadata()

const gchar * gfalt_get_transfer_metadata ( gfalt_params_t  ,
GError **  err 
)

Get the transfer metadata to be sent to the disk-buffer

◆ gfalt_get_use_evict()

gboolean gfalt_get_use_evict ( gfalt_params_t  ,
GError **  err 
)

Get the usage of file eviction

◆ gfalt_get_use_proxy_delegation()

gboolean gfalt_get_use_proxy_delegation ( gfalt_params_t  ,
GError **  err 
)

Get the usage of TPC proxy delegation value

◆ gfalt_params_handle_copy()

gfalt_params_t gfalt_params_handle_copy ( gfalt_params_t  params,
GError **  err 
)

Create a copy of a parameter handle

◆ gfalt_params_handle_delete()

void gfalt_params_handle_delete ( gfalt_params_t  params,
GError **  err 
)

Delete a created parameters handle

◆ gfalt_params_handle_new()

gfalt_params_t gfalt_params_handle_new ( GError **  err)

Create a new parameter handle

◆ gfalt_set_checksum()

gint gfalt_set_checksum ( gfalt_params_t  params,
gfalt_checksum_mode_t  mode,
const gchar *  type,
const gchar *  checksum,
GError **  err 
)

Set the checksum configuration to use

Parameters
modeFor GFALT_CHECKSUM_SOURCE or GFALT_CHECKSUM_TARGET only, the checksum value is mandatory. For GFALT_CHECKSUM_BOTH, the checksum value can be NULL, as the verification can be done end to end.
typeChecksum algorithm to use. Support depends on protocol and storage, but ADLER32 and MD5 are normally safe bets. If NULL, previous type is kept.
checksumExpected checksum value. Can be NULL for GFALT_CHECKSUM_BOTH mode. If NULL, clears value.
errGError error report
Returns
0 on success, < 0 on failure
Version
2.13.0

◆ gfalt_set_create_parent_dir()

gint gfalt_set_create_parent_dir ( gfalt_params_t  ,
gboolean  create_parent,
GError **  err 
)

Enable or disable the destination parent directory creation

◆ gfalt_set_dst_spacetoken()

gint gfalt_set_dst_spacetoken ( gfalt_params_t  params,
const char *  srm_spacetoken,
GError **  err 
)

Set the destination spacetoken for SRM transfers

◆ gfalt_set_local_transfer_perm()

gint gfalt_set_local_transfer_perm ( gfalt_params_t  ,
gboolean  local_transfer_status,
GError **  err 
)

Enable or disable the non-third party transfer execution ( default : true )

◆ gfalt_set_nbstreams()

gint gfalt_set_nbstreams ( gfalt_params_t  ,
guint  nbstreams,
GError **  err 
)

Define the maximum number of parallels connexion to use for the file transfer

◆ gfalt_set_replace_existing_file()

gint gfalt_set_replace_existing_file ( gfalt_params_t  ,
gboolean  replace,
GError **  err 
)

set the replace/overwrite option. default : false when True, if a destination file already exist, it is deleted before the copy.

◆ gfalt_set_scitag()

gint gfalt_set_scitag ( gfalt_params_t  ,
guint  scitag,
GError **  err 
)

Set the SciTag transfer flow label

◆ gfalt_set_src_spacetoken()

gint gfalt_set_src_spacetoken ( gfalt_params_t  params,
const char *  srm_spacetoken,
GError **  err 
)

Set the source spacetoken for SRM transfers

◆ gfalt_set_stage_request_id()

gint gfalt_set_stage_request_id ( gfalt_params_t  ,
const char *  request_id,
GError **  err 
)

Set the request id used in the staging operation

◆ gfalt_set_strict_copy_mode()

gint gfalt_set_strict_copy_mode ( gfalt_params_t  ,
gboolean  strict_mode,
GError **  err 
)

Set the strict copy mode default : false In the strict copy mode, the destination/source checks are skipped. only the minimum of the operations are done This option can leads to undefined behavior depending of the underlying protocol

◆ gfalt_set_tcp_buffer_size()

gint gfalt_set_tcp_buffer_size ( gfalt_params_t  ,
guint64  tcp_buffer_size,
GError **  err 
)

Define the size of the tcp buffer size for network transfer

◆ gfalt_set_timeout()

gint gfalt_set_timeout ( gfalt_params_t  ,
guint64  timeout,
GError **  err 
)

Define the maximum time acceptable for the file transfer

◆ gfalt_set_transfer_metadata()

gint gfalt_set_transfer_metadata ( gfalt_params_t  ,
const char *  metadata,
GError **  err 
)

Set the transfer metadata to be sent to the disk-buffer

◆ gfalt_set_use_evict()

gint gfalt_set_use_evict ( gfalt_params_t  ,
gboolean  evict,
GError **  err 
)

Enable or disable usage of file eviction

◆ gfalt_set_use_proxy_delegation()

gint gfalt_set_use_proxy_delegation ( gfalt_params_t  ,
gboolean  proxy_delegation,
GError **  err 
)

Enable or disable usage of TPC proxy delegation

Variable Documentation

◆ GFAL_EVENT_CANCEL_ENTER

GQuark GFAL_EVENT_CANCEL_ENTER
extern

Triggered before the cancellation logic

◆ GFAL_EVENT_CANCEL_EXIT

GQuark GFAL_EVENT_CANCEL_EXIT
extern

Triggered after the cancellation logic

◆ GFAL_EVENT_CHECKSUM_ENTER

GQuark GFAL_EVENT_CHECKSUM_ENTER
extern

Triggered before entering checksum validation

◆ GFAL_EVENT_CHECKSUM_EXIT

GQuark GFAL_EVENT_CHECKSUM_EXIT
extern

Triggered after exiting checksum validation

◆ GFAL_EVENT_CLEANUP

GQuark GFAL_EVENT_CLEANUP
extern

Triggered after a delete to cleanup a failed transfer

◆ GFAL_EVENT_CLOSE_ENTER

GQuark GFAL_EVENT_CLOSE_ENTER
extern

Triggered before entering the closing (putdone)

◆ GFAL_EVENT_CLOSE_EXIT

GQuark GFAL_EVENT_CLOSE_EXIT
extern

Triggered after exiting the closing (putdone)

◆ GFAL_EVENT_EVICT

GQuark GFAL_EVENT_EVICT
extern

Triggered after a file eviction operation

◆ GFAL_EVENT_IPV4

GQuark GFAL_EVENT_IPV4
extern

Triggered to register the transfer is done over IPv4

◆ GFAL_EVENT_IPV6

GQuark GFAL_EVENT_IPV6
extern

Triggered to register the transfer is done over IPv6

◆ GFAL_EVENT_LIST_ENTER

GQuark GFAL_EVENT_LIST_ENTER
extern

Triggered before listing the urls to be transferred

◆ GFAL_EVENT_LIST_EXIT

GQuark GFAL_EVENT_LIST_EXIT
extern

Triggered after listing the urls to be transferred

◆ GFAL_EVENT_LIST_ITEM

GQuark GFAL_EVENT_LIST_ITEM
extern

Triggered once per url pair to be transferred

◆ GFAL_EVENT_OVERWRITE_DESTINATION

GQuark GFAL_EVENT_OVERWRITE_DESTINATION
extern

Triggered before overwriting

◆ GFAL_EVENT_PREPARE_ENTER

GQuark GFAL_EVENT_PREPARE_ENTER
extern

Predefined stages.

Triggered before entering preparation

◆ GFAL_EVENT_PREPARE_EXIT

GQuark GFAL_EVENT_PREPARE_EXIT
extern

Triggered after exiting the preparation

◆ GFAL_EVENT_TRANSFER_ENTER

GQuark GFAL_EVENT_TRANSFER_ENTER
extern

Triggered before entering the transfer

◆ GFAL_EVENT_TRANSFER_EXIT

GQuark GFAL_EVENT_TRANSFER_EXIT
extern

Triggered after exiting the transfer

◆ GFAL_EVENT_TRANSFER_TYPE

GQuark GFAL_EVENT_TRANSFER_TYPE
extern

Triggered to register the transfer type being done