lokinet/llarp/router/i_outbound_message_handler.hpp
Thomas Winget 7caa87862e standardize include format and pragma once
All #ifndef guards on headers have been removed, I think,
in favor of #pragma once

Headers are now included as `#include "filename"` if the included file
resides in the same directory as the file including it, or any
subdirectory therein.  Otherwise they are included as
`#include <project/top/dir/relative/path/filename>`

The above does not include system/os headers.
2021-03-09 19:01:41 -05:00

48 lines
923 B
C++

#pragma once
#include <llarp/util/status.hpp>
#include <cstdint>
#include <functional>
namespace llarp
{
enum class SendStatus
{
Success,
Timeout,
NoLink,
InvalidRouter,
RouterNotFound,
Congestion
};
struct ILinkMessage;
struct RouterID;
struct PathID_t;
using SendStatusHandler = std::function<void(SendStatus)>;
static const size_t MAX_PATH_QUEUE_SIZE = 100;
static const size_t MAX_OUTBOUND_QUEUE_SIZE = 1000;
static const size_t MAX_OUTBOUND_MESSAGES_PER_TICK = 500;
struct IOutboundMessageHandler
{
virtual ~IOutboundMessageHandler() = default;
virtual bool
QueueMessage(const RouterID& remote, const ILinkMessage* msg, SendStatusHandler callback) = 0;
virtual void
Tick() = 0;
virtual void
QueueRemoveEmptyPath(const PathID_t& pathid) = 0;
virtual util::StatusObject
ExtractStatus() const = 0;
};
} // namespace llarp