12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- #ifndef __IAP_FTP_H__
- #define __IAP_FTP_H__
- #include "lwip/opt.h"
- #include "lwip/ip.h"
- #include "settings_api.h"
- enum lwftp_results {
- LWFTP_RESULT_OK=0,
- LWFTP_RESULT_ERR_UNKNOWN,
- LWFTP_RESULT_ERR_CONNECT,
- LWFTP_RESULT_ERR_HOSTNAME,
- LWFTP_RESULT_ERR_CLOSED,
- LWFTP_RESULT_ERR_TIMEOUT,
- LWFTP_RESULT_ERR_SRVR_RESP
- };
- typedef enum {
- LWFTP_CLOSED=0,
- LWFTP_CONNECTED,
- LWFTP_USER_SENT,
- LWFTP_PASS_SENT,
- LWFTP_TYPE_SENT,
- LWFTP_PASV_SENT,
- LWFTP_RETR_SENT,
- LWFTP_STOR_SENT,
- LWFTP_XFERING,
- LWFTP_QUIT,
- LWFTP_QUIT_SENT,
- LWFTP_CLOSING,
- } lwftp_state_t;
- typedef struct {
-
- FTP_Update_t *settings;
- void *data_handle;
- unsigned (*data_source)(void*, const char**, unsigned);
- unsigned (*data_sink)(void*, const char*, unsigned);
- void (*done_fn)(void*, int);
-
- lwftp_state_t control_state;
- lwftp_state_t target_state;
- lwftp_state_t data_state;
- struct tcp_pcb *control_pcb;
- struct tcp_pcb *data_pcb;
- char *error;
- } lwftp_session_t;
- err_t lwftp_store(lwftp_session_t *s);
- void start_ftp_client(lwftp_session_t *s);
- char *get_ftp_progress(void);
- #endif
|