| 33 |
33 |
| 34 #include "../util/object.h" |
34 #include "../util/object.h" |
| 35 #include "../public/nsapi.h" |
35 #include "../public/nsapi.h" |
| 36 #include "../daemon/acldata.h" |
36 #include "../daemon/acldata.h" |
| 37 |
37 |
| |
38 #include "location.h" |
| |
39 |
| 38 #include "log.h" |
40 #include "log.h" |
| 39 |
41 |
| 40 #ifdef __cplusplus |
42 #ifdef __cplusplus |
| 41 extern "C" { |
43 extern "C" { |
| 42 #endif |
44 #endif |
| 43 |
45 |
| 44 typedef struct VSLocation VSLocation; |
|
| 45 |
|
| 46 struct VSLocation { |
|
| 47 VSLocation *child_begin; |
|
| 48 VSLocation *child_end; |
|
| 49 |
|
| 50 VSLocation *next; |
|
| 51 }; |
|
| 52 |
46 |
| 53 struct VirtualServer { |
47 struct VirtualServer { |
| 54 pool_handle_t *pool; |
48 pool_handle_t *pool; |
| 55 |
49 |
| 56 cxmutstr name; |
50 cxmutstr name; |
| 57 cxmutstr host; |
51 cxmutstr host; |
| 58 CxMap hosts; |
52 CxMap *hosts; |
| 59 // TODO: list of listeners, check listener of vs |
53 // TODO: list of listeners, check listener of vs |
| 60 |
54 |
| 61 cxmutstr objectfile; |
55 cxmutstr objectfile; |
| 62 HTTPObjectConfig *objects; |
56 HTTPObjectConfig *objects; |
| 63 |
57 |
| 64 cxmutstr document_root; |
58 cxmutstr document_root; |
| 65 |
59 |
| 66 ACLData *acls; |
60 ACLData *acls; |
| 67 AccessLog *log; |
61 AccessLog *log; |
| 68 |
62 |
| 69 VSLocation *locations_begin; |
63 WSLocation *locations_begin; |
| 70 VSLocation *locations_end; |
64 WSLocation *locations_end; |
| 71 |
65 |
| 72 |
66 |
| 73 uint32_t ref; // reference counter |
67 uint32_t ref; // reference counter |
| 74 }; |
68 }; |
| 75 |
69 |
| 76 VirtualServer* vs_new(pool_handle_t *pool); |
70 VirtualServer* vs_new(pool_handle_t *pool); |
| 77 |
71 |
| 78 int vs_add_host(VirtualServer *vs, cxstring host); |
72 int vs_add_host(VirtualServer *vs, cxstring host); |
| |
73 |
| |
74 int vs_add_location(VirtualServer *vs, WSLocation *location); |
| 79 |
75 |
| 80 |
76 |
| 81 #ifdef __cplusplus |
77 #ifdef __cplusplus |
| 82 } |
78 } |
| 83 #endif |
79 #endif |