Subversion Repositories Tewi

Rev

Rev 7 | Rev 17 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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