• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • Examples
  • File List
  • File Members

sshserver.h

Go to the documentation of this file.
00001 // 
00002 //   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
00003 // 
00004 // This program is free software; you can redistribute it and/or modify
00005 // it under the terms of the GNU General Public License as published by
00006 // the Free Software Foundation; either version 3 of the License, or
00007 // (at your option) any later version.
00008 // 
00009 // This program is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU General Public License for more details.
00013 // 
00014 // You should have received a copy of the GNU General Public License
00015 // along with this program; if not, write to the Free Software
00016 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
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     // Authenticate the password from the user
00060     bool authPassword(std::string &user, std::string &passwd);
00061     bool authPassword(ssh_session session, std::string &user, std::string &passwd);
00062 
00063     // Wait for an incoming network connection
00064     bool acceptConnections();
00065     bool acceptConnections(short port);
00066     bool acceptConnections(ssh_session session);
00067     bool acceptConnections(ssh_session session, short port);
00068 
00069     // Parse an SSH command message and do something
00070     bool processSSHMessage(ssh_message message);
00071 
00072     void dump();
00073  protected:
00074     // Get the SSH command message
00075     ssh_message getSSHMessage();
00076     ssh_message getSSHMessage(ssh_session session);
00077 
00078     ssh_session _session;       // the current session
00079     ssh_message _message;       // the current SSH command message
00080 };
00081     
00082 } // end of gnash namespace
00083 
00084 // end of GNASH_SSH_SERVER_H
00085 #endif 
00086 
00087 // local Variables:
00088 // mode: C++
00089 // indent-tabs-mode: t
00090 // End:

Generated on Fri Mar 16 2012 15:46:12 for Gnash by  doxygen 1.7.1