Tizen 2.0 Release
[pkgs/o/oma-ds-service.git] / include / service-adapter / sa_define.h
1 /*
2  * oma-ds-agent
3  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4  *
5  * Licensed under the Apache License, Version 2.0 (the License);
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18 /**
19  *   @SA_Define.h
20  *   @version                                                                   0.1
21  *   @brief                                                                             This file is the header file of defined structure and enumeration used in SA
22  */
23
24 #ifndef SA_DEFINE_H_
25 #define SA_DEFINE_H_
26
27 #include <malloc.h>
28 #include <glib.h>
29 #include <assert.h>
30 #include <string.h>
31 #include <stdbool.h>
32
33 #include "service-adapter/sa_error.h"
34
35 #define DEFINE_PROTOCOL_TYPE "OMA_DS"
36
37 #define ELEMENT_DEVINF_10 "./devinf10"
38 #define ELEMENT_DEVINF_11 "./devinf11"
39 #define ELEMENT_DEVINF_12 "./devinf12"
40
41 #define ELEMENT_DEVINF_XML "application/vnd.syncml-devinf+xml"
42 #define ELEMENT_DEVINF_WBXML "application/vnd.syncml-devinf+wbxml"
43 #define ELEMENT_WBXML "application/vnd.syncml+wbxml"
44 #define ELEMENT_XML "application/vnd.syncml+xml"
45
46 #define ELEMENT_AUTH_BASIC "syncml:auth-basic"
47 #define ELEMENT_AUTH_MD5 "syncml:auth-md5"
48 #define ELEMENT_FORMAT_BASE64 "b64"
49
50 #define OMA_DS_HTTP_DEFAULT_CLIENT_MAX_MSG_SIZE 1024*12
51 #define OMA_DS_HTTP_DEFAULT_CLIENT_MAX_OBJ_SIZE 1024*1024
52
53 /*#define OMA_DS_HTTP_DEFAULT_SERVER_MAX_MSG_SIZE 61440*/
54 #define OMA_DS_HTTP_DEFAULT_SERVER_MAX_MSG_SIZE 1024*5
55
56 typedef struct item item_s;
57 typedef struct status status_s;
58 typedef struct command command_s;
59 typedef struct anchor anchor_s;
60 typedef struct location location_s;
61 typedef struct cred cred_s;
62 typedef struct syncml syncml_s;
63 typedef struct sync_hdr sync_hdr_s;
64 typedef struct chal chal_s;
65 typedef struct devinf devinf_s;
66 typedef struct devinf_datastore devinf_datastore_s;
67 typedef struct devinf_content_type devinf_content_type_s;
68 typedef struct devinf_ct_cap devinf_ct_cap_s;
69 typedef struct devinf_property devinf_property_s;
70 typedef struct devinf_prop_param devinf_prop_param_s;
71 typedef struct filter_cap filter_cap_s;
72 typedef struct session session_s;
73 typedef struct command_status command_status_s;
74 typedef struct mem mem_s;
75
76 typedef enum {
77         VERSION_UNKNOWN = 0,
78         VERSION_10 = 1,
79         VERSION_11 = 2,
80         VERSION_12 = 3
81 } protocol_version_e;
82
83 typedef enum {
84         PROTOCOL_TYPE_UNKNOWN = 0,
85         PROTOCOL_TYPE_DS = 1,
86 } protocol_type_e;
87
88 typedef enum {
89         COMMAND_TYPE_UNKNOWN = 0,
90         COMMAND_TYPE_ALERT = 1,
91         COMMAND_TYPE_SYNC_START = 2,
92         COMMAND_TYPE_SYNC_END = 3,
93         COMMAND_TYPE_PUT = 4,
94         COMMAND_TYPE_HEADER = 5,
95         COMMAND_TYPE_ADD = 6,
96         COMMAND_TYPE_REPLACE = 7,
97         COMMAND_TYPE_DELETE = 8,
98         COMMAND_TYPE_MAP = 9,
99         COMMAND_TYPE_GET = 10,
100         COMMAND_TYPE_RESULTS = 11
101 } command_type_e;
102
103 typedef enum {
104         AUTH_TYPE_UNKNOWN = 0,
105         AUTH_TYPE_BASIC = 1,
106         AUTH_TYPE_MD5 = 2
107 } auth_type_e;
108
109 typedef enum {
110         FORMAT_TYPE_UNKNOWN = 0,
111         FORMAT_TYPE_BASE64 = 1
112 } format_type_e;
113
114 typedef enum {
115         DEVINF_VERSION_UNKNOWN = 0,
116         DEVINF_VERSION_10 = 1,
117         DEVINF_VERSION_11 = 2,
118         DEVINF_VERSION_12 = 3
119 } devinf_version_e;
120
121 typedef enum {
122         DEVINF_DEVTYPE_UNKNOWN,
123         DEVINF_DEVTYPE_PAGER,
124         DEVINF_DEVTYPE_HANDHELD,
125         DEVINF_DEVTYPE_PDA,
126         DEVINF_DEVTYPE_PHONE,
127         DEVINF_DEVTYPE_SMARTPHONE,
128         DEVINF_DEVTYPE_SERVER,
129         DEVINF_DEVTYPE_WORKSTATION
130 } devinf_devtyp_e;
131
132 typedef enum {
133         DEVINF_SYNCTYPE_UNKNOWN = 0,
134         DEVINF_SYNCTYPE_TWO_WAY = 1,
135         DEVINF_SYNCTYPE_SLOW_SYNC = 1 << 1,
136         DEVINF_SYNCTYPE_ONE_WAY_FROM_CLIENT = 1 << 2,
137         DEVINF_SYNCTYPE_REFRESH_FROM_CLIENT = 1 << 3,
138         DEVINF_SYNCTYPE_ONE_WAY_FROM_SERVER = 1 << 4,
139         DEVINF_SYNCTYPE_REFRESH_FROM_SERVER = 1 << 5,
140         DEVINF_SYNCTYPE_SERVER_ALERTED_SYNC = 1 << 6
141 } devinf_sync_cap_e;
142
143 typedef enum {
144         SYNCML_PKG_1 = 1,
145         SYNCML_PKG_2 = 2,
146         SYNCML_PKG_3 = 3,
147         SYNCML_PKG_4 = 4,
148         SYNCML_PKG_5 = 5,
149         SYNCML_PKG_6 = 6,
150         SYNCML_SUSPEND = 7
151 } pkg_status_e;
152
153 typedef enum {
154         ITEM_UNKNOWN = 0,
155         ITEM_DATA = 1,
156         ITEM_DEVINF = 2,
157 } item_data_type_e;
158
159 #endif                          /* SA_DEFINE_H_ */