src/server/config/serverconf.h

branch
config
changeset 253
ddfead6ea863
parent 91
fac51f87def0
child 254
4784c14aa639
equal deleted inserted replaced
210:21274e5950af 253:ddfead6ea863
49 UcxMap *objects; // contains UcxList of ServerConfigObject 49 UcxMap *objects; // contains UcxList of ServerConfigObject
50 // parser temp vars 50 // parser temp vars
51 ServerConfigObject *obj; 51 ServerConfigObject *obj;
52 } ServerConfig; 52 } ServerConfig;
53 53
54 // server.conf objects
55
56 typedef struct _cfg_listener {
57 ServerConfigObject *cfgobj;
58 sstr_t name;
59 sstr_t vs;
60 sstr_t threadpool;
61 sstr_t address;
62 int port;
63 int nacceptors;
64 int cfg_correct;
65 } CfgListener;
66
67 typedef struct _cfg_keyfile_authdb {
68 sstr_t file;
69 } CfgKeyfileAuthDB;
70
71 typedef struct _cfg_ldap_authdb {
72 sstr_t host;
73 int port;
74 sstr_t basedn;
75 sstr_t binddn;
76 sstr_t bindpw;
77 } CfgLDAPAuthDB;
78
79 union authdb {
80 CfgKeyfileAuthDB keyfile;
81 CfgLDAPAuthDB ldap;
82 };
83
84 enum authdb_type {
85 AUTHDB_TYPE_KEYFILE,
86 AUTHDB_TYPE_LDAP
87 };
88
89 typedef struct _cfg_authdb {
90 sstr_t name;
91 enum authdb_type type;
92 union authdb cfg;
93 int cfg_correct;
94 } CfgAuthDB;
95 54
96 55
97 /* 56 /*
98 * Loads and parses a server configuration file. The function only structures 57 * Loads and parses a server configuration file. The function only structures
99 * the file content to configuration objects with directives. The semantics 58 * the file content to configuration objects with directives. The semantics
108 67
109 // private - parses a server.conf line 68 // private - parses a server.conf line
110 int serverconf_parse(void *p, ConfigLine *begin, ConfigLine *end, sstr_t line); 69 int serverconf_parse(void *p, ConfigLine *begin, ConfigLine *end, sstr_t line);
111 70
112 71
113 UcxList* srvcfg_get_listeners(ServerConfig *cfg, UcxAllocator *mp, int *error); 72
114 73
115 74
116 #ifdef __cplusplus 75 #ifdef __cplusplus
117 } 76 }
118 #endif 77 #endif

mercurial