summaryrefslogtreecommitdiff
path: root/core/Messenger.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/Messenger.c')
-rw-r--r--core/Messenger.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/Messenger.c b/core/Messenger.c
index c768633e..dee6eefc 100644
--- a/core/Messenger.c
+++ b/core/Messenger.c
@@ -363,7 +363,7 @@ void m_callback_userstatus(void (*function)(int, uint8_t *, uint16_t))
363 363
364#define PORT 33445 364#define PORT 33445
365/* run this at startup */ 365/* run this at startup */
366int initMessenger() 366int initMessenger(void)
367{ 367{
368 new_keys(); 368 new_keys();
369 m_set_userstatus((uint8_t*)"Online", sizeof("Online")); 369 m_set_userstatus((uint8_t*)"Online", sizeof("Online"));
@@ -378,7 +378,7 @@ int initMessenger()
378} 378}
379 379
380//TODO: make this function not suck. 380//TODO: make this function not suck.
381static void doFriends() 381static void doFriends(void)
382{ 382{
383 /* TODO: add incoming connections and some other stuff. */ 383 /* TODO: add incoming connections and some other stuff. */
384 uint32_t i; 384 uint32_t i;
@@ -464,7 +464,7 @@ static void doFriends()
464 } 464 }
465} 465}
466 466
467static void doInbound() 467static void doInbound(void)
468{ 468{
469 uint8_t secret_nonce[crypto_box_NONCEBYTES]; 469 uint8_t secret_nonce[crypto_box_NONCEBYTES];
470 uint8_t public_key[crypto_box_PUBLICKEYBYTES]; 470 uint8_t public_key[crypto_box_PUBLICKEYBYTES];
@@ -488,7 +488,7 @@ static void doInbound()
488static uint64_t last_LANdiscovery; 488static uint64_t last_LANdiscovery;
489 489
490/*Send a LAN discovery packet every LAN_DISCOVERY_INTERVAL seconds*/ 490/*Send a LAN discovery packet every LAN_DISCOVERY_INTERVAL seconds*/
491static void LANdiscovery() 491static void LANdiscovery(void)
492{ 492{
493 if (last_LANdiscovery + LAN_DISCOVERY_INTERVAL < unix_time()) { 493 if (last_LANdiscovery + LAN_DISCOVERY_INTERVAL < unix_time()) {
494 send_LANdiscovery(htons(PORT)); 494 send_LANdiscovery(htons(PORT));
@@ -498,7 +498,7 @@ static void LANdiscovery()
498 498
499 499
500/* the main loop that needs to be run at least 200 times per second. */ 500/* the main loop that needs to be run at least 200 times per second. */
501void doMessenger() 501void doMessenger(void)
502{ 502{
503 IP_Port ip_port; 503 IP_Port ip_port;
504 uint8_t data[MAX_UDP_PACKET_SIZE]; 504 uint8_t data[MAX_UDP_PACKET_SIZE];
@@ -532,7 +532,7 @@ void doMessenger()
532} 532}
533 533
534/* returns the size of the messenger data (for saving) */ 534/* returns the size of the messenger data (for saving) */
535uint32_t Messenger_size() 535uint32_t Messenger_size(void)
536{ 536{
537 return crypto_box_PUBLICKEYBYTES + crypto_box_SECRETKEYBYTES 537 return crypto_box_PUBLICKEYBYTES + crypto_box_SECRETKEYBYTES
538 + sizeof(uint32_t) + DHT_size() + sizeof(uint32_t) + sizeof(Friend) * numfriends; 538 + sizeof(uint32_t) + DHT_size() + sizeof(uint32_t) + sizeof(Friend) * numfriends;