Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef GNASH_SSH_SERVER_H
00020 #define GNASH_SSH_SERVER_H
00021
00022 #include <string>
00023 #include <boost/array.hpp>
00024 #include <boost/shared_ptr.hpp>
00025 #include <boost/shared_array.hpp>
00026 #include <boost/scoped_array.hpp>
00027 #include <boost/cstdint.hpp>
00028 #include <sstream>
00029
00030 extern "C" {
00031 #include <libssh/libssh.h>
00032 #include <libssh/sftp.h>
00033 #include <libssh/server.h>
00034 }
00035
00036 #include "sshclient.h"
00037 #include "cque.h"
00038 #include "network.h"
00039 #include "buffer.h"
00040
00041 namespace gnash
00042 {
00043
00044 extern const char *ROOTPATH;
00045 extern const char *HOST;
00046 extern const char *CA_LIST;
00047 extern const char *RANDOM;
00048 extern const char *KEYFILE;
00049 extern const size_t SSH_PASSWD_SIZE;
00050
00051 class DSOEXPORT SSHServer : public SSHClient {
00052 public:
00053 typedef enum {NO_AUTHTYPE, DSS, RSA} authtype_t;
00054 typedef enum {NO_TRANSPORT, RAW, SFTP} transport_type_t;
00055
00056 SSHServer();
00057 ~SSHServer();
00058
00059
00060 bool authPassword(std::string &user, std::string &passwd);
00061 bool authPassword(ssh_session session, std::string &user, std::string &passwd);
00062
00063
00064 bool acceptConnections();
00065 bool acceptConnections(short port);
00066 bool acceptConnections(ssh_session session);
00067 bool acceptConnections(ssh_session session, short port);
00068
00069
00070 bool processSSHMessage(ssh_message message);
00071
00072 void dump();
00073 protected:
00074
00075 ssh_message getSSHMessage();
00076 ssh_message getSSHMessage(ssh_session session);
00077
00078 ssh_session _session;
00079 ssh_message _message;
00080 };
00081
00082 }
00083
00084
00085 #endif
00086
00087
00088
00089
00090