Barracuda Application Server C/C++ Reference
NO
WebDAV.h
1/*
2 * ____ _________ __ _
3 * / __ \___ ____ _/ /_ __(_)___ ___ ___ / / ____ ____ _(_)____
4 * / /_/ / _ \/ __ `/ / / / / / __ `__ \/ _ \/ / / __ \/ __ `/ / ___/
5 * / _, _/ __/ /_/ / / / / / / / / / / / __/ /___/ /_/ / /_/ / / /__
6 * /_/ |_|\___/\__,_/_/ /_/ /_/_/ /_/ /_/\___/_____/\____/\__, /_/\___/
7 * /____/
8 *
9 * Barracuda Embedded Web-Server
10 *
11 ****************************************************************************
12 * HEADER
13 *
14 * $Id: WebDAV.h 4915 2021-12-01 18:26:55Z wini $
15 *
16 * COPYRIGHT: Real Time Logic LLC, 2006-2008
17 *
18 * This software is copyrighted by and is the sole property of Real
19 * Time Logic LLC. All rights, title, ownership, or other interests in
20 * the software remain the property of Real Time Logic LLC. This
21 * software may only be used in accordance with the terms and
22 * conditions stipulated in the corresponding license agreement under
23 * which the software has been supplied. Any unauthorized use,
24 * duplication, transmission, distribution, or disclosure of this
25 * software is expressly forbidden.
26 *
27 * This Copyright notice may not be removed or modified without prior
28 * written consent of Real Time Logic LLC.
29 *
30 * Real Time Logic LLC. reserves the right to modify this software
31 * without notice.
32 *
33 * http://www.realtimelogic.com
34 ****************************************************************************
35 *
36 *
37 */
38
39#ifndef __WebDAV_h
40#define __WebDAV_h
41
42#include <SingleList.h>
43#include "HttpUpload.h"
44
45struct WebDAV;
46
47#ifndef __DOXYGEN__
48typedef struct
49{
50 SplayTree lTree; /* Lock node tree. */
51 SingleList lList; /* Lock node list. */
52 struct WebDAV* webDAV;
53 char* lockDir;
54 char* lockDirFn;
55 U32 nextLockFileNumber;
56 U32 locksLeft; /* Max number of allowed locks left to allocate. */
57} LockContainer;
58#endif
59
60
61
102typedef struct WebDAV
103#ifdef __cplusplus
104: public HttpDir
105{
135 WebDAV(IoIntf* io,
136 int maxUploads,
137 const char* dirName,
138 const char* lockDir,
139 U32 maxNumberOfLocks=10,
140 AllocatorIntf* alloc=0,
141 S8 priority=0);
142
146 ~WebDAV();
147
148#if 0
149}
150#endif
151#else
152{
153 HttpDir super; /* Inherits from HttpDir. */
154#endif
155 HttpUploadCbIntf uploadCb;
156 LockContainer lock;
157 HttpUpload upload;
158 IoIntf* io;
159 AllocatorIntf* alloc;
160 char* vdRootPath;
161 size_t vdRootPathLen;
162 BaBool ioReadOnly; /* TRUE if the IoIntf is read only. */
163 BaBool ioMoveDir; /* TRUE if the IoIntf can move directories. */
164} WebDAV;
165
166
167#ifdef __cplusplus
168extern "C" {
169#endif
170
171BA_API void WebDAV_constructor(
172 WebDAV* o,
173 IoIntf* io,
174 int maxUploads,
175 const char* dirName,
176 const char* lockDir,
177 U32 maxNumberOfLocks,
178 AllocatorIntf* alloc,
179 S8 priority);
180
181BA_API void WebDAV_destructor(WebDAV* o);
182
183#define WebDAV_setAuthenticator(o, authenticator, realm) \
184 HttpDir_setAuthenticator((HttpDir*)o, authenticator, realm)
185
186typedef struct
187{
188 /* 0:is-locked, 1:lock, 2:unlock, 3:lock-owner,
189 */
190 int action;
191 BaTime lockTime; /* in val for action 1 */
192 const char* name; /* in val: the file */
193 const char* owner; /* in val for action 1 */
194 ResIntfPtr fp; /* out val: the owner XML file */
195} WebDAVLockMgr;
196
197
198BA_API int WebDAV_lockmgr(WebDAV* o, WebDAVLockMgr* mgr);
199
200
201
202#ifdef __cplusplus
203}
205 int maxUploads,
206 const char* dirName,
207 const char* lockDir,
208 U32 maxNumberOfLocks,
209 AllocatorIntf* alloc,
210 S8 priority) {
211 WebDAV_constructor(this,io,maxUploads,dirName, lockDir,
212 maxNumberOfLocks, alloc,priority);
213}
214
216 WebDAV_destructor(this);
217}
218#endif
219
220#endif /* __WebDAV_h */
221
S64 BaTime
An arithmetic type representing calendar time with epoch of 1970-01-01 00:00:10 GMT – i....
Definition: GenPrimT.h:93
Memory allocation and deallocation Interface class.
Definition: AllocatorIntf.h:83
An instance of the HttpDir class, which is a collection of zero or more resources,...
Definition: HttpServer.h:2368
The HttpUploadCbIntf interface is an abstract class that must be implemented by code using the HttpUp...
Definition: HttpUpload.h:163
The HttpUpload node is responsible for creating and starting HttpUploadNode instances.
Definition: HttpUpload.h:196
The IoIntf class specifies an abstract file API, implementations include ZipIo, DiskIo,...
Definition: IoIntf.h:377
The WebDAV plugin implements WebDAV version 1, as specified in RFC2518 and part of the locking in DAV...
Definition: WebDAV.h:105
WebDAV(IoIntf *io, int maxUploads, const char *dirName, const char *lockDir, U32 maxNumberOfLocks=10, AllocatorIntf *alloc=0, S8 priority=0)
Create a WebDAV instance.
Definition: WebDAV.h:204
~WebDAV()
Terminate the WebDAV object.
Definition: WebDAV.h:215