diff options
Diffstat (limited to 'mmss/iface.cpp')
-rw-r--r-- | mmss/iface.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mmss/iface.cpp b/mmss/iface.cpp index 31befbb..a7a174e 100644 --- a/mmss/iface.cpp +++ b/mmss/iface.cpp @@ -34,13 +34,13 @@ namespace MMSS { -void add_iface(const std::shared_ptr<node_t> &node, const std::shared_ptr<network_t> &net, const std::string &name, const gmrf_addr_t *address) { - std::shared_ptr<iface_t> iface = std::make_shared<iface_t>(node.get(), net.get(), name, address); - - node->interfaces.push_back(iface); - net->interfaces.push_back(iface); +std::shared_ptr<iface_t> iface_t::add(const std::shared_ptr<node_t> &node, const std::shared_ptr<network_t> &net, const std::string &name, const gmrf_addr_t *address) { + std::shared_ptr<iface_t> iface = std::shared_ptr<iface_t>(new iface_t(node.get(), net.get(), name, address)); + net->add_iface(iface); node->add_iface(iface); + + return iface; } } |