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 {
};
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;
};
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_ */