summaryrefslogtreecommitdiffstats
path: root/python-ethtool/etherinfo.h
Commit message (Collapse)AuthorAgeFilesLines
* cleanup: Rename etherinfo_py and ethtool_etherinfo_TypeDavid Sommerseth2014-01-091-4/+4
| | | | | | | | | Use PyEtherInfo and PyEtherInfoType the base names, to more easily see their relation, and more clearly indicate they are Python objects. Also remove an initialisation of PyEtherInfo/etherinfo_py not needed any more. Signed-off-by: David Sommerseth <davids@redhat.com>
* Merge struct etherinfo and etherinfo_pyDavid Sommerseth2013-12-201-1/+0
| | | | | | | | | | | | | Make things more "pythonic" and avoid another layer of wrapping by removing the struct etherinfo. Move that information to the main Python object instead. This simplifies the object creation and handling too, as now all strings are python objects. Also update some of the documentation blocks along the way. Signed-off-by: David Sommerseth <davids@redhat.com>
* Get rid of the internal IP address listsDavid Sommerseth2013-12-201-1/+1
| | | | | | | | With the new structure, these pointers are of no use. Kick them out. The result of this is that get_etherinfo_address() now returns a Python object which contains a list of IP address objects. Signed-off-by: David Sommerseth <davids@redhat.com>
* Clean-up get_etherinfo() and move it to get_etherinfo_address()David Sommerseth2013-12-201-2/+2
| | | | | | | This follows the previous commit. Just cleaning up and making things a bit more clearer. Signed-off-by: David Sommerseth <davids@redhat.com>
* Split out the link info from get_etherinfo()David Sommerseth2013-12-201-0/+1
| | | | | | | This is a needed step for the next move, where we'll query the interfaces for IP address at as late as possible. Signed-off-by: David Sommerseth <davids@redhat.com>
* Reduce the NETLINK pointer complexityDavid Sommerseth2013-12-171-3/+4
| | | | | | | | | | | | Make the NETLINK connection pointer and user counter local global variables inside netlink.c only. Where NETLINK calls via libnl is required, rather use get_nlc() to get a NETLINK connection. This also prepares the next step, to get rid of the struct etherinfo_obj_data wrapper. Signed-off-by: David Sommerseth <davids@redhat.com>
* Splitting up get_etherinfo() callsDavid Sommerseth2013-12-161-1/+1
| | | | | | | Make the calls to retrieve IPv4 and IPv6 addresses individual. This is the the beginning of the rewrite of the whole etherinfo main class. Signed-off-by: David Sommerseth <davids@redhat.com>
* Rip out the old IPv6 implementation completelyDavid Sommerseth2013-09-131-3/+0
| | | | | | | The whole IPv6 support will be re-implemented using a simliar strategy as the newer IPv4 support uses. Signed-off-by: David Sommerseth <davids@redhat.com>
* Migrated from libnl-1 to libnl-3David Sommerseth2013-09-121-7/+0
| | | | | | | | This ports the current functionality from libnl-1 to libnl-3.0. At the current stage, it should be functional but more patches cleaning up the code will come. Signed-off-by: David Sommerseth <davids@redhat.com>
* Only open the NETLINK interface when neededDavid Sommerseth2011-04-111-2/+5
| | | | | | | | | Do not open a NETLINK connection when loading the module, but rahter open it when needed. In a case where multiple users needs the connection, it will be shared and only closed when the last active user is done. Signed-off-by: David Sommerseth <davids@redhat.com>
* Get rid of not needed struct wrappingDavid Sommerseth2010-08-031-1/+1
| | | | | | | | | | The struct nl_handle was wrapped inside struct _nlconnection. This is really not needed if open_netlink() and close_netlink() functions uses "pointer's pointer" (struct nl_handle **) instead. Removes also the need to declare a static struct _nlconnection, as the global nlconnection variable can now be a pointer as well. Signed-off-by: David Sommerseth <davids@redhat.com>
* Added missing copyright notifications and updated where neededDavid Sommerseth2010-08-031-1/+1
| | | | Signed-off-by: David Sommerseth <davids@redhat.com>
* Improved documentation in the codeDavid Sommerseth2010-08-021-1/+1
| | | | Signed-off-by: David Sommerseth <davids@redhat.com>
* Improved IPv6 supportDavid Sommerseth2010-07-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | As the IPv6 protocol allows a single device to have more than one IPv6 address, the previous implementation did not provide all IPv6 information. It would reject all except the last parsed IPv6 address. NOTE: This implementation will break the previous API. This change removes the ethtool.etherinfo.ipv6_address and ethtool.etherinfo.ipv6_netmask members. A new member is added, ethtool.etherinfo.ipv6_addresses (in plural). This contains a tupple list containing of ethtool.etherinfo_ipv6addr objects, one object for each configured IPv6 address on the device. These objects have the following members available: .address - The IPv6 address .netmask - The IPv6 netmask (in bit notation) .scope - A string with the IPv6 address scope Example code: import ethtool devs = ethtool.get_interfaces_info('eth0') for ip6 in devs[0].ipv6_addresses: print "[%s] %s/%i" % (ip6.scope, ip6.address, ip6.netmask) Signed-off-by: David Sommerseth <davids@redhat.com>
* Updated to fetch the interface information when the "getter" function triggersDavid Sommerseth2010-04-281-11/+9
|
* Rewritten ethtool to make use of libnl instead of accessing NETLINK directlyDavid Sommerseth2010-04-261-3/+1
|
* First cut at a python etherinfo class in C. Does nothing useful yet.David Sommerseth2009-09-041-0/+1
|
* Imported functions for retrieving ethernet device info via AF_NETLINKDavid Sommerseth2009-08-241-0/+36