2017-03-09 12:43:24 +00:00
|
|
|
#pragma once
|
|
|
|
|
2017-03-24 21:50:02 +00:00
|
|
|
#include "libp2p/utils/vector.h"
|
2017-03-24 19:11:54 +00:00
|
|
|
#include "multiaddr/multiaddr.h"
|
|
|
|
|
2017-03-24 21:50:02 +00:00
|
|
|
int start_kademlia(int sock, int family, char* peer_id, int timeout, struct Libp2pVector* bootstrap_addresses);
|
|
|
|
int start_kademlia_multiaddress(struct MultiAddress* multiaddress, char* peer_id, int timeout, struct Libp2pVector* bootstrap_addresses);
|
2017-03-09 12:43:24 +00:00
|
|
|
void stop_kademlia (void);
|
|
|
|
|
|
|
|
void *kademlia_thread (void *ptr);
|
|
|
|
void *announce_thread (void *ptr);
|
|
|
|
|
|
|
|
int announce_kademlia (char* peer_id, uint16_t port);
|
2017-03-30 18:58:53 +00:00
|
|
|
|
|
|
|
/***
|
|
|
|
* Search for a hash
|
|
|
|
* @param peer_id the hash to search for
|
|
|
|
* @param timeout timeout in seconds
|
|
|
|
* @returns an array of MultiAddress
|
|
|
|
*/
|
2017-03-16 08:45:44 +00:00
|
|
|
struct MultiAddress** search_kademlia(char* peer_id, int timeout);
|
2017-03-09 12:43:24 +00:00
|
|
|
|
|
|
|
int ping_kademlia (char *ip, uint16_t port);
|