diff options
Diffstat (limited to 'include/dm-engine')
-rwxr-xr-x | include/dm-engine/bootstrap/factory_bootstrap.h | 76 | ||||
-rwxr-xr-x | include/dm-engine/cp/dm_cp_error.h | 27 | ||||
-rwxr-xr-x | include/dm-engine/cp/dm_cp_parser.h | 61 | ||||
-rwxr-xr-x | include/dm-engine/cp/dm_cp_processor.h | 567 | ||||
-rwxr-xr-x | include/dm-engine/cp/dm_cp_security.h | 40 | ||||
-rwxr-xr-x | include/dm-engine/cp/dm_cp_struct.h | 201 | ||||
-rwxr-xr-x | include/dm-engine/dl-manager/dd_object.h | 53 | ||||
-rwxr-xr-x | include/dm-engine/dl-manager/dd_parser.h | 53 | ||||
-rwxr-xr-x | include/dm-engine/dl-manager/fw_downloader.h | 175 | ||||
-rwxr-xr-x | include/dm-engine/dl-manager/na_fw_dl_binder.h | 54 | ||||
-rwxr-xr-x | include/dm-engine/dl-manager/sa_fw_downloader.h | 177 | ||||
-rwxr-xr-x | include/dm-engine/dm_common_engine.h | 272 | ||||
-rwxr-xr-x | include/dm-engine/fumo/fumo_account.h | 57 | ||||
-rwxr-xr-x | include/dm-engine/fumo/fumo_engine.h | 244 | ||||
-rwxr-xr-x | include/dm-engine/fumo/fumo_engine_internal.h | 91 | ||||
-rwxr-xr-x | include/dm-engine/lawmo/lawmo_account.h | 83 | ||||
-rwxr-xr-x | include/dm-engine/lawmo/lawmo_engine.h | 107 | ||||
-rwxr-xr-x | include/dm-engine/lawmo/lawmo_engine_internal.h | 45 |
18 files changed, 2383 insertions, 0 deletions
diff --git a/include/dm-engine/bootstrap/factory_bootstrap.h b/include/dm-engine/bootstrap/factory_bootstrap.h new file mode 100755 index 0000000..9d9b09d --- /dev/null +++ b/include/dm-engine/bootstrap/factory_bootstrap.h @@ -0,0 +1,76 @@ +/* + * 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. + */ + +/** + * @DM_Error.h + * @version 0.1 + * @brief This file is the header file of defined factory bootstrap + */ + +#ifndef FACTORY_BOOTSTRAP_H_ +#define FACTORY_BOOTSTRAP_H_ + +/*sync-agent*/ +#include <sync_agent.h> + +/*dm-agent*/ +#include "common/dm_error.h" +#include "common/dm_common_def.h" + +#define DDF_FILES "/usr/share/oma-dm-cfg/ddf/slp_ddfs.txt" +#define DDF_MSCFUMO_DMACC_FILE "/usr/share/oma-dm-cfg/ddf/slp_msctestserver_dmacc_ddf.txt" +#define DDF_MSCLAWMO_DMACC_FILE "/usr/share/oma-dm-cfg/ddf/slp_mscserver_dmacc_ddf.txt" +#define DDF_GCF_DMACC_FILE "/usr/share/oma-dm-cfg/ddf/slp_gcf_dmacc_ddf.txt" + +#define DDF_SPEC_COUNT 10 +#define MAX_FILE_PATH 100 +#define MAX_SERVICE_NAME 50 + +typedef struct { + sync_agent_dm_mo_type_e mo_type; /**< mo_type : SYNC_AGENT_DM_MO_TYPE_DMACC, SYNC_AGENT_DM_MO_TYPE_DEVINFO, SYNC_AGENT_DM_MO_TYPE_DEVDETAIL, SYNC_AGENT_DM_MO_TYPE_FUMO, SYNC_AGENT_DM_MO_TYPE_LAWMO, SYNC_AGENT_DM_MO_TYPE_SCOMO, SYNC_AGENT_DM_MO_TYPE_NO_TYPE */ + char schema_file[MAX_FILE_PATH]; /**< schema_file : schema_file paht*/ + int service_ddf; /**< service_ddf : 1,2,3,4,5,6,7*/ + int server_type; /**< service_type : 4, 8, 16*/ +} ddf_spec; + +/** + * @par Description: API to start factory bootstrap + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] file size + * + * @return DM_OK on success + * DM_ERROR, DM_ERR_DDF_PROCCESS on error + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +DM_ERROR factory_bootstrap(SERVICE_SERVER_TYPE server_type); + +#endif /* FACTORY_BOOTSTRAP_H_ */ diff --git a/include/dm-engine/cp/dm_cp_error.h b/include/dm-engine/cp/dm_cp_error.h new file mode 100755 index 0000000..8ae3457 --- /dev/null +++ b/include/dm-engine/cp/dm_cp_error.h @@ -0,0 +1,27 @@ +/* + * 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 DM_CP_ERROR_H_ +#define DM_CP_ERROR_H_ + +typedef enum { + CP_ERROR_SUCCESS = 1, + CP_ERROR_FAIL, + CP_NOT_EXIST_PIN +} CP_ERROR; + +#endif /* DM_CP_ERROR_H_ */ diff --git a/include/dm-engine/cp/dm_cp_parser.h b/include/dm-engine/cp/dm_cp_parser.h new file mode 100755 index 0000000..9947f4a --- /dev/null +++ b/include/dm-engine/cp/dm_cp_parser.h @@ -0,0 +1,61 @@ +/* + * 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 DM_CP_PARSER_H_ +#define DM_CP_PARSER_H_ + +/*dm-agent*/ +#include "dm_cp_struct.h" + +typedef enum { + CP_TYPE_XML = 1, + CP_TYPE_WBXML, + CP_TYPE_NONE +} CP_TYPE; + +typedef enum { + TNDS_TAG_CHARACTERISTIC_START +} CP_TAG; + +/** + * @par Description: API to parsing cp stream + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] cp type + * @param[in] wbxml + * @param[in] msg size + * + * @return DM_CP (cp structure) + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +DM_CP *parsing_cp_stream(CP_TYPE cp_type, const char *wbxml_stream, unsigned int msgSize); + +#endif /* DM_CP_PARSER_H_ */ diff --git a/include/dm-engine/cp/dm_cp_processor.h b/include/dm-engine/cp/dm_cp_processor.h new file mode 100755 index 0000000..4726d24 --- /dev/null +++ b/include/dm-engine/cp/dm_cp_processor.h @@ -0,0 +1,567 @@ +/* + * 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 DM_CP_PROCESSOR_H_ +#define DM_CP_PROCESSOR_H_ + +/*dm-agent*/ +#include "dm_cp_error.h" +#include "dm-engine/cp/dm_cp_struct.h" + +typedef enum { + ADD_MESSAGE, + REMOVE_MESSAGE, +} SENDMSG_TYPE; + +/** + * @par Description: API to recieve cp wbxml + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] msg body + * @param[in] msg size + * @param[in] ext id + * + * @return CP_ERROR 1 on success + * 2 on error + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +CP_ERROR process_Recieved_CP_WBXML(const char *msgBody, unsigned int msgSize, int ext_id); + +/** + * @par Description: API to recieve cp xml + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] msg body + * @param[in] msg size + * @param[in] ext id + * + * @return CP_ERROR 1 on success + * 2 on error + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +CP_ERROR process_Recieved_CP_XML(const char *msgBody, unsigned int msgSize, int ext_id); + +/** + * @par Description: API to check pincode + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] initial or not (0,1) + * @param[in] user data + * @param[out] correct (0,1) + * @param[in] ext id + * + * @return CP_ERROR 1 on success + * 2 on error + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +CP_ERROR process_Check_Pincode(int is_initial, char *user_data, int *is_correct, int ext_id); + +/** + * @par Description: API to invalid pincode + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] ext id + * + * @return CP_ERROR 1 on success + * 2 on error + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +CP_ERROR process_Invalid_Pincode(int ext_id); /* invalid PIN code ==> send delete message to MF and delete CP data */ + +/** + * @par Description: API to setting cp + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] ext id + * + * @return CP_ERROR 1 on success + * 2 on error + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +CP_ERROR process_Setting_CP(int ext_id); + +/** + * @par Description: API to delete all cp + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * + * @return CP_ERROR 1 on success + * 2 on error + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +CP_ERROR process_Delete_All_CP_Data(); /* delete all CP data */ + +/** + * @par Description: API to delete cp data + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] ext id + * + * @return CP_ERROR 1 on success + * 2 on error + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +CP_ERROR process_Delete_CP_Data(int ext_id); /* delete 1 CP data about specific extId */ + +/** + * @par Description: API to set msgid + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] msg id + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void process_Set_msgId(int msgId); + +/** + * @par Description: API to free application struct + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] app + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_cp_application(DM_CP_Application * app); +/** + * @par Description: API to free application addr struct + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] app_addr appaddr + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_cp_application_app_addr(DM_CP_Application_AppAddr * app_addr); + +/** + * @par Description: API to free application resource struct + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] resource + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_cp_application_resource(DM_CP_Application_Resource * resource); + +/** + * @par Description: API to free application auth struct + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] appauth + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_cp_application_app_auth(DM_CP_Application_AppAuth * appAuth); + +/** + * @par Description: API to free port struct + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] port + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_cp_port(DM_CP_Port * port); + +/** + * @par Description: API to free string struct + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] service + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_string_node(String_Node * service); + +/** + * @par Description: API to free napdef struct + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] napdef + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_cp_napdef(DM_CP_Napdef * napdef); + +/** + * @par Description: API to free auth info struct + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] auth_info + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_cp_napdef_authinfo(DM_CP_Napdef_AuthInfo * auth_info); + +/** + * @par Description: API to free validity struct + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] validity + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_cp_napdef_validity(DM_CP_Napdef_validity * validity); + +/** + * @par Description: API to free bootstraps struct + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] bootstraps + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_cp_bootstrap(DM_CP_Bootstrap * bootstraps); + +/** + * @par Description: API to free pxLogical struct + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] pxLogical + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_cp_pxlogical(DM_CP_PxLogical * pxLogical); + +/** + * @par Description: API to free pxAuthInfo struct + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] pxAuthInfo + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_cp_pxlogical_pxauthinfo(DM_CP_PxLogical_PxAuthInfo * pxAuthInfo); + +/** + * @par Description: API to free pxPhysical struct + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] pxPhysical + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_cp_pxLogical_pxphsical(DM_CP_PxLogical_PxPhysical * pxPhysical); + +#endif /* DM_CP_PROCESSOR_H_ */ diff --git a/include/dm-engine/cp/dm_cp_security.h b/include/dm-engine/cp/dm_cp_security.h new file mode 100755 index 0000000..c891d69 --- /dev/null +++ b/include/dm-engine/cp/dm_cp_security.h @@ -0,0 +1,40 @@ +/* + * 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 DM_CP_SECURITY_H_ +#define DM_CP_SECURITY_H_ + +#define CP_MAC_LEN 40 + +#define CP_IS_EXIST_MAC 0x92 + +#define CP_SEC 0x91 + +#define CP_SEC_TYPE_NETWPIN 0x80 +#define CP_SEC_TYPE_USERPIN 0x81 +#define CP_SEC_TYPE_USERNETWPIN 0x82 + +#define CP_DATA_REPOSITORY_PATH "/opt/data/oma-dm-cfg/cp" +#define CP_SEC_FILE_NAME "cp_pin_info" +#define CP_WBXML_FILE_NAME "wbxml_cp" +#define CP_TYPE_FILE_NAME "cp_type" + +#define CP_SEC_REPOSITORY_PATH "/opt/data/oma-dm-cfg/cp_pin_info" +#define CP_WBXML_REPOSITORY_PATH "/opt/data/oma-dm-cfg/wbxml_cp" +#define CP_TYPE_REPOSITORY_PATH "/opt/data/oma-dm-cfg/cp_type" + +#endif /* DM_CP_SECURITY_H_ */ diff --git a/include/dm-engine/cp/dm_cp_struct.h b/include/dm-engine/cp/dm_cp_struct.h new file mode 100755 index 0000000..679a23b --- /dev/null +++ b/include/dm-engine/cp/dm_cp_struct.h @@ -0,0 +1,201 @@ +/* + * 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 DM_CP_STRUCT_H_ +#define DM_CP_STRUCT_H_ + +typedef enum { + DM_CP_APP_OMADS = 1 +} DM_CP_APP_ID; + +typedef struct string_node { + char *data; + struct string_node *next; +} String_Node; + +typedef struct dm_cp_port { + char *portnbr; + String_Node *service; /* * */ + struct dm_cp_port *next; +} DM_CP_Port; + +/************************ PXLOGICAL *****************************/ + +typedef struct dm_cp_pxlogical_pxauthinfo { + char *pxAuth_type; + char *pxAuth_id; /* ? */ + char *pxAuth_pw; /* ? */ + struct dm_cp_pxlogical_pxauthinfo *next; +} DM_CP_PxLogical_PxAuthInfo; + +typedef struct dm_cp_pxlogical_pxphysical { + char *physical_proxy_id; + String_Node *domain; /* * */ + char *pxAddr; + char *pxAddrType; /* ? */ + char *pxAddr_FQDN; /* ? */ + char *wsp_version; /* ? */ + char *push_enabled; /* ? */ + char *pull_enabled; /* ? */ + String_Node *to_napid; /* + */ + DM_CP_Port *port; /* * */ + struct dm_cp_pxlogical_pxphysical *next; +} DM_CP_PxLogical_PxPhysical; + +typedef struct dm_cp_pxlogical { + char *proxy_id; + char *proxy_pw; /* ? */ + char *ppg_auth_type; /* ? */ + char *proxy_provider_id; /* ? */ + char *name; + String_Node *domain; /* * */ + char *trust; /* ? */ + char *master; /* ? */ + char *start_page; /* ? */ + char *bas_auth_id; /* ? */ + char *bas_auth_pw; /* ? */ + char *wsp_version; /* ? */ + char *push_enabled; /* ? */ + char *pull_enabled; /* ? */ + DM_CP_PxLogical_PxAuthInfo *pxAuthInfo; /* * */ + DM_CP_Port *port; /* * */ + DM_CP_PxLogical_PxPhysical *pxPhysical; /* + */ + struct dm_cp_pxlogical *next; +} DM_CP_PxLogical; + +/************************ BOOTSTRAP *****************************/ + +typedef struct dm_cp_bootstrap { + char *name; + String_Node *network; + char *country; + String_Node *proxy_id; + char *provurl; + char *context_allow; + struct dm_cp_bootstrap *next; +} DM_CP_Bootstrap; + +/************************ APPLICATION *****************************/ + +typedef struct dm_cp_application_appaddr { + char *addr; + char *addr_type; /* ? */ + DM_CP_Port *port; /* * */ + struct dm_cp_application_appaddr *next; +} DM_CP_Application_AppAddr; + +typedef struct dm_cp_application_appauth { + char *auth_level; /* ? */ + char *auth_type; /* ? */ + char *auth_name; /* ? */ + char *auth_secret; /* ? */ + char *auth_data; /* ? */ + struct dm_cp_application_appauth *next; +} DM_CP_Application_AppAuth; + +typedef struct dm_cp_application_resource { + char *uri; + char *name; /* ? */ + char *accept; /* ? */ + char *auth_type; /* ? */ + char *auth_name; /* ? */ + char *auth_secret; /* ? */ + char *auth_data; /* ? */ + char *start_page; /* ? */ + struct dm_cp_application_resource *next; +} DM_CP_Application_Resource; + +typedef struct dm_cp_application { + char *app_ID; + char *provider_ID; /* ? */ + char *name; /* ? */ + char *accept; /* ? */ + char *protocol; /* ? */ + String_Node *to_proxy; /* * */ + String_Node *to_napid; /* * */ + String_Node *addr; /* * */ + DM_CP_Application_AppAddr *appAddr; /* * */ + DM_CP_Application_AppAuth *appAuth; /* * */ + DM_CP_Application_Resource *resource; /* * */ + struct dm_cp_application *next; +} DM_CP_Application; + +/************************ NAPDEF *****************************/ + +typedef struct dm_cp_napdef_napauthinfo { + char *auth_type; + char *auth_name; /* ? */ + char *auth_secret; /* ? */ + String_Node *auth_entity; /* * */ + char *spi; /* ? */ + struct dm_cp_napdef_napauthinfo *next; +} DM_CP_Napdef_AuthInfo; + +typedef struct dm_cp_napdef_validity { + char *country; /* ? */ + char *network; /* ? */ + char *sid; /* ? */ + char *soc; /* ? */ + char *validuntil; /* ? */ + struct dm_cp_napdef_validity *next; +} DM_CP_Napdef_validity; + +typedef struct dm_cp_napdef { + char *nap_ID; + String_Node *bearer; /* * */ + char *name; + char *internet; /* ? */ + char *nap_address; + char *nap_addr_type; /* ? */ + String_Node *dns_addr; /* * */ + char *call_type; /* ? */ + char *local_addr; /* ? */ + char *local_addr_type; /* ? */ + char *link_speed; /* ? */ + char *dn_link_speed; /* ? */ + char *linger; /* ? */ + char *delivery_err_sdu; /* ? */ + char *delivery_order; /* ? */ + char *traffic_class; /* ? */ + char *max_sdu_size; /* ? */ + char *max_bitrate_uplink; /* ? */ + char *max_bitrate_dnlink; /* ? */ + char *residual_ber; /* ? */ + char *sdu_error_ratio; /* ? */ + char *traffic_handl_prio; /* ? */ + char *transfer_delay; /* ? */ + char *guaranteed_bitrate_uplink; /* ? */ + char *guaranteed_bitrate_dnlink; /* ? */ + char *max_num_retry; /* ? */ + char *first_retry_timeout; /* ? */ + char *rereg_threshold; /* ? */ + char *t_bit; /* ? */ + DM_CP_Napdef_AuthInfo *auth_info; + DM_CP_Napdef_validity *validity; + struct dm_cp_napdef *next; +} DM_CP_Napdef; + +/************************ CP *****************************/ + +typedef struct { + DM_CP_Bootstrap *bootstraps; + DM_CP_Napdef *napdefs; + DM_CP_Application *applications; + DM_CP_PxLogical *pxLogical; +} DM_CP; + +#endif /* DM_CP_STRUCT_H_ */ diff --git a/include/dm-engine/dl-manager/dd_object.h b/include/dm-engine/dl-manager/dd_object.h new file mode 100755 index 0000000..6564e77 --- /dev/null +++ b/include/dm-engine/dl-manager/dd_object.h @@ -0,0 +1,53 @@ +/* + * 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 DD_OBJECT_H_ +#define DD_OBJECT_H_ + +//typedef enum { +// OBJECT_NO_TYPE = 0, +// APPLICATION_OCTECT_STREAM, +// APPLICATION_MSWORD, +// APPLICATION_PDF, +// APPLICATION_ZIP, +// TEXT_HTML, +// TEXT_PLAIN, +// TEXT_CSS, +// IMAGE_GIF, +// IMAGE_JPEG, +// VIDEO_MPEG +// +//} OBJECT_TYPE; + +typedef struct { + int object_size; /* media object size */ + char *object_type; /* media object type */ + char *object_name; + char *object_description; /* media object description */ + char *object_uri; /* URI from which the media object can be loaded */ + char *next_uri; + char *install_notify_uri; /* URI to which a installation status report is to be sent */ + char *info_uri; + char *icon_uri; + char *object_vender; + char *DD_version; + char *install_param; + char *medea_object; + +} Download_Descriptor; + +#endif /* DD_OBJECT_H_ */ diff --git a/include/dm-engine/dl-manager/dd_parser.h b/include/dm-engine/dl-manager/dd_parser.h new file mode 100755 index 0000000..83afea4 --- /dev/null +++ b/include/dm-engine/dl-manager/dd_parser.h @@ -0,0 +1,53 @@ +/* + * 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 DD_PARSER_H_ +#define DD_PARSER_H_ + +/*dm-agent*/ +#include "common/dm_error.h" +#include "dm-engine/dl-manager/dd_object.h" + +/** + * @par Description: API to convert xml to dd object + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] dd xml + * @param[in] dd xml size + * @param[out] download descriptor structure + * + * @return DM_OK + * DM_ERROR + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +DM_ERROR convert_xml_to_DD_object(const char *dd_xml, unsigned int dd_xml_length, Download_Descriptor ** dd_object); + +#endif /* DD_PARSER_H_ */ diff --git a/include/dm-engine/dl-manager/fw_downloader.h b/include/dm-engine/dl-manager/fw_downloader.h new file mode 100755 index 0000000..f21f9d8 --- /dev/null +++ b/include/dm-engine/dl-manager/fw_downloader.h @@ -0,0 +1,175 @@ +/* + * 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 FW_DOWNLOADER_H_ +#define FW_DOWNLOADER_H_ + +/*dm-agent*/ +#include "common/dm_error.h" +#include "dm-engine/dl-manager/dd_object.h" + +typedef enum { + EXIST_PARTIAL_FILE = 1, + EXIST_COMPLETED_FILE, + NOT_EXIST_FILE +} DOWNLOAD_FILE_STATUS; + +typedef struct { + int current_data_size; + int total_data_size; + char *file_path; +} Data_Resume_Infomation; + +/** + * @par Description: API to get object information from dd_server_uri + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] dd_server_uri dd server uri + * @param[out] download_descriptor download_descriptor + * @param[out] dd_object_information dd object information + * + * @return DM_OK + * DM_ERROR + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +DM_ERROR get_object_information(char *dd_server_uri, int *file_size, Download_Descriptor ** download_descriptor, DM_ERROR * download_status); + +/** + * @par Description: API to check file resume + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] checked_download_folder folder path + * @param[in] download_descriptor download_descriptor + * @param[out] file_status file status + * + * @return DM_OK + * DM_ERROR + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +DM_ERROR check_file_resume(const char *checked_download_folder, DOWNLOAD_FILE_STATUS * file_status, Download_Descriptor * download_descriptor, Data_Resume_Infomation ** data_resume_info); + +/** + * @par Description: API to download object for object path + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] download_folder downloaded folder path + * @parma[in] config wifi config + * @param[in] download_descriptor download_descriptor + * @param[out] object_downloaded_path downloaded file path + * + * + * @return DM_OK + * DM_ERROR + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +DM_ERROR download_object(const char *download_folder, char **object_downloaded_path, Data_Resume_Infomation * data_resume_info, int config, Download_Descriptor * download_descriptor, DM_ERROR * downoad_status); + +/** + * @par Description: API to send download status to server + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] download_status DM_ERROR + * @param[in] download_descriptor download_descriptor + * + * @return DM_OK + * DM_ERROR + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +DM_ERROR send_donwload_status(DM_ERROR download_status, Download_Descriptor * download_descriptor); + +/** + * @par Description: API to free download descriptor + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] download_descriptor download_descriptor + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_Download_Descriptor(Download_Descriptor ** download_descriptor); + +#endif /* FW_DOWNLOADER_H_ */ diff --git a/include/dm-engine/dl-manager/na_fw_dl_binder.h b/include/dm-engine/dl-manager/na_fw_dl_binder.h new file mode 100755 index 0000000..51c009b --- /dev/null +++ b/include/dm-engine/dl-manager/na_fw_dl_binder.h @@ -0,0 +1,54 @@ +/* + * 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 NA_FW_DL_BINDER_H_ +#define NA_FW_DL_BINDER_H_ + +/*lib*/ +#include <glib.h> + +/*sync-agent*/ +#include <sync_agent.h> + +/** + * @par Description: API to add http header element + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[out] header element + * @param[in] header element key + * @param[in] header element value + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void add_header_info(GList ** header_info_list, char *key, char *value); + +#endif /* NA_FW_DL_BINDER_H_ */ diff --git a/include/dm-engine/dl-manager/sa_fw_downloader.h b/include/dm-engine/dl-manager/sa_fw_downloader.h new file mode 100755 index 0000000..3940af1 --- /dev/null +++ b/include/dm-engine/dl-manager/sa_fw_downloader.h @@ -0,0 +1,177 @@ +/* + * 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_FW_DOWNLOADER_H_ +#define SA_FW_DOWNLOADER_H_ + +/*lib*/ +#include <glib.h> + +/*dm-agent*/ +#include "common/dm_error.h" + +typedef enum { + DD_DOWNLOAD = 1, + GET_FILE_NAME, + DATA_DOWNLOAD, + SEND_DOWNLOAD_STATUS +} DL_SEND_MSG_TYPE; + +/** + * @par Description: API to send msg about DL + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] send_dl_type send msg type for dl + * @param[in] local_uri uri information + * @param[in] content_type content type + * @param[in] header_info header info g_list + * @param[in] sendMsg send msg + * @param[in] sendMsg_length send msg length + * @param[out] recv_header recv msg header info g_list + * @param[out] recvMsg recv msg + * @param[out] recvMsg_length recv msg length + * + * @return DM_OK + * DM_ERROR + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +DM_ERROR send_download_msg(DL_SEND_MSG_TYPE send_dl_type, char *local_uri, char *content_type, GList * header_info, char *sendMsg, unsigned int sendMsg_length, GList ** recv_header, char **recvMsg, unsigned int *recvMsg_length); + +/** + * @par Description: API to download data to server + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] local_uri uri information + * @param[in] content_type content type + * @param[in] header_info header info g_list + * @param[in] current_file_download_size current file download size + * @param[in] download_folder download folder path + * @param[in] config wifi config + * @param[out] download_path download file path + * + * @return DM_OK on success + * DM_ERROR on fail + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +DM_ERROR download_data(char *local_uri, char *content_type, GList * header_info, int current_file_download_size, char *download_folder, int config, char **download_path); + +/** + * @par Description: API to get file name + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] recieve http header + * @param[out] file name + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +char *get_file_name(GList * recv_header, char *file_name); + +/** + * @par Description: API to get file name for header info + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] header_info header info g_list + * + * @return file name + * 0 error + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +char *get_file_name_from_http_header(GList * header_info); + +/** + * @par Description: API to free header info g_list + * + * + * @par Purpose: + * @par Typical use case: + * @par par Method of function operation: + * @par Important notes: + * @param[in] header_info header info g_list + * + * @return file name + * 0 error + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_header_info(GList * header_info); + +#endif /* SA_FW_DOWNLOADER_H_ */ diff --git a/include/dm-engine/dm_common_engine.h b/include/dm-engine/dm_common_engine.h new file mode 100755 index 0000000..0a8f0a1 --- /dev/null +++ b/include/dm-engine/dm_common_engine.h @@ -0,0 +1,272 @@ +/* + * 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 DM_COMMON_ENGINE_H_ +#define DM_COMMON_ENGINE_H_ + +/*dm-agent*/ +#include "common/dm_error.h" +#include "common/dm_common_def.h" +#include "common/dm_common.h" +#include "framework/san-parser/pm_sanparser.h" +#include "framework/platform-event-handler/dm_platform_event_handler_internal.h" +#include "framework/platform-event-handler/dm_platform_event_handler.h" + +#define CHECK_OPERATION 1 +#define NON_CHECK_OPERATION 0 + +/** + * @par Description: API to get service engine id + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[out] engine_id engine id + * @param[in] ui mode ui mode + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void get_service_engine_id(ENGINE_ID * service_engine_id, char *ui_mode); + +/** + * @par Description: API to init dm engine + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[out] engine_id engine id + * @param[in] ui mode ui mode + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void init_Dm_Engine(); + +/** + * @par Description: API to engine Start + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] server id server id + * @param[in] full_path full path + * @param[in] correlator correlator + * @param[in] resultCode resultCode + * + * @return DM_OK success + * DM_ERRORS fail + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +DM_ERROR engine_start(char *server_id, char *full_path, char *correlator, ENGINE_ID * service_engine_id, int *resultCode); + +/** + * @par Description: API to service_engine_Start + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] service engine id service engine id + * @param[out] service_ret service_ret + * + * @return DM_OK success + * DM_ERRORS fail + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +DM_ERROR service_engine_start(ENGINE_ID service_engine_id, DM_ERROR * service_ret); + +/** + * @par Description: API to set_engine_status_idle + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] service engine id service engine id + * + * @return DM_OK success + * DM_ERRORS fail + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +DM_ERROR set_engine_status_idle(ENGINE_ID service_engine_id); + +/** + * @par Description: API to set_end_engine_status_idle + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] service engine id service engine id + * + * @return DM_OK success + * DM_ERRORS fail + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +DM_ERROR set_end_engine_status_idle(); + +/** + * @par Description: API to dm_common_start + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] Event_Contents Event_Contents + * + * @return DM_OK success + * DM_ERRORS fail + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +DM_ERROR dm_common_start(Event_Contents * pEvent_data); + +/** + * @par Description: API to dm common operation (called by task) + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] Event_Contents Event_Contents + * + * @return DM_OK success + * DM_ERRORS fail + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +DM_ERROR dm_common_operation(Event_Contents * pEvent_data); + +/** + * @par Description: API to genericAelrt_operation + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] session session + * @param[in] isFinish isFinish + * @param[in] service engine id service engine id + * + * @return DM_OK success + * DM_ERRORS fail + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +DM_ERROR genericalert_operation(void **session, int *isFinish, ENGINE_ID service_engine_id); + +#endif /* DM_COMMON_ENGINE_H_ */ diff --git a/include/dm-engine/fumo/fumo_account.h b/include/dm-engine/fumo/fumo_account.h new file mode 100755 index 0000000..17ccf9c --- /dev/null +++ b/include/dm-engine/fumo/fumo_account.h @@ -0,0 +1,57 @@ +/* + * 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. + */ + +/** + * @DM_Error.h + * @version 0.1 + * @brief This file is the header file of defined fota account + */ + +#ifndef FOTA_ACCOUNT_H_ +#define FOTA_ACCOUNT_H_ + +/*dm-agent*/ +#include "common/dm_error.h" + +/** + * @par Description: API to register fota account + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] + * @param[out] + * + * @return 1 success + * 0 error + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +int register_fota_account(); + +#endif /* FOTA_ACCOUNT_H_ */ diff --git a/include/dm-engine/fumo/fumo_engine.h b/include/dm-engine/fumo/fumo_engine.h new file mode 100755 index 0000000..147d5d9 --- /dev/null +++ b/include/dm-engine/fumo/fumo_engine.h @@ -0,0 +1,244 @@ +/* + * 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 FUMO_ENGINE_H_ +#define FUMO_ENGINE_H_ + +/*dm-agent*/ +#include "common/dm_error.h" +#include "dm-engine/fumo/fumo_engine_internal.h" + +/** + * @par Description: API to execute fumo operation + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] full_path mo full path + * @param[in] value value + * @param[out] fumo_return fumo return value + * + * @return DM_OK success + * DM_ERRORS fail + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +DM_ERROR fumo_exec(char *full_path, char *value, FUMO_Error * fumo_return); + +/** + * @par Description: API to operate firmware download + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] full_path mo full path + * @param[out] fumo_return fumo return value + * + * @return DM_OK success + * DM_ERRORS fail + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +DM_ERROR firmware_download_opeartion(char *full_path, FUMO_Error * fumo_return); + +/** + * @par Description: API to operate firmware update + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] full_path mo full path + * @param[out] fumo_return fumo return value + * + * @return DM_OK success + * DM_ERRORS fail + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +DM_ERROR firmware_update_operation(char *full_path, FUMO_Error * fumo_return); + +/** + * @par Description: API to operate firmware download&update + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] full_path mo full path + * @param[out] fumo_return fumo return value + * + * @return DM_OK success + * DM_ERRORS fail + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +DM_ERROR firmware_downloadupdate_operation(char *full_path, FUMO_Error * fumo_return); + +/** + * @par Description: API to operate firmware EXT + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] full_path mo full path + * @param[out] fumo_return fumo return value + * + * @return DM_OK success + * DM_ERRORS fail + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +DM_ERROR vendor_dependency_firmware_operation(char *full_path, FUMO_Error * fumo_return); + +/** + * @par Description: API to fumo engine operation (engine state flow) + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] full_path mo full path + * @param[in] down_server down server url + * @param[in] fumo_state fumo state + * @param[out] fumo_return fumo return value + * + * @return DM_OK success + * DM_ERRORS fail + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +DM_ERROR fumo_engine_state_operation(char *full_path, char *down_server, FUMO_Error * fumo_return); + +/** + * @par Description: API to get current fumo state + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] full_path mo full path + * @param[out] fumo_state_data fumo state data + * + * @return DM_OK success + * DM_ERRORS fail + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +DM_ERROR get_current_fumo_state(char *full_path, char **fumo_state_data); + +/** + * @par Description: API to set current fumo state + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] full_path mo full path + * @param[in] fumo_state_data fumo state data + * + * @return DM_OK success + * DM_ERRORS fail + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +DM_ERROR set_current_fumo_state(char *full_path, FUMO_State fumo_status); + +#endif /* FUMO_ENGINE_H_ */ diff --git a/include/dm-engine/fumo/fumo_engine_internal.h b/include/dm-engine/fumo/fumo_engine_internal.h new file mode 100755 index 0000000..41aaffd --- /dev/null +++ b/include/dm-engine/fumo/fumo_engine_internal.h @@ -0,0 +1,91 @@ +/* + * 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 FUMO_ENGINE_INTERNAL_H_ +#define FUMO_ENGINE_INTERNAL_H_ + + /* + * 1. DevInfo + * - DevID : device id + * - Man : manufacture + * - Mod : model id or model number + * - DmV : OMA DM client version + * - Lang : current setting language + * - Bearer : bearer + * + * 2. DevDetail + * - KernelV : kernel version + * - SwV : software version + * - HwV : hardware version + * - FwV : firmware version + * - ModemV : modem version + * - PDAV : PDA version + * - OEM : original equipment manufacturer + * - DevType : device type + * - Bearer : bearer + * - FOTADownDir: firmware download directory + * - FOTASaveDir: firmware save directory + */ +/* +sync_agent_dev_return_e sync_agent_get_devinfo(const char *platform, char *info_name, char **value); + +sync_agent_dev_return_e sync_agent_execute_dev_function(2, "fota_flag", 1, memory_type); +sync_agent_dev_return_e sync_agent_execute_dev_function(2, "fota_result", 1, (int *)error); +*/ + +#define MAX_DELTA_FILE_SIZE "/usr/share/oma-dm-cfg/delta_size/max_size.txt" + +typedef enum { + UNKNOWN = 0, + IDLE_START = 10, /*No pending operation */ + DOWNLOAD_FAILED = 20, /*Download failed */ + DOWNLOAD_PROGRESSING = 30, /*Download has stared */ + DOWNLOAD_COMPLETE = 40, /*Download has been completed successfully */ + READY_TO_UPDATE = 50, /*Have data and awaiting command to start update */ + UPDATE_PROGRESSING = 60, /*Update has stared */ + UPDATE_FAILED_HAVE_DATA = 70, /*Update failed but have update package */ + UPDATE_FAILED_NO_DATA = 80, /*Update failed and no update package available */ + UPDATE_SUCCESSFUL_HAVE_DATA = 90, /*Update complete and data still available */ + UPDATE_SUCCESSFUL_NO_DATA = 100 /*Data deleted or removed after a successful Update */ +} FUMO_State; + +typedef enum { + FUMO_SUCCESS = 200, + /* 250~299 VENDOR */ + FUMO_MANAGEMENT_CLIENT_ERROR = 400, + FUMO_USER_CANCELLED = 401, + FUMO_CORRUPTED_FIRMWARE_UPDATE = 402, + DEVICE_MISMATCH = 403, + FUMO_FAILED_VALIDATION = 404, + FUMO_NOT_ACCEPTABLE = 405, + FUMO_ALTERNATED_DOWNLOAD_AUTHENTICATION_FAILED = 406, + FUMO_ALTERANTED_DOWNLOAD_REQUEST_TIME_OUT = 407, + FUMO_NOT_IMPLEMENTED = 408, + FUMO_UNDEFINED_ERROR = 409, + FUMO_UPDATE_FAILED = 410, + FUMO_MALFORMED_OR_BAD_URL = 411, + FUMO_ALTERNATED_DOWNLOAD_SERVER_UNABAILABLE = 412, + /* 450~499 VENDOR */ + FUMO_ALTERNATE_DOWNLOAD_SERVER_ERROR = 500, + FUMO_DOWNLOAD_FAILS_DUE_TO_DEVICE_OUT_OF_MEMORY = 501, + FUMO_UPDATE_FAILS_DUE_TO_DEVICE_OUT_OF_MEMORY = 502, + FUMO_DOWNLOAD_FAILS_DUE_TO_NETWORK_ISSUES = 503, + /*550~599 */ + +} FUMO_Error; + +#endif /* FUMO_ENGINE_INTERNAL_H_ */ diff --git a/include/dm-engine/lawmo/lawmo_account.h b/include/dm-engine/lawmo/lawmo_account.h new file mode 100755 index 0000000..19eadf6 --- /dev/null +++ b/include/dm-engine/lawmo/lawmo_account.h @@ -0,0 +1,83 @@ +/* + * 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. + */ + +/** + * @DM_Error.h + * @version 0.1 + * @brief This file is the header file of defined lawmo account + */ +#ifndef LAWMO_ACCOUNT_H_ +#define LAWMO_ACCOUNT_H_ + +/*dm-agent*/ +#include "common/dm_error.h" + +/** + * @par Description: API to register lawmo account + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] item id + * @param[in] user data + * + * @return 1 success + * 0 error + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +int register_lawmo_account(int item_id, void *user_data); + +/** + * @par Description: API to deregister lawmo account + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] item id + * @param[in] user data + * + * @return 1 success + * 0 error + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +int deregister_lawmo_account(int item_id, void *user_data); + +#endif /* LAWMO_ACCOUNT_H_ */ diff --git a/include/dm-engine/lawmo/lawmo_engine.h b/include/dm-engine/lawmo/lawmo_engine.h new file mode 100755 index 0000000..b411985 --- /dev/null +++ b/include/dm-engine/lawmo/lawmo_engine.h @@ -0,0 +1,107 @@ +/* + * 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 LAWMO_ENGINE_H_ +#define LAWMO_ENGINE_H_ + +/*dm-agent*/ +#include "common/dm_error.h" +#include "dm-engine/lawmo/lawmo_engine_internal.h" + +/** + * @par Description: API to execute lawmo operation + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] full_path mo full path + * @param[in] value value + * @param[in] check operation check operation + * + * @return DM_OK success + * DM_ERRORS fail + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +DM_ERROR lawmo_exec(char *full_path, char *correlator, LAWMO_Result_code * lawmo_return, int check_operation); + +/** + * @par Description: API to execute lawmo operation + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] full_path mo full path + * @param[out] lawmo state data lawmo state data + * + * @return DM_OK success + * DM_ERRORS fail + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +DM_ERROR get_current_lawmo_state(char *full_path, char **lawmo_state_data); + +/** + * @par Description: API to execute lawmo operation + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] full_path mo full path + * @param[in] lawmo state lawmo state + * + * @return DM_OK success + * DM_ERRORS fail + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +DM_ERROR set_current_lawmo_state(char *full_path, LAWMO_State lawmo_state); + +#endif /* LAWMO_ENGINE_H_ */ diff --git a/include/dm-engine/lawmo/lawmo_engine_internal.h b/include/dm-engine/lawmo/lawmo_engine_internal.h new file mode 100755 index 0000000..bd52aeb --- /dev/null +++ b/include/dm-engine/lawmo/lawmo_engine_internal.h @@ -0,0 +1,45 @@ +/* + * 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 LAWMO_ENGINE_INTERNAL_H_ +#define LAWMO_ENGINE_INTERNAL_H_ + +typedef enum { + + FULLY_LOCKED, //the device is in Fully Locked state. + PARTIALLY_LOCKED, //The device is in Partially Locked state. + UNLOCKED //The device is in Unlocked state. +} LAWMO_State; + +typedef enum { + OPERATION_SUCCEEDED = 1200, + WIPE_OPEARTION_SUCCEEDED_WITH_DATA_WIPED = 1201, + WIPE_OPERATION_SUCCEEDED_WITH_BOTH_DATA_AND_ASSOCIATED_WIPE_LIST_WITHIN_MANAGEMENT_TREE_WIPED = 1202, + + /*SUCCESSFUL = VENDOR SPECIFIED */ + + CLIENT_ERROR = 1400, + USER_CANCELLED = 1401, + FULLY_LOCK_DEVICE_FAILED = 1402, + PARTIALLY_LOCK_DEVICE_FAILED = 1403, + UNLOCK_DEVICE_FAILED = 1404, + WIPE_DEVICES_DATA_FAILED = 1405, + WIPE_OPERATION_NOT_PERFORMED = 1406 + /*CLIENT ERROR = VENDOR SPECIFIED */ +} LAWMO_Result_code; + +#endif /* LAWMO_ENGINE_INTERNAL_H_ */ |