Defines | Enumerations | Functions | Variables
ftp.c File Reference
#include "curl_setup.h"
#include <curl/curl.h>
#include "urldata.h"
#include "sendf.h"
#include "if2ip.h"
#include "hostip.h"
#include "progress.h"
#include "transfer.h"
#include "escape.h"
#include "http.h"
#include "socks.h"
#include "ftp.h"
#include "fileinfo.h"
#include "ftplistparser.h"
#include "curl_sec.h"
#include "strtoofft.h"
#include "strcase.h"
#include "vtls/vtls.h"
#include "connect.h"
#include "strerror.h"
#include "inet_ntop.h"
#include "inet_pton.h"
#include "select.h"
#include "parsedate.h"
#include "sockaddr.h"
#include "multiif.h"
#include "url.h"
#include "speedcheck.h"
#include "warnless.h"
#include "http_proxy.h"
#include "non-ascii.h"
#include "curl_printf.h"
#include "curl_memory.h"
#include "memdebug.h"
Include dependency graph for ftp.c:

Go to the source code of this file.

Defines

#define CURL_FTP_HTTPSTYLE_HEAD   1
#define INET_ADDRSTRLEN   16
#define LASTLINE(line)   (STATUSCODE(line) && (' ' == line[3]))
#define NI_MAXHOST   1025
#define PPSENDF(x, y, z)
#define SBUF_SIZE   1024
#define state(x, y)   _state(x,y)
#define STATUSCODE(line)

Enumerations

enum  ftpport { EPRT, PORT, DONE }

Functions

static void _state (struct connectdata *conn, ftpstate newstate)
static CURLcode AcceptServerConnect (struct connectdata *conn)
static CURLcode AllowServerConnect (struct connectdata *conn, bool *connected)
static void close_secondarysocket (struct connectdata *conn)
static char * control_address (struct connectdata *conn)
CURLcode Curl_ftpsend (struct connectdata *conn, const char *cmd)
CURLcode Curl_GetFTPResponse (ssize_t *nreadp, struct connectdata *conn, int *ftpcode)
static void freedirs (struct ftp_conn *ftpc)
static CURLcode ftp_block_statemach (struct connectdata *conn)
static CURLcode ftp_connect (struct connectdata *conn, bool *done)
static CURLcode ftp_disconnect (struct connectdata *conn, bool dead_connection)
static CURLcode ftp_do (struct connectdata *conn, bool *done)
static CURLcode ftp_do_more (struct connectdata *conn, int *completed)
static CURLcode ftp_doing (struct connectdata *conn, bool *dophase_done)
static int ftp_domore_getsock (struct connectdata *conn, curl_socket_t *socks, int numsocks)
static CURLcode ftp_done (struct connectdata *conn, CURLcode, bool premature)
static CURLcode ftp_dophase_done (struct connectdata *conn, bool connected)
static bool ftp_endofresp (struct connectdata *conn, char *line, size_t len, int *code)
static CURLcode ftp_epsv_disable (struct connectdata *conn)
static int ftp_getsock (struct connectdata *conn, curl_socket_t *socks, int numsocks)
static CURLcode ftp_multi_statemach (struct connectdata *conn, bool *done)
static CURLcode ftp_nb_type (struct connectdata *conn, bool ascii, ftpstate newstate)
static int ftp_need_type (struct connectdata *conn, bool ascii)
static CURLcode ftp_parse_url_path (struct connectdata *conn)
static void ftp_pasv_verbose (struct connectdata *conn, Curl_addrinfo *ai, char *newhost, int port)
static CURLcode ftp_perform (struct connectdata *conn, bool *connected, bool *dophase_done)
static CURLcode ftp_quit (struct connectdata *conn)
static CURLcode ftp_range (struct connectdata *conn)
static CURLcode ftp_readresp (curl_socket_t sockfd, struct pingpong *pp, int *ftpcode, size_t *size)
static CURLcode ftp_regular_transfer (struct connectdata *conn, bool *done)
static CURLcode ftp_sendquote (struct connectdata *conn, struct curl_slist *quote)
static CURLcode ftp_setup_connection (struct connectdata *conn)
static CURLcode ftp_state_acct_resp (struct connectdata *conn, int ftpcode)
static CURLcode ftp_state_cwd (struct connectdata *conn)
static CURLcode ftp_state_get_resp (struct connectdata *conn, int ftpcode, ftpstate instate)
static CURLcode ftp_state_list (struct connectdata *conn)
static CURLcode ftp_state_loggedin (struct connectdata *conn)
static CURLcode ftp_state_mdtm (struct connectdata *conn)
static CURLcode ftp_state_mdtm_resp (struct connectdata *conn, int ftpcode)
static CURLcode ftp_state_pasv_resp (struct connectdata *conn, int ftpcode)
static CURLcode ftp_state_port_resp (struct connectdata *conn, int ftpcode)
static CURLcode ftp_state_prepare_transfer (struct connectdata *conn)
static CURLcode ftp_state_pwd (struct connectdata *conn)
static CURLcode ftp_state_quote (struct connectdata *conn, bool init, ftpstate instate)
static CURLcode ftp_state_rest (struct connectdata *conn)
static CURLcode ftp_state_rest_resp (struct connectdata *conn, int ftpcode, ftpstate instate)
static CURLcode ftp_state_retr (struct connectdata *conn, curl_off_t filesize)
static CURLcode ftp_state_retr_prequote (struct connectdata *conn)
static CURLcode ftp_state_size (struct connectdata *conn)
static CURLcode ftp_state_size_resp (struct connectdata *conn, int ftpcode, ftpstate instate)
static CURLcode ftp_state_stor_prequote (struct connectdata *conn)
static CURLcode ftp_state_stor_resp (struct connectdata *conn, int ftpcode, ftpstate instate)
static CURLcode ftp_state_type (struct connectdata *conn)
static CURLcode ftp_state_type_resp (struct connectdata *conn, int ftpcode, ftpstate instate)
static CURLcode ftp_state_ul_setup (struct connectdata *conn, bool sizechecked)
static CURLcode ftp_state_use_pasv (struct connectdata *conn)
static CURLcode ftp_state_use_port (struct connectdata *conn, ftpport fcmd)
static CURLcode ftp_state_user (struct connectdata *conn)
static CURLcode ftp_state_user_resp (struct connectdata *conn, int ftpcode, ftpstate instate)
static CURLcode ftp_statemach_act (struct connectdata *conn)
static time_t ftp_timeleft_accept (struct Curl_easy *data)
static CURLcode init_wc_data (struct connectdata *conn)
static CURLcode InitiateTransfer (struct connectdata *conn)
static bool isBadFtpString (const char *string)
static CURLcode ReceivedServerConnect (struct connectdata *conn, bool *received)
static void wc_data_dtor (void *ptr)
static CURLcode wc_statemach (struct connectdata *conn)

