Subversion Repositories Tewi

Rev

Rev 7 | Rev 17 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 nishi 1
/* $Id: tw_config.h 12 2024-09-13 13:36:03Z nishi $ */
2
 
3
#ifndef __TW_CONFIG_H__
4
#define __TW_CONFIG_H__
5
 
7 nishi 6
#include <stdint.h>
7
 
8
#define MAX_PORTS 1024
9
 
12 nishi 10
#define MAX_VHOSTS 1024
6 nishi 11
 
12 nishi 12
struct tw_config_entry {
13
	char* name;
14
	int port;
15
	char* sslkey;
16
	char* sslcert;
17
};
18
 
6 nishi 19
struct tw_config {
7 nishi 20
	uint64_t ports[MAX_PORTS + 1]; /* If port & (1 << 32) is non-zero, it is SSL */
12 nishi 21
	char hostname[1025];
6 nishi 22
	struct tw_config_entry root;
12 nishi 23
	struct tw_config_entry vhosts[MAX_VHOSTS];
24
	int vhost_count;
6 nishi 25
};
26
 
27
void tw_config_init(void);
4 nishi 28
int tw_config_read(const char* path);
12 nishi 29
struct tw_config_entry* tw_vhost_match(const char* name, int port);
4 nishi 30
 
31
#endif