3 #ifndef GCP_UTIL_SSHTUNNEL_H
4 #define GCP_UTIL_SSHTUNNEL_H
15 #include "gcp/util/common/Runnable.h"
51 SshTunnel(std::string gateway, std::string host,
unsigned short port,
52 unsigned timeOutInSeconds=0);
54 SshTunnel(std::string gateway, std::string host,
unsigned short port,
unsigned short hostPort,
55 unsigned timeOutInSeconds=0);
59 SshTunnel(std::string host,
unsigned short port,
60 unsigned timeOutInSeconds=0);
62 SshTunnel(std::string host,
unsigned short port,
unsigned short hostPort,
63 unsigned timeOutInSeconds=0);
83 unsigned short hostPort_;
84 std::ostringstream error_;
90 void initialize(std::string gateway, std::string host,
unsigned short port,
unsigned short hostPort,
91 unsigned timeOutInSeconds=0);
93 void blockUntilSuccessOrTimeOut(
unsigned timeOutInSeconds);
95 void parseStdOutMsg(
int fd, std::ostringstream& os,
bool& connected,
bool& stop);
96 void parseStdErrMsg(
int fd, std::ostringstream& os,
bool& connected,
bool& stop);
105 #endif // End #ifndef GCP_UTIL_SSHTUNNEL_H
friend std::ostream & operator<<(std::ostream &os, SshTunnel &obj)
Definition: SshTunnel.h:40
SshTunnel(std::string gateway, std::string host, unsigned short port, unsigned timeOutInSeconds=0)
Definition: SshTunnel.cc:21
bool succeeded()
Definition: SshTunnel.cc:257
virtual ~SshTunnel()
Definition: SshTunnel.cc:246