summaryrefslogtreecommitdiff
path: root/sftp-client.h
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2015-01-14 13:54:13 +0000
committerDamien Miller <djm@mindrot.org>2015-01-15 02:22:18 +1100
commit7d845f4a0b7ec97887be204c3760e44de8bf1f32 (patch)
treec7f7271203627c22594cc86381745acce479d250 /sftp-client.h
parent139ca81866ec1b219c717d17061e5e7ad1059e2a (diff)
upstream commit
update sftp client and server to new buffer API. pretty much just mechanical changes; with & ok markus
Diffstat (limited to 'sftp-client.h')
-rw-r--r--sftp-client.h44
1 files changed, 23 insertions, 21 deletions
diff --git a/sftp-client.h b/sftp-client.h
index 967840b9c..507d763ea 100644
--- a/sftp-client.h
+++ b/sftp-client.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: sftp-client.h,v 1.25 2014/04/21 14:36:16 logan Exp $ */ 1/* $OpenBSD: sftp-client.h,v 1.26 2015/01/14 13:54:13 djm Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> 4 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
@@ -56,79 +56,81 @@ struct sftp_conn *do_init(int, int, u_int, u_int, u_int64_t);
56u_int sftp_proto_version(struct sftp_conn *); 56u_int sftp_proto_version(struct sftp_conn *);
57 57
58/* Close file referred to by 'handle' */ 58/* Close file referred to by 'handle' */
59int do_close(struct sftp_conn *, char *, u_int); 59int do_close(struct sftp_conn *, const u_char *, u_int);
60 60
61/* Read contents of 'path' to NULL-terminated array 'dir' */ 61/* Read contents of 'path' to NULL-terminated array 'dir' */
62int do_readdir(struct sftp_conn *, char *, SFTP_DIRENT ***); 62int do_readdir(struct sftp_conn *, const char *, SFTP_DIRENT ***);
63 63
64/* Frees a NULL-terminated array of SFTP_DIRENTs (eg. from do_readdir) */ 64/* Frees a NULL-terminated array of SFTP_DIRENTs (eg. from do_readdir) */
65void free_sftp_dirents(SFTP_DIRENT **); 65void free_sftp_dirents(SFTP_DIRENT **);
66 66
67/* Delete file 'path' */ 67/* Delete file 'path' */
68int do_rm(struct sftp_conn *, char *); 68int do_rm(struct sftp_conn *, const char *);
69 69
70/* Create directory 'path' */ 70/* Create directory 'path' */
71int do_mkdir(struct sftp_conn *, char *, Attrib *, int); 71int do_mkdir(struct sftp_conn *, const char *, Attrib *, int);
72 72
73/* Remove directory 'path' */ 73/* Remove directory 'path' */
74int do_rmdir(struct sftp_conn *, char *); 74int do_rmdir(struct sftp_conn *, const char *);
75 75
76/* Get file attributes of 'path' (follows symlinks) */ 76/* Get file attributes of 'path' (follows symlinks) */
77Attrib *do_stat(struct sftp_conn *, char *, int); 77Attrib *do_stat(struct sftp_conn *, const char *, int);
78 78
79/* Get file attributes of 'path' (does not follow symlinks) */ 79/* Get file attributes of 'path' (does not follow symlinks) */
80Attrib *do_lstat(struct sftp_conn *, char *, int); 80Attrib *do_lstat(struct sftp_conn *, const char *, int);
81 81
82/* Set file attributes of 'path' */ 82/* Set file attributes of 'path' */
83int do_setstat(struct sftp_conn *, char *, Attrib *); 83int do_setstat(struct sftp_conn *, const char *, Attrib *);
84 84
85/* Set file attributes of open file 'handle' */ 85/* Set file attributes of open file 'handle' */
86int do_fsetstat(struct sftp_conn *, char *, u_int, Attrib *); 86int do_fsetstat(struct sftp_conn *, const u_char *, u_int, Attrib *);
87 87
88/* Canonicalise 'path' - caller must free result */ 88/* Canonicalise 'path' - caller must free result */
89char *do_realpath(struct sftp_conn *, char *); 89char *do_realpath(struct sftp_conn *, const char *);
90 90
91/* Get statistics for filesystem hosting file at "path" */ 91/* Get statistics for filesystem hosting file at "path" */
92int do_statvfs(struct sftp_conn *, const char *, struct sftp_statvfs *, int); 92int do_statvfs(struct sftp_conn *, const char *, struct sftp_statvfs *, int);
93 93
94/* Rename 'oldpath' to 'newpath' */ 94/* Rename 'oldpath' to 'newpath' */
95int do_rename(struct sftp_conn *, char *, char *m, int force_legacy); 95int do_rename(struct sftp_conn *, const char *, const char *, int force_legacy);
96 96
97/* Link 'oldpath' to 'newpath' */ 97/* Link 'oldpath' to 'newpath' */
98int do_hardlink(struct sftp_conn *, char *, char *); 98int do_hardlink(struct sftp_conn *, const char *, const char *);
99 99
100/* Rename 'oldpath' to 'newpath' */ 100/* Rename 'oldpath' to 'newpath' */
101int do_symlink(struct sftp_conn *, char *, char *); 101int do_symlink(struct sftp_conn *, const char *, const char *);
102 102
103/* Call fsync() on open file 'handle' */ 103/* Call fsync() on open file 'handle' */
104int do_fsync(struct sftp_conn *conn, char *, u_int); 104int do_fsync(struct sftp_conn *conn, u_char *, u_int);
105 105
106/* 106/*
107 * Download 'remote_path' to 'local_path'. Preserve permissions and times 107 * Download 'remote_path' to 'local_path'. Preserve permissions and times
108 * if 'pflag' is set 108 * if 'pflag' is set
109 */ 109 */
110int do_download(struct sftp_conn *, char *, char *, Attrib *, int, int, int); 110int do_download(struct sftp_conn *, const char *, const char *,
111 Attrib *, int, int, int);
111 112
112/* 113/*
113 * Recursively download 'remote_directory' to 'local_directory'. Preserve 114 * Recursively download 'remote_directory' to 'local_directory'. Preserve
114 * times if 'pflag' is set 115 * times if 'pflag' is set
115 */ 116 */
116int download_dir(struct sftp_conn *, char *, char *, Attrib *, int, 117int download_dir(struct sftp_conn *, const char *, const char *,
117 int, int, int); 118 Attrib *, int, int, int, int);
118 119
119/* 120/*
120 * Upload 'local_path' to 'remote_path'. Preserve permissions and times 121 * Upload 'local_path' to 'remote_path'. Preserve permissions and times
121 * if 'pflag' is set 122 * if 'pflag' is set
122 */ 123 */
123int do_upload(struct sftp_conn *, char *, char *, int, int, int); 124int do_upload(struct sftp_conn *, const char *, const char *, int, int, int);
124 125
125/* 126/*
126 * Recursively upload 'local_directory' to 'remote_directory'. Preserve 127 * Recursively upload 'local_directory' to 'remote_directory'. Preserve
127 * times if 'pflag' is set 128 * times if 'pflag' is set
128 */ 129 */
129int upload_dir(struct sftp_conn *, char *, char *, int, int, int, int); 130int upload_dir(struct sftp_conn *, const char *, const char *, int, int, int,
131 int);
130 132
131/* Concatenate paths, taking care of slashes. Caller must free result. */ 133/* Concatenate paths, taking care of slashes. Caller must free result. */
132char *path_append(char *, char *); 134char *path_append(const char *, const char *);
133 135
134#endif 136#endif