Commit Graph

104 Commits

Author SHA1 Message Date
irungentoo d05e39274c Make tox_new return TOX_ERR_NEW_PORT_ALLOC for all socket related errors. 2015-04-13 08:32:33 -04:00
irungentoo 405558258d Enable SO_REUSEADDR on TCP server socket. 2015-04-11 20:24:39 -04:00
irungentoo 7afab000f7 tox_new now sets error to TOX_ERR_NEW_PORT_ALLOC when binding to port fails. 2015-03-12 13:03:14 -04:00
saneki 6e8762b30a Allow for specifying the port range to use in Tox_Options 2015-02-27 11:58:00 -06:00
irungentoo 93a998d15a Code cleanups.
Moved some functions to onion.c.

Fixed possible portability issues.
2015-01-01 21:30:42 -05:00
irungentoo 8ac13beea4 Code cleanup.
Added length checks to ipport_pack() function.
2014-12-31 15:24:09 -05:00
irungentoo 4c8737785a Removed now useless packet id. 2014-12-31 13:01:01 -05:00
Maxim Biro 377da127a1 Added HTTP proxy support 2014-12-13 23:59:50 -05:00
irungentoo 6bbb939855 Cleaned up packet length types in toxcore.
They are now all uint16_t instead of sometimes being uint32_t.

Replaced some other uint32_t with unsigned ints.
2014-11-21 20:18:29 -05:00
Maxim Biro 3d23982250 Fixed return value comment of new_networking function 2014-10-12 19:38:12 -04:00
irungentoo d5d84818fe More groupchats code written. 2014-09-25 21:05:17 -04:00
irungentoo ebdfa892b3 Removed now useless atributes from structs. 2014-09-25 16:49:05 -04:00
irungentoo d67624bf99 Removed groupchats from core. 2014-09-25 16:48:18 -04:00
irungentoo 9cb0c98a9c Reduce max udp packet size to 2K. 2014-09-17 21:01:08 -04:00
irungentoo dbab15cf0c Remove useless code. 2014-08-14 14:43:01 -04:00
irungentoo 8d15ccc347 Don't set connection to established if packet is kill packet.
Removed now useless defines in network.h
2014-07-21 12:58:28 -04:00
irungentoo 97ad1e62b6 Added addr_parse_ip() to network.h header.
Removed useless semicolons.
2014-07-20 20:08:00 -04:00
Marc Schütz 4940c4c62b Const correctness for various packet callbacks 2014-06-13 22:55:15 +02:00
irungentoo 07936960df Astyle and fixes. 2014-06-10 18:35:55 -04:00
Marc Schütz 8bdf487d19 Const correctness in toxcore/network.c 2014-06-10 18:54:16 +02:00
irungentoo f2101a7d86 Toxcore closer to building correctly with gcc -std=c99. 2014-06-07 22:56:52 -04:00
irungentoo 99572e944a IN6_ARE_ADDR_EQUAL was used only once, replaced it. 2014-06-07 19:47:00 -04:00
irungentoo 1bad0b5eea Fixed TOX_MAX_MESSAGE_LENGTH define.
Removed some useless code from toxcore.

Astyled core code with new version of astyle.
2014-06-01 18:55:52 -04:00
irungentoo f818c1a197 Added functions to send and receive lossy encrypted packets over
the Tox connection.

A/V should now work over TCP.
2014-05-21 15:28:14 -04:00
notsecure ede8455a5a function comments in header 2014-05-19 11:56:45 -04:00
notsecure cecefd290a mistakes
forgot to build before pushing
2014-05-19 11:34:40 -04:00
notsecure 0d711afbec IP_Port packing unpacking in onion.c 2014-05-19 09:18:04 -04:00
irungentoo 77d2ad373a Fixed IP_Port packed struct being 1 byte too big on windows. 2014-05-18 16:07:26 -04:00
irungentoo a5da6df144 Net_crypto can now handle packets sent as TCP OOB packets.
Added timestamp to know which DHT public key is good in case
onion_client and net_crypto report different ones.
2014-05-17 12:33:22 -04:00
irungentoo 4dc0af61c6 All time in core is now monotonic. 2014-05-03 11:58:45 -04:00
irungentoo deb8bfc350 Random number functions belong in crypto_core. 2014-05-01 19:42:44 -04:00
irungentoo 19a4b1e443 Improved the crypto_cmp function.
It now uses the NaCl functions when the length is appropriate.

