diff options
Diffstat (limited to 'mmss/mmss.cpp')
-rw-r--r-- | mmss/mmss.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/mmss/mmss.cpp b/mmss/mmss.cpp index 8b94c20..62f818d 100644 --- a/mmss/mmss.cpp +++ b/mmss/mmss.cpp @@ -25,6 +25,7 @@ #include "mmss.hpp" +#include "node.hpp" #include <algorithm> #include <cassert> @@ -33,12 +34,6 @@ namespace MMSS { -static void init_nodes(std::list<std::shared_ptr<node_t>> &nodes) { - for (auto node : nodes) - node->ctx = node->proto->init(node.get()); -} - - void main(int argc, char *argv[]) { if (argc != 2) { std::fprintf(stderr, "usage: %s protocol_module\n", argv[0]); @@ -60,9 +55,9 @@ void main(int argc, char *argv[]) { net0->mtu = 1500; net1->mtu = 1500; - std::shared_ptr<node_t> node1 = std::make_shared<node_t>(&mmss, "node1", 1, proto); - std::shared_ptr<node_t> node2 = std::make_shared<node_t>(&mmss, "node2", 2, proto); - std::shared_ptr<node_t> node3 = std::make_shared<node_t>(&mmss, "node3", 3, proto); + std::shared_ptr<node_t> node1 = node_t::create(&mmss, "node1", 1, proto); + std::shared_ptr<node_t> node2 = node_t::create(&mmss, "node2", 2, proto); + std::shared_ptr<node_t> node3 = node_t::create(&mmss, "node3", 3, proto); std::list<std::shared_ptr<node_t>> nodes; @@ -70,8 +65,6 @@ void main(int argc, char *argv[]) { nodes.push_back(node2); nodes.push_back(node3); - init_nodes(nodes); - gmrf_addr_t addr1 = {{1}}, addr2 = {{2}}, addr3 = {{3}}, addr4 = {{4}}; add_iface(node1, net0, "mmss0", &addr1); add_iface(node2, net0, "mmss0", &addr2); |