30 #ifndef GLOBUS_GRIDFTP_SERVER_H
31 #define GLOBUS_GRIDFTP_SERVER_H
34 #include "globus_gridftp_server_control.h"
36 #ifdef TARGET_ARCH_WIN32
42 #ifndef TARGET_ARCH_WIN32
46 #define GLOBUS_MAPPING_STRING ":globus-mapping:"
49 #define GLOBUS_GRIDFTP_SERVER_MODULE (&globus_i_gfs_module)
51 extern globus_extension_registry_t globus_i_gfs_dsi_registry;
52 #define GLOBUS_GFS_DSI_REGISTRY &globus_i_gfs_dsi_registry
54 extern globus_extension_registry_t globus_i_gfs_acl_registry;
55 #define GLOBUS_GFS_ACL_REGISTRY &globus_i_gfs_acl_registry
61 typedef enum globus_gfs_error_type_e
63 GLOBUS_GFS_ERROR_MEMORY = 1,
64 GLOBUS_GFS_ERROR_PARAMETER,
65 GLOBUS_GFS_ERROR_SYSTEM_ERROR,
66 GLOBUS_GFS_ERROR_WRAPPED,
67 GLOBUS_GFS_ERROR_DATA,
68 GLOBUS_GFS_ERROR_GENERIC
69 } globus_gfs_error_type_t;
76 typedef enum globus_gfs_operation_type_e
78 GLOBUS_GFS_OP_FINAL_REPLY = 1,
79 GLOBUS_GFS_OP_EVENT_REPLY,
81 GLOBUS_GFS_OP_SESSION_START,
82 GLOBUS_GFS_OP_SESSION_STOP,
86 GLOBUS_GFS_OP_COMMAND,
87 GLOBUS_GFS_OP_PASSIVE,
89 GLOBUS_GFS_OP_DESTROY,
90 GLOBUS_GFS_OP_TRANSFER,
92 GLOBUS_GFS_OP_BUFFER_SEND,
93 GLOBUS_GFS_OP_HANDSHAKE,
94 GLOBUS_GFS_OP_SESSION_START_REPLY,
95 GLOBUS_GFS_OP_INTERMEDIATE_REPLY
96 } globus_gfs_operation_type_t;
98 #define GLOBUS_GFS_OP_STAT_PARTIAL GLOBUS_GFS_OP_INTERMEDIATE_REPLY
106 typedef enum globus_gfs_command_type_e
108 GLOBUS_GFS_CMD_MKD = 1,
111 GLOBUS_GFS_CMD_SITE_AUTHZ_ASSERT,
112 GLOBUS_GFS_CMD_SITE_RDEL,
116 GLOBUS_GFS_CMD_SITE_CHMOD,
117 GLOBUS_GFS_CMD_SITE_DSI,
118 GLOBUS_GFS_CMD_SITE_SETNETSTACK,
119 GLOBUS_GFS_CMD_SITE_SETDISKSTACK,
120 GLOBUS_GFS_CMD_SITE_CLIENTINFO,
122 GLOBUS_GFS_CMD_SITE_CHGRP,
123 GLOBUS_GFS_CMD_SITE_UTIME,
124 GLOBUS_GFS_CMD_SITE_SYMLINKFROM,
125 GLOBUS_GFS_CMD_SITE_SYMLINK,
126 GLOBUS_GFS_CMD_HTTP_PUT,
127 GLOBUS_GFS_CMD_HTTP_GET,
128 GLOBUS_GFS_CMD_HTTP_CONFIG,
130 GLOBUS_GFS_CMD_SITE_TASKID,
133 GLOBUS_GFS_CMD_SITE_RESTRICT = 3072,
134 GLOBUS_GFS_CMD_SITE_CHROOT,
135 GLOBUS_GFS_CMD_SITE_SHARING,
138 GLOBUS_GFS_CMD_STORATTR,
139 GLOBUS_GFS_CMD_WHOAMI,
141 GLOBUS_GFS_MIN_CUSTOM_CMD = 4096
142 } globus_gfs_command_type_t;
209 typedef enum globus_gfs_buffer_type_e
211 GLOBUS_GFS_BUFFER_EOF_INFO = 0x0001,
212 GLOBUS_GFS_BUFFER_SERVER_DEFINED = 0xFFFF
214 } globus_gfs_buffer_type_t;
221 typedef enum globus_gfs_layout_type_e
223 GLOBUS_GFS_LAYOUT_PARTITIONED = 1,
224 GLOBUS_GFS_LAYOUT_BLOCKED
225 } globus_gfs_layout_type_t;
260 typedef struct globus_i_gfs_op_info_s * globus_gfs_op_info_t;
268 typedef struct globus_gfs_data_finished_info_s
279 const char ** contact_strings;
280 } globus_gfs_data_finished_info_t;
287 typedef struct globus_gfs_cmd_finshed_info_s
290 globus_gfs_command_type_t command;
295 } globus_gfs_cmd_finshed_info_t;
302 typedef struct globus_gfs_stat_finished_info_s
314 } globus_gfs_stat_finished_info_t;
321 typedef struct globus_gfs_session_finished_info_s
329 } globus_gfs_session_finished_info_t;
336 typedef struct globus_gfs_transfer_finished_info_s
339 globus_off_t bytes_transferred;
341 } globus_gfs_transfer_finished_info_t;
348 typedef struct globus_gfs_finished_info_s
351 globus_gfs_operation_type_t type;
364 globus_gfs_session_finished_info_t session;
365 globus_gfs_data_finished_info_t data;
366 globus_gfs_cmd_finshed_info_t command;
367 globus_gfs_stat_finished_info_t stat;
368 globus_gfs_transfer_finished_info_t transfer;
372 globus_gfs_op_info_t op_info;
373 } globus_gfs_finished_info_t;
380 typedef struct globus_gfs_event_info_s
397 globus_off_t recvd_bytes;
399 globus_range_list_t recvd_ranges;
410 globus_gfs_op_info_t op_info;
411 } globus_gfs_event_info_t;
418 typedef struct globus_gfs_transfer_info_s
429 globus_off_t partial_offset;
431 globus_off_t partial_length;
433 globus_range_list_t range_list;
449 globus_off_t alloc_size;
452 char * expected_checksum;
454 char * expected_checksum_alg;
459 int traversal_options;
462 globus_gfs_op_info_t op_info;
463 } globus_gfs_transfer_info_t;
469 #define rnfr_pathname from_pathname
476 typedef struct globus_gfs_command_info_s
479 globus_gfs_command_type_t command;
484 globus_off_t cksm_offset;
486 globus_off_t cksm_length;
495 char * from_pathname;
507 globus_gfs_op_info_t op_info;
508 } globus_gfs_command_info_t;
515 typedef struct globus_gfs_data_info_s
548 const char ** contact_strings;
554 gss_cred_id_t del_cred;
557 globus_gfs_op_info_t op_info;
558 } globus_gfs_data_info_t;
565 typedef struct globus_gfs_stat_info_s
579 globus_gfs_op_info_t op_info;
580 } globus_gfs_stat_info_t;
582 typedef struct globus_gfs_session_info_s
584 gss_cred_id_t del_cred;
594 globus_gfs_op_info_t op_info;
595 } globus_gfs_session_info_t;
597 typedef enum globus_gfs_brain_reason_e
599 GLOBUS_GFS_BRAIN_REASON_ERROR = 1,
600 GLOBUS_GFS_BRAIN_REASON_COMPLETE
601 } globus_gfs_brain_reason_t;
603 typedef struct globus_i_gfs_brain_node_s
609 int current_connection;
611 } globus_i_gfs_brain_node_t;
626 typedef struct globus_l_gfs_data_operation_s * globus_gfs_operation_t;
644 globus_gfs_operation_t op,
645 globus_gfs_session_info_t * session_info);
652 (*globus_gfs_storage_destroy_t)(
661 (*globus_gfs_storage_transfer_t)(
662 globus_gfs_operation_t op,
663 globus_gfs_transfer_info_t * transfer_info,
673 (*globus_gfs_storage_command_t)(
674 globus_gfs_operation_t op,
675 globus_gfs_command_info_t * command_info,
684 (*globus_gfs_storage_stat_t)(
685 globus_gfs_operation_t op,
686 globus_gfs_stat_info_t * stat_info,
696 (*globus_gfs_storage_data_t)(
697 globus_gfs_operation_t op,
698 globus_gfs_data_info_t * data_info,
709 (*globus_gfs_storage_data_destroy_t)(
721 (*globus_gfs_storage_trev_t)(
722 globus_gfs_event_info_t * event_info,
732 (*globus_gfs_storage_set_cred_t)(
733 gss_cred_id_t del_cred,
743 (*globus_gfs_storage_buffer_send_t)(
760 (*globus_gfs_storage_realpath_t)(
761 const char * in_path,
762 char ** out_realpath,
766 #define GLOBUS_GFS_DSI_DESCRIPTOR_SENDER (1 << 0)
767 #define GLOBUS_GFS_DSI_DESCRIPTOR_BLOCKING (1 << 1)
768 #define GLOBUS_GFS_DSI_DESCRIPTOR_HAS_REALPATH (1 << 2)
769 #define GLOBUS_GFS_DSI_DESCRIPTOR_REQUIRES_ORDERED_DATA (1 << 3)
770 #define GLOBUS_GFS_DSI_DESCRIPTOR_SETS_ERROR_RESPONSES (1 << 4)
771 #define GLOBUS_GFS_DSI_DESCRIPTOR_SAFE_RDEL (1 << 5)
781 typedef struct globus_gfs_storage_iface_s
787 globus_gfs_storage_destroy_t destroy_func;
790 globus_gfs_storage_transfer_t list_func;
791 globus_gfs_storage_transfer_t send_func;
792 globus_gfs_storage_transfer_t recv_func;
793 globus_gfs_storage_trev_t trev_func;
796 globus_gfs_storage_data_t active_func;
797 globus_gfs_storage_data_t passive_func;
798 globus_gfs_storage_data_destroy_t data_destroy_func;
800 globus_gfs_storage_command_t command_func;
801 globus_gfs_storage_stat_t stat_func;
803 globus_gfs_storage_set_cred_t set_cred_func;
804 globus_gfs_storage_buffer_send_t buffer_send_func;
805 globus_gfs_storage_realpath_t realpath_func;
806 } globus_gfs_storage_iface_t;
822 globus_gfs_operation_t op,
824 globus_gfs_finished_info_t * finished_info);
834 globus_gridftp_server_operation_event(
835 globus_gfs_operation_t op,
837 globus_gfs_event_info_t * event_info);
845 globus_gridftp_server_begin_transfer(
846 globus_gfs_operation_t op,
856 globus_gridftp_server_finished_transfer(
857 globus_gfs_operation_t op,
867 globus_gridftp_server_finished_session_start(
868 globus_gfs_operation_t op,
882 globus_gridftp_server_finished_command(
883 globus_gfs_operation_t op,
885 char * command_response);
887 globus_gridftp_server_intermediate_command(
888 globus_gfs_operation_t op,
890 char * command_response);
898 globus_gridftp_server_finished_stat(
899 globus_gfs_operation_t op,
905 globus_gridftp_server_finished_stat_partial(
906 globus_gfs_operation_t op,
912 globus_gridftp_server_finished_stat_custom_list(
913 globus_gfs_operation_t op,
925 globus_gridftp_server_finished_active_data(
926 globus_gfs_operation_t op,
937 globus_gridftp_server_finished_passive_data(
938 globus_gfs_operation_t op,
942 const char ** contact_strings,
962 globus_gfs_operation_t op,
969 globus_gridftp_server_register_write(
970 globus_gfs_operation_t op,
988 (*globus_gridftp_server_read_cb_t)(
989 globus_gfs_operation_t op,
998 globus_gridftp_server_register_read(
999 globus_gfs_operation_t op,
1002 globus_gridftp_server_read_cb_t callback,
1041 globus_gridftp_server_add_command(
1042 globus_gfs_operation_t op,
1043 const char * command_name,
1047 const char * help_string,
1067 globus_gfs_operation_t op,
1068 const char * cksm_str);
1082 GLOBUS_GFS_OP_INFO_CMD_ARGS = 1
1092 globus_gridftp_server_query_op_info(
1093 globus_gfs_operation_t op,
1094 globus_gfs_op_info_t op_info,
1109 globus_gridftp_server_get_recv_attr_string(
1110 globus_gfs_operation_t op,
1111 const char * requested_attr,
1121 globus_gridftp_server_get_recv_modification_time(
1122 globus_gfs_operation_t op,
1136 globus_gridftp_server_update_bytes_written(
1137 globus_gfs_operation_t op,
1138 globus_off_t offset,
1139 globus_off_t length);
1152 globus_gridftp_server_update_bytes_recvd(
1153 globus_gfs_operation_t op,
1154 globus_off_t length);
1167 globus_gridftp_server_update_range_recvd(
1168 globus_gfs_operation_t op,
1169 globus_off_t offset,
1170 globus_off_t length);
1179 globus_gridftp_server_get_optimal_concurrency(
1180 globus_gfs_operation_t op,
1191 globus_gridftp_server_get_block_size(
1192 globus_gfs_operation_t op,
1202 globus_gridftp_server_get_stripe_block_size(
1203 globus_gfs_operation_t op,
1214 globus_gridftp_server_get_session_username(
1215 globus_gfs_operation_t op,
1227 globus_gridftp_server_get_delegated_cred(
1228 globus_gfs_operation_t op,
1229 gss_cred_id_t * del_cred);
1243 globus_gridftp_server_get_sec_context(
1244 globus_gfs_operation_t op,
1245 gss_ctx_id_t * context);
1264 globus_gridftp_server_set_ordered_data(
1265 globus_gfs_operation_t op,
1269 globus_gridftp_server_get_ordered_data(
1270 globus_gfs_operation_t op,
1280 globus_gridftp_server_get_config_string(
1281 globus_gfs_operation_t op,
1282 char ** config_string);
1292 globus_gridftp_server_get_config_data(
1293 globus_gfs_operation_t op,
1295 char ** config_data);
1298 globus_gfs_data_get_file_stack_list(
1299 globus_gfs_operation_t in_op,
1303 globus_gfs_data_get_cmd_string(
1304 globus_gfs_operation_t op);
1307 globus_gridftp_server_get_update_interval(
1308 globus_gfs_operation_t op,
1320 globus_gridftp_server_get_read_range(
1321 globus_gfs_operation_t op,
1322 globus_off_t * offset,
1323 globus_off_t * length);
1336 globus_gridftp_server_get_write_range(
1337 globus_gfs_operation_t op,
1338 globus_off_t * offset,
1339 globus_off_t * length);
1346 GLOBUS_GFS_LOG_ERR = 0x01,
1347 GLOBUS_GFS_LOG_WARN = 0x02,
1348 GLOBUS_GFS_LOG_TRANSFER = 0x04,
1349 GLOBUS_GFS_LOG_INFO = 0x08,
1350 GLOBUS_GFS_LOG_DUMP = 0x10,
1352 GLOBUS_GFS_LOG_ALL = 0xFF
1353 } globus_gfs_log_type_t;
1356 globus_gfs_log_message(
1357 globus_gfs_log_type_t type,
1358 const char * format,
1362 globus_gfs_log_result(
1363 globus_gfs_log_type_t type,
1370 GLOBUS_GFS_DEBUG_TRACE = 8,
1371 GLOBUS_GFS_DEBUG_INFO = 16,
1372 GLOBUS_GFS_DEBUG_STATE = 32
1376 #define GlobusGFSName(func) static const char * _gfs_name __attribute__((__unused__)) = #func
1378 #define GlobusGFSName(func) static const char * _gfs_name = #func
1381 GlobusDebugDeclare(GLOBUS_GRIDFTP_SERVER);
1383 #define GlobusGFSDebugPrintf(level, message) \
1384 GlobusDebugPrintf(GLOBUS_GRIDFTP_SERVER, level, message)
1386 #define GlobusGFSDebugInfo(_msg) \
1387 GlobusGFSDebugPrintf( \
1388 GLOBUS_GFS_DEBUG_INFO, \
1389 ("[%s] %s\n", __func__, _msg))
1391 #define GlobusGFSDebugEnter() \
1392 GlobusGFSDebugPrintf( \
1393 GLOBUS_GFS_DEBUG_TRACE, \
1394 ("[%s] Entering\n", __func__))
1396 #define GlobusGFSDebugExit() \
1397 GlobusGFSDebugPrintf( \
1398 GLOBUS_GFS_DEBUG_TRACE, \
1399 ("[%s] Exiting\n", __func__))
1401 #define GlobusGFSDebugState(_state) \
1402 GlobusGFSDebugPrintf( \
1403 GLOBUS_GFS_DEBUG_INFO, \
1404 ("[%s] State: %d\n", __func__, _state))
1406 #define GlobusGFSDebugExitWithError() \
1407 GlobusGFSDebugPrintf( \
1408 GLOBUS_GFS_DEBUG_TRACE, \
1409 ("[%s] Exiting with error\n", __func__))
1411 #define GlobusGFSErrorParameter(mem_name) \
1412 globus_error_put(GlobusGFSErrorObjParameter(mem_name))
1414 #define GlobusGFSErrorIPC() \
1415 globus_error_put(GlobusGFSErrorObjIPC())
1417 #define GlobusGFSErrorObjIPC() \
1418 globus_error_construct_error( \
1421 GLOBUS_GFS_ERROR_MEMORY, \
1425 "IPC Communication error.")
1427 #define GlobusGFSErrorObjParameter(param_name) \
1428 globus_error_construct_error( \
1431 GLOBUS_GFS_ERROR_PARAMETER, \
1435 "invalid parameter: %s", \
1438 #define GlobusGFSErrorSystemError(system_func, system_errno) \
1439 globus_error_put(GlobusGFSErrorObjSystemError(\
1440 (system_func), (system_errno)))
1441 #define GlobusGFSErrorObjSystemError(system_func, system_errno) \
1442 globus_i_gfs_error_system( \
1443 0, (system_errno), \
1444 "System error%s%s", \
1445 (system_func) != NULL ? " in " : "", \
1446 (system_func) != NULL ? (system_func) : "")
1448 #define GlobusGFSErrorWrapFailed(failed_func, result) \
1449 globus_error_put(GlobusGFSErrorObjWrapFailed(failed_func, result))
1451 #define GlobusGFSErrorObjWrapFailed(failed_func, result) \
1452 globus_error_construct_error( \
1454 globus_error_get((result)), \
1455 GLOBUS_GFS_ERROR_WRAPPED, \
1462 #define GlobusGFSErrorData(reason) \
1463 globus_error_put(GlobusGFSErrorObjData(reason))
1465 #define GlobusGFSErrorObjData(reason) \
1466 globus_error_construct_error( \
1469 GLOBUS_GFS_ERROR_DATA, \
1476 #define GlobusGFSErrorGeneric(reason) \
1477 globus_error_put(GlobusGFSErrorObjGeneric(reason))
1479 #define GlobusGFSErrorObjGeneric(reason) \
1480 globus_error_construct_error( \
1483 GLOBUS_GFS_ERROR_GENERIC, \
1493 globus_object_t * base_cause,
1495 const char *response_error_code,
1501 globus_object_t * error,
1503 globus_object_t * base_cause,
1505 const char * response_error_code,
1510 globus_object_t * error,
1512 globus_object_t * base_cause,
1514 const char * response_error_code,
1520 globus_object_t * error);
1524 globus_object_t * error);
1528 globus_object_t * error,
1529 const char * response_error_code);
1531 extern const globus_object_type_t
1534 #define GLOBUS_GFS_ERROR_FTP_RESPONSE_TYPE \
1535 (&GLOBUS_GFS_ERROR_FTP_RESPONSE_TYPE_DEFINITION)
1538 #define GlobusGFSErrorFtpResponse(cause, code, response_error_code, ...) \
1539 globus_error_put(GlobusGFSErrorObjFtpResponse( \
1540 cause, code, response_error_code, __VA_ARGS__))
1542 #define GlobusGFSErrorObjFtpResponse(cause, code, response_error_code, ...) \
1543 globus_gfs_ftp_response_error_construct( \
1547 response_error_code, \
1553 #define GlobusGFSErrorMemory(mem) \
1554 globus_error_put(GlobusGFSErrorObjMemory(mem))
1555 #define GlobusGFSErrorObjMemory(mem) \
1556 GlobusGFSErrorObjSystemError("malloc", errno)
1558 #define GlobusGFSErrorObj(cause, response_code, ...) \
1559 GlobusGFSErrorObjFtpResponse(cause, response_code, __VA_ARGS__)
1561 #define GlobusGFSErrorPathNotFound(p) \
1562 globus_error_put(GlobusGFSErrorObjPathNotFound(NULL, p))
1563 #define GlobusGFSErrorObjPathNotFound(cause, p) \
1564 GlobusGFSErrorObj((cause), 550, "PATH_NOT_FOUND", \
1566 ((p) != NULL) ? "GridFTP-Path: \"" : "", \
1567 ((p) != NULL) ? (p) : "", \
1568 ((p) != NULL) ? "\"" : "")
1570 #define GlobusGFSErrorIncorrectChecksum(computed, expected) \
1571 globus_error_put(GlobusGFSErrorObjIncorrectChecksum( \
1572 NULL, computed, expected))
1573 #define GlobusGFSErrorObjIncorrectChecksum(cause, computed, expected) \
1574 GlobusGFSErrorObj( \
1577 "INCORRECT_CHECKSUM", \
1578 "GridFTP-Computed-Checksum: %s\n" \
1579 "GridFTP-Expected-Checksum: %s", (computed), (expected))
1581 #define GlobusGFSErrorMultipartUploadNotFound() \
1582 globus_error_put(GlobusGFSErrorObjMultipartUploadNotFound(NULL))
1583 #define GlobusGFSErrorObjMultipartUploadNotFound(cause) \
1584 GlobusGFSErrorObj(cause, 553, "MULTI_PART_UPLOAD_NOT_FOUND", NULL)
1586 #define GlobusGFSErrorAppendNotSupported() \
1587 globus_error_put(GlobusGFSErrorObjAppendNotSupported(NULL))
1588 #define GlobusGFSErrorObjAppendNotSupported(cause) \
1589 GlobusGFSErrorObj((cause), 553, "APPEND_NOT_SUPPORTED", NULL)
1591 #define GlobusGFSErrorAmbiguousPath(ambiguity) \
1592 globus_error_put(GlobusGFSErrorObjAmbiguousPath(NULL, ambiguity))
1593 #define GlobusGFSErrorObjAmbiguousPath(cause, ambiguity) \
1594 GlobusGFSErrorObj( \
1598 "GridFTP-Path: %s", \
1601 #define GlobusGFSErrorTooBusy() \
1602 globus_error_put(GlobusGFSErrorObjTooBusy(NULL))
1603 #define GlobusGFSErrorObjTooBusy(cause) \
1604 GlobusGFSErrorObj((cause), 451, "TOO_BUSY", NULL)
1606 #define GlobusGFSErrorDataChannelAuthenticationFailure() \
1607 globus_error_put(GlobusGFSErrorObjDataChannelAuthenticationFailure( \
1609 #define GlobusGFSErrorObjDataChannelAuthenticationFailure(cause) \
1610 GlobusGFSErrorObj((cause), 425, \
1611 "DATA_CHANNEL_AUTHENTICATION_FAILURE", NULL)
1613 #define GlobusGFSErrorDataChannelCommunicationFailure() \
1614 globus_error_put(GlobusGFSErrorObjDataChannelCommunicationFailure( \
1616 #define GlobusGFSErrorObjDataChannelCommunicationFailure(cause) \
1617 GlobusGFSErrorObj((cause), 425, \
1618 "DATA_CHANNEL_COMMUNICATION_FAILURE", NULL)
1620 #define GlobusGFSErrorLoginDenied() \
1621 globus_error_put(GlobusGFSErrorObjLoginDenied(NULL))
1622 #define GlobusGFSErrorObjLoginDenied(cause) \
1623 GlobusGFSErrorObj((cause), 530, "LOGIN_DENIED", NULL)
1625 #define GlobusGFSErrorPermissionDenied() \
1626 globus_error_put(GlobusGFSErrorObjPermissionDenied(NULL))
1627 #define GlobusGFSErrorObjPermissionDenied(cause) \
1628 GlobusGFSErrorObj((cause), 550, "PERMISSION_DENIED", NULL)
1630 #define GlobusGFSErrorQuotaExceeded() \
1631 globus_error_put(GlobusGFSErrorObjQuotaExceeded(NULL))
1632 #define GlobusGFSErrorObjQuotaExceeded(cause) \
1633 GlobusGFSErrorObj((cause), 451, "QUOTA_EXCEEDED", NULL)
1635 #define GlobusGFSErrorNoSpaceLeft() \
1636 globus_error_put(GlobusGFSErrorObjNoSpaceLeft(NULL))
1637 #define GlobusGFSErrorObjNoSpaceLeft(cause) \
1638 GlobusGFSErrorObj((cause), 451, "NO_SPACE_LEFT", NULL)
1640 #define GlobusGFSErrorInvalidPathName(name) \
1641 globus_error_put(GlobusGFSErrorObjInvalidPathName(NULL, name))
1642 #define GlobusGFSErrorObjInvalidPathName(cause, name) \
1643 GlobusGFSErrorObj((cause), 553, "INVALID_PATH_NAME", \
1644 "GridFTP-Path: %s", name)
1646 #define GlobusGFSErrorPathExists(name) \
1647 globus_error_put(GlobusGFSErrorObjPathExists(NULL, name))
1648 #define GlobusGFSErrorObjPathExists(cause, name) \
1649 GlobusGFSErrorObj((cause), 553, "PATH_EXISTS", \
1650 "GridFTP-Path: %s", name)
1652 #define GlobusGFSErrorIsADirectory(name) \
1653 globus_error_put(GlobusGFSErrorObjIsADirectory(NULL, name))
1654 #define GlobusGFSErrorObjIsADirectory(cause, name) \
1655 GlobusGFSErrorObj((cause), 553, "IS_A_DIRECTORY", \
1656 "GridFTP-Path: %s", name)
1658 #define GlobusGFSErrorNotADirectory(name) \
1659 globus_error_put(GlobusGFSErrorObjNotADirectory(NULL, name))
1660 #define GlobusGFSErrorObjNotADirectory(cause, name) \
1661 GlobusGFSErrorObj((cause), 553, "NOT_A_DIRECTORY", \
1662 "GridFTP-Path: %s", name)
1664 #define GlobusGFSErrorCRLError() \
1665 globus_error_put(GlobusGFSErrorObjCRLError(NULL))
1666 #define GlobusGFSErrorObjCRLError(cause) \
1667 GlobusGFSErrorObj((cause), 530, "CRL_ERROR", NULL)
1669 #define GlobusGFSErrorInternalError(generic_string) \
1670 globus_error_put(GlobusGFSErrorObjInternalError( \
1671 NULL, (generic_string)))
1672 #define GlobusGFSErrorObjInternalError(cause, generic_string) \
1673 GlobusGFSErrorObj((cause), 500, "INTERNAL_ERROR", \
1675 ((generic_string) != NULL) ? "GridFTP-Error: " : "", \
1676 ((generic_string) != NULL) ? generic_string : "")
1678 #define GlobusGFSErrorNotImplemented() \
1679 globus_error_put(GlobusGFSErrorObjNotImplemented(NULL))
1680 #define GlobusGFSErrorObjNotImplemented(cause) \
1681 GlobusGFSErrorObj((cause), 500, "NOT_IMPLEMETED", NULL)
1683 #define GlobusGFSErrorNotImplementedFeature(feature) \
1684 globus_error_put(GlobusGFSErrorObjNotImplementedFeature(NULL, feature))
1685 #define GlobusGFSErrorObjNotImplementedFeature(cause, feature) \
1686 GlobusGFSErrorObj((cause), 500, \
1687 "NOT_IMPLEMETED", "GridFTP-Feature: %s", (feature))
1689 #define GlobusGFSErrorConfigurationError() \
1690 globus_error_put(GlobusGFSErrorObjConfigurationError(NULL))
1691 #define GlobusGFSErrorObjConfigurationError(cause) \
1692 GlobusGFSErrorObj((cause), 500, "CONFIGURATION_ERROR", NULL)
1699 typedef struct globus_i_gfs_ipc_handle_s * globus_gfs_ipc_handle_t;
1724 (*globus_gfs_ipc_callback_t)(
1725 globus_gfs_ipc_handle_t ipc_handle,
1727 globus_gfs_finished_info_t * reply,
1731 (*globus_gfs_ipc_event_callback_t)(
1732 globus_gfs_ipc_handle_t ipc_handle,
1734 globus_gfs_event_info_t * reply,
1738 (*globus_gfs_ipc_close_callback_t)(
1739 globus_gfs_ipc_handle_t ipc_handle,
1744 (*globus_gfs_ipc_open_callback_t)(
1745 globus_gfs_ipc_handle_t ipc_handle,
1747 globus_gfs_finished_info_t * reply,
1751 (*globus_gfs_ipc_error_callback_t)(
1752 globus_gfs_ipc_handle_t ipc_handle,
1757 globus_gfs_ipc_reply_finished(
1758 globus_gfs_ipc_handle_t ipc_handle,
1759 globus_gfs_finished_info_t * reply);
1762 globus_gfs_ipc_reply_event(
1763 globus_gfs_ipc_handle_t ipc_handle,
1764 globus_gfs_event_info_t * reply);
1767 globus_gfs_ipc_reply_session(
1768 globus_gfs_ipc_handle_t ipc_handle,
1769 globus_gfs_finished_info_t * reply);
1783 (*globus_i_gfs_ipc_data_callback_t)(
1784 globus_gfs_finished_info_t * reply,
1788 (*globus_i_gfs_ipc_data_event_callback_t)(
1789 globus_gfs_event_info_t * reply,
1793 (*globus_i_gfs_ipc_done_callback_t)(
1804 (*globus_gfs_ipc_iface_session_start_t)(
1805 globus_gfs_ipc_handle_t ipc_handle,
1806 const gss_ctx_id_t context,
1807 globus_gfs_session_info_t * session_info,
1808 globus_i_gfs_ipc_data_callback_t cb,
1812 globus_gfs_ipc_start_session(
1813 globus_gfs_ipc_handle_t ipc_handle,
1814 globus_gfs_session_info_t * session_info,
1815 globus_gfs_ipc_callback_t cb,
1820 (*globus_gfs_ipc_iface_session_stop_t)(
1821 globus_gfs_ipc_handle_t ipc_handle,
1822 void * session_handle);
1825 globus_gfs_ipc_iface_session_stop(
1826 globus_gfs_ipc_handle_t ipc_handle,
1827 void * session_handle);
1830 (*globus_gfs_ipc_iface_set_cred_t)(
1831 globus_gfs_ipc_handle_t ipc_handle,
1832 void * session_handle,
1833 gss_cred_id_t del_cred);
1836 globus_gfs_ipc_set_cred(
1837 globus_gfs_ipc_handle_t ipc_handle,
1838 gss_cred_id_t del_cred);
1841 (*globus_gfs_ipc_iface_buffer_send_t)(
1842 globus_gfs_ipc_handle_t ipc_handle,
1843 void * session_handle,
1849 globus_gfs_ipc_request_buffer_send(
1850 globus_gfs_ipc_handle_t ipc_handle,
1861 (*globus_gfs_ipc_iface_recv_t)(
1862 globus_gfs_ipc_handle_t ipc_handle,
1863 void * session_handle,
1865 globus_gfs_transfer_info_t * recv_info,
1866 globus_i_gfs_ipc_data_callback_t cb,
1867 globus_i_gfs_ipc_data_event_callback_t event_cb,
1871 globus_gfs_ipc_request_recv(
1872 globus_gfs_ipc_handle_t ipc_handle,
1873 globus_gfs_transfer_info_t * recv_info,
1874 globus_gfs_ipc_callback_t cb,
1875 globus_gfs_ipc_event_callback_t event_cb,
1884 (*globus_gfs_ipc_iface_send_t)(
1885 globus_gfs_ipc_handle_t ipc_handle,
1886 void * session_handle,
1888 globus_gfs_transfer_info_t * send_info,
1889 globus_i_gfs_ipc_data_callback_t cb,
1890 globus_i_gfs_ipc_data_event_callback_t event_cb,
1894 globus_gfs_ipc_request_send(
1895 globus_gfs_ipc_handle_t ipc_handle,
1896 globus_gfs_transfer_info_t * send_info,
1897 globus_gfs_ipc_callback_t cb,
1898 globus_gfs_ipc_event_callback_t event_cb,
1902 (*globus_gfs_ipc_iface_list_t)(
1903 globus_gfs_ipc_handle_t ipc_handle,
1904 void * session_handle,
1906 globus_gfs_transfer_info_t * list_info,
1907 globus_i_gfs_ipc_data_callback_t cb,
1908 globus_i_gfs_ipc_data_event_callback_t event_cb,
1912 globus_gfs_ipc_request_list(
1913 globus_gfs_ipc_handle_t ipc_handle,
1914 globus_gfs_transfer_info_t * data_info,
1915 globus_gfs_ipc_callback_t cb,
1916 globus_gfs_ipc_event_callback_t event_cb,
1925 (*globus_gfs_ipc_iface_command_t)(
1926 globus_gfs_ipc_handle_t ipc_handle,
1927 void * session_handle,
1929 globus_gfs_command_info_t * cmd_info,
1930 globus_i_gfs_ipc_data_callback_t cb,
1934 globus_gfs_ipc_request_command(
1935 globus_gfs_ipc_handle_t ipc_handle,
1936 globus_gfs_command_info_t * cmd_info,
1937 globus_gfs_ipc_callback_t cb,
1946 (*globus_gfs_ipc_iface_active_data_t)(
1947 globus_gfs_ipc_handle_t ipc_handle,
1948 void * session_handle,
1950 globus_gfs_data_info_t * data_info,
1951 globus_i_gfs_ipc_data_callback_t cb,
1955 globus_gfs_ipc_request_active_data(
1956 globus_gfs_ipc_handle_t ipc_handle,
1957 globus_gfs_data_info_t * data_info,
1958 globus_gfs_ipc_callback_t cb,
1967 (*globus_gfs_ipc_iface_passive_data_t)(
1968 globus_gfs_ipc_handle_t ipc_handle,
1969 void * session_handle,
1971 globus_gfs_data_info_t * data_info,
1972 globus_i_gfs_ipc_data_callback_t cb,
1976 globus_gfs_ipc_request_passive_data(
1977 globus_gfs_ipc_handle_t ipc_handle,
1978 globus_gfs_data_info_t * data_info,
1979 globus_gfs_ipc_callback_t cb,
1986 (*globus_gfs_ipc_iface_stat_t)(
1987 globus_gfs_ipc_handle_t ipc_handle,
1988 void * session_handle,
1990 globus_gfs_stat_info_t * stat_info,
1991 globus_i_gfs_ipc_data_callback_t cb,
1995 globus_gfs_ipc_request_stat(
1996 globus_gfs_ipc_handle_t ipc_handle,
1997 globus_gfs_stat_info_t * stat_info,
1998 globus_gfs_ipc_callback_t cb,
2005 (*globus_gfs_ipc_iface_transfer_event_t)(
2006 globus_gfs_ipc_handle_t ipc_handle,
2007 void * session_handle,
2008 globus_gfs_event_info_t * event_info);
2012 globus_gfs_ipc_request_transfer_event(
2013 globus_gfs_ipc_handle_t ipc_handle,
2014 globus_gfs_event_info_t * event_info);
2021 (*globus_gfs_ipc_iface_data_destroy_t)(
2022 globus_gfs_ipc_handle_t ipc_handle,
2023 void * session_handle,
2027 globus_gfs_ipc_request_data_destroy(
2028 globus_gfs_ipc_handle_t ipc_handle,
2031 typedef struct globus_i_gfs_ipc_iface_s
2033 globus_gfs_ipc_iface_session_start_t session_start_func;
2034 globus_gfs_ipc_iface_session_stop_t session_stop_func;
2035 globus_gfs_ipc_iface_recv_t recv_func;
2036 globus_gfs_ipc_iface_send_t send_func;
2037 globus_gfs_ipc_iface_command_t command_func;
2038 globus_gfs_ipc_iface_active_data_t active_func;
2039 globus_gfs_ipc_iface_passive_data_t passive_func;
2040 globus_gfs_ipc_iface_data_destroy_t data_destroy_func;
2041 globus_gfs_ipc_iface_stat_t stat_func;
2042 globus_gfs_ipc_iface_list_t list_func;
2043 globus_gfs_ipc_iface_transfer_event_t transfer_event_func;
2044 globus_gfs_ipc_iface_set_cred_t set_cred;
2045 globus_gfs_ipc_iface_buffer_send_t buffer_send;
2046 } globus_gfs_ipc_iface_t;
2057 globus_gfs_ipc_handle_create(
2058 globus_gfs_ipc_iface_t * iface,
2059 globus_xio_system_socket_t system_handle,
2060 globus_i_gfs_ipc_done_callback_t done_cb,
2067 globus_gfs_ipc_close(
2068 globus_gfs_ipc_handle_t ipc_handle,
2069 globus_gfs_ipc_close_callback_t cb,
2073 globus_gfs_ipc_reply_close(
2074 globus_gfs_ipc_handle_t ipc_handle);
2077 globus_gfs_ipc_session_stop(
2078 globus_gfs_ipc_handle_t ipc_handle);
2081 globus_gfs_ipc_handle_connect(
2082 globus_gfs_session_info_t * session_info,
2083 globus_gfs_ipc_open_callback_t cb,
2085 globus_gfs_ipc_error_callback_t error_cb,
2086 void * error_user_arg);
2089 globus_gfs_ipc_handle_connect_ex(
2090 globus_gfs_session_info_t * session_info,
2091 globus_gfs_ipc_open_callback_t cb,
2093 globus_gfs_ipc_error_callback_t error_cb,
2094 void * error_user_arg,
2097 const char *auth_mode,
2098 const char *subject,
2099 time_t connect_timeout,
2100 time_t idle_timeout,
2104 globus_gfs_ipc_handle_obtain(
2105 globus_gfs_session_info_t * session_info,
2106 globus_gfs_ipc_iface_t * iface,
2107 globus_gfs_ipc_open_callback_t cb,
2109 globus_gfs_ipc_error_callback_t error_cb,
2110 void * error_user_arg);
2115 #define BRAIN_SYMBOL_NAME (void*)"gridftp_brain"
2116 extern globus_extension_registry_t brain_i_registry;
2119 (*globus_i_gfs_brain_select_nodes_func_t)(
2120 globus_i_gfs_brain_node_t *** out_node_array,
2121 int * out_array_length,
2122 const char * repo_name,
2123 globus_off_t filesize,
2128 (*globus_i_gfs_brain_release_node_func_t)(
2129 globus_i_gfs_brain_node_t * contact_node,
2130 globus_gfs_brain_reason_t reason);
2133 (*globus_i_gfs_brain_init_func_t)();
2136 (*globus_i_gfs_brain_stop_func_t)();
2139 (*globus_i_gfs_brain_get_available_func_t)(
2140 const char * user_id,
2141 const char * repo_name,
2145 typedef struct globus_i_gfs_brain_module_s
2147 globus_i_gfs_brain_init_func_t init_func;
2148 globus_i_gfs_brain_stop_func_t stop_func;
2149 globus_i_gfs_brain_select_nodes_func_t select_func;
2150 globus_i_gfs_brain_release_node_func_t release_func;
2151 globus_i_gfs_brain_get_available_func_t available_func;
2152 } globus_i_gfs_brain_module_t;
2154 extern globus_i_gfs_brain_module_t globus_i_gfs_default_brain;
2157 globus_gfs_brain_select_nodes(
2158 globus_i_gfs_brain_node_t *** out_node_array,
2159 int * out_array_length,
2160 const char * repo_name,
2161 globus_off_t filesize,
2166 globus_gfs_brain_release_node(
2167 globus_i_gfs_brain_node_t * contact_node,
2168 globus_gfs_brain_reason_t reason);
2171 globus_gfs_brain_get_available(
2172 const char * user_id,
2173 const char * repo_name,
2177 globus_gfs_ipc_handle_get_contact_string(
2178 globus_gfs_ipc_handle_t ipc_handle,
2179 char ** contact_string);
2182 globus_gfs_ipc_init(
2189 globus_gfs_ipc_add_server(
2190 globus_xio_server_t server_handle);
2192 extern globus_gfs_ipc_iface_t globus_gfs_ipc_default_iface;
2205 typedef struct globus_i_gfs_acl_handle_s * globus_gfs_acl_handle_t;
2210 typedef enum globus_gfs_acl_action_e
2213 GFS_ACL_ACTION_INIT = 1,
2215 GFS_ACL_ACTION_DELETE,
2217 GFS_ACL_ACTION_WRITE,
2219 GFS_ACL_ACTION_CREATE,
2221 GFS_ACL_ACTION_READ,
2223 GFS_ACL_ACTION_LOOKUP,
2227 GFS_ACL_ACTION_AUTHZ_ASSERT,
2230 GFS_ACL_ACTION_COMMIT,
2233 } globus_gfs_acl_action_t;
2237 typedef struct globus_gfs_acl_info_s
2244 gss_ctx_id_t context;
2245 } globus_gfs_acl_info_t;
2249 typedef struct globus_gfs_acl_object_desc_s
2270 globus_gfs_op_info_t op_info;
2271 } globus_gfs_acl_object_desc_t;
2274 typedef enum globus_gfs_acl_status_e
2277 GLOBUS_GFS_ACL_COMPLETE = 1,
2280 GLOBUS_GFS_ACL_WOULD_BLOCK
2281 } globus_gfs_acl_status_t;
2298 (*globus_gfs_acl_init_t)(
2300 globus_gfs_acl_info_t * acl_info,
2301 globus_gfs_acl_handle_t acl_handle,
2314 (*globus_gfs_acl_authorize_t)(
2316 globus_gfs_acl_action_t action,
2317 globus_gfs_acl_object_desc_t * object,
2318 globus_gfs_acl_info_t * acl_info,
2319 globus_gfs_acl_handle_t acl_handle,
2324 (*globus_gfs_acl_destroy_t)(
2330 (*globus_gfs_acl_audit_t)(
2332 globus_gfs_acl_action_t action,
2333 globus_gfs_acl_object_desc_t * object,
2334 const char * message);
2338 typedef struct globus_gfs_acl_module_s
2340 globus_gfs_acl_init_t init_func;
2341 globus_gfs_acl_authorize_t authorize_func;
2342 globus_gfs_acl_destroy_t destroy_func;
2343 globus_gfs_acl_audit_t audit_func;
2344 } globus_gfs_acl_module_t;
2350 globus_gfs_acl_authorized_finished(
2351 globus_gfs_acl_handle_t acl_handle,
2357 globus_gfs_acl_action_to_string(
2358 globus_gfs_acl_action_t action);
2367 (*globus_i_gfs_config_set_string_cb_t)(
2368 const char * option_name,
2374 (*globus_i_gfs_config_set_int_cb_t)(
2375 const char * option_name,
2384 } globus_i_gfs_config_option_cb_ent_t;
2387 globus_gfs_config_enable_cb(
2388 globus_i_gfs_config_option_cb_ent_t * cb_handle,
2392 globus_gfs_config_add_cb(
2393 globus_i_gfs_config_option_cb_ent_t ** cb_handle,
2399 globus_gfs_config_get_bool(
2400 const char * option_name);
2403 globus_gfs_config_get_string(
2404 const char * option_name);
2407 globus_gfs_config_get_list(
2408 const char * option_name);
2411 globus_gfs_config_get(
2412 const char * option_name);
2415 globus_gfs_config_get_int(
2416 const char * option_name);
2419 globus_gfs_config_set_int(
2424 globus_gfs_config_set_bool(
2429 globus_gfs_config_set_ptr(
2434 globus_gfs_config_inc_int(
Definition: globus_gridftp_server.h:196
globus_bool_t globus_gfs_error_match_response_error_code(globus_object_t *error, const char *response_error_code)
Definition: globus_i_gfs_ftp_response_error.c:326
Definition: globus_gridftp_server.h:202
Definition: globus_gridftp_server.h:167
void globus_gridftp_server_operation_finished(globus_gfs_operation_t op, globus_result_t result, globus_gfs_finished_info_t *finished_info)
Definition: globus_i_gfs_data.c:12898
Definition: globus_gridftp_server.h:170
globus_result_t globus_gridftp_server_set_checksum_support(globus_gfs_operation_t op, const char *cksm_str)
Definition: globus_i_gfs_data.c:13464
void(* globus_gfs_storage_init_t)(globus_gfs_operation_t op, globus_gfs_session_info_t *session_info)
Definition: globus_gridftp_server.h:643
int globus_bool_t
Boolean type.
Definition: globus_types.h:93
globus_object_t * globus_gfs_ftp_response_error_construct(globus_module_descriptor_t *base_source, globus_object_t *base_cause, int response_code, const char *response_error_code, const char *fmt,...)
Definition: globus_i_gfs_ftp_response_error.c:67
Definition: globus_gridftp_server.h:193
globus_object_t * globus_gfs_ftp_response_error_v_initialize(globus_object_t *error, globus_module_descriptor_t *base_source, globus_object_t *base_cause, int response_code, const char *response_error_code, const char *fmt, va_list ap)
Definition: globus_i_gfs_ftp_response_error.c:185
globus_gfs_op_info_param_t
Definition: globus_gridftp_server.h:1074
Definition: globus_gridftp_server.h:188
List data type.
Definition: globus_list.h:44
void(* globus_gridftp_server_write_cb_t)(globus_gfs_operation_t op, globus_result_t result, globus_byte_t *buffer, globus_size_t nbytes, void *user_arg)
Definition: globus_gridftp_server.h:961
Definition: globus_gridftp_server_control.h:209
Definition: globus_gridftp_server.h:174
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
globus_gfs_event_type_e
Event types.
Definition: globus_gridftp_server.h:163
enum globus_gfs_event_type_e globus_gfs_event_type_t
Event types.
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
Definition: globus_gridftp_server.h:183
Headers common to all of Globus.
globus_object_t * globus_gfs_ftp_response_error_initialize(globus_object_t *error, globus_module_descriptor_t *base_source, globus_object_t *base_cause, int response_code, const char *response_error_code, const char *fmt,...)
Definition: globus_i_gfs_ftp_response_error.c:132
uint32_t globus_result_t
Definition: globus_types.h:99
Definition: globus_gridftp_server.h:199
globus_object_t * globus_i_gfs_error_system(int ftp_code, int system_errno, const char *fmt,...)
Definition: globus_i_gfs_ftp_response_error.c:473
int globus_gfs_error_get_ftp_response_code(globus_object_t *error)
Definition: globus_i_gfs_ftp_response_error.c:261
Definition: globus_gridftp_server.h:178
const char * globus_gfs_error_get_ftp_response_error_code(globus_object_t *error)
Definition: globus_i_gfs_ftp_response_error.c:293
const globus_object_type_t GLOBUS_GFS_ERROR_FTP_RESPONSE_TYPE_DEFINITION
Definition: globus_i_gfs_ftp_response_error.c:618
Module Descriptor.
Definition: globus_module.h:71