From 7d9a0b7bb11ca99513cb48a6611d7121ecc35868 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sun, 25 Oct 2026 19:13:36 +0100 Subject: Split options parsing and config code from opentracker.c, it has grown humongous --- ot_config.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 ot_config.h (limited to 'ot_config.h') diff --git a/ot_config.h b/ot_config.h new file mode 100644 index 0000000..ab25e2c --- /dev/null +++ b/ot_config.h @@ -0,0 +1,35 @@ +/* This software was written by Dirk Engling + It is considered beerware. Prost. Skol. Cheers or whatever. + + $id$ */ + +#ifndef OT_CONFIG_H__ +#define OT_CONFIG_H__ + +#include + +#include "trackerlogic.h" + +/* An address opentracker was asked to listen on. Options the statement did + not name have been filled in from the file wide defaults by the time these + are handed out. sock is filled in by whoever binds them. */ +typedef struct { + ot_ip6 ip; + uint16_t port; + PROTO_FLAG proto; + int shared; + int workers; + int64_t sock; +} ot_listen; + +extern char *g_redirecturl; +extern char *g_serverdir; +extern char *g_serveruser; +extern char *g_statefile; + +/* Reads the command line and every config file it names. Exits on error. */ +void config_parse(int argc, char **argv); + +ot_listen *config_listen_entries(size_t *count); + +#endif -- cgit v1.3