summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xCMakeLists.txt2
-rw-r--r--auto_tests/crypto_test.c2
-rw-r--r--auto_tests/friends_test.c4
-rw-r--r--auto_tests/messenger_test.c3
-rw-r--r--other/DHT_bootstrap.c4
-rw-r--r--other/bootstrap_serverdaemon/DHT_bootstrap_daemon.c4
-rw-r--r--other/unused/timer.c290
-rw-r--r--other/unused/timer.h104
-rw-r--r--testing/DHT_test.c4
-rw-r--r--testing/Lossless_UDP_testclient.c4
-rw-r--r--testing/Lossless_UDP_testserver.c4
-rw-r--r--testing/Messenger_test.c2
-rw-r--r--testing/crypto_speed_test.c2
-rw-r--r--testing/nTox.h2
-rw-r--r--toxcore/CMakeLists.txt (renamed from core/CMakeLists.txt)0
-rw-r--r--toxcore/DHT.c (renamed from core/DHT.c)0
-rw-r--r--toxcore/DHT.h (renamed from core/DHT.h)0
-rw-r--r--toxcore/LAN_discovery.c (renamed from core/LAN_discovery.c)0
-rw-r--r--toxcore/LAN_discovery.h (renamed from core/LAN_discovery.h)0
-rw-r--r--toxcore/Lossless_UDP.c (renamed from core/Lossless_UDP.c)0
-rw-r--r--toxcore/Lossless_UDP.h (renamed from core/Lossless_UDP.h)0
-rw-r--r--toxcore/Messenger.c (renamed from core/Messenger.c)0
-rw-r--r--toxcore/Messenger.h (renamed from core/Messenger.h)0
-rw-r--r--toxcore/friend_requests.c (renamed from core/friend_requests.c)0
-rw-r--r--toxcore/friend_requests.h (renamed from core/friend_requests.h)0
-rw-r--r--toxcore/net_crypto.c (renamed from core/net_crypto.c)0
-rw-r--r--toxcore/net_crypto.h (renamed from core/net_crypto.h)0
-rw-r--r--toxcore/network.c (renamed from core/network.c)0
-rw-r--r--toxcore/network.h (renamed from core/network.h)0
-rw-r--r--toxcore/packets.h (renamed from core/packets.h)0
-rw-r--r--toxcore/ping.c (renamed from core/ping.c)0
-rw-r--r--toxcore/ping.h (renamed from core/ping.h)0
-rw-r--r--toxcore/tox.c (renamed from core/tox.c)0
-rw-r--r--toxcore/tox.h (renamed from core/tox.h)0
-rw-r--r--toxcore/util.c (renamed from core/util.c)0
-rw-r--r--toxcore/util.h (renamed from core/util.h)0
36 files changed, 19 insertions, 412 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cba0013c..73e89171 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -58,7 +58,7 @@ endmacro()
58 58
59cmake_policy(SET CMP0011 NEW) 59cmake_policy(SET CMP0011 NEW)
60 60
61add_subdirectory(core) 61add_subdirectory(toxcore)
62add_subdirectory(testing) 62add_subdirectory(testing)
63add_subdirectory(other) 63add_subdirectory(other)
64add_subdirectory(docs) 64add_subdirectory(docs)
diff --git a/auto_tests/crypto_test.c b/auto_tests/crypto_test.c
index 01c545c8..b3ce6259 100644
--- a/auto_tests/crypto_test.c
+++ b/auto_tests/crypto_test.c
@@ -1,4 +1,4 @@
1#include "../core/net_crypto.h" 1#include "../toxcore/net_crypto.h"
2#include <sys/types.h> 2#include <sys/types.h>
3#include <stdint.h> 3#include <stdint.h>
4#include <string.h> 4#include <string.h>
diff --git a/auto_tests/friends_test.c b/auto_tests/friends_test.c
index b6223489..0426c18d 100644
--- a/auto_tests/friends_test.c
+++ b/auto_tests/friends_test.c
@@ -18,8 +18,8 @@
18 * times. This is used both to ensure that we don't loop forever on a broken build, 18 * times. This is used both to ensure that we don't loop forever on a broken build,
19 * and that we don't get too slow with messaging. The current time is 15 seconds. */ 19 * and that we don't get too slow with messaging. The current time is 15 seconds. */
20 20
21#include "../core/friend_requests.h" 21#include "../toxcore/friend_requests.h"
22#include "../core/Messenger.h" 22#include "../toxcore/Messenger.h"
23#include <assert.h> 23#include <assert.h>
24#include <unistd.h> 24#include <unistd.h>
25#include <sys/mman.h> 25#include <sys/mman.h>
diff --git a/auto_tests/messenger_test.c b/auto_tests/messenger_test.c
index 9de69409..deac749b 100644
--- a/auto_tests/messenger_test.c
+++ b/auto_tests/messenger_test.c
@@ -10,7 +10,8 @@
10 * checking that status changes are received, messages can be sent, etc. 10 * checking that status changes are received, messages can be sent, etc.
11 * All of that is done in a separate test, with two local clients running. */ 11 * All of that is done in a separate test, with two local clients running. */
12 12
13#include "../core/Messenger.h" 13#include "../toxcore/Messenger.h"
14#include "../toxcore/Lossless_UDP.h"
14#include <sys/types.h> 15#include <sys/types.h>
15#include <stdint.h> 16#include <stdint.h>
16#include <string.h> 17#include <string.h>
diff --git a/other/DHT_bootstrap.c b/other/DHT_bootstrap.c
index c0d4fcc6..0bf71312 100644
--- a/other/DHT_bootstrap.c
+++ b/other/DHT_bootstrap.c
@@ -27,8 +27,8 @@
27 * 27 *
28 */ 28 */
29 29
30#include "../core/DHT.h" 30#include "../toxcore/DHT.h"
31#include "../core/friend_requests.h" 31#include "../toxcore/friend_requests.h"
32#include "../testing/misc_tools.h" 32#include "../testing/misc_tools.h"
33 33
34//Sleep function (x = milliseconds) 34//Sleep function (x = milliseconds)
diff --git a/other/bootstrap_serverdaemon/DHT_bootstrap_daemon.c b/other/bootstrap_serverdaemon/DHT_bootstrap_daemon.c
index 46409b76..eec4e39f 100644
--- a/other/bootstrap_serverdaemon/DHT_bootstrap_daemon.c
+++ b/other/bootstrap_serverdaemon/DHT_bootstrap_daemon.c
@@ -32,8 +32,8 @@
32#include <arpa/inet.h> /* htons() */ 32#include <arpa/inet.h> /* htons() */
33#include <string.h> /* strcpy() */ 33#include <string.h> /* strcpy() */
34 34
35#include "../../core/DHT.h" 35#include "../../toxcore/DHT.h"
36#include "../../core/friend_requests.h" 36#include "../../toxcore/friend_requests.h"
37 37
38#define DEFAULT_PORT 33445 38#define DEFAULT_PORT 33445
39#define DEFAULT_PID_FILE "bootstrap_server.pid" 39#define DEFAULT_PID_FILE "bootstrap_server.pid"
diff --git a/other/unused/timer.c b/other/unused/timer.c
deleted file mode 100644
index 29190921..00000000
--- a/other/unused/timer.c
+++ /dev/null
@@ -1,290 +0,0 @@
1#define __STDC_FORMAT_MACROS
2#include <inttypes.h>
3
4#include "timer.h"
5#include "network.h"
6
7/*
8A nested linked list increases efficiency of insertions.
9Depending on the number of timers we have, we might need to have nested linked lists
10in order to improve insertion efficiency.
11The code below is preperation for that end, should it be necessary.
12
13typedef struct {
14 struct timer_package* _next;
15 union {
16 timer_packet* _inner;
17 timer* queue;
18 };
19 uint64_t pkgtime;
20} timer_package;
21
22timer_package* timer_package_pool;
23
24static timer_package* new_package()
25{
26 timer_package* ret;
27 if (timer_package_pool) {
28 ret = timer_package_pool;
29 timer_package_pool = timer_package_pool->_next;
30 } else {
31 ret = calloc(1, sizeof(struct timer_package));
32 }
33 return ret;
34}
35
36static void delete_package(timer_package* p)
37{
38 p->_next = timer_package_pool;
39 timer_package_pool = p;
40}
41*/
42
43enum timer_state {
44 STATE_INACTIVE = 0,
45 STATE_ACTIVE,
46 STATE_CALLBACK
47};
48
49struct timer {
50 enum timer_state state;
51 timer *_prev;
52 timer *_next;
53 timer_callback cb;
54 void *userdata;
55 uint64_t deadline;
56};
57
58static timer *timer_main_queue;
59static timer *timer_us_queue; /* hi-speed queue */
60
61inline static void timer_dequeue(timer *t, timer **queue)
62{
63 if (t->state == STATE_INACTIVE) return; /* not in a queue */
64
65 if (t->_prev) {
66 t->_prev->_next = t->_next;
67 } else {
68 *queue = t->_next;
69 }
70
71 if (t->_next) t->_next->_prev = t->_prev;
72
73 t->state = STATE_INACTIVE;
74}
75
76static void timer_enqueue(timer *t, timer **queue, timer *prev)
77{
78 t->state = STATE_ACTIVE;
79
80 while (true) {
81 if (!*queue) {
82 t->_next = 0;
83 t->_prev = prev;
84 *queue = t;
85 return;
86 }
87
88 if ((*queue)->deadline > t->deadline) {
89 (*queue)->_prev = t;
90 t->_next = *queue;
91 t->_prev = prev;
92 *queue = t;
93 return;
94 }
95
96 prev = *queue;
97 queue = &((*queue)->_next);
98 }
99}
100
101/*** interface ***/
102
103void timer_init()
104{
105 /* Nothing needs to be done... yet. */
106}
107
108/* Do not depend on fields being zeroed */
109static timer *timer_pool; /* timer_pool is SINGLY LINKED!! */
110
111timer *new_timer(void)
112{
113 timer *ret;
114
115 if (timer_pool) {
116 ret = timer_pool;
117 timer_pool = timer_pool->_next;
118 } else {
119 ret = calloc(1, sizeof(struct timer));
120 }
121
122 ret->state = STATE_INACTIVE;
123 return ret;
124}
125
126void delete_timer(timer *t)
127{
128 timer_dequeue(t, &timer_main_queue);
129 t->_next = timer_pool;
130 t->state = STATE_INACTIVE;
131 timer_pool = t;
132}
133
134void timer_setup(timer *t, timer_callback cb, void *userarg)
135{
136 t->cb = cb;
137 t->userdata = userarg;
138}
139
140void *timer_get_userdata(timer *t)
141{
142 return t->userdata;
143}
144
145static void timer_delay_us(timer *t, int us)
146{
147 t->deadline += us;
148 timer **queue = t->_prev ? &(t->_prev->_next) : &timer_main_queue;
149 timer_dequeue(t, &timer_main_queue);
150 timer_enqueue(t, queue, t->_prev);
151}
152
153/* Starts the timer so that it's called in sec seconds in the future.
154 * A non-positive value of sec results in the callback being called immediately.
155 * This function may be called again after a timer has been started to adjust
156 * the expiry time. */
157void timer_start(timer *t, int sec)
158{
159 uint64_t newdeadline = current_time() + sec * US_PER_SECOND;
160
161 if (timer_is_active(t)) {
162 if (t->deadline < newdeadline) {
163 timer_delay_us(t, newdeadline - t->deadline);
164 return;
165 }
166
167 timer_dequeue(t, &timer_main_queue);
168 }
169
170 t->deadline = newdeadline;
171 timer_enqueue(t, &timer_main_queue, 0);
172}
173
174/* Stops the timer. Returns -1 if the timer was not active. */
175int timer_stop(timer *t)
176{
177 int ret = timer_is_active(t) ? -1 : 0;
178 timer_dequeue(t, &timer_main_queue);
179 return ret;
180}
181
182/* Adds additionalsec seconds to the timer.
183 * Returns -1 and does nothing if the timer was not active. */
184int timer_delay(timer *t, int additonalsec)
185{
186 if (!timer_is_active(t)) return -1;
187
188 timer_delay_us(t, additonalsec * US_PER_SECOND);
189 return 0;
190}
191
192static uint64_t timer_diff(timer *t, uint64_t time)
193{
194 if (t->deadline <= time) return 0;
195
196 return time - t->deadline;
197}
198
199/* Returns the time remaining on a timer in seconds.
200 * Returns -1 if the timer is not active.
201 * Returns 0 if the timer has expired and will be called upon the next call to timer_poll. */
202int timer_time_remaining(timer *t)
203{
204 if (!timer_is_active(t)) return -1;
205
206 return timer_diff(t, current_time()) / US_PER_SECOND;
207}
208
209bool timer_is_active(timer *t)
210{
211 return t->state != STATE_INACTIVE;
212}
213
214/* Single-use timer.
215 * Creates a new timer, preforms setup and starts it. */
216void timer_single(timer_callback cb, void *userarg, int sec)
217{
218 timer *t = new_timer();
219 timer_setup(t, cb, userarg);
220 timer_start(t, sec);
221}
222
223/* Single-use microsecond timer. */
224void timer_us(timer_callback cb, void *userarg, int us)
225{
226 timer *t = new_timer();
227 timer_setup(t, cb, userarg);
228 t->deadline = current_time() + us;
229 t->state = STATE_ACTIVE;
230 timer_enqueue(t, &timer_us_queue, 0);
231}
232
233uint64_t prevtime = 0;
234void timer_poll(void)
235{
236 uint64_t time = current_time();
237
238 /* Handle millisecond timers */
239 while (timer_us_queue) {
240 if (timer_diff(timer_us_queue, time) != 0) break;
241
242 timer *t = timer_us_queue;
243 timer_dequeue(t, &timer_us_queue);
244 t->cb(0, t->userdata);
245 delete_timer(t);
246 }
247
248 if (time - prevtime > US_PER_SECOND || prevtime == 0 || prevtime > time) {
249 /* time moving backwards is just a sanity check */
250 prevtime = time;
251
252 while (timer_main_queue) {
253 if (timer_diff(timer_main_queue, time) != 0) break;
254
255 timer *t = timer_main_queue;
256 t->state = STATE_CALLBACK;
257 int rv = t->cb(t, t->userdata);
258
259 if (rv != 0) {
260 timer_dequeue(t, &timer_main_queue);
261 delete_timer(t);
262 continue;
263 }
264
265 if (t->state != STATE_ACTIVE) {
266 timer_dequeue(t, &timer_main_queue);
267 }
268 }
269 }
270}
271
272/*** Internal Testing ***/
273
274/* I do not want to expose internals to the public,
275 * which is why internals testing is done this way. */
276void timer_internal_tests(bool (*assert)(bool, char *))
277{
278
279}
280
281void timer_debug_print()
282{
283 timer *t = timer_main_queue;
284 printf("Queue:\n");
285
286 while (t) {
287 printf("%" PRIu64 " (%" PRIu64 ") : %s\n", t->deadline, t->deadline / US_PER_SECOND, (char *)t->userdata);
288 t = t->_next;
289 }
290}
diff --git a/other/unused/timer.h b/other/unused/timer.h
deleted file mode 100644
index 15491326..00000000
--- a/other/unused/timer.h
+++ /dev/null
@@ -1,104 +0,0 @@
1/* timer.h
2 *
3 * Timing subsystem. Provides deadline timers.
4 * All times are aliased to a second for efficiency.
5 *
6 * Timer Guarantees:
7 * - The callback will not be called before the timer expires.
8 * - The callback will be called sometime after the timer expires,
9 * on a best effort basis.
10 * - If timer_poll is called at least once a second, the callback
11 * will be called at most one second after it expires.
12 *
13 * Copyright (C) 2013 Tox project All Rights Reserved.
14 *
15 * This file is part of Tox.
16 *
17 * Tox is free software: you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation, either version 3 of the License, or
20 * (at your option) any later version.
21 *
22 * Tox is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * You should have received a copy of the GNU General Public License
28 * along with Tox. If not, see <http://www.gnu.org/licenses/>.
29 *
30 */
31
32#ifndef TIMER_H
33#define TIMER_H
34
35#include <stdint.h>
36#include <stdbool.h>
37
38#define US_PER_SECOND 1000000 /* 1 s = 10^6 us */
39
40struct timer;
41typedef struct timer timer;
42
43/* If time_callback returns a non-zero value, timer t is deleted.
44 * You may call any of the timer functions within the callback:
45 * For example, you may call timer_start to restart the timer from
46 * within a callback. */
47typedef int (*timer_callback)(timer *t, void *userarg);
48
49/* Initisalise timer subsystem */
50void timer_init(void);
51
52/* Poll. (I will eventually replace all polling in Tox with an async system.) */
53void timer_poll(void);
54
55/* Creates a new timer. Does not enqueue/start it. */
56timer *new_timer(void);
57
58/* Destroys a timer instance. */
59void delete_timer(timer *t);
60
61/* Sets up the timer callback. */
62void timer_setup(timer *t, timer_callback cb, void *userarg);
63
64/* Accessor Function. */
65void *timer_get_userdata(timer *t);
66
67/* Starts the timer so that it's called in sec seconds in the future from now.
68 * A non-positive value of sec results in the callback being called immediately.
69 * This function may be called again after a timer has been started to adjust
70 * the expiry time. */
71void timer_start(timer *t, int sec);
72
73/* Stops the timer. Returns -1 if the timer was not active. */
74int timer_stop(timer *t);
75
76/* Adds additionalsec seconds to the timer.
77 * Returns -1 and does nothing if the timer was not active. */
78int timer_delay(timer *t, int additonalsec);
79
80/* Returns the time remaining on a timer in seconds.
81 * Returns -1 if the timer is not active.
82 * Returns 0 if the timer has expired and the callback hasn't been called yet. */
83int timer_time_remaining(timer *t);
84
85/* Determines if timer is active. Returns TRUE if it is active */
86bool timer_is_active(timer *t);
87
88/* Single-use timer.
89 * Creates a new timer, preforms setup and starts it.
90 * Callback must return a non-zero value to prevent memory leak. */
91void timer_single(timer_callback cb, void *userarg, int sec);
92
93/* Single-use microsecond timer.
94 * Creates a new timer, preforms setup and starts it.
95 * Please do not use this when accuracy is not absolutely required.
96 * Use when one needs to time a period < 1 s.
97 * Use the more coarse timers above for periods > 5 s.
98 * WARNING: the callback will be called with NULL as the first argument */
99void timer_us(timer_callback cb, void *userarg, int us);
100
101/* Internal Testing */
102void timer_internal_tests(bool( *)(bool, char *));
103
104#endif
diff --git a/testing/DHT_test.c b/testing/DHT_test.c
index 53369794..d14f9781 100644
--- a/testing/DHT_test.c
+++ b/testing/DHT_test.c
@@ -28,8 +28,8 @@
28 */ 28 */
29 29
30//#include "../core/network.h" 30//#include "../core/network.h"
31#include "../core/DHT.h" 31#include "../toxcore/DHT.h"
32#include "../core/friend_requests.h" 32#include "../toxcore/friend_requests.h"
33#include "misc_tools.h" 33#include "misc_tools.h"
34 34
35#include <string.h> 35#include <string.h>
diff --git a/testing/Lossless_UDP_testclient.c b/testing/Lossless_UDP_testclient.c
index 09e9e0a3..af349863 100644
--- a/testing/Lossless_UDP_testclient.c
+++ b/testing/Lossless_UDP_testclient.c
@@ -28,8 +28,8 @@
28 * 28 *
29 */ 29 */
30 30
31#include "../core/network.h" 31#include "../toxcore/network.h"
32#include "../core/Lossless_UDP.h" 32#include "../toxcore/Lossless_UDP.h"
33 33
34#ifdef WIN32 34#ifdef WIN32
35 35
diff --git a/testing/Lossless_UDP_testserver.c b/testing/Lossless_UDP_testserver.c
index a82b787a..5c2cabd0 100644
--- a/testing/Lossless_UDP_testserver.c
+++ b/testing/Lossless_UDP_testserver.c
@@ -28,8 +28,8 @@
28 * 28 *
29 */ 29 */
30 30
31#include "../core/network.h" 31#include "../toxcore/network.h"
32#include "../core/Lossless_UDP.h" 32#include "../toxcore/Lossless_UDP.h"
33 33
34//Sleep function (x = milliseconds) 34//Sleep function (x = milliseconds)
35#ifdef WIN32 35#ifdef WIN32
diff --git a/testing/Messenger_test.c b/testing/Messenger_test.c
index c76584d7..19fd9ab7 100644
--- a/testing/Messenger_test.c
+++ b/testing/Messenger_test.c
@@ -37,7 +37,7 @@
37 * 37 *
38 */ 38 */
39 39
40#include "../core/Messenger.h" 40#include "../toxcore/Messenger.h"
41#include "misc_tools.h" 41#include "misc_tools.h"
42 42
43#ifdef WIN32 43#ifdef WIN32
diff --git a/testing/crypto_speed_test.c b/testing/crypto_speed_test.c
index a61b30e8..b06c25e1 100644
--- a/testing/crypto_speed_test.c
+++ b/testing/crypto_speed_test.c
@@ -28,7 +28,7 @@ double get_time()
28 28
29#endif 29#endif
30 30
31#include "../core/net_crypto.h" 31#include "../toxcore/net_crypto.h"
32#include <stdlib.h> 32#include <stdlib.h>
33#include <time.h> 33#include <time.h>
34 34
diff --git a/testing/nTox.h b/testing/nTox.h
index b27a956f..df9d404a 100644
--- a/testing/nTox.h
+++ b/testing/nTox.h
@@ -35,7 +35,7 @@
35#include <arpa/inet.h> 35#include <arpa/inet.h>
36#include <sys/types.h> 36#include <sys/types.h>
37#include <netdb.h> 37#include <netdb.h>
38#include "../core/tox.h" 38#include "../toxcore/tox.h"
39 39
40#define STRING_LENGTH 256 40#define STRING_LENGTH 256
41#define HISTORY 50 41#define HISTORY 50
diff --git a/core/CMakeLists.txt b/toxcore/CMakeLists.txt
index ecbb65c2..ecbb65c2 100644
--- a/core/CMakeLists.txt
+++ b/toxcore/CMakeLists.txt
diff --git a/core/DHT.c b/toxcore/DHT.c
index 533425c4..533425c4 100644
--- a/core/DHT.c
+++ b/toxcore/DHT.c
diff --git a/core/DHT.h b/toxcore/DHT.h
index 6295581b..6295581b 100644
--- a/core/DHT.h
+++ b/toxcore/DHT.h
diff --git a/core/LAN_discovery.c b/toxcore/LAN_discovery.c
index 49f52ce7..49f52ce7 100644
--- a/core/LAN_discovery.c
+++ b/toxcore/LAN_discovery.c
diff --git a/core/LAN_discovery.h b/toxcore/LAN_discovery.h
index 5a790331..5a790331 100644
--- a/core/LAN_discovery.h
+++ b/toxcore/LAN_discovery.h
diff --git a/core/Lossless_UDP.c b/toxcore/Lossless_UDP.c
index c30eb903..c30eb903 100644
--- a/core/Lossless_UDP.c
+++ b/toxcore/Lossless_UDP.c
diff --git a/core/Lossless_UDP.h b/toxcore/Lossless_UDP.h
index 176e86ce..176e86ce 100644
--- a/core/Lossless_UDP.h
+++ b/toxcore/Lossless_UDP.h
diff --git a/core/Messenger.c b/toxcore/Messenger.c
index c5dd8a40..c5dd8a40 100644
--- a/core/Messenger.c
+++ b/toxcore/Messenger.c
diff --git a/core/Messenger.h b/toxcore/Messenger.h
index e808529f..e808529f 100644
--- a/core/Messenger.h
+++ b/toxcore/Messenger.h
diff --git a/core/friend_requests.c b/toxcore/friend_requests.c
index d8c6858b..d8c6858b 100644
--- a/core/friend_requests.c
+++ b/toxcore/friend_requests.c
diff --git a/core/friend_requests.h b/toxcore/friend_requests.h
index 2ebd557b..2ebd557b 100644
--- a/core/friend_requests.h
+++ b/toxcore/friend_requests.h
diff --git a/core/net_crypto.c b/toxcore/net_crypto.c
index f421c37d..f421c37d 100644
--- a/core/net_crypto.c
+++ b/toxcore/net_crypto.c
diff --git a/core/net_crypto.h b/toxcore/net_crypto.h
index 81670993..81670993 100644
--- a/core/net_crypto.h
+++ b/toxcore/net_crypto.h
diff --git a/core/network.c b/toxcore/network.c
index 2bcf7d61..2bcf7d61 100644
--- a/core/network.c
+++ b/toxcore/network.c
diff --git a/core/network.h b/toxcore/network.h
index 3547f79b..3547f79b 100644
--- a/core/network.h
+++ b/toxcore/network.h
diff --git a/core/packets.h b/toxcore/packets.h
index 4f410fb3..4f410fb3 100644
--- a/core/packets.h
+++ b/toxcore/packets.h
diff --git a/core/ping.c b/toxcore/ping.c
index 55d4d261..55d4d261 100644
--- a/core/ping.c
+++ b/toxcore/ping.c
diff --git a/core/ping.h b/toxcore/ping.h
index c04ec80e..c04ec80e 100644
--- a/core/ping.h
+++ b/toxcore/ping.h
diff --git a/core/tox.c b/toxcore/tox.c
index a97e52bc..a97e52bc 100644
--- a/core/tox.c
+++ b/toxcore/tox.c
diff --git a/core/tox.h b/toxcore/tox.h
index bdfac1d6..bdfac1d6 100644
--- a/core/tox.h
+++ b/toxcore/tox.h
diff --git a/core/util.c b/toxcore/util.c
index 6f346db1..6f346db1 100644
--- a/core/util.c
+++ b/toxcore/util.c
diff --git a/core/util.h b/toxcore/util.h
index 5209c2ca..5209c2ca 100644
--- a/core/util.h
+++ b/toxcore/util.h