/*
** SellaNMS
** $Id: ssh.h,v 1.2 2005/05/21 23:10:28 sella Exp $
** Copyright (c) 2001-2005 Digital Genesis Software, LLC. All Rights Reserved.
** Released under the GPL Version 2 License.
** http://www.digitalgenesis.com
*/

#ifndef	__SSH_H__
#define	__SSH_H__

#ifdef HAVE_CONFIG_H
	#include "config.h"
#endif

#include "defaults.h"
#include <regex.h>
#include <stl/list>
#include <stl/slist>
#include <stl/string>

using namespace std;

class SSH {
	public:
		SSH();
		~SSH();

		bool connect(string hostname, string username, string password, string prompt);	
		bool disconnect();

		bool sendCommand(string const &command);
		bool sendCommand(string const &command, list<string> &result);

	protected:
		bool getReply(string &reply);
		bool getReply(list<string> &reply);

		bool recieve(string &value);
		bool transmit(string &value);

	private:
		int	ptty;

		regex_t	authRegex;
		regex_t	passwordRegex;
		regex_t	yesnoRegex;
		regex_t	shellRegex;
};

#endif

/*
** Local Variables:
** c-basic-offset: 3
** tab-width: 3
** End:
** vim600: fdm=marker
** vim: noet ts=3 sw=3
*/
