Develop and Download Open Source Software

Browse Subversion Repository

Contents of /trunk/ttssh2/ttxssh/sftp.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9048 - (show annotations) (download) (as text)
Wed Dec 16 12:24:13 2020 UTC (3 years, 3 months ago) by nmaya
File MIME type: text/x-chdr
File size: 3927 byte(s)
ソースファイルの著作権表記の "最後の発行の年" を削除

ticket #40996
1 /*
2 * (C) 2008- TeraTerm Project
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29 #ifndef __SFTP_H
30 #define __SFTP_H
31
32 // for debug mode
33 #ifdef _DEBUG
34 #define SFTP_DEBUG
35 #endif
36
37 /* version */
38 #define SSH2_FILEXFER_VERSION 3
39
40 /* client to server */
41 #define SSH2_FXP_INIT 1
42 #define SSH2_FXP_OPEN 3
43 #define SSH2_FXP_CLOSE 4
44 #define SSH2_FXP_READ 5
45 #define SSH2_FXP_WRITE 6
46 #define SSH2_FXP_LSTAT 7
47 #define SSH2_FXP_STAT_VERSION_0 7
48 #define SSH2_FXP_FSTAT 8
49 #define SSH2_FXP_SETSTAT 9
50 #define SSH2_FXP_FSETSTAT 10
51 #define SSH2_FXP_OPENDIR 11
52 #define SSH2_FXP_READDIR 12
53 #define SSH2_FXP_REMOVE 13
54 #define SSH2_FXP_MKDIR 14
55 #define SSH2_FXP_RMDIR 15
56 #define SSH2_FXP_REALPATH 16
57 #define SSH2_FXP_STAT 17
58 #define SSH2_FXP_RENAME 18
59 #define SSH2_FXP_READLINK 19
60 #define SSH2_FXP_SYMLINK 20
61
62 /* server to client */
63 #define SSH2_FXP_VERSION 2
64 #define SSH2_FXP_STATUS 101
65 #define SSH2_FXP_HANDLE 102
66 #define SSH2_FXP_DATA 103
67 #define SSH2_FXP_NAME 104
68 #define SSH2_FXP_ATTRS 105
69
70 #define SSH2_FXP_EXTENDED 200
71 #define SSH2_FXP_EXTENDED_REPLY 201
72
73 /* attributes */
74 #define SSH2_FILEXFER_ATTR_SIZE 0x00000001
75 #define SSH2_FILEXFER_ATTR_UIDGID 0x00000002
76 #define SSH2_FILEXFER_ATTR_PERMISSIONS 0x00000004
77 #define SSH2_FILEXFER_ATTR_ACMODTIME 0x00000008
78 #define SSH2_FILEXFER_ATTR_EXTENDED 0x80000000
79
80 /* portable open modes */
81 #define SSH2_FXF_READ 0x00000001
82 #define SSH2_FXF_WRITE 0x00000002
83 #define SSH2_FXF_APPEND 0x00000004
84 #define SSH2_FXF_CREAT 0x00000008
85 #define SSH2_FXF_TRUNC 0x00000010
86 #define SSH2_FXF_EXCL 0x00000020
87
88 /* statvfs@openssh.com f_flag flags */
89 #define SSH2_FXE_STATVFS_ST_RDONLY 0x00000001
90 #define SSH2_FXE_STATVFS_ST_NOSUID 0x00000002
91
92 /* status messages */
93 #define SSH2_FX_OK 0
94 #define SSH2_FX_EOF 1
95 #define SSH2_FX_NO_SUCH_FILE 2
96 #define SSH2_FX_PERMISSION_DENIED 3
97 #define SSH2_FX_FAILURE 4
98 #define SSH2_FX_BAD_MESSAGE 5
99 #define SSH2_FX_NO_CONNECTION 6
100 #define SSH2_FX_CONNECTION_LOST 7
101 #define SSH2_FX_OP_UNSUPPORTED 8
102 #define SSH2_FX_MAX 8
103
104 /* Maximum packet that we are willing to send/accept */
105 #define SFTP_MAX_MSG_LENGTH (256 * 1024)
106
107 #define DEFAULT_COPY_BUFLEN 32768 /* Size of buffer for up/download */
108 #define DEFAULT_NUM_REQUESTS 64 /* # concurrent outstanding requests */
109
110 void sftp_do_init(PTInstVar pvar, Channel_t *c);
111 void sftp_response(PTInstVar pvar, Channel_t *c, unsigned char *data, unsigned int buflen);
112
113 #endif

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26