diff options
author | Damien Miller <djm@mindrot.org> | 2002-02-13 14:10:32 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2002-02-13 14:10:32 +1100 |
commit | 3db5f530d0fdf8044d6014ab12940efe0bbecca7 (patch) | |
tree | 578c5ea0091f934c13d40264b033bbd2532d2e9a /sftp-client.h | |
parent | 3606ee29388781894e6374030d0e40fa46da4cf9 (diff) |
- djm@cvs.openbsd.org 2002/02/13 00:59:23
[sftp-client.c sftp-client.h sftp-glob.c sftp-glob.h sftp.h]
[sftp-int.c sftp-int.h]
API cleanup and backwards compat for filexfer v.0 servers; ok markus@
Diffstat (limited to 'sftp-client.h')
-rw-r--r-- | sftp-client.h | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/sftp-client.h b/sftp-client.h index 477c8ed3b..ceda879b9 100644 --- a/sftp-client.h +++ b/sftp-client.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* $OpenBSD: sftp-client.h,v 1.8 2002/02/12 12:32:27 djm Exp $ */ | 1 | /* $OpenBSD: sftp-client.h,v 1.9 2002/02/13 00:59:23 djm Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2001-2002 Damien Miller. All rights reserved. | 4 | * Copyright (c) 2001,2002 Damien Miller. All rights reserved. |
5 | * | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions |
@@ -26,6 +26,9 @@ | |||
26 | 26 | ||
27 | /* Client side of SSH2 filexfer protocol */ | 27 | /* Client side of SSH2 filexfer protocol */ |
28 | 28 | ||
29 | #ifndef _SFTP_CLIENT_H | ||
30 | #define _SFTP_CLIENT_H | ||
31 | |||
29 | typedef struct SFTP_DIRENT SFTP_DIRENT; | 32 | typedef struct SFTP_DIRENT SFTP_DIRENT; |
30 | 33 | ||
31 | struct SFTP_DIRENT { | 34 | struct SFTP_DIRENT { |
@@ -38,55 +41,59 @@ struct SFTP_DIRENT { | |||
38 | * Initialiase a SSH filexfer connection. Returns -1 on error or | 41 | * Initialiase a SSH filexfer connection. Returns -1 on error or |
39 | * protocol version on success. | 42 | * protocol version on success. |
40 | */ | 43 | */ |
41 | int do_init(int, int); | 44 | struct sftp_conn * |
45 | do_init(int, int, u_int, u_int); | ||
46 | |||
47 | u_int | ||
48 | sftp_proto_version(struct sftp_conn *); | ||
42 | 49 | ||
43 | /* Close file referred to by 'handle' */ | 50 | /* Close file referred to by 'handle' */ |
44 | int do_close(int, int, char *, u_int); | 51 | int do_close(struct sftp_conn *, char *, u_int); |
45 | 52 | ||
46 | /* List contents of directory 'path' to stdout */ | 53 | /* List contents of directory 'path' to stdout */ |
47 | int do_ls(int, int, char *); | 54 | int do_ls(struct sftp_conn *, char *); |
48 | 55 | ||
49 | /* Read contents of 'path' to NULL-terminated array 'dir' */ | 56 | /* Read contents of 'path' to NULL-terminated array 'dir' */ |
50 | int do_readdir(int, int, char *, SFTP_DIRENT ***); | 57 | int do_readdir(struct sftp_conn *, char *, SFTP_DIRENT ***); |
51 | 58 | ||
52 | /* Frees a NULL-terminated array of SFTP_DIRENTs (eg. from do_readdir) */ | 59 | /* Frees a NULL-terminated array of SFTP_DIRENTs (eg. from do_readdir) */ |
53 | void free_sftp_dirents(SFTP_DIRENT **); | 60 | void free_sftp_dirents(SFTP_DIRENT **); |
54 | 61 | ||
55 | /* Delete file 'path' */ | 62 | /* Delete file 'path' */ |
56 | int do_rm(int, int, char *); | 63 | int do_rm(struct sftp_conn *, char *); |
57 | 64 | ||
58 | /* Create directory 'path' */ | 65 | /* Create directory 'path' */ |
59 | int do_mkdir(int, int, char *, Attrib *); | 66 | int do_mkdir(struct sftp_conn *, char *, Attrib *); |
60 | 67 | ||
61 | /* Remove directory 'path' */ | 68 | /* Remove directory 'path' */ |
62 | int do_rmdir(int, int, char *); | 69 | int do_rmdir(struct sftp_conn *, char *); |
63 | 70 | ||
64 | /* Get file attributes of 'path' (follows symlinks) */ | 71 | /* Get file attributes of 'path' (follows symlinks) */ |
65 | Attrib *do_stat(int, int, char *, int); | 72 | Attrib *do_stat(struct sftp_conn *, char *, int); |
66 | 73 | ||
67 | /* Get file attributes of 'path' (does not follow symlinks) */ | 74 | /* Get file attributes of 'path' (does not follow symlinks) */ |
68 | Attrib *do_lstat(int, int, char *, int); | 75 | Attrib *do_lstat(struct sftp_conn *, char *, int); |
69 | 76 | ||
70 | /* Get file attributes of open file 'handle' */ | 77 | /* Get file attributes of open file 'handle' */ |
71 | Attrib *do_fstat(int, int, char *, u_int, int); | 78 | Attrib *do_fstat(struct sftp_conn *, char *, u_int, int); |
72 | 79 | ||
73 | /* Set file attributes of 'path' */ | 80 | /* Set file attributes of 'path' */ |
74 | int do_setstat(int, int, char *, Attrib *); | 81 | int do_setstat(struct sftp_conn *, char *, Attrib *); |
75 | 82 | ||
76 | /* Set file attributes of open file 'handle' */ | 83 | /* Set file attributes of open file 'handle' */ |
77 | int do_fsetstat(int, int, char *, u_int, Attrib *); | 84 | int do_fsetstat(struct sftp_conn *, char *, u_int, Attrib *); |
78 | 85 | ||
79 | /* Canonicalise 'path' - caller must free result */ | 86 | /* Canonicalise 'path' - caller must free result */ |
80 | char *do_realpath(int, int, char *); | 87 | char *do_realpath(struct sftp_conn *, char *); |
81 | 88 | ||
82 | /* Rename 'oldpath' to 'newpath' */ | 89 | /* Rename 'oldpath' to 'newpath' */ |
83 | int do_rename(int, int, char *, char *); | 90 | int do_rename(struct sftp_conn *, char *, char *); |
84 | 91 | ||
85 | /* Rename 'oldpath' to 'newpath' */ | 92 | /* Rename 'oldpath' to 'newpath' */ |
86 | int do_symlink(int, int, char *, char *); | 93 | int do_symlink(struct sftp_conn *, char *, char *); |
87 | 94 | ||
88 | /* Return target of symlink 'path' - caller must free result */ | 95 | /* Return target of symlink 'path' - caller must free result */ |
89 | char *do_readlink(int, int, char *); | 96 | char *do_readlink(struct sftp_conn *, char *); |
90 | 97 | ||
91 | /* XXX: add callbacks to do_download/do_upload so we can do progress meter */ | 98 | /* XXX: add callbacks to do_download/do_upload so we can do progress meter */ |
92 | 99 | ||
@@ -94,10 +101,12 @@ char *do_readlink(int, int, char *); | |||
94 | * Download 'remote_path' to 'local_path'. Preserve permissions and times | 101 | * Download 'remote_path' to 'local_path'. Preserve permissions and times |
95 | * if 'pflag' is set | 102 | * if 'pflag' is set |
96 | */ | 103 | */ |
97 | int do_download(int, int, char *, char *, int, size_t, int); | 104 | int do_download(struct sftp_conn *, char *, char *, int); |
98 | 105 | ||
99 | /* | 106 | /* |
100 | * Upload 'local_path' to 'remote_path'. Preserve permissions and times | 107 | * Upload 'local_path' to 'remote_path'. Preserve permissions and times |
101 | * if 'pflag' is set | 108 | * if 'pflag' is set |
102 | */ | 109 | */ |
103 | int do_upload(int, int, char *, char *, int , size_t, int); | 110 | int do_upload(struct sftp_conn *, char *, char *, int); |
111 | |||
112 | #endif | ||