libsyncml 0.5.4

- Main Page
- Modules
- Data Structures
- Files

- File List

sml_defines.h
1 /*
2 * libsyncml - A syncml protocol implementation
3 * Copyright (C) 2005 Armin Bauer <armin.bauer@opensync.org>
4 * Copyright (C) 2007-2009 Michael Bell <michael.bell@opensync.org>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 */
21
29
30 #ifndef _SML_DEFINES_H
31 #define _SML_DEFINES_H
32
33 #define SML_ELEMENT_SYNCML "SyncML"
34 #define SML_ELEMENT_SYNCHDR "SyncHdr"
35 #define SML_ELEMENT_SYNCBODY "SyncBody"
36 #define SML_ELEMENT_VERPROTO "VerProto"
37 #define SML_ELEMENT_VERDTD "VerDTD"
38 #define SML_ELEMENT_MSGID "MsgID"
39 #define SML_ELEMENT_SESSIONID "SessionID"
40 #define SML_ELEMENT_TARGET "Target"
41 #define SML_ELEMENT_SOURCE "Source"
42 #define SML_ELEMENT_SOURCE_PARENT "SourceParent"
43 #define SML_ELEMENT_TARGET_PARENT "TargetParent"
44 #define SML_ELEMENT_LOCURI "LocURI"
45 #define SML_ELEMENT_LOCNAME "LocName"
46 #define SML_ELEMENT_RESPURI "RespURI"
47 #define SML_ELEMENT_NORESP "NoResp"
48 #define SML_ELEMENT_SYNC "Sync"
49 #define SML_ELEMENT_STATUS "Status"
50 #define SML_ELEMENT_CMDID "CmdID"
51 #define SML_ELEMENT_MSGREF "MsgRef"
52 #define SML_ELEMENT_CMDREF "CmdRef"
53 #define SML_ELEMENT_CMD "Cmd"
54 #define SML_ELEMENT_ANCHOR "Anchor"
55 #define SML_ELEMENT_NEXT "Next"
56 #define SML_ELEMENT_LAST "Last"
57 #define SML_ELEMENT_ALERT "Alert"
58 #define SML_ELEMENT_PUT "Put"
59 #define SML_ELEMENT_GET "Get"
60 #define SML_ELEMENT_SEQUENCE "Sequence"
61 #define SML_ELEMENT_ATOMIC "Atomic"
62 #define SML_ELEMENT_FINAL "Final"
63 #define SML_ELEMENT_DATA "Data"
64 #define SML_ELEMENT_ITEM "Item"
65 #define SML_ELEMENT_META "Meta"
66 #define SML_ELEMENT_MAXMSGSIZE "MaxMsgSize"
67 #define SML_ELEMENT_TYPE "Type"
68 #define SML_ELEMENT_SOURCEREF "SourceRef"
69 #define SML_ELEMENT_TARGETREF "TargetRef"
70 #define SML_ELEMENT_NUMBEROFCHANGES "NumberOfChanges"
71 #define SML_ELEMENT_ADD "Add"
72 #define SML_ELEMENT_REPLACE "Replace"
73 #define SML_ELEMENT_DELETE "Delete"
74 #define SML_ELEMENT_MAP "Map"
75 #define SML_ELEMENT_MAPITEM "MapItem"
76 #define SML_ELEMENT_FORMAT "Format"
77 #define SML_ELEMENT_CRED "Cred"
78 #define SML_ELEMENT_CHAL "Chal"
79 #define SML_ELEMENT_RESULTS "Results"
80 #define SML_ELEMENT_MAXOBJSIZE "MaxObjSize"
81 #define SML_ELEMENT_EMI "EMI"
82 #define SML_ELEMENT_MOREDATA "MoreData"
83 #define SML_ELEMENT_MEM "Mem"
84 #define SML_ELEMENT_FREEID "FreeID"
85 #define SML_ELEMENT_VERSION "Version"
86 #define SML_ELEMENT_NEXTNONCE "NextNonce"
87
88 /* For devinf */
89 #define SML_ELEMENT_CTCAP "CTCap"
90 #define SML_ELEMENT_CTTYPE "CTType"
91 #define SML_ELEMENT_DATASTORE "DataStore"
92 #define SML_ELEMENT_DATATYPE "DataType"
93 #define SML_ELEMENT_DEVID "DevID"
94 #define SML_ELEMENT_DEVINF "DevInf"
95 #define SML_ELEMENT_DEVTYPE "DevTyp"
96 #define SML_ELEMENT_DISPLAYNAME "DisplayName"
97 #define SML_ELEMENT_DSMEM "DSMem"
98 #define SML_ELEMENT_EXT "Ext"
99 #define SML_ELEMENT_FWV "FwV"
100 #define SML_ELEMENT_HWV "HwV"
101 #define SML_ELEMENT_MAN "Man"
102 #define SML_ELEMENT_MAXGUIDSIZE "MaxGUIDSize"
103 #define SML_ELEMENT_MAXID "MaxID"
104 #define SML_ELEMENT_MAXMEM "MaxMem"
105 #define SML_ELEMENT_MAXOCCUR "MaxOccur"
106 #define SML_ELEMENT_MAXSIZE "MaxSize"
107 #define SML_ELEMENT_MOD "Mod"
108 #define SML_ELEMENT_NOTRUNCATE "NoTruncate"
109 #define SML_ELEMENT_OEM "OEM"
110 #define SML_ELEMENT_PARAMNAME "ParamName"
111 #define SML_ELEMENT_PROPERTY "Property"
112 #define SML_ELEMENT_PROPNAME "PropName"
113 #define SML_ELEMENT_PROPPARAM "PropParam"
114 #define SML_ELEMENT_RX "Rx"
115 #define SML_ELEMENT_RXPREF "Rx-Pref"
116 #define SML_ELEMENT_SHAREDMEM "SharedMem"
117 #define SML_ELEMENT_SIZE "Size"
118 #define SML_ELEMENT_SUPPORTLARGEOBJS "SupportLargeObjs"
119 #define SML_ELEMENT_SUPPORTNUMBEROFCHANGES "SupportNumberOfChanges"
120 #define SML_ELEMENT_SUPPORT_HIERARCHICAL_SYNC "SupportHierarchicalSync"
121 #define SML_ELEMENT_SWV "SwV"
122 #define SML_ELEMENT_SYNCCAP "SyncCap"
123 #define SML_ELEMENT_SYNCTYPE "SyncType"
124 #define SML_ELEMENT_TX "Tx"
125 #define SML_ELEMENT_TXPREF "Tx-Pref"
126 #define SML_ELEMENT_UTC "UTC"
127 #define SML_ELEMENT_VALENUM "ValEnum"
128 #define SML_ELEMENT_VERCT "VerCT"
129 #define SML_ELEMENT_XNAM "XNam"
130 #define SML_ELEMENT_XVAL "XVal"
131
132 /* For metinf */
133 #define SML_ELEMENT_MARK "Mark"
134
135 #define SML_ELEMENT_DATATYPE_CHR "chr"
136 #define SML_ELEMENT_DATATYPE_INT "int"
137 #define SML_ELEMENT_DATATYPE_BOOL "bool"
138 #define SML_ELEMENT_DATATYPE_BIN "bin"
139 #define SML_ELEMENT_DATATYPE_DATE "datetime"
140 #define SML_ELEMENT_DATATYPE_PHONE "phonenum"
141
142 #define SML_ELEMENT_DEVTYP_PAGER "pager"
143 #define SML_ELEMENT_DEVTYP_HANDHELD "handheld"
144 #define SML_ELEMENT_DEVTYP_PDA "pda"
145 #define SML_ELEMENT_DEVTYP_PHONE "phone"
146 #define SML_ELEMENT_DEVTYP_SMARTPHONE "smartphone"
147 #define SML_ELEMENT_DEVTYP_SERVER "server"
148 #define SML_ELEMENT_DEVTYP_WORKSTATION "workstation"
149
150 typedef enum {
151 SML_DEVINF_DATATYPE_UNKNOWN,
152 SML_DEVINF_DATATYPE_CHR,
153 SML_DEVINF_DATATYPE_INT,
154 SML_DEVINF_DATATYPE_BOOL,
155 SML_DEVINF_DATATYPE_BIN,
156 SML_DEVINF_DATATYPE_DATE,
157 SML_DEVINF_DATATYPE_PHONE
158 } SmlDevInfDataType;
159
160 typedef enum {
161 SML_DEVINF_DEVTYPE_UNKNOWN,
162 SML_DEVINF_DEVTYPE_PAGER,
163 SML_DEVINF_DEVTYPE_HANDHELD,
164 SML_DEVINF_DEVTYPE_PDA,
165 SML_DEVINF_DEVTYPE_PHONE,
166 SML_DEVINF_DEVTYPE_SMARTPHONE,
167 SML_DEVINF_DEVTYPE_SERVER,
168 SML_DEVINF_DEVTYPE_WORKSTATION
169 } SmlDevInfDevTyp;
170
171 typedef enum {
172 SML_DEVINF_SYNCTYPE_UNKNOWN = 0,
173 SML_DEVINF_SYNCTYPE_TWO_WAY = 1,
174 SML_DEVINF_SYNCTYPE_SLOW_SYNC = 1 << 1,
175 SML_DEVINF_SYNCTYPE_ONE_WAY_FROM_CLIENT = 1 << 2,
176 SML_DEVINF_SYNCTYPE_REFRESH_FROM_CLIENT = 1 << 3,
177 SML_DEVINF_SYNCTYPE_ONE_WAY_FROM_SERVER = 1 << 4,
178 SML_DEVINF_SYNCTYPE_REFRESH_FROM_SERVER = 1 << 5,
179 SML_DEVINF_SYNCTYPE_SERVER_ALERTED_SYNC = 1 << 6
180 } SmlDevInfSyncCap;
181
182 typedef enum {
183 SML_DEVINF_CTCAP_UNKNOWN,
184 SML_DEVINF_CTCAP_CTTYPE,
185 SML_DEVINF_CTCAP_PROPNAME,
186 SML_DEVINF_CTCAP_VALENUM,
187 SML_DEVINF_CTCAP_DATATYPE,
188 SML_DEVINF_CTCAP_SIZE,
189 SML_DEVINF_CTCAP_DISPLAYNAME,
190 SML_DEVINF_CTCAP_PARAMNAME,
191 SML_DEVINF_CTCAP_VERCT,
192 SML_DEVINF_CTCAP_PROPERTY,
193 SML_DEVINF_CTCAP_PROPPARAM,
194 SML_DEVINF_CTCAP_NOTRUNCATE,
195 SML_DEVINF_CTCAP_MAXOCCUR,
196 SML_DEVINF_CTCAP_MAXSIZE
197 } SmlDevInfCTCapType;
198
199 #define SML_ELEMENT_TEXT_VCARD "text/x-vcard"
200 #define SML_ELEMENT_TEXT_VCARD_30 "text/vcard"
201 #define SML_ELEMENT_TEXT_VCAL "text/x-vcalendar"
202 #define SML_ELEMENT_TEXT_ICAL "text/calendar"
203 #define SML_ELEMENT_TEXT_PLAIN "text/plain"
204 #define SML_ELEMENT_TEXT_MESSAGE "text/x-vMessage"
205
206 #define SML_ELEMENT_DEVINF_XML "application/vnd.syncml-devinf+xml"
207 #define SML_ELEMENT_WBXML "application/vnd.syncml+wbxml"
208 #define SML_ELEMENT_XML "application/vnd.syncml+xml"
209 #define SML_ELEMENT_SAN "application/vnd.syncml.ds.notification"
210 #define SML_ELEMENT_APPLICATION_OMA_DS_EMAIL "application/vnd.omads-email+xml"
211 #define SML_ELEMENT_APPLICATION_OMA_DS_FILE "application/vnd.omads-file+xml"
212 #define SML_ELEMENT_APPLICATION_OMA_DS_FOLDER "application/vnd.omads-folder+xml"
213
214 #define SML_NAMESPACE_METINF "syncml:metinf"
215 #define SML_NAMESPACE_DEVINF "syncml:devinf"
216 #define SML_NAMESPACE_SYNCML10 "SYNCML:SYNCML1.0"
217 #define SML_NAMESPACE_SYNCML11 "SYNCML:SYNCML1.1"
218 #define SML_NAMESPACE_SYNCML12 "SYNCML:SYNCML1.2"
219
220 #define SML_VERSION_STRING_10 "SyncML/1.0"
221 #define SML_VERSION_STRING_11 "SyncML/1.1"
222 #define SML_VERSION_STRING_12 "SyncML/1.2"
223
224 #define SML_AUTH_BASIC "syncml:auth-basic"
225 #define SML_AUTH_MD5 "syncml:auth-md5"
226 #define SML_BASE64 "b64"
227
228 /* Transport configuration defines */
229
230 #define SML_TRANSPORT_CONFIG_PROXY "PROXY"
231 #define SML_TRANSPORT_CONFIG_USERNAME "USERNAME"
232 #define SML_TRANSPORT_CONFIG_PASSWORD "PASSWORD"
233 #define SML_TRANSPORT_CONFIG_SSL_CA_FILE "SSL_CA_FILE"
234 #define SML_TRANSPORT_CONFIG_PORT "PORT"
235 #define SML_TRANSPORT_CONFIG_URL "URL"
236 #define SML_TRANSPORT_CONFIG_SSL_KEY "SSL_KEY"
237 #define SML_TRANSPORT_CONFIG_SSL_SERVER_CERT "SSL_SERVER_CERT"
238 #define SML_TRANSPORT_CONFIG_BLUETOOTH_ADDRESS "BLUETOOTH_ADDRESS"
239 #define SML_TRANSPORT_CONFIG_BLUETOOTH_CHANNEL "BLUETOOTH_CHANNEL"
240 #define SML_TRANSPORT_CONFIG_IRDA_SERVICE "IRDA_SERVICE"
241
242 #define SML_TRANSPORT_CONFIG_AT_COMMAND "AT_COMMAND"
243 #define SML_TRANSPORT_CONFIG_AT_MANUFACTURER "AT_MANUFACTURER"
244 #define SML_TRANSPORT_CONFIG_AT_MODEL "AT_MODEL"
245
246 #define SML_TRANSPORT_CONFIG_DATASTORE "DATASTORE"
247 #define SML_TRANSPORT_CONFIG_DATASTORE_EVENT "EVENT"
248 #define SML_TRANSPORT_CONFIG_DATASTORE_TODO "TODO"
249 #define SML_TRANSPORT_CONFIG_DATASTORE_CONTACT "CONTACT"
250 #define SML_TRANSPORT_CONFIG_DATASTORE_NOTE "NOTE"
251
252 /* Enumeration types */
253
254 typedef enum {
255 SML_DEVINF_VERSION_UNKNOWN = 0,
256 SML_DEVINF_VERSION_10 = 1,
257 SML_DEVINF_VERSION_11 = 2,
258 SML_DEVINF_VERSION_12 = 3
259 } SmlDevInfVersion;
260
261 typedef enum {
262 SML_MIMETYPE_UNKNOWN,
263 SML_MIMETYPE_XML,
264 SML_MIMETYPE_WBXML,
265 SML_MIMETYPE_SAN
266 } SmlMimeType;
267
268 typedef enum {
269 SML_TRANSPORT_HTTP_SERVER,
270 SML_TRANSPORT_HTTP_CLIENT,
271 SML_TRANSPORT_OBEX_CLIENT,
272 SML_TRANSPORT_OBEX_SERVER
273 } SmlTransportType;
274
275 typedef enum {
276 SML_RESULT_OK,
277 SML_RESULT_RETRY,
278 SML_RESULT_FATAL
279 } SmlTransportResult;
280
281 typedef enum {
282 SML_VERSION_UNKNOWN = 0,
283 SML_VERSION_10 = 1,
284 SML_VERSION_11 = 2,
285 SML_VERSION_12 = 3
286 } SmlProtocolVersion;
287
288 typedef enum {
289 SML_PROTOCOL_UNKNOWN = 0,
290 SML_PROTOCOL_SYNCML = 1,
291 SML_PROTOCOL_DM = 2
292 } SmlProtocolType;
293
294 typedef enum {
295 SML_COMMAND_TYPE_UNKNOWN = 0,
296 SML_COMMAND_TYPE_ALERT = 1,
297 SML_COMMAND_TYPE_SYNC = 2,
298 SML_COMMAND_TYPE_PUT = 3,
299 SML_COMMAND_TYPE_HEADER = 4,
300 SML_COMMAND_TYPE_ADD = 5,
301 SML_COMMAND_TYPE_REPLACE = 6,
302 SML_COMMAND_TYPE_DELETE = 7,
303 SML_COMMAND_TYPE_MAP = 8,
304 SML_COMMAND_TYPE_GET = 9,
305 SML_COMMAND_TYPE_RESULTS = 10
306 } SmlCommandType;
307
308 typedef enum {
309 SML_ALERT_UNKNOWN = 0,
310 SML_ALERT_DISPLAY = 100,
311 SML_ALERT_TWO_WAY = 200,
312 SML_ALERT_SLOW_SYNC = 201,
313 SML_ALERT_ONE_WAY_FROM_CLIENT = 202,
314 SML_ALERT_REFRESH_FROM_CLIENT = 203,
315 SML_ALERT_ONE_WAY_FROM_SERVER = 204,
316 SML_ALERT_REFRESH_FROM_SERVER = 205,
317 SML_ALERT_TWO_WAY_BY_SERVER = 206,
318 SML_ALERT_ONE_WAY_FROM_CLIENT_BY_SERVER = 207,
319 SML_ALERT_REFRESH_FROM_CLIENT_BY_SERVER = 208,
320 SML_ALERT_ONE_WAY_FROM_SERVER_BY_SERVER = 209,
321 SML_ALERT_REFRESH_FROM_SERVER_BY_SERVER = 210,
322 SML_ALERT_RESULT = 221,
323 SML_ALERT_NEXT_MESSAGE = 222,
324 SML_ALERT_NO_END_OF_DATA = 223
325 } SmlAlertType;
326
327 typedef enum {
328 SML_CHANGE_UNKNOWN = 0,
329 SML_CHANGE_ADD = 1,
330 SML_CHANGE_REPLACE = 2,
331 SML_CHANGE_DELETE = 3
332 } SmlChangeType;
333
334 typedef enum {
335 SML_AUTH_TYPE_UNKNOWN = 0,
336 SML_AUTH_TYPE_BASIC = 1,
337 SML_AUTH_TYPE_MD5 = 2
338 } SmlAuthType;
339
340 typedef enum {
341 SML_FORMAT_TYPE_UNKNOWN = 0,
342 SML_FORMAT_TYPE_BASE64 = 1
343 } SmlFormatType;
344
345 typedef enum {
346 SML_DS_UNKNOWN_TYPE = 0,
347 SML_DS_SERVER = 1,
348 SML_DS_CLIENT = 2
349 } SmlDsServerType;
350
351 #if __GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2)
352 /* gcc >= 3.2 */
353 # define LIBSYNCML_DEPRECATED __attribute__ ((deprecated))
354 #elif defined(_MSC_VER) && (_MSC_VER >= 1300) && (_MSC_VER < 1400)
355 /* msvc >= 7 */
356 # define LIBSYNCML_DEPRECATED __declspec(deprecated)
357 #elif defined(_MSV_VER) && (_MSC_VER >= 1400)
358 /* MS Visual Studio 2005 */
359 # define LIBSYNCML_DEPRECATED
360 #else
361 # define LIBSYNCML_DEPRECATED
362 #endif
363
364 #endif //_SML_DEFINES_H
365