[T106][ZXW-22]7520V3SCV2.01.01.02P42U09_VEC_V0.8_AP_VEC origin source commit
Change-Id: Ic6e05d89ecd62fc34f82b23dcf306c93764aec4b
diff --git a/ap/app/include/mainctl_msg.h b/ap/app/include/mainctl_msg.h
new file mode 100755
index 0000000..8c66cc5
--- /dev/null
+++ b/ap/app/include/mainctl_msg.h
@@ -0,0 +1,147 @@
+/**
+* @file Mainctl_msg.h
+* @brief ÌṩÖ÷¿Ø¡¢ÍøÂçÏà¹ØÏûÏ¢½Ó¿Ú
+*
+* Copyright (C) 2017 Sanechips Technology Co., Ltd.
+* @author Linxu Gebin
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License version 2 as
+* published by the Free Software Foundation.
+*
+************************************************************************
+*/
+
+#ifndef __MAINCTRL_MSG_H__
+#define __MAINCTRL_MSG_H__
+
+#include "message.h"
+
+/**
+* @brief ¶¨ÒåÖ÷¿ØÏûÏ¢
+* @param MSG_CMD_RESET_REQUEST »Ö¸´³ö³§ÉèÖÃÇëÇó
+* @param MSG_CMD_POWEROFF_REQUEST ¹Ø»úÇëÇó
+* @param MSG_CMD_RESTART_REQUEST ÖØÆôÇëÇó
+* @param MSG_CMD_NET_IPPORT_FILTER ·À»ðǽ-¶Ë¿Ú¹ýÂËÏûÏ¢
+* @param MSG_CMD_NET_IPPORT_FORWARD ·À»ðǽ-¶Ë¿Úת·¢ÏûÏ¢
+* @param MSG_CMD_NET_DMZ ·À»ðǽ-DMZÏûÏ¢
+* @param MSG_CMD_NET_IPPORT_MAPPING ·À»ðǽ-¶Ë¿ÚÓ³ÉäÏûÏ¢
+* @param MSG_CMD_NET_UPNP ·À»ðǽ-UPNPÏûÏ¢
+* @param MSG_CMD_NET_URL_FILTER ·À»ðǽ-URL¹ýÂËÏûÏ¢
+* @param MSG_CMD_NET_MTU MTUÏà¹ØÅäÖÃÏûÏ¢
+* @param MSG_CMD_NET_STATIC_DHCP DHCPµØÖ·³ØÖеľ²Ì¬IPÏà¹ØÉèÖÃÏûÏ¢
+* @param MSG_CMD_NET_PLUGIN ÈȲå°ÎÉ豸²åÈëÏûÏ¢
+* @param MSG_CMD_NET_PLUGOUT ÈȲå°ÎÉ豸°Î³öÏûÏ¢
+* @param MSG_CMD_NET_CONNECT rj45ºÍwifiµÈÉ豸Á¬½ÓÍøÂçÏûÏ¢
+* @param MSG_CMD_NET_DISCON rj45ºÍwifiµÈÉ豸¶Ï¿ªÍøÂçÏûÏ¢
+* @param MSG_CMD_NET_PDP_ACT pdp¼¤»îÏûÏ¢
+* @param MSG_CMD_NET_PDP_DEACT pdpÈ¥¼¤»îÏûÏ¢
+* @param MSG_CMD_NET_TC_CTRL Á÷Á¿¿ØÖÆÏûÏ¢
+* @param MSG_CMD_NET_GET_HOSTNAME Ð޸ĽÓÈëÉ豸µÄhostnameÏûÏ¢
+* @param MSG_CMD_NET_BIND_STATIC_ADDRESS ¾²Ì¬µØÖ·°ó¶¨ÏûÏ¢
+* @param MSG_CMD_NET_BIND_STATIC_ADDRESS_ADD Ìí¼Ó¾²Ì¬µØÖ·°ó¶¨ÏûÏ¢
+* @param MSG_CMD_NET_BIND_STATIC_ADDRESS_DEL ɾ³ý¾²Ì¬µØÖ·°ó¶¨ÏûÏ¢
+* @param MSG_CMD_NET_PING_DIAGNOSTICS pingÕï¶Ï²Ù×÷ÏûÏ¢
+* @param MSG_CMD_NET_DHCP_SETTING_REQ DHCPÉèÖÃÇëÇóÏûÏ¢
+*/
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+/*Ö÷¿ØÏà¹ØÏûÏ¢ÃüÁî*/
+typedef enum {
+ /*Ö÷¿Ø¿ØÖÆÏà¹Ø*/
+ MSG_CMD_MAINCTRL_BEG = MSG_CMD_MAINCTRL_BASE,
+
+ /* Ö÷¿ØÊÕµ½ÇëÇóºó£¬Í¨ÖªÐèÒªµÄÄ£¿é×öÏàÓ¦²Ù×÷£¬ÊÕµ½µÄÄ£¿é±ØÐë»Ø¸´result
+ * Ö÷¿ØÊÕµ½ËùÓÐresultºóÔÙÖ´ÐÐ×îºóµÄ²Ù×÷(±£´æNV£¬ÖØÆô¡¢¹Ø»ú¡¢resetµÈ)
+ */
+ MSG_CMD_RESET_REQUEST, /*ÇëÇó»Ö¸´³ö³§ÉèÖà 211D, ²ÎÊý:ÎÞ */
+ MSG_CMD_POWEROFF_REQUEST, /*ÇëÇ󹨻ú211E, ²ÎÊý:ÎÞ */
+ MSG_CMD_RESTART_REQUEST, /*ÇëÇóÖØÆô211F, ²ÎÊý:ÎÞ */
+ MSG_CMD_RESET_NOTIFY, /*֪ͨ»Ö¸´³ö³§ÉèÖÃ2120, ²ÎÊý:ÎÞ, ´¦ÀíÄ£¿é±ØÐë»Ø¸´MSG_CMD_RESET_RSP */
+ MSG_CMD_POWEROFF_NOTIFY, /*֪ͨ¹Ø»ú2121, ²ÎÊý:ÎÞ, ´¦ÀíÄ£¿é±ØÐë»Ø¸´MSG_CMD_POWEROFF_RSP */
+ MSG_CMD_RESTART_NOTIFY, /*Í¨ÖªÖØÆô2122, ²ÎÊý:ÎÞ, ´¦ÀíÄ£¿é±ØÐë»Ø¸´MSG_CMD_RESTART_RSP */
+ MSG_CMD_RESET_RSP, /*»Ö¸´³ö³§ÉèÖûظ´ÏûÏ¢, ²ÎÊý:ÎÞ */
+ MSG_CMD_POWEROFF_RSP, /*¹Ø»úÉèÖýá¹û»Ø¸´ÏûÏ¢, ²ÎÊý:ÎÞ */
+ MSG_CMD_RESTART_RSP, /*ÖØÆôÉèÖýá¹û»Ø¸´ÏûÏ¢, ²ÎÊý:ÎÞ */
+
+ //ÍøÂçÏà¹Ø
+ MSG_CMD_NET_IPPORT_FILTER, /*·À»ðǽ-¶Ë¿Ú¹ýÂË, ²ÎÊý:ÎÞ, ÐèÒª·¢ËÍǰÉèÖÃÏà¹ØNV, ¼ûNV±í */
+ MSG_CMD_NET_IPPORT_FORWARD, /*·À»ðǽ-¶Ë¿Úת·¢, ²ÎÊý:ÎÞ, ÐèÒª·¢ËÍǰÉèÖÃÏà¹ØNV, ¼ûNV±í */
+ MSG_CMD_NET_DMZ, /*·À»ðǽ-DMZ, ²ÎÊý:ÎÞ, ÐèÒª·¢ËÍǰÉèÖÃÏà¹ØNV, ¼ûNV±í */
+ MSG_CMD_NET_IPPORT_MAPPING, /*·À»ðǽ-¶Ë¿ÚÓ³Éä, ²ÎÊý:ÎÞ, ÐèÒª·¢ËÍǰÉèÖÃÏà¹ØNV, ¼ûNV±í */
+ MSG_CMD_NET_UPNP, /*upnp, ²ÎÊý:ÎÞ, ÐèÒª·¢ËÍǰÉèÖÃÏà¹ØNV, ¼ûNV±í */
+ MSG_CMD_NET_URL_FILTER, /*·À»ðǽ-URL¹ýÂË, ²ÎÊý:ÎÞ, ÐèÒª·¢ËÍǰÉèÖÃÏà¹ØNV, ¼ûNV±í, ²»Ö§³ÖHTTPS */
+ MSG_CMD_NET_MTU, /*MTUÏà¹ØÅäÖÃ, ²»´ø²ÎÊý£¬ÐèÒª·¢ËÍǰÉèÖÃNV mtuÖµ */
+ MSG_CMD_NET_STATIC_DHCP, /*DHCPµØÖ·³ØÖеľ²Ì¬IPÏà¹ØÉèÖÃ, ²ÎÊý:ÎÞ, ÐèÒª·¢ËÍǰÉèÖÃÏà¹ØNV, ¼ûNV±í */
+ MSG_CMD_NET_PLUGIN, /*ÈȲå°ÎÉ豸²åÈ룬¹©netdev_plugin_proc_byname/netdev_plugin_procʹÓà */
+ MSG_CMD_NET_PLUGOUT, /*ÈȲå°ÎÉ豸°Î³ö£¬¹©netdev_plugout_proc_byname/netdev_plugout_procʹÓà */
+ MSG_CMD_NET_CONNECT, /*rj45ºÍwifiµÈÉ豸Á¬½ÓÍøÂ磬¹©netdev_connect_internetʹÓà */
+ MSG_CMD_NET_DISCON, /*rj45ºÍwifiµÈÉ豸¶Ï¿ªÍøÂ磬¹©netdev_disconnect_internetʹÓà */
+ MSG_CMD_NET_PDP_ACT, /*pdp¼¤»î,¹©pdp_act_procʹÓà */
+ MSG_CMD_NET_PDP_DEACT, /*pdpÈ¥¼¤»î,¹©pdp_deact_procʹÓà */
+ MSG_CMD_NET_TC_CTRL, /*Á÷Á¿¿ØÖÆ,¹©tc_controlʹÓà */
+ MSG_CMD_NET_GET_HOSTNAME, /*Ð޸ĽÓÈëÉ豸µÄhostname, ²ÎÊý:struct mac_hostname_info */
+ MSG_CMD_NET_BIND_STATIC_ADDRESS, /*¾²Ì¬µØÖ·°ó¶¨, ²ÎÊý:ÎÞ ÐèÒª·¢ËÍǰÉèÖÃÏà¹ØNV, ¼ûNV±í */
+ MSG_CMD_NET_BIND_STATIC_ADDRESS_ADD, /*Ìí¼Ó¾²Ì¬µØÖ·°ó¶¨, ²ÎÊý: struct static_macip_info */
+ MSG_CMD_NET_BIND_STATIC_ADDRESS_DEL, /*ɾ³ý¾²Ì¬µØÖ·°ó¶¨, ²ÎÊý: macµØÖ· */
+ MSG_CMD_NET_PING_DIAGNOSTICS, /*pingÕï¶Ï²Ù×÷, ²ÎÊý:ÎÞ, ÐèÒª·¢ËÍǰÉèÖÃÏà¹ØNV, ¼ûNV±í */
+
+ MSG_CMD_NET_DHCP_SETTING_REQ, /*ÍøÂçDHCP»ù´¡²ÎÊýÅäÖÃÇëÇó*/
+ MSG_CMD_NET_DHCP_SETTING_RSP, /*ÍøÂçDHCP»ù´¡²ÎÊýÅäÖûظ´*/
+
+ /* --------------------- ÒÔÏÂÊÇÄÚ²¿Ê¹ÓÃÏûÏ¢ ---------------- */
+ MSG_CMD_NET_WAN4_CHANGE, /*ipv4ÍâÍø¿Ú·¢Éú±ä»¯, ²ÎÊý:ÎÞ */
+ MSG_CMD_NET_WAN6_CHANGE, /*ipv6ÍâÍø¿Ú·¢Éú±ä»¯, ²ÎÊý:ÎÞ */
+ MSG_CMD_NET_TIMER_DEL, /*ɾ³ý¶¨Ê±Æ÷²Ù×÷, ²ÎÊý:ÍâÍø¿ÚÀàÐÍethwan¡¢wifiwan */
+ MSG_CMD_NET_TIMER_OUT, /*¶¨Ê±Æ÷³¬Ê±²Ù×÷, ²ÎÊý:É豸dev_ID */
+ MSG_CMD_NET_SET_RJ45_LAN, /*½«rj45ÉèÖÃΪÄÚÍø¿Ú, ²ÎÊý:ÎÞ */
+ MSG_CMD_NET_ADD_CHILDREN_DEVICE, /*¼Ò³¤Ä£Ê½¹¦ÄÜÖÐ, Ìí¼ÓÉ豸µ½¶ùͯ×éÉ豸, ²ÎÊý: struct mac_hostname_info*/
+ MSG_CMD_NET_DEL_CHILDREN_DEVICE, /*¼Ò³¤Ä£Ê½¹¦ÄÜÖÐ, ɾ³ý¶ùͯ×éÉ豸, ²ÎÊý: macµØÖ· */
+ MSG_CMD_NET_ADD_WHITE_SITE, /*¼Ò³¤Ä£Ê½¹¦ÄÜÖÐ, Ìí¼ÓÍøÕ¾µ½°×Ãûµ¥, ²ÎÊý: struct white_site_info */
+ MSG_CMD_NET_REMOVE_WHITE_SITE, /*¼Ò³¤Ä£Ê½¹¦ÄÜÖÐ, ɾ³ý°×Ãûµ¥ÖеÄÍøÖ·, ²ÎÊý: °×Ãûµ¥ÍøÕ¾ */
+ MSG_CMD_NET_START_NONET, /*¼Ò³¤Ä£Ê½¹¦ÄÜÖÐ, ½ûÖ¹ÉÏÍøÊ±¼ä¿ªÊ¼, ²ÎÊý:ÎÞ, ÐèÒª·¢ËÍǰÉèÖÃÏà¹ØNV, ¼ûNV±í */
+ MSG_CMD_NET_STOP_NONET, /*¼Ò³¤Ä£Ê½¹¦ÄÜÖУ¬½ûÖ¹ÉÏÍøÊ±¼ä½áÊø, ²ÎÊý:ÎÞ, ÐèÒª·¢ËÍǰÉèÖÃÏà¹ØNV, ¼ûNV±í */
+ MSG_CMD_NET_WAN_DIAL_FAIL, /*֪ͨÍâÍø¿ÚÁªÍø³¬Ê±, ²ÎÊý:ÎÞ */
+ MSG_CMD_SECURITY_LOG_SAVE, /*°²È«ÈÕÖ¾´æ´¢, ²ÎÊý:ÈÕÖ¾×Ö·û´®s */
+} emMSG_CMD_MainCtrl;
+#endif
+
+/** * @brief dhcp·þÎñÆ÷ÐÅÏ¢
+ * @param lan_ip Íø¹Øip
+ * @param lan_netmask ÑÚÂë
+ * @param dhcp_enabled dhcp ·þÎñÆ÷ʹÄܱêÖ¾
+ * @param dchp_start dhcp µØÖ·³ØÆðʼµØÖ·
+ * @param dchp_end dhcp µØÖ·³Ø½áÊøµØÖ·
+ * @param dchp_dns dnsµØÖ·
+ * @param dchp_lease dhcp×âÔ¼Îļþ
+ */
+typedef struct {
+ char lan_ip[SOFTAP_IP_MAX_LEN];
+ char lan_netmask[SOFTAP_IP_MAX_LEN];
+ int dhcp_enabled;
+ char dhcp_start[SOFTAP_IP_MAX_LEN];
+ char dhcp_end[SOFTAP_IP_MAX_LEN];
+ char dhcp_dns[SOFTAP_IP_MAX_LEN];
+ char dhcp_lease[SOFTAP_STR_LEN_16];
+} dhcp_setting_req;
+
+/** * @brief restart request message info
+ * @param action restart or reset
+ * @param subactuon finally realized by MCU or mainCtrl
+ */
+typedef struct {
+ int action;
+ int subaction;
+} restart_info;
+
+typedef enum {
+ Restart_Action_RESTART = 0,
+ Restart_Action_RESET,
+} emACTION_RESTART_MainCtrl;
+
+typedef enum {
+ Operate_By_MCU = 0,
+ Operate_By_SOC,
+} emSUBACTION_RESTART_MainCtrl;
+
+
+#endif