c-libp2p/include/libp2p/utils/multiaddress.h

14 lines
545 B
C
Raw Normal View History

2017-03-02 21:14:52 +00:00
#pragma once
#include "multiaddr/multiaddr.h"
/**
* This is a hack to get ip4/tcp working
* TODO: this should be moved further down in the networking stack and generified for different multiaddresses
* This makes too many assumptions
* @param address the multiaddress to parse
* @param ip the first IP address in the multiaddress
* @param port the first port in the multiaddress
* @returns true(1) on success, false(0) on failure
*/
int libp2p_utils_multiaddress_parse_ip4_tcp(const struct MultiAddress* address, char** ip, int* port);