-
Notifications
You must be signed in to change notification settings - Fork 5
/
PICA_nodeconfig.h
65 lines (48 loc) · 1.72 KB
/
PICA_nodeconfig.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
(c) Copyright 2012 - 2018 Anton Sviridenko
https://picapica.im
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef PICA_NODECONFIG_H
#define PICA_NODECONFIG_H
#ifndef PICA_INSTALLPREFIX
#define PICA_INSTALLPREFIX "/usr"
#endif
#ifndef PICA_SYSCONFDIR
#define PICA_SYSCONFDIR "/etc"
#endif
#ifndef PICA_LOCALSTATEDIR
#define PICA_LOCALSTATEDIR "/var/lib"
#endif
#define PICA_NODECONFIG_DEF_ANNOUNCED_ADDR "autoconfigure"
#define PICA_NODECONFIG_DEF_LISTEN_PORT "2299"
#ifndef WIN32
#define PICA_NODECONFIG_DEF_NODES_DB_FILE PICA_LOCALSTATEDIR"/pica-node/nodelist.db"
#define PICA_NODECONFIG_DEF_CONFIG_FILE PICA_SYSCONFDIR"/pica-node.conf"
#define PICA_NODECONFIG_DEF_DH_PARAM_FILE PICA_INSTALLPREFIX"/share/pica-node/dhparam4096.pem"
#else
#define PICA_NODECONFIG_DEF_NODES_DB_FILE "nodelist.db"
#define PICA_NODECONFIG_DEF_CONFIG_FILE "pica-node.conf"
#define PICA_NODECONFIG_DEF_DH_PARAM_FILE "share\\dhparam4096.pem"
#endif
struct nodeconfig
{
char *announced_addr;
char *listen_port;
char *nodes_db_file;
char *config_file;
char *dh_param_file;
int disable_reserved_addrs;
//int conn_speed_limit;
};
extern struct nodeconfig nodecfg;
int PICA_nodeconfig_load(const char *config_file);
#endif