diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/DHT.c | 10 | ||||
-rw-r--r-- | core/LAN_discovery.c | 2 | ||||
-rw-r--r-- | core/Lossless_UDP.c | 6 | ||||
-rw-r--r-- | core/Messenger.c | 22 | ||||
-rw-r--r-- | core/friend_requests.c | 2 | ||||
-rw-r--r-- | core/network.c | 22 |
6 files changed, 32 insertions, 32 deletions
@@ -1076,11 +1076,11 @@ static void doNAT(void) | |||
1076 | 1076 | ||
1077 | void DHT_init(void) | 1077 | void DHT_init(void) |
1078 | { | 1078 | { |
1079 | networking_registerhandler(0, &handle_ping_request); | 1079 | networking_registerhandler(0, &handle_ping_request); |
1080 | networking_registerhandler(1, &handle_ping_response); | 1080 | networking_registerhandler(1, &handle_ping_response); |
1081 | networking_registerhandler(2, &handle_getnodes); | 1081 | networking_registerhandler(2, &handle_getnodes); |
1082 | networking_registerhandler(3, &handle_sendnodes); | 1082 | networking_registerhandler(3, &handle_sendnodes); |
1083 | networking_registerhandler(254, &handle_NATping); | 1083 | networking_registerhandler(254, &handle_NATping); |
1084 | } | 1084 | } |
1085 | 1085 | ||
1086 | void doDHT(void) | 1086 | void doDHT(void) |
diff --git a/core/LAN_discovery.c b/core/LAN_discovery.c index 43eb7d42..67dc656b 100644 --- a/core/LAN_discovery.c +++ b/core/LAN_discovery.c | |||
@@ -134,5 +134,5 @@ int send_LANdiscovery(uint16_t port) | |||
134 | 134 | ||
135 | void LANdiscovery_init(void) | 135 | void LANdiscovery_init(void) |
136 | { | 136 | { |
137 | networking_registerhandler(33, &handle_LANdiscovery); | 137 | networking_registerhandler(33, &handle_LANdiscovery); |
138 | } | 138 | } |
diff --git a/core/Lossless_UDP.c b/core/Lossless_UDP.c index d72a2c63..002e2cf8 100644 --- a/core/Lossless_UDP.c +++ b/core/Lossless_UDP.c | |||
@@ -772,9 +772,9 @@ static int handle_data(IP_Port source, uint8_t *packet, uint32_t length) | |||
772 | 772 | ||
773 | void LosslessUDP_init(void) | 773 | void LosslessUDP_init(void) |
774 | { | 774 | { |
775 | networking_registerhandler(16, &handle_handshake); | 775 | networking_registerhandler(16, &handle_handshake); |
776 | networking_registerhandler(17, &handle_SYNC); | 776 | networking_registerhandler(17, &handle_SYNC); |
777 | networking_registerhandler(18, &handle_data); | 777 | networking_registerhandler(18, &handle_data); |
778 | } | 778 | } |
779 | 779 | ||
780 | /* | 780 | /* |
diff --git a/core/Messenger.c b/core/Messenger.c index a7d21e1a..bc18c86a 100644 --- a/core/Messenger.c +++ b/core/Messenger.c | |||
@@ -517,10 +517,10 @@ int initMessenger(void) | |||
517 | if(init_networking(ip,PORT) == -1) | 517 | if(init_networking(ip,PORT) == -1) |
518 | return -1; | 518 | return -1; |
519 | 519 | ||
520 | DHT_init(); | 520 | DHT_init(); |
521 | LosslessUDP_init(); | 521 | LosslessUDP_init(); |
522 | friendreq_init(); | 522 | friendreq_init(); |
523 | LANdiscovery_init(); | 523 | LANdiscovery_init(); |
524 | 524 | ||
525 | return 0; | 525 | return 0; |
526 | } | 526 | } |
@@ -688,14 +688,14 @@ static void LANdiscovery(void) | |||
688 | /* the main loop that needs to be run at least 200 times per second. */ | 688 | /* the main loop that needs to be run at least 200 times per second. */ |
689 | void doMessenger(void) | 689 | void doMessenger(void) |
690 | { | 690 | { |
691 | networking_poll(); | 691 | networking_poll(); |
692 | 692 | ||
693 | doDHT(); | 693 | doDHT(); |
694 | doLossless_UDP(); | 694 | doLossless_UDP(); |
695 | doNetCrypto(); | 695 | doNetCrypto(); |
696 | doInbound(); | 696 | doInbound(); |
697 | doFriends(); | 697 | doFriends(); |
698 | LANdiscovery(); | 698 | LANdiscovery(); |
699 | } | 699 | } |
700 | 700 | ||
701 | /* returns the size of the messenger data (for saving) */ | 701 | /* returns the size of the messenger data (for saving) */ |
diff --git a/core/friend_requests.c b/core/friend_requests.c index 013232ee..422cc028 100644 --- a/core/friend_requests.c +++ b/core/friend_requests.c | |||
@@ -132,5 +132,5 @@ static int friendreq_handlepacket(IP_Port source, uint8_t * packet, uint32_t len | |||
132 | 132 | ||
133 | void friendreq_init(void) | 133 | void friendreq_init(void) |
134 | { | 134 | { |
135 | networking_registerhandler(32, &friendreq_handlepacket); | 135 | networking_registerhandler(32, &friendreq_handlepacket); |
136 | } | 136 | } |
diff --git a/core/network.c b/core/network.c index 89697e76..7e3b344a 100644 --- a/core/network.c +++ b/core/network.c | |||
@@ -92,21 +92,21 @@ static packet_handler_callback packethandlers[256] = {0}; | |||
92 | 92 | ||
93 | void networking_registerhandler(uint8_t byte, packet_handler_callback cb) | 93 | void networking_registerhandler(uint8_t byte, packet_handler_callback cb) |
94 | { | 94 | { |
95 | packethandlers[byte] = cb; | 95 | packethandlers[byte] = cb; |
96 | } | 96 | } |
97 | 97 | ||
98 | void networking_poll() | 98 | void networking_poll() |
99 | { | 99 | { |
100 | IP_Port ip_port; | 100 | IP_Port ip_port; |
101 | uint8_t data[MAX_UDP_PACKET_SIZE]; | 101 | uint8_t data[MAX_UDP_PACKET_SIZE]; |
102 | uint32_t length; | 102 | uint32_t length; |
103 | 103 | ||
104 | while (receivepacket(&ip_port, data, &length) != -1) | 104 | while (receivepacket(&ip_port, data, &length) != -1) |
105 | { | 105 | { |
106 | if (length < 1) continue; | 106 | if (length < 1) continue; |
107 | if (!packethandlers[data[0]]) continue; | 107 | if (!packethandlers[data[0]]) continue; |
108 | packethandlers[data[0]](ip_port, data, length); | 108 | packethandlers[data[0]](ip_port, data, length); |
109 | } | 109 | } |
110 | } | 110 | } |
111 | 111 | ||
112 | /* initialize networking | 112 | /* initialize networking |