Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
WebDAV.h
Go to the documentation of this file.
1/*
2 * ____ _________ __ _
3 * / __ \___ ____ _/ /_ __(_)___ ___ ___ / / ____ ____ _(_)____
4 * / /_/ / _ \/ __ `/ / / / / / __ `__ \/ _ \/ / / __ \/ __ `/ / ___/
5 * / _, _/ __/ /_/ / / / / / / / / / / / __/ /___/ /_/ / /_/ / / /__
6 * /_/ |_|\___/\__,_/_/ /_/ /_/_/ /_/ /_/\___/_____/\____/\__, /_/\___/
7 * /____/
8 *
9 * Barracuda Embedded Web-Server
10 *
11 ****************************************************************************
12 * HEADER
13 *
14 * $Id: WebDAV.h 5978 2026-09-11 16:13:48Z 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
41#ifndef __WebDAV_h
42#define __WebDAV_h
43
44#include <SingleList.h>
45#include "HttpUpload.h"
46
47struct WebDAV;
48
49#ifndef __DOXYGEN__
50typedef struct
51{
52 SplayTree lTree; /* Lock node tree. */
53 SingleList lList; /* Lock node list. */
54 struct WebDAV* webDAV;
55 char* lockDir;
56 char* lockDirFn;
57 U32 nextLockFileNumber;
58 U32 locksLeft; /* Max number of allowed locks left to allocate. */
59} LockContainer;
60#endif
61
62
63
103typedef struct WebDAV
104#ifdef __cplusplus
105: public HttpDir
106{
139 WebDAV(IoIntf* io,
140 int maxUploads,
141 const char* dirName,
142 const char* lockDir,
143 U32 maxNumberOfLocks=10,
144 AllocatorIntf* alloc=0,
145 S8 priority=0);
146
151 ~WebDAV();
152
153#if 0
154}
155#endif
156#else
157{
158 HttpDir super; /* Inherits from HttpDir. */
159#endif
160 HttpUploadCbIntf uploadCb;
161 LockContainer lock;
162 HttpUpload upload;
163 IoIntf* io;
164 AllocatorIntf* alloc;
165 char* vdRootPath;
166 size_t vdRootPathLen;
167 BaBool ioReadOnly; /* TRUE if the IoIntf is read only. */
168 BaBool ioMoveDir; /* TRUE if the IoIntf can move directories. */
170
171
172#ifdef __cplusplus
173extern "C" {
174#endif
175
180 WebDAV* o,
181 IoIntf* io,
182 int maxUploads,
183 const char* dirName,
184 const char* lockDir,
185 U32 maxNumberOfLocks,
186 AllocatorIntf* alloc,
187 S8 priority);
188
192BA_API void WebDAV_destructor(WebDAV* o);
193
200#define WebDAV_setAuthenticator(o, authenticator, realm) \
201 HttpDir_setAuthenticator((HttpDir*)o, authenticator, realm)
202
204typedef struct
205{
206 /* 0:is-locked, 1:lock, 2:unlock, 3:lock-owner,
207 */
209 int action;
211 BaTime lockTime; /* in val for action 1 */
213 const char* name; /* in val: the file */
215 const char* owner; /* in val for action 1 */
217 ResIntfPtr fp; /* out val: the owner XML file */
219
220
232
233
234
235#ifdef __cplusplus
236}
238 int maxUploads,
239 const char* dirName,
240 const char* lockDir,
241 U32 maxNumberOfLocks,
242 AllocatorIntf* alloc,
243 S8 priority) {
244 WebDAV_constructor(this,io,maxUploads,dirName, lockDir,
245 maxNumberOfLocks, alloc,priority);
246}
247
249 WebDAV_destructor(this);
250}
251#endif
252
253#endif /* __WebDAV_h */
254
WebDAV WebDAV
The WebDAV plugin implements WebDAV version 1, as specified in RFC2518 and part of the locking in DAV...
BA_API int WebDAV_lockmgr(WebDAV *o, WebDAVLockMgr *mgr)
Manage WebDAV locks without an HTTP request.
BA_API void WebDAV_destructor(WebDAV *o)
Terminate the WebDAV object.
BA_API void WebDAV_constructor(WebDAV *o, IoIntf *io, int maxUploads, const char *dirName, const char *lockDir, U32 maxNumberOfLocks, AllocatorIntf *alloc, S8 priority)
Create a WebDAV instance.
S64 BaTime
An arithmetic type representing calendar time with epoch of 1970-01-01 00:00:00 UTC,...
Definition: GenPrimT.h:103
uint32_t U32
Unsigned 32-bit integer.
Definition: GenPrimT.h:93
U8 BaBool
Boolean stored in an unsigned byte; FALSE is zero and TRUE is one.
Definition: GenPrimT.h:118
int8_t S8
Signed 8-bit integer.
Definition: GenPrimT.h:81
Memory allocation and deallocation Interface class.
Definition: AllocatorIntf.h:98
An instance of the HttpDir class, which is a collection of zero or more resources,...
Definition: HttpServer.h:2777
The HttpUploadCbIntf interface is an abstract class that must be implemented by code using the HttpUp...
Definition: HttpUpload.h:237
The HttpUpload node is responsible for creating and starting HttpUploadNode instances.
Definition: HttpUpload.h:275
The IoIntf class specifies an abstract file API, implementations include ZipIo, DiskIo,...
Definition: IoIntf.h:482
Self-adjusting tree of caller-owned nodes, with unique keys.
Definition: SplayTree.h:109
Input/output record for WebDAV_lockmgr().
Definition: WebDAV.h:205
ResIntfPtr fp
Action 3 output only: opened owner-XML resource, or NULL if opening fails.
Definition: WebDAV.h:217
int action
Input: 0 tests a lock, 1 creates, 2 removes, 3 reads owner XML.
Definition: WebDAV.h:209
const char * name
Required input resource path relative to the WebDAV IoIntf, NUL-terminated and borrowed for the call.
Definition: WebDAV.h:213
const char * owner
Action 1 input: required NUL-terminated owner text inserted into an XML href element.
Definition: WebDAV.h:215
BaTime lockTime
Action 1 input: duration in seconds.
Definition: WebDAV.h:211
The WebDAV plugin implements WebDAV version 1, as specified in RFC2518 and part of the locking in DAV...
Definition: WebDAV.h:106
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:237
~WebDAV()
Terminate the WebDAV object.
Definition: WebDAV.h:248