123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- #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;
- extern lwftp_session_t ftpcfg;
- err_t lwftp_store(lwftp_session_t *s);
- void start_ftp_client(lwftp_session_t *s);
- char *get_ftp_progress(void);
- #endif
|