17 #if !defined GLOBUS_GRIDFTP_SERVER_CONTROL_H
18 #define GLOBUS_GRIDFTP_SERVER_CONTROL_H
20 #include "globus_xio.h"
23 #include "globus_xio_system.h"
25 #ifndef TARGET_ARCH_WIN32
53 typedef struct globus_i_gsc_server_handle_s * globus_gridftp_server_control_t;
54 typedef struct globus_i_gsc_attr_s * globus_gridftp_server_control_attr_t;
55 typedef struct globus_i_gsc_op_s * globus_gridftp_server_control_op_t;
56 typedef struct globus_i_gsc_op_s * globus_gsc_959_op_t;
57 typedef time_t globus_time_t;
63 typedef enum globus_gsc_error_type_e
65 GLOBUS_GRIDFTP_SERVER_CONTROL_ERROR_PANIC,
66 GLOBUS_GRIDFTP_SERVER_CONTROL_ERROR_SYSTEM_RESOURCE,
67 GLOBUS_GRIDFTP_SERVER_CONTROL_ERROR_AUTHENTICATION,
68 GLOBUS_GRIDFTP_SERVER_CONTROL_ERROR_SYNTAX
69 } globus_gridftp_server_control_error_type_t;
71 typedef enum globus_gsc_response_e
74 GLOBUS_GRIDFTP_SERVER_CONTROL_RESPONSE_SUCCESS,
75 GLOBUS_GRIDFTP_SERVER_CONTROL_RESPONSE_ACTION_FAILED,
76 GLOBUS_GRIDFTP_SERVER_CONTROL_RESPONSE_PATH_INVALID,
77 GLOBUS_GRIDFTP_SERVER_CONTROL_RESPONSE_INVALID_FILE_TYPE,
78 GLOBUS_GRIDFTP_SERVER_CONTROL_RESPONSE_ACCESS_DENIED,
79 GLOBUS_GRIDFTP_SERVER_CONTROL_RESPONSE_DATA_CONN_TERMINATED,
80 GLOBUS_GRIDFTP_SERVER_CONTROL_RESPONSE_DATA_CONN_FAILED,
81 GLOBUS_GRIDFTP_SERVER_CONTROL_RESPONSE_DATA_CONN_AUTH,
82 GLOBUS_GRIDFTP_SERVER_CONTROL_RESPONSE_PANIC,
83 GLOBUS_GRIDFTP_SERVER_CONTROL_RESPONSE_PARTIAL_SUCCESS,
84 GLOBUS_GRIDFTP_SERVER_CONTROL_RESPONSE_MIN_FTP_ERROR = 400,
85 GLOBUS_GRIDFTP_SERVER_CONTROL_RESPONSE_MAX_FTP_ERROR = 599
86 } globus_gridftp_server_control_response_t;
89 #define GLOBUS_GRIDFTP_SERVER_CONTROL_RESPONSE_ACCESS_DENINED \
90 GLOBUS_GRIDFTP_SERVER_CONTROL_RESPONSE_ACCESS_DENIED
93 #define GlobusGridFTPServerName(func) static const char * _gridftp_server_name __attribute__((__unused__)) = #func
95 #define GlobusGridFTPServerName(func) static const char * _gridftp_server_name = #func
98 #define _FSCSL(s) globus_common_i18n_get_string( \
99 GLOBUS_GRIDFTP_SERVER_CONTROL_MODULE, \
102 #define _FSMSL(s) globus_common_i18n_get_string_by_key( \
104 GLOBUS_GRIDFTP_SERVER_CONTROL_MODULE->module_name, \
108 #define GlobusGridFTPServerErrorParameter(param_name) \
110 globus_error_construct_error( \
111 GLOBUS_GRIDFTP_SERVER_CONTROL_MODULE, \
113 GLOBUS_GRIDFTP_SERVER_CONTROL_ERROR_PARAMETER, \
115 _gridftp_server_name, \
117 "Bad parameter, %s", \
120 #define GlobusGridFTPServerControlErrorSyntax() \
122 globus_error_construct_error( \
123 GLOBUS_GRIDFTP_SERVER_CONTROL_MODULE, \
125 GLOBUS_GRIDFTP_SERVER_CONTROL_ERROR_SYNTAX, \
127 _gridftp_server_name, \
131 #define GlobusGridFTPServerControlErrorPanic() \
133 globus_error_construct_error( \
134 GLOBUS_GRIDFTP_SERVER_CONTROL_MODULE, \
136 GLOBUS_GRIDFTP_SERVER_CONTROL_ERROR_PANIC, \
138 _gridftp_server_name, \
142 #define GlobusGridFTPServerControlErrorSystem() \
144 globus_error_construct_error( \
145 GLOBUS_GRIDFTP_SERVER_CONTROL_MODULE, \
147 GLOBUS_GRIDFTP_SERVER_CONTROL_ERROR_SYSTEM_RESOURCE, \
149 _gridftp_server_name, \
151 "System resource error"))
154 #define GlobusGridFTPServerControlErrorSytem() \
155 GlobusGridFTPServerControlErrorSystem()
157 #define GlobusGridFTPServerControlErrorAuthentication() \
159 globus_error_construct_error( \
160 GLOBUS_GRIDFTP_SERVER_CONTROL_MODULE, \
162 GLOBUS_GRIDFTP_SERVER_CONTROL_ERROR_AUTHENTICATION, \
164 _gridftp_server_name, \
166 "Authentication error"))
174 typedef enum globus_gsc_security_type_e
176 GLOBUS_GRIDFTP_SERVER_LIBRARY_NONE = 0x01,
177 GLOBUS_GRIDFTP_SERVER_LIBRARY_GSSAPI = 0x02,
178 GLOBUS_GRIDFTP_SERVER_LIBRARY_TLS = 0x04
179 } globus_gridftp_server_control_security_type_t;
181 typedef enum globus_gsc_layout_e
183 GLOBUS_GSC_LAYOUT_TYPE_NONE = 0,
184 GLOBUS_GSC_LAYOUT_TYPE_PARTITIONED,
185 GLOBUS_GSC_LAYOUT_TYPE_BLOCKED
186 } globus_gsc_layout_t;
188 typedef enum globus_gridftp_server_control_stat_error_e
190 GLOBUS_GRIDFTP_SERVER_CONTROL_STAT_SUCCESS = 0,
191 GLOBUS_GRIDFTP_SERVER_CONTROL_STAT_OPENFAILED,
192 GLOBUS_GRIDFTP_SERVER_CONTROL_STAT_INVALIDLINK,
193 } globus_gridftp_server_control_stat_error_t;
195 typedef enum globus_gfs_traversal_options_e {
196 GLOBUS_GFS_TRAVERSAL_CONTINUE = 1,
197 GLOBUS_GFS_TRAVERSAL_FOLLOW_SYMLINKS = 2
198 } globus_gfs_traversal_options_t;
214 char * symlink_target;
224 globus_gridftp_server_control_stat_error_t error;
234 typedef enum globus_gridftp_server_control_network_protocol_e
236 GLOBUS_GRIDFTP_SERVER_CONTROL_PROTOCOL_IPV4 = 1,
237 GLOBUS_GRIDFTP_SERVER_CONTROL_PROTOCOL_IPV6
238 } globus_gridftp_server_control_network_protocol_t;
250 typedef enum globus_i_gsc_data_dir_e
252 GLOBUS_GRIDFTP_SERVER_CONTROL_DATA_DIR_RECV = 0x01,
253 GLOBUS_GRIDFTP_SERVER_CONTROL_DATA_DIR_SEND = 0x02,
254 GLOBUS_GRIDFTP_SERVER_CONTROL_DATA_DIR_BI = 0x03
255 } globus_gridftp_server_control_data_dir_t;
264 typedef enum globus_gridftp_server_control_event_type_e
266 GLOBUS_GRIDFTP_SERVER_CONTROL_EVENT_PERF = 0x01,
267 GLOBUS_GRIDFTP_SERVER_CONTROL_EVENT_RESTART = 0x02,
268 GLOBUS_GRIDFTP_SERVER_CONTROL_EVENT_ABORT = 0x04,
269 GLOBUS_GRIDFTP_SERVER_CONTROL_EVENT_TRANSFER_COMPLETE = 0x08
270 } globus_gridftp_server_control_event_type_t;
282 (*globus_gridftp_server_control_auth_cb_t)(
283 globus_gridftp_server_control_op_t op,
284 globus_gridftp_server_control_security_type_t secure_type,
285 gss_ctx_id_t context,
286 const char * subject,
287 const char * user_name,
298 globus_gridftp_server_control_finished_auth(
299 globus_gridftp_server_control_op_t op,
300 const char * username,
301 globus_gridftp_server_control_response_t response_code,
312 typedef enum globus_gridftp_server_control_resource_mask_e
314 GLOBUS_GRIDFTP_SERVER_CONTROL_RESOURCE_DIRECTORY_LIST = 1,
315 GLOBUS_GRIDFTP_SERVER_CONTROL_RESOURCE_FILE_ONLY = 2,
316 GLOBUS_GRIDFTP_SERVER_CONTROL_RESOURCE_USER_DEFINED = 3
317 } globus_gridftp_server_control_resource_mask_t;
325 (*globus_gridftp_server_control_cb_t)(
326 globus_gridftp_server_control_t server,
341 (*globus_gridftp_server_control_resource_cb_t)(
342 globus_gridftp_server_control_op_t op,
344 globus_gridftp_server_control_resource_mask_t mask,
352 (*globus_gridftp_server_control_transfer_cb_t)(
353 globus_gridftp_server_control_op_t op,
355 const char * local_target,
356 const char * mod_name,
357 const char * mod_parms,
358 globus_range_list_t range_list,
362 (*globus_gridftp_server_control_list_cb_t)(
363 globus_gridftp_server_control_op_t op,
366 const char * fact_str,
368 int traversal_options,
372 globus_gridftp_server_control_list_buffer_alloc(
373 const char * fact_str,
375 const char * base_path,
382 globus_gridftp_server_control_list_buffer_free(
395 GLOBUS_GRIDFTP_SERVER_CONTROL_LOG_SECURITY = 0x0001,
396 GLOBUS_GRIDFTP_SERVER_CONTROL_LOG_TRANSFER = 0x0004,
397 GLOBUS_GRIDFTP_SERVER_CONTROL_LOG_TRANSFER_STATE = 0x0008,
398 GLOBUS_GRIDFTP_SERVER_CONTROL_LOG_FILE_COMMANDS = 0x0010,
399 GLOBUS_GRIDFTP_SERVER_CONTROL_LOG_ERROR = 0x0020,
400 GLOBUS_GRIDFTP_SERVER_CONTROL_LOG_SITE = 0x0040,
401 GLOBUS_GRIDFTP_SERVER_CONTROL_LOG_LIST = 0x0080,
402 GLOBUS_GRIDFTP_SERVER_CONTROL_LOG_OTHER = 0x0100,
403 GLOBUS_GRIDFTP_SERVER_CONTROL_LOG_REPLY = 0x0400,
404 GLOBUS_GRIDFTP_SERVER_CONTROL_LOG_ALL = 0xFFFF
408 (*globus_gridftp_server_control_log_cb_t)(
409 globus_gridftp_server_control_t server_handle,
410 const char * full_command,
427 (*globus_gridftp_server_control_passive_connect_cb_t)(
428 globus_gridftp_server_control_op_t op,
429 globus_gridftp_server_control_network_protocol_t net_prt,
431 const char * pathname,
447 (*globus_gridftp_server_control_active_connect_cb_t)(
448 globus_gridftp_server_control_op_t op,
449 globus_gridftp_server_control_network_protocol_t net_prt,
463 (*globus_gridftp_server_control_data_destroy_cb_t)(
464 void * user_data_handle,
468 (*globus_gridftp_server_control_event_cb_t)(
469 globus_gridftp_server_control_op_t op,
474 globus_gridftp_server_control_events_enable(
475 globus_gridftp_server_control_op_t op,
477 globus_gridftp_server_control_event_cb_t event_cb,
494 globus_gridftp_server_control_finished_resource(
495 globus_gridftp_server_control_op_t op,
501 globus_gridftp_server_control_response_t response_code,
510 globus_gridftp_server_control_attr_init(
511 globus_gridftp_server_control_attr_t * in_attr);
514 globus_gridftp_server_control_attr_destroy(
515 globus_gridftp_server_control_attr_t in_attr);
518 globus_gridftp_server_control_attr_copy(
519 globus_gridftp_server_control_attr_t * dst,
520 globus_gridftp_server_control_attr_t src);
523 globus_gridftp_server_control_attr_set_resource(
524 globus_gridftp_server_control_attr_t in_attr,
525 globus_gridftp_server_control_resource_cb_t resource_cb,
529 globus_gridftp_server_control_attr_set_auth(
530 globus_gridftp_server_control_attr_t in_attr,
531 globus_gridftp_server_control_auth_cb_t auth_cb,
535 globus_gridftp_server_control_attr_set_list(
536 globus_gridftp_server_control_attr_t in_attr,
537 globus_gridftp_server_control_list_cb_t list_cb,
541 globus_gridftp_server_control_attr_set_banner(
542 globus_gridftp_server_control_attr_t in_attr,
546 globus_gridftp_server_control_attr_set_message(
547 globus_gridftp_server_control_attr_t in_attr,
551 globus_gridftp_server_control_attr_set_security(
552 globus_gridftp_server_control_attr_t in_attr,
553 globus_gridftp_server_control_security_type_t sec);
556 globus_gridftp_server_control_attr_set_idle_time(
557 globus_gridftp_server_control_attr_t in_attr,
559 int preauth_timeout);
562 globus_gridftp_server_control_attr_set_epsv_ip(
563 globus_gridftp_server_control_attr_t in_attr,
567 globus_gridftp_server_control_attr_set_ipv6(
568 globus_gridftp_server_control_attr_t in_attr,
575 globus_gridftp_server_control_attr_add_recv(
576 globus_gridftp_server_control_attr_t in_attr,
577 const char * module_name,
578 globus_gridftp_server_control_transfer_cb_t recv_func,
582 globus_gridftp_server_control_attr_add_send(
583 globus_gridftp_server_control_attr_t in_attr,
584 const char * module_name,
585 globus_gridftp_server_control_transfer_cb_t send_func,
589 globus_gridftp_server_control_attr_data_functions(
590 globus_gridftp_server_control_attr_t server_attr,
591 globus_gridftp_server_control_active_connect_cb_t active_cb,
593 globus_gridftp_server_control_passive_connect_cb_t passive_cb,
595 globus_gridftp_server_control_data_destroy_cb_t destroy_cb,
599 globus_gridftp_server_control_attr_set_log(
600 globus_gridftp_server_control_attr_t server_attr,
601 globus_gridftp_server_control_log_cb_t log_func,
613 globus_gridftp_server_control_init(
614 globus_gridftp_server_control_t * server);
623 globus_gridftp_server_control_destroy(
624 globus_gridftp_server_control_t server);
638 globus_gridftp_server_control_start(
639 globus_gridftp_server_control_t server,
640 globus_gridftp_server_control_attr_t attr,
641 globus_xio_system_socket_t system_handle,
642 globus_gridftp_server_control_cb_t done_cb,
654 globus_gridftp_server_control_stop(
655 globus_gridftp_server_control_t server);
661 globus_gridftp_server_control_get_allocated(
662 globus_gridftp_server_control_op_t op,
663 globus_off_t * out_allo);
666 globus_gridftp_server_control_get_layout(
667 globus_gridftp_server_control_op_t op,
668 globus_gsc_layout_t * layout_type,
672 globus_gridftp_server_control_get_buffer_size(
673 globus_gridftp_server_control_op_t op,
678 globus_gridftp_server_control_get_parallelism(
679 globus_gridftp_server_control_op_t op,
680 int * out_parallelism);
683 globus_gridftp_server_control_get_mode(
684 globus_gridftp_server_control_op_t op,
688 globus_gridftp_server_control_get_type(
689 globus_gridftp_server_control_op_t op,
693 globus_gridftp_server_control_get_cwd(
694 globus_gridftp_server_control_t server,
698 globus_gridftp_server_control_set_cwd(
699 globus_gridftp_server_control_t server,
700 const char * cwd_string);
703 globus_gridftp_server_control_get_data_auth(
704 globus_gridftp_server_control_op_t op,
708 gss_cred_id_t * del_cred);
711 globus_gridftp_server_control_authenticated(
712 globus_gridftp_server_control_t server);
715 globus_gridftp_server_control_get_cmd_string(
716 globus_gridftp_server_control_op_t op);
740 globus_gridftp_server_control_finished_active_connect(
741 globus_gridftp_server_control_op_t op,
742 void * user_data_handle,
743 globus_gridftp_server_control_data_dir_t data_dir,
744 globus_gridftp_server_control_response_t response_code,
759 globus_gridftp_server_control_finished_passive_connect(
760 globus_gridftp_server_control_op_t op,
761 void * user_data_handle,
762 globus_gridftp_server_control_data_dir_t data_dir,
765 globus_gridftp_server_control_response_t response_code,
778 globus_gridftp_server_control_disconnected(
779 globus_gridftp_server_control_t server,
780 void * user_data_handle);
794 globus_gridftp_server_control_begin_transfer(
795 globus_gridftp_server_control_op_t op);
805 globus_gridftp_server_control_finished_transfer(
806 globus_gridftp_server_control_op_t op,
807 globus_gridftp_server_control_response_t response_code,
811 globus_gridftp_server_control_set_paths(
812 globus_gridftp_server_control_op_t op,
813 const char * absolute_path,
814 const char * resolved_path);
817 globus_gridftp_server_control_add_feature(
818 globus_gridftp_server_control_t server,
819 const char * feature);
823 typedef enum globus_gsc_959_command_desc_e
825 GLOBUS_GSC_COMMAND_POST_AUTH = 0x01,
826 GLOBUS_GSC_COMMAND_PRE_AUTH = 0x02
827 } globus_gsc_959_command_desc_t;
830 globus_gsc_string_to_959(
833 const char * preline);
836 (*globus_gsc_959_command_cb_t)(
837 globus_gsc_959_op_t op,
838 const char * full_command,
844 globus_gsc_959_command_add(
845 globus_gridftp_server_control_t server,
846 const char * command_name,
847 globus_gsc_959_command_cb_t command_cb,
848 globus_gsc_959_command_desc_t desc,
855 globus_gsc_959_command_remove(
856 globus_gridftp_server_control_t server,
857 const char * command_name);
860 globus_gsc_959_finished_command(
861 globus_gsc_959_op_t op,
865 globus_gridftp_server_control_event_send_perf(
866 globus_gridftp_server_control_op_t op,
868 globus_off_t nbytes);
871 globus_gridftp_server_control_event_send_restart(
872 globus_gridftp_server_control_op_t op,
873 globus_range_list_t restart);
877 globus_gridftp_server_control_421_end(
878 globus_gridftp_server_control_t server,
883 #define GLOBUS_GRIDFTP_SERVER_CONTROL_MODULE (&globus_i_gsc_module)
int globus_bool_t
Boolean type.
Definition: globus_types.h:93
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
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
Headers common to all of Globus.
uint32_t globus_result_t
Definition: globus_types.h:99
Module Descriptor.
Definition: globus_module.h:71