globus_gass_copy 10.13
Loading...
Searching...
No Matches
globus_gass_copy.h
Go to the documentation of this file.
1/*
2 * Copyright 1999-2006 University of Chicago
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef GLOBUS_GASS_COPY_H
18#define GLOBUS_GASS_COPY_H
19
20#include <openssl/evp.h>
21
27#ifndef GLOBUS_GLOBAL_DOCUMENT_SET
32#endif
33
57#include "globus_gass_transfer.h"
58#include "globus_ftp_client.h"
59#include "globus_io.h"
60
61#ifdef __cplusplus
62extern "C" {
63#endif
64
96#define GLOBUS_GASS_COPY_MODULE (&globus_i_gass_copy_module)
97
98extern
99globus_module_descriptor_t globus_i_gass_copy_module;
100
101#define _GASCSL(s) globus_common_i18n_get_string( \
102 GLOBUS_GASS_COPY_MODULE, \
103 s)
104
105#define CKSM_SIZE (EVP_MAX_MD_SIZE * 2 + 1)
106
107typedef struct globus_gass_copy_state_s globus_gass_copy_state_t;
109typedef struct globus_gass_copy_perf_info_s globus_gass_copy_perf_info_t;
110
144 void * user_arg,
146 globus_off_t total_bytes,
147 float instantaneous_throughput,
148 float avg_throughput);
149
158 void * callback_arg,
160 globus_object_t * error);
161
166typedef enum
167{
168 GLOBUS_GASS_COPY_STATUS_NONE,
169 GLOBUS_GASS_COPY_STATUS_PENDING,
170 GLOBUS_GASS_COPY_STATUS_INITIAL,
171 GLOBUS_GASS_COPY_STATUS_SOURCE_READY,
172 GLOBUS_GASS_COPY_STATUS_TRANSFER_IN_PROGRESS,
173 GLOBUS_GASS_COPY_STATUS_READ_COMPLETE,
174 GLOBUS_GASS_COPY_STATUS_WRITE_COMPLETE,
175 GLOBUS_GASS_COPY_STATUS_DONE,
176 GLOBUS_GASS_COPY_STATUS_FAILURE,
177 GLOBUS_GASS_COPY_STATUS_CANCEL,
178 GLOBUS_GASS_COPY_STATUS_DONE_SUCCESS,
179 GLOBUS_GASS_COPY_STATUS_DONE_FAILURE,
180 GLOBUS_GASS_COPY_STATUS_DONE_CANCELLED
182
187typedef enum
188{
189 GLOBUS_GASS_COPY_URL_MODE_UNSUPPORTED,
190 GLOBUS_GASS_COPY_URL_MODE_FTP,
191 GLOBUS_GASS_COPY_URL_MODE_GASS,
192 GLOBUS_GASS_COPY_URL_MODE_IO
194
200{
205
210 globus_gass_copy_state_t *state;
211
216
221 globus_gass_copy_perf_info_t *performance;
222
227 globus_bool_t external_third_party;
228
233
238
243
248
252 globus_object_t *err;
253
258
266
267 globus_ftp_client_handle_t ftp_handle;
271 globus_ftp_client_handle_t ftp_handle_2;
272
277 globus_off_t partial_offset;
278 globus_off_t partial_end_offset;
279 globus_off_t partial_bytes_remaining;
284 globus_bool_t send_allo;
285
290};
291
300{
301 globus_ftp_client_operationattr_t * ftp_attr;
302 globus_io_attr_t * io;
303 globus_gass_transfer_requestattr_t * gass_requestattr;
305
314{
315 globus_ftp_client_handleattr_t * ftp_attr;
317
318/* initialization and destruction of GASS Copy handle */
319globus_result_t
322 globus_gass_copy_handleattr_t * handle_attr);
323
324globus_result_t
327
328globus_result_t
329globus_gass_copy_handleattr_init(
330 globus_gass_copy_handleattr_t * handle_attr);
331
332globus_result_t
333globus_gass_copy_handleattr_destroy(
334 globus_gass_copy_handleattr_t * handle_attr);
335
336globus_result_t
337globus_gass_copy_handleattr_set_ftp_attr(
338 globus_gass_copy_handleattr_t * handle_attr,
339 globus_ftp_client_handleattr_t * ftp_attr);
340
341/* set the size of the buffer to be used for the transfers */
342globus_result_t
345 int length);
346
347/* get the size of the buffer being used for the transfers */
348globus_result_t
351 int * length);
352
353/* sets whether third_party transfers should be used for ftp to
354 * ftp transfers */
355globus_result_t
358 globus_bool_t no_third_party_transfers);
359
360/* get the size of the buffer being used for the transfers */
361globus_result_t
364 globus_bool_t * no_third_party_transfers);
365
366/* get offsets for partial file transfer */
367globus_result_t
370 globus_off_t * offset,
371 globus_off_t * end_offset);
372
373/* set offsets for partial file transfer */
374globus_result_t
377 globus_off_t offset,
378 globus_off_t end_offset);
379
380/* send ALLO to ftp destinations */
381globus_result_t
384 globus_bool_t send_allo);
385
386
387/* run a stat check on all urls passed to globus_gass_copy_glob_expand_url
388 FALSE by default
389 */
390
391globus_result_t
394 globus_bool_t always_stat);
395
396globus_result_t
399 char * algo,
400 globus_gass_copy_handle_t * cksm_handle);
401
402globus_result_t
405 char * cksm);
406
407/* 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 */
408globus_result_t
410 char * url,
412
413/* get current ftp client handle -- use with care if modifying the handle */
414globus_result_t
415globus_gass_copy_get_ftp_handle(
417 globus_ftp_client_handle_t * ftp_handle);
418
419/* initialize the attr structure */
420globus_result_t
423
424/* functions for setting attributes for specific protocols */
425globus_result_t
428 globus_ftp_client_operationattr_t * ftp_attr);
429
430globus_result_t
433 globus_io_attr_t * io_attr);
434
435globus_result_t
438 globus_gass_transfer_requestattr_t * gass_attr);
439
440/*
441 * copy functions (blocking)
442 */
443globus_result_t
446 char * source_url,
447 globus_gass_copy_attr_t * source_attr,
448 char * dest_url,
449 globus_gass_copy_attr_t * dest_attr);
450
451globus_result_t
454 char * source_url,
455 globus_gass_copy_attr_t * source_attr,
456 globus_io_handle_t * dest_handle);
457
458globus_result_t
461 globus_io_handle_t * source_handle,
462 char * dest_url,
463 globus_gass_copy_attr_t * dest_attr);
464
465/*
466 * copy functions (asyncronous)
467 */
468globus_result_t
471 char * source_url,
472 globus_gass_copy_attr_t * dest_attr,
473 char * dest_url,
474 globus_gass_copy_attr_t * source_attr,
475 globus_gass_copy_callback_t callback_func,
476 void * callback_arg);
477
478globus_result_t
481 char * source_url,
482 globus_gass_copy_attr_t * source_attr,
483 globus_io_handle_t * dest_handle,
484 globus_gass_copy_callback_t callback_func,
485 void * callback_arg);
486
487globus_result_t
490 globus_io_handle_t * source_handle,
491 char * dest_url,
492 globus_gass_copy_attr_t * dest_attr,
493 globus_gass_copy_callback_t callback_func,
494 void * callback_arg);
495
496/*
497 * get the status code of the current transfer
498 */
499globus_result_t
503
504/*
505 * get the status string of the current transfer
506 */
507
508const char *
511
512/*
513 * cancel the current transfer
514 */
515globus_result_t
518 globus_gass_copy_callback_t cancel_callback,
519 void * cancel_callback_arg);
520
521/*
522 * cache handles functions
523 *
524 * Use this when transferring mulitple files from or to the same host
525 */
526globus_result_t
529 char * url);
530
531globus_result_t
534 char * url);
535
536/*
537 * get/set user pointers from/to GASS Copy handles
538 */
539globus_result_t
542 void * user_data);
543
544globus_result_t
547 void ** user_data);
548
549globus_result_t
553 void * user_arg);
554
555/*
556 * Set Attribute functions
557 */
558
559#ifdef USE_FTP
560/* TCP buffer/window size */
561globus_result_t
562globus_gass_copy_attr_set_tcpbuffer(
564 globus_ftp_control_tcpbuffer_t * tcpbuffer_info);
565
566/* parallel transfer options */
567globus_result_t
568globus_gass_copy_attr_set_parallelism(
570 globus_ftp_control_parallelism_t * parallelism_info);
571
572/* striping options */
573globus_result_t
574globus_gass_copy_attr_set_striping(
576 globus_ftp_control_striping_t * striping_info);
577
578/* authorization options */
579globus_result_t
580globus_gass_copy_attr_set_authorization(
582 globus_io_authorization_t * authorization_info);
583
584/* secure channel options */
585globus_result_t
586globus_gass_copy_attr_set_secure_channel(
588 globus_io_secure_channel_t * secure_channel_info);
589#endif
590
595typedef enum {
596 GLOBUS_GASS_COPY_GLOB_ENTRY_UNKNOWN,
597 GLOBUS_GASS_COPY_GLOB_ENTRY_FILE,
598 GLOBUS_GASS_COPY_GLOB_ENTRY_DIR,
599 GLOBUS_GASS_COPY_GLOB_ENTRY_OTHER
601
606typedef struct
607{
611
617 char * unique_id;
618
623
627 int mode;
628
632 int mdtm;
633
637 globus_off_t size;
639
662 const char * url,
663 const globus_gass_copy_glob_stat_t * info_stat,
664 void * user_arg);
665
698globus_result_t
701 const char * url,
704 void * user_arg);
705
729globus_result_t
732 char * url,
734
735globus_result_t
736globus_gass_copy_cksm(
738 char * url,
740 globus_off_t offset,
741 globus_off_t length,
742 const char * algorithm,
743 char * cksm);
744
745globus_result_t
746globus_gass_copy_cksm_async(
748 char * url,
750 globus_off_t offset,
751 globus_off_t length,
752 const char * algorithm,
753 char * cksm,
755 void * callback_arg);
756
757globus_result_t
758globus_gass_copy_stat(
760 char * url,
762 globus_gass_copy_glob_stat_t * stat_info);
763
764#ifdef __cplusplus
765}
766#endif
767
768#endif /* GLOBUS_GASS_COPY_H */
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:6073
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:6260
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:5376
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:5229
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:5097
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:6143
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:6232
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:5935
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:5775
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:6204
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:4962
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:977
struct globus_gass_copy_handleattr_s globus_gass_copy_handleattr_t
Handle Attributes.
globus_gass_copy_url_mode_t
URL Modes.
Definition globus_gass_copy.h:188
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:661
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:143
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:1730
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:1656
globus_gass_copy_glob_entry_t
Definition globus_gass_copy.h: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:1122
globus_result_t globus_gass_copy_attr_init(globus_gass_copy_attr_t *attr)
Initialize an attribute structure.
Definition globus_gass_copy.c:928
globus_result_t globus_gass_copy_handle_init(globus_gass_copy_handle_t *handle, globus_gass_copy_handleattr_t *handle_attr)
Initialize a GASS Copy handle.
Definition globus_gass_copy.c:304
struct globus_gass_copy_attr_s globus_gass_copy_attr_t
Attributes.
globus_result_t globus_gass_copy_set_checksum(globus_gass_copy_handle_t *handle, char *cksm)
Copies the checksum to the handle's checksum parameter.
Definition globus_gass_copy.c:771
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:157
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:805
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:610
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:741
globus_result_t globus_gass_copy_handle_destroy(globus_gass_copy_handle_t *handle)
Destroy a GASS Copy handle.
Definition globus_gass_copy.c:383
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:527
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:851
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:1026
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:1075
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:712
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:698
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:669
globus_gass_copy_status_t
Status States.
Definition globus_gass_copy.h:167
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:567
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:133
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:1764
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:1199
Attributes.
Definition globus_gass_copy.h:300
Glob expanded entry information.
Definition globus_gass_copy.h:607
int mode
Definition globus_gass_copy.h:627
globus_off_t size
Definition globus_gass_copy.h:637
int mdtm
Definition globus_gass_copy.h:632
globus_gass_copy_glob_entry_t type
Definition globus_gass_copy.h:610
char * symlink_target
Definition globus_gass_copy.h:622
char * unique_id
Definition globus_gass_copy.h:617
Copy Handle.
Definition globus_gass_copy.h:200
globus_ftp_client_handle_t ftp_handle_2
Definition globus_gass_copy.h:271
globus_bool_t always_stat_on_expand
Definition globus_gass_copy.h:289
globus_gass_copy_callback_t user_callback
Definition globus_gass_copy.h:232
void * callback_arg
Definition globus_gass_copy.h:237
globus_object_t * err
Definition globus_gass_copy.h:252
globus_off_t partial_offset
Definition globus_gass_copy.h:277
globus_bool_t no_third_party_transfers
Definition globus_gass_copy.h:265
globus_gass_copy_perf_info_t * performance
Definition globus_gass_copy.h:221
globus_bool_t external_third_party
Definition globus_gass_copy.h:227
int buffer_length
Definition globus_gass_copy.h:257
globus_bool_t send_allo
Definition globus_gass_copy.h:284
globus_gass_copy_state_t * state
Definition globus_gass_copy.h:210
void * user_pointer
Definition globus_gass_copy.h:215
globus_gass_copy_status_t status
Definition globus_gass_copy.h:204
globus_gass_copy_callback_t user_cancel_callback
Definition globus_gass_copy.h:242
void * cancel_callback_arg
Definition globus_gass_copy.h:247
Handle Attributes.
Definition globus_gass_copy.h:314