X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fftp.h;fp=src%2Fftp.h;h=e8bcf10928a02eb1fc65d180d44c37ef81bcb841;hb=a606b2eade34c3d8e662e94a32af960b5d2911f1;hp=c9ebbe2941ab3dfa60b9c78b1fa8d988eb8e41f1;hpb=c65c4562a19c45eda17d7d672afe15f5c8ce5fec;p=oftp diff --git a/src/ftp.h b/src/ftp.h index c9ebbe2..e8bcf10 100644 --- a/src/ftp.h +++ b/src/ftp.h @@ -14,9 +14,17 @@ enum { FTP_STORE }; +enum { + FTP_DISC, + FTP_CONN_PASV, + FTP_CONN_ACT +}; + struct ftp_op { int op; char *arg; + + struct ftp_op *next; }; struct ftp_dirent { @@ -25,24 +33,26 @@ struct ftp_dirent { }; struct ftp { - int ctl, data; /* sockets */ + int ctl, lis, data; /* sockets */ + int lis_port; int status; char *user, *pass; - void (*cproc)(struct ftp *ftp, int code, const char *buf, void *cls); + struct ftp_op *qhead, *qtail; + + int (*cproc)(struct ftp *ftp, int code, const char *buf, void *cls); void (*dproc)(struct ftp *ftp, const char *buf, int sz, void *cls); void *cproc_cls, *dproc_cls; char crecv[256]; int num_crecv; char drecv[256]; - int num_drecv; char *curdir_rem, *curdir_loc; - struct ftp_dirent *dent; - int num_dent; + struct ftp_dirent *dent_rem, *dent_loc; + int last_resp; int modified; }; @@ -55,13 +65,21 @@ int ftp_connect(struct ftp *ftp, const char *host, int port); void ftp_close(struct ftp *ftp); int ftp_sockets(struct ftp *ftp, int *sockv, int maxsize); -int ftp_pending(struct ftp *ftp); int ftp_handle(struct ftp *ftp, int s); +int ftp_queue(struct ftp *ftp, int op, const char *arg); +int ftp_waitresp(struct ftp *ftp, time_t timeout); + int ftp_update(struct ftp *ftp); int ftp_pwd(struct ftp *ftp); int ftp_chdir(struct ftp *ftp, const char *dirname); +int ftp_mkdir(struct ftp *ftp, const char *dirname); +int ftp_rmdir(struct ftp *ftp, const char *dirname); +int ftp_delete(struct ftp *ftp, const char *fname); +int ftp_list(struct ftp *ftp); +int ftp_retrieve(struct ftp *ftp, const char *fname); +int ftp_store(struct ftp *ftp, const char *fname); #endif /* FTP_H_ */