Variables

struct Curl_handler Curl_handler_ftp
static struct Curl_handler Curl_handler_ftp_proxy

Define Documentation

#define CURL_FTP_HTTPSTYLE_HEAD   1

Definition at line 288 of file ftp.c.

#define INET_ADDRSTRLEN   16

Definition at line 89 of file ftp.c.

#define LASTLINE (   line)    (STATUSCODE(line) && (' ' == line[3]))

Definition at line 599 of file ftp.c.

#define NI_MAXHOST   1025

Definition at line 86 of file ftp.c.

#define PPSENDF (   x,
  y,
  z 
)
Value:
result = Curl_pp_sendf(x,y,z); \
                        if(result)                     \
                          return result

Definition at line 157 of file ftp.c.

#define SBUF_SIZE   1024
#define state (   x,
  y 
)    _state(x,y)

Definition at line 100 of file ftp.c.

#define STATUSCODE (   line)
Value:
(ISDIGIT(line[0]) && ISDIGIT(line[1]) &&       \
                          ISDIGIT(line[2]))

Definition at line 595 of file ftp.c.


Enumeration Type Documentation

enum ftpport
Enumerator:
EPRT 
PORT 
DONE 

Definition at line 971 of file ftp.c.


Function Documentation

static void _state ( struct connectdata conn,
ftpstate  newstate 
) [static]

Definition at line 823 of file ftp.c.

static CURLcode AcceptServerConnect ( struct connectdata conn) [static]

Definition at line 328 of file ftp.c.

static CURLcode AllowServerConnect ( struct connectdata conn,
bool connected 
) [static]

Definition at line 547 of file ftp.c.

static void close_secondarysocket ( struct connectdata conn) [static]

Definition at line 268 of file ftp.c.

static char* control_address ( struct connectdata conn) [static]

Definition at line 1860 of file ftp.c.

