c-libp2p/include/libp2p/conn/transport_dialer.h

18 lines
681 B
C
Raw Normal View History

2017-02-13 18:26:41 +00:00
#pragma once
#include "multiaddr/multiaddr.h"
2017-10-23 23:03:38 +00:00
#include "libp2p/net/stream.h"
2017-02-13 18:26:41 +00:00
#include "libp2p/utils/linked_list.h"
struct TransportDialer {
char* peer_id;
2017-10-25 17:43:27 +00:00
struct RsaPrivateKey* private_key;
2017-03-02 21:14:52 +00:00
int (*can_handle)(const struct MultiAddress* multiaddr);
2017-10-23 23:03:38 +00:00
struct Stream* (*dial)(const struct TransportDialer* transport_dialer, const struct MultiAddress* multiaddr);
2017-02-13 18:26:41 +00:00
};
2017-10-25 17:43:27 +00:00
struct TransportDialer* libp2p_conn_transport_dialer_new(char* peer_id, struct RsaPrivateKey* private_key);
2017-02-13 18:26:41 +00:00
void libp2p_conn_transport_dialer_free(struct TransportDialer* in);
2017-10-23 23:03:38 +00:00
struct Stream* libp2p_conn_transport_dialer_get(const struct Libp2pLinkedList* transport_dialers, const struct MultiAddress* multiaddr);