diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-01-15 01:23:08 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-01-16 20:06:07 +0000 |
commit | 643eea60bb9dcf4ecb33d64666b1bc77cbfd7438 (patch) | |
tree | 2f98b0c7869fddac03f834be508a182da06f07b4 /toxcore/onion_client.c | |
parent | 22db2b9fe581a35300b66126604d12e83c2eafb1 (diff) |
Make DHT a module-private type.
Diffstat (limited to 'toxcore/onion_client.c')
-rw-r--r-- | toxcore/onion_client.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/toxcore/onion_client.c b/toxcore/onion_client.c index f7ff41bd..c652d7f3 100644 --- a/toxcore/onion_client.c +++ b/toxcore/onion_client.c | |||
@@ -1133,7 +1133,7 @@ static int send_dht_dhtpk(const Onion_Client *onion_c, int friend_num, const uin | |||
1133 | } | 1133 | } |
1134 | 1134 | ||
1135 | uint8_t packet[MAX_CRYPTO_REQUEST_SIZE]; | 1135 | uint8_t packet[MAX_CRYPTO_REQUEST_SIZE]; |
1136 | len = create_request(onion_c->dht->self_public_key, onion_c->dht->self_secret_key, packet, | 1136 | len = create_request(dht_get_self_public_key(onion_c->dht), dht_get_self_secret_key(onion_c->dht), packet, |
1137 | onion_c->friends_list[friend_num].dht_public_key, temp, SIZEOF_VLA(temp), CRYPTO_PACKET_DHTPK); | 1137 | onion_c->friends_list[friend_num].dht_public_key, temp, SIZEOF_VLA(temp), CRYPTO_PACKET_DHTPK); |
1138 | 1138 | ||
1139 | if (len == -1) { | 1139 | if (len == -1) { |
@@ -1192,7 +1192,7 @@ static int send_dhtpk_announce(Onion_Client *onion_c, uint16_t friend_num, uint8 | |||
1192 | uint64_t no_replay = unix_time(); | 1192 | uint64_t no_replay = unix_time(); |
1193 | host_to_net((uint8_t *)&no_replay, sizeof(no_replay)); | 1193 | host_to_net((uint8_t *)&no_replay, sizeof(no_replay)); |
1194 | memcpy(data + 1, &no_replay, sizeof(no_replay)); | 1194 | memcpy(data + 1, &no_replay, sizeof(no_replay)); |
1195 | memcpy(data + 1 + sizeof(uint64_t), onion_c->dht->self_public_key, CRYPTO_PUBLIC_KEY_SIZE); | 1195 | memcpy(data + 1 + sizeof(uint64_t), dht_get_self_public_key(onion_c->dht), CRYPTO_PUBLIC_KEY_SIZE); |
1196 | Node_format nodes[MAX_SENT_NODES]; | 1196 | Node_format nodes[MAX_SENT_NODES]; |
1197 | uint16_t num_relays = copy_connected_tcp_relays(onion_c->c, nodes, (MAX_SENT_NODES / 2)); | 1197 | uint16_t num_relays = copy_connected_tcp_relays(onion_c->c, nodes, (MAX_SENT_NODES / 2)); |
1198 | uint16_t num_nodes = closelist_nodes(onion_c->dht, &nodes[num_relays], MAX_SENT_NODES - num_relays); | 1198 | uint16_t num_nodes = closelist_nodes(onion_c->dht, &nodes[num_relays], MAX_SENT_NODES - num_relays); |
@@ -1864,7 +1864,7 @@ Onion_Client *new_onion_client(Net_Crypto *c) | |||
1864 | } | 1864 | } |
1865 | 1865 | ||
1866 | onion_c->dht = nc_get_dht(c); | 1866 | onion_c->dht = nc_get_dht(c); |
1867 | onion_c->net = onion_c->dht->net; | 1867 | onion_c->net = dht_get_net(onion_c->dht); |
1868 | onion_c->c = c; | 1868 | onion_c->c = c; |
1869 | new_symmetric_key(onion_c->secret_symmetric_key); | 1869 | new_symmetric_key(onion_c->secret_symmetric_key); |
1870 | crypto_new_keypair(onion_c->temp_public_key, onion_c->temp_secret_key); | 1870 | crypto_new_keypair(onion_c->temp_public_key, onion_c->temp_secret_key); |