diff options
author | irungentoo <irungentoo@gmail.com> | 2013-08-10 14:21:06 -0700 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-08-10 14:21:06 -0700 |
commit | 6c2b2806d10881a4c44a47e877898e9de1cc63c9 (patch) | |
tree | 2879741f06260a5390ae619954f53f141ba4ce54 /core/DHT.h | |
parent | 341de59bb627600c27ef29b113fa71bac120350f (diff) | |
parent | 5b6465528f88c4ed45fe57d5c2c21270f9109bb9 (diff) |
Merge pull request #415 from slvr/pr
Beginning to centralise packet handling
Diffstat (limited to 'core/DHT.h')
-rw-r--r-- | core/DHT.h | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -58,11 +58,6 @@ IP_Port DHT_getfriendip(uint8_t *client_id); | |||
58 | /* Run this function at least a couple times per second (It's the main loop) */ | 58 | /* Run this function at least a couple times per second (It's the main loop) */ |
59 | void doDHT(void); | 59 | void doDHT(void); |
60 | 60 | ||
61 | /* if we receive a DHT packet we call this function so it can be handled. | ||
62 | return 0 if packet is handled correctly. | ||
63 | return 1 if it didn't handle the packet or if the packet was shit. */ | ||
64 | int DHT_handlepacket(uint8_t *packet, uint32_t length, IP_Port source); | ||
65 | |||
66 | /* Use this function to bootstrap the client | 61 | /* Use this function to bootstrap the client |
67 | Sends a get nodes request to the given node with ip port and public_key */ | 62 | Sends a get nodes request to the given node with ip port and public_key */ |
68 | void DHT_bootstrap(IP_Port ip_port, uint8_t *public_key); | 63 | void DHT_bootstrap(IP_Port ip_port, uint8_t *public_key); |
@@ -93,6 +88,9 @@ uint32_t DHT_size(void); | |||
93 | /* save the DHT in data where data is an array of size DHT_size() */ | 88 | /* save the DHT in data where data is an array of size DHT_size() */ |
94 | void DHT_save(uint8_t *data); | 89 | void DHT_save(uint8_t *data); |
95 | 90 | ||
91 | /* init DHT */ | ||
92 | void DHT_init(void); | ||
93 | |||
96 | /* load the DHT from data of size size; | 94 | /* load the DHT from data of size size; |
97 | return -1 if failure | 95 | return -1 if failure |
98 | return 0 if success */ | 96 | return 0 if success */ |