Data Structures |
struct | ftp_state |
Files |
file | ftp.c |
file | ftp.h |
Defines |
#define | PRINT(x) |
#define | PRINTLN(x) |
#define | PRINTNUMLN(x) |
#define | PRINTNUM(x) |
#define | CMDSND_NONE 0 |
#define | CMDSND_CONNECT (CMDSND_NONE + 1) |
#define | CMDSND_LOGIN (CMDSND_CONNECT + 1) |
#define | CMDSND_SYST (CMDSND_LOGIN + 1) |
#define | CMDSND_PORT (CMDSND_SYST + 1) |
#define | CMDSND_STOR (CMDSND_PORT + 1) |
#define | CMDSND_QUIT (CMDSND_STOR + 1) |
#define | CMDSND_PASS (CMDSND_QUIT + 1) |
#define | ANSRCV_NONE 0 |
#define | ANSRCV_WELCOME (ANSRCV_NONE + 1) |
#define | ANSRCV_WELCOMERR (ANSRCV_WELCOME + 1) |
#define | ANSRCV_LOGGEDIN (ANSRCV_WELCOMERR + 1) |
#define | ANSRCV_LOGGEDERR (ANSRCV_LOGGEDIN + 1) |
#define | ANSRCV_SYSTOK (ANSRCV_LOGGEDERR + 1) |
#define | ANSRCV_SYSTERR (ANSRCV_SYSTOK + 1) |
#define | ANSRCV_PORTOK (ANSRCV_SYSTERR + 1) |
#define | ANSRCV_PORTERR (ANSRCV_PORTOK + 1) |
#define | ANSRCV_STOROK (ANSRCV_PORTERR + 1) |
#define | ANSRCV_STORERR (ANSRCV_STOROK + 1) |
#define | ANSRCV_QUITOK (ANSRCV_STORERR + 1) |
#define | ANSRCV_QUITERR (ANSRCV_QUITOK + 1) |
#define | ANSRCV_PASSERR (ANSRCV_QUITERR + 1) |
#define | ANSRCV_PASSREQ (ANSRCV_PASSERR + 1) |
#define | arnTRUE ((arn_uCHAR) 1) |
#define | arnFALSE ((arn_uCHAR) 0) |
#define | MAX_FILENAME_LEN 128 |
#define | FTP_FLAG_CMDREQUEST 0x01 |
#define | FTP_FLAG_DATAPENDING 0x02 |
#define | FTP_FLAG_LASTDATAACK 0x04 |
#define | FTP_FLAG_CTRL 0x80 |
#define | FTP_FLAG_DATA 0x40 |
#define | STS_NONE 0 |
#define | STS_ERROR (STS_NONE + 1) |
#define | STS_WAITFORCONN (STS_ERROR + 1) |
#define | STS_CONNECTED (STS_WAITFORCONN + 1) |
#define | STS_SENDINGFILE (STS_CONNECTED + 1) |
#define | STS_UPOLOADOK (STS_SENDINGFILE + 1) |
#define | STS_LOGGINGIN (STS_UPOLOADOK + 1) |
#define | STS_LOGGEDIN (STS_LOGGINGIN + 1) |
#define | STS_SYST_INPROG (STS_LOGGEDIN + 1) |
#define | STS_SYST_OK (STS_SYST_INPROG + 1) |
#define | STS_PORT_INPROG (STS_SYST_OK + 1) |
#define | STS_PORT_OK (STS_PORT_INPROG + 1) |
#define | STS_DATACONN_INPROG (STS_PORT_OK + 1) |
#define | STS_DATACONN_OK (STS_DATACONN_INPROG + 1) |
#define | STS_STOR_INPROG (STS_DATACONN_OK + 1) |
#define | STS_START_DATASTORE (STS_STOR_INPROG + 1) |
#define | STS_SENDDATA_INPROG (STS_START_DATASTORE + 1) |
#define | STS_SENDDATA_ENDING (STS_SENDDATA_INPROG + 1) |
#define | STS_SENDDATA_OK (STS_SENDDATA_ENDING + 1) |
#define | STS_DATACONN_CLOSED_OK (STS_SENDDATA_OK + 1) |
#define | STS_QUIT_INPROG (STS_DATACONN_CLOSED_OK + 1) |
#define | STS_QUIT_OK (STS_QUIT_INPROG + 1) |
#define | STS_IDLE (STS_QUIT_OK + 1) |
#define | ERRC_NONE 0 |
#define | ERRC_HOSTNAMENOTIP (ERRC_NONE + 1) |
#define | ERRC_CONN (ERRC_HOSTNAMENOTIP + 1) |
#define | ERRC_FNAMETOLOONG (ERRC_CONN + 1) |
#define | ERRC_SRV_WM (ERRC_FNAMETOLOONG + 1) |
#define | ERRC_LOGIN (ERRC_SRV_WM + 1) |
#define | ERRC_SYST (ERRC_LOGIN + 1) |
#define | ERRC_PORT (ERRC_SYST + 1) |
#define | ERRC_CONN_DATA (ERRC_PORT + 1) |
#define | ERRC_STOR (ERRC_CONN_DATA + 1) |
#define | ERRC_QUIT (ERRC_STOR + 1) |
#define | ERRC_PASS (ERRC_QUIT + 1) |
#define | UIP_APPSTATE_SIZE (sizeof(struct ftp_state)) |
Typedefs |
typedef unsigned char | arn_uCHAR |
typedef unsigned short | arn_uSHORT |
typedef unsigned long | arn_uLONG |
typedef arn_uLONG | arn_uINT |
typedef signed char | arn_sCHAR |
typedef signed short | arn_sSHORT |
typedef signed long | arn_sLONG |
typedef arn_sLONG | arn_sINT |
typedef char | arn_CHAR |
typedef short | arn_SHORT |
typedef long | arn_LONG |
typedef int | arn_INT |
typedef arn_uCHAR | arn_BOOL |
typedef enum ftp_cmd_status | ftp_cmd_status_t |
Enumerations |
enum | ftp_cmd_status {
ftpcs_NONE = 0,
ftpcs_INPROGRESS,
ftpcs_SUCCESS,
ftpcs_FAILED,
ftpcs_USERNAME_REQ,
ftpcs_PASSWORD_REQ
} |
Functions |
ftp_cmd_status_t | ftp_connect (arn_CHAR *host, arn_uSHORT rport, struct uip_conn **sconn) |
ftp_cmd_status_t | ftp_login (const struct uip_conn *sconn, arn_CHAR *username) |
ftp_cmd_status_t | ftp_password (const struct uip_conn *sconn, arn_CHAR *password) |
ftp_cmd_status_t | ftp_syst (const struct uip_conn *sconn, arn_CHAR *res) |
ftp_cmd_status_t | ftp_port (const struct uip_conn *sconn, arn_uSHORT ldataport) |
ftp_cmd_status_t | ftp_pasv (const struct uip_conn *sconn) |
ftp_cmd_status_t | ftp_send (const struct uip_conn *sconn, arn_CHAR *filename, arn_uCHAR *sadd, arn_uLONG size) |
ftp_cmd_status_t | ftp_quit (const struct uip_conn *sconn) |
arn_uCHAR | ftp_getStatus (const struct uip_conn *sconn) |
arn_uCHAR | ftp_getErrorCode (const struct uip_conn *sconn) |
void | ftp_init (void) |
void | ftp_appcall (void) |
Variables |
arn_uCHAR | TSTclose |
arn_uCHAR | TSTconn |
arn_CHAR | TSTgetBff [8][16] |
arn_uCHAR | TSTack |
arn_CHAR | TSTpss [32] |
arn_uCHAR * | ftp_state::dataptr |
arn_uLONG | ftp_state::count |
arn_uCHAR * | ftp_state::fSAddr |
arn_uLONG | ftp_state::fSize |
arn_uSHORT | ftp_state::errorCode |
arn_uSHORT | ftp_state::localdataport |
arn_uSHORT | ftp_state::remotedataport |
arn_uSHORT | ftp_state::remotectrlport |
arn_uCHAR | ftp_state::Status |
arn_uCHAR | ftp_state::CmdSnt |
arn_uCHAR | ftp_state::AnsRcv |
arn_uCHAR | ftp_state::flags |
arn_CHAR | ftp_state::fname [MAX_FILENAME_LEN] |
arn_uCHAR | ftp_state::data [MAX_FILENAME_LEN+8] |
The uIP ftp client is a very simplistic implementation of an FTP client. It can upload a file to a server ad it cannot download anything.