From 6d332e5ca4a7311406ac285f827c31c9e5b94280 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 23 Mar 2017 15:40:28 -0700 Subject: mpm: move public includes into include/ --- mpm/lib/net_helper.hpp | 69 -------------------------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 mpm/lib/net_helper.hpp (limited to 'mpm/lib/net_helper.hpp') diff --git a/mpm/lib/net_helper.hpp b/mpm/lib/net_helper.hpp deleted file mode 100644 index b07e43ccc..000000000 --- a/mpm/lib/net_helper.hpp +++ /dev/null @@ -1,69 +0,0 @@ -// -// Copyright 2017 Ettus Research (National Instruments) -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// - -#include -#include -#include - -namespace mpm { -namespace network { - -/*! - * A struct describing a single network interface - */ -using net_iface = struct net_iface { - /*! MAC address of the interface in the form AABBCCDDEEFF */ - std::string mac_addr; - /*! vector of associated IP addresses, contains both IPv4 and IPv6 */ - std::vector ip_addr; -}; - -/*! - * net_ifaces contains a pair - * describing mac address and associated ip addresses for - * each interface - */ -using net_ifaces = std::map; - -/*! - * Convenience function to get all ip addresses of one MAC address - * \param MAC address in the form AABBCCDDEEFF - * \return vector of strings containing all IP addresses with this MAC address - */ -std::vector get_if_addrs(const std::string& mac_addr); - -/*! - * Get information about all interfaces on this system - * \return a map with interface names as keys and the interfaces information as value - */ -net_ifaces get_net_map(); - -/*! - * Pretty print net_ifaces in the style of `ip addr` - * \param interface map net_ifaces to print - */ -void print_net_ifaces(net_ifaces my_ifaces); -} -} - -#ifdef LIBMPM_PYTHON -void export_net_iface(){ - LIBMPM_BOOST_PREAMBLE("network") - bp::def("get_if_addrs", &mpm::network::get_if_addrs); -} -#endif - -- cgit v1.2.3