Tue, 23 Jul 2024 14:40:20 +0200
also remove \r from user name
795
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1 | /* |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
3 | * |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
4 | * Copyright 2023 Olaf Wintermann. All rights reserved. |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
5 | * |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
6 | * Redistribution and use in source and binary forms, with or without |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
7 | * modification, are permitted provided that the following conditions are met: |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
8 | * |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
9 | * 1. Redistributions of source code must retain the above copyright |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
10 | * notice, this list of conditions and the following disclaimer. |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
11 | * |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
12 | * 2. Redistributions in binary form must reproduce the above copyright |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
13 | * notice, this list of conditions and the following disclaimer in the |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
14 | * documentation and/or other materials provided with the distribution. |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
15 | * |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
26 | * POSSIBILITY OF SUCH DAMAGE. |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
27 | */ |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
28 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
29 | #ifndef LIBIDAV_CONFIG_H |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
30 | #define LIBIDAV_CONFIG_H |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
31 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
32 | #include "webdav.h" |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
33 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
34 | #ifdef __cplusplus |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
35 | extern "C" { |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
36 | #endif |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
37 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
38 | typedef struct DavConfig DavConfig; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
39 | typedef struct DavCfgRepository DavCfgRepository; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
40 | typedef struct DavCfgProxy DavCfgProxy; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
41 | typedef struct DavCfgKey DavCfgKey; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
42 | typedef struct DavCfgNamespace DavCfgNamespace; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
43 | typedef struct DavCfgSecretStore DavCfgSecretStore; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
44 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
45 | typedef struct CfgString CfgString; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
46 | typedef struct CfgInt CfgInt; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
47 | typedef struct CfgUInt CfgUInt; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
48 | typedef struct CfgBool CfgBool; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
49 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
50 | typedef enum dav_cfg_key_type DavCfgKeyType; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
51 | |
796
81e0f67386a6
remove old config loader
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
795
diff
changeset
|
52 | typedef cxmutstr (*dav_loadkeyfile_func)(const char *filename); |
81e0f67386a6
remove old config loader
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
795
diff
changeset
|
53 | |
795
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
54 | #define DAV_HTTP_PROXY 1 |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
55 | #define DAV_HTTPS_PROXY 2 |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
56 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
57 | enum dav_cfg_key_type { |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
58 | DAV_KEY_TYPE_AES256 = 0, |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
59 | DAV_KEY_TYPE_AES128, |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
60 | DAV_KEY_TYPE_UNKNOWN |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
61 | }; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
62 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
63 | struct DavConfig { |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
64 | CxMempool *mp; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
65 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
66 | DavCfgRepository *repositories; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
67 | DavCfgKey *keys; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
68 | DavCfgNamespace *namespaces; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
69 | DavCfgProxy *http_proxy; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
70 | DavCfgProxy *https_proxy; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
71 | DavCfgSecretStore *secretstore; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
72 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
73 | xmlDoc *doc; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
74 | }; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
75 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
76 | struct CfgString { |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
77 | cxmutstr value; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
78 | xmlNode *node; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
79 | }; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
80 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
81 | struct CfgInt { |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
82 | int64_t value; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
83 | xmlNode *node; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
84 | }; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
85 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
86 | struct CfgUInt { |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
87 | uint64_t value; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
88 | xmlNode *node; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
89 | }; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
90 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
91 | struct CfgBool { |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
92 | bool value; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
93 | xmlNode *node; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
94 | }; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
95 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
96 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
97 | struct DavCfgRepository { |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
98 | xmlNode *node; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
99 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
100 | CfgString name; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
101 | CfgString url; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
102 | CfgString user; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
103 | CfgString password; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
104 | CfgString stored_user; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
105 | CfgString default_key; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
106 | CfgString cert; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
107 | CfgBool verification; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
108 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
109 | CfgBool full_encryption; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
110 | CfgBool content_encryption; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
111 | CfgBool decrypt_content; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
112 | CfgBool decrypt_name; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
113 | CfgBool decrypt_properties; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
114 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
115 | CfgInt ssl_version; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
116 | CfgUInt authmethods; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
117 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
118 | int unknown_elements; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
119 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
120 | DavCfgRepository *prev; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
121 | DavCfgRepository *next; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
122 | }; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
123 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
124 | struct DavCfgProxy { |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
125 | CfgString url; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
126 | CfgString user; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
127 | CfgString password; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
128 | CfgString noproxy; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
129 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
130 | int unknown_elements; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
131 | }; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
132 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
133 | struct DavCfgKey { |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
134 | CfgString name; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
135 | CfgString file; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
136 | DavCfgKeyType type; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
137 | xmlNode *type_node; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
138 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
139 | DavCfgKey *prev; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
140 | DavCfgKey *next; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
141 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
142 | int unknown_elements; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
143 | }; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
144 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
145 | struct DavCfgNamespace { |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
146 | xmlNode *node; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
147 | cxmutstr prefix; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
148 | cxmutstr uri; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
149 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
150 | DavCfgNamespace *prev; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
151 | DavCfgNamespace *next; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
152 | }; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
153 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
154 | struct DavCfgSecretStore { |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
155 | CfgString unlock_cmd; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
156 | CfgString lock_cmd; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
157 | }; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
158 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
159 | enum DavConfigError { |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
160 | DAV_CONFIG_ERROR_XML = 0 |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
161 | }; |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
162 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
163 | DavConfig* dav_config_load(cxmutstr xmlfilecontent, int *error); |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
164 | |
796
81e0f67386a6
remove old config loader
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
795
diff
changeset
|
165 | void dav_config_free(DavConfig *config); |
81e0f67386a6
remove old config loader
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
795
diff
changeset
|
166 | |
795
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
167 | CxBuffer* dav_config2buf(DavConfig *config); |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
168 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
169 | void dav_config_add_repository(DavConfig *config, DavCfgRepository *repo); |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
170 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
171 | DavCfgRepository* dav_repository_new(DavConfig *config); |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
172 | void dav_repository_free(DavConfig *config, DavCfgRepository *repo); |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
173 | void dav_repository_remove_and_free(DavConfig *config, DavCfgRepository *repo); |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
174 | int dav_repository_get_flags(DavCfgRepository *repo); |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
175 | void dav_repository_set_url(DavConfig *config, DavCfgRepository *repo, cxstring newurl); |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
176 | void dav_repository_set_auth(DavConfig *config, DavCfgRepository *repo, cxstring user, cxstring password); |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
177 | cxmutstr dav_repository_get_decodedpassword(DavCfgRepository *repo); |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
178 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
179 | int dav_cfg_string_set_value(DavConfig *config, CfgString *str, xmlNode *node); |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
180 | void dav_cfg_bool_set_value(DavConfig *config, CfgBool *cbool, xmlNode *node); |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
181 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
182 | DavCfgRepository* dav_config_get_repository(DavConfig *config, cxstring name); |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
183 | DavCfgRepository* dav_config_url2repo(DavConfig *config, const char *url, char **path); |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
184 | DavCfgRepository* dav_config_url2repo_s(DavConfig *config, cxstring url, cxmutstr *path); |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
185 | |
796
81e0f67386a6
remove old config loader
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
795
diff
changeset
|
186 | int dav_config_keytype(DavCfgKeyType type); |
81e0f67386a6
remove old config loader
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
795
diff
changeset
|
187 | int dav_config_register_keys(DavConfig *config, DavContext *ctx, dav_loadkeyfile_func loadkey); |
795
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
188 | |
823
04c60a353331
add configured namespaces to the dav context
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
189 | int dav_config_register_namespaces(DavConfig *config, DavContext *ctx); |
04c60a353331
add configured namespaces to the dav context
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
190 | |
795
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
191 | #ifdef __cplusplus |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
192 | } |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
193 | #endif |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
194 | |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
195 | #endif /* LIBIDAV_CONFIG_H */ |
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
196 |