summaryrefslogtreecommitdiff
path: root/toxcore/network.h
AgeCommit message (Collapse)Author
2014-02-14Added custom userpackets.irungentoo
A way to send and handle lossy UDP packets coming from friends. Will be used for A/V.
2014-02-01Added DHT bootstrap server info packets.irungentoo
define DHT_SERVER_EXTRA_PACKETS to enable.
2014-01-30Convert IPv4 in IPv6 to IPv6 address in recieve packet.irungentoo
2014-01-25missing #endifSean
2014-01-25Moved to networking.hSean
Plan 9 requires u.h in every file
2014-01-19proper windows preprocessor detectionBen Iofel
2013-12-24Added the shell of onion.{c, h}irungentoo
2013-12-21Added function to save an encrypted version of the messenger.irungentoo
Also added some tests.
2013-12-15Code cleanups.irungentoo
No functionality changed.
2013-12-08Compatibility fixes.irungentoo
AF_INET/AF_INET6 can vary across devices, we introduce TOX_AF_INET and TOX_AF_INET6 to fix this.
2013-12-07Added/updated some basic docs and cleaned up some things.irungentoo
2013-12-06Merge branch 'master' into hardenirungentoo
2013-11-18Merge pull request #650 from FullName/ID-IP-basicirungentoo
Significantly trimmed down version of an ID<=>IP cache.
2013-11-16Fixed build error on windows.irungentoo
2013-11-14Significantly trimmed down version of an ID<=>IP cache.Coren[m]
Besides acknowledging timeouts, the module isn't trying to do anything fancy with the data besides storing and retrieving.
2013-10-28Merge branch 'master' into hardenirungentoo
Also removed some old, useless loading code.
2013-10-26Increased port range.irungentoo
2013-10-24Fixed build error with libsodium.irungentoo
2013-10-24Move unix_time(), id_cpy()/id_eq(), is_timeout() to util.*Coren[m]
unix_time(): - returns local value for current epoch - value is updated explicitly with unix_time_update() called at new_DHT()/doMessenger()/do_DHT() is_timeout(): - uses the local value for current epoch id_cpy()/id_eq() => id_copy()/id_equal(): - centralized duplicate definitions - replaced (most) memcpy()/memcmp() of (*, *, CLIENT_ID_SIZE) with id_copy()/id_equal()
2013-10-24Adding encrypted data to send/getnode packets part 1.irungentoo
2013-10-24Removed define that could become confusing.irungentoo
2013-10-20Main: Eliminate TOX_ENABLE_IPV6 (then always on), CLIENT_ONETOONE_IP (then ↵Coren[m]
always off). Additionally (besides cleanups): network.h/tox.h: - WIN32: fix a strange sa_family_t definition - WIN32: define EWOULDBLOCK to WSAEWOULDBLOCK - WIN32: kill macro for an existing function (IN6_ADDR_EQUAL) network.c: - use EWOULDBLOCK instead of EAGAIN (same value, but EWOULDBLOCK is more "popular") - new_networking(): only try to enable IPv4-in-IPv6 if it's not already enabled per default - inet_ntop()/inet_pton(): WIN32: remove partial initializers in favor of a simple memset() - ip_equal(): WIN32: use an existing function - logging: networking_wait_execute(): only dump result if not timeout - logging: loglogdata(): kill an unused variable LAN_discovery.c: - send_broadcasts(): re-enabled, can only support IPv4 by principle, split into fetch_broadcast_info() (to fetch the addresses once) and send_broadcasts() (actual sending) DHT.c: - DHT_load_state_callback(): enclosed a fprintf(stderr, ...) into #ifdef DEBUG Lossless_UDP.c: - change_handshake(): harden against strange sa_family_t definitions Messenger.c: - logging: fix ID to string conversion util.c: - logging: eliminate a signed-warning
2013-10-13Small fix.irungentoo
2013-10-13tox A/V: integration of A/V code into toxmannol
Also-by: Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>
2013-10-06sendqueue_length no longer determines if we check for socket-can-write, but ↵Coren[m]
sendpacket() sets a timestamp if it happened network.*: - sendpacket(): checks result and on EAGAIN, stores time of this event - networking_wait_prepare(): uses the time if set to check up to 500ms later for the socket to be writeable again - networking_wait_cleanup(): clears the time if the socket was writeable - fixed some accidental tabs Messenger.*, tox.*: - pass-through functions to reach networking_wait_cleanup() - fixed some accidental tabs
2013-10-05Broken *_wait() into *_wait_prepare() and *_wait_execute()Coren[m]
To allow the actual waiting to run without any locking, split it into preparing the data it uses and the execution of the wait. The caller must provide with the buffer to store whatever data it requires to wait. Completely eliminates any reliance on the existence of anything but that data in the actual wait routine. Also fixed a few argument type warnings inside LOGGING.
2013-10-03Only add write-ready to select() if we have packets queuedCoren[m]
Lossless_UDP.*: - sendqueue_total() sums sendqueue() across all connections network.*, Messenger.c: - sendqueue_total() is collected and then used in deciding if we select() on write-readiness
2013-10-02Add tox_wait() for socket, allow tox.h include in tox.cCoren[m]
tox.*, Messenger.*, network.*; - new function tox_wait() => waitMessenger() => networking_wait(): - waits for a given amount of time for any sort of socket activity - mustn't change anything inside, mustn't poll or do other stuff - the point is to be able to call this asynchronously from a second thread - the outside shall follow up with an immediate tox_do() when there's socket activity tox.*: - allow inclusion of tox.h into tox.c, ensuring that the outside interface and the internal always match util.c: - squished a few warnings about questionable format strings
2013-09-22Fix inet_pton/ntop on win32BtbN
2013-09-21Fix compilation on windows for ipv6 codeBtbN
2013-09-15more portability fixes.irungentoo
2013-09-15Fixed portablity problems.irungentoo
struct in6_addr member names can differ per platform.
2013-09-13Merge remote-tracking branch 'upstream/master' into IntegrationCoren[m]
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-12Merge remote-tracking branch 'upstream/master' into IntegrationCoren[m]
Conflicts resolved: toxcore/Messenger.c toxcore/network.h
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-11Integration of group chats into messenger in progress.irungentoo
2013-09-11cleanup TravisCI warnings (missing exports/extraneous args to printf)Coren[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-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-09- added missing include (autobuild warning)Coren[m]
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]
- added ipany_ntoa() network.c: - added ipany_ntoa() - fixed formatting
2013-09-09network.*:Coren[m]
- IP4: changed in_addr_t to struct in_addr for compatibility reasons - IP6: added - IPAny: added - addr_resolve_or_parse_ip(): converts a string into an IPAny
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/