globus_connect_gridftp_server  16.6
/build/globus-connect-gridftp-server-16.6/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 #include "globus_i_gridftp_server_config.h"
11 #include "globus_gridftp_server.h"
12 #include "globus_gridftp_server_control.h"
13 #include "globus_i_gfs_acl.h"
14 #include "globus_xio.h"
15 #include "globus_xio_system.h"
16 #include "globus_xio_tcp_driver.h"
17 #include "globus_xio_gsi.h"
18 #include "globus_ftp_control.h"
19 #include "globus_gsi_authz.h"
20 
21 #define _GSSL(s) globus_common_i18n_get_string_by_key(\
22  NULL, \
23  "globus_gridftp_server", \
24  s)
25 
26 #define _FSSL(s,p) globus_common_i18n_get_string_by_key(\
27  p, \
28  "globus_gridftp_server", \
29  s)
30 
31 typedef void
32 (*globus_i_gfs_server_close_cb_t)(
33  void * user_arg,
34  globus_object_t * error);
35 
36 typedef struct globus_i_gfs_monitor_s
37 {
38  globus_bool_t done;
39  globus_cond_t cond;
40  globus_mutex_t mutex;
41 } globus_i_gfs_monitor_t;
42 
43 typedef struct gfs_i_stack_entry_s
44 {
45  globus_xio_driver_t driver;
46  char * driver_name;
47  char * opts;
48 } gfs_i_stack_entry_t;
49 
50 typedef struct
51 {
52  int cmd_id;
53  char * cmd_name;
54  char * help_str;
55  int max_argc;
56  int min_argc;
57  globus_bool_t has_pathname;
58  int access_type;
59 } globus_i_gfs_cmd_ent_t;
60 
61 typedef struct globus_i_gfs_op_info_s
62 {
63  int id;
64  globus_hashtable_t custom_command_table;
65 
66  char ** argv;
67  int argc;
68  globus_i_gfs_cmd_ent_t * cmd_ent;
69 
70  char * remote_ip;
71 } globus_i_gfs_op_info_t;
72 
73 void
74 globus_i_gfs_monitor_init(
75  globus_i_gfs_monitor_t * monitor);
76 
77 void
78 globus_i_gfs_monitor_destroy(
79  globus_i_gfs_monitor_t * monitor);
80 
81 void
82 globus_i_gfs_monitor_wait(
83  globus_i_gfs_monitor_t * monitor);
84 
85 void
86 globus_i_gfs_monitor_signal(
87  globus_i_gfs_monitor_t * monitor);
88 
89 void
90 globus_i_gfs_ipc_stop();
91 
92 void
93 globus_i_gfs_control_stop();
94 
95 void
96 globus_i_gfs_control_init();
97 
98 globus_result_t
99 globus_i_gfs_brain_init(
100  globus_callback_func_t ready_cb,
101  void * ready_cb_arg);
102 
103 void
104 globus_i_gfs_control_end_421(
105  const char * msg);
106 
107 void
108 globus_l_gfs_data_brain_ready(
109  void * user_arg);
110 
111 globus_result_t
112 globus_i_gfs_get_full_path(
113  const char * home_dir,
114  const char * server_cwd,
115  void * session_arg,
116  const char * in_path,
117  char ** ret_path,
118  int access_type);
119 
120 #define GlobusGFSErrorGenericStr(_res, _fmt) \
121 do \
122 { \
123  char * _tmp_str; \
124  _tmp_str = globus_common_create_string _fmt; \
125  _res = globus_error_put( \
126  globus_error_construct_error( \
127  GLOBUS_NULL, \
128  GLOBUS_NULL, \
129  GLOBUS_GFS_ERROR_GENERIC, \
130  __FILE__, \
131  _gfs_name, \
132  __LINE__, \
133  "%s", \
134  _tmp_str)); \
135  globus_free(_tmp_str); \
136  \
137 } while(0)
138 
139 extern globus_gfs_acl_module_t globus_gfs_acl_cas_module;
140 extern globus_gfs_acl_module_t globus_gfs_acl_test_module;
141 
142 typedef enum globus_l_gfs_auth_level_e
143 {
144  GLOBUS_L_GFS_AUTH_NONE = 0x00,
145  GLOBUS_L_GFS_AUTH_IDENTIFY = 0x01,
146  GLOBUS_L_GFS_AUTH_ACTION = 0x02,
147  GLOBUS_L_GFS_AUTH_NOSETUID = 0x04,
148  GLOBUS_L_GFS_AUTH_NOGRIDMAP = 0x08,
149  GLOBUS_L_GFS_AUTH_DATA_NODE_PATH = 0x10,
150  GLOBUS_L_GFS_AUTH_ALL = 0xFF
151 } globus_l_gfs_auth_level_t;
152 
153 #define GFS_L_AUTHTYPE_FTP 1<<0
154 #define GFS_L_AUTHTYPE_IPC 1<<1
155 #define GFS_L_AUTHTYPE_HTTP 1<<2
156 #define GFS_L_AUTHTYPE_GSI 1<<3
157 #define GFS_L_AUTHTYPE_TLS 1<<4
158 #define GFS_L_AUTHTYPE_SHARING 1<<5
159 
160 #define GLOBUS_GCP_PREFIX ":globus-gcp:"
161 #define GLOBUS_MAPPED_PREFIX ":globus-mapped-collection:"
162 
163 globus_result_t
164 globus_i_gfs_data_parse_mapped_login_username(
165  const char * prefix,
166  const char * login_username,
167  char ** collection_idp,
168  char ** identity_idsp,
169  char ** identity_namesp,
170  char ** desired_userp,
171  int * high_assurance);
172 
173 #define GLOBUS_SHARING_PREFIX ":globus-sharing:"
174 
175 globus_result_t
176 globus_i_gfs_data_parse_sharing_login_username(
177  const char * login_username,
178  char ** usernamep,
179  char ** collection_idp,
180  char ** certp,
181  char ** shareep,
182  char ** sharee_idp,
183  int * high_assurance);
184 
185 globus_result_t
186 globus_i_gfs_base64_encode(
187  const unsigned char * inbuf,
188  globus_size_t in_len,
189  globus_byte_t * outbuf,
190  globus_size_t * out_len);
191 
192 
193 #include "globus_i_gfs_log.h"
194 #include "globus_i_gfs_control.h"
195 #include "globus_i_gfs_ipc.h"
196 #include "globus_i_gfs_data.h"
197 #include "globus_i_gfs_config.h"
198 #include "globus_i_gfs_gcs_db.h"
199 
200 #endif