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;
67 #define SFTP_PROGRESS_ONLY 2
73 struct sftp_conn *do_init(
int,
int, u_int, u_int, u_int64_t);
75 u_int sftp_proto_version(
struct sftp_conn *);
78 int do_limits(
struct sftp_conn *,
struct sftp_limits *);
81 int do_close(
struct sftp_conn *,
const u_char *, u_int);
84 int do_readdir(
struct sftp_conn *,
const char *, SFTP_DIRENT ***);
87 void free_sftp_dirents(SFTP_DIRENT **);
90 int do_rm(
struct sftp_conn *,
const char *);
93 int do_mkdir(
struct sftp_conn *,
const char *, Attrib *,
int);
96 int do_rmdir(
struct sftp_conn *,
const char *);
99 Attrib *do_stat(
struct sftp_conn *,
const char *,
int);
102 Attrib *do_lstat(
struct sftp_conn *,
const char *,
int);
105 int do_setstat(
struct sftp_conn *,
const char *, Attrib *);
108 int do_fsetstat(
struct sftp_conn *,
const u_char *, u_int, Attrib *);
111 int do_lsetstat(
struct sftp_conn *conn,
const char *path, Attrib *a);
114 char *do_realpath(
struct sftp_conn *,
const char *);
117 char *do_expand_path(
struct sftp_conn *,
const char *);
120 int can_expand_path(
struct sftp_conn *);
123 int do_statvfs(
struct sftp_conn *,
const char *,
struct sftp_statvfs *,
int);
126 int do_rename(
struct sftp_conn *,
const char *,
const char *,
int);
129 int do_hardlink(
struct sftp_conn *,
const char *,
const char *);
132 int do_symlink(
struct sftp_conn *,
const char *,
const char *);
135 int do_fsync(
struct sftp_conn *conn, u_char *, u_int);
141 int do_download(
struct sftp_conn *,
const char *,
const char *,
142 Attrib *,
int,
int,
int);
148 int download_dir(
struct sftp_conn *,
const char *,
const char *,
149 Attrib *,
int,
int,
int,
int,
int);
155 int do_upload(
struct sftp_conn *,
const char *,
const char *,
int,
int,
int);
161 int upload_dir(
struct sftp_conn *,
const char *,
const char *,
int,
int,
int,
169 do_crossload(
struct sftp_conn *from,
struct sftp_conn *to,
170 const char *from_path,
const char *to_path,
171 Attrib *a,
int preserve_flag);
177 int crossload_dir(
struct sftp_conn *from,
struct sftp_conn *to,
178 const char *from_path,
const char *to_path,
179 Attrib *dirattrib,
int preserve_flag,
int print_flag,
180 int follow_link_flag);
183 char *path_append(
const char *,
const char *);
187 char *make_absolute(
char *,
const char *);
190 int remote_is_dir(
struct sftp_conn *conn,
const char *path);
193 int local_is_dir(
const char *path);
196 int globpath_is_dir(
const char *pathname);