From ed97d29c970e948d65b21ca9f94c7cf9c6a64296 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Mon, 1 Mar 2021 08:39:50 -0500 Subject: [PATCH] fix up pyllarp parts * expose paths config in pyllarp * fix up pyllarp unit tests --- pybind/llarp/config.cpp | 5 +++++ test/hive/hive.py | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/pybind/llarp/config.cpp b/pybind/llarp/config.cpp index 782d164fa..188760b77 100644 --- a/pybind/llarp/config.cpp +++ b/pybind/llarp/config.cpp @@ -25,6 +25,7 @@ namespace llarp .def_readwrite("lokid", &Config::lokid) .def_readwrite("bootstrap", &Config::bootstrap) .def_readwrite("logging", &Config::logging) + .def_readwrite("paths", &Config::paths) .def("Load", &Config::Load); py::class_(mod, "RouterConfig") @@ -47,6 +48,10 @@ namespace llarp .def_readwrite("numNetThreads", &RouterConfig::m_numNetThreads) .def_readwrite("JobQueueSize", &RouterConfig::m_JobQueueSize); + py::class_(mod, "PeerSelectionConfig") + .def(py::init<>()) + .def_readwrite("netmask", &PeerSelectionConfig::m_UniqueHopsNetmaskSize); + py::class_(mod, "NetworkConfig") .def(py::init<>()) .def_readwrite("enableProfiling", &NetworkConfig::m_enableProfiling) diff --git a/test/hive/hive.py b/test/hive/hive.py index 92095834f..50babcb04 100644 --- a/test/hive/hive.py +++ b/test/hive/hive.py @@ -68,8 +68,8 @@ class RouterHive(object): config.network.enableProfiling = False config.network.endpointType = 'null' - config.links.addInboundLink("lo", AF_INET, port); - config.links.setOutboundLink("lo", AF_INET, port + 10000); + config.links.addInboundLink("lo", AF_INET, port) + config.links.setOutboundLink("lo", AF_INET, 0) # config.dns.options = {"local-dns": ("127.3.2.1:%d" % port)} if index == 0: @@ -90,9 +90,9 @@ class RouterHive(object): config = pyllarp.Config(dirname) config.Load(None, False); - port = index + 50000 tunname = "lokihive%d" % index + config.paths.netmask = 0 config.router.dataDir = dirname config.router.netid = self.netid config.router.blockBogons = False @@ -100,7 +100,7 @@ class RouterHive(object): config.network.enableProfiling = False config.network.endpointType = 'null' - config.links.setOutboundLink("lo", AF_INET, port + 10000); + config.links.setOutboundLink("lo", AF_INET, 0); # config.dns.options = {"local-dns": ("127.3.2.1:%d" % port)}