[Qt-interest] QNetworkInterface::allInterfaces does not return interfaces without an IP address?
Jeroen De Wachter
jeroen.dewachter at barco.com
Fri Aug 7 14:18:02 CEST 2009
I meant "non-Qt code" instead of "proprietary code" earlier (LIBPONA
exceptions, References, Guard, etc.)
Just so we're clear :)
On Fri, 2009-08-07 at 14:11 +0200, Jeroen De Wachter wrote:
> Hi Frank,
>
> Thanks for your reference to libPONA.
> It does use a lot of proprietary code :)
>
> I'm probably going to copy some stuff both from your code and from the
> ip command in the iproute package (which also uses netlink) to get the
> necessary network interface information.
>
> The ip command also has some monitoring capabilities which would be nice
> to integrate.
>
> If I can find some time, I would like to contribute my stuff to Qt (I'll
> probably pop in the #qt-labs channel on IRC or bank on this mailing list
> to get some more input from you guys when I start).
> Anyway, you'll see if/when that happens.
>
> The Qt classes don't seem to have any signals for dynamic changes to the
> configuration though. Is that something coming up in a new release? Or
> could I add it when I start contributing? I guess it would be rather
> difficult to support that kind of functionality on platforms other that
> Linux though...
>
> Kind regards,
>
> Jeroen
>
> On Fri, 2009-07-31 at 22:45 +0200, Frank Mertens wrote:
> > Jeroen De Wachter wrote:
> > > Hello,
> > >
> > > I've been testing some things regarding QNetworkInterface and I've
> > > noticed that when I call QNetworkInterface::allInterfaces on a system
> > > that does not have IPv6 support, only the interfaces that are up are
> > > returned.
> > >
> > > When I enable IPv6 support in my uClibc-based toolchain (but not in the
> > > kernel), different calls are used and I do get all interfaces and all
> > > their addresses.
> > >
> > > This seems due to the way QNetworkInterface gets the interface names and
> > > interface information in qnetworkinterface_unix.cpp
> > >
> > > I still need to look further into why this happens exactly (lots of
> > > #ifdef in there), but I wanted to check if anyone else has seen this
> > > issue.
> >
> > I panicked the last time I visited those dark dungeons of Qt's internals.
> > The solution: Rewrite from scratch:
> > http://trac.cyblogic.com/libPONA/browser/pona/NetworkInterface.cpp
> > Sadly its not Qt compatible at all...
> >
> > >
> > > Also, I wanted to ask, if a Linux system is detected, why doesn't Qt use
> > > a more standardized way of doing things? ifconfig parses
> > > the /proc/dev/net file, for instance, while the ip command is using the
> > > netlink interface. (though I guess there would need to be a fallback for
> > > the netlink stuff... Qt will likely run on older kernels that don't
> > > support it.)
> >
> > No I don't think, this is the issue.
> > Netlink is around for quite some time (linux 2.2?).
> > But Qt is very brave, supporting BSD, Linux and Solaris(no sysctl) with the same code.
> > The least common denominator are likely some pre-BSB-4.4 ioctls.
> > If it runs through getifaddrs(3), probably your C-runtime is source of the problem.
> > _______________________________________________
> > Qt-interest mailing list
> > Qt-interest at trolltech.com
> > http://lists.trolltech.com/mailman/listinfo/qt-interest
> >
>
>
> DISCLAIMER:
> Unless indicated otherwise, the information contained in this message is privileged and confidential, and is intended only for the use of the addressee(s) named above and others who have been specifically authorized to receive it. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message and/or attachments is strictly prohibited. The company accepts no liability for any damage caused by any virus transmitted by this email. Furthermore, the company does not warrant a proper and complete transmission of this information, nor does it accept liability for any delays. If you have received this message in error, please contact the sender and delete the message. Thank you.
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
DISCLAIMER:
Unless indicated otherwise, the information contained in this message is privileged and confidential, and is intended only for the use of the addressee(s) named above and others who have been specifically authorized to receive it. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message and/or attachments is strictly prohibited. The company accepts no liability for any damage caused by any virus transmitted by this email. Furthermore, the company does not warrant a proper and complete transmission of this information, nor does it accept liability for any delays. If you have received this message in error, please contact the sender and delete the message. Thank you.
More information about the Qt-interest-old
mailing list