summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* pifethtool: Show IPv6 address information when availableDave Malcolm2011-07-061-3/+9
| | | | Signed-off-by: David Sommerseth <davids@redhat.com>
* Make pifconfig respect interface arguments from the command lineDavid Sommerseth2011-06-212-24/+18
| | | | | | | | pifconfig did not pay attention to any arguments give on the command line, which should only list selected devices. This patch revamps the argument parsing, to behave as described in usage and man page. Signed-off-by: David Sommerseth <davids@redhat.com>
* Package man pages in the RPMDavid Sommerseth2011-04-132-3/+18
| | | | | | | The spec file slipped the man page addition commit, so the man pages was not packaged into the RPM itself. Signed-off-by: David Sommerseth <davids@redhat.com>
* Force O_CLOEXEC on the NETLINK socketv0.7David Sommerseth2011-04-121-0/+8
| | | | | | | | | | | To avoid that the NETLINK socket is available to forked children, set the FD_CLOEXEC flag on the NETLINK socket. This also avoids SELinux from complaining on Fedora 14. For more information: https://bugzilla.redhat.com/show_bug.cgi?id=689843 Signed-off-by: David Sommerseth <davids@redhat.com>
* Added man pages for pethtool and pifconfigMiroslav Suchý2011-04-112-0/+123
| | | | Signed-off-by: David Sommerseth <davids@redhat.com>
* Only open the NETLINK interface when neededDavid Sommerseth2011-04-116-75/+118
| | | | | | | | | 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>
* Fixed several memory leaksDavid Sommerseth2011-04-113-10/+22
| | | | | | | | | | | Several places python-ethtool leaked memory, mostly due to missing Py_DECREF() calls on objects being put in to python lists (via PyList_Append() calls). This revealed an issue in addition where the IPv6 addresses pointers in some cases could freed more times. This is fixed as well. Signed-off-by: David Sommerseth <davids@redhat.com>
* Fixed typo in pethtool --help screenDavid Sommerseth2011-03-301-1/+1
| | | | Signed-off-by: David Sommerseth <davids@redhat.com>
* Improved error situations in case of NULL returnsDavid Sommerseth2011-02-251-0/+23
| | | | | | | | _ethtool_etherinfo_get_ipv6_addresses() didn't check too well several Python calls if it would return NULL. Reported-by: Dave Malcolm <dmalcolm@redhat.com> 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>
* Version bump - python-ethtool v0.6v0.6David Sommerseth2011-01-191-1/+8
| | | | Signed-off-by: David Sommerseth <davids@redhat.com>
* Avoid duplicating IPv6 address informationDavid Sommerseth2011-01-191-0/+8
| | | | | | | | | In commit c52ed2cbdc5b851ebc7bc19d7c682b14a4a16ba4 a free_ipv6addresses() call was removed, which lead to duplicated IPv6 address information in some cases. Re-add this freeing, to be sure we don't add existing information to an already existing pointer chain. Signed-off-by: David Sommerseth <davids@redhat.com>
* Added ethtool.version string constantDavid Sommerseth2011-01-192-2/+6
| | | | | | This is useful to identify the python-ethtool version at runtime. Signed-off-by: David Sommerseth <davids@redhat.com>
* Remove errornous file from MANIFESTDavid Sommerseth2010-12-211-1/+0
| | | | | | | There has never really existed a file called python-ethtool/etherinfo_ipv6_obj.h Signed-off-by: David Sommerseth <davids@redhat.com>
* Don't segfault if we don't receive any address from rtnl_link_get_addr()David Sommerseth2010-12-211-1/+1
| | | | | | | The callback function for device link information was lacking a simple check to avoid a SEGV in these situations. 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>
* Version bump - v0.5v0.5David Sommerseth2010-08-091-1/+4
| | | | Signed-off-by: David Sommerseth <davids@redhat.com>
* Python reference counter was not properly set for etherinfo_ipv6addr objectsDavid Sommerseth2010-08-092-5/+4
| | | | | | | | | This caused a double free situation, when Python tried to free the object if the etherinfo::get_ipv6_addresses() method was called several times. In addition the ethtool::get_interfaces_info() would also free the structures uses by etherinfo_ipv6addr objects. Signed-off-by: David Sommerseth <davids@redhat.com>
* Corrected a few spelling mistakesv0.4David Sommerseth2010-08-031-1/+1
| | | | | | Makes rpmlint happy. Signed-off-by: David Sommerseth <davids@redhat.com>
* Preparing for a python-ethtool-0.4 releaseDavid Sommerseth2010-08-031-6/+9
| | | | | | | | | - David Sommerseth is now taking over the maintenance of python-ethtool - New URLs for upstream source code - Added new API: ethtool.get_interfaces_info() - returns list of etherinfo objects - Added support retrieving for IPv6 address, using etherinfo::get_ipv6_addresses() Signed-off-by: David Sommerseth <davids@redhat.com>
* Get rid of not needed struct wrappingDavid Sommerseth2010-08-034-32/+25
| | | | | | | | | | 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>
* Don't append newline when etherinfo_ipv6addr objects are used as stringsDavid Sommerseth2010-08-031-1/+1
| | | | Signed-off-by: David Sommerseth <davids@redhat.com>
* Moved etherinfo::ipv6_addresses to etherinfo::get_ipv6_addresses()David Sommerseth2010-08-031-29/+46
| | | | | | | This is more appropriate as it is not a static list of IPv6 address objects which are returned. Signed-off-by: David Sommerseth <davids@redhat.com>
* Added missing copyright notifications and updated where neededDavid Sommerseth2010-08-037-3/+65
| | | | Signed-off-by: David Sommerseth <davids@redhat.com>
* Renamed etherinfo_ipv6_py to etherinfo_ipv6addr_pyDavid Sommerseth2010-08-022-13/+13
| | | | | | 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-024-25/+94
| | | | Signed-off-by: David Sommerseth <davids@redhat.com>
* Updated MANIFEST to include new needed source filesDavid Sommerseth2010-07-301-0/+2
| | | | Signed-off-by: David Sommerseth <davids@redhat.com>
* Improved IPv6 supportDavid Sommerseth2010-07-307-39/+350
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fixed a bug - IPv4 address quering tried to query NLQRY_LINK instead of ↵David Sommerseth2010-05-311-1/+1
| | | | NLQRY_ADDR
* Renamed get_interface_info() to get_interfaces_info() and updated help stringDavid Sommerseth2010-05-041-3/+5
| | | | | This is to make it a bit clearer that the result type of this function always will be a list of ethtool.etherinfo objects.
* Clean up - avoid static variables in etherinfo_obj.hDavid Sommerseth2010-04-283-79/+80
|
* Updated MANIFEST with the extra files neededDavid Sommerseth2010-04-281-0/+5
|
* Updated .spec file with BuildRequires libnl-develDavid Sommerseth2010-04-281-2/+5
|
* Updated to fetch the interface information when the "getter" function triggersDavid Sommerseth2010-04-286-137/+222
|
* Rewritten ethtool to make use of libnl instead of accessing NETLINK directlyDavid Sommerseth2010-04-264-434/+186
|
* Added parameter to get_interface_inf()David Sommerseth2009-09-161-2/+66
| | | | | | | | | | It can handle a string with a device name or a list or a tuple list with more devices. dev = ethtool.get_interface_info(['lo','eth0','pan0']) dev = ethtool.get_interface_info(('eth0','virbr0')) dev = ethtool.get_interface_info('lo') dev = ethtool.get_interface_info()
* Removed the previous "attempt" of IPv6 support, get_ipaddresses()David Sommerseth2009-09-071-34/+0
|
* Changed the RETURN_STRING() macro to return None instead of False, to make ↵David Sommerseth2009-09-071-3/+3
| | | | it more Pythonish
* Make Python dir() function work with ethtool.etherinfo objectsDavid Sommerseth2009-09-071-2/+1
|
* Completed implementing the new Python get_interface_info() function.David Sommerseth2009-09-073-17/+124
| | | | | | | | | | | | | | | | | | It will return a list of Python etherinfo objects. These objects have the following properties: .device - Device name .mac_address - Hardware address .ipv4_address .ipv4_netmask .ipv4_broadcast .ipv6_address .ipv6_netmask In addition, it will produce a human readable output if these objects are treated as strings. It will not be possible to modify any of the properties in these objects.
* First cut at a python etherinfo class in C. Does nothing useful yet.David Sommerseth2009-09-046-4/+264
|
* Even more clean up. Improved more error messagesDavid Sommerseth2009-08-241-15/+32
|
* Fixed typos, more clean upDavid Sommerseth2009-08-241-6/+7
|
* Give some creditDavid Sommerseth2009-08-241-0/+1
|
* Improved error handling, clean upDavid Sommerseth2009-08-241-7/+14
|
* Added new function: get_ipaddresses() - retrieves IPv4 and IPv6 addresses ↵David Sommerseth2009-08-242-2/+40
| | | | for all devices
* Imported functions for retrieving ethernet device info via AF_NETLINKDavid Sommerseth2009-08-242-0/+539
|
* ethtool: Older kernels don't have IFF_DYNAMICArnaldo Carvalho de Melo2009-05-281-0/+4
| | | | Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
* rpm: Rewrote build and install sections as part of the fedora review processArnaldo Carvalho de Melo2008-09-051-5/+9
| | | | Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
* pifconfig: Add python ifconfig equivalent to test featuresv0.3Arnaldo Carvalho de Melo2008-08-263-1/+107
| | | | | | A la pethtool Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>