273
|
1 /*
|
|
2 * Copyright (c) 2006-2011 Christian Plattner. All rights reserved.
|
|
3 * Please refer to the LICENSE.txt for licensing details.
|
|
4 */
|
|
5 package ch.ethz.ssh2.sftp;
|
|
6
|
|
7 /**
|
|
8 * SFTP Paket Types
|
|
9 *
|
|
10 * @author Christian Plattner
|
|
11 * @version 2.50, 03/15/10
|
|
12 */
|
|
13 public class Packet {
|
|
14 public static final int SSH_FXP_INIT = 1;
|
|
15 public static final int SSH_FXP_VERSION = 2;
|
|
16 public static final int SSH_FXP_OPEN = 3;
|
|
17 public static final int SSH_FXP_CLOSE = 4;
|
|
18 public static final int SSH_FXP_READ = 5;
|
|
19 public static final int SSH_FXP_WRITE = 6;
|
|
20 public static final int SSH_FXP_LSTAT = 7;
|
|
21 public static final int SSH_FXP_FSTAT = 8;
|
|
22 public static final int SSH_FXP_SETSTAT = 9;
|
|
23 public static final int SSH_FXP_FSETSTAT = 10;
|
|
24 public static final int SSH_FXP_OPENDIR = 11;
|
|
25 public static final int SSH_FXP_READDIR = 12;
|
|
26 public static final int SSH_FXP_REMOVE = 13;
|
|
27 public static final int SSH_FXP_MKDIR = 14;
|
|
28 public static final int SSH_FXP_RMDIR = 15;
|
|
29 public static final int SSH_FXP_REALPATH = 16;
|
|
30 public static final int SSH_FXP_STAT = 17;
|
|
31 public static final int SSH_FXP_RENAME = 18;
|
|
32 public static final int SSH_FXP_READLINK = 19;
|
|
33 public static final int SSH_FXP_SYMLINK = 20;
|
|
34 public static final int SSH_FXP_LINK = 21;
|
|
35
|
|
36 public static final int SSH_FXP_STATUS = 101;
|
|
37 public static final int SSH_FXP_HANDLE = 102;
|
|
38 public static final int SSH_FXP_DATA = 103;
|
|
39 public static final int SSH_FXP_NAME = 104;
|
|
40 public static final int SSH_FXP_ATTRS = 105;
|
|
41
|
|
42 /**
|
|
43 * SSH_FXP_EXTENDED and SSH_FXP_EXTENDED_REPLY packets can be used to
|
|
44 * implement extensions, which can be vendor specific.
|
|
45 */
|
|
46 public static final int SSH_FXP_EXTENDED = 200;
|
|
47 /**
|
|
48 * SSH_FXP_EXTENDED and SSH_FXP_EXTENDED_REPLY packets can be used to
|
|
49 * implement extensions, which can be vendor specific.
|
|
50 */
|
|
51 public static final int SSH_FXP_EXTENDED_REPLY = 201;
|
|
52
|
|
53 public static String forName(int type) {
|
307
|
54 switch (type) {
|
273
|
55 case SSH_FXP_INIT:
|
|
56 return "SSH_FXP_INIT";
|
307
|
57
|
273
|
58 case SSH_FXP_VERSION:
|
|
59 return "SSH_FXP_VERSION";
|
307
|
60
|
273
|
61 case SSH_FXP_OPEN:
|
|
62 return "SSH_FXP_OPEN";
|
307
|
63
|
273
|
64 case SSH_FXP_CLOSE:
|
|
65 return "SSH_FXP_CLOSE";
|
307
|
66
|
273
|
67 case SSH_FXP_READ:
|
|
68 return "SSH_FXP_READ";
|
307
|
69
|
273
|
70 case SSH_FXP_WRITE:
|
|
71 return "SSH_FXP_WRITE";
|
307
|
72
|
273
|
73 case SSH_FXP_LSTAT:
|
|
74 return "SSH_FXP_LSTAT";
|
307
|
75
|
273
|
76 case SSH_FXP_FSTAT:
|
|
77 return "SSH_FXP_FSTAT";
|
307
|
78
|
273
|
79 case SSH_FXP_SETSTAT:
|
|
80 return "SSH_FXP_SETSTAT";
|
307
|
81
|
273
|
82 case SSH_FXP_FSETSTAT:
|
|
83 return "SSH_FXP_FSETSTAT";
|
307
|
84
|
273
|
85 case SSH_FXP_OPENDIR:
|
|
86 return "SSH_FXP_OPENDIR";
|
307
|
87
|
273
|
88 case SSH_FXP_READDIR:
|
|
89 return "SSH_FXP_READDIR";
|
307
|
90
|
273
|
91 case SSH_FXP_REMOVE:
|
|
92 return "SSH_FXP_REMOVE";
|
307
|
93
|
273
|
94 case SSH_FXP_MKDIR:
|
|
95 return "SSH_FXP_MKDIR";
|
307
|
96
|
273
|
97 case SSH_FXP_RMDIR:
|
|
98 return "SSH_FXP_RMDIR";
|
307
|
99
|
273
|
100 case SSH_FXP_REALPATH:
|
|
101 return "SSH_FXP_REALPATH";
|
307
|
102
|
273
|
103 case SSH_FXP_STAT:
|
|
104 return "SSH_FXP_STAT";
|
307
|
105
|
273
|
106 case SSH_FXP_RENAME:
|
|
107 return "SSH_FXP_RENAME";
|
307
|
108
|
273
|
109 case SSH_FXP_READLINK:
|
|
110 return "SSH_FXP_READLINK";
|
307
|
111
|
273
|
112 case SSH_FXP_SYMLINK:
|
|
113 return "SSH_FXP_SYMLINK";
|
307
|
114
|
273
|
115 case SSH_FXP_STATUS:
|
|
116 return "SSH_FXP_STATUS";
|
307
|
117
|
273
|
118 case SSH_FXP_HANDLE:
|
|
119 return "SSH_FXP_HANDLE";
|
307
|
120
|
273
|
121 case SSH_FXP_DATA:
|
|
122 return "SSH_FXP_DATA";
|
307
|
123
|
273
|
124 case SSH_FXP_NAME:
|
|
125 return "SSH_FXP_NAME";
|
307
|
126
|
273
|
127 case SSH_FXP_ATTRS:
|
|
128 return "SSH_FXP_ATTRS";
|
307
|
129
|
273
|
130 case SSH_FXP_EXTENDED:
|
|
131 return "SSH_FXP_EXTENDED";
|
307
|
132
|
273
|
133 case SSH_FXP_EXTENDED_REPLY:
|
|
134 return "SSH_FXP_EXTENDED_REPLY";
|
|
135 }
|
307
|
136
|
273
|
137 return null;
|
|
138 }
|
|
139 }
|