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 *,
int);
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_copy(
struct sftp_conn *,
const char *,
const char *);
132 int do_hardlink(
struct sftp_conn *,
const char *,
const char *);
135 int do_symlink(
struct sftp_conn *,
const char *,
const char *);
138 int do_fsync(
struct sftp_conn *conn, u_char *, u_int);
144 int do_download(
struct sftp_conn *,
const char *,
const char *, Attrib *,
151 int download_dir(
struct sftp_conn *,
const char *,
const char *, Attrib *,
152 int,
int,
int,
int,
int,
int);
158 int do_upload(
struct sftp_conn *,
const char *,
const char *,
165 int upload_dir(
struct sftp_conn *,
const char *,
const char *,
166 int,
int,
int,
int,
int,
int,
int);
173 do_crossload(
struct sftp_conn *from,
struct sftp_conn *to,
174 const char *from_path,
const char *to_path,
175 Attrib *a,
int preserve_flag);
181 int crossload_dir(
struct sftp_conn *from,
struct sftp_conn *to,
182 const char *from_path,
const char *to_path,
183 Attrib *dirattrib,
int preserve_flag,
int print_flag,
184 int follow_link_flag);
189 int can_get_users_groups_by_id(
struct sftp_conn *conn);
190 int do_get_users_groups_by_id(
struct sftp_conn *conn,
191 const u_int *uids, u_int nuids,
192 const u_int *gids, u_int ngids,
193 char ***usernamesp,
char ***groupnamesp);
196 char *path_append(
const char *,
const char *);
200 char *make_absolute(
char *,
const char *);
203 int remote_is_dir(
struct sftp_conn *conn,
const char *path);
206 int local_is_dir(
const char *path);
209 int globpath_is_dir(
const char *pathname);