CURLcode Curl_ftpsend ( struct connectdata conn,
const char *  cmd 
)

Definition at line 4033 of file ftp.c.

CURLcode Curl_GetFTPResponse ( ssize_t nreadp,
struct connectdata conn,
int *  ftpcode 
)

Definition at line 678 of file ftp.c.

static void freedirs ( struct ftp_conn ftpc) [static]

Definition at line 290 of file ftp.c.

static CURLcode ftp_block_statemach ( struct connectdata conn) [static]

Definition at line 3108 of file ftp.c.

static CURLcode ftp_connect ( struct connectdata conn,
bool done 
) [static]

Definition at line 3131 of file ftp.c.

static CURLcode ftp_disconnect ( struct connectdata conn,
bool  dead_connection 
) [static]

Definition at line 4128 of file ftp.c.

static CURLcode ftp_do ( struct connectdata conn,
bool done 
) [static]

Definition at line 4003 of file ftp.c.

static CURLcode ftp_do_more ( struct connectdata conn,
int *  completed 
) [static]

Definition at line 3575 of file ftp.c.

static CURLcode ftp_doing ( struct connectdata conn,
bool dophase_done 
) [static]

Definition at line 4397 of file ftp.c.

static int ftp_domore_getsock ( struct connectdata conn,
curl_socket_t socks,
int  numsocks 
) [static]

Definition at line 880 of file ftp.c.

static CURLcode ftp_done ( struct connectdata conn,
CURLcode  status,
bool  premature 
) [static]

Definition at line 3175 of file ftp.c.

static CURLcode ftp_dophase_done ( struct connectdata conn,
bool  connected 
) [static]

Definition at line 4368 of file ftp.c.

static bool ftp_endofresp ( struct connectdata conn,
char *  line,
size_t  len,
int *  code 
) [static]

Definition at line 601 of file ftp.c.

static CURLcode ftp_epsv_disable ( struct connectdata conn) [static]

Definition at line 1837 of file ftp.c.

static int ftp_getsock ( struct connectdata conn,
curl_socket_t socks,
int  numsocks 
) [static]

Definition at line 872 of file ftp.c.

static CURLcode ftp_multi_statemach ( struct connectdata conn,
bool done 
) [static]

Definition at line 3094 of file ftp.c.

static CURLcode ftp_nb_type ( struct connectdata conn,
bool  ascii,
ftpstate  newstate 
) [static]

Definition at line 3467 of file ftp.c.

static int ftp_need_type ( struct connectdata conn,
bool  ascii 
) [static]

Definition at line 3453 of file ftp.c.

static CURLcode ftp_parse_url_path ( struct connectdata conn) [static]

Definition at line 4178 of file ftp.c.

static void ftp_pasv_verbose ( struct connectdata conn,
Curl_addrinfo ai,
char *  newhost,
int  port 
) [static]

Definition at line 3498 of file ftp.c.

static CURLcode ftp_perform ( struct connectdata conn,
bool connected,
bool dophase_done 
) [static]

Definition at line 3739 of file ftp.c.

static CURLcode ftp_quit ( struct connectdata conn) [static]

Definition at line 4098 of file ftp.c.

static CURLcode ftp_range ( struct connectdata conn) [static]

Definition at line 3514 of file ftp.c.

static CURLcode ftp_readresp ( curl_socket_t  sockfd,
struct pingpong pp,
int *  ftpcode,
size_t *  size 
) [static]

Definition at line 614 of file ftp.c.

static CURLcode ftp_regular_transfer ( struct connectdata conn,
bool done 
) [static]

Definition at line 4425 of file ftp.c.

static CURLcode ftp_sendquote ( struct connectdata conn,
struct curl_slist quote 
) [static]

Definition at line 3402 of file ftp.c.

static CURLcode ftp_setup_connection ( struct connectdata conn) [static]

Definition at line 4462 of file ftp.c.

static CURLcode ftp_state_acct_resp ( struct connectdata conn,
int  ftpcode 
) [static]

Definition at line 2630 of file ftp.c.

static CURLcode ftp_state_cwd ( struct connectdata conn) [static]

Definition at line 929 of file ftp.c.

static CURLcode ftp_state_get_resp ( struct connectdata conn,
int  ftpcode,
ftpstate  instate 
) [static]

Definition at line 2417 of file ftp.c.

static CURLcode ftp_state_list ( struct connectdata conn) [static]

