lokinet/llarp/iwp/iwp.cpp

43 lines
1.3 KiB
C++
Raw Normal View History

2019-03-29 15:17:49 +00:00
#include <iwp/iwp.hpp>
#include <iwp/linklayer.hpp>
2019-02-18 19:44:41 +00:00
#include <router/abstractrouter.hpp>
2019-01-05 13:45:05 +00:00
namespace llarp
{
namespace iwp
{
std::unique_ptr< ILinkLayer >
2019-02-18 19:44:41 +00:00
NewServerFromRouter(AbstractRouter* r)
2019-01-05 13:45:05 +00:00
{
2019-02-18 19:44:41 +00:00
using namespace std::placeholders;
return NewServer(
r->crypto(), r->encryption(), std::bind(&AbstractRouter::rc, r),
std::bind(&AbstractRouter::HandleRecvLinkMessageBuffer, r, _1, _2),
std::bind(&AbstractRouter::OnSessionEstablished, r, _1),
std::bind(&AbstractRouter::CheckRenegotiateValid, r, _1, _2),
std::bind(&AbstractRouter::Sign, r, _1, _2),
std::bind(&AbstractRouter::OnConnectTimeout, r, _1),
std::bind(&AbstractRouter::SessionClosed, r, _1));
2019-01-05 13:45:05 +00:00
}
2019-01-05 13:45:05 +00:00
std::unique_ptr< ILinkLayer >
2019-02-18 19:44:41 +00:00
NewServer(Crypto* c, const SecretKey& enckey, GetRCFunc getrc,
LinkMessageHandler h, SessionEstablishedHandler est,
SessionRenegotiateHandler reneg, SignBufferFunc sign,
TimeoutHandler t, SessionClosedHandler closed)
2019-01-05 13:45:05 +00:00
{
2019-02-19 13:32:26 +00:00
(void)c;
(void)enckey;
(void)getrc;
(void)h;
(void)est;
(void)reneg;
(void)sign;
(void)t;
(void)closed;
// TODO: implement me
return nullptr;
2019-01-05 13:45:05 +00:00
}
} // namespace iwp
} // namespace llarp