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