summaryrefslogtreecommitdiff
path: root/include/service-adapter/sa_define.h
blob: 254e6ce6b0f0a9c7cf816cd098939864ec3eb7bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
/*
 * oma-ds-agent
 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the License);
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 *   @SA_Define.h
 *   @version									0.1
 *   @brief										This file is the header file of defined structure and enumeration used in SA
 */

#ifndef SA_DEFINE_H_
#define SA_DEFINE_H_

#include <malloc.h>
#include <glib.h>
#include <assert.h>
#include <string.h>
#include <stdbool.h>

#include "service-adapter/sa_error.h"

#define DEFINE_PROTOCOL_TYPE "OMA_DS"

#define ELEMENT_DEVINF_10 "./devinf10"
#define ELEMENT_DEVINF_11 "./devinf11"
#define ELEMENT_DEVINF_12 "./devinf12"

#define ELEMENT_DEVINF_XML "application/vnd.syncml-devinf+xml"
#define ELEMENT_DEVINF_WBXML "application/vnd.syncml-devinf+wbxml"
#define ELEMENT_WBXML "application/vnd.syncml+wbxml"
#define ELEMENT_XML "application/vnd.syncml+xml"

#define ELEMENT_AUTH_BASIC "syncml:auth-basic"
#define ELEMENT_AUTH_MD5 "syncml:auth-md5"
#define ELEMENT_FORMAT_BASE64 "b64"

#define OMA_DS_HTTP_DEFAULT_CLIENT_MAX_MSG_SIZE 1024*12
#define OMA_DS_HTTP_DEFAULT_CLIENT_MAX_OBJ_SIZE 1024*1024

/*#define OMA_DS_HTTP_DEFAULT_SERVER_MAX_MSG_SIZE 61440*/
#define OMA_DS_HTTP_DEFAULT_SERVER_MAX_MSG_SIZE 1024*5

typedef struct item item_s;
typedef struct status status_s;
typedef struct command command_s;
typedef struct anchor anchor_s;
typedef struct location location_s;
typedef struct cred cred_s;
typedef struct syncml syncml_s;
typedef struct sync_hdr sync_hdr_s;
typedef struct chal chal_s;
typedef struct devinf devinf_s;
typedef struct devinf_datastore devinf_datastore_s;
typedef struct devinf_content_type devinf_content_type_s;
typedef struct devinf_ct_cap devinf_ct_cap_s;
typedef struct devinf_property devinf_property_s;
typedef struct devinf_prop_param devinf_prop_param_s;
typedef struct filter_cap filter_cap_s;
typedef struct session session_s;
typedef struct command_status command_status_s;
typedef struct mem mem_s;

typedef enum {
	VERSION_UNKNOWN = 0,
	VERSION_10 = 1,
	VERSION_11 = 2,
	VERSION_12 = 3
} protocol_version_e;

typedef enum {
	PROTOCOL_TYPE_UNKNOWN = 0,
	PROTOCOL_TYPE_DS = 1,
} protocol_type_e;

typedef enum {
	COMMAND_TYPE_UNKNOWN = 0,
	COMMAND_TYPE_ALERT = 1,
	COMMAND_TYPE_SYNC_START = 2,
	COMMAND_TYPE_SYNC_END = 3,
	COMMAND_TYPE_PUT = 4,
	COMMAND_TYPE_HEADER = 5,
	COMMAND_TYPE_ADD = 6,
	COMMAND_TYPE_REPLACE = 7,
	COMMAND_TYPE_DELETE = 8,
	COMMAND_TYPE_MAP = 9,
	COMMAND_TYPE_GET = 10,
	COMMAND_TYPE_RESULTS = 11
} command_type_e;

typedef enum {
	AUTH_TYPE_UNKNOWN = 0,
	AUTH_TYPE_BASIC = 1,
	AUTH_TYPE_MD5 = 2
} auth_type_e;

typedef enum {
	FORMAT_TYPE_UNKNOWN = 0,
	FORMAT_TYPE_BASE64 = 1
} format_type_e;

typedef enum {
	DEVINF_VERSION_UNKNOWN = 0,
	DEVINF_VERSION_10 = 1,
	DEVINF_VERSION_11 = 2,
	DEVINF_VERSION_12 = 3
} devinf_version_e;

typedef enum {
	DEVINF_DEVTYPE_UNKNOWN,
	DEVINF_DEVTYPE_PAGER,
	DEVINF_DEVTYPE_HANDHELD,
	DEVINF_DEVTYPE_PDA,
	DEVINF_DEVTYPE_PHONE,
	DEVINF_DEVTYPE_SMARTPHONE,
	DEVINF_DEVTYPE_SERVER,
	DEVINF_DEVTYPE_WORKSTATION
} devinf_devtyp_e;

typedef enum {
	DEVINF_SYNCTYPE_UNKNOWN = 0,
	DEVINF_SYNCTYPE_TWO_WAY = 1,
	DEVINF_SYNCTYPE_SLOW_SYNC = 1 << 1,
	DEVINF_SYNCTYPE_ONE_WAY_FROM_CLIENT = 1 << 2,
	DEVINF_SYNCTYPE_REFRESH_FROM_CLIENT = 1 << 3,
	DEVINF_SYNCTYPE_ONE_WAY_FROM_SERVER = 1 << 4,
	DEVINF_SYNCTYPE_REFRESH_FROM_SERVER = 1 << 5,
	DEVINF_SYNCTYPE_SERVER_ALERTED_SYNC = 1 << 6
} devinf_sync_cap_e;

typedef enum {
	SYNCML_PKG_1 = 1,
	SYNCML_PKG_2 = 2,
	SYNCML_PKG_3 = 3,
	SYNCML_PKG_4 = 4,
	SYNCML_PKG_5 = 5,
	SYNCML_PKG_6 = 6,
	SYNCML_SUSPEND = 7
} pkg_status_e;

typedef enum {
	ITEM_UNKNOWN = 0,
	ITEM_DATA = 1,
	ITEM_DEVINF = 2,
} item_data_type_e;

#endif				/* SA_DEFINE_H_ */