After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 652713 - Add support for BSD to info_get_interface_from_dev_name()
Add support for BSD to info_get_interface_from_dev_name()
Status: RESOLVED OBSOLETE
Product: libgtop
Classification: Core
Component: general
unspecified
Other OpenBSD
: Normal minor
: ---
Assigned To: libgtop maintainers
libgtop maintainers
Depends on:
Blocks:
 
 
Reported: 2011-06-16 10:50 UTC by Antoine Jacoutot
Modified: 2013-04-11 16:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
properly display interface names and corresponding icon on BSD (2.33 KB, patch)
2011-06-16 10:50 UTC, Antoine Jacoutot
needs-work Details | Review
Expand to support ifmedia(4) types as found on BSD. (1.17 KB, patch)
2011-07-13 10:08 UTC, Jasper Lievisse Adriaanse
none Details | Review

Description Antoine Jacoutot 2011-06-16 10:50:39 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?
Comment 1 Germán Poo-Caamaño 2011-07-13 07:26:03 UTC
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.
Comment 2 Germán Poo-Caamaño 2011-07-13 07:27:02 UTC
I am reassigning the bug to libgtop, where this belongs to.
Comment 3 Jasper Lievisse Adriaanse 2011-07-13 07:50:33 UTC
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?
Comment 4 Germán Poo-Caamaño 2011-07-13 08:22:26 UTC
(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.
Comment 5 Antoine Jacoutot 2011-07-13 08:24:04 UTC
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" ...
Comment 6 Jasper Lievisse Adriaanse 2011-07-13 08:34:49 UTC
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.
Comment 7 Germán Poo-Caamaño 2011-07-13 08:57:33 UTC
(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.
Comment 8 Jasper Lievisse Adriaanse 2011-07-13 08:59:43 UTC
'here' being libgtop, right? If so, Ill cook up a patch.
Comment 9 Jasper Lievisse Adriaanse 2011-07-13 10:08:53 UTC
Created attachment 191871 [details] [review]
Expand to support ifmedia(4) types as found on BSD.
Comment 10 Jasper Lievisse Adriaanse 2011-07-13 10:09:16 UTC
Attached is the change for libgtop, minus the implementation which will follow
when I pushed this. OK?
Comment 11 Jasper Lievisse Adriaanse 2011-07-30 08:57:44 UTC
Anyone?
Comment 12 Antoine Jacoutot 2011-07-30 17:51:54 UTC
(In reply to comment #11)
> Anyone?

Hey, I copyrighted this! This is my most used comment in bugzilla reports.
Comment 13 Antoine Jacoutot 2012-01-22 17:37:21 UTC
It would be nice to have some comment.
Comment 14 Antoine Jacoutot 2013-04-11 16:36:16 UTC
Closing. This is not related to libgtop and nettool is not part of OpenBSD anymore.