summaryrefslogtreecommitdiff
path: root/other/bootstrap_daemon/src/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'other/bootstrap_daemon/src/config.h')
-rw-r--r--other/bootstrap_daemon/src/config.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/other/bootstrap_daemon/src/config.h b/other/bootstrap_daemon/src/config.h
new file mode 100644
index 00000000..73bc6e0b
--- /dev/null
+++ b/other/bootstrap_daemon/src/config.h
@@ -0,0 +1,49 @@
1/* config.h
2 *
3 * Tox DHT bootstrap daemon.
4 *
5 * Copyright (C) 2014-2015 Tox project All Rights Reserved.
6 *
7 * This file is part of Tox.
8 *
9 * Tox is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * Tox is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with Tox. If not, see <http://www.gnu.org/licenses/>.
21 *
22 */
23
24#ifndef CONFIG_H
25#define CONFIG_H
26
27#include "../../../toxcore/DHT.h"
28
29// Gets general config options
30//
31// Important: you are responsible for freeing `pid_file_path` and `keys_file_path`
32// also, iff `tcp_relay_ports_count` > 0, then you are responsible for freeing `tcp_relay_ports`
33// and also `motd` iff `enable_motd` is set
34//
35// returns 1 on success
36// 0 on failure, doesn't modify any data pointed by arguments
37
38int get_general_config(const char *cfg_file_path, char **pid_file_path, char **keys_file_path, int *port, int *enable_ipv6,
39 int *enable_ipv4_fallback, int *enable_lan_discovery, int *enable_tcp_relay, uint16_t **tcp_relay_ports,
40 int *tcp_relay_port_count, int *enable_motd, char **motd);
41
42// Bootstraps nodes listed in the config file
43//
44// returns 1 on success, some or no bootstrap nodes were added
45// 0 on failure, a error accured while parsing config file
46
47int bootstrap_from_config(const char *cfg_file_path, DHT *dht, int enable_ipv6);
48
49#endif // CONFIG_H