-
-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
194 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,99 @@ | ||
|
||
package ch.ethz.ssh2.sftp; | ||
|
||
/** | ||
* | ||
* SFTP Paket Types | ||
* | ||
* @author Christian Plattner, plattner@inf.ethz.ch | ||
* @version $Id$ | ||
* | ||
*/ | ||
public class Packet | ||
{ | ||
public static final int SSH_FXP_INIT = 1; | ||
public static final int SSH_FXP_VERSION = 2; | ||
public static final int SSH_FXP_OPEN = 3; | ||
public static final int SSH_FXP_CLOSE = 4; | ||
public static final int SSH_FXP_READ = 5; | ||
public static final int SSH_FXP_WRITE = 6; | ||
public static final int SSH_FXP_LSTAT = 7; | ||
public static final int SSH_FXP_FSTAT = 8; | ||
public static final int SSH_FXP_SETSTAT = 9; | ||
public static final int SSH_FXP_FSETSTAT = 10; | ||
public static final int SSH_FXP_OPENDIR = 11; | ||
public static final int SSH_FXP_READDIR = 12; | ||
public static final int SSH_FXP_REMOVE = 13; | ||
public static final int SSH_FXP_MKDIR = 14; | ||
public static final int SSH_FXP_RMDIR = 15; | ||
public static final int SSH_FXP_REALPATH = 16; | ||
public static final int SSH_FXP_STAT = 17; | ||
public static final int SSH_FXP_RENAME = 18; | ||
public static final int SSH_FXP_READLINK = 19; | ||
public static final int SSH_FXP_SYMLINK = 20; | ||
|
||
public static final int SSH_FXP_STATUS = 101; | ||
public static final int SSH_FXP_HANDLE = 102; | ||
public static final int SSH_FXP_DATA = 103; | ||
public static final int SSH_FXP_NAME = 104; | ||
public static final int SSH_FXP_ATTRS = 105; | ||
|
||
public static final int SSH_FXP_EXTENDED = 200; | ||
public static final int SSH_FXP_EXTENDED_REPLY = 201; | ||
public class Packet { | ||
public static final int SSH_FXP_INIT = 1; | ||
public static final int SSH_FXP_VERSION = 2; | ||
public static final int SSH_FXP_OPEN = 3; | ||
public static final int SSH_FXP_CLOSE = 4; | ||
public static final int SSH_FXP_READ = 5; | ||
public static final int SSH_FXP_WRITE = 6; | ||
public static final int SSH_FXP_LSTAT = 7; | ||
public static final int SSH_FXP_FSTAT = 8; | ||
public static final int SSH_FXP_SETSTAT = 9; | ||
public static final int SSH_FXP_FSETSTAT = 10; | ||
public static final int SSH_FXP_OPENDIR = 11; | ||
public static final int SSH_FXP_READDIR = 12; | ||
public static final int SSH_FXP_REMOVE = 13; | ||
public static final int SSH_FXP_MKDIR = 14; | ||
public static final int SSH_FXP_RMDIR = 15; | ||
public static final int SSH_FXP_REALPATH = 16; | ||
public static final int SSH_FXP_STAT = 17; | ||
public static final int SSH_FXP_RENAME = 18; | ||
public static final int SSH_FXP_READLINK = 19; | ||
public static final int SSH_FXP_SYMLINK = 20; | ||
|
||
public static final int SSH_FXP_STATUS = 101; | ||
public static final int SSH_FXP_HANDLE = 102; | ||
public static final int SSH_FXP_DATA = 103; | ||
public static final int SSH_FXP_NAME = 104; | ||
public static final int SSH_FXP_ATTRS = 105; | ||
|
||
public static final int SSH_FXP_EXTENDED = 200; | ||
public static final int SSH_FXP_EXTENDED_REPLY = 201; | ||
|
||
public static String forName(int type) { | ||
switch(type) { | ||
case SSH_FXP_INIT: | ||
return "SSH_FXP_INIT"; | ||
case SSH_FXP_VERSION: | ||
return "SSH_FXP_VERSION"; | ||
case SSH_FXP_OPEN: | ||
return "SSH_FXP_OPEN"; | ||
case SSH_FXP_CLOSE: | ||
return "SSH_FXP_CLOSE"; | ||
case SSH_FXP_READ: | ||
return "SSH_FXP_READ"; | ||
case SSH_FXP_WRITE: | ||
return "SSH_FXP_WRITE"; | ||
case SSH_FXP_LSTAT: | ||
return "SSH_FXP_LSTAT"; | ||
case SSH_FXP_FSTAT: | ||
return "SSH_FXP_FSTAT"; | ||
case SSH_FXP_SETSTAT: | ||
return "SSH_FXP_SETSTAT"; | ||
case SSH_FXP_FSETSTAT: | ||
return "SSH_FXP_FSETSTAT"; | ||
case SSH_FXP_OPENDIR: | ||
return "SSH_FXP_OPENDIR"; | ||
case SSH_FXP_READDIR: | ||
return "SSH_FXP_READDIR"; | ||
case SSH_FXP_REMOVE: | ||
return "SSH_FXP_REMOVE"; | ||
case SSH_FXP_MKDIR: | ||
return "SSH_FXP_MKDIR"; | ||
case SSH_FXP_RMDIR: | ||
return "SSH_FXP_RMDIR"; | ||
case SSH_FXP_REALPATH: | ||
return "SSH_FXP_REALPATH"; | ||
case SSH_FXP_STAT: | ||
return "SSH_FXP_STAT"; | ||
case SSH_FXP_RENAME: | ||
return "SSH_FXP_RENAME"; | ||
case SSH_FXP_READLINK: | ||
return "SSH_FXP_READLINK"; | ||
case SSH_FXP_SYMLINK: | ||
return "SSH_FXP_SYMLINK"; | ||
case SSH_FXP_STATUS: | ||
return "SSH_FXP_STATUS"; | ||
case SSH_FXP_HANDLE: | ||
return "SSH_FXP_HANDLE"; | ||
case SSH_FXP_DATA: | ||
return "SSH_FXP_DATA"; | ||
case SSH_FXP_NAME: | ||
return "SSH_FXP_NAME"; | ||
case SSH_FXP_ATTRS: | ||
return "SSH_FXP_ATTRS"; | ||
case SSH_FXP_EXTENDED: | ||
return "SSH_FXP_EXTENDED"; | ||
case SSH_FXP_EXTENDED_REPLY: | ||
return "SSH_FXP_EXTENDED_REPLY"; | ||
} | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package ch.ethz.ssh2.sftp; | ||
|
||
/* | ||
* Copyright (c) 2002-2011 David Kocher. All rights reserved. | ||
* | ||
* http://cyberduck.ch/ | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* Bug fixes, suggestions and comments should be sent to: | ||
* dkocher@cyberduck.ch | ||
*/ | ||
|
||
/** | ||
* @version $Id:$ | ||
*/ | ||
public interface PacketListener { | ||
void read(String packet); | ||
|
||
void write(String packet); | ||
} |
Oops, something went wrong.