summaryrefslogtreecommitdiff
path: root/include/serviceadapter/sa_elements.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/serviceadapter/sa_elements.h')
-rwxr-xr-xinclude/serviceadapter/sa_elements.h775
1 files changed, 775 insertions, 0 deletions
diff --git a/include/serviceadapter/sa_elements.h b/include/serviceadapter/sa_elements.h
new file mode 100755
index 0000000..9bb4757
--- /dev/null
+++ b/include/serviceadapter/sa_elements.h
@@ -0,0 +1,775 @@
+/*
+ * oma-dm-agent
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SA_ELEMENTS_H_
+#define SA_ELEMENTS_H_
+
+/*dm-agent*/
+#include "common/dm_error.h"
+#include "serviceadapter/sa_define.h"
+
+/**
+ * @par Description: API to create hmac
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] string type, auth name
+ * @param[in] string type, auth type
+ * @param[out] session structure
+ *
+ *
+ * @return DM_OK on success
+ * DM_ERROR on fail
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+DM_ERROR create_hmac(char *auth_name, char *auth_type, char *mac, Session ** session);
+
+/**
+ * @par Description: API to create location
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] string type, location uri
+ * @param[in] string type, location name
+ * @param[out] location structure
+ *
+ *
+ * @return DM_OK on success
+ * DM_ERROR on fail
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+DM_ERROR create_location(const char *locURI, const char *locName, Location ** pLocation);
+
+/**
+ * @par Description: API to duplicate location
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[out] location structure
+ *
+ *
+ * @return location structure
+ *
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+Location *dup_location(Location * pLocation);
+
+/**
+ * @par Description: API to get location name
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[out] location structure
+ *
+ *
+ * @return location name
+ *
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+char *get_location_locname(Location * location);
+
+/**
+ * @par Description: API to get location uri
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[out] location structure
+ *
+ *
+ * @return location uri
+ *
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+char *get_location_locuri(Location * location);
+
+/**
+ * @par Description: API to free location
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] location structure
+ *
+ *
+ * @return
+ *
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+void free_location(Location * loc);
+
+/**
+ * @par Description: API to free cred
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[out] cred structure
+ *
+ *
+ * @return
+ *
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+void free_cred(Cred * cred);
+
+/**
+ * @par Description: API to create auth cred
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] string type, user name
+ * @param[in] enum type, AuthType
+ * @param[in] enum type, FormatType
+ * @param[in] string type, data
+ * @param[out] cred structure
+ *
+ *
+ * @return
+ *
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+DM_ERROR create_auth_cred(char *userName, char *pwd, AuthType authType, FormatType formatType, char *data, Cred ** cred);
+
+/**
+ * @par Description: API to create cred with data
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] enum type, AuthType
+ * @param[in] string type, data
+ *
+ *
+ * @return Cred structure
+ *
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+Cred *create_credwithdata(AuthType authType, char *data);
+
+/**
+ * @par Description: API to set cred format type
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] Cred structure
+ * @param[in] enum type, format type
+ *
+ *
+ * @return
+ *
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+void set_credformattype(Cred * cred, FormatType formatType);
+
+/**
+ * @par Description: API to check server cred
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] Cred structure
+ * @param[in] session structure
+ *
+ *
+ * @return DM_OK on success
+ * DM_ERROR on fial
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+DM_ERROR check_server_cred(Cred * hdrCred, Session * session); // Cred *sessionCred);
+
+/**
+ * @par Description: API to create challenge
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] enum type, format type
+ * @param[in] enum type, auth type
+ * @param[in] string type, next nonce
+ * @param[in] chanlenge stturcture
+ *
+ *
+ * @return DM_OK on success
+ * DM_ERROR on fial
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+DM_ERROR create_chal(FormatType format, AuthType type, char *nextnonce, Chal ** pChal);
+
+/**
+ * @par Description: API to free challenge
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] challenge structure
+ *
+ *
+ * @return
+ *
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+void free_chal(Chal * pChal);
+
+/**
+ * @par Description: API to duplicate chalenge
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] challenge structure
+ *
+ *
+ * @return challenge structure
+ *
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+Chal *dup_chal(Chal * pChal);
+
+/**
+ * @par Description: API to free challenge
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] challenge structure
+ *
+ *
+ * @return
+ *
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+void free_hmac(Hmac * hmac);
+
+/**
+ * @par Description: API to convert to string to auth type
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] string type, auth type
+ *
+ *
+ * @return AuthType
+ *
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+AuthType converttoauthtype(char *authType);
+
+/**
+ * @par Description: API to convert to string to format type
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] string type, format type
+ *
+ *
+ * @return FormatType
+ *
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+FormatType converttoformattype(char *formatType);
+
+/**
+ * @par Description: API to construct item
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] string type, source uri
+ * @param[in] string type, source uri
+ * @param[in] string type, format
+ * @param[in] string type, contenttype
+ * @param[in] string type, data
+ * @param[in] int type, size
+ * @param[in] int type, moredata
+ * @param[out] item structure
+ *
+ * @return DM_OK on success
+ * DM_ERROR on fail
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+DM_ERROR construct_Item(char *sourceUrl, const char *format, const char *contenttype, const char *data, unsigned int size, int moreData, Item ** pItem);
+
+/**
+ * @par Description: API to construct item
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ *
+ * @return item structure
+ *
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+Item *create_Item();
+
+/**
+ * @par Description: API to construct item
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] string type, data
+ * @param[in] int type, size
+ * @param[out] item structure
+ *
+ * @return DM_OK on success
+ * DM_ERROR on fail
+ *
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+DM_ERROR create_item_data(char *data, unsigned int size, Item ** pItem);
+
+/**
+ * @par Description: API to set item target uri
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] item structure
+ * @param[in] location structure
+ *
+ * @return
+ *
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+void set_itemtarget(Item * item, Location * target);
+
+/**
+ * @par Description: API to set item source uri
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] item structure
+ * @param[in] location structure
+ *
+ * @return
+ *
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+void set_itemsource(Item * item, Location * source);
+
+/**
+ * @par Description: API to free item
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] item structure
+ *
+ * @return
+ *
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+void free_Item(Item * item);
+
+/**
+ * @par Description: API to create syncml
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] sync header structure
+ * @param[in] status list
+ * @param[in] command list
+ * @param[in] int type is final
+ * @param[out] syncml structure
+ *
+ * @return DM_OK on success
+ * DM_ERROR on fail
+ *
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+DM_ERROR create_syncml(SyncHdr * syncHdr, GList * status, GList * commands, int isFinal, SyncML ** pSyncML);
+
+/**
+ * @par Description: API to free syncml
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] syncml structure
+ *
+ * @return
+ *
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+void free_syncml(SyncML * syncML);
+
+/**
+ * @par Description: API to create syncml header
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] session structure
+ * @param[out] sync header
+ *
+ * @return
+ *
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+DM_ERROR create_syncml_hdr(Session * session, SyncHdr ** pSyncHdr);
+
+/**
+ * @par Description: API to free syncml header
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] sync header
+ *
+ * @return
+ *
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+void free_synchdr(SyncHdr * syncHdr);
+
+#endif /* SA_ELEMENTS_H_ */