2016-11-02 18:09:38 +00:00
|
|
|
#ifndef addresses_h
|
|
|
|
#define addresses_h
|
|
|
|
|
2017-03-19 12:47:19 +00:00
|
|
|
#include "libp2p/utils/linked_list.h"
|
2016-11-02 18:09:38 +00:00
|
|
|
#include "swarm.h"
|
|
|
|
|
|
|
|
struct Addresses {
|
2017-04-03 16:55:36 +00:00
|
|
|
// list of strings in format "/family/address/type/port"
|
2017-03-19 12:47:19 +00:00
|
|
|
struct Libp2pLinkedList* swarm_head;
|
2017-04-03 16:55:36 +00:00
|
|
|
// info for api connection
|
2016-11-02 18:09:38 +00:00
|
|
|
char* api;
|
2017-04-03 16:55:36 +00:00
|
|
|
// info for http gateway
|
2016-11-02 18:09:38 +00:00
|
|
|
char* gateway;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* initialize the Addresses struct with data. Must add the SwarmAddresses later
|
|
|
|
* @param addresses the struct
|
|
|
|
* @returns true(1) on success, otherwise false(0)
|
|
|
|
*/
|
2017-04-17 16:58:47 +00:00
|
|
|
int repo_config_addresses_new(struct Addresses** addresses);
|
2016-11-02 18:09:38 +00:00
|
|
|
|
|
|
|
/**
|
2016-11-28 13:09:00 +00:00
|
|
|
* clear any memory allocated by a address_new call
|
2016-11-02 18:09:38 +00:00
|
|
|
* @param addresses the struct
|
|
|
|
* @returns true(1)
|
|
|
|
*/
|
|
|
|
int repo_config_addresses_free(struct Addresses* addresses);
|
|
|
|
|
|
|
|
#endif /* addresses_h */
|