You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lokinet/llarp/router/i_outbound_message_handler.hpp

44 lines
817 B
C++

#ifndef LLARP_ROUTER_I_OUTBOUND_MESSAGE_HANDLER_HPP
#define LLARP_ROUTER_I_OUTBOUND_MESSAGE_HANDLER_HPP
#include <cstdint>
#include <functional>
namespace llarp
{
enum class SendStatus
{
Success,
Timeout,
NoLink,
InvalidRouter,
RouterNotFound,
Congestion
};
struct ILinkMessage;
struct RouterID;
namespace util
{
struct StatusObject;
}
using SendStatusHandler = std::function< void(SendStatus) >;
struct IOutboundMessageHandler
{
virtual ~IOutboundMessageHandler() = default;
virtual bool
QueueMessage(const RouterID &remote, const ILinkMessage *msg,
SendStatusHandler callback) = 0;
virtual util::StatusObject
ExtractStatus() const = 0;
};
} // namespace llarp
#endif // LLARP_ROUTER_I_OUTBOUND_MESSAGE_HANDLER_HPP