From 8baeb5a51c4dfa03956887ade2ef77295f17c95e Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sun, 25 Oct 2020 21:46:01 -0400 Subject: Initial implementation of a routing table --- include/config.h | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'include') 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 #include +#include #include 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; }; -- cgit v1.2.3