00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef GLOBUS_INCLUDE_FTP_I_CONTROL_H
00018 #define GLOBUS_INCLUDE_FTP_I_CONTROL_H 1
00019
00020 #define GLOBUS_I_FTP_CONTROL_BUF_SIZE 200
00021 #define GLOBUS_I_FTP_CONTROL_BUF_INCR 100
00022
00023 #define GLOBUS_I_TELNET_IP "\xFF\xF4"
00024 #define GLOBUS_I_TELNET_SYNCH "\xFF\xF2"
00025 #define GLOBUS_I_TELNET_IAC '\xFF'
00026
00027 #include "globus_config.h"
00028
00029 extern
00030 FILE * globus_i_ftp_control_devnull;
00031
00032 typedef enum
00033 {
00034 GLOBUS_I_FTP_AUTH,
00035 GLOBUS_I_FTP_ACCT,
00036 GLOBUS_I_FTP_ADAT,
00037 GLOBUS_I_FTP_QUIT,
00038 GLOBUS_I_FTP_USER,
00039 GLOBUS_I_FTP_PASS,
00040 GLOBUS_I_FTP_NOOP
00041 }
00042 globus_i_ftp_cmd_t;
00043
00044 typedef struct globus_i_ftp_passthru_cb_arg_s
00045 {
00046 globus_ftp_control_response_callback_t user_cb;
00047 void * user_cb_arg;
00048 globus_i_ftp_cmd_t cmd;
00049 globus_ftp_control_handle_t * handle;
00050 } globus_i_ftp_passthru_cb_arg_t;
00051
00052 typedef struct globus_i_ftp_server_passthru_cb_arg_s
00053 {
00054 globus_ftp_control_server_callback_t callback;
00055 void * callback_arg;
00056 globus_ftp_control_server_t * server_handle;
00057 } globus_i_ftp_server_passthru_cb_arg_t;
00058
00059
00060 void
00061 globus_i_ftp_control_call_close_cb(
00062 globus_ftp_control_handle_t * handle);
00063
00064 void
00065 globus_i_ftp_control_write_next(
00066 globus_ftp_control_handle_t * handle);
00067
00068 globus_result_t
00069 globus_i_ftp_control_radix_encode(
00070 unsigned char * inbuf,
00071 unsigned char * outbuf,
00072 int * length);
00073
00074 globus_result_t
00075 globus_i_ftp_control_radix_decode(
00076 unsigned char * inbuf,
00077 unsigned char * outbuf,
00078 int * length);
00079
00080 globus_result_t
00081 globus_i_ftp_control_decode_command(
00082 char * cmd,
00083 char ** decoded_cmd,
00084 globus_ftp_control_auth_info_t * auth_info);
00085
00086 globus_result_t
00087 globus_i_ftp_control_encode_command(
00088 globus_ftp_cc_handle_t * cc_handle,
00089 char * cmd,
00090 char ** encoded_cmd);
00091
00092
00093 globus_result_t
00094 globus_i_ftp_control_encode_reply(
00095 char * reply,
00096 char ** encoded_reply,
00097 globus_ftp_control_auth_info_t * auth_info);
00098
00099 globus_result_t
00100 globus_i_ftp_control_data_set_netlogger(
00101 globus_ftp_control_handle_t * handle,
00102 globus_netlogger_handle_t * nl_handle,
00103 globus_bool_t nl_ftp_control,
00104 globus_bool_t nl_globus_io);
00105
00106 globus_result_t
00107 globus_i_ftp_control_client_set_netlogger(
00108 globus_ftp_control_handle_t * handle,
00109 globus_netlogger_handle_t * nl_handle);
00110
00111 globus_result_t
00112 globus_i_ftp_control_data_activate(void);
00113
00114 globus_result_t
00115 globus_i_ftp_control_data_deactivate(void);
00116
00117
00118 globus_result_t
00119 globus_i_ftp_control_client_activate(void);
00120
00121 globus_result_t
00122 globus_i_ftp_control_client_deactivate(void);
00123
00124 globus_result_t
00125 globus_i_ftp_control_server_activate(void);
00126
00127 globus_result_t
00128 globus_i_ftp_control_server_deactivate(void);
00129
00130 globus_result_t
00131 globus_i_ftp_control_data_cc_destroy(
00132 globus_ftp_control_handle_t * control_handle);
00133
00134 globus_result_t
00135 globus_i_ftp_control_data_cc_blocking_destroy(
00136 globus_ftp_control_handle_t * control_handle);
00137
00138 globus_result_t
00139 globus_i_ftp_control_data_abort(
00140 globus_ftp_control_handle_t * control_handle,
00141 globus_object_t * error);
00142
00143 globus_result_t
00144 globus_i_ftp_control_auth_info_init(
00145 globus_ftp_control_auth_info_t * dest,
00146 globus_ftp_control_auth_info_t * src);
00147
00148 globus_result_t
00149 globus_i_ftp_control_auth_info_destroy(
00150 globus_ftp_control_auth_info_t * auth_info);
00151
00152 globus_result_t
00153 globus_i_ftp_control_get_connection_info(
00154 globus_ftp_control_handle_t * handle,
00155 int * local_host,
00156 unsigned short * local_port,
00157 int * remote_host,
00158 unsigned short * remote_port);
00159
00160
00161
00162
00163 globus_result_t
00164 globus_i_ftp_parallelism_copy(
00165 globus_ftp_control_parallelism_t * dest_parallelism,
00166 globus_ftp_control_parallelism_t * src_parallelism);
00167
00168 int
00169 globus_i_ftp_parallelism_get_size(
00170 globus_ftp_control_parallelism_t * parallelism);
00171
00172 int
00173 globus_i_ftp_parallelism_get_min_size(
00174 globus_ftp_control_parallelism_t * parallelism);
00175
00176 int
00177 globus_i_ftp_parallelism_get_max_size(
00178 globus_ftp_control_parallelism_t * parallelism);
00179
00180 void
00181 globus_ftp_control_host_port_init(
00182 globus_ftp_control_host_port_t * host_port,
00183 char * host,
00184 unsigned short port);
00185
00186 void
00187 globus_ftp_control_host_port_destroy(
00188 globus_ftp_control_host_port_t * host_port);
00189
00190 void
00191 globus_ftp_control_host_port_get_host(
00192 globus_ftp_control_host_port_t * host_port,
00193 char * host);
00194
00195 unsigned short
00196 globus_ftp_control_host_port_get_port(
00197 globus_ftp_control_host_port_t * host_port);
00198
00199 void
00200 globus_ftp_control_host_port_copy(
00201 globus_ftp_control_host_port_t * dest,
00202 globus_ftp_control_host_port_t * src);
00203
00204 globus_result_t
00205 globus_i_ftp_control_client_get_connection_info(
00206 globus_ftp_control_handle_t * handle,
00207 int localhost[4],
00208 unsigned short * localport,
00209 int remotehost[4],
00210 unsigned short * remoteport);
00211
00212 extern const char * globus_i_ftp_server_welcome;
00213 extern const char * globus_i_ftp_server_user_reply;
00214 extern const char * globus_i_ftp_server_pass_reply;
00215
00216 extern int globus_i_ftp_control_debug_level;
00217
00218 #ifdef BUILD_DEBUG
00219 #define globus_i_ftp_control_debug(Level) \
00220 (globus_i_ftp_control_debug_level >= (Level))
00221
00222 #define globus_i_ftp_control_debug_printf(level, message) \
00223 do { \
00224 if (globus_i_ftp_control_debug(level)) \
00225 { \
00226 globus_libc_fprintf message; \
00227 } \
00228 } while (0)
00229 #else
00230 #define globus_i_ftp_control_debug_printf(level, message)
00231 #endif
00232
00233
00234 #endif
00235
00236