17 #if !defined(GLOBUS_I_GRIDFTP_SERVER_CONTROL_H)
18 #define GLOBUS_I_GRIDFTP_SERVER_CONTROL_H 1
20 #include "globus_gridftp_server_control.h"
21 #include "globus_xio.h"
22 #include "globus_xio_system.h"
24 #include "globus_xio_pipe_driver.h"
26 #include "globus_xio_gssapi_ftp.h"
28 #define GLOBUS_GRIDFTP_VERSION_CTL 1
30 GlobusDebugDeclare(GLOBUS_GRIDFTP_SERVER_CONTROL);
32 #define GlobusGSDebugPrintf(level, message) \
33 GlobusDebugPrintf(GLOBUS_GRIDFTP_SERVER_CONTROL, level, message)
35 #define GlobusGridFTPServerDebugEnter() \
36 GlobusGSDebugPrintf( \
37 GLOBUS_GRIDFTP_SERVER_CONTROL_DEBUG_TRACE, \
38 ("[%s] Entering\n", _gridftp_server_name))
40 #define GlobusGridFTPServerDebugExit() \
41 GlobusGSDebugPrintf( \
42 GLOBUS_GRIDFTP_SERVER_CONTROL_DEBUG_TRACE, \
43 ("[%s] Exiting\n", _gridftp_server_name))
45 #define GlobusGridFTPServerDebugExitWithError() \
46 GlobusGSDebugPrintf( \
47 GLOBUS_GRIDFTP_SERVER_CONTROL_DEBUG_TRACE, \
48 ("[%s] Exiting with error\n", _gridftp_server_name))
50 #define GlobusGridFTPServerDebugInternalEnter() \
51 GlobusGSDebugPrintf( \
52 GLOBUS_GRIDFTP_SERVER_CONTROL_DEBUG_INTERNAL_TRACE, \
53 ("[%s] I Entering\n", _gridftp_server_name))
55 #define GlobusGridFTPServerDebugInternalExit() \
56 GlobusGSDebugPrintf( \
57 GLOBUS_GRIDFTP_SERVER_CONTROL_DEBUG_INTERNAL_TRACE, \
58 ("[%s] I Exiting\n", _gridftp_server_name))
60 #define GlobusGridFTPServerDebugInternalExitWithError() \
61 GlobusGSDebugPrintf( \
62 GLOBUS_GRIDFTP_SERVER_CONTROL_DEBUG_INTERNAL_TRACE, \
63 ("[%s] I Exiting with error\n", _gridftp_server_name))
65 #define GlobusGridFTPServerDebugVerboseEnter() \
66 GlobusGSDebugPrintf( \
67 GLOBUS_GRIDFTP_SERVER_CONTROL_DEBUG_VERBOSE, \
68 ("[%s] V Entering\n", _gridftp_server_name))
70 #define GlobusGridFTPServerDebugVerboseExit() \
71 GlobusGSDebugPrintf( \
72 GLOBUS_GRIDFTP_SERVER_CONTROL_DEBUG_VERBOSE, \
73 ("[%s] V Exiting\n", _gridftp_server_name))
75 #define GlobusGridFTPServerDebugVerboseExitWithError() \
76 GlobusGSDebugPrintf( \
77 GLOBUS_GRIDFTP_SERVER_CONTROL_DEBUG_VERBOSE, \
78 ("[%s] V Exiting with error\n", _gridftp_server_name))
80 #define GlobusGridFTPServerDebugCommand(cmd) \
81 GlobusGSDebugPrintf( \
82 GLOBUS_GRIDFTP_SERVER_CONTROL_DEBUG_COMMANDS, \
83 ("### [%s] Received command: %s\n", _gridftp_server_name, cmd))
85 struct globus_i_gs_attr_s;
87 typedef enum globus_i_gsc_debug_levels_e
89 GLOBUS_GRIDFTP_SERVER_CONTROL_DEBUG_ERROR = 1,
90 GLOBUS_GRIDFTP_SERVER_CONTROL_DEBUG_WARNING = 2,
91 GLOBUS_GRIDFTP_SERVER_CONTROL_DEBUG_TRACE = 4,
92 GLOBUS_GRIDFTP_SERVER_CONTROL_DEBUG_INTERNAL_TRACE = 8,
93 GLOBUS_GRIDFTP_SERVER_CONTROL_DEBUG_COMMANDS = 16,
94 GLOBUS_GRIDFTP_SERVER_CONTROL_DEBUG_VERBOSE = 32,
95 GLOBUS_GRIDFTP_SERVER_CONTROL_DEBUG_STATE = 64
96 } globus_i_gsc_debug_levels_t;
98 typedef enum globus_i_gsc_error_type_e
100 GLOBUS_GRIDFTP_SERVER_CONTROL_ERROR_PARAMETER,
101 GLOBUS_GRIDFTP_SERVER_CONTROL_ERROR_STATE,
102 GLOBUS_GRIDFTP_SERVER_CONTROL_ERROR_MEMORY,
103 GLOBUS_GRIDFTP_SERVER_CONTROL_NO_AUTH,
104 GLOBUS_GRIDFTP_SERVER_CONTROL_POST_AUTH,
105 GLOBUS_GRIDFTP_SERVER_CONTROL_NO_COMMAND,
106 GLOBUS_GRIDFTP_SERVER_CONTROL_MALFORMED_COMMAND
107 } globus_i_gsc_error_type_t;
109 typedef enum globus_i_gsc_mlsx_fact_e
111 GLOBUS_GSC_MLSX_FACT_TYPE =
'T',
112 GLOBUS_GSC_MLSX_FACT_MODIFY =
'M',
113 GLOBUS_GSC_MLSX_FACT_CHARSET =
'C',
114 GLOBUS_GSC_MLSX_FACT_SIZE =
'S',
115 GLOBUS_GSC_MLSX_FACT_PERM =
'P',
116 GLOBUS_GSC_MLSX_FACT_UNIXMODE =
'U',
117 GLOBUS_GSC_MLSX_FACT_UNIXOWNER =
'O',
118 GLOBUS_GSC_MLSX_FACT_UNIXGROUP =
'G',
119 GLOBUS_GSC_MLSX_FACT_UNIQUE =
'Q',
120 GLOBUS_GSC_MLSX_FACT_UNIXSLINK =
'L',
121 GLOBUS_GSX_MLSX_FACT_UNIXUID =
'I',
122 GLOBUS_GSX_MLSX_FACT_UNIXGID =
'D',
123 GLOBUS_GSC_MLSX_FACT_XCOUNT =
'N',
124 GLOBUS_GSC_MLSX_FACT_XABSPATH =
'A'
125 } globus_i_gsc_mlsx_fact_t;
129 GLOBUS_L_GSC_DATA_OBJ_READY = 1,
130 GLOBUS_L_GSC_DATA_OBJ_DESTROY_WAIT,
131 GLOBUS_L_GSC_DATA_OBJ_DESTROYING,
132 GLOBUS_L_GSC_DATA_OBJ_INUSE
133 } globus_l_gsc_data_obj_state_t;
136 (*globus_i_gsc_auth_cb_t)(
137 struct globus_i_gsc_op_s * op,
138 globus_gridftp_server_control_response_t response_type,
143 (*globus_i_gsc_resource_cb_t)(
144 struct globus_i_gsc_op_s * op,
145 globus_gridftp_server_control_response_t response_type,
155 (*globus_i_gsc_passive_cb_t)(
156 struct globus_i_gsc_op_s * op,
157 globus_gridftp_server_control_response_t response_type,
164 (*globus_i_gsc_port_cb_t)(
165 struct globus_i_gsc_op_s * op,
166 globus_gridftp_server_control_response_t response_type,
171 (*globus_i_gsc_transfer_cb_t)(
172 struct globus_i_gsc_op_s * op,
173 globus_gridftp_server_control_response_t response_type,
177 typedef struct globus_i_gsc_data_s
179 globus_l_gsc_data_obj_state_t state;
180 struct globus_i_gsc_server_handle_s * server_handle;
183 globus_gridftp_server_control_data_dir_t dir;
185 } globus_i_gsc_data_t;
187 typedef enum globus_i_gsc_op_type_e
189 GLOBUS_L_GSC_OP_TYPE_AUTH,
190 GLOBUS_L_GSC_OP_TYPE_RESOURCE,
191 GLOBUS_L_GSC_OP_TYPE_CREATE_PASV,
192 GLOBUS_L_GSC_OP_TYPE_CREATE_PORT,
193 GLOBUS_L_GSC_OP_TYPE_SEND,
194 GLOBUS_L_GSC_OP_TYPE_RECV,
195 GLOBUS_L_GSC_OP_TYPE_DESTROY,
196 GLOBUS_L_GSC_OP_TYPE_LIST,
197 GLOBUS_L_GSC_OP_TYPE_NLST,
198 GLOBUS_L_GSC_OP_TYPE_MLSD,
199 GLOBUS_L_GSC_OP_TYPE_MLSR
200 } globus_i_gsc_op_type_t;
202 typedef struct globus_i_gsc_event_data_s
204 globus_l_gsc_data_obj_state_t state;
213 globus_gridftp_server_control_event_cb_t user_cb;
216 globus_off_t * stripe_total;
217 } globus_i_gsc_event_data_t;
219 typedef struct globus_i_gsc_handle_opts_s
221 char mlsx_fact_str[16];
230 int retr_perf_frequency;
231 int restart_frequency;
232 globus_gsc_layout_t layout;
234 int mlsr_traversal_options;
235 } globus_i_gsc_handle_opts_t;
237 typedef struct globus_i_gsc_module_func_s
240 globus_gridftp_server_control_transfer_cb_t func;
242 } globus_i_gsc_module_func_t;
244 typedef struct globus_i_gsc_user_funcs_s
246 globus_hashtable_t send_cb_table;
247 globus_hashtable_t recv_cb_table;
248 globus_gridftp_server_control_transfer_cb_t default_send_cb;
249 void * default_send_arg;
250 globus_gridftp_server_control_transfer_cb_t default_recv_cb;
251 void * default_recv_arg;
252 globus_gridftp_server_control_auth_cb_t auth_cb;
254 globus_gridftp_server_control_passive_connect_cb_t passive_cb;
256 globus_gridftp_server_control_active_connect_cb_t active_cb;
258 globus_gridftp_server_control_data_destroy_cb_t data_destroy_cb;
259 void * data_destroy_arg;
260 globus_gridftp_server_control_list_cb_t list_cb;
262 globus_gridftp_server_control_resource_cb_t resource_cb;
264 globus_gridftp_server_control_cb_t done_cb;
266 globus_gridftp_server_control_log_cb_t log_func;
269 } globus_i_gsc_user_funcs_t;
271 typedef struct globus_i_gsc_op_s
273 globus_i_gsc_op_type_t type;
276 struct globus_i_gsc_server_handle_s * server_handle;
278 globus_gridftp_server_control_response_t response_type;
288 globus_i_gsc_auth_cb_t auth_cb;
289 globus_i_gsc_resource_cb_t stat_cb;
290 globus_i_gsc_transfer_cb_t list_cb;
301 char * absolute_path;
302 char * glob_match_str;
303 globus_gridftp_server_control_resource_mask_t mask;
309 globus_i_gsc_passive_cb_t passive_cb;
310 globus_i_gsc_port_cb_t port_cb;
311 globus_i_gsc_transfer_cb_t transfer_cb;
318 globus_gridftp_server_control_transfer_cb_t user_data_cb;
321 globus_range_list_t range_list;
322 globus_range_list_t perf_range_list;
323 globus_i_gsc_event_data_t event;
326 void * abort_user_arg;
329 globus_i_gsc_data_t * data_destroy_obj;
332 typedef struct globus_i_gsc_attr_s
338 char * post_auth_banner;
339 char * pre_auth_banner;
340 globus_gridftp_server_control_security_type_t security;
347 globus_i_gsc_user_funcs_t funcs;
348 } globus_i_gsc_attr_t;
351 extern globus_hashtable_t globus_i_gs_default_attr_command_hash;
360 typedef enum globus_l_gsc_state_e
362 GLOBUS_L_GSC_STATE_NONE,
363 GLOBUS_L_GSC_STATE_OPENING,
364 GLOBUS_L_GSC_STATE_OPEN,
365 GLOBUS_L_GSC_STATE_PROCESSING,
366 GLOBUS_L_GSC_STATE_ABORTING,
367 GLOBUS_L_GSC_STATE_ABORTING_STOPPING,
368 GLOBUS_L_GSC_STATE_STOPPING,
369 GLOBUS_L_GSC_STATE_STOPPED
370 } globus_l_gsc_state_t;
373 typedef struct globus_i_gsc_cmd_wrapper_s
375 globus_i_gsc_op_t * op;
384 globus_gridftp_server_control_network_protocol_t prt;
386 globus_i_gsc_op_type_t type;
393 struct globus_i_gsc_cmd_wrapper_s * transfer_info;
394 } globus_i_gsc_cmd_wrapper_t;
397 typedef struct globus_i_gsc_server_handle_s
417 char * post_auth_banner;
418 char * pre_auth_banner;
420 gss_ctx_id_t context;
422 gss_cred_id_t del_cred;
423 globus_gridftp_server_control_security_type_t security_type;
437 globus_off_t allocated_bytes;
443 globus_i_gsc_handle_opts_t opts;
448 globus_range_list_t range_list;
450 globus_i_gsc_user_funcs_t funcs;
452 globus_i_gsc_data_t * data_object;
462 globus_xio_handle_t xio_handle;
463 globus_l_gsc_state_t state;
467 globus_hashtable_t cmd_table;
468 globus_hashtable_t site_cmd_table;
469 globus_hashtable_t data_object_table;
470 struct globus_i_gsc_op_s * outstanding_op;
477 globus_i_gsc_cmd_wrapper_t * pasv_info;
483 } globus_i_gsc_server_handle_t;
487 globus_i_gsc_reverse_restart(
488 globus_range_list_t in_range,
489 globus_range_list_t out_range);
492 globus_i_gsc_op_destroy(
493 globus_i_gsc_op_t * op);
496 globus_i_gsc_event_start(
497 globus_i_gsc_op_t * op,
499 globus_gridftp_server_control_event_cb_t event_cb,
503 globus_i_gsc_event_end(
504 globus_i_gsc_op_t * op);
507 globus_i_gsc_get_help(
508 globus_i_gsc_server_handle_t * server_handle,
509 const char * command_name);
512 globus_i_gsc_intermediate_reply(
513 globus_i_gsc_op_t * op,
517 globus_i_gsc_authenticate(
518 globus_i_gsc_op_t * op,
521 globus_i_gsc_auth_cb_t cb,
526 globus_i_gsc_op_t * op,
528 globus_gridftp_server_control_resource_mask_t mask,
529 globus_i_gsc_op_type_t type,
530 globus_i_gsc_transfer_cb_t list_cb,
534 globus_i_gsc_resource_query(
535 globus_i_gsc_op_t * op,
537 globus_gridftp_server_control_resource_mask_t mask,
538 globus_i_gsc_resource_cb_t cb,
542 globus_i_gsc_passive(
543 globus_i_gsc_op_t * op,
546 const char * pathname,
547 globus_i_gsc_passive_cb_t cb,
552 globus_i_gsc_op_t * op,
553 const char ** contact_strings,
556 globus_i_gsc_port_cb_t cb,
561 globus_i_gsc_op_t * op,
563 const char * mod_name,
564 const char * mod_parms,
565 globus_i_gsc_transfer_cb_t data_cb,
570 globus_i_gsc_op_t * op,
572 const char * mod_name,
573 const char * mod_parms,
574 globus_i_gsc_transfer_cb_t data_cb,
578 globus_i_gsc_add_commands(
579 globus_i_gsc_server_handle_t * server_handle);
582 globus_i_gsc_command_panic(
583 globus_i_gsc_op_t * op);
586 globus_i_gsc_concat_path(
587 globus_i_gsc_server_handle_t * i_server,
588 const char * in_path);
591 globus_i_gsc_list_single_line(
595 globus_i_gsc_list_line(
598 const char * glob_match_str);
601 globus_i_gsc_nlst_line(
606 globus_i_gsc_mlsx_line_single(
607 const char * mlsx_fact_str,
610 const char * base_path,
611 const char * absolute_path,
615 globus_i_gsc_mlsx_line(
618 const char * mlsx_fact_string,
620 const char * base_path,
621 const char * absolute_path,
625 globus_i_guc_command_data_destroy(
626 globus_i_gsc_server_handle_t * server_handle);
630 globus_i_gsc_server_handle_t * server_handle,
631 const char * command,
635 globus_i_guc_data_object_destroy(
636 globus_i_gsc_server_handle_t * server_handle,
637 globus_i_gsc_data_t * data_object);
640 globus_i_gsc_cmd_intermediate_reply(
641 globus_i_gsc_op_t * op,
645 globus_i_gsc_event_start_perf_restart(
646 globus_i_gsc_op_t * op);
649 globus_gsc_959_terminate(
650 globus_i_gsc_op_t * op,
int globus_bool_t
Boolean type.
Definition: globus_types.h:93
int globus_callback_handle_t
Periodic callback handle.
Definition: globus_callback.h:102
struct globus_fifo_s * globus_fifo_t
Definition: globus_fifo.h:48
List data type.
Definition: globus_list.h:44
Header file for XIO TCP Driver.
Mutex.
Definition: globus_thread.h:107
Definition: globus_gridftp_server_control.h:209
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
uint32_t globus_result_t
Definition: globus_types.h:99