Subversion Repositories Tewi

Rev

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

Rev 21 Rev 22
Line 1... Line 1...
1
/* $Id: tw_config.h 21 2024-09-14 12:39:39Z nishi $ */
1
/* $Id: tw_config.h 22 2024-09-14 13:25:38Z 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 "tw_http.h"
6
#include "tw_http.h"
Line 19... Line 19...
19
#define SOCKADDR struct sockaddr_in
19
#define SOCKADDR struct sockaddr_in
20
#else
20
#else
21
#define SOCKADDR struct sockaddr_in6
21
#define SOCKADDR struct sockaddr_in6
22
#endif
22
#endif
23
 
23
 
24
#define MAX_PORTS	1024
24
#define MAX_PORTS 1024
25
#define MAX_VHOSTS	1024
25
#define MAX_VHOSTS 1024
26
#define MAX_MODULES	1024
26
#define MAX_MODULES 1024
27
#define MAX_DIRS 	1024
27
#define MAX_DIRS 1024
28
#define MAX_MIME 	1024
28
#define MAX_MIME 1024
-
 
29
#define MAX_ICON 1024
29
 
30
 
30
enum TW_DIR_TYPE {
31
enum TW_DIR_TYPE {
31
	TW_DIR_ALLOW = 0,
32
	TW_DIR_ALLOW = 0,
32
	TW_DIR_DENY
33
	TW_DIR_DENY
33
};
34
};
Line 41... Line 42...
41
struct tw_mime_entry {
42
struct tw_mime_entry {
42
	char* ext;
43
	char* ext;
43
	char* mime;
44
	char* mime;
44
};
45
};
45
 
46
 
-
 
47
struct tw_icon_entry {
-
 
48
	char* mime;
-
 
49
	char* icon;
-
 
50
};
-
 
51
 
46
struct tw_config_entry {
52
struct tw_config_entry {
47
	char* name;
53
	char* name;
48
	int port;
54
	int port;
49
	char* sslkey;
55
	char* sslkey;
50
	char* sslcert;
56
	char* sslcert;
51
	char* root;
57
	char* root;
52
	struct tw_dir_entry dirs[MAX_DIRS];
58
	struct tw_dir_entry dirs[MAX_DIRS];
53
	int dir_count;
59
	int dir_count;
54
	struct tw_mime_entry mimes[MAX_DIRS];
60
	struct tw_mime_entry mimes[MAX_DIRS];
55
	int mime_count;
61
	int mime_count;
-
 
62
	struct tw_icon_entry icons[MAX_DIRS];
-
 
63
	int icon_count;
56
};
64
};
57
 
65
 
58
struct tw_config {
66
struct tw_config {
59
	uint64_t ports[MAX_PORTS + 1]; /* If port & (1 << 32) is non-zero, it is SSL */
67
	uint64_t ports[MAX_PORTS + 1]; /* If port & (1 << 32) is non-zero, it is SSL */
60
	char hostname[1025];
68
	char hostname[1025];