summaryrefslogtreecommitdiffstats
path: root/python-ethtool/etherinfo_struct.h
Commit message (Collapse)AuthorAgeFilesLines
* Only open the NETLINK interface when neededDavid Sommerseth2011-04-111-2/+4
| | | | | | | | | 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>
* RETURN_STRING() did not use Py_INCREF() when returning Py_NoneDavid Sommerseth2011-02-251-1/+1
| | | | | | | | | | | | | | | From RH BZ#680269: #define RETURN_STRING(str) (str ? PyString_FromString(str) : Py_None) This isn't incrementing the reference count on the Py_None singleton when it should be (the caller assumes that it "owns" a ref on the result of _getter, and will decref it), it could cause the python process to bail out: "Fatal Python error: deallocating None" if run repeatedly. Reported-by: Dave Malcolm <dmalcolm@redhat.com> Signed-off-by: David Sommerseth <davids@redhat.com>
* Get rid of not needed struct wrappingDavid Sommerseth2010-08-031-8/+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-0/+15
| | | | Signed-off-by: David Sommerseth <davids@redhat.com>
* Renamed etherinfo_ipv6_py to etherinfo_ipv6addr_pyDavid Sommerseth2010-08-021-1/+1
| | | | | | The new name reflects the contents of the data type better. Signed-off-by: David Sommerseth <davids@redhat.com>
* Improved documentation in the codeDavid Sommerseth2010-08-021-16/+31
| | | | Signed-off-by: David Sommerseth <davids@redhat.com>
* Improved IPv6 supportDavid Sommerseth2010-07-301-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2/+27
|
* First cut at a python etherinfo class in C. Does nothing useful yet.David Sommerseth2009-09-041-0/+23