Grid Community Toolkit  6.2.1653033972 (tag: v6.2.20220524)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
globus_i_ftp_control.h
1 /*
2  * Copyright 1999-2006 University of Chicago
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef GLOBUS_INCLUDE_FTP_I_CONTROL_H
18 #define GLOBUS_INCLUDE_FTP_I_CONTROL_H 1
19 
20 #define GLOBUS_I_FTP_CONTROL_BUF_SIZE 200
21 #define GLOBUS_I_FTP_CONTROL_BUF_INCR 100
22 
23 #define GLOBUS_I_TELNET_IP "\xFF\xF4"
24 #define GLOBUS_I_TELNET_SYNCH "\xFF\xF2"
25 #define GLOBUS_I_TELNET_IAC '\xFF'
26 
27 #include "globus_config.h"
28 
29 extern
30 FILE * globus_i_ftp_control_devnull;
31 
32 typedef enum
33 {
34  GLOBUS_I_FTP_AUTH,
35  GLOBUS_I_FTP_ACCT,
36  GLOBUS_I_FTP_ADAT,
37  GLOBUS_I_FTP_QUIT,
38  GLOBUS_I_FTP_USER,
39  GLOBUS_I_FTP_PASS,
40  GLOBUS_I_FTP_NOOP
41 }
42 globus_i_ftp_cmd_t;
43 
44 typedef struct globus_i_ftp_passthru_cb_arg_s
45 {
47  void * user_cb_arg;
48  globus_i_ftp_cmd_t cmd;
49  globus_ftp_control_handle_t * handle;
50 } globus_i_ftp_passthru_cb_arg_t;
51 
52 typedef struct globus_i_ftp_server_passthru_cb_arg_s
53 {
55  void * callback_arg;
56  globus_ftp_control_server_t * server_handle;
57 } globus_i_ftp_server_passthru_cb_arg_t;
58 
59 
60 void
61 globus_i_ftp_control_call_close_cb(
62  globus_ftp_control_handle_t * handle);
63 
64 void
65 globus_i_ftp_control_write_next(
66  globus_ftp_control_handle_t * handle);
67 
69 globus_i_ftp_control_radix_encode(
70  unsigned char * inbuf,
71  unsigned char * outbuf,
72  int * length);
73 
75 globus_i_ftp_control_radix_decode(
76  unsigned char * inbuf,
77  unsigned char * outbuf,
78  int * length);
79 
81 globus_i_ftp_control_decode_command(
82  char * cmd,
83  char ** decoded_cmd,
84  globus_ftp_control_auth_info_t * auth_info);
85 
87 globus_i_ftp_control_encode_command(
88  globus_ftp_cc_handle_t * cc_handle,
89  char * cmd,
90  char ** encoded_cmd);
91 
92 
94 globus_i_ftp_control_encode_reply(
95  char * reply,
96  char ** encoded_reply,
97  globus_ftp_control_auth_info_t * auth_info);
98 
100 globus_i_ftp_control_data_set_netlogger(
101  globus_ftp_control_handle_t * handle,
102  globus_netlogger_handle_t * nl_handle,
103  globus_bool_t nl_ftp_control,
104  globus_bool_t nl_globus_io);
105 
107 globus_i_ftp_control_client_set_netlogger(
108  globus_ftp_control_handle_t * handle,
109  globus_netlogger_handle_t * nl_handle);
110 
112 globus_i_ftp_control_data_activate(void);
113 
115 globus_i_ftp_control_data_deactivate(void);
116 
117 
119 globus_i_ftp_control_client_activate(void);
120 
122 globus_i_ftp_control_client_deactivate(void);
123 
125 globus_i_ftp_control_server_activate(void);
126 
128 globus_i_ftp_control_server_deactivate(void);
129 
131 globus_i_ftp_control_data_cc_destroy(
132  globus_ftp_control_handle_t * control_handle);
133 
135 globus_i_ftp_control_data_cc_blocking_destroy(
136  globus_ftp_control_handle_t * control_handle);
137 
139 globus_i_ftp_control_data_abort(
140  globus_ftp_control_handle_t * control_handle,
141  globus_object_t * error);
142 
144 globus_i_ftp_control_auth_info_init(
147 
149 globus_i_ftp_control_auth_info_destroy(
150  globus_ftp_control_auth_info_t * auth_info);
151 
153 globus_i_ftp_control_get_connection_info(
154  globus_ftp_control_handle_t * handle,
155  int * local_host,
156  unsigned short * local_port,
157  int * remote_host,
158  unsigned short * remote_port);
159 
160 /*
161  * internal function definitions
162  */
164 globus_i_ftp_parallelism_copy(
165  globus_ftp_control_parallelism_t * dest_parallelism,
166  globus_ftp_control_parallelism_t * src_parallelism);
167 
168 int
169 globus_i_ftp_parallelism_get_size(
170  globus_ftp_control_parallelism_t * parallelism);
171 
172 int
173 globus_i_ftp_parallelism_get_min_size(
174  globus_ftp_control_parallelism_t * parallelism);
175 
176 int
177 globus_i_ftp_parallelism_get_max_size(
178  globus_ftp_control_parallelism_t * parallelism);
179 
180 void
181 globus_ftp_control_host_port_init(
182  globus_ftp_control_host_port_t * host_port,
183  char * host,
184  unsigned short port);
185 
186 void
187 globus_ftp_control_host_port_destroy(
188  globus_ftp_control_host_port_t * host_port);
189 
190 void
191 globus_ftp_control_host_port_get_host(
192  globus_ftp_control_host_port_t * host_port,
193  char * host);
194 
195 unsigned short
196 globus_ftp_control_host_port_get_port(
197  globus_ftp_control_host_port_t * host_port);
198 
199 void
200 globus_ftp_control_host_port_copy(
201  globus_ftp_control_host_port_t * dest,
202  globus_ftp_control_host_port_t * src);
203 
205 globus_i_ftp_control_client_get_connection_info(
206  globus_ftp_control_handle_t * handle,
207  int localhost[4],
208  unsigned short * localport,
209  int remotehost[4],
210  unsigned short * remoteport);
211 
212 extern const char * globus_i_ftp_server_welcome;
213 extern const char * globus_i_ftp_server_user_reply;
214 extern const char * globus_i_ftp_server_pass_reply;
215 
216 extern int globus_i_ftp_control_debug_level;
217 
218 #ifdef BUILD_DEBUG
219 #define globus_i_ftp_control_debug(Level) \
220  (globus_i_ftp_control_debug_level >= (Level))
221 
222 #define globus_i_ftp_control_debug_printf(level, message) \
223 do { \
224  if (globus_i_ftp_control_debug(level)) \
225  { \
226  globus_libc_fprintf message; \
227  } \
228 } while (0)
229 #else
230 #define globus_i_ftp_control_debug_printf(level, message)
231 #endif
232 
233 
234 #endif
235 
236 
Globus Platform Configuration.
int globus_bool_t
Boolean type.
Definition: globus_types.h:93
void(* globus_ftp_control_server_callback_t)(void *callback_arg, struct globus_ftp_control_server_s *server_handle, globus_object_t *error)
Server callbackA function with this signature can be used as general callbacks for the GridFTP server...
Definition: globus_ftp_control.h:1028
void(* globus_ftp_control_response_callback_t)(void *callback_arg, struct globus_ftp_control_handle_s *handle, globus_object_t *error, globus_ftp_control_response_t *ftp_response)
Definition: globus_ftp_control.h:526
uint32_t globus_result_t
Definition: globus_types.h:99
Authentication Values.
Definition: globus_ftp_control.h:483
Control parallelism attribute structure.
Definition: globus_ftp_control.h:261