globus_connect_gridftp_server 17.0~b1
Loading...
Searching...
No Matches
/build/globus-connect-gridftp-server-17.0~b1/globus_i_gridftp_server.h
1/*
2 * Copyright The University of Chicago
3 *
4 * All Rights Reserved.
5 */
6
7#ifndef GLOBUS_I_GRIDFTP_SERVER_H
8#define GLOBUS_I_GRIDFTP_SERVER_H
9
10
11#include "globus_i_gridftp_server_config.h"
13#include "globus_gridftp_server_control.h"
14#include "globus_i_gfs_acl.h"
15#include "globus_xio.h"
16#include "globus_xio_system.h"
17#include "globus_xio_tcp_driver.h"
18#include "globus_xio_gsi.h"
19#include "globus_ftp_control.h"
20
21
22/* This is insures that both of these macros are not defined in the same build
23 GRIDFTP_TEST_BUILD is strictly for testing and opens up security holes
24 GLOBUS_GRIDFTP_PRODUCTION is set when rpms and debs are built */
25#if defined(GLOBUS_GRIDFTP_PRODUCTION) && defined(GRIDFTP_TEST_BUILD)
26 Do not set GRIDFTP_TEST_BUILD on production builds!
27#endif
28
29
30#define _GSSL(s) globus_common_i18n_get_string_by_key(\
31 NULL, \
32 "globus_gridftp_server", \
33 s)
34
35#define _FSSL(s,p) globus_common_i18n_get_string_by_key(\
36 p, \
37 "globus_gridftp_server", \
38 s)
39
40typedef void
41(*globus_i_gfs_server_close_cb_t)(
42 void * user_arg,
43 globus_object_t * error);
44
45typedef struct globus_i_gfs_monitor_s
46{
47 globus_bool_t done;
48 globus_cond_t cond;
49 globus_mutex_t mutex;
50} globus_i_gfs_monitor_t;
51
52typedef struct gfs_i_stack_entry_s
53{
54 globus_xio_driver_t driver;
55 char * driver_name;
56 char * opts;
57} gfs_i_stack_entry_t;
58
59typedef struct
60{
61 int cmd_id;
62 char * cmd_name;
63 char * help_str;
64 int max_argc;
65 int min_argc;
66 globus_bool_t has_pathname;
67 int access_type;
68} globus_i_gfs_cmd_ent_t;
69
70typedef struct globus_i_gfs_op_info_s
71{
72 int id;
73 globus_hashtable_t custom_command_table;
74
75 char ** argv;
76 int argc;
77 globus_i_gfs_cmd_ent_t * cmd_ent;
78
79 char * remote_ip;
80} globus_i_gfs_op_info_t;
81
82void
83globus_i_gfs_monitor_init(
84 globus_i_gfs_monitor_t * monitor);
85
86void
87globus_i_gfs_monitor_destroy(
88 globus_i_gfs_monitor_t * monitor);
89
90void
91globus_i_gfs_monitor_wait(
92 globus_i_gfs_monitor_t * monitor);
93
94void
95globus_i_gfs_monitor_signal(
96 globus_i_gfs_monitor_t * monitor);
97
98void
99globus_i_gfs_ipc_stop();
100
101void
102globus_i_gfs_control_stop();
103
104void
105globus_i_gfs_control_init();
106
107globus_result_t
108globus_i_gfs_brain_init(
109 globus_callback_func_t ready_cb,
110 void * ready_cb_arg);
111
112void
113globus_i_gfs_control_end_421(
114 const char * msg);
115
116void
117globus_l_gfs_data_brain_ready(
118 void * user_arg);
119
120globus_result_t
121globus_i_gfs_get_full_path(
122 const char * home_dir,
123 const char * server_cwd,
124 void * session_arg,
125 const char * in_path,
126 char ** ret_path,
127 int access_type);
128
129#define GlobusGFSErrorGenericStr(_res, _fmt) \
130do \
131{ \
132 char * _tmp_str; \
133 _tmp_str = globus_common_create_string _fmt; \
134 _res = globus_error_put( \
135 globus_error_construct_error( \
136 GLOBUS_NULL, \
137 GLOBUS_NULL, \
138 GLOBUS_GFS_ERROR_GENERIC, \
139 __FILE__, \
140 _gfs_name, \
141 __LINE__, \
142 "%s", \
143 _tmp_str)); \
144 globus_free(_tmp_str); \
145 \
146} while(0)
147
148extern globus_gfs_acl_module_t globus_gfs_acl_cas_module;
149extern globus_gfs_acl_module_t globus_gfs_acl_test_module;
150
151typedef enum globus_l_gfs_auth_level_e
152{
153 GLOBUS_L_GFS_AUTH_NONE = 0x00,
154 GLOBUS_L_GFS_AUTH_IDENTIFY = 0x01,
155 GLOBUS_L_GFS_AUTH_ACTION = 0x02,
156 GLOBUS_L_GFS_AUTH_NOSETUID = 0x04,
157 GLOBUS_L_GFS_AUTH_NOGRIDMAP = 0x08,
158 GLOBUS_L_GFS_AUTH_DATA_NODE_PATH = 0x10,
159 GLOBUS_L_GFS_AUTH_ALL = 0xFF
160} globus_l_gfs_auth_level_t;
161
162#define GFS_L_AUTHTYPE_FTP 1<<0
163#define GFS_L_AUTHTYPE_IPC 1<<1
164#define GFS_L_AUTHTYPE_HTTP 1<<2
165#define GFS_L_AUTHTYPE_GSI 1<<3
166#define GFS_L_AUTHTYPE_TLS 1<<4
167#define GFS_L_AUTHTYPE_SHARING 1<<5
168
169#define GLOBUS_GCP_PREFIX ":globus-gcp:"
170#define GLOBUS_MAPPED_PREFIX ":globus-mapped-collection:"
171
172globus_result_t
173globus_i_gfs_data_parse_mapped_login_username(
174 const char * prefix,
175 const char * login_username,
176 char ** collection_idp,
177 char ** identity_idsp,
178 char ** identity_namesp,
179 char ** desired_userp,
180 int * high_assurance);
181
182#define GLOBUS_SHARING_PREFIX ":globus-sharing:"
183
184globus_result_t
185globus_i_gfs_data_parse_sharing_login_username(
186 const char * login_username,
187 char ** usernamep,
188 char ** collection_idp,
189 char ** shareep,
190 char ** sharee_idp,
191 int * high_assurance);
192
193#define GLOBUS_TUNNEL_PREFIX ":globus-tunnel:"
194
195globus_result_t
196globus_i_gfs_data_parse_tunnel_login_username(
197 const char * login_username,
198 char ** stream_ap_idp,
199 char ** tunnel_idp,
200 char ** identity_idsp,
201 char ** identity_namesp,
202 char ** desired_userp);
203
204
205globus_result_t
206globus_gfs_base64_encode(
207 const unsigned char * inbuf,
208 globus_size_t in_len,
209 globus_byte_t * outbuf,
210 globus_size_t * out_len);
211
212
213#include "globus_i_gfs_log.h"
214#include "globus_i_gfs_control.h"
215#include "globus_i_gfs_ipc.h"
216#include "globus_i_gfs_data.h"
217#include "globus_i_gfs_config.h"
218#include "globus_i_gfs_gcs_db.h"
219#include "gfs_i_recv_cache.h"
220#include "gfs_i_openssl.h"
221
222#endif