summaryrefslogtreecommitdiffstats
path: root/include/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/config.h')
-rw-r--r--include/config.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/include/config.h b/include/config.h
index e0d7947..a489f2d 100644
--- a/include/config.h
+++ b/include/config.h
@@ -2,6 +2,7 @@
#define GMNISRV_CONFIG
#include <arpa/inet.h>
#include <openssl/x509.h>
+#include <regex.h>
#include <stdbool.h>
struct gmnisrv_tls {
@@ -10,15 +11,33 @@ struct gmnisrv_tls {
SSL_CTX *ssl_ctx;
};
-struct gmnisrv_host {
- char *hostname;
+enum gmnisrv_routing {
+ ROUTE_PATH,
+ ROUTE_REGEX,
+};
+
+struct gmnisrv_route {
+ enum gmnisrv_routing routing;
+ char *spec;
+ union {
+ char *path;
+ regex_t *regex;
+ };
+
char *root;
char *index;
bool autoindex;
+ struct gmnisrv_route *next;
+};
+
+struct gmnisrv_host {
+ char *hostname;
X509 *x509;
EVP_PKEY *pkey;
+ struct gmnisrv_route *routes;
+
struct gmnisrv_host *next;
};