summaryrefslogtreecommitdiff
path: root/shared/server-config-options.h
blob: dd1a4854c004ca6130ae89084d70bb14b42cc823 (plain)
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
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef fooserverconfigoptionshfoo
#define fooserverconfigoptionshfoo

#define SERVER_CFG_HEADER "server"

enum scfg_keys {
	SCFG_KEY_INVALID = 0,
	SCFG_KEY_TYPE,
	SCFG_KEY_NAME,
	SCFG_KEY_ANNOUNCE,
	SCFG_KEY_PORT,
	SCFG_KEY_LOCAL,
	SCFG_KEY_REMOTE,
	SCFG_KEY_IDLE_TIMEOUT,
	SCFG_KEY_STOP_METHOD,
	SCFG_KEY_START_METHOD,
	SCFG_KEY_STOP_EXEC,
	SCFG_KEY_START_EXEC,
	SCFG_KEY_RCON,
	SCFG_KEY_RCON_PASSWORD,
	SCFG_KEY_SYSTEMD_SERVICE,
};

struct cfg_key_value_map scfg_key_map[] = {
	{
		.key_name = "type",
		.key_value = SCFG_KEY_TYPE,
		.value_type = CFG_VAL_TYPE_STRING,
	},
	{
		.key_name = "name",
		.key_value = SCFG_KEY_NAME,
		.value_type = CFG_VAL_TYPE_STRING,
	},
	{
		.key_name = "announce",
		.key_value = SCFG_KEY_ANNOUNCE,
		.value_type = CFG_VAL_TYPE_STRING,
	},
	{
		.key_name = "port",
		.key_value = SCFG_KEY_PORT,
		.value_type = CFG_VAL_TYPE_UINT16,
	},
	{
		.key_name = "local",
		.key_value = SCFG_KEY_LOCAL,
		.value_type = CFG_VAL_TYPE_ADDRS,
	},
	{
		.key_name = "remote",
		.key_value = SCFG_KEY_REMOTE,
		.value_type = CFG_VAL_TYPE_ADDRS,
	},
	{
		.key_name = "idle_timeout",
		.key_value = SCFG_KEY_IDLE_TIMEOUT,
		.value_type = CFG_VAL_TYPE_UINT16,
	},
	{
		.key_name = "stop_method",
		.key_value = SCFG_KEY_STOP_METHOD,
		.value_type = CFG_VAL_TYPE_STRING,
	},
	{
		.key_name = "start_method",
		.key_value = SCFG_KEY_START_METHOD,
		.value_type = CFG_VAL_TYPE_STRING,
	},
	{
		.key_name = "stop_exec",
		.key_value = SCFG_KEY_STOP_EXEC,
		.value_type = CFG_VAL_TYPE_STRING,
	},
	{
		.key_name = "start_exec",
		.key_value = SCFG_KEY_START_EXEC,
		.value_type = CFG_VAL_TYPE_STRING,
	},
	{
		.key_name = "rcon",
		.key_value = SCFG_KEY_RCON,
		.value_type = CFG_VAL_TYPE_ADDRS,
	},
	{
		.key_name = "rcon_password",
		.key_value = SCFG_KEY_RCON_PASSWORD,
		.value_type = CFG_VAL_TYPE_STRING,
	},
	{
		.key_name = "systemd_service",
		.key_value = SCFG_KEY_SYSTEMD_SERVICE,
		.value_type = CFG_VAL_TYPE_STRING,
	},
	{
		.key_name = NULL,
		.key_value = SCFG_KEY_INVALID,
		.value_type = CFG_VAL_TYPE_INVALID,
	}
};

#endif