Data Structures | Files | Defines | Typedefs | Enumerations | Enumerator | Functions | Variables

client
[Exampleapps]

Collaboration diagram for client:

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_uCHARftp_state::dataptr
arn_uLONG ftp_state::count
arn_uCHARftp_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]

Detailed Description

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.


Define Documentation

#define ANSRCV_LOGGEDERR   (ANSRCV_LOGGEDIN + 1)

Definition at line 154 of file ftp.c.

#define ANSRCV_LOGGEDIN   (ANSRCV_WELCOMERR + 1)

Definition at line 153 of file ftp.c.

#define ANSRCV_NONE   0

Definition at line 150 of file ftp.c.

#define ANSRCV_PASSERR   (ANSRCV_QUITERR + 1)

Definition at line 163 of file ftp.c.

#define ANSRCV_PASSREQ   (ANSRCV_PASSERR + 1)

Definition at line 164 of file ftp.c.

#define ANSRCV_PORTERR   (ANSRCV_PORTOK + 1)

Definition at line 158 of file ftp.c.

#define ANSRCV_PORTOK   (ANSRCV_SYSTERR + 1)

Definition at line 157 of file ftp.c.

#define ANSRCV_QUITERR   (ANSRCV_QUITOK + 1)

Definition at line 162 of file ftp.c.

#define ANSRCV_QUITOK   (ANSRCV_STORERR + 1)

Definition at line 161 of file ftp.c.

#define ANSRCV_STORERR   (ANSRCV_STOROK + 1)

Definition at line 160 of file ftp.c.

#define ANSRCV_STOROK   (ANSRCV_PORTERR + 1)

Definition at line 159 of file ftp.c.

#define ANSRCV_SYSTERR   (ANSRCV_SYSTOK + 1)

Definition at line 156 of file ftp.c.

#define ANSRCV_SYSTOK   (ANSRCV_LOGGEDERR + 1)

Definition at line 155 of file ftp.c.

#define ANSRCV_WELCOME   (ANSRCV_NONE + 1)

Definition at line 151 of file ftp.c.

#define ANSRCV_WELCOMERR   (ANSRCV_WELCOME + 1)

Definition at line 152 of file ftp.c.

#define arnFALSE   ((arn_uCHAR) 0)

Definition at line 87 of file ftp.h.

#define arnTRUE   ((arn_uCHAR) 1)

Definition at line 86 of file ftp.h.

#define CMDSND_CONNECT   (CMDSND_NONE + 1)

Definition at line 142 of file ftp.c.

#define CMDSND_LOGIN   (CMDSND_CONNECT + 1)

Definition at line 143 of file ftp.c.

#define CMDSND_NONE   0

Definition at line 141 of file ftp.c.

#define CMDSND_PASS   (CMDSND_QUIT + 1)

Definition at line 148 of file ftp.c.

#define CMDSND_PORT   (CMDSND_SYST + 1)

Definition at line 145 of file ftp.c.

#define CMDSND_QUIT   (CMDSND_STOR + 1)

Definition at line 147 of file ftp.c.

#define CMDSND_STOR   (CMDSND_PORT + 1)

Definition at line 146 of file ftp.c.

#define CMDSND_SYST   (CMDSND_LOGIN + 1)

Definition at line 144 of file ftp.c.

#define ERRC_CONN   (ERRC_HOSTNAMENOTIP + 1)

Definition at line 165 of file ftp.h.

#define ERRC_CONN_DATA   (ERRC_PORT + 1)

Definition at line 171 of file ftp.h.

#define ERRC_FNAMETOLOONG   (ERRC_CONN + 1)

Definition at line 166 of file ftp.h.

#define ERRC_HOSTNAMENOTIP   (ERRC_NONE + 1)

Definition at line 164 of file ftp.h.

#define ERRC_LOGIN   (ERRC_SRV_WM + 1)

Definition at line 168 of file ftp.h.

