Start of tunnel request handling.
This commit is contained in:
13
crypto.cc
13
crypto.cc
@@ -302,11 +302,24 @@ void CryptoPubServerConnection::OnHandshake(const TLVNode& decoded) {
|
||||
|
||||
bool CryptoPubServerConnection::OnMessage(const TLVNode& message) {
|
||||
switch (message.GetType()) {
|
||||
case TLV_TYPE_TUNNEL_REQUEST:
|
||||
return OnTunnelRequest(message);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool CryptoPubServerConnection::OnTunnelRequest(const TLVNode& message) {
|
||||
Log() << "New tunnel request" << std::endl;
|
||||
for (auto child : message.GetChildren()) {
|
||||
if (child->GetType() != TLV_TYPE_CHANNEL) {
|
||||
continue;
|
||||
}
|
||||
Log() << "Channel" << std::endl;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void CryptoPubServerConnection::SendHandshake() {
|
||||
auto handshake = BuildSecureHandshake();
|
||||
std::string out;
|
||||
|
||||
1
crypto.h
1
crypto.h
@@ -80,6 +80,7 @@ class CryptoPubServerConnection : public CryptoPubConnBase {
|
||||
private:
|
||||
void OnHandshake(const TLVNode& decoded);
|
||||
bool OnMessage(const TLVNode& node);
|
||||
bool OnTunnelRequest(const TLVNode& node);
|
||||
|
||||
static void OnError_(struct bufferevent* bev, const short what, void* this__);
|
||||
void OnError(const short what);
|
||||
|
||||
5
tlv.cc
5
tlv.cc
@@ -105,3 +105,8 @@ const std::string& TLVNode::GetValue() const {
|
||||
assert(!this->IsContainer());
|
||||
return value_;
|
||||
}
|
||||
|
||||
const std::list<TLVNode*>& TLVNode::GetChildren() const {
|
||||
assert(this->IsContainer());
|
||||
return children_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user