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-09-01 12:38:03 +00:00
|
|
|
#include <util/meta/memfn.hpp>
|
2019-01-05 13:45:05 +00:00
|
|
|
|
|
|
|
namespace llarp
|
|
|
|
{
|
|
|
|
namespace iwp
|
|
|
|
{
|
2019-08-22 20:53:27 +00:00
|
|
|
LinkLayer_ptr
|
|
|
|
NewInboundLink(const SecretKey& routerEncSecret, GetRCFunc getrc,
|
|
|
|
LinkMessageHandler h, SignBufferFunc sign,
|
|
|
|
SessionEstablishedHandler est,
|
|
|
|
SessionRenegotiateHandler reneg, TimeoutHandler timeout,
|
2019-11-04 18:49:08 +00:00
|
|
|
SessionClosedHandler closed, PumpDoneHandler pumpDone)
|
2019-01-05 13:45:05 +00:00
|
|
|
{
|
2019-08-22 20:53:27 +00:00
|
|
|
return std::make_shared< LinkLayer >(routerEncSecret, getrc, h, sign, est,
|
2019-11-04 18:49:08 +00:00
|
|
|
reneg, timeout, closed, pumpDone,
|
|
|
|
true);
|
2019-08-22 20:53:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
LinkLayer_ptr
|
|
|
|
NewOutboundLink(const SecretKey& routerEncSecret, GetRCFunc getrc,
|
|
|
|
LinkMessageHandler h, SignBufferFunc sign,
|
|
|
|
SessionEstablishedHandler est,
|
|
|
|
SessionRenegotiateHandler reneg, TimeoutHandler timeout,
|
2019-11-04 18:49:08 +00:00
|
|
|
SessionClosedHandler closed, PumpDoneHandler pumpDone)
|
2019-08-22 20:53:27 +00:00
|
|
|
{
|
|
|
|
return std::make_shared< LinkLayer >(routerEncSecret, getrc, h, sign, est,
|
2019-11-04 18:49:08 +00:00
|
|
|
reneg, timeout, closed, pumpDone,
|
|
|
|
false);
|
2019-01-05 13:45:05 +00:00
|
|
|
}
|
|
|
|
} // namespace iwp
|
|
|
|
} // namespace llarp
|