lokinet/llarp/handlers/null.hpp
Jeff Becker 2403ab8f86
ipv6
2019-06-11 12:44:05 -04:00

55 lines
1.1 KiB
C++

#ifndef LLARP_HANDLERS_NULL_HPP
#define LLARP_HANDLERS_NULL_HPP
#include <service/endpoint.hpp>
namespace llarp
{
namespace handlers
{
struct NullEndpoint final
: public llarp::service::Endpoint,
public std::enable_shared_from_this< NullEndpoint >
{
NullEndpoint(const std::string &name, AbstractRouter *r,
llarp::service::Context *parent)
: llarp::service::Endpoint(name, r, parent)
{
}
bool
HandleWriteIPPacket(const llarp_buffer_t &,
std::function< huint128_t(void) >) override
{
return true;
}
path::PathSet_ptr
GetSelf() override
{
return shared_from_this();
}
bool
SupportsV6() const override
{
return false;
}
huint128_t
ObtainIPForAddr(const AlignedBuffer< 32 > &, bool) override
{
return {0};
}
bool
HasAddress(const AlignedBuffer< 32 > &) const override
{
return false;
}
};
} // namespace handlers
} // namespace llarp
#endif