summaryrefslogtreecommitdiff
path: root/agent/interfaces.c
Commit message (Collapse)AuthorAgeFilesLines
* interfaces: Add API to find the interface index from a local addressOlivier Crête2022-07-251-0/+150
| | | | | | | This will find some interface that has the address and will not work correctly if multiple interfaces have the same address. But in any case, nothing in libnice expects that and we would need to break the API to make that work.
* interfaces: Skip special interfaces on Apple OSesOle André Vadla Ravnås2021-04-191-0/+25
| | | | Including unused utun devices.
* interfaces: Skip special interfaces on Apple OSesOle André Vadla Ravnås2021-04-201-0/+18
| | | | Including unused utun devices.
* interfaces: Accept only IPv4/IPv4 addresses using ioctl() methodOlivier Crête2021-02-251-17/+30
| | | | | | Android now spits other address types too confusing libnice. This patch is a collaborative work with Tom Gilbert <twcgilbert@gmail.com>
* interfaces: Fix small warnings on Win32Olivier Crête2021-02-161-2/+1
|
* interfaces: skip unhandled interface families earlyFabrice Bellet2020-12-141-0/+4
| | | | | | We handle interfaces of type AF_INET or AF_INET6 only, so discard other families before calling sockaddr_to_string() on them, for example PF_PACKET.
* interfaces: IPv6 addresses can have a scope and be very longOlivier Crête2020-12-071-1/+1
| | | | | | Just put a much larger buffer for this to work. Fixes #126
* Ignore interfaces in windowsAmi Perlmutter2020-08-131-0/+25
|
* interfaces: Fix code style for function declarationsNirbheek Chauhan2020-07-091-3/+6
|
* interfaces: Fix fetching of interfaces on Win32Nirbheek Chauhan2020-07-091-89/+85
| | | | | | | | | | | | | | | | | | | nice_interfaces_get_local_interfaces() was returning the hardware device names of interfaces that have been seen in the past or could be connected. It had no relation to the actual interfaces present on the device. Perhaps this worked back in the XP days, but it is returning garbage today. Use GetAdapterAddresses(), and return the adapter friendly names as the interface names. At the same time, update nice_interfaces_get_ip_for_interface() to match. Coincidentally, this also fixes UWP compatibility since GetIfTable and GetIpAddrTable are not available when targeting UWP. They are only available for desktop apps: https://docs.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getiftable https://docs.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getipaddrtable
* interfaces: Remove unused win32 codeNirbheek Chauhan2020-07-091-36/+0
|
* interfaces: Port to GetBestInterfaceEx for UWP compatNirbheek Chauhan2020-07-091-2/+15
| | | | | | | | Still prefer ipv4 addresses for backwards-compat. GetBestInterface is not allowed when targeting UWP, so use GetBestInterfaceEx. Also add some debug logging to ensure that the function is actually running correctly.
* interfaces: Add debug logging to sockaddr_to_stringNirbheek Chauhan2020-07-091-3/+14
| | | | Helps when you forgot to call WSAStartup, for instance.
* interfaces: Use the private address detector from NiceAddressOlivier Crête2020-05-061-36/+5
|
* interfaces: Use union for sockaddr/sockaddr_inOlivier Crête2020-05-061-7/+11
| | | | | This makes clang happy Fixes #100
* interfaces: fix network to host conversion for private addressesFabrice Bellet2020-03-021-4/+4
|
* interfaces: ignore only interfaces we really want to (II)Stefan Becker2020-02-281-4/+5
| | | | | | This improves commit bd4b47813844aa0e68e9074b3ac516c383ca8bab There is a second place where this fix is needed.
* interfaces: use fallback if getifaddrs failedsergey radionov2020-02-061-121/+139
| | | | fix #99
* interfaces: ignore only interfaces we really want toJakub Adam2019-07-121-0/+1
| | | | | Once an interface got ignored, ALL interfaces coming after it were dropped too.
* interfaces: allow list of ignored prefixesStefan Becker2019-06-271-19/+53
| | | | | | | | Improve on commit b4abda09c79e4ce372a3771300abf568c85c7ff5 Instead of checking one prefix, check against a list of prefixes. This allows libnice to be configured to ignore interfaces from virtual machines and containers.
* interfaces: ignore non-running interfacesStefan Becker2019-06-271-0/+13
| | | | Check for IFF_UP and IFF_RUNNING flags on the interface.
* interfaces: detect IPv6 ULA & link-local addressesStefan Becker2019-06-271-0/+10
| | | | | | | Update nice_interfaces_is_private_ip() to handle IPv6 too: - unique local address block: fc00::/7 - link-local address block: fe80::/10
* interfaces: add missing support for IGNORED_IFACE_PREFIXStefan Becker2019-06-261-0/+5
| | | | | | This fixes commit b4abda09c79e4ce372a3771300abf568c85c7ff5 Copy the implementation to the !HAVE_GETIFADDRS branch too.
* interfaces: support multiple loopbacksStefan Becker2019-06-261-4/+4
| | | | | Clone implementation from HAVE_GETIFADDRS branch to !HAVE_GETIFADDRS branch of nice_interfaces_get_local_ips()
* agent: Fix spellingJakub Adam2019-01-141-4/+4
| | | | Errors reported by lintian -EvIL -pedantic.
* interfaces: ignore predefined network interfacesFabrice Bellet2017-06-081-0/+6
| | | | | | | | | | | | Some interfaces, like the one managed by libvirtd to provide a network bridge to locally hosted virtual machines, can be completely ignored when gathering ICE candidates. The motivation for adding this possibility is that, ignoring them doesn't remove capabilities, and improves the overall speed of the connection check method, by reducing the number of pairs to be tested. This patch adds the possibility to define such interfaces in the configuration script. Differential Revision: https://phabricator.freedesktop.org/D948
* agent: Fix a utility function being defined unnecessarilyPhilip Withnall2015-04-241-28/+28
| | | | | sockaddr_to_string() is not needed on UNIX when compiling without HAVE_GETIFADDRS. This fixes a compiler warning in that case.
* agent: Add a missing cast when compiling without HAVE_GETIFADDRSPhilip Withnall2015-04-241-1/+1
|
* agent: Move utility function outside #ifdefPhilip Withnall2015-04-241-5/+5
| | | | | This fixes compilation when HAVE_GETIFADDRS is not define. Reported on the mailing list by Curieux Tres <trescurieux@yahoo.fr>.
* Remove duplicate ips from nice_interfacesYouness Alaoui2015-01-301-6/+23
| | | | | | | | | | | | | | OpenVPN creates a tun interface having the same IP assigned twice like: 9: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc ...100 link/none inet 10.222.111.10 peer 10.222.111.9/32 brd 10.222.111.10 scope global tun0 valid_lft forever preferred_lft forever inet 10.222.111.10/32 brd 10.222.111.10 scope global tun0 valid_lft forever preferred_lft forever This interface would generate two identical host candidates with the same value of foundation.
* interfaces: Add missing bracketsOlivier Crête2014-07-121-2/+3
|
* agent: Fix an old-style function definition in the Windows codePhilip Withnall2014-07-071-1/+1
|
* agent: Switch to GetAdapterAddresses() to find local IPs on WindowsPhilip Withnall2014-07-071-50/+104
| | | | | | The old GetIpAddrTable() function only returned IPv4 addresses. In order to support IPv6 addresses, we need to use GetAdapterAddresses(), which is available from Windows XP or Server 2003 onwards.
* agent: Use getnameinfo() instead of inet_ntop() to stringify addressesPhilip Withnall2014-07-071-23/+17
| | | | | | | | | | | | | inet_ntop() drops IPv6 link-local scope IDs on the floor, which means libnice doesn’t generate any IPv6 candidates for link-local connections, meaning that it will theoretically fail to negotiate a connection on an IPv6-only network where the two peers are local. Fix that by using getnameinfo() to convert sockaddrs to strings, which preserves the scope ID. There are no portability concerns — getnameinfo() is POSIX.1-2001, and isn’t used on Windows (although it is supported, surprisingly).
* agent: Add a missing precondition assertionPhilip Withnall2014-07-071-0/+1
| | | | Spotted by Tartan.
* interfaces: License was meant to be the same as the restOlivier Crête2014-07-071-12/+29
|
* agent: Remove unused #includePhilip Withnall2014-03-061-1/+0
| | | | | | net/if_arp.h doesn’t exist on OS X, and hence causes cross-compilation to fail. It doesn’t appear to be needed for any of the functions currently used in interfaces.c anyway.
* agent: Avoid calling nice_address_to_string() when debugging is disabledOlivier Crête2014-01-311-1/+1
|
* Fix strict aliasing of sockaddr structuresPhilip Withnall2013-12-181-18/+30
| | | | | | | | | | | | Casting from one struct sockaddr type to another breaks C’s strict aliasing rules (variables of different types cannot alias). Fix this cleanly by using unions of struct sockaddrs to convert between the types (i.e. type-punning). I wish sockaddr didn’t have to be this painful. See: http://gcc.gnu.org/onlinedocs/gcc-4.4.1/gcc/Optimize-Options.html#Type_002dpunning
* Changes windows specific headers to lower caseSiraj Razick2011-12-191-1/+1
| | | | This helps us when cross compiling libnice for Windows from Linux
* Add support for windows's compilation through MinGWNader Morshed2011-11-301-3/+21
|
* Fix support for solarisApostolos Syropoulos2011-09-071-0/+4
|
* Use IN6_IS_ADDR_LINKLOCAL in a more portable wayTimothy Redaelli2011-03-311-1/+1
|
* Remove unnessesary changesMarcus Lundblad2010-12-141-0/+1
|
* Removed unused variableMarcus Lundblad2010-12-141-1/+0
|
* Remaining changes for RFC 5766Marcus Lundblad2010-12-141-1/+1
|
* remove unused variableYouness Alaoui2010-09-281-1/+0
|
* interfaces: With IPV6, we can have more than one loopback addressOlivier Crête2010-06-271-4/+4
|
* interfaces: Also return IPv6 addressesOlivier Crête2010-06-271-25/+50
|
* Fix build on FreeBSD.Alexis Ballier2010-03-181-0/+1
| | | | POSIX (http://www.opengroup.org/onlinepubs/009695399/basedefs/netinet/in.h.html) specifies that sockaddr_in is defined in netinet/in.h. Include the header where this struct is used.