aboutsummaryrefslogtreecommitdiff
path: root/config.h
blob: 2bf8007d34aa3de2c8fc6181ac1dd97155bdf417 (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
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
// HaxIRCd's config definitions
// You will need to supply a config.c that matches all the fields below (if included by your choice of options)
//
// Written by: Test_User <hax@runxiyu.org>
//
// This is free and unencumbered software released into the public
// domain.
//
// Anyone is free to copy, modify, publish, use, compile, sell, or
// distribute this software, either in source code form or as a compiled
// binary, for any purpose, commercial or non-commercial, and by any
// means.
//
// In jurisdictions that recognize copyright laws, the author or authors
// of this software dedicate any and all copyright interest in the
// software to the public domain. We make this dedication for the benefit
// of the public at large and to the detriment of our heirs and
// successors. We intend this dedication to be an overt act of
// relinquishment in perpetuity of all present and future rights to this
// software under copyright law.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
// OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.

#pragma once

#include <time.h>

#include "general_network.h"
#include "protocols.h"

// #define K * 1024LU
// #define M * (1024LU K)
// #define G * (1024LU M)

#ifdef USE_SERVER
struct server_config {
	struct string name; // = STRING("hax.example.org"),
	struct string sid; // = STRING("100"),

	struct string in_pass; // = STRING("blah blah blah"),
	struct string out_pass; // = STRING("some other thing"),

	size_t protocol; // = HAXIRCD_PROTOCOL,

	char autoconnect; // = 1;
	size_t autoconnect_type; // = NET_TYPE_GNUTLS,

	char ignore_remote_unlinks;
	char ignore_remote_kills;
	char ignore_local_kills;

	// autoconnect only
	struct string address; // = "haxnet.org",
	struct string port; // = "4321",
};
extern struct server_config SERVER_CONFIG[]; // = {{...}, ...};
extern size_t SERVER_CONFIG_LEN; // = sizeof(SERVER_CONFIG)/sizeof(*SERVER_CONFIG);
#endif

extern struct string SID; // = STRING("200");
extern struct string SERVER_NAME; // = STRING("me.example.org");
extern struct string SERVER_FULLNAME; // = STRING("My random server");

extern time_t PING_INTERVAL; // = 60;

#if defined(USE_GNUTLS_NETWORK) || defined(USE_GNUTLS_BUFFERED_NETWORK)
extern char GNUTLS_USE_SYSTEM_TRUST; // = 1;
extern char *GNUTLS_CERT_PATH; // = "/etc/keys/crt.pem", or 0
extern char *GNUTLS_KEY_PATH; // = "/etc/keys/key.pem", or 0
#endif

#if defined(USE_OPENSSL_NETWORK) || defined(USE_OPENSSL_BUFFERED_NETWORK)
extern char OPENSSL_USE_SYSTEM_TRUST; // = 1;
extern char *OPENSSL_CERT_PATH; // = "/etc/keys/crt.pem", or 0
extern char *OPENSSL_KEY_PATH; // = "/etc/keys/key.pem", or 0
#endif

#ifdef USE_PLAINTEXT_BUFFERED_NETWORK
extern size_t PLAINTEXT_BUFFERED_LEN; // = 1 M
#endif

#ifdef USE_GNUTLS_BUFFERED_NETWORK
extern size_t GNUTLS_BUFFERED_LEN; // = 1 M
#endif

#ifdef USE_OPENSSL_BUFFERED_NETWORK
extern size_t OPENSSL_BUFFERED_LEN; // = 1 M
#endif

#ifdef USE_SERVER
extern unsigned short SERVER_PORTS[NUM_NET_TYPES][NUM_PROTOCOLS]; // = {7000, ...};
extern size_t SERVER_LISTEN[NUM_NET_TYPES][NUM_PROTOCOLS]; // = {16, ...};
extern char SERVER_INCOMING[NUM_NET_TYPES][NUM_PROTOCOLS]; // = {1, ...};
#endif

#ifdef USE_HAXSERV_PSEUDOCLIENT
extern struct string HAXSERV_UID; // = STRING("200000000");
extern struct string HAXSERV_NICK; // = STRING("HaxServ");
extern struct string HAXSERV_FULLNAME; // = STRING("Hax Services");
extern struct string HAXSERV_IDENT; // = STRING("HaxServ");
extern struct string HAXSERV_VHOST; // = STRING("services/hax");
extern struct string HAXSERV_HOST; // = STRING("localhost");
extern struct string HAXSERV_ADDRESS; // = STRING("/dev/null");

extern struct string HAXSERV_PREJOIN_CHANNELS[]; // = {STRING("#services"), ...};
extern size_t HAXSERV_NUM_PREJOIN_CHANNELS; // = sizeof(HAXSERV_PREJOIN_CHANNELS) / sizeof(*HAXSERV_PREJOIN_CHANNELS);

extern struct string HAXSERV_COMMAND_PREFIX; // = STRING("HaxServ: ");

extern struct string HAXSERV_REQUIRED_OPER_TYPE; // = STRING("Admin");

extern struct string HAXSERV_LOG_CHANNEL; // = STRING("#services");
#endif

#ifdef USE_SERVICES_PSEUDOCLIENT
extern struct string NICKSERV_UID; // = STRING("200000001");
extern struct string NICKSERV_NICK; // = STRING("NickServ");
extern struct string NICKSERV_FULLNAME; // = STRING("Nickname Services");
extern struct string NICKSERV_IDENT; // = STRING("NickServ");
extern struct string NICKSERV_VHOST; // = STRING("services/NickServ");
extern struct string NICKSERV_HOST; // = STRING("localhost");
extern struct string NICKSERV_ADDRESS; // = STRING("/dev/null");

extern struct string SERVICES_CHANNEL; // = STRING("#services");

extern struct string SERVICES_DB_PATH; // = STRING("./pseudoclients/services.db");
extern size_t SERVICES_DB_MAX_SIZE; // = 100 M;
#endif