New feature * Replace network device entry box with combobox * Get list of detected network interfaces * Populate new combobox with list of detected network interfaces * Allow for a network device to still be entered manually, so old functionality retained * Platform specific code can be easily added; so far only Linux implemented
(In reply to comment #0) > * Get list of detected network interfaces > * Platform specific code can be easily added; so far only Linux implemented It's possible to look into libgtop: http://git.gnome.org/browse/libgtop/tree/sysdeps (/*/netlist.c) - Linux: http://git.gnome.org/browse/libgtop/tree/sysdeps/linux/netlist.c - FreeBSD: http://git.gnome.org/browse/libgtop/tree/sysdeps/freebsd/netlist.c Under Linux the list of devices is available through different means. Libgtop looks into /proc/net/dev, but it doesn't tell if the devices are up or not. (It's possible to look into /sys/class/net/<DEVICE>/operstate for that (the sysfs is officially available since Linux 2.6).) Under FreeBSD the devices are fetched with builtin functionnality <net/if.h>. This is POSIX and therefore works cross-platform. http://pwet.fr/man/linux/conventions/posix/if_h Code can be copied from the libgtop project, there is netlist (list of devices) and netload (state of devices, up or down, bytes exchanged, etc). (In reply to comment #0) > * Replace network device entry box with combobox > * Populate new combobox with list of detected network interfaces > * Allow for a network device to still be entered manually, so old > functionality retained The GtkComboBoxEntry widget is done for that.
(In reply to comment #1) > Under Linux the list of devices is available through different means. > Libgtop looks into /proc/net/dev, but it doesn't tell if the devices are up > or not. (It's possible to look into /sys/class/net/<DEVICE>/operstate for > that (the sysfs is officially available since Linux 2.6).) I'm using a socket-based approach which - I'm not sure here though - should be compatible with FreeBsd and possibly even other platforms that implement it? Unsure whether it is POSIX compliant though. Good thing about this approach is it returns a list of network interfaces which are up (loopback included.) > > The GtkComboBoxEntry widget is done for that. GtkComboBoxEntry seems to have been deprecated (see here: http://developer.gnome.org/gtk/2.24/GtkComboBoxEntry.html#GtkComboBoxEntry-struct And so is the approach I'd initially used so I've just now migrated the code to use GtkComboBoxEntry instead. However, it seems to have been deprecated too but I can't find the right replacement for it. It now works nicely though and, unlike my first attempt, integrates nicely with the current GTK theme. Also, new feature now added: * work right out of the box upon adding plugin. Find first available network interface if one hasn't been specified. Reverts to first loopback device found (if one exists) if no network interfaces are available. https://bugzilla.xfce.org/show_bug.cgi?id=7431 * in addition, the fact that the plugin only presents a list of available (as in up) network interfaces seems to also address the bug report found here: https://bugzilla.xfce.org/show_bug.cgi?id=3362 However this will only work if a network device hasn't been specified, which means the plugin will find the first up interface available. Might be nice to implement code to check whether specified interface is up and, if not, revert to finding first available network? Or possibly add an option to allow plugin to behave in this way? New improved patch can be found here: http://paste.ubuntu.com/1085987/ (I've not been having luck lately attaching patches to bugzilla after the report has been created but will still try now)
Apologies! I meant https://bugzilla.xfce.org/show_bug.cgi?id=3880 instead of https://bugzilla.xfce.org/show_bug.cgi?id=7431 above.
Also, forgot to mention that this an implementation of the original idea by Mike Massonnet here: https://bugzilla.xfce.org/show_bug.cgi?id=9076#c4
-- GitLab Migration Automatic Message -- This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/panel-plugins/xfce4-netload-plugin/-/issues/4. Please create an account or use an existing account on one of our supported OAuth providers. If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev