Tizen 2.0 Release
[framework/system/oma-dm-agent.git] / include / serviceadapter / sa_util.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_UTIL_H_
19 #define SA_UTIL_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 auth credstring
27  *
28  *
29  * @par Purpose:
30  * @par Typical use case:
31  * @par Method of function operation:
32  * @par Important notes:
33  * @param[in]           command list
34  * @param[in]           command last list value
35  * @param[in]           command structure
36  *
37  * @return                              DM_OK on success
38  *                                                      DM_ERROR on fail
39  *
40  * @par Errors:
41  *
42  * @pre None.
43  * @post
44  * @see
45  * @remarks None.
46  *
47  * @par Sample Code:
48  * @code
49  * @endcode
50  */
51 void putCmdIntoList(GList ** commands, GList ** commands_last, void *pCommand);
52
53 /**
54  * @par Description: API to create auth credstring
55  *
56  *
57  * @par Purpose:
58  * @par Typical use case:
59  * @par Method of function operation:
60  * @par Important notes:
61  * @param[in]           enum type, auth type
62  * @param[in]           string type, user name
63  * @param[in]           string type, password
64  * @param[in]           string type, nonce
65  * @param[in]           int type, nonce size
66  * @param[out]          string type, cred string
67  *
68  * @return                              DM_OK on success
69  *                                                      DM_ERROR on fail
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 DM_ERROR create_auth_credString(AuthType type, const char *username, const char *password, const unsigned char *nonce, const unsigned int nonce_size, char **pCred);
83
84 /**
85  * @par Description: API to generate hmac
86  *
87  *
88  * @par Purpose:
89  * @par Typical use case:
90  * @par Method of function operation:
91  * @par Important notes:
92  * @param[in]           string type, user name
93  * @param[in]           string type, password
94  * @param[in]           string type, nonce
95  * @param[in]           string type, msg
96  * @param[in]           int type, msg size
97  * @param[out]          string type, hmac
98  *
99  * @return                              DM_OK on success
100  *                                                      DM_ERROR on fail
101  *
102  * @par Errors:
103  *
104  * @pre None.
105  * @post
106  * @see
107  * @remarks None.
108  *
109  * @par Sample Code:
110  * @code
111  * @endcode
112  */
113 DM_ERROR gemerate_hmac(char *username, char *password, unsigned char *nonce, unsigned int nonce_size, char *msg, unsigned int msg_size, char **mac);
114
115 /**
116  * @par Description: API to find string value
117  *
118  *
119  * @par Purpose:
120  * @par Typical use case:
121  * @par Method of function operation:
122  * @par Important notes:
123  * @param[in]           string type, original string
124  * @param[in]           string type, find param
125  * @param[in]           string type, find seperator
126  * @param[out]          string type, find value
127  *
128  * @return                              DM_OK on success
129  *                                                      DM_ERROR on fail
130  *
131  * @par Errors:
132  *
133  * @pre None.
134  * @post
135  * @see
136  * @remarks None.
137  *
138  * @par Sample Code:
139  * @code
140  * @endcode
141  */
142 DM_ERROR findStgringValue(char *original, char *findParam, char *findSep, char **findValue);
143
144 /**
145  * @par Description: API to set xml to file
146  *
147  *
148  * @par Purpose:
149  * @par Typical use case:
150  * @par Method of function operation:
151  * @par Important notes:
152  * @param[in]           string type, xml
153  * @param[in]           string type, path
154  *
155  * @return
156  *
157  *
158  * @par Errors:
159  *
160  * @pre None.
161  * @post
162  * @see
163  * @remarks None.
164  *
165  * @par Sample Code:
166  * @code
167  * @endcode
168  */
169 void set_xml_to_file(char *xml, const char *path);
170
171 #endif                          /* SA_UTIL_H_ */