diff options
Diffstat (limited to 'include/service-adapter/sa_define.h')
-rwxr-xr-x | include/service-adapter/sa_define.h | 159 |
1 files changed, 159 insertions, 0 deletions
diff --git a/include/service-adapter/sa_define.h b/include/service-adapter/sa_define.h new file mode 100755 index 0000000..254e6ce --- /dev/null +++ b/include/service-adapter/sa_define.h @@ -0,0 +1,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_ */ |