lokinet/llarp/handlers/null.hpp

49 lines
1.0 KiB
C++
Raw Normal View History

2018-11-29 14:12:35 +01:00
#ifndef LLARP_HANDLERS_NULL_HPP
#define LLARP_HANDLERS_NULL_HPP
2018-12-12 03:15:08 +01:00
#include <service/endpoint.hpp>
2018-11-29 14:12:35 +01:00
namespace llarp
2018-11-29 14:12:35 +01:00
{
namespace handlers
2018-11-29 14:12:35 +01:00
{
2019-04-23 18:13:22 +02:00
struct NullEndpoint final
: public llarp::service::Endpoint,
public std::enable_shared_from_this< NullEndpoint >
2018-11-29 14:12:35 +01:00
{
NullEndpoint(const std::string &name, AbstractRouter *r,
llarp::service::Context *parent)
: llarp::service::Endpoint(name, r, parent)
{
}
2018-11-29 14:12:35 +01:00
bool
HandleWriteIPPacket(const llarp_buffer_t &,
std::function< huint32_t(void) >) override
2018-11-29 14:12:35 +01:00
{
return true;
}
2019-04-23 18:13:22 +02:00
path::PathSet_ptr
GetSelf() override
{
return shared_from_this();
}
huint32_t
ObtainIPForAddr(const AlignedBuffer< 32 > &, bool) override
2018-11-29 14:12:35 +01:00
{
return {0};
}
bool
HasAddress(const AlignedBuffer< 32 > &) const override
2018-11-29 14:12:35 +01:00
{
return false;
}
};
} // namespace handlers
} // namespace llarp
2018-11-29 14:12:35 +01:00
#endif