lokinet/llarp/handlers/null.hpp

37 lines
749 B
C++
Raw Normal View History

2018-11-29 13:12:35 +00:00
#ifndef LLARP_HANDLERS_NULL_HPP
#define LLARP_HANDLERS_NULL_HPP
2018-12-12 02:15:08 +00:00
#include <service/endpoint.hpp>
2018-11-29 13:12:35 +00:00
namespace llarp
2018-11-29 13:12:35 +00:00
{
namespace handlers
2018-11-29 13:12:35 +00:00
{
struct NullEndpoint final : public llarp::service::Endpoint
{
NullEndpoint(const std::string &name, llarp::Router *r)
: llarp::service::Endpoint(name, r){};
2018-11-29 13:12:35 +00:00
bool HandleWriteIPPacket(llarp_buffer_t,
std::function< huint32_t(void) >) override
2018-11-29 13:12:35 +00:00
{
return true;
}
huint32_t
ObtainIPForAddr(const byte_t *, bool) override
2018-11-29 13:12:35 +00:00
{
return {0};
}
bool
HasAddress(const byte_t *) const override
2018-11-29 13:12:35 +00:00
{
return false;
}
};
} // namespace handlers
} // namespace llarp
2018-11-29 13:12:35 +00:00
#endif