globus_gass_copy  9.32
 All Data Structures Files Functions Variables Typedefs Enumerations Groups Pages
globus_gass_copy.h
Go to the documentation of this file.
1 
2 #ifndef GLOBUS_GASS_COPY_H
3 #define GLOBUS_GASS_COPY_H
4 
5 #include <openssl/evp.h>
6 
12 #ifndef GLOBUS_GLOBAL_DOCUMENT_SET
13 
17 #endif
18 
41 #include "globus_gass_transfer.h"
42 #include "globus_ftp_client.h"
43 #include "globus_io.h"
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
80 #define GLOBUS_GASS_COPY_MODULE (&globus_i_gass_copy_module)
81 
82 extern
83 globus_module_descriptor_t globus_i_gass_copy_module;
84 
85 #define _GASCSL(s) globus_common_i18n_get_string( \
86  GLOBUS_GASS_COPY_MODULE, \
87  s)
88 
89 #define CKSM_SIZE (EVP_MAX_MD_SIZE * 2 + 1)
90 
91 typedef struct globus_gass_copy_state_s globus_gass_copy_state_t;
93 typedef struct globus_gass_copy_perf_info_s globus_gass_copy_perf_info_t;
94 
128  void * user_arg,
129  globus_gass_copy_handle_t * handle,
130  globus_off_t total_bytes,
131  float instantaneous_throughput,
132  float avg_throughput);
133 
142  void * callback_arg,
143  globus_gass_copy_handle_t * handle,
144  globus_object_t * error);
145 
150 typedef enum
151 {
152  GLOBUS_GASS_COPY_STATUS_NONE,
153  GLOBUS_GASS_COPY_STATUS_PENDING,
154  GLOBUS_GASS_COPY_STATUS_INITIAL,
155  GLOBUS_GASS_COPY_STATUS_SOURCE_READY,
156  GLOBUS_GASS_COPY_STATUS_TRANSFER_IN_PROGRESS,
157  GLOBUS_GASS_COPY_STATUS_READ_COMPLETE,
158  GLOBUS_GASS_COPY_STATUS_WRITE_COMPLETE,
159  GLOBUS_GASS_COPY_STATUS_DONE,
160  GLOBUS_GASS_COPY_STATUS_FAILURE,
161  GLOBUS_GASS_COPY_STATUS_CANCEL,
162  GLOBUS_GASS_COPY_STATUS_DONE_SUCCESS,
163  GLOBUS_GASS_COPY_STATUS_DONE_FAILURE,
164  GLOBUS_GASS_COPY_STATUS_DONE_CANCELLED
166 
171 typedef enum
172 {
173  GLOBUS_GASS_COPY_URL_MODE_UNSUPPORTED,
174  GLOBUS_GASS_COPY_URL_MODE_FTP,
175  GLOBUS_GASS_COPY_URL_MODE_GASS,
176  GLOBUS_GASS_COPY_URL_MODE_IO
178 
184 {
189 
194  globus_gass_copy_state_t *state;
195 
200 
205  globus_gass_copy_perf_info_t *performance;
206 
211  globus_bool_t external_third_party;
212 
217 
222 
227 
232 
236  globus_object_t *err;
237 
242 
250 
251  globus_ftp_client_handle_t ftp_handle;
255  globus_ftp_client_handle_t ftp_handle_2;
256 
261  globus_off_t partial_offset;
262  globus_off_t partial_end_offset;
263  globus_off_t partial_bytes_remaining;
268  globus_bool_t send_allo;
269 
273  globus_bool_t always_stat_on_expand;
274 };
275 
284 {
285  globus_ftp_client_operationattr_t * ftp_attr;
286  globus_io_attr_t * io;
287  globus_gass_transfer_requestattr_t * gass_requestattr;
289 
298 {
299  globus_ftp_client_handleattr_t * ftp_attr;
301 
302 /* initialization and destruction of GASS Copy handle */
303 globus_result_t
305  globus_gass_copy_handle_t * handle,
306  globus_gass_copy_handleattr_t * handle_attr);
307 
308 globus_result_t
310  globus_gass_copy_handle_t * handle);
311 
312 globus_result_t
313 globus_gass_copy_handleattr_init(
314  globus_gass_copy_handleattr_t * handle_attr);
315 
316 globus_result_t
317 globus_gass_copy_handleattr_destroy(
318  globus_gass_copy_handleattr_t * handle_attr);
319 
320 globus_result_t
321 globus_gass_copy_handleattr_set_ftp_attr(
322  globus_gass_copy_handleattr_t * handle_attr,
323  globus_ftp_client_handleattr_t * ftp_attr);
324 
325 /* set the size of the buffer to be used for the transfers */
326 globus_result_t
328  globus_gass_copy_handle_t * handle,
329  int length);
330 
331 /* get the size of the buffer being used for the transfers */
332 globus_result_t
334  globus_gass_copy_handle_t * handle,
335  int * length);
336 
337 /* sets whether third_party transfers should be used for ftp to
338  * ftp transfers */
339 globus_result_t
341  globus_gass_copy_handle_t * handle,
342  globus_bool_t no_third_party_transfers);
343 
344 /* get the size of the buffer being used for the transfers */
345 globus_result_t
347  globus_gass_copy_handle_t * handle,
348  globus_bool_t * no_third_party_transfers);
349 
350 /* get offsets for partial file transfer */
351 globus_result_t
353  globus_gass_copy_handle_t * handle,
354  globus_off_t * offset,
355  globus_off_t * end_offset);
356 
357 /* set offsets for partial file transfer */
358 globus_result_t
360  globus_gass_copy_handle_t * handle,
361  globus_off_t offset,
362  globus_off_t end_offset);
363 
364 /* send ALLO to ftp destinations */
365 globus_result_t
367  globus_gass_copy_handle_t * handle,
368  globus_bool_t send_allo);
369 
370 
371 /* run a stat check on all urls passed to globus_gass_copy_glob_expand_url
372  FALSE by default
373  */
374 
375 globus_result_t
377  globus_gass_copy_handle_t * handle,
378  globus_bool_t always_stat);
379 
380 globus_result_t
382  globus_gass_copy_handle_t * handle,
383  char * algo,
384  globus_gass_copy_handle_t * cksm_handle);
385 
386 globus_result_t
388  globus_gass_copy_handle_t * handle,
389  char * cksm);
390 
391 /* find out what transfer mode will be used for a given url, so that the proper attributes may be passed to one of the copy function */
392 globus_result_t
394  char * url,
396 
397 /* get current ftp client handle -- use with care if modifying the handle */
398 globus_result_t
399 globus_gass_copy_get_ftp_handle(
400  globus_gass_copy_handle_t * handle,
401  globus_ftp_client_handle_t * ftp_handle);
402 
403 /* initialize the attr structure */
404 globus_result_t
406  globus_gass_copy_attr_t * attr);
407 
408 /* functions for setting attributes for specific protocols */
409 globus_result_t
412  globus_ftp_client_operationattr_t * ftp_attr);
413 
414 globus_result_t
417  globus_io_attr_t * io_attr);
418 
419 globus_result_t
422  globus_gass_transfer_requestattr_t * gass_attr);
423 
424 /*
425  * copy functions (blocking)
426  */
427 globus_result_t
429  globus_gass_copy_handle_t * handle,
430  char * source_url,
431  globus_gass_copy_attr_t * source_attr,
432  char * dest_url,
433  globus_gass_copy_attr_t * dest_attr);
434 
435 globus_result_t
437  globus_gass_copy_handle_t * handle,
438  char * source_url,
439  globus_gass_copy_attr_t * source_attr,
440  globus_io_handle_t * dest_handle);
441 
442 globus_result_t
444  globus_gass_copy_handle_t * handle,
445  globus_io_handle_t * source_handle,
446  char * dest_url,
447  globus_gass_copy_attr_t * dest_attr);
448 
449 /*
450  * copy functions (asyncronous)
451  */
452 globus_result_t
454  globus_gass_copy_handle_t * handle,
455  char * source_url,
456  globus_gass_copy_attr_t * dest_attr,
457  char * dest_url,
458  globus_gass_copy_attr_t * source_attr,
459  globus_gass_copy_callback_t callback_func,
460  void * callback_arg);
461 
462 globus_result_t
464  globus_gass_copy_handle_t * handle,
465  char * source_url,
466  globus_gass_copy_attr_t * source_attr,
467  globus_io_handle_t * dest_handle,
468  globus_gass_copy_callback_t callback_func,
469  void * callback_arg);
470 
471 globus_result_t
473  globus_gass_copy_handle_t * handle,
474  globus_io_handle_t * source_handle,
475  char * dest_url,
476  globus_gass_copy_attr_t * dest_attr,
477  globus_gass_copy_callback_t callback_func,
478  void * callback_arg);
479 
480 /*
481  * get the status code of the current transfer
482  */
483 globus_result_t
485  globus_gass_copy_handle_t * handle,
486  globus_gass_copy_status_t *status);
487 
488 /*
489  * get the status string of the current transfer
490  */
491 
492 const char *
494  globus_gass_copy_handle_t * handle);
495 
496 /*
497  * cancel the current transfer
498  */
499 globus_result_t
501  globus_gass_copy_handle_t * handle,
502  globus_gass_copy_callback_t cancel_callback,
503  void * cancel_callback_arg);
504 
505 /*
506  * cache handles functions
507  *
508  * Use this when transferring mulitple files from or to the same host
509  */
510 globus_result_t
512  globus_gass_copy_handle_t * handle,
513  char * url);
514 
515 globus_result_t
517  globus_gass_copy_handle_t * handle,
518  char * url);
519 
520 /*
521  * get/set user pointers from/to GASS Copy handles
522  */
523 globus_result_t
525  globus_gass_copy_handle_t * handle,
526  void * user_data);
527 
528 globus_result_t
530  globus_gass_copy_handle_t * handle,
531  void ** user_data);
532 
533 globus_result_t
535  globus_gass_copy_handle_t * handle,
537  void * user_arg);
538 
539 /*
540  * Set Attribute functions
541  */
542 
543 #ifdef USE_FTP
544 /* TCP buffer/window size */
545 globus_result_t
546 globus_gass_copy_attr_set_tcpbuffer(
548  globus_ftp_control_tcpbuffer_t * tcpbuffer_info);
549 
550 /* parallel transfer options */
551 globus_result_t
552 globus_gass_copy_attr_set_parallelism(
554  globus_ftp_control_parallelism_t * parallelism_info);
555 
556 /* striping options */
557 globus_result_t
558 globus_gass_copy_attr_set_striping(
560  globus_ftp_control_striping_t * striping_info);
561 
562 /* authorization options */
563 globus_result_t
564 globus_gass_copy_attr_set_authorization(
566  globus_io_authorization_t * authorization_info);
567 
568 /* secure channel options */
569 globus_result_t
570 globus_gass_copy_attr_set_secure_channel(
572  globus_io_secure_channel_t * secure_channel_info);
573 #endif
574 
579 typedef enum {
580  GLOBUS_GASS_COPY_GLOB_ENTRY_UNKNOWN,
581  GLOBUS_GASS_COPY_GLOB_ENTRY_FILE,
582  GLOBUS_GASS_COPY_GLOB_ENTRY_DIR,
583  GLOBUS_GASS_COPY_GLOB_ENTRY_OTHER
585 
590 typedef struct
591 {
595 
601  char * unique_id;
602 
607 
611  int mode;
612 
616  int mdtm;
617 
621  globus_off_t size;
623 
646  const char * url,
647  const globus_gass_copy_glob_stat_t * info_stat,
648  void * user_arg);
649 
682 globus_result_t
684  globus_gass_copy_handle_t * handle,
685  const char * url,
688  void * user_arg);
689 
713 globus_result_t
715  globus_gass_copy_handle_t * handle,
716  char * url,
717  globus_gass_copy_attr_t * attr);
718 
719 globus_result_t
720 globus_gass_copy_cksm(
721  globus_gass_copy_handle_t * handle,
722  char * url,
724  globus_off_t offset,
725  globus_off_t length,
726  const char * algorithm,
727  char * cksm);
728 
729 globus_result_t
730 globus_gass_copy_cksm_async(
731  globus_gass_copy_handle_t * handle,
732  char * url,
734  globus_off_t offset,
735  globus_off_t length,
736  const char * algorithm,
737  char * cksm,
739  void * callback_arg);
740 
741 globus_result_t
742 globus_gass_copy_stat(
743  globus_gass_copy_handle_t * handle,
744  char * url,
746  globus_gass_copy_glob_stat_t * stat_info);
747 
748 #ifdef __cplusplus
749 }
750 #endif
751 
752 #endif /* GLOBUS_GASS_COPY_H */
globus_bool_t external_third_party
Definition: globus_gass_copy.h:211
globus_gass_copy_status_t
Status States.
Definition: globus_gass_copy.h:150
globus_result_t globus_gass_copy_attr_set_gass(globus_gass_copy_attr_t *attr, globus_gass_transfer_requestattr_t *gass_attr)
Set the http/https attributes.
Definition: globus_gass_copy.c:1060
globus_off_t partial_offset
Definition: globus_gass_copy.h:261
globus_result_t globus_gass_copy_set_buffer_length(globus_gass_copy_handle_t *handle, int length)
Set the size of the buffer to be used for doing transfers.
Definition: globus_gass_copy.c:512
globus_gass_copy_glob_entry_t type
Definition: globus_gass_copy.h:594
globus_result_t globus_gass_copy_set_checksum_algo(globus_gass_copy_handle_t *handle, char *algo, globus_gass_copy_handle_t *cksm_handle)
Stores the checksum algorithm to use with all checksum operations.
Definition: globus_gass_copy.c:726
void(* globus_gass_copy_performance_cb_t)(void *user_arg, globus_gass_copy_handle_t *handle, globus_off_t total_bytes, float instantaneous_throughput, float avg_throughput)
Performance Callback.
Definition: globus_gass_copy.h:127
globus_result_t globus_gass_copy_flush_url_state(globus_gass_copy_handle_t *handle, char *url)
Remove an FTP or GridFTP cached connection.
Definition: globus_gass_copy.c:6128
Handle Attributes.
Definition: globus_gass_copy.h:297
const char * globus_gass_copy_get_status_string(globus_gass_copy_handle_t *handle)
Get the status string of a transfer.
Definition: globus_gass_copy.c:1715
globus_gass_copy_callback_t user_callback
Definition: globus_gass_copy.h:216
globus_bool_t no_third_party_transfers
Definition: globus_gass_copy.h:249
void(* globus_gass_copy_callback_t)(void *callback_arg, globus_gass_copy_handle_t *handle, globus_object_t *error)
Copy Callback.
Definition: globus_gass_copy.h:141
globus_result_t globus_gass_copy_set_no_third_party_transfers(globus_gass_copy_handle_t *handle, globus_bool_t no_third_party_transfers)
Enable/Disable third-party transfers.
Definition: globus_gass_copy.c:595
globus_result_t globus_gass_copy_get_url_mode(char *url, globus_gass_copy_url_mode_t *mode)
Get URL scheme.
Definition: globus_gass_copy.c:1107
globus_result_t globus_gass_copy_get_status(globus_gass_copy_handle_t *handle, globus_gass_copy_status_t *status)
Get the status code of a transfer.
Definition: globus_gass_copy.c:1641
Glob expanded entry information.
Definition: globus_gass_copy.h:590
void * callback_arg
Definition: globus_gass_copy.h:221
char * unique_id
Definition: globus_gass_copy.h:601
globus_result_t globus_gass_copy_handle_to_url(globus_gass_copy_handle_t *handle, globus_io_handle_t *source_handle, char *dest_url, globus_gass_copy_attr_t *dest_attr)
Blocking transfer from an IO handle to an URL.
Definition: globus_gass_copy.c:5214
struct globus_gass_copy_attr_s globus_gass_copy_attr_t
Attributes.
Attributes.
Definition: globus_gass_copy.h:283
globus_result_t globus_gass_copy_register_performance_cb(globus_gass_copy_handle_t *handle, globus_gass_copy_performance_cb_t callback, void *user_arg)
Register a performance information callback.
Definition: globus_gass_copy.c:1184
globus_result_t globus_gass_copy_url_to_handle(globus_gass_copy_handle_t *handle, char *source_url, globus_gass_copy_attr_t *source_attr, globus_io_handle_t *dest_handle)
Blocking Transfer from an URL to an IO handle.
Definition: globus_gass_copy.c:5082
globus_result_t globus_gass_copy_get_no_third_party_transfers(globus_gass_copy_handle_t *handle, globus_bool_t *no_third_party_transfers)
Query third-party transfer status.
Definition: globus_gass_copy.c:654
globus_gass_copy_glob_entry_t
Definition: globus_gass_copy.h:579
globus_result_t globus_gass_copy_cancel(globus_gass_copy_handle_t *handle, globus_gass_copy_callback_t cancel_callback, void *cancel_callback_arg)
Cancel a transfer.
Definition: globus_gass_copy.c:6245
globus_bool_t always_stat_on_expand
Definition: globus_gass_copy.h:273
globus_result_t globus_gass_copy_get_buffer_length(globus_gass_copy_handle_t *handle, int *length)
Get the size of the transfer buffer.
Definition: globus_gass_copy.c:552
globus_result_t globus_gass_copy_set_stat_on_expand(globus_gass_copy_handle_t *handle, globus_bool_t always_stat)
Make globus_gass_copy_expand_url() always send stat info.
Definition: globus_gass_copy.c:697
globus_result_t globus_gass_copy_handle_destroy(globus_gass_copy_handle_t *handle)
Destroy a GASS Copy handle.
Definition: globus_gass_copy.c:368
globus_object_t * err
Definition: globus_gass_copy.h:236
globus_result_t globus_gass_copy_url_to_url(globus_gass_copy_handle_t *handle, char *source_url, globus_gass_copy_attr_t *source_attr, char *dest_url, globus_gass_copy_attr_t *dest_attr)
Blocking Transfer between URLs.
Definition: globus_gass_copy.c:4947
globus_gass_copy_state_t * state
Definition: globus_gass_copy.h:194
int buffer_length
Definition: globus_gass_copy.h:241
Copy Handle.
Definition: globus_gass_copy.h:183
globus_result_t globus_gass_copy_get_user_pointer(globus_gass_copy_handle_t *handle, void **user_data)
Get the user pointer in a handle.
Definition: globus_gass_copy.c:6217
globus_result_t globus_gass_copy_attr_init(globus_gass_copy_attr_t *attr)
Initialize an attribute structure.
Definition: globus_gass_copy.c:913
globus_result_t globus_gass_copy_set_partial_offsets(globus_gass_copy_handle_t *handle, globus_off_t offset, globus_off_t end_offset)
Set partial file offsets.
Definition: globus_gass_copy.c:790
globus_result_t globus_gass_copy_set_allocate(globus_gass_copy_handle_t *handle, globus_bool_t send_allo)
Set allo on or off.
Definition: globus_gass_copy.c:683
int mode
Definition: globus_gass_copy.h:611
struct globus_gass_copy_handleattr_s globus_gass_copy_handleattr_t
Handle Attributes.
globus_result_t globus_gass_copy_get_partial_offsets(globus_gass_copy_handle_t *handle, globus_off_t *offset, globus_off_t *end_offset)
Get partial transfer offsets.
Definition: globus_gass_copy.c:836
globus_bool_t send_allo
Definition: globus_gass_copy.h:268
globus_gass_copy_url_mode_t
URL Modes.
Definition: globus_gass_copy.h:171
globus_gass_copy_callback_t user_cancel_callback
Definition: globus_gass_copy.h:226
globus_result_t globus_gass_copy_handle_init(globus_gass_copy_handle_t *handle, globus_gass_copy_handleattr_t *attr)
Initialize a GASS Copy handle.
Definition: globus_gass_copy.c:289
globus_result_t globus_gass_copy_register_url_to_handle(globus_gass_copy_handle_t *handle, char *source_url, globus_gass_copy_attr_t *source_attr, globus_io_handle_t *dest_handle, globus_gass_copy_callback_t callback_func, void *callback_arg)
Nonblocking transfer from an URL to an IO handle.
Definition: globus_gass_copy.c:5760
globus_result_t globus_gass_copy_cache_url_state(globus_gass_copy_handle_t *handle, char *url)
Cache connections to an FTP or GridFTP server.
Definition: globus_gass_copy.c:6058
void(* globus_gass_copy_glob_entry_cb_t)(const char *url, const globus_gass_copy_glob_stat_t *info_stat, void *user_arg)
Gass copy glob entry callback.
Definition: globus_gass_copy.h:645
globus_result_t globus_gass_copy_attr_set_ftp(globus_gass_copy_attr_t *attr, globus_ftp_client_operationattr_t *ftp_attr)
Set the attributes for ftp/gsiftp transfers.
Definition: globus_gass_copy.c:962
globus_result_t globus_gass_copy_glob_expand_url(globus_gass_copy_handle_t *handle, const char *url, globus_gass_copy_attr_t *attr, globus_gass_copy_glob_entry_cb_t entry_cb, void *user_arg)
Expand globbed url.
Definition: globus_gass_copy_glob.c:118
globus_off_t size
Definition: globus_gass_copy.h:621
globus_result_t globus_gass_copy_set_user_pointer(globus_gass_copy_handle_t *handle, void *user_data)
Set the user pointer in a handle.
Definition: globus_gass_copy.c:6189
globus_result_t globus_gass_copy_set_checksum(globus_gass_copy_handle_t *handle, char *cksm)
Copies the checksum to the handle&#39;s checksum parameter.
Definition: globus_gass_copy.c:756
char * symlink_target
Definition: globus_gass_copy.h:606
globus_result_t globus_gass_copy_attr_set_io(globus_gass_copy_attr_t *attr, globus_io_attr_t *io_attr)
Set file transfers attributes.
Definition: globus_gass_copy.c:1011
globus_ftp_client_handle_t ftp_handle_2
Definition: globus_gass_copy.h:255
globus_result_t globus_gass_copy_mkdir(globus_gass_copy_handle_t *handle, char *url, globus_gass_copy_attr_t *attr)
Make directory.
Definition: globus_gass_copy_glob.c:1751
globus_gass_copy_status_t status
Definition: globus_gass_copy.h:188
void * user_pointer
Definition: globus_gass_copy.h:199
globus_gass_copy_perf_info_t * performance
Definition: globus_gass_copy.h:205
globus_result_t globus_gass_copy_register_url_to_url(globus_gass_copy_handle_t *handle, char *source_url, globus_gass_copy_attr_t *dest_attr, char *dest_url, globus_gass_copy_attr_t *source_attr, globus_gass_copy_callback_t callback_func, void *callback_arg)
Definition: globus_gass_copy.c:5361
void * cancel_callback_arg
Definition: globus_gass_copy.h:231
globus_result_t globus_gass_copy_register_handle_to_url(globus_gass_copy_handle_t *handle, globus_io_handle_t *source_handle, char *dest_url, globus_gass_copy_attr_t *dest_attr, globus_gass_copy_callback_t callback_func, void *callback_arg)
Definition: globus_gass_copy.c:5920
int mdtm
Definition: globus_gass_copy.h:616