Skip to content

Commit

Permalink
Updating toxcore
Browse files Browse the repository at this point in the history
  • Loading branch information
dvor committed Feb 12, 2016
1 parent 6625b7a commit ddba543
Show file tree
Hide file tree
Showing 23 changed files with 285 additions and 244 deletions.
2 changes: 1 addition & 1 deletion toxcore-git
Submodule toxcore-git updated 50 files
+12 −35 .travis.yml
+11 −11 auto_tests/TCP_test.c
+51 −0 auto_tests/crypto_test.c
+81 −111 auto_tests/dht_test.c
+0 −1 auto_tests/encryptsave_test.c
+1 −1 build/Makefile.am
+1 −0 configure.ac
+1 −1 other/DHT_bootstrap.c
+3 −1 other/Makefile.inc
+0 −27 other/bootstrap_daemon/Makefile.inc
+128 −9 other/bootstrap_daemon/README.md
+59 −0 other/bootstrap_daemon/docker/Dockerfile
+49 −0 other/bootstrap_daemon/docker/get-nodes.py
+38 −0 other/bootstrap_daemon/src/Makefile.inc
+147 −0 other/bootstrap_daemon/src/command_line_arguments.c
+42 −0 other/bootstrap_daemon/src/command_line_arguments.h
+431 −0 other/bootstrap_daemon/src/config.c
+52 −0 other/bootstrap_daemon/src/config.h
+42 −0 other/bootstrap_daemon/src/config_defaults.h
+34 −0 other/bootstrap_daemon/src/global.h
+121 −0 other/bootstrap_daemon/src/log.c
+64 −0 other/bootstrap_daemon/src/log.h
+344 −0 other/bootstrap_daemon/src/tox-bootstrapd.c
+0 −730 other/bootstrap_daemon/tox-bootstrapd.c
+1 −1 other/bootstrap_daemon/tox-bootstrapd.service
+1 −1 other/bootstrap_daemon/tox-bootstrapd.sh
+1 −1 other/bootstrap_node_packets.c
+35 −0 other/bootstrap_node_packets.h
+2 −2 testing/DHT_test.c
+2 −2 toxav/rtp.h
+117 −123 toxcore/DHT.c
+12 −3 toxcore/DHT.h
+1 −1 toxcore/Messenger.c
+3 −3 toxcore/TCP_client.c
+3 −3 toxcore/TCP_connection.c
+7 −7 toxcore/TCP_server.c
+60 −37 toxcore/crypto_core.c
+4 −1 toxcore/crypto_core.h
+5 −5 toxcore/friend_connection.c
+1 −1 toxcore/friend_requests.c
+8 −8 toxcore/group.c
+8 −5 toxcore/net_crypto.c
+16 −16 toxcore/network.c
+5 −4 toxcore/onion_announce.c
+12 −11 toxcore/onion_client.c
+9 −4 toxcore/ping.c
+1 −1 toxcore/tox.c
+1 −1 toxcore/util.c
+8 −5 toxencryptsave/Makefile.inc
+0 −1 toxencryptsave/toxencryptsave.c
2 changes: 1 addition & 1 deletion toxcore.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

Pod::Spec.new do |s|
s.name = "toxcore"
s.version = "0.0.1-0938ba0"
s.version = "0.0.1-94cc8b1"
s.summary = "Cocoapods wrapper for toxcore"
s.homepage = "https://github.com/Antidote-for-Tox/toxcore"
s.license = 'GPLv3'
Expand Down
4 changes: 2 additions & 2 deletions toxcore/toxav/rtp.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct RTPHeader {
} __attribute__ ((packed));

/* Check alignment */
typedef char __fail_if_misaligned [ sizeof(struct RTPHeader) == 80 ? 1 : -1 ];
typedef char __fail_if_misaligned_1 [ sizeof(struct RTPHeader) == 80 ? 1 : -1 ];

struct RTPMessage {
uint16_t len;
Expand All @@ -75,7 +75,7 @@ struct RTPMessage {
} __attribute__ ((packed));

/* Check alignment */
typedef char __fail_if_misaligned [ sizeof(struct RTPMessage) == 82 ? 1 : -1 ];
typedef char __fail_if_misaligned_2 [ sizeof(struct RTPMessage) == 82 ? 1 : -1 ];

/**
* RTP control session.
Expand Down
15 changes: 12 additions & 3 deletions toxcore/toxcore/DHT.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@
/* Maximum number of clients stored per friend. */
#define MAX_FRIEND_CLIENTS 8

#define LCLIENT_NODES (MAX_FRIEND_CLIENTS)
#define LCLIENT_LENGTH 128

/* A list of the clients mathematically closest to ours. */
#define LCLIENT_LIST 32
#define LCLIENT_LIST (LCLIENT_LENGTH * LCLIENT_NODES)

#define MAX_CLOSE_TO_BOOTSTRAP_NODES 8

/* The max number of nodes to send with send nodes. */
#define MAX_SENT_NODES 4
Expand All @@ -58,7 +63,7 @@
#define TOX_TCP_INET6 138

/* The number of "fake" friends to add (for optimization purposes and so our paths for the onion part are more random) */
#define DHT_FAKE_FRIEND_NUMBER 4
#define DHT_FAKE_FRIEND_NUMBER 2

/* Functions to transfer ips safely across wire. */
void to_net_family(IP *ip);
Expand Down Expand Up @@ -232,7 +237,7 @@ typedef struct {

Cryptopacket_Handles cryptopackethandlers[256];

Node_format to_bootstrap[MAX_SENT_NODES];
Node_format to_bootstrap[MAX_CLOSE_TO_BOOTSTRAP_NODES];
unsigned int num_to_bootstrap;
} DHT;
/*----------------------------------------------------------------------------------*/
Expand Down Expand Up @@ -307,6 +312,10 @@ int id_closest(const uint8_t *pk, const uint8_t *pk1, const uint8_t *pk2);
_Bool add_to_list(Node_format *nodes_list, unsigned int length, const uint8_t *pk, IP_Port ip_port,
const uint8_t *cmp_pk);

/* Return 1 if node can be added to close list, 0 if it can't.
*/
_Bool node_addable_to_close_list(DHT *dht, const uint8_t *public_key, IP_Port ip_port);

/* Get the (maximum MAX_SENT_NODES) closest nodes to public_key we know
* and put them in nodes_list (must be MAX_SENT_NODES big).
*
Expand Down
Loading

0 comments on commit ddba543

Please sign in to comment.