21 #ifndef _SFTP_CLIENT_H
22 #define _SFTP_CLIENT_H
24 #ifdef USE_SYSTEM_GLOB
27 # include "openbsd-compat/glob.h"
30 typedef struct SFTP_DIRENT SFTP_DIRENT;
58 u_int64_t packet_length;
59 u_int64_t read_length;
60 u_int64_t write_length;
61 u_int64_t open_handles;
68 struct sftp_conn *do_init(
int,
int, u_int, u_int, u_int64_t);
70 u_int sftp_proto_version(
struct sftp_conn *);
73 int do_limits(
struct sftp_conn *,
struct sftp_limits *);
76 int do_close(
struct sftp_conn *,
const u_char *, u_int);
79 int do_readdir(
struct sftp_conn *,
const char *, SFTP_DIRENT ***);
82 void free_sftp_dirents(SFTP_DIRENT **);
85 int do_rm(
struct sftp_conn *,
const char *);
88 int do_mkdir(
struct sftp_conn *,
const char *, Attrib *,
int);
91 int do_rmdir(
struct sftp_conn *,
const char *);
94 Attrib *do_stat(
struct sftp_conn *,
const char *,
int);
97 Attrib *do_lstat(
struct sftp_conn *,
const char *,
int);
100 int do_setstat(
struct sftp_conn *,
const char *, Attrib *);
103 int do_fsetstat(
struct sftp_conn *,
const u_char *, u_int, Attrib *);
106 int do_lsetstat(
struct sftp_conn *conn,
const char *path, Attrib *a);
109 char *do_realpath(
struct sftp_conn *,
const char *);
112 int do_statvfs(
struct sftp_conn *,
const char *,
struct sftp_statvfs *,
int);
115 int do_rename(
struct sftp_conn *,
const char *,
const char *,
int force_legacy);
118 int do_hardlink(
struct sftp_conn *,
const char *,
const char *);
121 int do_symlink(
struct sftp_conn *,
const char *,
const char *);
124 int do_fsync(
struct sftp_conn *conn, u_char *, u_int);
130 int do_download(
struct sftp_conn *,
const char *,
const char *,
131 Attrib *,
int,
int,
int);
137 int download_dir(
struct sftp_conn *,
const char *,
const char *,
138 Attrib *,
int,
int,
int,
int);
144 int do_upload(
struct sftp_conn *,
const char *,
const char *,
int,
int,
int);
150 int upload_dir(
struct sftp_conn *,
const char *,
const char *,
int,
int,
int,
154 char *path_append(
const char *,
const char *);
158 char *make_absolute(
char *,
const char *);
161 int remote_is_dir(
struct sftp_conn *conn,
const char *path);
164 int local_is_dir(
const char *path);
167 int globpath_is_dir(
const char *pathname);