diff options
author | djm@openbsd.org <djm@openbsd.org> | 2015-01-14 13:54:13 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2015-01-15 02:22:18 +1100 |
commit | 7d845f4a0b7ec97887be204c3760e44de8bf1f32 (patch) | |
tree | c7f7271203627c22594cc86381745acce479d250 /sftp-client.h | |
parent | 139ca81866ec1b219c717d17061e5e7ad1059e2a (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.h | 44 |
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); | |||
56 | u_int sftp_proto_version(struct sftp_conn *); | 56 | u_int sftp_proto_version(struct sftp_conn *); |
57 | 57 | ||
58 | /* Close file referred to by 'handle' */ | 58 | /* Close file referred to by 'handle' */ |
59 | int do_close(struct sftp_conn *, char *, u_int); | 59 | int 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' */ |
62 | int do_readdir(struct sftp_conn *, char *, SFTP_DIRENT ***); | 62 | int 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) */ |
65 | void free_sftp_dirents(SFTP_DIRENT **); | 65 | void free_sftp_dirents(SFTP_DIRENT **); |
66 | 66 | ||
67 | /* Delete file 'path' */ | 67 | /* Delete file 'path' */ |
68 | int do_rm(struct sftp_conn *, char *); | 68 | int do_rm(struct sftp_conn *, const char *); |
69 | 69 | ||
70 | /* Create directory 'path' */ | 70 | /* Create directory 'path' */ |
71 | int do_mkdir(struct sftp_conn *, char *, Attrib *, int); | 71 | int do_mkdir(struct sftp_conn *, const char *, Attrib *, int); |
72 | 72 | ||
73 | /* Remove directory 'path' */ | 73 | /* Remove directory 'path' */ |
74 | int do_rmdir(struct sftp_conn *, char *); | 74 | int 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) */ |
77 | Attrib *do_stat(struct sftp_conn *, char *, int); | 77 | Attrib *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) */ |
80 | Attrib *do_lstat(struct sftp_conn *, char *, int); | 80 | Attrib *do_lstat(struct sftp_conn *, const char *, int); |
81 | 81 | ||
82 | /* Set file attributes of 'path' */ | 82 | /* Set file attributes of 'path' */ |
83 | int do_setstat(struct sftp_conn *, char *, Attrib *); | 83 | int 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' */ |
86 | int do_fsetstat(struct sftp_conn *, char *, u_int, Attrib *); | 86 | int 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 */ |
89 | char *do_realpath(struct sftp_conn *, char *); | 89 | char *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" */ |
92 | int do_statvfs(struct sftp_conn *, const char *, struct sftp_statvfs *, int); | 92 | int do_statvfs(struct sftp_conn *, const char *, struct sftp_statvfs *, int); |
93 | 93 | ||
94 | /* Rename 'oldpath' to 'newpath' */ | 94 | /* Rename 'oldpath' to 'newpath' */ |
95 | int do_rename(struct sftp_conn *, char *, char *m, int force_legacy); | 95 | int do_rename(struct sftp_conn *, const char *, const char *, int force_legacy); |
96 | 96 | ||
97 | /* Link 'oldpath' to 'newpath' */ | 97 | /* Link 'oldpath' to 'newpath' */ |
98 | int do_hardlink(struct sftp_conn *, char *, char *); | 98 | int do_hardlink(struct sftp_conn *, const char *, const char *); |
99 | 99 | ||
100 | /* Rename 'oldpath' to 'newpath' */ | 100 | /* Rename 'oldpath' to 'newpath' */ |
101 | int do_symlink(struct sftp_conn *, char *, char *); | 101 | int 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' */ |
104 | int do_fsync(struct sftp_conn *conn, char *, u_int); | 104 | int 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 | */ |
110 | int do_download(struct sftp_conn *, char *, char *, Attrib *, int, int, int); | 110 | int 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 | */ |
116 | int download_dir(struct sftp_conn *, char *, char *, Attrib *, int, | 117 | int 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 | */ |
123 | int do_upload(struct sftp_conn *, char *, char *, int, int, int); | 124 | int 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 | */ |
129 | int upload_dir(struct sftp_conn *, char *, char *, int, int, int, int); | 130 | int 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. */ |
132 | char *path_append(char *, char *); | 134 | char *path_append(const char *, const char *); |
133 | 135 | ||
134 | #endif | 136 | #endif |