summaryrefslogtreecommitdiff
path: root/other/bootstrap_daemon/src/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'other/bootstrap_daemon/src/config.c')
-rw-r--r--other/bootstrap_daemon/src/config.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/other/bootstrap_daemon/src/config.c b/other/bootstrap_daemon/src/config.c
index 84e18a69..861a3803 100644
--- a/other/bootstrap_daemon/src/config.c
+++ b/other/bootstrap_daemon/src/config.c
@@ -35,12 +35,13 @@
35 35
36#include "../../bootstrap_node_packets.h" 36#include "../../bootstrap_node_packets.h"
37 37
38// Parses tcp relay ports from `cfg` and puts them into `tcp_relay_ports` array 38/**
39// 39 * Parses tcp relay ports from `cfg` and puts them into `tcp_relay_ports` array.
40// Supposed to be called from get_general_config only 40 *
41// 41 * Supposed to be called from get_general_config only.
42// Important: iff `tcp_relay_port_count` > 0, then you are responsible for freeing `tcp_relay_ports` 42 *
43 43 * Important: iff `tcp_relay_port_count` > 0, then you are responsible for freeing `tcp_relay_ports`.
44 */
44void parse_tcp_relay_ports_config(config_t *cfg, uint16_t **tcp_relay_ports, int *tcp_relay_port_count) 45void parse_tcp_relay_ports_config(config_t *cfg, uint16_t **tcp_relay_ports, int *tcp_relay_port_count)
45{ 46{
46 const char *NAME_TCP_RELAY_PORTS = "tcp_relay_ports"; 47 const char *NAME_TCP_RELAY_PORTS = "tcp_relay_ports";
@@ -294,13 +295,15 @@ int get_general_config(const char *cfg_file_path, char **pid_file_path, char **k
294 return 1; 295 return 1;
295} 296}
296 297
297// Converts a hex string with even number of characters into binary 298/**
298// 299 *
299// You are responsible for freeing the return value! 300 * Converts a hex string with even number of characters into binary.
300// 301 *
301// Returns binary on success, 302 * Important: You are responsible for freeing the return value.
302// NULL on failure 303 *
303 304 * @return binary on success,
305 * NULL on failure.
306 */
304uint8_t *hex_string_to_bin(char *hex_string) 307uint8_t *hex_string_to_bin(char *hex_string)
305{ 308{
306 if (strlen(hex_string) % 2 != 0) { 309 if (strlen(hex_string) % 2 != 0) {