summaryrefslogtreecommitdiff
path: root/ot_config.h
blob: 059573a4074b0ea14aa757c7ba1d16eaaebc6713 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
   It is considered beerware. Prost. Skol. Cheers or whatever.

   $id$ */

#ifndef OT_CONFIG_H__
#define OT_CONFIG_H__

#include <stdint.h>

#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 const char *g_redirecturl;
extern const char *g_serverdir;
extern const char *g_serveruser;
extern const 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