Initialize Tizen 2.3
[framework/system/oma-dm-agent.git] / include / serviceadapter / sa_session.h
1 /*
2  * oma-dm-agent
3  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4  *
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
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
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.
16  */
17
18 #ifndef SA_SESSION_H_
19 #define SA_SESSION_H_
20
21 /*dm-agent*/
22 #include "common/dm_error.h"
23 #include "serviceadapter/sa_define.h"
24
25 /**
26  * @par Description: API to create Session structure
27  * This API can be used to create Session structure
28  *
29  * @par Purpose:
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
41  *
42  * @return                              DM_OK on success
43  *                                                      DM_ERROR on fail
44  *
45  * @par Errors:
46  *
47  * @pre None.
48  * @post
49  * @see
50  * @remarks None.
51  *
52  * @par Sample Code:
53  * @code
54  * @endcode
55  */
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);
57
58 /**
59  * @par Description: API to free Session structure
60  *
61  *
62  * @par Purpose:
63  * @par Typical use case:
64  * @par Method of function operation:
65  * @par Important notes:
66  * @param[in]           Session structure
67  *
68  * @return
69  *
70  *
71  * @par Errors:
72  *
73  * @pre None.
74  * @post
75  * @see
76  * @remarks None.
77  *
78  * @par Sample Code:
79  * @code
80  * @endcode
81  */
82 void free_session(Session * session);
83
84 /**
85  * @par Description: API to receivce header
86  *
87  *
88  * @par Purpose:
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
94  *
95  * @return                              DM_OK on success
96  *                                                      DM_ERROR on fail
97  *
98  * @par Errors:
99  *
100  * @pre None.
101  * @post
102  * @see
103  * @remarks None.
104  *
105  * @par Sample Code:
106  * @code
107  * @endcode
108  */
109 DM_ERROR receive_header(Session * session, SyncHdr * header);
110
111 /**
112  * @par Description: API to receivce header
113  *
114  *
115  * @par Purpose:
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
122  *                                                      DM_ERROR on fail
123  *
124  * @par Errors:
125  *
126  * @pre None.
127  * @post
128  * @see
129  * @remarks None.
130  *
131  * @par Sample Code:
132  * @code
133  * @endcode
134  */
135 DM_ERROR receive_statuses(Session * session, GList * receiveStatus);
136
137 /**
138  * @par Description: API to receivce command
139  *
140  *
141  * @par Purpose:
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
147  *
148  * @return                              DM_OK on success
149  *                                                      DM_ERROR on fail
150  *
151  * @par Errors:
152  *
153  * @pre None.
154  * @post
155  * @see
156  * @remarks None.
157  *
158  * @par Sample Code:
159  * @code
160  * @endcode
161  */
162 DM_ERROR receive_cmd(Session * session, GList * receiveCommand);
163
164 /**
165  * @par Description: API to create prepending status
166  *
167  *
168  * @par Purpose:
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
175  *
176  *
177  * @return                              DM_OK on success
178  *                                                      DM_ERROR on fail
179  *
180  * @par Errors:
181  *
182  * @pre None.
183  * @post
184  * @see
185  * @remarks None.
186  *
187  * @par Sample Code:
188  * @code
189  * @endcode
190  */
191 DM_ERROR create_prependingstatus(unsigned int msgID, unsigned int cmdID, PendingStatus ** pPendingStatus);
192
193 /**
194  * @par Description: API to set auth cred
195  *
196  *
197  * @par Purpose:
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
203  *
204  *
205  * @return                              DM_OK on success
206  *                                                      DM_ERROR on fail
207  *
208  * @par Errors:
209  *
210  * @pre None.
211  * @post
212  * @see
213  * @remarks None.
214  *
215  * @par Sample Code:
216  * @code
217  * @endcode
218  */
219 DM_ERROR set_session_authcred(Session * session, Cred * cred);
220
221 /**
222  * @par Description: API to reset command id
223  *
224  *
225  * @par Purpose:
226  * @par Typical use case:
227  * @par Method of function operation:
228  * @par Important notes:
229  * @param[in]           session structure
230  *
231  *
232  * @return
233  *
234  * @par Errors:
235  *
236  * @pre None.
237  * @post
238  * @see
239  * @remarks None.
240  *
241  * @par Sample Code:
242  * @code
243  * @endcode
244  */
245 void reset_cmdid_session(Session * session);
246
247 /**
248  * @par Description: API to add response hmac info
249  *
250  *
251  * @par Purpose:
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
257  *
258  *
259  * @return                              DM_OK on success
260  *                                                      DM_ERROR on fail
261  *
262  * @par Errors:
263  *
264  * @pre None.
265  * @post
266  * @see
267  * @remarks None.
268  *
269  * @par Sample Code:
270  * @code
271  * @endcode
272  */
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);*/
276
277 /**
278  * @par Description: API to get session authtype
279  *
280  *
281  * @par Purpose:
282  * @par Typical use case:
283  * @par Method of function operation:
284  * @par Important notes:
285  * @param[in]           string type, auth data
286  *
287  *
288  * @return                              Auth type
289  *
290  *
291  * @par Errors:
292  *
293  * @pre None.
294  * @post
295  * @see
296  * @remarks None.
297  *
298  * @par Sample Code:
299  * @code
300  * @endcode
301  */
302 AuthType __get_Session_AuthType_enum(char *data);
303
304 /**
305  * @par Description: API to get session authname
306  *
307  *
308  * @par Purpose:
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
314  *
315  * @return
316  *
317  *
318  * @par Errors:
319  *
320  * @pre None.
321  * @post
322  * @see
323  * @remarks None.
324  *
325  * @par Sample Code:
326  * @code
327  * @endcode
328  */
329 void __set_Session_AuthType_name(AuthType authType, char **authname);
330
331 #endif                          /* SE_SESSION_H_ */