Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Examples

RemoteProtocol Class Reference

#include <RemoteProtocol.h>

Inheritance diagram for RemoteProtocol:

ExternalProgram ExternalDataSource RloginProtocol RshProtocol SudoProtocol SuProtocol TelnetProtocol List of all members.

Public Types

enum  callStatus { RP_OK, RP_PASSWD, RP_ERROR }

Public Member Functions

 RemoteProtocol (std::string commandline, bool use_pty=false)
virtual callStatus callComponent (std::string password="", bool passwd_supplied=false)=0
virtual bool doesEcho () const=0

Protected Member Functions

int expectOneOf (const std::string *strings, int number_strings, int maxread)

Member Enumeration Documentation

enum RemoteProtocol::callStatus
 

Returns values of callComponent.

Enumeration values:
RP_OK 
RP_PASSWD 
RP_ERROR 


Constructor & Destructor Documentation

RemoteProtocol::RemoteProtocol std::string  commandline,
bool  use_pty = false
 

Initializes the remote protocol. Starts the external program like telnet, ssh, su, rsh, ...

Parameters:
string commandline parsed by the shell
use_pty,set to true, if you want to communicate over ptys instead of pipes.


Member Function Documentation

virtual callStatus RemoteProtocol::callComponent std::string  password = "",
bool  passwd_supplied = false
[pure virtual]
 

Tries to do the handshake, this is supply password, enter loginname and answer other interactive questions. Also starts the Y2 component on the other machine.

Parameters:
password A password for the login.
bool passwd_supplied This flag determines whether the password given should be used.
Returns:
RP_OK, if the remote component is now running, RP_PASSWD, if the protocol needs a login password (provide a password and try again) or RP_ERROR, if an unrecoverable error occured.

Implemented in RloginProtocol, RshProtocol, SudoProtocol, SuProtocol, and TelnetProtocol.

virtual bool RemoteProtocol::doesEcho  )  const [pure virtual]
 

Determines, whether output to the protocol program (telnet, rsh, ...) is echoed.

Implemented in RloginProtocol, RshProtocol, SudoProtocol, SuProtocol, and TelnetProtocol.

int RemoteProtocol::expectOneOf const std::string *  strings,
int  number_strings,
int  maxread
[protected]
 

Reads from the input (i.e. output of the login program) characters until one of a list of given strings will match the tail of the read characters.

Parameters:
strings an array of strings to wait for.
number_strings size of this array.
maxread the number of characters that should be read before we give it up
Returns:
index of the string that has been read. -1 if we gave up, i.e. no matching string has been found within maxread characters or if no further characters could be read.


The documentation for this class was generated from the following files:
Generated on Fri Nov 9 18:15:24 2007 for yast2-core by doxygen 1.3.6