2021-03-09 22:24:35 +00:00
|
|
|
#include "iwp.hpp"
|
|
|
|
#include "linklayer.hpp"
|
2019-12-03 17:58:53 +00:00
|
|
|
#include <memory>
|
2021-03-09 22:24:35 +00:00
|
|
|
#include <llarp/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,
|
2021-02-22 13:26:32 +00:00
|
|
|
std::shared_ptr<EventLoop> loop,
|
2020-04-07 18:38:56 +00:00
|
|
|
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>(
|
2021-02-22 13:26:32 +00:00
|
|
|
keyManager,
|
|
|
|
loop,
|
|
|
|
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,
|
2021-02-22 13:26:32 +00:00
|
|
|
std::shared_ptr<EventLoop> loop,
|
2020-04-07 18:38:56 +00:00
|
|
|
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>(
|
2021-02-22 13:26:32 +00:00
|
|
|
keyManager,
|
|
|
|
loop,
|
|
|
|
getrc,
|
|
|
|
h,
|
|
|
|
sign,
|
|
|
|
before,
|
|
|
|
est,
|
|
|
|
reneg,
|
|
|
|
timeout,
|
|
|
|
closed,
|
|
|
|
pumpDone,
|
|
|
|
work,
|
|
|
|
false);
|
2019-01-05 13:45:05 +00:00
|
|
|
}
|
|
|
|
} // namespace iwp
|
|
|
|
} // namespace llarp
|