summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2020-09-23 11:19:29 -0400
committerDrew DeVault <sir@cmpwn.com>2020-09-23 11:24:23 -0400
commit58500c8e530cc9b0807afbe8b068fe7b00db0131 (patch)
tree25d8d12de0e3a9ec1bc65a5256ab3bebe06771e2 /include
parentccae8ffd2807b8b984b657b6321802fa00b52427 (diff)
downloadgmnisrv-58500c8e530cc9b0807afbe8b068fe7b00db0131.tar.gz
gmnisrv-58500c8e530cc9b0807afbe8b068fe7b00db0131.tar.xz
gmnisrv-58500c8e530cc9b0807afbe8b068fe7b00db0131.zip
Initial config parser
Diffstat (limited to 'include')
-rw-r--r--include/config.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/config.h b/include/config.h
new file mode 100644
index 0000000..0c3d085
--- /dev/null
+++ b/include/config.h
@@ -0,0 +1,34 @@
+#ifndef GMNISRV_CONFIG
+#define GMNISRV_CONFIG
+#include <arpa/inet.h>
+
+struct gmnisrv_tls {
+ char *store;
+ char *organization;
+ char *email;
+};
+
+struct gmnisrv_host {
+ char *hostname;
+ char *root;
+ struct gmnisrv_host *next;
+};
+
+struct gmnisrv_bind {
+ int family;
+ char addr[sizeof(struct in6_addr)];
+ struct gmnisrv_bind *next;
+};
+
+struct gmnisrv_config {
+ struct gmnisrv_tls tls;
+ struct gmnisrv_host *hosts;
+ struct gmnisrv_bind *binds;
+};
+
+int load_config(struct gmnisrv_config *conf, const char *path);
+
+struct gmnisrv_host *gmnisrv_config_get_host(
+ struct gmnisrv_config *conf, const char *hostname);
+
+#endif