mirror of https://github.com/oxen-io/lokinet
more pybind bindings
This commit is contained in:
parent
f712acc486
commit
831e80f498
|
@ -5,7 +5,9 @@ set(LLARP_PYBIND_SRC
|
|||
module.cpp
|
||||
llarp/context.cpp
|
||||
llarp/router_contact.cpp
|
||||
llarp/crypto/types.cpp)
|
||||
llarp/crypto/types.cpp
|
||||
llarp/tooling/router_hive.cpp
|
||||
)
|
||||
|
||||
pybind11_add_module(pyllarp MODULE ${LLARP_PYBIND_SRC})
|
||||
target_include_directories(pyllarp PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/crypto/libntrup/include ${CMAKE_SOURCE_DIR}/llarp ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
|
|
@ -14,9 +14,10 @@ namespace llarp
|
|||
void
|
||||
RouterContact_Init(py::module &mod);
|
||||
|
||||
namespace simulate
|
||||
{
|
||||
void
|
||||
SimContext_Init(py::module &mod);
|
||||
}
|
||||
} // namespace llarp
|
||||
|
||||
namespace tooling
|
||||
{
|
||||
void
|
||||
RouterHive_Init(py::module & mod);
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
#include "common.hpp"
|
||||
#include <tooling/router_hive.hpp>
|
||||
|
||||
namespace tooling
|
||||
{
|
||||
void
|
||||
RouterHive_Init(py::module& mod)
|
||||
{
|
||||
using RouterHive_ptr = std::shared_ptr< RouterHive >;
|
||||
py::class_< RouterHive, RouterHive_ptr >(mod, "RouterHive")
|
||||
.def(py::init<>())
|
||||
.def("StartAll", &RouterHive::StartRouters)
|
||||
.def("StopAll", &RouterHive::StopRouters);
|
||||
|
||||
}
|
||||
}
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
PYBIND11_MODULE(pyllarp, m)
|
||||
{
|
||||
llarp::simulate::SimContext_Init(m);
|
||||
tooling::RouterHive_Init(m);
|
||||
llarp::RouterContact_Init(m);
|
||||
llarp::CryptoTypes_Init(m);
|
||||
llarp::Context_Init(m);
|
||||
|
|
Loading…
Reference in New Issue