2019-03-29 15:17:49 +00:00
|
|
|
#include <iwp/iwp.hpp>
|
|
|
|
#include <iwp/linklayer.hpp>
|
2019-12-03 17:58:53 +00:00
|
|
|
#include <memory>
|
2019-02-18 19:44:41 +00:00
|
|
|
#include <router/abstractrouter.hpp>
|
2019-01-05 13:45:05 +00:00
|
|
|
|
|
|
|
namespace llarp
|
|
|
|
{
|
|
|
|
namespace iwp
|
|
|
|
{
|
2019-08-22 20:53:27 +00:00
|
|
|
LinkLayer_ptr
|
2020-04-07 18:38:56 +00:00
|
|
|
NewInboundLink(
|
|
|
|
std::shared_ptr<KeyManager> keyManager,
|
|
|
|
GetRCFunc getrc,
|
|
|
|
LinkMessageHandler h,
|
|
|
|
SignBufferFunc sign,
|
2020-09-01 21:22:22 +00:00
|
|
|
BeforeConnectFunc_t before,
|
2020-04-07 18:38:56 +00:00
|
|
|
SessionEstablishedHandler est,
|
|
|
|
SessionRenegotiateHandler reneg,
|
|
|
|
TimeoutHandler timeout,
|
|
|
|
SessionClosedHandler closed,
|
2020-06-11 11:44:02 +00:00
|
|
|
PumpDoneHandler pumpDone,
|
|
|
|
WorkerFunc_t work)
|
2019-01-05 13:45:05 +00:00
|
|
|
{
|
2020-04-07 18:38:56 +00:00
|
|
|
return std::make_shared<LinkLayer>(
|
2020-09-01 21:22:22 +00:00
|
|
|
keyManager, getrc, h, sign, before, est, reneg, timeout, closed, pumpDone, work, true);
|
2019-08-22 20:53:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
LinkLayer_ptr
|
2020-04-07 18:38:56 +00:00
|
|
|
NewOutboundLink(
|
|
|
|
std::shared_ptr<KeyManager> keyManager,
|
|
|
|
GetRCFunc getrc,
|
|
|
|
LinkMessageHandler h,
|
|
|
|
SignBufferFunc sign,
|
2020-09-01 21:22:22 +00:00
|
|
|
BeforeConnectFunc_t before,
|
2020-04-07 18:38:56 +00:00
|
|
|
SessionEstablishedHandler est,
|
|
|
|
SessionRenegotiateHandler reneg,
|
|
|
|
TimeoutHandler timeout,
|
|
|
|
SessionClosedHandler closed,
|
2020-06-11 11:44:02 +00:00
|
|
|
PumpDoneHandler pumpDone,
|
|
|
|
WorkerFunc_t work)
|
2019-08-22 20:53:27 +00:00
|
|
|
{
|
2020-04-07 18:38:56 +00:00
|
|
|
return std::make_shared<LinkLayer>(
|
2020-09-01 21:22:22 +00:00
|
|
|
keyManager, getrc, h, sign, before, est, reneg, timeout, closed, pumpDone, work, false);
|
2019-01-05 13:45:05 +00:00
|
|
|
}
|
|
|
|
} // namespace iwp
|
|
|
|
} // namespace llarp
|