aboutsummaryrefslogtreecommitdiff
path: root/src/netbase.h
Commit message (Collapse)AuthorAgeFilesLines
* Rename IMPLEMENT_SERIALIZE to ADD_SERIALIZE_METHODSPieter Wuille2014-09-021-2/+2
|
* Serializer simplifications after IMPLEMENT_SERIALIZE overhaulPieter Wuille2014-09-011-2/+1
|
* Merge pull request #4737Pieter Wuille2014-09-011-13/+17
|\ | | | | | | | | | | | | 31e9a83 Use CSizeComputer to avoid counting sizes in SerializationOp (Pieter Wuille) 84881f8 rework overhauled serialization methods to non-static (Kamil Domanski) 5d96b4a remove fields of ser_streamplaceholder (Kamil Domanski) 3d796f8 overhaul serialization code (Kamil Domanski)
| * Use CSizeComputer to avoid counting sizes in SerializationOpPieter Wuille2014-08-311-9/+4
| |
| * rework overhauled serialization methods to non-staticKamil Domanski2014-08-311-10/+10
| | | | | | | | | | | | | | Thanks to Pieter Wuille for most of the work on this commit. I did not fixup the overhaul commit, because a rebase conflicted with "remove fields of ser_streamplaceholder". I prefer not to risk making a mistake while resolving it.
| * overhaul serialization codeKamil Domanski2014-08-311-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementation of each class' serialization/deserialization is no longer passed within a macro. The implementation now lies within a template of form: template <typename T, typename Stream, typename Operation> inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; /* CODE */ return nSerSize; } In cases when codepath should depend on whether or not we are just deserializing (old fGetSize, fWrite, fRead flags) an additional clause can be used: bool fRead = boost::is_same<Operation, CSerActionUnserialize>(); The IMPLEMENT_SERIALIZE macro will now be a freestanding clause added within class' body (similiar to Qt's Q_OBJECT) to implement GetSerializeSize, Serialize and Unserialize. These are now wrappers around the "SerializationOp" template.
* | add missing header end commentsPhilip Kaufmann2014-08-281-1/+1
|/ | | | | | - ensures a consistent usage in header files - also add a blank line after the copyright header where missing - also remove orphan new-lines at the end of some files
* Remove all other print() methodsWladimir J. van der Laan2014-08-201-2/+0
| | | | All unused.
* Add GetNetworkName functionWladimir J. van der Laan2014-07-301-1/+2
| | | | Returns the network name for an Network enum.
* net: add SetSocketNonBlocking() as OS independent wrapperPhilip Kaufmann2014-07-171-0/+2
|
* Convert closesocket 'compat wrapper' to function in netbaseWladimir J. van der Laan2014-07-171-0/+2
| | | | | | | | | | | Simpler alternative to #4348. The current setup with closesocket() is strange. It poses as a compatibility wrapper but adds functionality. Rename it and make it a documented utility function in netbase. Code movement only, zero effect on the functionality.
* remove SOCKS4 support from core and GUIPhilip Kaufmann2014-07-071-3/+3
| | | | - now we support SOCKS5 only
* build: fix build weirdness after 54372482.Cory Fields2014-06-231-1/+1
| | | | | | | | | | | | | bitcoin-config.h moved, but the old file is likely to still exist when reconfiguring or switching branches. This would've caused files to not rebuild correctly, and other strange problems. Make the path explicit so that the old one cannot be found. Core libs use config/bitcoin-config.h. Libs (like crypto) which don't want access to bitcoin's headers continue to use -Iconfig and #include bitcoin-config.h.
* remove dup of extern int nConnectTimeout; in netbasePhilip Kaufmann2014-05-311-3/+1
|
* Merge pull request #4183Wladimir J. van der Laan2014-05-251-1/+0
|\ | | | | | | | | | | | | | | | | f40dbee remove CPubKey::VerifyCompact( ) which is never used (Kamil Domanski) 28b6c1d remove GetMedianTime( ) which is never used (Kamil Domanski) 5bd4adc remove LookupHostNumeric( ) which is never used (Kamil Domanski) 595f691 remove LogException( ) which is never used (Kamil Domanski) f4057cb remove CTransaction::IsNewerThan which is never used (Kamil Domanski) 0e31e56 remove CWallet::AddReserveKey which is never used (Kamil Domanski)
| * remove LookupHostNumeric( ) which is never usedKamil Domanski2014-05-201-1/+0
| |
* | Replace non-threadsafe strerrorWladimir J. van der Laan2014-05-231-0/+2
|/ | | | | | | Log the name of the error as well as the error code if a network problem happens. This makes network troubleshooting more convenient. Use thread-safe strerror_r and the WIN32 equivalent FormatMessage.
* net: Add CSubNet class for subnet matchingWladimir J. van der Laan2014-05-091-0/+30
|
* Remove build-time no-IPv6 settingWladimir J. van der Laan2014-05-011-4/+0
| | | | | | | | | | | The year is 2014. All supported operating systems have IPv6 support, most certainly at build time (this doesn't mean that IPv6 is configured, of course). If noone is exercising the functionality to disable it, that means it doesn't get tested, and IMO it's better to get rid of it. (it's also not used consistently in RPC/boost and Net code...)
* Cleanup code using forward declarations.Brandon Dahler2013-11-101-4/+6
| | | | | | | | | Use misc methods of avoiding unnecesary header includes. Replace int typedefs with int##_t from stdint.h. Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h. Normalize QT_VERSION ifs where possible. Resolve some indirect dependencies as direct ones. Remove extern declarations from .cpp files.
* Bump Year Number to 2013super32013-10-201-1/+1
|
* fix #3049 by changing comment for CNetAddr::IsRFC4193()Philip Kaufmann2013-10-031-1/+1
|
* autotools: switch to autotools buildsystemCory Fields2013-09-051-0/+4
|
* Merge pull request #1913 from sipa/noi2pWladimir J. van der Laan2012-10-111-4/+2
|\ | | | | Remove I2P support from netbase
| * Remove I2P support from netbasePieter Wuille2012-10-071-4/+2
| | | | | | | | | | | | | | | | | | | | | | I2P apparently needs 256 bits to store a fully routable address. Garlicat requires a centralized lookup service to map the 80-bit addresses to fully routable ones (as far as I understood), so that's not really usable in our situation. To support I2P routing and peer exchange for it, another solution is needed. This will most likely imply a network protocol change, and extension of the 'addr' message.
* | add LOCK() for proxy related data-structuresPhilip Kaufmann2012-10-041-2/+4
|/ | | | | | | | | - fix #1560 by properly locking proxy related data-structures - update GetProxy() and introduce GetNameProxy() to be able to use a thread-safe local copy from proxyInfo and nameproxyInfo - update usage of GetProxy() all over the source to match the new behaviour, as it now fills a full proxyType object - rename GetNameProxy() into HaveNameProxy() to be more clear
* fix signed/unsigned in strprintf and CNetAddr::GetByte()Philip Kaufmann2012-09-121-1/+1
| | | | | | - I checked every occurance of strprintf() in the code and used %u, where unsigned vars are used - the change to GetByte() was made, as ip is an unsigned char
* Bugfix: Fix a variety of misspellingsLuke Dashjr2012-08-011-2/+2
|
* Rewrite CNetAddr::GetReachabilityFrom()Pieter Wuille2012-06-231-1/+1
| | | | Add support for Tor/I2P networks, and make code more readable.
* Node support for Tor hidden servicesPieter Wuille2012-06-231-3/+4
| | | | | | This commit adds support for .onion addresses (mapped into the IPv6 by using OnionCat's range and encoding), and the ability to connect to them via a SOCKS5 proxy.
* Merge pull request #1399 from sipa/ipparseGavin Andresen2012-06-181-0/+1
|\ | | | | Improve parsing of IPv6 addresses
| * Improve parsing of IPv6 addressesPieter Wuille2012-06-141-0/+1
| | | | | | | | | | | | | | Implement the following rules: * Interpret [X]:Y as host=X port=Y, if Y is an integer * Interpret X:Y as host=X port=Y, if Y is an integer and X contains no colon * Interpret X:Y as host=X:Y port=default otherwise
* | Merge branch 'signbugs' of https://github.com/wizeman/bitcoinGavin Andresen2012-06-181-1/+1
|\ \ | |/ |/| | | Resolved minor conflict in main.cpp
| * Make CNetAddr::GetHash() return an unsigned val.Ricardo M. Correia2012-05-131-1/+1
| | | | | | | | | | | | This prevents an undefined operation in main.cpp, when shifting the hash value left by 32 bits. Shifting a signed int left into the sign bit is undefined in C++11.
* | Rework network config settingsPieter Wuille2012-05-311-9/+8
| |
* | Update License in File HeadersFordy2012-05-181-1/+1
|/ | | | | | I originally created a pull to replace the "COPYING" in crypter.cpp and crypter.h, but it turned out that COPYING was actually the correct file.
* Separate listening sockets, -bind=<addr>Pieter Wuille2012-05-111-2/+2
|
* Add -noproxy to circumvent proxy for some networkPieter Wuille2012-05-111-0/+1
|
* Limited relaying/storing of foreign addressesPieter Wuille2012-05-111-0/+14
| | | | | | | Introduce a boolean variable for each "network" (ipv4, ipv6, tor, i2p), and track whether we are likely to able to connect to it. Addresses in "addr" messages outside of our network get limited relaying and are not stored in addrman.
* Preliminary support for Tor/I2P hidden servicesPieter Wuille2012-05-111-0/+2
| | | | | | | | | | | There are plans to let Bitcoin function as Tor/I2P hidden service. To do so, we could use the established encoding provided by OnionCat and GarliCat (without actually using those tools) to embed Tor/I2P addresses in IPv6. This patch makes these addresses considered routable, so they can travel over the Bitcoin network in 'addr' messages. This will hopefully make it easier to deploy real hidden service support later.
* IPv6 node supportPieter Wuille2012-05-111-0/+1
| | | | | | This will make bitcoin relay valid routable IPv6 addresses, and when USE_IPV6 is enabled, listen on IPv6 interfaces and attempt connections to IPv6 addresses.
* Support for multiple local addressesPieter Wuille2012-05-041-0/+1
|
* Support connecting by hostnames passed to proxy (-proxydns)Pieter Wuille2012-05-041-0/+4
|
* Remove headers.hPieter Wuille2012-04-171-21/+0
|
* Fix sign-compare warnings: netbase's Lookup* max-solutions may be unsignedJeff Garzik2012-04-151-3/+3
|
* VC2010 compile fixesWladimir J. van der Laan2012-04-031-0/+8
|
* fixed typo in comment in netbase.h and bignum.hPhilip Kaufmann2012-03-301-1/+1
|
* Begin doxygen-compatible commentsPieter Wuille2012-03-261-1/+2
|
* Update all copyrights to 2012Gavin Andresen2012-02-071-1/+1
|
* Fix handling of default portsPieter Wuille2012-01-171-6/+6
|