3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 * @brief This file is the header file of interface and defined structure for San Parser
24 #ifndef PM_SANPARSER_H_
25 #define PM_SANPARSER_H_
27 /* FIXME : When initialize, set "Server_id" at config_tbl..
28 #define SMLDS_MOBILEDIT_SERVER (char *)"mobiledit"
29 #define SMLDS_FUNAMBOL_SERVER (char *)"funambol"
30 #define SMLDS_O3SIS_SERVER_SAN_IDENTIFIER (char *)"O3SIS SyncML Server"
34 SAN_UIMODE_UNSPECIFIED = 0,
35 SAN_UIMODE_BACKGROUND = 1,
36 SAN_UIMODE_INFORMATIVE = 2,
41 SAN_INITIATOR_USER = 0,
42 SAN_INITIATOR_SERVER = 1
46 SAN_SYNC_TYPE_TWO_WAY_BY_SERVER = 206,
47 SAN_SYNC_TYPE_ONE_WAY_FROM_CLIENT_BY_SERVER = 207,
48 SAN_SYNC_TYPE_REFRESH_FROM_CLIENT_BY_SERVER = 208,
49 SAN_SYNC_TYPE_ONE_WAY_FROM_SERVER_BY_SERVER = 209,
50 SAN_SYNC_TYPE_REFRESH_FROM_SERVER_BY_SERVER = 210,
53 typedef struct san_cred san_cred_s;
60 typedef struct san_content_type san_content_type_s;
61 struct san_content_type {
66 typedef struct san_sync_alert san_sync_alert_s;
67 struct san_sync_alert {
68 san_sync_type_e sync_type;
73 typedef struct san_package san_package_s;
75 char *msg_body_without_digest;
76 unsigned int msg_body_without_digest_length;
79 san_ui_mode_e ui_mode;
80 san_initiator_e initiator;
81 unsigned int session_id;
84 unsigned int cnt_sync_alerts;
85 san_sync_alert_s *sync_alerts;
89 * @par Description: API to parse for SAN version 1.2
93 * @par Typical use case:
94 * @par Method of function operation:
95 * @par Important notes:
96 * @param[in] string type, msg body
97 * @param[in] unsigned int type, size of msg
100 * @return san_package_s structure on success
114 san_package_s *san_package_12_parser(const char *msg_body, unsigned int msg_size);
117 * @par Description: API to parse for SAN version 1.1
121 * @par Typical use case:
122 * @par Method of function operation:
123 * @par Important notes:
124 * @param[in] string type, msg body
125 * @param[in] unsigned int type, size of msg
128 * @return san_package_s structure on success
142 san_package_s *san_package_11_parser(const char *msg_body, unsigned int msg_size);
145 * @par Description: API to free san_package_s structure
149 * @par Typical use case:
150 * @par Method of function operation:
151 * @par Important notes:
152 * @param[in] san_package_s structure
168 void sanPackageParserFree(void *point);
171 * @par Description: API to print SAN msg for debugging
175 * @par Typical use case:
176 * @par Method of function operation:
177 * @par Important notes:
178 * @param[in] san_package_s structure
194 void sanPrintMsg(san_package_s * san);
197 * @par Description: API to parse ip push message
201 * @par Typical use case:
202 * @par Method of function operation:
203 * @par Important notes:
204 * @param[in] data(ip push message)
205 * @param[out] san_package_s structure
208 * @return 1 on success
222 int parse_ip_push_msg(char *data, san_package_s ** sanpackage, char **id);
224 #endif /* PM_SANPARSER_H_ */