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
|
|
|
|
2018-12-02 18:07:07 +00:00
|
|
|
namespace llarp
|
2018-11-29 13:12:35 +00:00
|
|
|
{
|
2018-12-02 18:07:07 +00:00
|
|
|
namespace handlers
|
2018-11-29 13:12:35 +00:00
|
|
|
{
|
2019-04-23 16:13:22 +00:00
|
|
|
struct NullEndpoint final
|
|
|
|
: public llarp::service::Endpoint,
|
|
|
|
public std::enable_shared_from_this< NullEndpoint >
|
2018-11-29 13:12:35 +00:00
|
|
|
{
|
2019-02-11 19:45:42 +00:00
|
|
|
NullEndpoint(const std::string &name, AbstractRouter *r,
|
2019-01-28 15:26:35 +00:00
|
|
|
llarp::service::Context *parent)
|
2019-04-24 23:27:31 +00:00
|
|
|
: llarp::service::Endpoint(name, r, parent)
|
|
|
|
{
|
|
|
|
}
|
2018-11-29 13:12:35 +00:00
|
|
|
|
2019-02-01 01:58:06 +00:00
|
|
|
bool
|
|
|
|
HandleWriteIPPacket(const llarp_buffer_t &,
|
|
|
|
std::function< huint32_t(void) >) override
|
2018-11-29 13:12:35 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2019-04-23 16:13:22 +00:00
|
|
|
path::PathSet_ptr
|
|
|
|
GetSelf() override
|
|
|
|
{
|
|
|
|
return shared_from_this();
|
|
|
|
}
|
|
|
|
|
2018-12-02 18:07:07 +00:00
|
|
|
huint32_t
|
2019-01-02 01:03:53 +00:00
|
|
|
ObtainIPForAddr(const AlignedBuffer< 32 > &, bool) override
|
2018-11-29 13:12:35 +00:00
|
|
|
{
|
|
|
|
return {0};
|
|
|
|
}
|
2018-12-02 18:07:07 +00:00
|
|
|
|
|
|
|
bool
|
2019-01-02 01:04:04 +00:00
|
|
|
HasAddress(const AlignedBuffer< 32 > &) const override
|
2018-11-29 13:12:35 +00:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
};
|
2018-12-02 18:07:07 +00:00
|
|
|
} // namespace handlers
|
|
|
|
} // namespace llarp
|
2018-11-29 13:12:35 +00:00
|
|
|
|
2018-12-10 16:26:46 +00:00
|
|
|
#endif
|