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 auth credstring
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
37 * @return DM_OK on success
51 void putCmdIntoList(GList ** commands, GList ** commands_last, void *pCommand);
54 * @par Description: API to create auth credstring
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
68 * @return DM_OK on success
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);
85 * @par Description: API to generate hmac
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
99 * @return DM_OK on success
113 DM_ERROR gemerate_hmac(char *username, char *password, unsigned char *nonce, unsigned int nonce_size, char *msg, unsigned int msg_size, char **mac);
116 * @par Description: API to find string value
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
128 * @return DM_OK on success
142 DM_ERROR findStgringValue(char *original, char *findParam, char *findSep, char **findValue);
145 * @par Description: API to set xml to file
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
169 void set_xml_to_file(char *xml, const char *path);
171 #endif /* SA_UTIL_H_ */