GNOME Bugzilla – Bug 652713
Add support for BSD to info_get_interface_from_dev_name()
Last modified: 2013-04-11 16:36:16 UTC
Created attachment 190027 [details] [review] properly display interface names and corresponding icon on BSD Hi. Under FreeBSD and OpenBSD, interfaces are named according to their driver (e.g. bge0, ath0, em0...). There is no generic eth? naming. This patch adds support for it by differenciating dev_type and dev_name. Note that this patch is mainly from Joe Marcus Clarke from FreeBSD. Thoughts?
Review of attachment 190027 [details] [review]: Thanks for the patch, but for getting the network devices we are using libgtop, which provides an abstraction for getting the device information from different operating systems. So, this should be fixed there. In particular, you might want to take a look at http://git.gnome.org/browse/libgtop/tree/sysdeps/openbsd/netlist.c Once solved there, gnome-nettool should detect the devices properly in OpenBSD.
I am reassigning the bug to libgtop, where this belongs to.
I concur this ought to be fixed in libgtop eventually, but right now there is no existing functionality in libgtop that allows for looking at the media type. glibtop_netlist only supports one function right now, which is GLIBTOP_NETLIST_NUMBER. So adding the to be GLIBTOP_MEDIA_TYPE and associated glibtop_get_media_type() would be changing the API, is that what you intended?
(In reply to comment #3) > I concur this ought to be fixed in libgtop eventually, but right now there is > no existing functionality in libgtop that allows for looking at the media type. > glibtop_netlist only supports one function right now, which is > GLIBTOP_NETLIST_NUMBER. > > So adding the to be GLIBTOP_MEDIA_TYPE and associated glibtop_get_media_type() > would be changing the API, is that what you intended? I do not think that would be necessary any change in the API, because the only thing to expose are the device names. IMVHO, The way to get the device names is an implementation detail. For instance, take a look at the Linux implementation: http://git.gnome.org/browse/libgtop/tree/sysdeps/linux/netlist.c And considering the patch, I think it would be more or less in the same line.
I think there is some confusion. Just to clarify, getting the devices names works just fine currently. This patch adds support for getting the type of the interface, otherwise it will appear as "Unknown Interface" instead of "Ethernet Interface" ...
Right, the Linux netlist.c doesn't refer to any of the ifmedia-related functions/structs/etc. That's what's needed to get the device *type*, like Ethernet, IEEE802.11, etc. So there's no functionality like this in glibtop right now.
(In reply to comment #6) > Right, the Linux netlist.c doesn't refer to any of the ifmedia-related > functions/structs/etc. That's what's needed to get the device *type*, like > Ethernet, IEEE802.11, etc. So there's no functionality like this in glibtop > right now. Fair enough. So, we should add the functionality here, as a new function in the API.
'here' being libgtop, right? If so, Ill cook up a patch.
Created attachment 191871 [details] [review] Expand to support ifmedia(4) types as found on BSD.
Attached is the change for libgtop, minus the implementation which will follow when I pushed this. OK?
Anyone?
(In reply to comment #11) > Anyone? Hey, I copyrighted this! This is my most used comment in bugzilla reports.
It would be nice to have some comment.
Closing. This is not related to libgtop and nettool is not part of OpenBSD anymore.