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 #ifndef WEBDAV_H
30 #define WEBDAV_H
31
32 #include "../public/webdav.h"
33
34 #include <cx/map.h>
35 #include <cx/list.h>
36 #include <cx/buffer.h>
37 #include <cx/string.h>
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 typedef struct WebdavType {
44 webdav_init_func init;
45 webdav_create_func create;
46 } WebdavType;
47
48 typedef struct DefaultWebdavData {
49 WebdavVFSProperties vfsproperties;
50 } DefaultWebdavData;
51
52 typedef struct WebdavPropfindRequestList WebdavPropfindRequestList;
53 struct WebdavPropfindRequestList {
54 WebdavPropfindRequest *propfind;
55 WebdavPropfindRequestList *next;
56 };
57
58 WebdavType* webdav_get_type(cxstring dav_class);
59
60 void* webdav_init_backend(ServerConfiguration *cfg,
pool_handle_t *pool, WebdavType *dav_class, WSConfigNode *config,
int *error);
61
62 int webdav_init(pblock *pb, Session *sn, Request *rq);
63
64 int webdav_service(pblock *pb, Session *sn, Request *rq);
65
66
67
68
69
70
71
72 int rqbody2buffer(Session *sn, Request *rq, CxBuffer *buf);
73
74
75 int webdav_options(pblock *pb, Session *sn, Request *rq);
76
77 int webdav_propfind(pblock *pb, Session *sn, Request *rq);
78
79 int webdav_propfind_init(
80 WebdavBackend *dav,
81 WebdavPropfindRequest *propfind,
82 const char *path,
83 const char *uri,
84 WebdavPropfindRequestList **out_req);
85
86 int webdav_propfind_do(
87 WebdavBackend *dav,
88 WebdavPropfindRequest *propfind,
89 WebdavResponse *response,
90 VFSContext *vfs,
91 char *path,
92 char *uri);
93
94
95 int webdav_proppatch(pblock *pb, Session *sn, Request *rq);
96 int webdav_mkcol(pblock *pb, Session *sn, Request *rq);
97 int webdav_post(pblock *pb, Session *sn, Request *rq);
98 int webdav_delete(pblock *pb, Session *sn, Request *rq);
99 int webdav_put(pblock *pb, Session *sn, Request *rq);
100 int webdav_copy(pblock *pb, Session *sn, Request *rq);
101 int webdav_move(pblock *pb, Session *sn, Request *rq);
102 int webdav_lock(pblock *pb, Session *sn, Request *rq);
103 int webdav_unlock(pblock *pb, Session *sn, Request *rq);
104 int webdav_report(pblock *pb, Session *sn, Request *rq);
105 int webdav_acl(pblock *pb, Session *sn, Request *rq);
106 int webdav_search (pblock *pb, Session *sn, Request *rq);
107
108
109 int default_propfind_init(
110 WebdavPropfindRequest *rq,
111 const char *path,
112 const char *href,
113 WebdavPList **outplist);
114 int default_propfind_do(
115 WebdavPropfindRequest *request,
116 WebdavResponse *response,
117 VFS_DIR parent,
118 WebdavResource *resource,
119 struct stat *s);
120 int default_propfind_finish(WebdavPropfindRequest *rq);
121 int default_proppatch_do(
122 WebdavProppatchRequest *request,
123 WebdavResource *response,
124 VFSFile *file,
125 WebdavPList **setInOut,
126 WebdavPList **removeInOut);
127 int default_proppatch_finish(
128 WebdavProppatchRequest *request,
129 WebdavResource *response,
130 VFSFile *file,
131 WSBool commit);
132
133 CxHashKey webdav_property_key(
const char *ns,
const char *name);
134
135 CxHashKey webdav_property_key_a(
const CxAllocator *a,
const char *ns,
const char *name);
136
137 #ifdef __cplusplus
138 }
139 #endif
140
141 #endif
142
143