21 #ifndef _THRIFT_TRANSPORT_TSSLTRANSPORT_H_
22 #define _THRIFT_TRANSPORT_TSSLTRANSPORT_H_ 1
26 #include <boost/shared_ptr.hpp>
27 #include <boost/scoped_ptr.hpp>
28 #include <thrift/transport/TTransport.h>
29 #include <thrift/transport/TVirtualTransport.h>
30 #include <thrift/transport/TBufferTransports.h>
34 namespace apache {
namespace thrift {
namespace transport {
71 boost::shared_ptr<TTransport> transport);
109 uint32_t
read(uint8_t* buf, uint32_t len);
123 void write(
const uint8_t* buf, uint32_t len);
131 virtual void flush();
156 boost::shared_ptr<sasl::TSasl>
sasl_;
169 *(
reinterpret_cast<uint32_t*
>(buf +
offset)) = htonl(x);
174 return ntohl(*(reinterpret_cast<uint32_t*>(buf + offset)));
195 const uint8_t* payload,
const uint32_t length,
bool flush =
true);
223 #endif // #ifndef _THRIFT_TRANSPORT_TSSLTRANSPORT_H_
boost::scoped_array< uint8_t > protoBuf_
Buffer to hold protocol info.
void write(const uint8_t *buf, uint32_t len)
void sendSaslMessage(const NegotiationStatus status, const uint8_t *payload, const uint32_t length, bool flush=true)
void writeLength(uint32_t length)
bool isClient_
True if this is a client.
uint32_t decodeInt(uint8_t *buf, uint32_t offset)
virtual ~TSaslTransport()
boost::shared_ptr< sasl::TSasl > sasl_
bool shouldWrap_
IF true we wrap data in encryption.
TMemoryBuffer * memBuf_
Buffer for reading and writing.
boost::shared_ptr< TTransport > transport_
Underlying transport.
static const int HEADER_LENGTH
std::string getUsername()
uint8_t offset[7 *64-sizeof(uint64_t)]
boost::shared_ptr< TTransport > getUnderlyingTransport()
static const int PAYLOAD_LENGTH_BYTES
uint32_t read(uint8_t *buf, uint32_t len)
TSaslTransport(boost::shared_ptr< TTransport > transport)
static const int MECHANISM_NAME_BYTES
void encodeInt(uint32_t x, uint8_t *buf, uint32_t offset)
uint8_t * receiveSaslMessage(NegotiationStatus *status, uint32_t *length)
virtual void handleSaslStartMessage()=0
static const int STATUS_BYTES