Commit Graph

59 Commits

Author SHA1 Message Date
arvidn faa807c0f3 fix travis build 2020-04-10 00:26:15 +02:00
Arvid Norberg e9a30a34f2 make sure attempting to bind to an unknown device fails (on MacOS/BSD) 2020-03-31 05:05:55 -07:00
arvidn 1e4083b3fb rely less on the ability to enumerate the routing table reliably. Any IP address
explicitly specified is assumed to represent an externally available IP, unless
marked with the l-flag. If a device name or an unspecified address is used, they
are expanded and only for such expanded entries is there a heuristic to
determine which addresses are externally available and which are local. The
default is to assume it's local only, unless it has a globally routable IP
address or a default route can be found for the device.
2020-03-03 11:43:52 +01:00
arvidn 208d71ba77 support source-hint from routing table, where supported 2020-01-22 15:50:33 +01:00
arvidn 7529d3e67e remove now unused, in_local_network() functions 2020-01-20 14:27:16 +01:00
arvidn f5ebd4e354 simplify natpmp by requiring it to be tied to a specific network, and use get_gateway() and remove unused get_default_route() functions 2020-01-20 01:24:22 +01:00
arvidn a53d3a8746 factor out get_gateway function and add unit tests. IPv6 gateways are not addressed in the same network, so we can't use match_addr_mask(). Assume all local IPv6 addresses do not have a gateway 2020-01-19 08:27:33 +01:00
arvidn 96695fa714 fix build_netmask to treat the count as a prefix and add tests 2020-01-06 20:23:13 +01:00
arvidn 3569b8885e fix null termination of description and friendly_name in ip_interface on linux 2020-01-05 18:38:04 +01:00
Arvid Norberg b90564d418 remove the IPv6 enable/disable build config 2018-08-19 22:20:54 +02:00
Arvid Norberg a477a53b80 simplify natpmp gateway and local address discovery 2018-07-29 13:10:36 +02:00
Steven Siloti 78be52112f create a natpmp instance for each listen socket 2018-06-07 18:16:08 -07:00
arvidn 534276e7a5 refactor to use the utility function for bind_socket_to_device() instead of using the bind_to_device socket option directly, to make it best effort. include operation enum in udp_error alert. 2018-05-23 12:11:04 +02:00
arvidn f0227451a6 merged RC_1_1 into master 2018-04-13 01:47:41 +02:00
arvidn aaf9304a3b update year in copyright header 2018-04-09 09:04:33 +02:00
Alden Torres 421709f67f added friendly_name and description to ip_interface (#2799) 2018-02-19 11:46:35 +01:00
arvidn e126d7bce0 move socket_type into aux-namespace 2018-01-29 08:33:45 +01:00
Alden Torres 98ade28237 using make_address instead of deprecated from_string when boost>=1.66 (#2659)
using make_address instead of deprecated from_string when boost>=1.66
2018-01-04 04:48:22 -05:00
Alden Torres 66734e2e5b using if_indextoname instead of RTM_GETLINK to fill the interface name in enum_net_interfaces (#2253)
using if_indextoname instead of RTM_GETLINK to fill the interface name in enum_net_interfaces. removed IFA_LABEL switch case, removed ip_interface::mtu, master rebase
2017-08-20 10:55:59 +02:00
Alden Torres bde4718e3f typos, auto loop refactor and more std:: 2017-08-16 07:01:50 +02:00
Steven Siloti 67a530f3ab only listen on preferred IPv6 addresses on Windows
We shouldn't listen on addresses which are duplicates, deprecated,
or tenative unless explicitly requested.

This is only supported on Windows for now because the Linux interface
to get this information is much less convenient for libtorrent to use.
As far as I've been able to determine, Linux only exposes this information
via the RTM_NEWADDR and RTM_GETADDR netlink messages. Currently libtorrent
uses getifaddrs() to enumerate network interfaces on Linux so this will
probably need to be changed to use netlink if available.

MacOS: ???
2017-05-30 07:38:12 -04:00
arvidn 480bde9333 change formatting of namespace declarations 2017-04-12 14:26:35 -04:00
arvidn 1dd0e9b280 use string_view instead of strcmp 2017-03-18 15:54:38 -04:00
arvidn 173951ec7f merged RC_1_1 into master 2017-01-21 02:28:29 -05:00
arvidn 3b9c65daf1 remove unused function, has_interface() 2017-01-16 15:14:47 -05:00
Alden Torres c3d9614dfb minor code refactor and cleanup 2017-01-14 06:59:44 -05:00
Alden Torres f382936d56 headers, end of file, code cleanup 2016-12-12 23:36:45 -05:00
Alden Torres d9f8d4b642 refactor to more use of auto c++11 keyword (#1404)
refactor to more use of auto c++11 keyword
2016-12-11 20:50:30 -05:00
Alden Torres 86251adb1b more fixes of integral type conversion warnings 2016-11-21 20:22:18 -05:00
Alden Torres 0507764d04 consts and refactor, hash_address returns the hash (#1093)
consts and refactor
2016-09-15 21:13:43 -04:00
arvidn 72a24b63ba use bind_to_device for listen sockets 2016-02-12 15:46:18 -05:00
arvidn e113e8cdf3 minor cleanup of listen sockets 2016-01-31 19:40:31 -05:00
arvidn 1f9f588e75 merge copyright year update and changelog from RC_1_0 2016-01-17 18:57:46 -05:00
arvidn 729a8e9152 update libsimulator. add simulation/test for announcing twice to trackers over IPv4 and IPv6. fix bugs preventing libtorrent from doing that correctly 2015-10-27 00:21:07 -04:00
arvidn 3cc464805f update libsimulator submodule 2015-10-25 10:55:20 -04:00
arvidn 4fa0aa62da simulate IP routes, interfaces and page size when building in simulation mode 2015-08-09 15:01:01 -04:00
Arvid Norberg d43f7b56a2 update copyright year 2015-06-03 05:18:48 +00:00
Arvid Norberg f9c9d0ad0d merge small unit tests to make running the tests quicker. expand the test framework a bit. add ax_boost_random.m4 script to link against boost.random correctly from makefile. 2015-05-30 04:31:23 +00:00
Arvid Norberg 9ee98b3ed1 fix build warnings 2015-05-18 05:04:55 +00:00
Arvid Norberg 3951377d95 fix include paths for warning push and pop headers 2015-04-21 01:16:28 +00:00
Arvid Norberg 408232cfc8 raise warning level. fix a few of them. filter out warnings from boost 2015-04-18 02:33:39 +00:00
Arvid Norberg 7351389ce8 land libtorrent_aio branch in trunk 2014-07-06 19:18:00 +00:00
Arvid Norberg a943fec777 update copyright 2014-02-23 19:12:25 +00:00
Arvid Norberg 4e6b1cfbfb update copyright 2013-12-25 17:07:16 +00:00
Arvid Norberg bbe62564ad low level network primitives should not be exported. Moved enum_if into tests (since it uses internal functions) 2013-07-20 01:02:15 +00:00
Arvid Norberg bff648a89e update copyright dates and add tool to do so 2012-10-02 03:16:33 +00:00
Arvid Norberg e5f980d80d merged uTP branch into trunk (yay) 2010-11-29 01:33:05 +00:00
Arvid Norberg 6343fe6a6d optimized header dependencies to lower build time 2009-11-23 08:38:50 +00:00
Arvid Norberg 6c67da08d6 split socket.hpp up in multiple headers to lower build time somewhat 2009-09-16 03:46:36 +00:00
Arvid Norberg 010d3b6e75 windows fix 2008-05-04 16:10:13 +00:00