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.
22 #include "common/dm_error.h"
23 #include "serviceadapter/sa_define.h"
26 * @par Description: API to create Session structure
27 * This API can be used to create Session structure
30 * @par Typical use case:
31 * @par Method of function operation:
32 * @par Important notes:
33 * @param[in] enum type, protocol version(VERSION_UNKNOWN, VERSION_10, VERSION_11, VERSION_12);
34 * @param[in] enum type, protocol type(PROTOCOL_TYPE_UNKNOWN , PROTOCOL_TYPE_DM)
35 * @param[in] string type, server id
36 * @param[in] string type, client id
37 * @param[in] string type, session id
38 * @param[in] string type, source uri(server ip)
39 * @param[in] string type, target uri(client identifer)
40 * @param[out] Session structure
42 * @return DM_OK on success
56 DM_ERROR create_syncml_session(ProtocolVersion protocolVersion, ProtocolType protocolType, char *server_id, char *client_id, char *pSession_id, char *sourceUrl, char *targetUrl, Session ** pSession);
59 * @par Description: API to free Session structure
63 * @par Typical use case:
64 * @par Method of function operation:
65 * @par Important notes:
66 * @param[in] Session structure
82 void free_session(Session * session);
85 * @par Description: API to receivce header
89 * @par Typical use case:
90 * @par Method of function operation:
91 * @par Important notes:
92 * @param[in] Session structure
93 * @param[in] syncml header structure
95 * @return DM_OK on success
109 DM_ERROR receive_header(Session * session, SyncHdr * header);
112 * @par Description: API to receivce header
116 * @par Typical use case:
117 * @par Method of function operation:
118 * @par Important notes:
119 * @param[in] Session structure
120 * @param[in] receive status list
121 * @return DM_OK on success
135 DM_ERROR receive_statuses(Session * session, GList * receiveStatus);
138 * @par Description: API to receivce command
142 * @par Typical use case:
143 * @par Method of function operation:
144 * @par Important notes:
145 * @param[in] Session structure
146 * @param[in] receive command list
148 * @return DM_OK on success
162 DM_ERROR receive_cmd(Session * session, GList * receiveCommand);
165 * @par Description: API to create prepending status
169 * @par Typical use case:
170 * @par Method of function operation:
171 * @par Important notes:
172 * @param[in] int type, msg id
173 * @param[in] int type, command id
174 * @param[out] pending status structure
177 * @return DM_OK on success
191 DM_ERROR create_prependingstatus(unsigned int msgID, unsigned int cmdID, PendingStatus ** pPendingStatus);
194 * @par Description: API to set auth cred
198 * @par Typical use case:
199 * @par Method of function operation:
200 * @par Important notes:
201 * @param[in] session structure
202 * @param[in] cred structure
205 * @return DM_OK on success
219 DM_ERROR set_session_authcred(Session * session, Cred * cred);
222 * @par Description: API to reset command id
226 * @par Typical use case:
227 * @par Method of function operation:
228 * @par Important notes:
229 * @param[in] session structure
245 void reset_cmdid_session(Session * session);
248 * @par Description: API to add response hmac info
252 * @par Typical use case:
253 * @par Method of function operation:
254 * @par Important notes:
255 * @param[in] session structure
256 * @param[in] string type, temp hmac
259 * @return DM_OK on success
273 DM_ERROR add_response_hmacinfo(Session ** session, char *temp_hmac);
274 /*DM_ERROR get_session_clientauthtype(Session * session, AuthType * authType);
275 DM_ERROR get_session_serverauthtype(Session * session, AuthType * authType);*/
278 * @par Description: API to get session authtype
282 * @par Typical use case:
283 * @par Method of function operation:
284 * @par Important notes:
285 * @param[in] string type, auth data
302 AuthType __get_Session_AuthType_enum(char *data);
305 * @par Description: API to get session authname
309 * @par Typical use case:
310 * @par Method of function operation:
311 * @par Important notes:
312 * @param[in] enum type, Auth type
313 * @param[out] string type, auth name
329 void __set_Session_AuthType_name(AuthType authType, char **authname);
331 #endif /* SE_SESSION_H_ */