Definition at line 1492 of file ftp.c.

static CURLcode ftp_state_loggedin ( struct connectdata conn) [static]

Definition at line 2545 of file ftp.c.

static CURLcode ftp_state_mdtm ( struct connectdata conn) [static]

Definition at line 1613 of file ftp.c.

static CURLcode ftp_state_mdtm_resp ( struct connectdata conn,
int  ftpcode 
) [static]

Definition at line 2090 of file ftp.c.

static CURLcode ftp_state_pasv_resp ( struct connectdata conn,
int  ftpcode 
) [static]

Definition at line 1872 of file ftp.c.

static CURLcode ftp_state_port_resp ( struct connectdata conn,
int  ftpcode 
) [static]

Definition at line 2054 of file ftp.c.

static CURLcode ftp_state_prepare_transfer ( struct connectdata conn) [static]

Definition at line 1408 of file ftp.c.

static CURLcode ftp_state_pwd ( struct connectdata conn) [static]

Definition at line 860 of file ftp.c.

static CURLcode ftp_state_quote ( struct connectdata conn,
bool  init,
ftpstate  instate 
) [static]

Definition at line 1732 of file ftp.c.

static CURLcode ftp_state_rest ( struct connectdata conn) [static]

Definition at line 1451 of file ftp.c.

static CURLcode ftp_state_rest_resp ( struct connectdata conn,
int  ftpcode,
ftpstate  instate 
) [static]

Definition at line 2343 of file ftp.c.

static CURLcode ftp_state_retr ( struct connectdata conn,
curl_off_t  filesize 
) [static]

Definition at line 2224 of file ftp.c.

static CURLcode ftp_state_retr_prequote ( struct connectdata conn) [static]

Definition at line 1558 of file ftp.c.

static CURLcode ftp_state_size ( struct connectdata conn) [static]

Definition at line 1472 of file ftp.c.

static CURLcode ftp_state_size_resp ( struct connectdata conn,
int  ftpcode,
ftpstate  instate 
) [static]

Definition at line 2306 of file ftp.c.

static CURLcode ftp_state_stor_prequote ( struct connectdata conn) [static]

Definition at line 1569 of file ftp.c.

static CURLcode ftp_state_stor_resp ( struct connectdata conn,
int  ftpcode,
ftpstate  instate 
) [static]

Definition at line 2379 of file ftp.c.

static CURLcode ftp_state_type ( struct connectdata conn) [static]

Definition at line 1580 of file ftp.c.

static CURLcode ftp_state_type_resp ( struct connectdata conn,
int  ftpcode,
ftpstate  instate 
) [static]

Definition at line 2194 of file ftp.c.

static CURLcode ftp_state_ul_setup ( struct connectdata conn,
bool  sizechecked 
) [static]

Definition at line 1636 of file ftp.c.

static CURLcode ftp_state_use_pasv ( struct connectdata conn) [static]

Definition at line 1362 of file ftp.c.

static CURLcode ftp_state_use_port ( struct connectdata conn,
ftpport  fcmd 
) [static]

Definition at line 977 of file ftp.c.

static CURLcode ftp_state_user ( struct connectdata conn) [static]

Definition at line 847 of file ftp.c.

static CURLcode ftp_state_user_resp ( struct connectdata conn,
int  ftpcode,
ftpstate  instate 
) [static]

Definition at line 2574 of file ftp.c.

static CURLcode ftp_statemach_act ( struct connectdata conn) [static]

Definition at line 2646 of file ftp.c.

static time_t ftp_timeleft_accept ( struct Curl_easy data) [static]

Definition at line 387 of file ftp.c.

static CURLcode init_wc_data ( struct connectdata conn) [static]

Definition at line 3782 of file ftp.c.

static CURLcode InitiateTransfer ( struct connectdata conn) [static]

Definition at line 496 of file ftp.c.

static bool isBadFtpString ( const char *  string) [static]

Definition at line 314 of file ftp.c.

static CURLcode ReceivedServerConnect ( struct connectdata conn,
bool received 
) [static]

Definition at line 425 of file ftp.c.

static void wc_data_dtor ( void *  ptr) [static]

Definition at line 3774 of file ftp.c.

static CURLcode wc_statemach ( struct connectdata conn) [static]

Definition at line 3877 of file ftp.c.


Variable Documentation



rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Thu Jun 6 2019 20:43:08