summaryrefslogtreecommitdiff
path: root/toxcore/util.c
AgeCommit message (Collapse)Author
2013-09-16Merge pull request #576 from FullName/MessengerLoadSaveirungentoo
State loading/saving: Instead of a blob, segment into sections marked with tags.
2013-09-16Fix warnings of -Wall -WextraCoren[m]
2013-09-16additional length >= size checksCoren[m]
Messenger.c: - additional size checks - removed one pointless copying of data, instead using it directly util.c: - lost a newline vs. master
2013-09-16Merge remote-tracking branch 'upstream/master' into MessengerLoadSaveCoren[m]
Conflicts: toxcore/Messenger.c toxcore/util.c toxcore/util.h
2013-09-14Change sublength to 32 bits. Someone might have more than (sizeof(Friends) / ↵Coren[m]
65536) friends...
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-13TOX_ENABLE_IPV6 is now #define'd per default. Added some logging and error ↵Coren[m]
messages.
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-11toxcore/util.h:Coren[m]
- moved cmdline_parsefor_ipv46() to testing/misc_tools.c
2013-09-11cmdline parsing of --ipv4/6 plucked into utilCoren[m]
2013-09-10util.*:Coren[m]
- added logging functions, default off tox.h: - added includes for sockaddr_in/6 network.c: - added logging functions, default off (#define in util.h) - IPv6: activating site-local all-nodes multicast address (i.e. IPv6 equivalent of broadcast)
2013-09-10big push, putting all the infrastructure in place behind TOX_ENABLE_IPV6Coren[m]
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-08-30Fixed build errors.Kostya
2013-08-29Removed packet structs.irungentoo
They were causing problems on certain compiler configurations.
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.