Main Page Data Structures File List Data Fields Globals Related Pages

# clib/ftp.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures
struct | ftp_desc
## Defines
#define | FTP_CTRLPORT 21
#define | FTP_CONN_MAX 2
#define | FTP_MSG_DATA_CONNECTION_ALREADY_OPEN 125
#define | FTP_MSG_FILE_STATUS_OK 150
#define | FTP_MSG_TYPE_COMMAND_OK 200
#define | FTP_MSG_SERVER_READY 220
#define | FTP_MSG_GOODBYE 221
#define | FTP_MSG_TRANSFER_COMPLETED 226
#define | FTP_MSG_ENTERING_PASSIV_MODE 227
#define | FTP_MSG_USER_LOGGED_IN 230
#define | FTP_MSG_REQ_FILE_ACTION_OK 250
#define | FTP_MSG_CURRENT_DIRECTORY 257
#define | FTP_MSG_DIRECTORY_CREATED 257
#define | FTP_MSG_USERNAME_OK 331
#define | FTP_MSG_SERVICE_NOT_AVAILABLE 421
#define | FTP_MSG_NOT_LOGGED_IN 530
#define | FTP_ASCII 0
#define | FTP_BINARY 1
## Functions
ftp_desc * | ftp_open (char *DestIPStr, unsigned int ClientCtrlPort, unsigned int ClientDataPort, unsigned int HostCtrlPort, int *stat, int *error)
int | ftp_close (ftp_desc *fd, int *error)
int | ftp_login (ftp_desc *fd, char *user, char *pass, int *stat, int *error)
int | ftp_logout (ftp_desc *fd, int *stat, int *error)
int | ftp_pwd (ftp_desc *fd, char *dirstr, int strlen, int *stat, int *error)
int | ftp_cwd (ftp_desc *fd, char *cwdstr, int *stat, int *error)
int | ftp_mkd (ftp_desc *fd, char *mkdstr, int *stat, int *error)
int | ftp_rmd (ftp_desc *fd, char *rmdstr, int *stat, int *error)
int | ftp_dele (ftp_desc *fd, char *filename, int *stat, int *error)
int | ftp_sendfile (ftp_desc *fd, char *LocalName, char *RemoteName, int mode, int *stat, int *error)
int | ftp_recvfile (ftp_desc *fd, char *RemoteName, char *LocalName, int mode, int *stat, int *error)

## Define Documentation

#define FTP_ASCII 0

| Definition at line 64 of file ftp.h. Referenced by ftp_recvfile(), and ftp_sendfile().

#define FTP_BINARY 1

| Definition at line 65 of file ftp.h.

#define FTP_CONN_MAX 2

| Definition at line 46 of file ftp.h.

#define FTP_CTRLPORT 21

| Definition at line 45 of file ftp.h.

#define FTP_MSG_CURRENT_DIRECTORY 257

| Definition at line 58 of file ftp.h. Referenced by ftp_pwd().

#define FTP_MSG_DATA_CONNECTION_ALREADY_OPEN 125

| Definition at line 49 of file ftp.h. Referenced by ftp_recvfile(), and ftp_sendfile().

#define FTP_MSG_DIRECTORY_CREATED 257

| Definition at line 59 of file ftp.h. Referenced by ftp_mkd().

#define FTP_MSG_ENTERING_PASSIV_MODE 227

| Definition at line 55 of file ftp.h. Referenced by ftp_recvfile(), and ftp_sendfile().

#define FTP_MSG_FILE_STATUS_OK 150

| Definition at line 50 of file ftp.h. Referenced by ftp_recvfile(), and ftp_sendfile().

#define FTP_MSG_GOODBYE 221

| Definition at line 53 of file ftp.h.

#define FTP_MSG_NOT_LOGGED_IN 530

| Definition at line 62 of file ftp.h.

#define FTP_MSG_REQ_FILE_ACTION_OK 250

| Definition at line 57 of file ftp.h. Referenced by ftp_cwd(), ftp_dele(), and ftp_rmd().

#define FTP_MSG_SERVER_READY 220

| Definition at line 52 of file ftp.h. Referenced by ftp_open().

#define FTP_MSG_SERVICE_NOT_AVAILABLE 421

| Definition at line 61 of file ftp.h.

#define FTP_MSG_TRANSFER_COMPLETED 226

| Definition at line 54 of file ftp.h. Referenced by ftp_recvfile(), and ftp_sendfile().

#define FTP_MSG_TYPE_COMMAND_OK 200

| Definition at line 51 of file ftp.h. Referenced by ftp_recvfile(), and ftp_sendfile().

#define FTP_MSG_USER_LOGGED_IN 230

| Definition at line 56 of file ftp.h. Referenced by ftp_login().

#define FTP_MSG_USERNAME_OK 331

| Definition at line 60 of file ftp.h. Referenced by ftp_login(), and ftp_logout().

## Function Documentation

int ftp_close | ( | ftp_desc * | fd,
|  | int * | error
| ) |

| Definition at line 331 of file ftp.c. References closesocket(), and ftp_desc::sd_ctrl.

