Grid Community Toolkit  6.2.1629922860 (tag: v6.2.20210826)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
globus_i_gass_transfer.h
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_DONT_DOCUMENT_INTERNAL
18 
26 #ifndef GLOBUS_I_GASS_TRANSFER_H
27 #define GLOBUS_I_GASS_TRANSFER_H
28 
29 #include "globus_gass_transfer.h"
31 #include "globus_i_gass_transfer_keyvalue.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 extern globus_hashtable_t globus_i_gass_transfer_protocols;
38 extern globus_handle_table_t globus_i_gass_transfer_request_handles;
39 extern globus_handle_table_t globus_i_gass_transfer_listener_handles;
40 extern globus_list_t * globus_i_gass_transfer_requests;
41 extern globus_list_t * globus_i_gass_transfer_listeners;
42 extern globus_bool_t globus_i_gass_transfer_deactivating;
43 
44 /* Default implemented protocols */
45 extern globus_module_descriptor_t globus_i_gass_transfer_http_module;
46 #define GLOBUS_I_GASS_TRANSFER_HTTP_MODULE (&globus_i_gass_transfer_http_module)
47 extern globus_module_descriptor_t globus_i_gass_transfer_ftp_module;
48 #define GLOBUS_I_GASS_TRANSFER_FTP_MODULE (&globus_i_gass_transfer_ftp_module)
49 
51  globus_i_gass_transfer_http_descriptor;
53  globus_i_gass_transfer_https_descriptor;
55  globus_i_gass_transfer_ftp_descriptor;
57  globus_i_gass_transfer_gsiftp_descriptor;
58 /*
59  * The request status structure. This should only be accessed
60  * through the functions globus_gass_transfer_request_get_*()
61  */
62 typedef struct
63 {
64  char * url;
67 
68  globus_bool_t client_side;
69 
70  globus_size_t length;
71  globus_size_t handled_length;
72  globus_size_t posted_length;
73 
74  char ** referral_url;
75  globus_size_t referral_count;
76 
77  globus_gass_transfer_callback_t callback;
78  void * callback_arg;
79 
80  globus_gass_transfer_callback_t fail_callback;
81  void * fail_callback_arg;
82 
83  /* subject of peer */
84  char * subject;
85 
86  /* queue of byte arrays to be sent or received */
87  globus_fifo_t pending_data;
88 
89  /* Denial reasons */
90  int denial_reason;
91  char * denial_message;
92 
93  globus_object_t * attr;
94 
96  proto;
97  void * user_pointer;
98 } globus_gass_transfer_request_struct_t;
99 
100 /*
101  * The listener status structure. This should only be accessed
102  * through the functions globus_gass_transfer_listener_get_*()
103  */
104 typedef struct
105 {
106  char * base_url;
107  globus_gass_transfer_listener_status_t status;
109  proto;
110 
112  void * listen_callback_arg;
113 
115  void * close_callback_arg;
116  void * user_pointer;
117 } globus_gass_transfer_listener_struct_t;
118 
119 /* the pending_data fifo in the request structure is one of these */
120 typedef struct
121 {
122  globus_bool_t last_data;
123  globus_size_t length;
124  globus_size_t wait_for_length;
126 
127  /*
128  * True when this pending block has been passed to the protocol
129  * module
130  */
131  globus_bool_t pending;
132 
133  globus_byte_t * bytes;
135  void * callback_arg;
136 } globus_gass_transfer_pending_t;
137 
138 /* implemented in globus_gass_transfer_request.c */
139 void
140 globus_i_gass_transfer_request_init(
142  globus_gass_transfer_requestattr_t * attr,
143  char * url,
145  globus_gass_transfer_callback_t callback,
146  void * user_arg);
147 
148 int
149 globus_i_gass_transfer_request_destroy(
151 
152 void
155  globus_size_t length);
156 
157 /* implemented in globus_gass_transfer_server.c */
158 int
159 globus_i_gass_transfer_listener_destroy(
160  globus_gass_transfer_listener_t listener);
161 
162 /* implemented in globus_gass_transfer_client.c */
163 int
164 globus_i_gass_transfer_client_request(
166 
167 /* implemented in globus_gass_transfer_send_recv.c */
168 typedef void
169 (* globus_gass_transfer_dispatch_func_t) (
171 
172 void
173 globus_i_gass_transfer_send_dispatcher(
175 
176 void
177 globus_i_gass_transfer_recv_dispatcher(
179 
180 int
181 globus_i_gass_transfer_fail(
183  globus_gass_transfer_request_struct_t * req,
184  globus_gass_transfer_callback_t callback,
185  void * callback_arg);
186 
187 extern globus_cond_t globus_i_gass_transfer_shutdown_cond;
188 extern globus_mutex_t globus_i_gass_transfer_mutex;
189 
190 #if defined(GLOBUS_DEBUG_GASS_TRANSFER)
191 #define globus_i_gass_transfer_lock() \
192  thread_print(_GTSL("locking mutex at %s:%d\n"), __FILE__, __LINE__), \
193  globus_mutex_lock(&globus_i_gass_transfer_mutex)
194 #define globus_i_gass_transfer_unlock() \
195  thread_print(_GTSL("unlocking mutex at %s:%d\n"), __FILE__, __LINE__), \
196  globus_mutex_unlock(&globus_i_gass_transfer_mutex)
197 #else
198 #define globus_i_gass_transfer_lock() \
199  globus_mutex_lock(&globus_i_gass_transfer_mutex)
200 #define globus_i_gass_transfer_unlock() \
201  globus_mutex_unlock(&globus_i_gass_transfer_mutex)
202 #endif
203 
204 int
205 globus_i_gass_transfer_close_listener(
206  globus_gass_transfer_listener_t listener,
207  globus_gass_transfer_listener_struct_t * l,
209  void * user_arg);
210 
211 void
212 globus_i_gass_transfer_deactivate_callback(
213  void * user_arg,
215 
216 #ifdef __cplusplus
217 }
218 #endif
219 
220 #endif /* GLOBUS_I_GASS_TRANSFER_H */
221 
222 #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
void globus_gass_transfer_request_set_length(globus_gass_transfer_request_t request, globus_size_t length)
Definition: globus_gass_transfer_request.c:455
GASS transfer.
struct globus_l_handle_table_s * globus_handle_table_t
Handle table abstract type.
Definition: globus_handle_table.h:51
void(* globus_gass_transfer_listen_callback_t)(void *callback_arg, globus_gass_transfer_listener_t listener)
Definition: globus_gass_transfer.h:445
int globus_bool_t
Boolean type.
Definition: globus_types.h:93
Protocol module descriptor structure.
Definition: globus_gass_transfer_proto.h:452
struct globus_fifo_s * globus_fifo_t
Definition: globus_fifo.h:48
globus_gass_transfer_request_type_t
Definition: globus_gass_transfer.h:145
void(* globus_gass_transfer_bytes_callback_t)(void *arg, globus_gass_transfer_request_t request, globus_byte_t *bytes, globus_size_t length, globus_bool_t last_data)
Definition: globus_gass_transfer.h:531
List data type.
Definition: globus_list.h:44
Mutex.
Definition: globus_thread.h:107
Condition variable.
Definition: globus_thread.h:124
size_t globus_size_t
Standard size of memory objectThe globus_size_t is the size of a memory object. It is identical to si...
Definition: globus_types.h:48
unsigned char globus_byte_t
Unsigned byte datatypeThis is used for byte-addressable arrays of arbitrary data which is not subject...
Definition: globus_types.h:85
Protocol module listener handling structure.
Definition: globus_gass_transfer_proto.h:432
GASS Transfer Protocol Interface.
globus_gass_transfer_request_status_t
Definition: globus_gass_transfer.h:189
void(* globus_gass_transfer_close_callback_t)(void *callback_arg, globus_gass_transfer_listener_t listener)
Definition: globus_gass_transfer.h:434
Protocol module request handling structure.
Definition: globus_gass_transfer_proto.h:386
Module Descriptor.
Definition: globus_module.h:71