#define ERRC_NONE   0

Definition at line 163 of file ftp.h.

#define ERRC_PASS   (ERRC_QUIT + 1)

Definition at line 174 of file ftp.h.

#define ERRC_PORT   (ERRC_SYST + 1)

Definition at line 170 of file ftp.h.

#define ERRC_QUIT   (ERRC_STOR + 1)

Definition at line 173 of file ftp.h.

#define ERRC_SRV_WM   (ERRC_FNAMETOLOONG + 1)

Definition at line 167 of file ftp.h.

#define ERRC_STOR   (ERRC_CONN_DATA + 1)

Definition at line 172 of file ftp.h.

#define ERRC_SYST   (ERRC_LOGIN + 1)

Definition at line 169 of file ftp.h.

#define FTP_FLAG_CMDREQUEST   0x01

Definition at line 91 of file ftp.h.

#define FTP_FLAG_CTRL   0x80

Definition at line 94 of file ftp.h.

#define FTP_FLAG_DATA   0x40

Definition at line 95 of file ftp.h.

#define FTP_FLAG_DATAPENDING   0x02

Definition at line 92 of file ftp.h.

#define FTP_FLAG_LASTDATAACK   0x04

Definition at line 93 of file ftp.h.

#define MAX_FILENAME_LEN   128

Definition at line 90 of file ftp.h.

#define PRINT (   x  ) 

Definition at line 69 of file ftp.c.

#define PRINTLN (   x  ) 

Definition at line 70 of file ftp.c.

#define PRINTNUM (   x  ) 

Definition at line 72 of file ftp.c.

#define PRINTNUMLN (   x  ) 

Definition at line 71 of file ftp.c.

#define STS_CONNECTED   (STS_WAITFORCONN + 1)

Definition at line 141 of file ftp.h.

#define STS_DATACONN_CLOSED_OK   (STS_SENDDATA_OK + 1)

Definition at line 157 of file ftp.h.

#define STS_DATACONN_INPROG   (STS_PORT_OK + 1)

Definition at line 150 of file ftp.h.

#define STS_DATACONN_OK   (STS_DATACONN_INPROG + 1)

Definition at line 151 of file ftp.h.

#define STS_ERROR   (STS_NONE + 1)

Definition at line 139 of file ftp.h.

#define STS_IDLE   (STS_QUIT_OK + 1)

Definition at line 160 of file ftp.h.

#define STS_LOGGEDIN   (STS_LOGGINGIN + 1)

Definition at line 145 of file ftp.h.

#define STS_LOGGINGIN   (STS_UPOLOADOK + 1)

Definition at line 144 of file ftp.h.

#define STS_NONE   0

Definition at line 138 of file ftp.h.

#define STS_PORT_INPROG   (STS_SYST_OK + 1)

Definition at line 148 of file ftp.h.

#define STS_PORT_OK   (STS_PORT_INPROG + 1)

Definition at line 149 of file ftp.h.

#define STS_QUIT_INPROG   (STS_DATACONN_CLOSED_OK + 1)

Definition at line 158 of file ftp.h.

#define STS_QUIT_OK   (STS_QUIT_INPROG + 1)

Definition at line 159 of file ftp.h.

#define STS_SENDDATA_ENDING   (STS_SENDDATA_INPROG + 1)

Definition at line 155 of file ftp.h.

#define STS_SENDDATA_INPROG   (STS_START_DATASTORE + 1)

Definition at line 154 of file ftp.h.

#define STS_SENDDATA_OK   (STS_SENDDATA_ENDING + 1)

Definition at line 156 of file ftp.h.

#define STS_SENDINGFILE   (STS_CONNECTED + 1)

Definition at line 142 of file ftp.h.

#define STS_START_DATASTORE   (STS_STOR_INPROG + 1)

Definition at line 153 of file ftp.h.

#define STS_STOR_INPROG   (STS_DATACONN_OK + 1)