int ftp_cwd | ( | ftp_desc * | fd,
|  | char * | cwdstr,
|  | int * | stat,
|  | int * | error
| ) |

| Definition at line 492 of file ftp.c. References ftp_buf, FTP_BUF_LEN, ftp_command(), FTP_MSG_REQ_FILE_ACTION_OK, and ftp_desc::sd_ctrl.

int ftp_dele | ( | ftp_desc * | fd,
|  | char * | filename,
|  | int * | stat,
|  | int * | error
| ) |

| Definition at line 606 of file ftp.c. References ftp_buf, FTP_BUF_LEN, ftp_command(), FTP_MSG_REQ_FILE_ACTION_OK, and ftp_desc::sd_ctrl.

int ftp_login | ( | ftp_desc * | fd,
|  | char * | user,
|  | char * | pass,
|  | int * | stat,
|  | int * | error
| ) |

| Definition at line 361 of file ftp.c. References ftp_buf, FTP_BUF_LEN, ftp_command(), FTP_MSG_USER_LOGGED_IN, FTP_MSG_USERNAME_OK, and ftp_desc::sd_ctrl.

int ftp_logout | ( | ftp_desc * | fd,
|  | int * | stat,
|  | int * | error
| ) |

| Definition at line 414 of file ftp.c. References ftp_buf, FTP_BUF_LEN, ftp_command(), FTP_MSG_USERNAME_OK, and ftp_desc::sd_ctrl.

int ftp_mkd | ( | ftp_desc * | fd,
|  | char * | mkdstr,
|  | int * | stat,
|  | int * | error
| ) |

| Definition at line 531 of file ftp.c. References ftp_buf, FTP_BUF_LEN, ftp_command(), FTP_MSG_DIRECTORY_CREATED, and ftp_desc::sd_ctrl.

ftp_desc* ftp_open | ( | char * | DestIPStr,
|  | unsigned int | ClientCtrlPort,
|  | unsigned int | ClientDataPort,
|  | unsigned int | HostCtrlPort,
|  | int * | stat,
|  | int * | error
| ) |

| Definition at line 254 of file ftp.c. References api_sleep(), closesocket(), ftp_buf, FTP_BUF_LEN, ftp_command(), ftp_connect(), FTP_MSG_SERVER_READY, ftp_desc::host_ctrl_port, ftp_desc::host_data_port, ftp_desc::HostIPAddr, ftp_desc::HostIPStr, inet_addr(), ftp_desc::local_ctrl_port, ftp_desc::local_data_port, ftp_desc::sd_ctrl, and ftp_desc::sd_data.

int ftp_pwd | ( | ftp_desc * | fd,
|  | char * | dirstr,
|  | int | strlen,
|  | int * | stat,
|  | int * | error
| ) |

| Definition at line 450 of file ftp.c. References ftp_buf, FTP_BUF_LEN, ftp_command(), FTP_MSG_CURRENT_DIRECTORY, and ftp_desc::sd_ctrl.

int ftp_recvfile | ( | ftp_desc * | fd,
|  | char * | RemoteName,
|  | char * | LocalName,
|  | int | mode,
|  | int * | stat,
|  | int * | error
| ) |

| Definition at line 829 of file ftp.c. References api_sleep(), closesocket(), FTP_ASCII, ftp_buf, FTP_BUF_LEN, ftp_command(), ftp_connect(), FTP_MSG_DATA_CONNECTION_ALREADY_OPEN, FTP_MSG_ENTERING_PASSIV_MODE, FTP_MSG_FILE_STATUS_OK, FTP_MSG_TRANSFER_COMPLETED, FTP_MSG_TYPE_COMMAND_OK, ftp_recv(), ftp_desc::host_data_port, ftp_desc::HostIPStr, ftp_desc::local_data_port, ftp_desc::sd_ctrl, and ftp_desc::sd_data.

int ftp_rmd | ( | ftp_desc * | fd,
|  | char * | rmdstr,
|  | int * | stat,
|  | int * | error
| ) |

| Definition at line 570 of file ftp.c. References ftp_buf, FTP_BUF_LEN, ftp_command(), FTP_MSG_REQ_FILE_ACTION_OK, and ftp_desc::sd_ctrl.

int ftp_sendfile | ( | ftp_desc * | fd,
|  | char * | LocalName,
|  | char * | RemoteName,
|  | int | mode,
|  | int * | stat,
|  | int * | error
| ) |

| Definition at line 659 of file ftp.c. References closesocket(), FTP_ASCII, ftp_buf, FTP_BUF_LEN, ftp_command(), ftp_connect(), FTP_MSG_DATA_CONNECTION_ALREADY_OPEN, FTP_MSG_ENTERING_PASSIV_MODE, FTP_MSG_FILE_STATUS_OK, FTP_MSG_TRANSFER_COMPLETED, FTP_MSG_TYPE_COMMAND_OK, ftp_send(), ftp_desc::host_data_port, ftp_desc::HostIPStr, ftp_desc::local_data_port, ftp_desc::sd_ctrl, and ftp_desc::sd_data.