summaryrefslogtreecommitdiff
path: root/toxcore/DHT.c
AgeCommit message (Collapse)Author
2013-09-14Fixed some warnings.irungentoo
2013-09-14Some fixes.irungentoo
2013-09-14DHT.c:Coren[m]
- get_close_nodes(): refactored the inner loop out into get_close_nodes_inner()
2013-09-14DHT.c:Coren[m]
- get_close_nodes()/sendnodes()/sendnodes_ipv6(): when selecting for SEND_NODES/SEND_NODES_IPV6, treat embedded IPv4-in-IPv6 addresses as being IPv4 Messenger.c: - added a named constant for sixty seconds friend/client dump - fix logging to convert client_id to printable before printing
2013-09-14Change sublength to 32 bits. Someone might have more than (sizeof(Friends) / ↵Coren[m]
65536) friends...
2013-09-13Merge remote-tracking branch 'upstream/master' into IntegrationCoren[m]
2013-09-13Merge remote-tracking branch 'upstream/master' into MessengerLoadSaveCoren[m]
2013-09-13State loading/saving: Instead of a blob, segment into sections marked with tags.Coren[m]
Primary rationale: The part that DHT saves changes if IP is expanded to IPv6. To let people keep their friends/name, change the datafile format now, while everybody is still on the same page. Loading/Saving rewritten to allow a part of the file to be incomprehensible to the loading routine. Added a magic cookie at the beginning to mark the file as tox's. Changes in some part of the datafile can be skipped and the remaining parts still be consumed. Allows a wide margin of forward compatibility (like the IP to IPv6 transition, but also e.g. a change in the key format). As long as the file is not completely garbled, the routine will read as much as possible. Only the KEY section is considered mandatory: a malformed key section leads to a negative result. util.*: - holds the driving function which jumps from section to section and calls back with section length and tag (type) Messenger.c,DHT.*: - new loading functions call the util-function with a callback, which subsequently consumes the sections - old routines are kept to fall back onto if the magic cookie at the beginning isn't present - saving is still done in one local routine
2013-09-13Nonce generation changes.irungentoo
Nonces don't need to be random, only different. also random_int now gives same quality random numbers for both NaCl and libsodium.
2013-09-13TOX_ENABLE_IPV6 is now #define'd per default. Added some logging and error ↵Coren[m]
messages.
2013-09-12network.*:Coren[m]
- addr_resolv(_or_parse_ip)(): added an optional parameter to return both an IPv6 and an IPv4 address if requested address family was AF_UNSPEC - logging of unhandled packets DHT.c: - bootstrap_from_address(): use the additional return from addr_resolv_or_parse_ip() to bootstrap in both network types at once Lossless_UDP_testclient.c: - main(): adapt to signature change of addr_resolve() Messenger.c. LAN_discovery.h: - lost a htons(), readded - moved LAN_DISCOVERY_INTERVAL #define into LAN_discovery.h LAN_discovery.c: - added IPv4-in-IPv6 local address test
2013-09-12tox.h:Coren[m]
- #define'd tox's network port (as range) - finally killed tox_new_ex() in favor of changing tox_new()'s signature - renamed tox_bootstrap() to tox_bootstrap_from_ip() network.h: - #define'd tox's network port (as range) - renamed SEND_NODES_EX to SEND_NODES_IPV6 - bind() loop uses #define'd port range DHT.c: - renamed SEND_NODES_EX to SEND_NODES_IPV6 - sending ipv6 node addresses even if can't use them ourselves nTox.c: - adapted to changed tox_new()
2013-09-11tox.h, DHT.h:Coren[m]
- tox_bootstrap_ex(), DHT_bootstrap_ex() renamed to tox_bootstrap_from_address(), DHT_bootstrap_from_address() - (handle_)sendnodes_ex() renamed to (handle_)sendnodes_ipv6() - only sending sendnodes_ipv6() if we're actually IPv6 enabled - changed comments to conform better nTox.c, Messenger_text.c, DHT_test.c, DHT_bootstrap.c: - fallout from *_ex() to *_from_address() DHT_bootstrap.c: - corrected a potentially wrong info message util.c: - fixed logfile name: now (funcptr) => now() (number) network.c: - addead comment about the necessity of bind() to succeed auto_test/messenger_test.c: - defaulting ipv6enabled to TOX_ENABLE_IPV6_DEFAULT LAN_discovery.c: - slight cleanup and comments for clarity
2013-09-11cmdline parsing:Coren[m]
- add missing includes (autobuild warnings)
2013-09-10tox.*, DHT.*:Coren[m]
- return to the caller if the string could be resolved into an IP other/DHT_bootstrap.c, testing/*_test.c, testing/nTox.c: - parse cmdline for --ipv4/--ipv6 switch to allow user a choice util.h: - proper old-style C-comment
2013-09-10DHT.c:Coren[m]
- client_in_list: split loop in two to avoid inserting a client_id duplicate - final pieces for IPv6 expansion: (handle_)sendnodes_ex(), called from hande_getnodes() resp. handler callback
2013-09-10big push, putting all the infrastructure in place behind TOX_ENABLE_IPV6Coren[m]
2013-09-09tox.*, DHT.*;Coren[m]
- second set of *_bootstrap_ex() functions to allow addresses instead of IPs network.h: - new message ID for sending/receiving IPv6 nodes DHT.*: - get_close_nodes(): - additional parameter to select which kind of nodes: IPv4 or IPv6 - sendnodes()/handle_sendnodes(): - the IPv4 message must remain intact even when the Node_format structure (which embeds IP_Port) is expanded - added Node4_format to keep the structure "alive" - copying in/out of wider to smaller format required in sendnodes()/handle_sendnodes() - switch of Node_format from Node4_format to Node46_format by define
2013-09-09network.*:Coren[m]
- IPAny_Port: analogous to IP_Port - ipport_equal: moved from DHT.c and adapted DHTc.: - ipport_equal renamed to ip4port_equal
2013-09-09network.h:Coren[m]
- IP: add in_addr_t as part of the union - IP: rename IP to IP4
2013-09-09network.h:Coren[m]
- global: added sock_t - Networking_Core: added family (currently always AF_INET) and port - sendpacket(): changed signature to require (Networking_Core *) instead of sock_t *.c: - sendpacket()-calls: replaced *->net->sock with *->net
2013-09-06Allow to build vs nacl instead of libsodiumJin^eLD
By default libsodium is used. Only if --enable-nacl is specified, then nacl will be used instead of libsodium. Pass locations of nacl headers and libraries by using the following options: --with-nacl-headers=/home/me/somewhere/nacl-20110221/build/469/include/amd64/ --with-nacl-libs=/home/me/somewhere/nacl-20110221/build/469/lib/amd64/
2013-09-03Work in progress group chats.irungentoo
Not done yet.
2013-09-02Merge branch 'master' of https://github.com/JamoBox/ProjectTox-Core into ↵irungentoo
JamoBox-master
2013-09-02Fixed missing field initializers warningsMaxim Biro
2013-09-02Properly fixed signed/unsigned comparisons.irungentoo
2013-09-02More comment refactoring - DHT.cJamoBox
2013-09-01Merge branch 'master' of github.com:tylerb/ProjectTox-CoreTyler Bunnell
2013-09-01Fix signed/unsigned comparison warningsTyler Bunnell
2013-09-01Fixed possible bug.irungentoo
2013-08-30Cleaned up pull request.irungentoo
2013-08-30Made clang happy by taking definitions for the macro out of functions and ↵redwire
adding declarations
2013-08-30Wrote a quicksort macro and modified sort_list to use itredwire
2013-08-30Fixed possible compiling problems on some compilers.irungentoo
2013-08-30Fixed warnings and moved hex_string_to_bin to testing/irungentoo
2013-08-30Fixed build errors.Kostya
2013-08-30Made IP_Port a union.Kostya
2013-08-29Removed packet structs.irungentoo
They were causing problems on certain compiler configurations.
2013-08-29Merge branch 'master' of https://github.com/JamoBox/ProjectTox-Core into ↵irungentoo
JamoBox-master Conflicts: toxcore/LAN_discovery.h
2013-08-29Correct a lot of the grammar and spelling. Also spent a few hours fixing the ↵pete
comments so they follow a standard.
2013-08-29Fixed bug.irungentoo
2013-08-28Fixed possible bug.irungentoo
2013-08-24Rename core directory because of autoconf name clashjin-eld
While doing the checks configure might generate "core" files and will then try to remove them. Having a "core" directory generates an error while runing the configure script. There's no workaround but to rename the core directory.