1998-02-27 07:54:42 +03:00
|
|
|
/* ftpfs.h */
|
|
|
|
|
2000-02-25 15:53:06 +03:00
|
|
|
/* $Id$ */
|
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
#if !defined(__FTPFS_H)
|
|
|
|
#define __FTPFS_H
|
|
|
|
|
2000-09-14 19:06:14 +04:00
|
|
|
#include "xdirentry.h"
|
1999-12-08 14:39:14 +03:00
|
|
|
|
1998-09-13 14:40:43 +04:00
|
|
|
struct direntry
|
1998-02-27 07:54:42 +03:00
|
|
|
{
|
|
|
|
char *name;
|
|
|
|
int count;
|
|
|
|
char *linkname;
|
1998-09-21 13:52:07 +04:00
|
|
|
char *local_filename, *remote_filename;
|
1998-02-27 07:54:42 +03:00
|
|
|
int local_is_temp:1;
|
|
|
|
int freshly_created:1;
|
|
|
|
struct stat local_stat;
|
|
|
|
struct stat s;
|
|
|
|
struct stat *l_stat;
|
1998-09-13 14:40:43 +04:00
|
|
|
struct connection *bucket;
|
1998-09-21 13:52:07 +04:00
|
|
|
|
|
|
|
int data_sock; /* For linear_ operations */
|
1998-10-13 02:07:53 +04:00
|
|
|
int linear_state;
|
|
|
|
#define LS_NONLIN 0 /* Not using linear access at all */
|
|
|
|
#define LS_LINEAR_CLOSED 1 /* Using linear access, but not open, yet */
|
|
|
|
#define LS_LINEAR_OPEN 2 /* Using linear access, open */
|
1998-02-27 07:54:42 +03:00
|
|
|
};
|
|
|
|
|
1998-09-13 14:40:43 +04:00
|
|
|
struct dir
|
1998-02-27 07:54:42 +03:00
|
|
|
{
|
|
|
|
int count;
|
|
|
|
struct timeval timestamp;
|
|
|
|
char *remote_path;
|
|
|
|
struct linklist *file_list;
|
1998-09-15 23:41:22 +04:00
|
|
|
int symlink_status;
|
1998-02-27 07:54:42 +03:00
|
|
|
};
|
|
|
|
|
1998-09-15 23:41:22 +04:00
|
|
|
/* valid values for dir->symlink_status */
|
|
|
|
#define FTPFS_NO_SYMLINKS 0
|
|
|
|
#define FTPFS_UNRESOLVED_SYMLINKS 1
|
|
|
|
#define FTPFS_RESOLVED_SYMLINKS 2
|
1998-10-23 00:17:49 +04:00
|
|
|
#define FTPFS_RESOLVING_SYMLINKS 3
|
1998-09-15 23:41:22 +04:00
|
|
|
|
1998-09-13 14:40:43 +04:00
|
|
|
struct connection {
|
1998-02-27 07:54:42 +03:00
|
|
|
char *host;
|
|
|
|
char *user;
|
|
|
|
char *current_directory;
|
|
|
|
char *home;
|
|
|
|
char *updir;
|
|
|
|
char *password;
|
|
|
|
int port;
|
|
|
|
int sock;
|
|
|
|
struct linklist *dcache;
|
|
|
|
ino_t __inode_counter;
|
|
|
|
int lock;
|
|
|
|
int failed_on_login; /* used to pass the failure reason to upper levels */
|
|
|
|
int use_proxy; /* use a proxy server */
|
|
|
|
int result_pending;
|
|
|
|
int use_source_route;
|
|
|
|
int use_passive_connection;
|
1999-01-31 23:28:13 +03:00
|
|
|
int remote_is_amiga; /* No leading slash allowed for AmiTCP (Amiga) */
|
1998-02-27 07:54:42 +03:00
|
|
|
int isbinary;
|
1998-05-10 17:41:43 +04:00
|
|
|
int cwd_defered; /* current_directory was changed but CWD command hasn't
|
|
|
|
been sent yet */
|
1998-09-15 23:41:22 +04:00
|
|
|
int strict_rfc959_list_cmd; /* ftp server doesn't understand
|
|
|
|
"LIST -la <path>"; use "CWD <path>"/
|
|
|
|
"LIST" instead */
|
1998-02-27 07:54:42 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#define qhost(b) (b)->host
|
|
|
|
#define quser(b) (b)->user
|
|
|
|
#define qcdir(b) (b)->current_directory
|
|
|
|
#define qport(b) (b)->port
|
|
|
|
#define qsock(b) (b)->sock
|
|
|
|
#define qlock(b) (b)->lock
|
|
|
|
#define qdcache(b) (b)->dcache
|
|
|
|
#define qhome(b) (b)->home
|
|
|
|
#define qupdir(b) (b)->updir
|
|
|
|
#define qproxy(b) (b)->use_proxy
|
|
|
|
|
|
|
|
/* Increased since now we may use C-r to reread the contents */
|
|
|
|
#define FTPFS_DIRECTORY_TIMEOUT 30 * 60
|
|
|
|
|
1998-09-13 14:40:43 +04:00
|
|
|
#define DO_RESOLVE_SYMLINK 1
|
|
|
|
#define DO_OPEN 2
|
|
|
|
#define DO_FREE_RESOURCE 4
|
1998-02-27 07:54:42 +03:00
|
|
|
|
|
|
|
extern char *ftpfs_anonymous_passwd;
|
|
|
|
extern char *ftpfs_proxy_host;
|
1998-04-17 04:59:58 +04:00
|
|
|
extern int ftpfs_directory_timeout;
|
|
|
|
extern int ftpfs_always_use_proxy;
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2001-06-01 21:46:57 +04:00
|
|
|
extern int use_netrc;
|
|
|
|
extern int ftpfs_retry_seconds;
|
|
|
|
extern int ftpfs_use_passive_connections;
|
|
|
|
extern int ftpfs_use_unix_list_options;
|
|
|
|
extern int ftpfs_first_cd_then_ls;
|
|
|
|
|
1999-12-08 14:39:14 +03:00
|
|
|
void ftpfs_init_passwd (void);
|
|
|
|
|
|
|
|
#define OPT_FLUSH 1
|
|
|
|
#define OPT_IGNORE_ERROR 2
|
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
#endif
|