summaryrefslogtreecommitdiffstats
path: root/setup.py
Commit message (Collapse)AuthorAgeFilesLines
* Releasing v0.10v0.10David Sommerseth2014-01-101-1/+1
| | | | | | | | This is more like a test release, to get these last changes out in the field. And it will help debugging issues later on too, if there are some issues with this rewrite. Signed-off-by: David Sommerseth <davids@redhat.com>
* Split out generic NETLINK functions from etherinfo.c to netlink.cDavid Sommerseth2013-12-101-0/+1
| | | | | | Primarily just to clean up the code Signed-off-by: David Sommerseth <davids@redhat.com>
* Rip out the old IPv6 implementation completelyDavid Sommerseth2013-09-131-1/+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-2/+3
| | | | | | | | 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>
* bump version to 0.8David Malcolm2013-02-191-1/+1
|
* Support devices with multiple IPv4 addressesDavid Malcolm2013-01-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a get_ipv4_addresses() method to ethtool.etherinfo to support devices with multiple IPv4 addresses (rhbz#759150) Previously, get_etherinfo() made queries to NETLINK with NLQRY_ADDR, and callback_nl_address handled responses of family AF_INET (IPv4) by writing to fields within a struct etherinfo. If multiple AF_INET responses come back, each overwrote the last, and the last one won. This patch generalizes things by moving the relevant fields: char *ipv4_address; /**< Configured IPv4 address */ int ipv4_netmask; /**< Configured IPv4 netmask */ char *ipv4_broadcast; from (struct etherinfo) into a new Python class, currently named PyNetlinkIPv4Address. This object has a sane repr(): >>> ethtool.get_interfaces_info('eth1')[0].get_ipv4_addresses() [ethtool.NetlinkIPv4Address(address='192.168.1.10', netmask=24, broadcast='192.168.1.255')] and attributes: >>> print [iface.address for iface in ethtool.get_interfaces_info('eth1')[0].get_ipv4_addresses()] ['192.168.1.10'] >>> print [iface.netmask for iface in ethtool.get_interfaces_info('eth1')[0].get_ipv4_addresses()] [24] >>> print [iface.broadcast for iface in ethtool.get_interfaces_info('eth1')[0].get_ipv4_addresses()] ['192.168.1.255'] The (struct etherinfo) then gains a new field: PyObject *ipv4_addresses; /**< list of PyNetlinkIPv4Address instances */ which is created before starting the query, and populated by the callback as responses come in. All direct usage of the old fields (which assumed a single IPv4 address) are changed to use the last entry in the list (if any), to mimic the old behavior. dump_etherinfo() and _ethtool_etherinfo_str() are changed to loop over all of the IPv4 addresses when outputting, rather than just outputting one. Caveats: * the exact terminology is probably incorrect: I'm not a networking specialist * the relationship between each of devices, get_interfaces_info() results, and addresses seems both unclear and messy to me: how changable is the API? >>> ethtool.get_interfaces_info('eth1')[0].get_ipv4_addresses() [ethtool.NetlinkIPv4Address(address='192.168.1.10', netmask=24, broadcast='192.168.1.255')] It seems that an etherinfo object relates to a device: perhaps it should be named as such? But it may be too late to make this change. Notes: The _ethtool_etherinfo_members array within python-ethtool/etherinfo_obj.c was broken: it defined 4 attributes of type PyObject*, to be extracted from etherinfo_py->data, which is of a completed different type. If these PyMemberDef fields were ever used, Python would segfault. Thankfully _ethtool_etherinfo_getter() has handlers for these attributes, and gets called first. This is a modified version of the patch applied downstream in RHEL 6.4 within python-ethtool-0.6-3.el6: python-ethtool-0.6-add-get_ipv4_addresses-method.patch ported to take account of 508ffffbb3c48eeeb11eeab2bf971180fe4e1940
* remove redundant material from setup.pyDavid Malcolm2013-01-151-4/+0
| | | | | | | | | Commit d3fd6b84f461a4d7ffbf3f3eae37381150b69e82 introduced an ext_modules keyword argument to the setup invocation in setup.py, making the exttool = Extension(...) code at the top of setup.py redundant. Remove the redundant code.
* Only open the NETLINK interface when neededDavid Sommerseth2011-04-111-3/+3
| | | | | | | | | 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>
* Added ethtool.version string constantDavid Sommerseth2011-01-191-2/+5
| | | | | | This is useful to identify the python-ethtool version at runtime. Signed-off-by: David Sommerseth <davids@redhat.com>
* import sys moduleMiroslav Suchy2010-09-291-0/+1
| | | | | | | it is later used when calling sys.exit() Signed-off-by: Miroslav Suchy <miroslav@suchy.cz> Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
* Improved IPv6 supportDavid Sommerseth2010-07-301-1/+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>
* Rewritten ethtool to make use of libnl instead of accessing NETLINK directlyDavid Sommerseth2010-04-261-1/+53
|
* First cut at a python etherinfo class in C. Does nothing useful yet.David Sommerseth2009-09-041-1/+2
|
* Added new function: get_ipaddresses() - retrieves IPv4 and IPv6 addresses ↵David Sommerseth2009-08-241-1/+1
| | | | for all devices
* setup: fix version field, we're at 0.2Arnaldo Carvalho de Melo2008-06-301-1/+1
| | | | Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
* [PYTHON-ETHTOOL]: Create repositoryArnaldo Carvalho de Melo2007-12-181-0/+15
From code in fedora's rhpl. Code indented, offload methods (tso, etc) added. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>