summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-11-09Store NATPortMapping lifetime as uint32_tEdwin Mons
The NAT-PMP RFC specifies lifetime as an unsigned, 32 bit integer, so using this internally makes sense. This also removes the need for casts in interface code. A slight bug in the NATPMPInterface implementation to remove a mapping has been addressed. Test-Information: Unit tests pass on macOS 10.13 Change-Id: I06687fd2735a8706f339f85d6c957ad7aadaaf02
2018-11-08Consistently use unsigned short for network portsEdwin Mons
Network ports are now consistently stored as unsigned shorts, apart from the options and user interface, where -1 is still used to denote the use of default ports. Test-Information: Unit tests pass on macOS 10.13 and Debian 9 On macOS: tested the UI with various proxy and manual ports, behaviour as expected. Change-Id: I7a65f40083022887aa30ed7b21eadc56d0c52be1
2018-07-27Autofix boost-use-to-string clang-tidy warningsKevin Smith
Done by adding --fix --fix-errors to the clang-tidy args in the Makefile Test-Information: Unit tests pass (macOS) Change-Id: I3a4df955ac3553afeb9384f23f9d8b2ef01117e2
2016-11-18Improve string to HostAddress conversion APITobias Markmann
Previously HostAddress had a constructor which allowed initialisation via a std::string. This initialisation can fail and this is heavily used for checking whether a string is a valid IP address. This constructor is removed in this commit and replaced by a static method HostAddress::fromString, taking a string and returning an optional HostAddress. This clearly communicates that the conversion can fail. Test-Information: ./scons test=all passes on macOS 10.12.1. Change-Id: Idaafee6f84010ce541c55f267ac77ad6ac8f02b4
2016-10-21Fix version number for libminiupnpc version switchTobias Markmann
Test-Information: Without this building failed under Gentoo Linux distribution. Verified this on Sabayon, a desktop Linux distribution based on Gentoo, by adding it to our cross distribution test. With this fix it builds on all platforms, including Sabayon. Change-Id: I23aec19b9755244dd3dbe6f581cf170eaf334dfc
2016-09-26Use const std::unique_ptr for pimpl idiom usageTobias Markmann
All our pimpl idiom usage used std::shared_ptr due to being written in C++03. Now we use C++11 and const std::unique_ptr is more sensible. Test-Information: Builds on macOS 10.12 and unit tests pass. Change-Id: I1b9b3fbb22e337d53ae71e5a5e03118998cc3376
2016-07-22Add support for libminiupnpc version 2Tobias Markmann
Test-Information: Build successfully on openSUSE Tumbleweed which only has libminiupnpc 2.0 as package. Unit tests passed. Change-Id: I650e1224014162b55cdf64df7e72466b52dc3ade
2016-04-04Modernize code to use C++11 shared_ptr instead of Boost'sTobias Markmann
This change was done by applying the following 'gsed' replacement calls to all source files: 's/\#include <boost\/shared_ptr\.hpp>/\#include <memory>/g' 's/\#include <boost\/enable_shared_from_this\.hpp>/\#include <memory>/g' 's/\#include <boost\/smart_ptr\/make_shared\.hpp>/\#include <memory>/g' 's/\#include <boost\/make_shared\.hpp>/\#include <memory>/g' 's/\#include <boost\/weak_ptr\.hpp>/\#include <memory>/g' 's/boost::make_shared/std::make_shared/g' 's/boost::dynamic_pointer_cast/std::dynamic_pointer_cast/g' 's/boost::shared_ptr/std::shared_ptr/g' 's/boost::weak_ptr/std::weak_ptr/g' 's/boost::enable_shared_from_this/std::enable_shared_from_this/g' The remaining issues have been fixed manually. Test-Information: Code builds on OS X 10.11.4 and unit tests pass. Change-Id: Ia7ae34eab869fb9ad6387a1348426b71ae4acd5f
2016-04-01Modernize code to use C++11 nullptr using clang-tidyTobias Markmann
Run 'clang-tidy -fix -checks=modernize-use-nullptr' on all source code files on OS X. This does not modernize platform specific code on Linux and Windows Test-Information: Code builds and unit tests pass on OS X 10.11.4. Change-Id: Ic43ffeb1b76c1a933a55af03db3c54977f5f60dd
2016-03-31Convert tabs to 4 spaces for all source filesTobias Markmann
Removed trailing spaces and whitespace on empty lines in the process. Changed CheckTabs.py tool to disallow hard tabs in source files. Test-Information: Manually checked 30 random files that the conversion worked as expected. Change-Id: I874f99d617bd3d2bb55f02d58f22f58f9b094480
2016-03-30Apply consistent #include grouping and sorting styleTobias Markmann
Changed "" style includes to <> style. Test-Information: Build with Clang 3.9.0 and ran all tests on OS X 10.11.4. Change-Id: Ic05e53f2e5dba39cc1307b116fc5f17b62ab9eb8
2015-02-03Use "Swift" description when adding UPnP port forwardings.Tobias Markmann
Test-Information: Verified using Port Map.app tool and router supporting UPnP. Change-Id: I8d43a812f136979a70ef4dc62ff45448c6603b8b
2013-05-11File Transfer refactoring.Remko Tronçon
Allocate S5B server lazily. Forward forts lazily. Various state machine fixes. Temporarily disabling S5B proxy support. Change-Id: I3145e85a99b15a7e457306bbfbe9c0eb570191e4
2012-07-15Hide libminiupnp and libnatpmp.Remko Tronçon
2011-10-03Turn NATPortMapping into a class.Tobias Markmann
License: This patch is BSD-licensed, see http://www.opensource.org/licenses/bsd-license.php
2011-09-29File Transfer refactoring.Remko Tronçon
NAT traversal classes refactoring. Added beginnings of a NetworkTool.
2010-03-28Removing submodules.Remko Tronçon
2010-03-28Moved Swiften to a separate module.Remko Tronçon