2017-02-13 18:26:41 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "multiaddr/multiaddr.h"
|
|
|
|
#include "libp2p/utils/linked_list.h"
|
|
|
|
|
|
|
|
struct TransportDialer {
|
2017-02-15 17:04:10 +00:00
|
|
|
char* peer_id;
|
|
|
|
struct PrivateKey* private_key;
|
2017-03-02 21:14:52 +00:00
|
|
|
int (*can_handle)(const struct MultiAddress* multiaddr);
|
|
|
|
struct Connection* (*dial)(const struct TransportDialer* transport_dialer, const struct MultiAddress* multiaddr);
|
2017-02-13 18:26:41 +00:00
|
|
|
};
|
|
|
|
|
2017-02-15 17:04:10 +00:00
|
|
|
struct TransportDialer* libp2p_conn_transport_dialer_new(char* peer_id, struct PrivateKey* private_key);
|
2017-02-13 18:26:41 +00:00
|
|
|
void libp2p_conn_transport_dialer_free(struct TransportDialer* in);
|
|
|
|
|
2017-03-02 21:14:52 +00:00
|
|
|
struct Connection* libp2p_conn_transport_dialer_get(const struct Libp2pLinkedList* transport_dialers, const struct MultiAddress* multiaddr);
|