Definition at line 152 of file ftp.h.

#define STS_SYST_INPROG   (STS_LOGGEDIN + 1)

Definition at line 146 of file ftp.h.

#define STS_SYST_OK   (STS_SYST_INPROG + 1)

Definition at line 147 of file ftp.h.

#define STS_UPOLOADOK   (STS_SENDINGFILE + 1)

Definition at line 143 of file ftp.h.

#define STS_WAITFORCONN   (STS_ERROR + 1)

Definition at line 140 of file ftp.h.

#define UIP_APPSTATE_SIZE   (sizeof(struct ftp_state))

Definition at line 189 of file ftp.h.


Typedef Documentation

Definition at line 88 of file ftp.h.

typedef char arn_CHAR

Definition at line 79 of file ftp.h.

typedef int arn_INT

Definition at line 82 of file ftp.h.

typedef long arn_LONG

Definition at line 81 of file ftp.h.

typedef signed char arn_sCHAR

Definition at line 74 of file ftp.h.

typedef short arn_SHORT

Definition at line 80 of file ftp.h.

Definition at line 77 of file ftp.h.

typedef signed long arn_sLONG

Definition at line 76 of file ftp.h.

typedef signed short arn_sSHORT

Definition at line 75 of file ftp.h.

typedef unsigned char arn_uCHAR

Definition at line 69 of file ftp.h.

Definition at line 72 of file ftp.h.

typedef unsigned long arn_uLONG

Definition at line 71 of file ftp.h.

typedef unsigned short arn_uSHORT

Definition at line 70 of file ftp.h.


Enumeration Type Documentation

Enumerator:
ftpcs_NONE 
ftpcs_INPROGRESS 
ftpcs_SUCCESS 
ftpcs_FAILED 
ftpcs_USERNAME_REQ 
ftpcs_PASSWORD_REQ 

Definition at line 120 of file ftp.h.


Function Documentation

void ftp_appcall ( void   ) 
ftp_cmd_status_t ftp_connect ( arn_CHAR host,
arn_uSHORT  rport,
struct uip_conn **  sconn 
)
arn_uCHAR ftp_getErrorCode ( const struct uip_conn sconn  ) 
arn_uCHAR ftp_getStatus ( const struct uip_conn sconn  ) 
void ftp_init ( void   ) 
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_pasv ( const struct uip_conn sconn  ) 
ftp_cmd_status_t ftp_port ( const struct uip_conn sconn,
arn_uSHORT  ldataport 
)
ftp_cmd_status_t ftp_quit ( 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_syst ( const struct uip_conn sconn,
arn_CHAR res 
)

Variable Documentation

Risposta ricevuta

Definition at line 109 of file ftp.h.

Comando inviato

Definition at line 108 of file ftp.h.

Counter of current chunk of data

Definition at line 100 of file ftp.h.

arn_uCHAR ftp_state::data[MAX_FILENAME_LEN+8] [inherited]

Definition at line 112 of file ftp.h.

Pointer to the current chunk of data

Definition at line 99 of file ftp.h.

ErrorCode

Definition at line 103 of file ftp.h.

allineamento

Definition at line 110 of file ftp.h.

arn_CHAR ftp_state::fname[MAX_FILENAME_LEN] [inherited]

file nale to upload

Definition at line 111 of file ftp.h.

Pointer to the base address of the file

Definition at line 101 of file ftp.h.

curret size of the file

Definition at line 102 of file ftp.h.

default = 5001

Definition at line 104 of file ftp.h.

default = 21

Definition at line 106 of file ftp.h.

default = 20

Definition at line 105 of file ftp.h.

State of the protocol

Definition at line 107 of file ftp.h.

Definition at line 542 of file ftp.c.

Definition at line 459 of file ftp.c.

Definition at line 477 of file ftp.c.

Definition at line 478 of file ftp.c.

Definition at line 550 of file ftp.c.