summaryrefslogtreecommitdiff
path: root/include/framework/san-parser/pm_sanparser.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/framework/san-parser/pm_sanparser.h')
-rwxr-xr-xinclude/framework/san-parser/pm_sanparser.h224
1 files changed, 224 insertions, 0 deletions
diff --git a/include/framework/san-parser/pm_sanparser.h b/include/framework/san-parser/pm_sanparser.h
new file mode 100755
index 0000000..47b5bf5
--- /dev/null
+++ b/include/framework/san-parser/pm_sanparser.h
@@ -0,0 +1,224 @@
+/*
+ * 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.
+ */
+
+/**
+ * @PM_SanParser.h
+ * @version 0.1
+ * @brief This file is the header file of interface and defined structure for San Parser
+ */
+
+#ifndef PM_SANPARSER_H_
+#define PM_SANPARSER_H_
+
+/* FIXME : When initialize, set "Server_id" at config_tbl..
+#define SMLDS_MOBILEDIT_SERVER (char *)"mobiledit"
+#define SMLDS_FUNAMBOL_SERVER (char *)"funambol"
+#define SMLDS_O3SIS_SERVER_SAN_IDENTIFIER (char *)"O3SIS SyncML Server"
+*/
+
+typedef enum {
+ SAN_UIMODE_UNSPECIFIED = 0,
+ SAN_UIMODE_BACKGROUND = 1,
+ SAN_UIMODE_INFORMATIVE = 2,
+ SAN_UIMODE_USER = 3
+} san_ui_mode_e;
+
+typedef enum {
+ SAN_INITIATOR_USER = 0,
+ SAN_INITIATOR_SERVER = 1
+} san_initiator_e;
+
+typedef enum {
+ SAN_SYNC_TYPE_TWO_WAY_BY_SERVER = 206,
+ SAN_SYNC_TYPE_ONE_WAY_FROM_CLIENT_BY_SERVER = 207,
+ SAN_SYNC_TYPE_REFRESH_FROM_CLIENT_BY_SERVER = 208,
+ SAN_SYNC_TYPE_ONE_WAY_FROM_SERVER_BY_SERVER = 209,
+ SAN_SYNC_TYPE_REFRESH_FROM_SERVER_BY_SERVER = 210,
+} san_sync_type_e;
+
+typedef struct san_cred san_cred_s;
+struct san_cred {
+ char *cred_format;
+ char *cred_auth;
+ char *cred_data;
+};
+
+typedef struct san_content_type san_content_type_s;
+struct san_content_type {
+ unsigned int type;
+ char *strType;
+};
+
+typedef struct san_sync_alert san_sync_alert_s;
+struct san_sync_alert {
+ san_sync_type_e sync_type;
+ char *content_type;
+ char *server_uri;
+};
+
+typedef struct san_package san_package_s;
+struct san_package {
+ char *msg_body_without_digest;
+ unsigned int msg_body_without_digest_length;
+ char *digest;
+ unsigned int version;
+ san_ui_mode_e ui_mode;
+ san_initiator_e initiator;
+ unsigned int session_id;
+ san_cred_s *cred;
+ char *server_id;
+ unsigned int cnt_sync_alerts;
+ san_sync_alert_s *sync_alerts;
+};
+
+/**
+ * @par Description: API to parse for SAN version 1.2
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] string type, msg body
+ * @param[in] unsigned int type, size of msg
+ * @param[out]
+ *
+ * @return san_package_s structure on success
+ * NULL on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+san_package_s *san_package_12_parser(const char *msg_body, unsigned int msg_size);
+
+/**
+ * @par Description: API to parse for SAN version 1.1
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] string type, msg body
+ * @param[in] unsigned int type, size of msg
+ * @param[out]
+ *
+ * @return san_package_s structure on success
+ * NULL on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+san_package_s *san_package_11_parser(const char *msg_body, unsigned int msg_size);
+
+/**
+ * @par Description: API to free san_package_s structure
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] san_package_s structure
+ * @param[out]
+ *
+ * @return
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+void sanPackageParserFree(void *point);
+
+/**
+ * @par Description: API to print SAN msg for debugging
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] san_package_s structure
+ * @param[out]
+ *
+ * @return
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+void sanPrintMsg(san_package_s * san);
+
+/**
+ * @par Description: API to parse ip push message
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] data(ip push message)
+ * @param[out] san_package_s structure
+ * @param[out] id
+ *
+ * @return 1 on success
+ * 0 on fail
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+int parse_ip_push_msg(char *data, san_package_s ** sanpackage, char **id);
+
+#endif /* PM_SANPARSER_H_ */