summaryrefslogtreecommitdiffstats
path: root/PICA_nodeconfig.h
blob: 37b5e69996aa5e1eb853bfd07cd58d571e875d28 (plain) (blame)
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

#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"
#endif

#define PICA_NODECONFIG_DEF_ANNOUNCED_ADDR "autoconfigure"
#define PICA_NODECONFIG_DEF_LISTEN_PORT "2299"
#define PICA_NODECONFIG_DEF_NODES_DB_FILE PICA_LOCALSTATEDIR"/lib/pica-node/nodelist.db"
#define PICA_NODECONFIG_DEF_CONFIG_FILE PICA_SYSCONFDIR"/pica-node.conf"
#define PICA_NODECONFIG_DEF_CA_CERT_FILE PICA_INSTALLPREFIX"/share/pica-node/CA.pem"

struct nodeconfig
{
	char			*announced_addr;
	char 			*listen_port;
	char 			*nodes_db_file;
	char			*config_file;
	char			*CA_cert_file;
	int 			disable_reserved_addrs;
//int			conn_speed_limit;
};

extern struct nodeconfig nodecfg;

int PICA_nodeconfig_load(const char *config_file);

#endif