[libnice] nice_interfaces_get_local_ips() returns nothing on Windows

Philip Withnall philip at tecnocode.co.uk
Sun Jan 3 16:22:20 PST 2016


Hey,

Sorry for the slow reply; December was busy for me.

That debug output localises the problem a little (it’s either a problem
with getnameinfo() on Windows, or the output from the
GetAdaptersAddresses() function), but I need some more information to
be able to know exactly what’s going on.

Would you be able to add a breakpoint on the ‘Failed to convert address
to string’ debug message using your IDE, and print out the values of
the following local variables?
 • addresses (including all its elements)
 • addresses_size
 • a (including all its fields)
 • unicast (including all its fields)
 • unicast->Address.lpSockaddr (especially)

If it’s not possible to do that with your IDE (for some reason), let me
know and I can prepare a patch to expose it all via g_debug() calls.

Thanks,
Philip

On Fri, 2015-12-04 at 19:54 +0100, Adrien Carbonne wrote:
> Hello,
> 
> I would be glad to help!
> 
> I compiled using MSVC (Visual C++ 2010 Express).
> 
> Here is what I get when debug messages are enabled:
> 
> > ** (test.exe:9672): DEBUG: Using stun server
> > '[stun.l.google.com]:19302'
> > 
> > ** (test.exe:9672): DEBUG: Created NiceStream (1 created, 0
> > destroyed)
> > ** (test.exe:9672): DEBUG: Created NiceComponent (1 created, 0
> > destroyed)
> > ** (test.exe:9672): DEBUG: Agent 00AA9010 : allocating stream id 1
> > (00AB31C0)
> > ** (test.exe:9672): DEBUG: Agent 00AA9010 : In ICE-FULL mode,
> > starting candidate gathering.
> > ** (test.exe:9672): DEBUG: Agent 00AA9010 : libnice compiled
> > without UPnP support
> > ** (test.exe:9672): DEBUG: Queried addresses with status 0.
> > ** (test.exe:9672): DEBUG: Interface ‘Connexion au r\xe9seau
> > local’:
> > ** (test.exe:9672): DEBUG: Rejecting interface due to being down or
> > read-only.
> > ** (test.exe:9672): DEBUG: Interface ‘Connexion au r\xe9seau local*
> > 4’:
> > ** (test.exe:9672): DEBUG: Rejecting interface due to being down or
> > read-only.
> > ** (test.exe:9672): DEBUG: Interface ‘Ethernet’:
> > ** (test.exe:9672): DEBUG: Failed to convert address to string for
> > interface ‘Ethernet’.
> > ** (test.exe:9672): DEBUG: Failed to convert address to string for
> > interface ‘Ethernet’.
> > ** (test.exe:9672): DEBUG: Interface ‘Ethernet 2’:
> > ** (test.exe:9672): DEBUG: Failed to convert address to string for
> > interface ‘Ethernet 2’.
> > ** (test.exe:9672): DEBUG: Failed to convert address to string for
> > interface ‘Ethernet 2’.
> > ** (test.exe:9672): DEBUG: Interface ‘Connexion r\xe9seau sans
> > fil’:
> > ** (test.exe:9672): DEBUG: Failed to convert address to string for
> > interface ‘Connexion r\xe9seau sans fil’.
> > ** (test.exe:9672): DEBUG: Failed to convert address to string for
> > interface ‘Connexion r\xe9seau sans fil’.
> > ** (test.exe:9672): DEBUG: Interface ‘Loopback Pseudo-Interface 1’:
> > ** (test.exe:9672): DEBUG: Rejecting loopback interface ‘Loopback
> > Pseudo-Interface 1’.
> > ** (test.exe:9672): DEBUG: Interface ‘isatap.{C66F6F69-5A07-481B-
> > 88C6-963A69AC1202}’:
> > ** (test.exe:9672): DEBUG: Rejecting interface due to being down or
> > read-only.
> > ** (test.exe:9672): DEBUG: Interface ‘isatap.{F44E089F-E5CC-43A2-
> > BD76-A07FEB4FBD13}’:
> > ** (test.exe:9672): DEBUG: Rejecting interface due to being down or
> > read-only.
> > ** (test.exe:9672): DEBUG: Interface ‘isatap.{D581D457-EF0D-443D-
> > A62C-2867E5225AFE}’:
> > ** (test.exe:9672): DEBUG: Rejecting interface due to being down or
> > read-only.
> > ** (test.exe:9672): DEBUG: Interface ‘isatap.{4F7EEF12-75C9-4DE7-
> > A263-48898503A707}’:
> > ** (test.exe:9672): DEBUG: Rejecting interface due to being down or
> > read-only.
> > ** (test.exe:9672): DEBUG: Interface ‘isatap.{59A0B365-4F00-45E7-
> > 8B96-3DEF08201D36}’:
> > ** (test.exe:9672): DEBUG: Rejecting interface due to being down or
> > read-only.
> > ** (test.exe:9672): DEBUG: Agent 00AA9010: Candidate gathering
> > FINISHED, no scheduled items.
> > ** (test.exe:9672): DEBUG: SIGNAL candidate gathering done
> > 
> > ** (test.exe:9672): DEBUG: waiting for candidate-gathering-done
> > signal...
> 
> This interface is my Wi-Fi connection to Internet:
> 
> > ** (test.exe:9672): DEBUG: Interface ‘Connexion r\xe9seau sans
> > fil’:
> > ** (test.exe:9672): DEBUG: Failed to convert address to string for
> > interface ‘Connexion r\xe9seau sans fil’.
> > ** (test.exe:9672): DEBUG: Failed to convert address to string for
> > interface ‘Connexion r\xe9seau sans fil’.
> Does this debug message help you? 
> 
> Thank you very much for your help,
> Adrien
> 
> On Fri, Dec 4, 2015 at 1:01 AM, Philip Withnall <philip at tecnocode.co.
> uk> wrote:
> > Hi,
> > 
> > On Wed, 2015-12-02 at 14:53 +0100, Adrien Carbonne wrote:
> > > Hello,
> > >
> > > I have compiled libnice on Windows but I cannot get *any* example
> > to
> > > work.
> > 
> > How did you compile it? MinGW, or MSVC?
> > 
> > > I have tried to debug it, and I found out that one issue is that
> > > nice_interfaces_get_local_ips() returns nothing on Windows.
> > 
> > If you enable all debugging output (G_MESSAGES_DEBUG=all
> > NICE_DEBUG=all
> > in the environment), do you get debug messages like “Error
> > retrieving
> > local addresses (error code XX).”?
> > 
> > For debugging to work, you must also have configured libnice
> > //without// NDEBUG defined. The normal libnice.vcproj file //does//
> > define NDEBUG, so make sure you unconfigure that.
> > 
> > > Here is a sample program : it should display some candidates but
> > gets
> > > no candidates (and no local addresses for that matter).
> > >
> > >
> > > int main() {
> > >       context = g_main_context_new ();
> > >       loop = g_main_loop_new ( context , FALSE );
> > >       NiceAgent *agent = nice_agent_new ( context ,
> > > NICE_COMPATIBILITY_RFC5245 );
> > >
> > >       g_signal_connect (G_OBJECT (agent), "candidate-gathering-
> > done",
> > > G_CALLBACK (candidate_gathering_done_cb), NULL);
> > >       g_signal_connect (G_OBJECT (agent), "component-state-
> > changed",
> > > G_CALLBACK (component_state_changed_cb), NULL);
> > >       g_signal_connect (G_OBJECT (agent), "new-candidate-full",
> > > G_CALLBACK (new_candidate_full_cb), NULL);
> > >
> > >       guint stream_id = nice_agent_add_stream ( agent , 1);
> > >       nice_agent_attach_recv ( agent , stream_id , 1 , context ,
> > > cb_nice_recv , NULL );
> > >       nice_agent_gather_candidates ( agent , stream_id );
> > >
> > >       g_main_loop_run ( loop );
> > > }
> > >
> > > Is it a Windows-specific issue?
> > 
> > Most likely, since the code for nice_interfaces_get_local_ips() is
> > highly platform specific.
> > 
> > > Do I have to stop dreaming about running libnice on Windows? ;)
> > 
> > Sorry, I don’t have regular access to a Windows machine to test
> > libnice
> > on. All help is welcome!
> > 
> > Philip
> > _______________________________________________
> > nice mailing list
> > nice at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/nice
> > 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 213 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/nice/attachments/20160104/296b200c/attachment.sig>


More information about the nice mailing list