Moved crypto defines to crypto_core.h
2014-05-01 08:06:24 -04:00
irungentoo 3863e01e22 Some more work done on the middle network protocol.
Handshake most likely has no more possible flaws to it, next thing
to do is to do the same with the data packets.

Wrote a couple more functions.
2014-04-29 20:45:32 -04:00
irungentoo 94545c3b50 Added some packet defines. 2014-04-28 20:27:23 -04:00
irungentoo 1bfe15ee88 Decided pretty much how the handshake would work.
Started writing the code.

Astyled some files.
2014-04-22 20:28:40 -04:00
irungentoo 9c6a8432ce Crypto related cleanups.
Moved Bunch of functions from net_crypto to crypto_core.

decrypt_data_fast and decrypt_data_symmetric were the same thing
therefore, removed decrypt_data_fast.

Replaced all the crypto_secretbox_* defines with the equivalent
crypto_box_* one.

New define: crypto_box_KEYBYTES that is equal to
crypto_box_BEFORENMBYTES.
2014-04-21 16:51:36 -04:00
irungentoo f9bf7b074a Major protocol changes, this commit breaks all network compatibility.
Removed a bunch of useless space from various structs.

pack_nodes() and unpack_nodes() are now used to transmit lists of
nodes for the DHT and onion parts. They provide a way to transmit
both ipv6 and ipv4 nodes in the same packet in a portable way that
takes as little space as possible without compression.

Using pack_nodes, merged the send nodes and send nodes ipv6 packets
into one packet greatly reducing the risk of amplification attacks.
2014-04-15 18:09:07 -04:00
Steven Noonan ecf0ff3e7f sockets: support Mac OS X way of disabling SIGPIPE on a socket
Mac OS X doesn't have MSG_NOSIGNAL, so we need to use SO_NOSIGPIPE.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
2014-04-13 04:01:38 -07:00
irungentoo bd0d24fc9c Added TCP_client.
Some work done on the TCP part.
2014-04-06 20:51:03 -04:00
irungentoo c8ab29632b Some code cleanups. 2014-04-02 18:02:53 -04:00
irungentoo 98cba889a7 TCP server now has onion functionality.
All the IP/Port related structs now have __attribute__ ((__packed__))
2014-03-29 22:19:03 -04:00
irungentoo 5770a0e29a Merge branch 'api-fix'
Main changes:
1. Strings no longer need to be NULL terminated.
2. tox_get_friend_id is now named tox_get_friend_number.
3. The friend request callback function is now (Tox *tox, uint8_t *,
uint8_t *, uint16_t, void *), the Tox object pointer has been added to
it.
2014-03-18 20:02:50 -04:00
irungentoo e95494482f A bit of work done on the TCP relay server. 2014-03-15 22:11:36 -04:00
Maxim Biro e118319467 Some tox_wait_* improvements 2014-03-07 22:40:00 -05:00
Maxim Biro 5a142bb697 Renamed dht server to dht node 2014-02-22 17:07:15 -05:00
irungentoo 71b48516e8 Added custom userpackets.
A way to send and handle lossy UDP packets coming from friends.

Will be used for A/V.
2014-02-14 21:16:31 -05:00
irungentoo ad5d58b4a2 Added DHT bootstrap server info packets.
define DHT_SERVER_EXTRA_PACKETS to enable.
2014-02-01 18:45:37 -05:00
irungentoo 5da80263a5 Convert IPv4 in IPv6 to IPv6 address in recieve packet. 2014-01-30 13:59:10 -05:00
Sean 460e52c426 missing #endif 2014-01-25 19:49:37 -08:00
Sean 803c6f41d7 Moved to networking.h
Plan 9 requires u.h in every file
2014-01-25 18:48:49 -08:00