Move other messages

pull/650/head
Michael 5 years ago
parent 83bd9227a7
commit 8a058fcb34
No known key found for this signature in database
GPG Key ID: 2D51757B47E2434C

@ -180,9 +180,6 @@ set(LIB_SRC
messages/link_intro.cpp
messages/link_message_parser.cpp
messages/link_message.cpp
messages/path_confirm.cpp
messages/path_latency.cpp
messages/path_transfer.cpp
messages/relay.cpp
messages/relay_commit.cpp
net/address_info.cpp
@ -207,6 +204,9 @@ set(LIB_SRC
routing/handler.cpp
routing/message_parser.cpp
routing/message.cpp
routing/path_confirm.cpp
routing/path_latency.cpp
routing/path_transfer.cpp
routing/transfer_traffic.cpp
rpc/rpc.cpp
service/address.cpp

@ -1,58 +0,0 @@
#include <messages/path_latency.hpp>
#include <routing/handler.hpp>
#include <util/bencode.hpp>
namespace llarp
{
namespace routing
{
PathLatencyMessage::PathLatencyMessage()
{
}
bool
PathLatencyMessage::DecodeKey(const llarp_buffer_t& key,
llarp_buffer_t* val)
{
bool read = false;
if(!BEncodeMaybeReadDictInt("L", L, read, key, val))
return false;
if(!BEncodeMaybeReadDictInt("S", S, read, key, val))
return false;
if(!BEncodeMaybeReadDictInt("T", T, read, key, val))
return false;
return read;
}
bool
PathLatencyMessage::BEncode(llarp_buffer_t* buf) const
{
if(!bencode_start_dict(buf))
return false;
if(!BEncodeWriteDictMsgType(buf, "A", "L"))
return false;
if(L)
{
if(!BEncodeWriteDictInt("L", L, buf))
return false;
}
if(T)
{
if(!BEncodeWriteDictInt("T", T, buf))
return false;
}
if(!BEncodeWriteDictInt("S", S, buf))
return false;
return bencode_end(buf);
}
bool
PathLatencyMessage::HandleMessage(IMessageHandler* h,
AbstractRouter* r) const
{
return h && h->HandlePathLatencyMessage(*this, r);
}
} // namespace routing
} // namespace llarp

@ -1,16 +1,15 @@
#include <messages/relay_commit.hpp>
#include <crypto/crypto.hpp>
#include <messages/path_confirm.hpp>
#include <path/path_context.hpp>
#include <path/transit_hop.hpp>
#include <router/abstractrouter.hpp>
#include <routing/path_confirm.hpp>
#include <util/bencode.hpp>
#include <util/buffer.hpp>
#include <util/logger.hpp>
#include <util/logic.hpp>
#include <util/memfn.hpp>
#include <nodedb.hpp>
#include <functional>

@ -2,13 +2,13 @@
#include <exit/exit_messages.hpp>
#include <messages/discard.hpp>
#include <messages/path_latency.hpp>
#include <messages/relay_commit.hpp>
#include <path/pathbuilder.hpp>
#include <path/transit_hop.hpp>
#include <profiling.hpp>
#include <router/abstractrouter.hpp>
#include <routing/dht_message.hpp>
#include <routing/path_latency.hpp>
#include <routing/transfer_traffic.hpp>
#include <util/buffer.hpp>
#include <util/endian.hpp>

@ -4,12 +4,12 @@
#include <exit/context.hpp>
#include <exit/exit_messages.hpp>
#include <messages/discard.hpp>
#include <messages/path_latency.hpp>
#include <messages/path_transfer.hpp>
#include <messages/relay_commit.hpp>
#include <path/path_context.hpp>
#include <path/transit_hop.hpp>
#include <router/abstractrouter.hpp>
#include <routing/path_latency.hpp>
#include <routing/path_transfer.hpp>
#include <routing/handler.hpp>
#include <util/buffer.hpp>
#include <util/endian.hpp>

@ -2,11 +2,11 @@
#include <exit/exit_messages.hpp>
#include <messages/discard.hpp>
#include <messages/path_confirm.hpp>
#include <messages/path_latency.hpp>
#include <messages/path_transfer.hpp>
#include <path/path_types.hpp>
#include <routing/dht_message.hpp>
#include <routing/path_confirm.hpp>
#include <routing/path_latency.hpp>
#include <routing/path_transfer.hpp>
#include <routing/transfer_traffic.hpp>
#include <util/mem.hpp>

@ -1,4 +1,4 @@
#include <messages/path_confirm.hpp>
#include <routing/path_confirm.hpp>
#include <routing/handler.hpp>
#include <util/bencode.hpp>

@ -1 +1,58 @@
#include <messages/path_latency.hpp>
#include <routing/path_latency.hpp>
#include <routing/handler.hpp>
#include <util/bencode.hpp>
namespace llarp
{
namespace routing
{
PathLatencyMessage::PathLatencyMessage()
{
}
bool
PathLatencyMessage::DecodeKey(const llarp_buffer_t& key,
llarp_buffer_t* val)
{
bool read = false;
if(!BEncodeMaybeReadDictInt("L", L, read, key, val))
return false;
if(!BEncodeMaybeReadDictInt("S", S, read, key, val))
return false;
if(!BEncodeMaybeReadDictInt("T", T, read, key, val))
return false;
return read;
}
bool
PathLatencyMessage::BEncode(llarp_buffer_t* buf) const
{
if(!bencode_start_dict(buf))
return false;
if(!BEncodeWriteDictMsgType(buf, "A", "L"))
return false;
if(L)
{
if(!BEncodeWriteDictInt("L", L, buf))
return false;
}
if(T)
{
if(!BEncodeWriteDictInt("T", T, buf))
return false;
}
if(!BEncodeWriteDictInt("S", S, buf))
return false;
return bencode_end(buf);
}
bool
PathLatencyMessage::HandleMessage(IMessageHandler* h,
AbstractRouter* r) const
{
return h && h->HandlePathLatencyMessage(*this, r);
}
} // namespace routing
} // namespace llarp

@ -1,4 +1,4 @@
#include <messages/path_transfer.hpp>
#include <routing/path_transfer.hpp>
#include <routing/handler.hpp>
#include <util/buffer.hpp>

@ -5,11 +5,11 @@
#include <dht/messages/gotintro.hpp>
#include <dht/messages/gotrouter.hpp>
#include <dht/messages/pubintro.hpp>
#include <messages/path_transfer.hpp>
#include <nodedb.hpp>
#include <profiling.hpp>
#include <router/abstractrouter.hpp>
#include <routing/dht_message.hpp>
#include <routing/path_transfer.hpp>
#include <service/endpoint_util.hpp>
#include <service/hidden_service_address_lookup.hpp>
#include <service/outbound_context.hpp>

@ -1,8 +1,8 @@
#include <service/sendcontext.hpp>
#include <messages/path_transfer.hpp>
#include <service/endpoint.hpp>
#include <router/abstractrouter.hpp>
#include <routing/path_transfer.hpp>
#include <service/endpoint.hpp>
#include <util/logic.hpp>
namespace llarp

@ -1,11 +1,13 @@
#ifndef LLARP_SERVICE_SENDCONTEXT_HPP
#define LLARP_SERVICE_SENDCONTEXT_HPP
#include <messages/path_transfer.hpp>
#include <path/pathset.hpp>
#include <routing/path_transfer.hpp>
#include <service/intro.hpp>
#include <service/protocol.hpp>
#include <util/buffer.hpp>
#include <util/types.hpp>
#include <deque>
namespace llarp

Loading…
Cancel
Save