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) {
|
|
54 switch(type) {
|
|
55 case SSH_FXP_INIT:
|
|
56 return "SSH_FXP_INIT";
|
|
57 case SSH_FXP_VERSION:
|
|
58 return "SSH_FXP_VERSION";
|
|
59 case SSH_FXP_OPEN:
|
|
60 return "SSH_FXP_OPEN";
|
|
61 case SSH_FXP_CLOSE:
|
|
62 return "SSH_FXP_CLOSE";
|
|
63 case SSH_FXP_READ:
|
|
64 return "SSH_FXP_READ";
|
|
65 case SSH_FXP_WRITE:
|
|
66 return "SSH_FXP_WRITE";
|
|
67 case SSH_FXP_LSTAT:
|
|
68 return "SSH_FXP_LSTAT";
|
|
69 case SSH_FXP_FSTAT:
|
|
70 return "SSH_FXP_FSTAT";
|
|
71 case SSH_FXP_SETSTAT:
|
|
72 return "SSH_FXP_SETSTAT";
|
|
73 case SSH_FXP_FSETSTAT:
|
|
74 return "SSH_FXP_FSETSTAT";
|
|
75 case SSH_FXP_OPENDIR:
|
|
76 return "SSH_FXP_OPENDIR";
|
|
77 case SSH_FXP_READDIR:
|
|
78 return "SSH_FXP_READDIR";
|
|
79 case SSH_FXP_REMOVE:
|
|
80 return "SSH_FXP_REMOVE";
|
|
81 case SSH_FXP_MKDIR:
|
|
82 return "SSH_FXP_MKDIR";
|
|
83 case SSH_FXP_RMDIR:
|
|
84 return "SSH_FXP_RMDIR";
|
|
85 case SSH_FXP_REALPATH:
|
|
86 return "SSH_FXP_REALPATH";
|
|
87 case SSH_FXP_STAT:
|
|
88 return "SSH_FXP_STAT";
|
|
89 case SSH_FXP_RENAME:
|
|
90 return "SSH_FXP_RENAME";
|
|
91 case SSH_FXP_READLINK:
|
|
92 return "SSH_FXP_READLINK";
|
|
93 case SSH_FXP_SYMLINK:
|
|
94 return "SSH_FXP_SYMLINK";
|
|
95 case SSH_FXP_STATUS:
|
|
96 return "SSH_FXP_STATUS";
|
|
97 case SSH_FXP_HANDLE:
|
|
98 return "SSH_FXP_HANDLE";
|
|
99 case SSH_FXP_DATA:
|
|
100 return "SSH_FXP_DATA";
|
|
101 case SSH_FXP_NAME:
|
|
102 return "SSH_FXP_NAME";
|
|
103 case SSH_FXP_ATTRS:
|
|
104 return "SSH_FXP_ATTRS";
|
|
105 case SSH_FXP_EXTENDED:
|
|
106 return "SSH_FXP_EXTENDED";
|
|
107 case SSH_FXP_EXTENDED_REPLY:
|
|
108 return "SSH_FXP_EXTENDED_REPLY";
|
|
109 }
|
|
110 return null;
|
|
111 }
|
|
112 }
|