zte's code,first commit

Change-Id: I9a04da59e459a9bc0d67f101f700d9d7dc8d681b
diff --git a/ap/lib/libdmgr/inc/fota_protocol_util.h b/ap/lib/libdmgr/inc/fota_protocol_util.h
new file mode 100644
index 0000000..66aa1b9
--- /dev/null
+++ b/ap/lib/libdmgr/inc/fota_protocol_util.h
@@ -0,0 +1,82 @@
+#ifndef _FOTA_PROTOCOL_UTIL_H_
+#define _FOTA_PROTOCOL_UTIL_H_
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+
+#define LINE_BUF_SIZE 128
+
+typedef enum {
+    INT_ARGUMENT = 1,
+    DOUBLE_ARGUMENT,
+    STRING_ARGUMENT,
+    HEX_ARGUMENT,
+    CHARACTER_ARGUMENT,
+    POINTER_ARGUMENT,
+    MESSAGE_END
+} ArgumentType;
+
+typedef struct {
+    ArgumentType type;
+    union {
+        int     int_val;
+        double  double_val;
+        char    *string_val;
+        void    *pointer_val;
+        int     character_val;
+    } u;
+} ArgumentInfo;
+
+typedef struct {
+    char        *string;
+} VString;
+
+/*ЭÒéijÏîÖµÀàÐÍ*/
+typedef enum {
+    ITEMTYPE_DEC,
+    ITEMTYPE_HEX,
+    ITEMTYPE_STRING
+} ItemType;
+
+
+/*º¯ÊýÉùÃ÷*/
+char* protocol_package(char *description, ...);
+
+void format_arguments(VString *message, va_list ap);
+
+int get_action_code(char *content);
+
+int get_result_code(char *content);
+
+int get_version_info(char *content, version_info_t *versionInfo);
+
+int get_version_down_info(char *content, download_info_t *downloadInfo);
+
+void str_append(VString *message, char *str);
+
+void free_version_info(version_info_t *version_info);
+void print_version_info(version_info_t *version_info);
+
+
+
+
+/* notifier list */
+notifier_block_t* notifier_list_add(notifier_block_t* notifier_list, notifier_block_t* notifier_msg);
+
+int notifier_list_free(notifier_block_t* notifier_list);
+
+void notify_callback_process(dmgr_t dm_id, unsigned short event_id, unsigned short msgid, void* data);
+/* notifier list end */
+
+int version_md5_check(const char *filename, char *md5_expect);
+
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif
+
+