diff --git a/llarp/handlers/null.hpp b/llarp/handlers/null.hpp index fde860543..b038cbdfc 100644 --- a/llarp/handlers/null.hpp +++ b/llarp/handlers/null.hpp @@ -47,6 +47,7 @@ namespace llarp service::ProtocolType t, uint64_t seqno) override { + LogTrace("Inbound ", t, " packet (", buf.sz, "B) on convo ", tag); if (t == service::ProtocolType::Control) { MarkConvoTagActive(tag); diff --git a/llarp/handlers/tun.cpp b/llarp/handlers/tun.cpp index f8811bdff..9bac4b927 100644 --- a/llarp/handlers/tun.cpp +++ b/llarp/handlers/tun.cpp @@ -984,6 +984,7 @@ namespace llarp service::ProtocolType t, uint64_t seqno) { + LogTrace("Inbound ", t, " packet (", buf.sz, "B) on convo ", tag); if (t == service::ProtocolType::QUIC) { auto* quic = GetQUICTunnel(); diff --git a/llarp/service/protocol.cpp b/llarp/service/protocol.cpp index f7543a3c8..b815d7e2e 100644 --- a/llarp/service/protocol.cpp +++ b/llarp/service/protocol.cpp @@ -12,6 +12,17 @@ namespace llarp { namespace service { + std::ostream& operator<<(std::ostream& o, ProtocolType t) { + return o << + (t == ProtocolType::Control ? "Control" : + t == ProtocolType::TrafficV4 ? "TrafficV4" : + t == ProtocolType::TrafficV6 ? "TrafficV6" : + t == ProtocolType::Exit ? "Exit" : + t == ProtocolType::Auth ? "Auth" : + t == ProtocolType::QUIC ? "QUIC" : + "(unknown-protocol-type)"); + } + ProtocolMessage::ProtocolMessage() { tag.Zero(); diff --git a/llarp/service/protocol.hpp b/llarp/service/protocol.hpp index 623e2afa7..ab4dfd5f6 100644 --- a/llarp/service/protocol.hpp +++ b/llarp/service/protocol.hpp @@ -31,6 +31,8 @@ namespace llarp constexpr std::size_t MAX_PROTOCOL_MESSAGE_SIZE = 2048 * 2; + std::ostream& operator<<(std::ostream& o, ProtocolType t); + /// inner message struct ProtocolMessage {