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