[Feature][R305][task-view-1233][webui] add r305 v2 app base
Change-Id: Ic5849897b0122cce24cc852467d1672f0afc9798
diff --git a/lynq/R305/ap/app/Script/Makefile b/lynq/R305/ap/app/Script/Makefile
new file mode 100755
index 0000000..2065e63
--- /dev/null
+++ b/lynq/R305/ap/app/Script/Makefile
@@ -0,0 +1,66 @@
+
+############################################################################
+#
+# Makefile -- Build for rootfs makefile.
+#
+# Copyright (c) 2001-2004, SnapGear (www.snapgear.com)
+# Copyright (c) 2001, Lineo
+#
+# Add by zhouwei 2010-08-06 for freescale imx28 platform
+#
+############################################################################
+CP = cp
+ROMFS_DIR = $(ROMFSDIR)
+$(warning CONFIG_WIFI_MODULE=$(CONFIG_WIFI_MODULE))
+.PHONY: romfs wifi
+
+ifneq ($(CONFIG_WIFI_MODULE), )
+CPWIFI=wifi
+endif
+
+$(warning CPWIFI=$(CPWIFI))
+all:
+
+romfs: $(CPWIFI)
+ chmod +x ./scripts/*.sh
+ $(CP) -f ./scripts/*.sh $(ROMFS_DIR)/sbin/
+ #$(CP) -f ./scripts/*.txt $(ROMFS_DIR)/sbin/
+ mkdir -p $(ROMFS_DIR)/etc_ro/
+ $(CP) -f ./etc/*.conf $(ROMFS_DIR)/etc_ro/
+ $(CP) -f ./etc/options.auth $(ROMFS_DIR)/etc_ro/
+ $(CP) -f ./etc/options.noauth $(ROMFS_DIR)/etc_ro/
+ $(CP) -f ./etc/initchat $(ROMFS_DIR)/etc_ro/
+ifneq ($(CONFIG_USE_WEBUI_SECURITY),yes)
+ $(CP) -f ./etc/pap-secrets $(ROMFS_DIR)/etc_ro/
+ $(CP) -f ./etc/chap-secrets $(ROMFS_DIR)/etc_ro/
+endif
+ifeq ($(USE_FOTA),yes)
+ mkdir -p $(ROMFS_DIR)/recovery/sbin
+ $(CP) -f ./scripts/to_mnt_ubifs.sh $(ROMFS_DIR)/recovery/sbin/
+endif
+wifi:
+ @echo "copying wifi script"
+
+ifeq ($(CONFIG_WIFI_MODULE), realtek)
+ @echo "copying wifi realtek script"
+ mkdir -p $(ROMFS_DIR)/etc_ro/
+ $(CP) -rf ./wifi/* $(ROMFS_DIR)/etc_ro/
+ifeq ($(CONFIG_WIFI_RTL_WPA2),yes)
+ chmod +x ./wifi_script/realtek_wpa2/*
+ $(CP) -rf ./wifi_script/realtek_wpa2/* $(ROMFS_DIR)/sbin/
+else
+ chmod +x ./wifi_script/realtek/*
+ $(CP) -rf ./wifi_script/realtek/* $(ROMFS_DIR)/sbin/
+endif
+else
+ chmod +x ./wifi_script/realtek/*
+ifeq ($(CONFIG_MIN_8M_VERSION), n)
+ $(CP) -rf ./wifi_script/realtek/zte_qrcode_create.sh $(ROMFS_DIR)/sbin/
+else
+ifeq ($(CONFIG_MMI_LCD),yes)
+ $(CP) -rf ./wifi_script/realtek/zte_qrcode_create.sh $(ROMFS_DIR)/sbin/
+endif
+endif
+endif
+
+
diff --git a/lynq/R305/ap/app/goahead/server/goahead.c b/lynq/R305/ap/app/goahead/server/goahead.c
new file mode 100755
index 0000000..680db6a
--- /dev/null
+++ b/lynq/R305/ap/app/goahead/server/goahead.c
@@ -0,0 +1,339 @@
+#include "uemf.h"
+#include "wsIntrn.h"
+#include <signal.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sched.h>
+#ifdef WEBS_SSL_SUPPORT
+#include "websSSL.h"
+#endif
+#include "../interface5.0/zte_web_interface.h"
+
+static char_t *rootWeb = T("etc_ro/web"); /* Root web directory */
+static int port = 80; /* Server port */
+static int retries = 5; /* Server port retries */
+static int finished; /* Finished flag */
+
+/****************************** Forward Declarations **************************/
+
+static int initWebs();
+static int websHomePageHandler(webs_t wp, char_t *urlPrefix, char_t *webDir,
+ int arg, char_t *url, char_t *path, char_t *query);
+extern void defaultErrorHandler(int etype, char_t *msg);
+extern void defaultTraceHandler(int level, char_t *buf);
+
+//added by liuyingnan for PC Client begin, 20120829
+extern int websXMLPostHandler(webs_t wp, char_t *urlPrefix, char_t *webDir, int arg, char_t *url, char_t *path, char_t *query);
+//added by liuyingnan for PC Client end, 20120829
+
+int main(int argc, char** argv)
+{
+ int rs;
+ struct sched_param param;
+
+ loglevel_init();
+ slog(MISC_PRINT, SLOG_DEBUG, "goahead main\n");
+ bopen(NULL, (60 * 1024), B_USE_MALLOC);
+ signal(SIGPIPE, SIG_IGN);
+ if (initWebs() < 0) {
+ slog(MISC_PRINT, SLOG_ERR, "goahead initWebs failed.");
+ return -1;
+ }
+
+#ifdef WEBS_SSL_SUPPORT
+ websSSLOpen();
+#endif
+ web_init_pwd();
+ web_aes_init();
+
+ slog(MISC_PRINT, SLOG_NORMAL,"[goahead] enter working\n");
+ while (!finished) {
+ if (socketReady(-1) || socketSelect(-1, 1000)) {
+ socketProcess(-1);
+ }
+ websCgiCleanup();
+ emfSchedProcess();
+ }
+
+#ifdef WEBS_SSL_SUPPORT
+ websSSLClose();
+#endif
+
+ websCloseServer();
+ socketClose();
+ bclose();
+ return 0;
+}
+
+static int initWebs()
+{
+ struct in_addr intaddr;
+ const char lan_ip[128] = {0};
+ char host[128], dir[128], webdir[128];
+ char *cp;
+ char_t wbuf[128];
+ socketOpen();
+
+ cfg_get_item("lan_ipaddr", lan_ip, sizeof(lan_ip));
+ if (0 == strcmp(lan_ip, "")) {
+ slog(MISC_PRINT, SLOG_ERR, "goahead initWebs failed: lan_ip is NULL!");
+ return -1;
+ }
+ intaddr.s_addr = inet_addr(lan_ip);
+ if (intaddr.s_addr == INADDR_NONE) {
+ slog(MISC_PRINT, SLOG_ERR, "goahead initWebs failed: lan_ip is %s, INADDR_NONE!", lan_ip);
+ return -1;
+ }
+ getcwd(dir, sizeof(dir));
+ if ((cp = strrchr(dir, '/'))) {
+ *cp = '\0';
+ }
+ snprintf(webdir, sizeof(webdir), "%s/%s", dir, rootWeb);
+ slog(MISC_PRINT,SLOG_DEBUG, "goahead initWebs info: webdir is %s!",webdir);
+ websSetDefaultDir(webdir);
+ cp = inet_ntoa(intaddr);
+ ascToUni(wbuf, cp, min(strlen(cp) + 1, sizeof(wbuf)));
+ websSetIpaddr(wbuf);
+ websSetHost(wbuf);
+ websSetDefaultPage(T(ZTE_WEB_PAGE_LOGIN_NAME));
+ websOpenServer(port, retries);
+ //websUrlHandlerDefine(T(""), NULL, 0, websSecurityHandler, WEBS_HANDLER_FIRST);
+ websUrlHandlerDefine(T("/reqproc"), NULL, 0, websFormHandler, 0);
+#ifndef WEBS_SECURITY
+ websUrlHandlerDefine(T("/cgi-bin"), NULL, 0, websCgiHandler, 0);
+ //websUrlHandlerDefine(T("/api/xmlclient/post"), NULL, 0, websXMLPostHandler, 0);
+ websUrlHandlerDefine(T("/mmc2"), NULL, 0, websCgiDownLoadHandler, 0);//http share
+#endif
+ websUrlHandlerDefine(T(""), NULL, 0, websDefaultHandler, WEBS_HANDLER_LAST);
+ zte_web_init();
+ zte_httpshare_init();//httpshare
+ websUrlHandlerDefine(T("/"), NULL, 0, websHomePageHandler, 0);
+
+ system("rm -rf /firmware_tmp_file");
+ return 0;
+}
+
+static int websHomePageHandler(webs_t wp, char_t *urlPrefix, char_t *webDir,
+ int arg, char_t *url, char_t *path, char_t *query)
+{
+ if (*url == '\0' || gstrcmp(url, T("/")) == 0)
+ {
+ websRedirect(wp, zte_web_get_login_page(wp)); /*×ÔÊÊÓ¦ÖÕ¶Ëä¯ÀÀÆ÷*/
+ return 1;
+ }
+ return 0;
+}
+
+void defaultErrorHandler(int etype, char_t *msg)
+{
+ printf("[goahead]e %s\n",msg);
+}
+
+void defaultTraceHandler(int level, char_t *buf)
+{
+ if (buf) {
+ printf("[goahead]t %s\n",buf);
+ }
+}
+
+char_t *websGetCgiCommName(webs_t wp)
+{
+ char_t *pname1, *pname2;
+
+ pname1 = (char_t *)tempnam(T("/var"), T("cgi"));
+ pname2 = bstrdup(B_L, pname1);
+ free(pname1);
+ return pname2;
+}
+
+int websLaunchCgiProc(char_t *cgiPath, char_t **argp, char_t **envp,
+ char_t *stdIn, char_t *stdOut)
+{
+ int pid, fdin, fdout, hstdin, hstdout, rc;
+
+ fdin = fdout = hstdin = hstdout = rc = -1;
+ if ((fdin = open(stdIn, O_RDWR | O_CREAT, 0666)) < 0 ||
+ (fdout = open(stdOut, O_RDWR | O_CREAT, 0666)) < 0 ||
+ (hstdin = dup(0)) == -1 ||
+ (hstdout = dup(1)) == -1 ||
+ dup2(fdin, 0) == -1 ||
+ dup2(fdout, 1) == -1) {
+ goto DONE;
+ }
+
+ rc = pid = fork();
+ if (pid == 0) {
+ int result = execve(cgiPath, argp, envp);
+ slog(MISC_PRINT,SLOG_DEBUG, "content-type: text/html Execution of cgi process :%d", result);
+ exit (0);
+ }
+
+DONE:
+ if (hstdout >= 0) {
+ dup2(hstdout, 1);
+ close(hstdout);
+ }
+ if (hstdin >= 0) {
+ dup2(hstdin, 0);
+ close(hstdin);
+ }
+ if (fdout >= 0) {
+ close(fdout);
+ }
+ if (fdin >= 0) {
+ close(fdin);
+ }
+ return rc;
+}
+
+int websCheckCgiProc(int handle, int *status)
+{
+ if (waitpid(handle, status, WNOHANG) == handle) {
+ return 0;
+ } else {
+ return 1;
+ }
+}
+
+static int i64c(int i)
+{
+ i &= 0x3f;
+ if (i == 0)
+ return '.';
+ if (i == 1)
+ return '/';
+ if (i < 12)
+ return ('0' - 2 + i);
+ if (i < 38)
+ return ('A' - 12 + i);
+ return ('a' - 38 + i);
+}
+
+static int web_make_salt(char *p, int cnt /*, int x */)
+{
+ /* was: x += ... */
+ int x = getpid() + (int)time(0);
+ do {
+ /* x = (x*1664525 + 1013904223) % 2^32 generator is lame
+ * (low-order bit is not "random", etc...),
+ * but for our purposes it is good enough */
+ x = x*1664525 + 1013904223;
+ /* BTW, Park and Miller's "minimal standard generator" is
+ * x = x*16807 % ((2^31)-1)
+ * It has no problem with visibly alternating lowest bit
+ * but is also weak in cryptographic sense + needs div,
+ * which needs more code (and slower) on many CPUs */
+ *p++ = i64c(x >> 16);
+ *p++ = i64c(x >> 22);
+ } while (--cnt);
+ *p = '\0';
+ return x;
+}
+
+int web_set_pwd(char *buf)
+{
+ if(buf == NULL)
+ return -1;
+ int bufLen = strlen(buf);
+ if(bufLen <= 0 || bufLen > LOGIN_PSW_MAX_LEN)
+ return -1;
+#ifdef WEBS_SSL_SUPPORT
+ char salt[LOGIN_PSW_MAX_LEN+1]={0};
+ web_make_salt(salt,(sizeof(salt)-1)/2);
+ slog(MISC_PRINT,SLOG_DEBUG, "[goahead]salt %s\n",salt);
+ unsigned char md[LOGIN_PSW_MAX_LEN] = {0};
+ {
+ unsigned char src[LOGIN_PSW_MAX_LEN*2+1] = {0};
+ memcpy(src,salt,LOGIN_PSW_MAX_LEN);
+ memcpy(src+LOGIN_PSW_MAX_LEN,buf,bufLen);
+ SHA256((const unsigned char *)src, bufLen+LOGIN_PSW_MAX_LEN, md);
+ }
+ {
+ char i = 0;
+ char str_md[LOGIN_PSW_MAX_LEN*2+1] = {0};
+ for(i = 0; i < LOGIN_PSW_MAX_LEN; i++)
+ {
+ sprintf(str_md+i+i,"%02x", md[i]);
+ }
+ char psw_buf[100] = {0};
+ snprintf(psw_buf,sizeof(psw_buf),"%s%s",salt,str_md);
+ slog(MISC_PRINT,SLOG_DEBUG, "goahead]set_pw %s\n",psw_buf);
+ return cfg_set("admin_Password", psw_buf);
+ }
+#else
+ return cfg_set("admin_Password", buf);
+#endif
+}
+
+void web_init_pwd(void)
+{
+#ifdef WEBS_SSL_SUPPORT
+ char psw_buf[LOGIN_PSW_MAX_LEN*3+1] = {0};
+ cfg_get_item("admin_Password", psw_buf, sizeof(psw_buf));
+ slog(MISC_PRINT,SLOG_DEBUG, "[goahead]init_pw %s\n",psw_buf);
+ if(strlen(psw_buf) <= LOGIN_PSW_MAX_LEN)
+ {
+ web_set_pwd(psw_buf);
+ }
+#endif
+}
+
+int web_check_pwd(char* buf)
+{
+ char psw_buf[LOGIN_PSW_MAX_LEN*3+1] = {0};
+ if(buf == NULL)
+ return -1;
+ int bufLen = strlen(buf);
+ if(bufLen <= 0 || bufLen > LOGIN_PSW_MAX_LEN)
+ return -1;
+ cfg_get_item("admin_Password", psw_buf, sizeof(psw_buf));
+ slog(MISC_PRINT,SLOG_DEBUG, "[goahead]check_pw in %s\n",buf);
+ slog(MISC_PRINT,SLOG_DEBUG, "[goahead]check_pw src %s\n",psw_buf);
+#ifdef WEBS_SSL_SUPPORT
+ unsigned char md[LOGIN_PSW_MAX_LEN] = {0};
+ {
+ unsigned char src[LOGIN_PSW_MAX_LEN*2+1] = {0};
+ memcpy(src,psw_buf,LOGIN_PSW_MAX_LEN);
+ memcpy(src+LOGIN_PSW_MAX_LEN,buf,bufLen);
+ SHA256((const unsigned char *)src, bufLen+LOGIN_PSW_MAX_LEN, md);
+ }
+ {
+ char i = 0;
+ char str_md[65] = {0};
+ for(i = 0; i < LOGIN_PSW_MAX_LEN; i++)
+ {
+ sprintf(str_md+i+i,"%02x", md[i]);
+ }
+ return strncmp(str_md,psw_buf+LOGIN_PSW_MAX_LEN,sizeof(str_md)-1);
+ }
+#else
+ if(bufLen != strlen(psw_buf))
+ return -1;
+
+ return strncmp(buf,psw_buf,bufLen);;
+#endif
+}
+
+int web_make_salt_base64(char *buf, int len)
+{
+ int salt_len;
+ char *salt;
+ if(buf == NULL || len < 5)
+ {
+ return 0;
+ }
+ salt_len = (len - 1)/4*3;
+ salt = balloc(B_L, salt_len+1);
+ if(salt == NULL)
+ {
+ return 0;
+ }
+ web_make_salt(salt,salt_len/2);
+ websEncode64(buf, salt, len);
+ bfree(B_L, salt);
+ *(buf + len -1) = '\0';
+ slog(MISC_PRINT,SLOG_DEBUG, "[goahead]salt_base64=%s\n",buf);
+ return strlen(buf);
+}
+
diff --git a/lynq/R305/ap/app/goahead/server/webs.c b/lynq/R305/ap/app/goahead/server/webs.c
new file mode 100755
index 0000000..b0238e1
--- /dev/null
+++ b/lynq/R305/ap/app/goahead/server/webs.c
@@ -0,0 +1,2303 @@
+#include "wsIntrn.h"
+#ifdef DIGEST_ACCESS_SUPPORT
+ #include "websda.h"
+#endif
+#include "../interface5.0/zte_web_interface.h"
+//#include "../interface5.0/zte_rest_comm_interface.h"
+
+websStatsType websStats;
+webs_t *webs;
+sym_fd_t websMime;
+int websMax;
+int websPort;
+char_t websHost[64];
+char_t websIpaddr[64];
+char_t *websHostUrl = NULL;
+char_t *websIpaddrUrl = NULL;
+//added by liuyingnan for PC Client begin, 20120829
+char websRecvHttpBuffer[HTTP_BUFFER_SIZE] = {0};
+char websRecvHttpBuffer_XML[HTTP_BUFFER_SIZE] = {0};
+
+extern void zte_change_wp_query(webs_t wp,char_t *xml_str);
+//added by liuyingnan for PC Client begin, 20120829
+
+websErrorType websErrors[] = {
+ { 200, T("Data follows") },
+ { 204, T("No Content") },
+ { 301, T("Redirect") },
+ { 302, T("Redirect") },
+ { 304, T("Use local copy") },
+ { 400, T("Page not found") },
+ { 401, T("Unauthorized") },
+ { 403, T("Forbidden") },
+ { 404, T("Site or Page Not Found") },
+ { 405, T("Access Denied") },
+ { 500, T("Web Error") },
+ { 501, T("Not Implemented") },
+ { 503, T("Site Temporarily Unavailable. Try again.") },
+ { 0, NULL }
+};
+
+typedef enum {
+ RET_DATA_ERROR = -1,
+ RET_FAILED = 0,
+ RET_OK = 1,
+} ERROR_CODE;
+
+
+#ifdef FEATURE_ZTE_WEB_TCARD
+//added by guo shoupeng 10124224 for http share 20111001 start
+
+typedef enum {
+ RET_FAILED = 0,
+ RET_OK = 1,
+ RET_UNKNOWN = 3,
+ MALLOC_FIALED = 4,
+ SD_NONE = 5,
+ USB_OUT = 6,
+ USER_MALLOC_FAILED = 7,
+ UPLOAD_FILE_LIMITED = 8,
+ USER_UNKNOWN = 9,
+} ERROR_CODE;
+
+//added by guo shoupeng 10124224 for http share 20111001 end
+#endif
+
+
+
+static int websGetInput(webs_t wp, char_t **ptext, int *nbytes);
+static int websParseFirst(webs_t wp, char_t *text);
+static int websParseRequest(webs_t wp);
+static void websSocketEvent(int sid, int mask, int data);
+static int websGetTimeSinceMark(webs_t wp);
+
+static int websListenSock;
+static char_t websRealm[64] = T("GoAhead");
+
+static int websOpenCount = 0;
+
+
+int websOpenServer(int port, int retries)
+{
+ websMimeType *mt;
+
+ if (++websOpenCount != 1) {
+ return websPort;
+ }
+
+ a_assert(port > 0);
+ a_assert(retries >= 0);
+
+ webs = NULL;
+ websMax = 0;
+
+ websMime = symOpen(WEBS_SYM_INIT * 4);
+ a_assert(websMime >= 0);
+ if(websMime < 0) // cov M NEGATIVE_RETURNS
+ {
+ return -1;
+ }
+ for (mt = websMimeList; mt->type; mt++) {
+ symEnter(websMime, mt->ext, valueString(mt->type, 0), 0);
+ }
+
+#if 1
+ // kw 3 INVARIANT_CONDITION.UNREACH websUrlHandlerOpen only return 0
+ websUrlHandlerOpen();
+#else
+ if (websUrlHandlerOpen() < 0) {
+ return -1;
+ }
+#endif
+ websFormOpen();
+
+ return websOpenListen(port, retries);
+}
+
+
+
+void websCloseServer()
+{
+ webs_t wp;
+ int wid;
+
+ if (--websOpenCount > 0) {
+ return;
+ }
+
+ websCloseListen();
+
+ for (wid = websMax; webs && wid >= 0; wid--) {
+ if ((wp = webs[wid]) == NULL) {
+ continue;
+ }
+ socketCloseConnection(wp->sid);
+ websFree(wp);
+ }
+
+ symClose(websMime);
+ websFormClose();
+ websUrlHandlerClose();
+}
+
+
+void websCloseListen()
+{
+ if (websListenSock >= 0) {
+ socketCloseConnection(websListenSock);
+ websListenSock = -1;
+ }
+ bfreeSafe(B_L, websHostUrl);
+ bfreeSafe(B_L, websIpaddrUrl);
+ websIpaddrUrl = websHostUrl = NULL;
+}
+
+
+int websOpenListen(int port, int retries)
+{
+ int i, orig;
+
+ a_assert(port > 0);
+ a_assert(retries >= 0);
+
+ orig = port;
+
+ for (i = 0; i <= retries; i++) {
+ websListenSock = socketOpenConnection6(NULL, port, websAccept, 0);
+ if (websListenSock >= 0) {
+ break;
+ }
+ port++;
+ }
+ if (i > retries) {
+ error(E_L, E_USER, T("Couldn't open a socket on ports %d - %d"),
+ orig, port - 1);
+ return -1;
+ }
+
+ websPort = port;
+ bfreeSafe(B_L, websHostUrl);
+ bfreeSafe(B_L, websIpaddrUrl);
+ websIpaddrUrl = websHostUrl = NULL;
+
+ if (port == 80) {
+ websHostUrl = bstrdup(B_L, websHost);
+ websIpaddrUrl = bstrdup(B_L, websIpaddr);
+ } else {
+ fmtAlloc(&websHostUrl, WEBS_MAX_URL + 80, T("%s:%d"), websHost, port);
+ fmtAlloc(&websIpaddrUrl, WEBS_MAX_URL + 80, T("%s:%d"),
+ websIpaddr, port);
+ }
+ trace(0, T("webs: Listening for HTTP requests at address %s\n"),
+ websIpaddrUrl);
+
+ return port;
+}
+
+
+static void websSocketEvent(int sid, int mask, int iwp)
+{
+ webs_t wp;
+
+ wp = (webs_t) iwp;
+ a_assert(wp);
+
+ if (! websValid(wp)) {
+ return;
+ }
+
+ if (mask & SOCKET_READABLE) {
+ websReadEvent(wp);
+ }
+ if (mask & SOCKET_WRITABLE) {
+ if (websValid(wp) && wp->writeSocket) {
+ (*wp->writeSocket)(wp);
+ }
+ }
+}
+
+int websAccept(int sid, char *ipaddr, int port, int listenSid)
+{
+ webs_t wp;
+ int wid;
+
+ a_assert(ipaddr && *ipaddr);
+ a_assert(sid >= 0);
+ a_assert(port >= 0);
+
+ if ((wid = websAlloc(sid)) < 0) {
+ return -1;
+ }
+ wp = webs[wid];
+ a_assert(wp);
+ wp->listenSid = listenSid;
+
+ ascToUni(wp->ipaddr, ipaddr, min(sizeof(wp->ipaddr), strlen(ipaddr) + 1));
+
+ if (gstrcmp(wp->ipaddr, T("127.0.0.1")) == 0 ||
+ gstrcmp(wp->ipaddr, websIpaddr) == 0 ||
+ gstrcmp(wp->ipaddr, websHost) == 0) {
+ wp->flags |= WEBS_LOCAL_REQUEST;
+ }
+
+ socketCreateHandler(sid, SOCKET_READABLE, websSocketEvent, (int) wp);
+
+ wp->timeout = emfSchedCallback(WEBS_TIMEOUT, websTimeout, (void *) wp);
+ //trace(8, T("webs: accept request\n"));
+ return 0;
+}
+
+
+
+#ifdef FEATURE_ZTE_WEB_TCARD
+//added by guo shoupeng 10124224 for http share 20120110 start
+static int read_bytes = 0;
+//added by guo shoupeng 10124224 for http share 20120110 end
+#endif
+
+void websReadEvent(webs_t wp)
+{
+ char_t *text;
+ int rc, nbytes, len, done, fd;
+
+ a_assert(wp);
+ a_assert(websValid(wp));
+
+ websSetTimeMark(wp);
+
+ static unsigned int timer = 0;
+
+ text = NULL;
+ fd = -1;
+ for (done = 0; !done; ) {
+ if (text) {
+ bfree(B_L, text);
+ text = NULL;
+ }
+
+
+#ifdef FEATURE_ZTE_WEB_TCARD
+//added by guo shoupeng 10124224 for http share 20120110 start
+ if( read_bytes > UPLOAD_INTERVAL)
+ {
+ read_bytes = 0;
+ break;
+ }
+//added by guo shoupeng 10124224 for http share 20120110 end
+#endif
+ assert(wp);
+ assert(websValid(wp));
+ while ((rc = websGetInput(wp, &text, &nbytes)) == 0) {
+ ;
+ }
+
+
+ if (rc < 0) {
+ if(websValid(wp) && (wp->flags & WEBS_CGI_REQUEST ))
+ {
+ //printf("\n +++sockettt upload websSetTimeMark+++ \n");
+ websSetTimeMark(wp);
+ }
+ break;
+ }
+ if(text == NULL)
+ break;//for kw
+
+ switch(wp->state) {
+ case WEBS_BEGIN:
+
+ if (websParseFirst(wp, text) < 0) {
+ done++;
+ break;
+ }
+ wp->state = WEBS_HEADER;
+ break;
+
+ case WEBS_HEADER:
+
+ if (ringqLen(&wp->header) > 0) {
+ ringqPutStr(&wp->header, T("\n"));
+ }
+ ringqPutStr(&wp->header, text);
+ break;
+
+ case WEBS_POST_CLEN:
+
+#ifndef __NO_CGI_BIN
+ if (wp->flags & WEBS_CGI_REQUEST) {
+
+ //if(!(wp->flags & WEBS_CGI_FIRMWARE_UPLOAD))
+ if(wp->flags & WEBS_CGI_HTTPSHARE_UPLOAD)
+ {
+ if( timer ==0)
+ {
+ websSetLoginTimemark(wp);
+ printf("[httpshare]upload reset login state~\n");
+ }
+ ERROR_CODE ret = zte_process_cgi_recv(wp, wp->clen,text, nbytes);
+
+ if(RET_DATA_ERROR == ret || RET_FAILED == ret)
+ {
+ websError(wp, 404, T("Bad state"));
+ printf("[httpshare]ret->%d\n",ret);
+ done++;
+ break;
+ }
+
+ timer++;
+ timer=timer-(timer>>11<<11); //timer%2^11
+ }else if(wp->flags & WEBS_CGI_UPLOAD)
+ {
+ if (fd == -1)
+ {
+ if(wp->flags & WEBS_CGI_FIRMWARE_UPLOAD )
+ {
+ fd = gopen(FIRMWARE_TMP_FILE, O_CREAT | O_WRONLY | O_BINARY | O_APPEND, 0666);
+ printf("[goahead]open cgi temp file\n");
+ }
+ else
+ {
+ fd = gopen(wp->cgiStdin, O_CREAT | O_WRONLY | O_BINARY | O_APPEND, 0666);
+ }
+ }
+ if(fd < 0){
+ break;
+ }
+
+
+ gwrite(fd, text, nbytes);
+ }else
+ {
+ websError(wp, 404, T("Bad state"));
+ printf("[goahead]bad cgi request\n");
+ done++;
+ break;
+ }
+
+
+ } else
+#endif
+ //added by liuyingnan for PC Client begin, 20120829
+ if(wp->flags & WEBS_REST_CLIENT_REQUEST){
+ printf("%s", "websReadEvent: pc client post");
+ if (nbytes > (HTTP_BUFFER_SIZE-gstrlen(websRecvHttpBuffer)-1))
+ {
+ gstrncpy(websRecvHttpBuffer+gstrlen(websRecvHttpBuffer), text, HTTP_BUFFER_SIZE-gstrlen(websRecvHttpBuffer)-1);
+ }
+ else
+ {
+ gstrncpy(websRecvHttpBuffer+gstrlen(websRecvHttpBuffer), text, nbytes);
+ }
+ } else if(wp->flags & WEBS_XML_CLIENT_REQUEST){
+ if (nbytes > (HTTP_BUFFER_SIZE-gstrlen(websRecvHttpBuffer_XML)-1))
+ {
+ gstrncpy(websRecvHttpBuffer_XML+gstrlen(websRecvHttpBuffer_XML), text, HTTP_BUFFER_SIZE-gstrlen(websRecvHttpBuffer_XML)-1);
+ }
+ else
+ {
+ gstrncpy(websRecvHttpBuffer_XML+gstrlen(websRecvHttpBuffer_XML), text, nbytes);
+ }
+ } else
+ //added by liuyingnan for PC Client end, 20120829
+
+
+
+ if (wp->query) {
+ if (wp->query[0] && !(wp->flags & WEBS_POST_DATA)) {
+
+ len = gstrlen(wp->query);
+ wp->query = brealloc(B_L, wp->query, (len + gstrlen(text) +
+ 2) * sizeof(char_t));
+ if(wp->query == NULL)
+ break;//for kw
+ wp->query[len++] = '&';
+ gstrcpy(&wp->query[len], text);
+
+ } else {
+
+ //if (text != NULL)//for kw
+ {
+ len = gstrlen(wp->query);
+ wp->query = brealloc(B_L, wp->query, (len + gstrlen(text) +
+ 1) * sizeof(char_t));
+ if (wp->query) {
+ gstrcpy(&wp->query[len], text);
+ }
+ }
+ }
+
+ } else {
+ wp->query = bstrdup(B_L, text);
+ }
+#if 0 //for kw
+ //Add By liuyingnan for XML COMM API START
+ if(wp->flags & WEBS_XML_CLIENT_REQUEST)
+ {
+ slog(MISC_PRINT,SLOG_DEBUG,"[websReadEvent]:zte_change_wp_query function:%s\n",websRecvHttpBuffer_XML);
+ //zte_change_wp_query(wp,websRecvHttpBuffer_Json);
+ zte_change_wp_query(wp,websRecvHttpBuffer_XML);
+ memset(websRecvHttpBuffer_XML,0,HTTP_BUFFER_SIZE);
+ slog(MISC_PRINT,SLOG_DEBUG,"[out the function]:wp->query:%s\n",wp->query);
+ }
+ //Add By liuyingnan for XML COMM API END
+#endif
+
+ wp->flags |= WEBS_POST_DATA;
+ wp->clen -= nbytes;
+ if (wp->clen > 0) {
+ if (nbytes > 0) {
+ break;
+ }
+ done++;
+ break;
+ }
+#ifdef FEATURE_ZTE_WEB_TCARD
+//added by guo shoupeng 10124224 for http share 20120110 start
+ else
+ {
+ zte_efs_write(wp);
+ }
+//added by guo shoupeng 10124224 for http share 20120110 end
+#endif
+
+ if (fd != -1) {
+ gclose (fd);
+ fd = -1;
+ }
+ websUrlHandlerRequest(wp);
+ done++;
+ break;
+
+ case WEBS_POST:
+
+
+#ifndef __NO_CGI_BIN
+ if (wp->flags & WEBS_CGI_REQUEST) {
+ if (fd == -1) {
+ fd = gopen(wp->cgiStdin, O_CREAT | O_WRONLY | O_BINARY,
+ 0666);
+ }
+
+ if(fd < 0){
+ break;
+ }
+ gwrite(fd, text, gstrlen(text));
+ gwrite(fd, T("\n"), sizeof(char_t));
+ } else
+#endif
+ if (wp->query && *wp->query && !(wp->flags & WEBS_POST_DATA)) {
+ len = gstrlen(wp->query);
+ wp->query = brealloc(B_L, wp->query, (len + gstrlen(text) +
+ 2) * sizeof(char_t));
+ if (wp->query) {
+ wp->query[len++] = '&';
+ gstrcpy(&wp->query[len], text);
+ }
+
+ } else {
+ wp->query = bstrdup(B_L, text);
+ }
+ wp->flags |= WEBS_POST_DATA;
+ done++;
+ break;
+
+ default:
+ websError(wp, 404, T("Bad state"));
+ done++;
+ break;
+ }
+ }
+
+ if (fd != -1) {
+ fd = gclose (fd);
+ }
+
+ if (text) {
+ bfree(B_L, text);
+ }
+}
+char_t htmExt[] = T(".htm");
+int websUrlParse(char_t *url, char_t **pbuf, char_t **phost, char_t **ppath,
+ char_t **pport, char_t **pquery, char_t **pproto, char_t **ptag,
+ char_t **pext)
+{
+ char_t *hostbuf, *portbuf, *buf;
+ int c, len, ulen;
+ char_t *tok, *cp, *host, *path, *port, *proto, *tag, *query, *ext;
+
+ a_assert(url);
+ a_assert(pbuf);
+
+ ulen = gstrlen(url);
+
+ len = ulen * 2 + MAX_PORT_LEN + 3;
+ if ((buf = balloc(B_L, len * sizeof(char_t))) == NULL) {
+ return -1;
+ }
+ portbuf = &buf[len - MAX_PORT_LEN - 1];
+ hostbuf = &buf[ulen+1];
+
+ websDecodeUrl(buf, url, ulen);
+
+ url = buf;
+
+ if(portbuf == NULL) //for kw 20210312
+ return -1;
+
+ stritoa(websGetPort(), portbuf, MAX_PORT_LEN);
+ port = portbuf;
+ path = T("/");
+ proto = T("http");
+ host = T("localhost");
+ query = T("");
+ ext = htmExt;
+ tag = T("");
+
+ if (gstrncmp(url, T("http://"), 7) == 0) {
+ tok = &url[7];
+ tok[-3] = '\0';
+ proto = url;
+ host = tok;
+ for (cp = tok; *cp; cp++) {
+ if (*cp == '/') {
+ break;
+ }
+ if (*cp == ':') {
+ *cp++ = '\0';
+ port = cp;
+ tok = cp;
+ }
+ }
+ if ((cp = gstrchr(tok, '/')) != NULL) {
+
+ c = *cp;
+ *cp = '\0';
+ gstrncpy(hostbuf, host, ulen);
+ gstrncpy(portbuf, port, MAX_PORT_LEN);
+ *cp = c;
+ host = hostbuf;
+ port = portbuf;
+ path = cp;
+ tok = cp;
+ }
+
+ } else {
+ path = url;
+ tok = url;
+ }
+
+ if ((cp = gstrchr(tok, '?')) != NULL) {
+ *cp++ = '\0';
+ query = cp;
+ path = tok;
+ tok = query;
+ }
+
+ if ((cp = gstrchr(tok, '#')) != NULL) {
+ *cp++ = '\0';
+ if (*query == 0) {
+ path = tok;
+ }
+ }
+
+ if (pext) {
+
+ if ((cp = gstrrchr(path, '.')) != NULL) {
+ const char_t* garbage = T("/\\");
+ int length = gstrcspn(cp, garbage);
+ int garbageLength = gstrspn(cp + length, garbage);
+ int ok = (length + garbageLength == (int) gstrlen(cp));
+
+ if (ok) {
+ cp[length] = '\0';
+ ext = cp;
+ }
+ }
+ }
+
+ if (phost)
+ *phost = host;
+ if (ppath)
+ *ppath = path;
+ if (pport)
+ *pport = port;
+ if (pproto)
+ *pproto = proto;
+ if (pquery)
+ *pquery = query;
+ if (ptag)
+ *ptag = tag;
+ if (pext)
+ *pext = ext;
+ *pbuf = buf;
+ return 0;
+}
+
+char_t *websUrlType(char_t *url, char_t *buf, int charCnt)
+{
+ char_t *ext = NULL; //cov
+ char_t *tmp_buf;
+ sym_t *psym;
+
+ a_assert(url && *url);
+ a_assert(buf && charCnt > 0);
+
+ if (url == NULL || *url == '\0') {
+ gstrcpy(buf, T("text/plain"));
+ return buf;
+ }
+ if (websUrlParse(url, &tmp_buf, NULL, NULL, NULL, NULL, NULL,
+ NULL, &ext) < 0) {
+ gstrcpy(buf, T("text/plain"));
+ return buf;
+ }
+ strlower(ext);
+
+ if ((psym = symLookup(websMime, ext)) != NULL) {
+ gstrncpy(buf, psym->content.value.string, charCnt);
+ } else {
+ gstrcpy(buf, T("text/plain"));
+ }
+ bfree(B_L, tmp_buf);
+ return buf;
+}
+
+static int websParseFirst(webs_t wp, char_t *text)
+{
+ char_t *op, *proto, *protoVer, *url, *host, *query, *path, *port, *ext;
+ char_t *buf;
+ int testPort;
+
+#ifdef FEATURE_ZTE_WEB_TCARD
+//added by guo shoupeng 10124224 for http share 20111001 start
+ char *page_att=NULL;
+//added by guo shoupeng 10124224 for http share 20111001 end
+#endif
+ a_assert(websValid(wp));
+ a_assert(text && *text);
+#ifdef WEBINSPECT_FIX
+ if(text && (!is_print_str(text,strlen(text)) || strstr(text, "HTTP") == NULL))
+ {
+ websDone(wp, 0);
+ slog(MISC_PRINT, SLOG_ERR,"[goahead]es\n");
+ return -1;
+ }
+#endif
+ op = gstrtok(text, T(" \t"));
+ if (op == NULL || *op == '\0') {
+ websError(wp, 400, T("Bad HTTP request"));
+ return -1;
+ }
+ if (gstrcmp(op, T("GET")) != 0) {
+ if (gstrcmp(op, T("POST")) == 0) {
+ wp->flags |= WEBS_POST_REQUEST;
+ } else if (gstrcmp(op, T("HEAD")) == 0) {
+ wp->flags |= WEBS_HEAD_REQUEST;
+ } else {
+ websError(wp, 400, T("Bad request type"));
+ return -1;
+ }
+ }
+
+ websSetVar(wp, T("REQUEST_METHOD"), op);
+
+ url = gstrtok(NULL, T(" \t\n"));
+ if (url == NULL || *url == '\0') {
+ websError(wp, 400, T("Bad HTTP request"));
+ return -1;
+ }
+ protoVer = gstrtok(NULL, T(" \t\n"));
+
+ host = path = port = proto = query = ext = NULL;
+ if (websUrlParse(url, &buf, &host, &path, &port, &query, &proto,
+ NULL, &ext) < 0) {
+ websError(wp, 400, T("Bad URL format"));
+ return -1;
+ }
+
+ wp->url = bstrdup(B_L, url);
+
+#ifndef __NO_CGI_BIN
+
+
+ if ((gstrstr(url, CGI_BIN) != NULL)&&((wp->flags & WEBS_POST_REQUEST))) {
+ wp->flags |= WEBS_CGI_REQUEST;
+
+ printf("[goahead]set WEBS_CGI_REQUEST \n");
+
+ // special case: upload.cgi
+
+ if(gstrstr(url, CGI_BIN_UPLOAD) != NULL)
+ {
+ if(gstrstr(url, CGI_FIRMWARE_UPLOAD) != NULL){
+ wp->flags |= WEBS_CGI_FIRMWARE_UPLOAD;
+ system("rm -rf /firmware_tmp_file");
+ zte_mgmt_login_timemark_set();
+ printf("[goahead]set WEBS_CGI_FIRMWARE_UPLOAD \n");
+ }
+ wp->cgiStdin = websGetCgiCommName(wp);
+ printf("[goahead]get cgi name.\n");
+ // ex: upload_setting....
+ wp->flags |= WEBS_CGI_UPLOAD;
+ }
+
+ if(gstrstr(url, CGI_BIN_HTTPSHARE) != NULL)
+ {
+ printf("[httpshare]upload file.\n");
+
+ if(!zte_reset_cgi_state(wp))
+ {
+ printf("[httpshare]upload file.reset cgi state error.\n");
+ bfree(B_L, buf);
+ return -1;
+ }
+ wp->flags |= WEBS_CGI_HTTPSHARE_UPLOAD;
+ }
+
+
+ }
+#endif
+
+ wp->query = bstrdup(B_L, query);
+ wp->host = bstrdup(B_L, host);
+ wp->path = bstrdup(B_L, path);
+ wp->protocol = bstrdup(B_L, proto);
+ wp->protoVersion = bstrdup(B_L, protoVer);
+
+ //added by liuyingnan for PC Client begin, 20120829
+ if (gstrstr(url, "api/client/post") != NULL) {
+ printf("%s", "websParseFirst: pc client post");
+ wp->flags |= WEBS_REST_CLIENT_REQUEST;
+ }
+ //added by huangmin for PC Client end, 20120829
+ if (gstrstr(url, "api/xmlclient/post") != NULL) {
+ wp->flags |= WEBS_XML_CLIENT_REQUEST;
+ }
+
+ if ((testPort = socketGetPort(wp->listenSid)) >= 0) {
+ wp->port = testPort;
+ } else {
+ wp->port = gatoi(port);
+ }
+
+ if (gstrcmp(ext, T(".asp")) == 0) {
+ wp->flags |= WEBS_ASP;
+ }
+ bfree(B_L, buf);
+
+ websUrlType(url, wp->type, TSZ(wp->type));
+
+ ringqFlush(&wp->header);
+ return 0;
+}
+
+static int websGetInput(webs_t wp, char_t **ptext, int *pnbytes)
+{
+ char_t *text;
+ char buf[WEBS_SOCKET_BUFSIZ+1];
+ int nbytes, len, clen;
+
+ a_assert(websValid(wp));
+ a_assert(ptext);
+ a_assert(pnbytes);
+
+ if(websValid(wp) == 0 || ptext == NULL || pnbytes == NULL){
+ softap_assert("websGetInput 1");
+ return -1;//for kw
+ }
+
+ *ptext = text = NULL;
+ *pnbytes = 0;
+
+ if (wp->state == WEBS_POST_CLEN) {
+ len = (wp->clen > WEBS_SOCKET_BUFSIZ) ? WEBS_SOCKET_BUFSIZ : wp->clen;
+ } else {
+ len = 0;
+ }
+
+ if (len > 0) {
+
+#ifdef WEBS_SSL_SUPPORT
+ if (wp->flags & WEBS_SECURE) {
+ nbytes = websSSLRead(wp->wsp, buf, len);
+ } else {
+ nbytes = socketRead(wp->sid, buf, len);
+ }
+#else
+ nbytes = socketRead(wp->sid, buf, len);
+#endif
+ if (nbytes < 0) { /* Error */
+ websDone(wp, 0);
+ return -1;
+
+ } else if (nbytes == 0) { /* EOF or No data available */
+ //trace(8, T("@@@@webs 0x%x 0x%x: websGetInput read 0\n"),wp,wp->sid);
+ if (socketEof(wp->sid)) {
+ websDone(wp, 0);
+ }
+ return -1;
+
+ } else { /* Valid data */
+
+ buf[nbytes] = '\0';
+ if ((text = ballocAscToUni(buf, nbytes)) == NULL) {
+ websError(wp, 503, T("Insufficient memory"));
+ return -1;
+ }
+ }
+
+ } else {
+#ifdef WEBS_SSL_SUPPORT
+ if (wp->flags & WEBS_SECURE) {
+ nbytes = websSSLGets(wp->wsp, &text);
+ } else {
+ nbytes = socketGets(wp->sid, &text);
+ }
+#else
+ nbytes = socketGets(wp->sid, &text);
+#endif
+
+ if (nbytes < 0) {
+ int eof;
+
+#ifdef WEBS_SSL_SUPPORT
+ if (wp->flags & WEBS_SECURE) {
+
+ if (wp->state == WEBS_BEGIN) {
+ eof = 1;
+ } else {
+ eof = websSSLEof(wp->wsp);
+ }
+ } else {
+ eof = socketEof(wp->sid);
+ }
+#else
+ eof = socketEof(wp->sid);
+#endif
+
+ if (eof) {
+
+ if (wp->state == WEBS_POST) {
+ websUrlHandlerRequest(wp);
+ } else {
+ websDone(wp, 0);
+ }
+ } else {
+ trace(8, T("@@@@webs 0x%x 0x%x: websGetInput no eof\n"),wp,wp->sid);
+
+#if 1//def HP_FIX
+ websDone(wp, 0);
+#endif /*HP_FIX*/
+
+ }
+
+#if 0 //def UNUSED
+ if (wp->state == WEBS_HEADER && ringqLen(&wp->header) <= 0) {
+ websParseRequest(wp);
+ websUrlHandlerRequest(wp);
+ }
+#endif
+ bfreeSafe(B_L,text);//for kw
+ return -1;
+
+ } else if (nbytes == 0) {
+ if (wp->state == WEBS_HEADER) {
+
+ if(websParseRequest(wp) != 0){
+ return -1;
+ }
+ if (wp->flags & WEBS_POST_REQUEST) {
+ if (wp->flags & WEBS_CLEN) {
+ wp->state = WEBS_POST_CLEN;
+ clen = wp->clen;
+ } else {
+ wp->state = WEBS_POST;
+ clen = 1;
+ }
+ if (clen > 0) {
+
+ return 0;
+ }
+ return 1;
+ }
+
+ websUrlHandlerRequest(wp);
+ }
+ return -1;
+ }
+ }
+
+// if(text == NULL || nbytes <= 0){ // kw 3 nbytes <= 0 already return
+ if(text == NULL){
+ softap_assert("websGetInput 2");
+ }
+ a_assert(text);
+ a_assert(nbytes > 0);
+ *ptext = text;
+ *pnbytes = nbytes;
+ return 1;
+}
+
+
+#define isgoodchar(s) (gisalnum((s)) || ((s) == '/') || ((s) == '_') || \
+ ((s) == '.') || ((s) == '-') )
+
+static int websParseRequest(webs_t wp)
+{
+ char_t *authType, *upperKey, *cp, *browser, *lp, *key, *value;
+ int smugglingFlag = 0;
+ a_assert(websValid(wp));
+
+ websSetVar(wp, T("HTTP_AUTHORIZATION"), T(""));
+
+ browser = NULL;
+ char tmp[4] = T("");
+ for (lp = (char_t*) wp->header.servp; lp && *lp; ) {
+ cp = lp;
+ if ((lp = gstrchr(lp, '\n')) != NULL) {
+ lp++;
+ }
+
+ if ((key = gstrtok(cp, T(": \t\n"))) == NULL) {
+ continue;
+ }
+
+ if ((value = gstrtok(NULL, T("\n"))) == NULL) {
+ //value = T("");
+ value = tmp;// kw OVERWRITE_CONST_CHAR
+ }
+
+ while (gisspace(*value)) {
+ value++;
+ }
+ strlower(key);
+
+ fmtAlloc(&upperKey, (gstrlen(key) + 6), T("HTTP_%s"), key);
+ for (cp = upperKey; *cp; cp++) {
+ if (*cp == '-')
+ *cp = '_';
+ }
+ strupper(upperKey);
+ websSetVar(wp, upperKey, value);
+ bfree(B_L, upperKey);
+
+ if (gstrcmp(key, T("user-agent")) == 0) {
+ if (wp->userAgent)
+ bfree(B_L, wp->userAgent);
+ wp->userAgent = bstrdup(B_L, value);
+
+ } else if (gstricmp(key, T("authorization")) == 0) {
+
+ authType = bstrdup (B_L, value);
+ a_assert (authType);
+
+ cp = authType;
+ while (gisalpha(*cp)) {
+ cp++;
+ }
+ *cp = '\0';
+ if (wp->authType)
+ bfree(B_L, wp->authType);
+ wp->authType = bstrdup(B_L, authType);
+ bfree(B_L, authType);
+
+ if (gstricmp(wp->authType, T("basic")) == 0) {
+ char_t userAuth[FNAMESIZE];
+
+ if ((cp = gstrchr(value, ' ')) != NULL) {
+ *cp = '\0';
+
+ bfree(B_L, wp->authType);
+ wp->authType = bstrdup(B_L, value);
+ websDecode64(userAuth, ++cp, sizeof(userAuth));
+ } else {
+ websDecode64(userAuth, value, sizeof(userAuth));
+ }
+
+ if ((cp = gstrchr(userAuth, ':')) != NULL) {
+ *cp++ = '\0';
+ }
+ if (wp->password)
+ bfree(B_L, wp->password);
+ if (wp->userName)
+ bfree(B_L, wp->userName);
+ if (cp) {
+ wp->userName = bstrdup(B_L, userAuth);
+ wp->password = bstrdup(B_L, cp);
+ } else {
+ wp->userName = bstrdup(B_L, T(""));
+ wp->password = bstrdup(B_L, T(""));
+ }
+
+ wp->flags |= WEBS_AUTH_BASIC;
+ } else {
+#ifdef DIGEST_ACCESS_SUPPORT
+
+ char_t *np;
+ char_t tp;
+ char_t *vp;
+ char_t *npv;
+ char_t tpv;
+
+ wp->flags |= WEBS_AUTH_DIGEST;
+
+ cp = value;
+ while (isgoodchar(*cp)) {
+ cp++;
+ }
+ while (!isgoodchar(*cp)) {
+ cp++;
+ }
+
+
+ vp = gstrchr(cp, '=');
+ while (vp) {
+
+ np = cp;
+ while (isgoodchar(*np)) {
+ np++;
+ }
+ tp = *np;
+ *np = 0;
+
+ vp++;
+ while (!isgoodchar(*vp)) {
+ vp++;
+ }
+
+ npv = vp;
+ while (isgoodchar(*npv)) {
+ npv++;
+ }
+ tpv = *npv;
+ *npv = 0;
+
+ if (gstricmp(cp, T("username")) == 0) {
+ wp->userName = bstrdup(B_L, vp);
+ } else if (gstricmp(cp, T("response")) == 0) {
+ wp->digest = bstrdup(B_L, vp);
+ } else if (gstricmp(cp, T("opaque")) == 0) {
+ wp->opaque = bstrdup(B_L, vp);
+ } else if (gstricmp(cp, T("uri")) == 0) {
+ wp->uri = bstrdup(B_L, vp);
+ } else if (gstricmp(cp, T("realm")) == 0) {
+ wp->realm = bstrdup(B_L, vp);
+ } else if (gstricmp(cp, T("nonce")) == 0) {
+ wp->nonce = bstrdup(B_L, vp);
+ } else if (gstricmp(cp, T("nc")) == 0) {
+ wp->nc = bstrdup(B_L, vp);
+ } else if (gstricmp(cp, T("cnonce")) == 0) {
+ wp->cnonce = bstrdup(B_L, vp);
+ } else if (gstricmp(cp, T("qop")) == 0) {
+ wp->qop = bstrdup(B_L, vp);
+ }
+
+ *np = tp;
+ *npv = tpv;
+
+ cp = npv;
+ while (*cp && isgoodchar(*cp)) {
+ cp++;
+ }
+ while (*cp && !isgoodchar(*cp)) {
+ cp++;
+ }
+
+ if (*cp) {
+ vp = gstrchr(cp, '=');
+ } else {
+ vp = NULL;
+ }
+ }
+#endif /* DIGEST_ACCESS_SUPPORT */
+ } /* if (gstrcmp(wp->authType)) */
+#ifdef WEBS_SECURITY
+ } else if (gstrcmp(key, T("x-http-method")) == 0) {
+ printf("websParseRequest: key=%s\n",key);
+ websError(wp, 405, T(""));
+ return -1;
+ } else if (gstrcmp(key, T("x-http-method-override")) == 0) {
+ printf("websParseRequest: key=%s\n",key);
+ websError(wp, 405, T(""));
+ return -1;
+ } else if (gstrcmp(key, T("x-method-override")) == 0) {
+ printf("websParseRequest: key=%s\n",key);
+ websError(wp, 405, T(""));
+ return -1;
+ } else if (gstrcmp(key, T("transfer-encoding")) == 0) {
+ printf("websParseRequest: key=%s\n",key);
+ if(smugglingFlag) {
+ websError(wp, 403, T(""));
+ return -1;
+ }
+ smugglingFlag = 1;
+#endif
+
+ } else if (gstrcmp(key, T("content-length")) == 0) {
+
+#ifdef WEBS_SECURITY
+ if(smugglingFlag) {
+ websError(wp, 403, T(""));
+ return -1;
+ }
+ smugglingFlag = 1;
+#endif
+ wp->clen = gatoi(value);
+ if (wp->clen > 0)
+ {
+ wp->flags |= WEBS_CLEN;
+ websSetVar(wp, T("CONTENT_LENGTH"), value);
+ }
+ else
+ {
+ wp->clen = 0;
+ }
+
+ } else if (gstrcmp(key, T("content-type")) == 0) {
+ websSetVar(wp, T("CONTENT_TYPE"), value);
+
+#ifdef WEBS_KEEP_ALIVE_SUPPORT
+ } else if (gstrcmp(key, T("connection")) == 0) {
+ strlower(value);
+ if (gstrcmp(value, T("keep-alive")) == 0) {
+ wp->flags |= WEBS_KEEP_ALIVE;
+ }
+#endif
+
+#ifdef WEBS_PROXY_SUPPORT
+
+ } else if (gstrcmp(key, T("pragma")) == 0) {
+ char_t tmp[256];
+ gstrncpy(tmp, value, TSZ(tmp));
+ strlower(tmp);
+ if (gstrstr(tmp, T("no-cache"))) {
+ wp->flags |= WEBS_DONT_USE_CACHE;
+ }
+#endif /* WEBS_PROXY_SUPPORT */
+
+
+ } else if (gstrcmp(key, T("cookie")) == 0) {
+ wp->flags |= WEBS_COOKIE;
+ if (wp->cookie)
+ bfree(B_L, wp->cookie);
+ wp->cookie = bstrdup(B_L, value);
+ } else if (gstrcmp(key, T("referer")) == 0) {
+ if (wp->referer)
+ bfree(B_L, wp->referer);
+ wp->referer = bstrdup(B_L, value);
+
+ }
+ }
+ return 0;
+}
+
+
+int websTestVar(webs_t wp, char_t *var)
+{
+ sym_t *sp;
+
+ a_assert(websValid(wp));
+
+ if (var == NULL || *var == '\0') {
+ return 0;
+ }
+
+ if ((sp = symLookup(wp->cgiVars, var)) == NULL) {
+ return 0;
+ }
+ return 1;
+}
+
+void websSetVar(webs_t wp, char_t *var, char_t *value)
+{
+ value_t v;
+
+ a_assert(websValid(wp));
+
+ if (value) {
+ v = valueString(value, VALUE_ALLOCATE);
+ } else {
+ v = valueString(T(""), VALUE_ALLOCATE);
+ }
+ symEnter(wp->cgiVars, var, v, 0);
+}
+
+
+void websSetEnv(webs_t wp)
+{
+ char_t portBuf[8];
+ char_t *keyword, *value, *valCheck, *valNew;
+
+ a_assert(websValid(wp));
+
+ websSetVar(wp, T("QUERY_STRING"), wp->query);
+ websSetVar(wp, T("GATEWAY_INTERFACE"), T("CGI/1.1"));
+ websSetVar(wp, T("SERVER_HOST"), websHost);
+ websSetVar(wp, T("SERVER_NAME"), websHost);
+ websSetVar(wp, T("SERVER_URL"), websHostUrl);
+ websSetVar(wp, T("REMOTE_HOST"), wp->ipaddr);
+ websSetVar(wp, T("REMOTE_ADDR"), wp->ipaddr);
+ websSetVar(wp, T("PATH_INFO"), wp->path);
+ stritoa(websPort, portBuf, sizeof(portBuf));
+ websSetVar(wp, T("SERVER_PORT"), portBuf);
+ websSetVar(wp, T("SERVER_ADDR"), websIpaddr);
+ fmtAlloc(&value, FNAMESIZE, T("%s/%s"), WEBS_NAME, WEBS_VERSION);
+ websSetVar(wp, T("SERVER_SOFTWARE"), value);
+ bfreeSafe(B_L, value);
+ websSetVar(wp, T("SERVER_PROTOCOL"), wp->protoVersion);
+
+ wp->decodedQuery = bstrdup(B_L, wp->query);
+ keyword = gstrtok(wp->decodedQuery, T("&"));
+ char tmp[4] = T("");
+ while (keyword != NULL) {
+ if ((value = gstrchr(keyword, '=')) != NULL) {
+ *value++ = '\0';
+ websDecodeUrl(keyword, keyword, gstrlen(keyword));
+ websDecodeUrl(value, value, gstrlen(value));
+ } else {
+ //value = T("");
+ value = tmp;// kw OVERWRITE_CONST_CHAR
+ }
+
+ if (*keyword) {
+
+ if ((valCheck = websGetVar(wp, keyword, NULL)) != 0) {
+ fmtAlloc(&valNew, 256, T("%s %s"), valCheck, value);
+ websSetVar(wp, keyword, valNew);
+ bfreeSafe(B_L, valNew);
+ } else {
+ websSetVar(wp, keyword, value);
+ }
+ }
+ keyword = gstrtok(NULL, T("&"));
+ }
+
+#ifdef EMF
+
+ websSetEmfEnvironment(wp);
+#endif
+}
+
+
+int websCompareVar(webs_t wp, char_t *var, char_t *value)
+{
+ a_assert(websValid(wp));
+ a_assert(var && *var);
+
+ if (gstrcmp(value, websGetVar(wp, var, T(" __UNDEF__ "))) == 0) {
+ return 1;
+ }
+ return 0;
+}
+
+char_t *websGetVar(webs_t wp, char_t *var, char_t *defaultGetValue)
+{
+ sym_t *sp;
+
+ a_assert(websValid(wp));
+ a_assert(var && *var);
+
+ if ((sp = symLookup(wp->cgiVars, var)) != NULL) {
+ a_assert(sp->content.type == string);
+ if (sp->content.value.string) {
+ return sp->content.value.string;
+ } else {
+ return T("");
+ }
+ }
+ return defaultGetValue;
+}
+
+
+void websResponse(webs_t wp, int code, char_t *message, char_t *redirect)
+{
+ char_t *date;
+
+ a_assert(websValid(wp));
+
+ wp->flags &= ~WEBS_KEEP_ALIVE;
+
+ if ( !(wp->flags & WEBS_HEADER_DONE)) {
+ wp->flags |= WEBS_HEADER_DONE;
+
+ if (redirect != NULL) {
+ websWrite(wp, T("HTTP/1.0 %d %s\r\n"), code, websErrorMsg(code));
+ } else {
+ websWrite(wp, T("HTTP/1.1 %d %s\r\n"), code, websErrorMsg(code));
+ }
+
+
+ websWrite(wp, T("Server: %s\r\n"), WEBS_NAME);
+
+ if ((date = websGetDateString(NULL)) != NULL) {
+ websWrite(wp, T("Date: %s\r\n"), date);
+ bfree(B_L, date);
+ }
+
+ if (code == 401) {
+ if (!(wp->flags & WEBS_AUTH_DIGEST)) {
+ websWrite(wp, T("WWW-Authenticate: Basic realm=\"%s\"\r\n"),
+ websGetRealm());
+#ifdef DIGEST_ACCESS_SUPPORT
+ } else {
+ char_t *nonce, *opaque;
+
+ /* $$$ before... (note commas instead of semicolons...)
+ nonce = websCalcNonce(wp),
+ opaque = websCalcOpaque(wp),
+ $$$ after */
+ nonce = websCalcNonce(wp);
+ opaque = websCalcOpaque(wp);
+ /* ...$$$ end */
+ websWrite(wp,
+ T("WWW-Authenticate: Digest realm=\"%s\", domain=\"%s\",")
+ T("qop=\"%s\", nonce=\"%s\", opaque=\"%s\",")
+ T("algorithm=\"%s\", stale=\"%s\"\r\n"),
+ websGetRealm(),
+ websGetHostUrl(),
+ T("auth"),
+ nonce,
+ opaque, T("MD5"), T("FALSE"));
+ bfree(B_L, nonce);
+ bfree(B_L, opaque);
+#endif
+ }
+ }
+
+ if (wp->flags & WEBS_KEEP_ALIVE) {
+ websWrite(wp, T("Connection: keep-alive\r\n"));
+ }
+#ifdef WEBINSPECT_FIX
+ websWrite(wp, T("X-Frame-Options: SAMEORIGIN\r\n"));
+#endif
+ websWrite(wp, T("Pragma: no-cache\r\nCache-Control: no-cache\r\n"));
+ websWrite(wp, T("Content-Type: text/html\r\n"));
+
+ if (redirect) {
+ websWrite(wp, T("Location: %s\r\n"), redirect);
+ }
+ websWrite(wp, T("\r\n"));
+ }
+
+
+ if ((wp->flags & WEBS_HEAD_REQUEST) == 0 && message && *message) {
+ websWrite(wp, T("%s\r\n"), message);
+ }
+ websDone(wp, code);
+}
+
+void websTimeoutCancel(webs_t wp)
+{
+ a_assert(websValid(wp));
+
+ if (wp->timeout >= 0) {
+ emfUnschedCallback(wp->timeout);
+ wp->timeout = -1;
+ }
+}
+
+void websRedirect(webs_t wp, char_t *url)
+{
+ char_t *msgbuf, *urlbuf, *redirectFmt;
+
+ a_assert(websValid(wp));
+ a_assert(url);
+
+ websStats.redirects++;
+ msgbuf = urlbuf = NULL;
+
+ if (gstrstr(url, T("%0D")) || gstrstr(url, T("%0A"))
+ || gstrstr(url, T("%0d")) || gstrstr(url, T("%0a"))
+ || gstrstr(url, T("\r")) || gstrstr(url, T("\n"))) {
+ printf("[goahead]Redirect injo %s\n",url);
+ url = T(ZTE_WEB_PAGE_LOGIN_NAME);
+ /*ÓÃÓÚÖØ¶¨ÏòµÄÊäÈë²ÎÊý²»Äܰüº¬»Ø³µºÍ»»ÐÐ×Ö·û£¬ÒÔ·ÀÖ¹HTTPÏìÓ¦²ð·Ö¹¥»÷*/
+ }
+
+
+ if (gstrstr(url, T("http://")) == NULL && gstrstr(url, T("https://")) == NULL) {
+ if (*url == '/') {
+ url++;
+ }
+
+ //redirectFmt = T("http://%s/%s");
+
+#ifdef WEBS_SSL_SUPPORT
+ //if (wp->flags & WEBS_SECURE) {
+ if (websSSLIsOpen()) {
+ //redirectFmt = T("https://%s/%s");// kw OVERWRITE_CONST_CHAR
+ fmtAlloc(&urlbuf, WEBS_MAX_URL + 80, "https://%s/%s",
+ websGetVar(wp, T("HTTP_HOST"), websHostUrl), url);
+ }
+ else
+#endif
+ {
+ fmtAlloc(&urlbuf, WEBS_MAX_URL + 80, "http://%s/%s",
+ websGetVar(wp, T("HTTP_HOST"), websHostUrl), url);
+ }
+ url = urlbuf;
+ printf("[goahead]Redirect %s\n",url);
+ }
+
+
+ fmtAlloc(&msgbuf, WEBS_MAX_URL + 80,
+ T("<html><head></head><body>\r\n\
+ This document has moved to a new <a href=\"%s\">location</a>.\r\n\
+ Please update your documents to reflect the new location.\r\n\
+ </body></html>\r\n"), url);
+
+ websResponse(wp, 302, msgbuf, url);
+
+ bfreeSafe(B_L, msgbuf);
+ bfreeSafe(B_L, urlbuf);
+}
+
+static int charCount(const char_t* str, char_t ch);
+
+#define kLt '<'
+#define kLessThan T("<")
+#define kGt '>'
+#define kGreaterThan T(">")
+
+static char_t* websSafeUrl(const char_t* url)
+{
+
+ int ltCount = charCount(url, kLt);
+ int gtCount = charCount(url, kGt);
+ int safeLen = 0;
+ char_t* safeUrl = NULL;
+ char_t* src = NULL;
+ char_t* dest = NULL;
+
+ if (NULL != url)
+ {
+ safeLen = gstrlen(url);
+ if (ltCount == 0 && gtCount == 0)
+ {
+ safeUrl = bstrdup(B_L, (char_t*) url);
+ }
+ else
+ {
+ safeLen += (ltCount * 4);
+ safeLen += (gtCount * 4);
+
+ safeUrl = balloc(B_L, safeLen);
+ if (safeUrl != NULL)
+ {
+ src = (char_t*) url;
+ dest = safeUrl;
+ while (*src)
+ {
+ if (*src == kLt)
+ {
+ gstrcpy(dest, kLessThan);
+ dest += gstrlen(kLessThan);
+ }
+ else if (*src == kGt)
+ {
+ gstrcpy(dest, kGreaterThan);
+ dest += gstrlen(kGreaterThan);
+ }
+ else
+ {
+ *dest++ = *src;
+ }
+ ++src;
+ }
+ /* don't forget to terminate the string...*/
+ *dest = '\0';
+ }
+ }
+ }
+ return safeUrl;
+}
+
+static int charCount(const char_t* str, char_t ch)
+{
+ int count = 0;
+ char_t* p = (char_t*) str;
+
+ if (NULL == str)
+ {
+ return 0;
+ }
+
+ while (1)
+ {
+ p = gstrchr(p, ch);
+ if (NULL == p)
+ {
+ break;
+ }
+
+ ++count;
+ ++p;
+ }
+ return count;
+}
+
+
+char_t *websErrorMsg(int code)
+{
+ websErrorType *ep;
+
+ for (ep = websErrors; ep->code; ep++) {
+ if (code == ep->code) {
+ return ep->msg;
+ }
+ }
+ a_assert(0);
+ return T("");
+}
+
+
+#ifdef qRichErrorPage
+extern int dmfRichError(webs_t wp, int code, char_t* userMsg);
+#endif
+void websError(webs_t wp, int code, char_t *fmt, ...)
+{
+ va_list args = {0};
+ char_t *msg, *userMsg, *buf;
+ char_t* safeUrl = NULL;
+ char_t* safeMsg = NULL;
+#ifdef qRichErrorPage
+ static int reEntry = 0;
+ int errorOk;
+#endif
+
+ a_assert(websValid(wp));
+ a_assert(fmt);
+
+ websStats.errors++;
+
+ safeUrl = websSafeUrl(wp->url);
+ bfreeSafe(B_L, wp->url);
+ wp->url = safeUrl;
+
+ va_start(args, fmt);
+ userMsg = NULL;
+ fmtValloc(&userMsg, WEBS_BUFSIZE, fmt, args);
+ va_end(args);
+ safeMsg = websSafeUrl(userMsg);
+ bfreeSafe(B_L, userMsg);
+ userMsg = safeMsg;
+ safeMsg = NULL;
+
+
+
+#ifdef qRichErrorPage
+ if (!reEntry)
+ {
+
+ reEntry = 1;
+ errorOk = dmfRichError(wp, code, userMsg);
+ reEntry = 0;
+ if (errorOk)
+ {
+ bfreeSafe(B_L, userMsg);
+ return;
+ }
+
+ }
+
+#endif
+
+/* msg = T("<html><head><title>Document Error: %s</title></head>\r\n\
+ <body><h2>Access Error: %s</h2>\r\n\
+ <p>%s</p></body></html>\r\n");*/
+// kw OVERWRITE_CONST_CHAR
+
+ buf = NULL;
+ fmtAlloc(&buf, WEBS_BUFSIZE, "<html><head><title>Document Error: %s</title></head>\r\n\
+ <body><h2>Access Error: %s</h2>\r\n\
+ <p>%s</p></body></html>\r\n", websErrorMsg(code),
+ websErrorMsg(code), userMsg);
+
+ websResponse(wp, code, buf, NULL);
+ bfreeSafe(B_L, buf);
+ bfreeSafe(B_L, userMsg);
+}
+
+
+int websWriteBlock(webs_t wp, char_t *buf, int nChars)
+{
+ int len, done;
+ char *asciiBuf, *pBuf;
+
+ a_assert(wp);
+ a_assert(websValid(wp));
+ a_assert(buf);
+ a_assert(nChars >= 0);
+ if(wp == NULL)
+ return -1;//for kw
+
+ done = len = 0;
+
+ pBuf = asciiBuf = ballocUniToAsc(buf, nChars);
+ if(asciiBuf == NULL)
+ return -1;//for kw
+
+ while (nChars > 0) {
+#ifdef WEBS_SSL_SUPPORT
+ if (wp->flags & WEBS_SECURE) {
+ if ((len = websSSLWrite(wp->wsp, pBuf, nChars)) < 0) {
+ bfree(B_L, asciiBuf);
+ return -1;
+ }
+ websSSLFlush(wp->wsp);
+ } else {
+ if ((len = socketWrite(wp->sid, pBuf, nChars)) < 0) {
+ bfree(B_L, asciiBuf);
+ return -1;
+ }
+ socketFlush(wp->sid);
+ }
+#else /* ! WEBS_SSL_SUPPORT */
+ if ((len = socketWrite(wp->sid, pBuf, nChars)) < 0) {
+ bfree(B_L, asciiBuf);
+ return -1;
+ }
+ socketFlush(wp->sid);
+#endif /* WEBS_SSL_SUPPORT */
+ nChars -= len;
+ pBuf += len;
+ done += len;
+ }
+
+ bfree(B_L, asciiBuf);
+ return done;
+}
+
+int websWrite(webs_t wp, char_t *fmt, ...)
+{
+ va_list vargs = {0};
+ char_t *buf;
+ int rc;
+
+ a_assert(websValid(wp));
+
+ va_start(vargs, fmt);
+
+ buf = NULL;
+ rc = 0;
+
+ if (fmtValloc(&buf, WEBS_BUFSIZE, fmt, vargs) >= WEBS_BUFSIZE) {
+ trace(0, T("webs: websWrite lost data, buffer overflow\n"));
+ }
+
+ va_end(vargs);
+ a_assert(buf);
+ if (buf) {
+ rc = websWriteBlock(wp, buf, gstrlen(buf));
+ bfree(B_L, buf);
+ }
+ return rc;
+}
+
+
+void websDecodeUrl(char_t *decoded, char_t *token, int len)
+{
+ char_t *ip, *op;
+ int num, i, c;
+
+ a_assert(decoded);
+ a_assert(token);
+
+ op = decoded;
+ for (ip = token; *ip && len > 0; ip++, op++) {
+ if (*ip == '+') {
+ *op = ' ';
+ } else if (*ip == '%' && gisxdigit(ip[1]) && gisxdigit(ip[2])) {
+
+ ip++;
+ for (i = 0, num = 0; i < 2; i++, ip++) {
+ c = tolower(*ip);
+ if (c >= 'a' && c <= 'f') {
+ num = (num * 16) + 10 + c - 'a';
+ } else {
+ num = (num * 16) + c - '0';
+ }
+ }
+ *op = (char_t) num;
+ ip--;
+
+ } else {
+ *op = *ip;
+ }
+ len--;
+ }
+ *op = '\0';
+}
+
+int websWriteDataNonBlock(webs_t wp, char *buf, int nChars)
+{
+ int r;
+
+ a_assert(wp);
+ a_assert(websValid(wp));
+ a_assert(buf);
+ a_assert(nChars >= 0);
+
+#ifdef WEBS_SSL_SUPPORT
+ if (wp->flags & WEBS_SECURE) {
+ r = websSSLWrite(wp->wsp, buf, nChars);
+ websSSLFlush(wp->wsp);
+ } else {
+ r = socketWrite(wp->sid, buf, nChars);
+ socketFlush(wp->sid);
+ }
+#else
+ r = socketWrite(wp->sid, buf, nChars);
+ socketFlush(wp->sid);
+#endif
+
+ return r;
+}
+
+
+void websTimeout(void *arg, int id)
+{
+ webs_t wp;
+ int delay, tm;
+
+ wp = (webs_t) arg;
+ a_assert(websValid(wp));
+
+ tm = websGetTimeSinceMark(wp) * 1000;
+ trace(8, T("@@websTimeout %d ip:%s url:%s\n"),tm,wp->ipaddr,wp->url);
+ if (tm >= WEBS_TIMEOUT) {
+ websStats.timeouts++;
+ emfUnschedCallback(id);
+
+ wp->timeout = -1;
+ websDone(wp, 404);
+ } else {
+ delay = WEBS_TIMEOUT - tm;
+ a_assert(delay > 0);
+ emfReschedCallback(id, delay);
+ }
+}
+
+void websDone(webs_t wp, int code)
+{
+ a_assert(websValid(wp));
+
+ socketDeleteHandler(wp->sid);
+
+ if (code != 200) {
+ wp->flags &= ~WEBS_KEEP_ALIVE;
+ }
+
+ websPageClose(wp);
+
+#ifdef WEBS_SSL_SUPPORT
+ if (wp->flags & WEBS_SECURE) {
+ websTimeoutCancel(wp);
+ websSSLFlush(wp->wsp);
+ socketCloseConnection(wp->sid);
+ websFree(wp);
+ return;
+ }
+#endif
+
+ if (wp->flags & WEBS_KEEP_ALIVE) {
+ if (socketFlush(wp->sid) == 0) {
+ wp->state = WEBS_BEGIN;
+ wp->flags |= WEBS_REQUEST_DONE;
+ if (wp->header.buf) {
+ ringqFlush(&wp->header);
+ }
+ socketCreateHandler(wp->sid, SOCKET_READABLE, websSocketEvent,
+ (int) wp);
+ websTimeoutCancel(wp);
+ wp->timeout = emfSchedCallback(WEBS_TIMEOUT, websTimeout,
+ (void *) wp);
+ return;
+ }
+ } else {
+ websTimeoutCancel(wp);
+ socketSetBlock(wp->sid, 1);
+ socketFlush(wp->sid);
+ socketCloseConnection(wp->sid);
+ }
+ websFree(wp);
+}
+
+void websFree(webs_t wp)
+{
+ a_assert(websValid(wp));
+
+ if (wp->path)
+ bfree(B_L, wp->path);
+ if (wp->url)
+ bfree(B_L, wp->url);
+ if (wp->host)
+ bfree(B_L, wp->host);
+ if (wp->lpath)
+ bfree(B_L, wp->lpath);
+ if (wp->query)
+ bfree(B_L, wp->query);
+ if (wp->decodedQuery)
+ bfree(B_L, wp->decodedQuery);
+ if (wp->authType)
+ bfree(B_L, wp->authType);
+ if (wp->password)
+ bfree(B_L, wp->password);
+ if (wp->userName)
+ bfree(B_L, wp->userName);
+ if (wp->cookie)
+ bfree(B_L, wp->cookie);
+ if (wp->referer)
+ bfree(B_L, wp->referer);
+ if (wp->userAgent)
+ bfree(B_L, wp->userAgent);
+ if (wp->dir)
+ bfree(B_L, wp->dir);
+ if (wp->protocol)
+ bfree(B_L, wp->protocol);
+ if (wp->protoVersion)
+ bfree(B_L, wp->protoVersion);
+ if (wp->cgiStdin)
+ bfree(B_L, wp->cgiStdin);
+
+
+#ifdef DIGEST_ACCESS_SUPPORT
+ if (wp->realm)
+ bfree(B_L, wp->realm);
+ if (wp->uri)
+ bfree(B_L, wp->uri);
+ if (wp->digest)
+ bfree(B_L, wp->digest);
+ if (wp->opaque)
+ bfree(B_L, wp->opaque);
+ if (wp->nonce)
+ bfree(B_L, wp->nonce);
+ if (wp->nc)
+ bfree(B_L, wp->nc);
+ if (wp->cnonce)
+ bfree(B_L, wp->cnonce);
+ if (wp->qop)
+ bfree(B_L, wp->qop);
+#endif
+#ifdef WEBS_SSL_SUPPORT
+ websSSLFree(wp->wsp);
+#endif
+ symClose(wp->cgiVars);
+
+ if (wp->header.buf) {
+ ringqClose(&wp->header);
+ }
+
+ websMax = hFree((void***) &webs, wp->wid);
+ bfree(B_L, wp);
+ a_assert(websMax >= 0);
+}
+
+
+int websAlloc(int sid)
+{
+ webs_t wp;
+ int wid;
+
+ if ((wid = hAllocEntry((void***) &webs, &websMax,
+ sizeof(struct websRec))) < 0) {
+ return -1;
+ }
+ wp = webs[wid];
+
+ wp->wid = wid;
+ wp->sid = sid;
+ wp->state = WEBS_BEGIN;
+ wp->docfd = -1;
+ wp->timeout = -1;
+ wp->dir = NULL;
+ wp->authType = NULL;
+ wp->protocol = NULL;
+ wp->protoVersion = NULL;
+ wp->password = NULL;
+ wp->userName = NULL;
+ wp->cookie = NULL;
+ wp->referer = NULL;
+ wp->has_firmware_upload_clean = 0;
+ wp->has_firmware_upload_shell = 0;
+#ifdef DIGEST_ACCESS_SUPPORT
+ wp->realm = NULL;
+ wp->nonce = NULL;
+ wp->digest = NULL;
+ wp->uri = NULL;
+ wp->opaque = NULL;
+ wp->nc = NULL;
+ wp->cnonce = NULL;
+ wp->qop = NULL;
+#endif
+#ifdef WEBS_SSL_SUPPORT
+ wp->wsp = NULL;
+#endif
+
+ ringqOpen(&wp->header, WEBS_HEADER_BUFINC, WEBS_MAX_HEADER);
+
+ wp->cgiVars = symOpen(WEBS_SYM_INIT);
+
+ return wid;
+}
+
+
+char_t *websGetIpaddrUrl()
+{
+ return websIpaddrUrl;
+}
+
+
+char_t *websGetHostUrl()
+{
+ return websHostUrl;
+}
+
+
+int websGetPort()
+{
+ return websPort;
+}
+
+char_t *websGetHost()
+{
+ return websHost;
+}
+
+
+int websGetRequestBytes(webs_t wp)
+{
+ a_assert(websValid(wp));
+
+ return wp->numbytes;
+}
+
+
+int websGetRequestFlags(webs_t wp)
+{
+ a_assert(websValid(wp));
+
+ return wp->flags;
+}
+
+char_t *websGetRequestDir(webs_t wp)
+{
+ a_assert(websValid(wp));
+
+ if (wp->dir == NULL) {
+ return T("");
+ }
+
+ return wp->dir;
+}
+
+
+int websGetSid(webs_t wp)
+{
+ a_assert(websValid(wp));
+
+ return wp->sid;
+}
+
+
+char_t *websGetRequestIpaddr(webs_t wp)
+{
+ a_assert(websValid(wp));
+ return wp->ipaddr;
+}
+
+
+#ifdef FEATURE_ZTE_WEB_TCARD
+//added by guo shoupeng 10124224 for http share 20111001 start
+char_t * websGetURL(webs_t wp)
+{
+ a_assert(websValid(wp));
+
+ return wp->url;
+}
+
+char_t *websGetFileName(webs_t wp)
+{
+ a_assert(websValid(wp));
+
+ return wp->cgiStdin;
+}
+
+
+int websGetState(webs_t wp)
+{
+ a_assert(websValid(wp));
+
+ return wp->state;
+}
+
+int websGetlen(webs_t wp)
+{
+ a_assert(websValid(wp));
+
+ return wp->clen;
+}
+
+//added by guo shoupeng 10124224 for http share 20111001 end
+#endif
+
+
+char_t *websGetRequestLpath(webs_t wp)
+{
+ a_assert(websValid(wp));
+
+ return wp->lpath;
+}
+
+
+char_t *websGetRequestPassword(webs_t wp)
+{
+ a_assert(websValid(wp));
+
+ return wp->password;
+}
+
+char_t *websGetRequestPath(webs_t wp)
+{
+ a_assert(websValid(wp));
+
+ if (wp->path == NULL) {
+ return T("");
+ }
+
+ return wp->path;
+}
+
+
+char_t *websGetRequestType(webs_t wp)
+{
+ a_assert(websValid(wp));
+
+ return wp->type;
+}
+
+
+int websGetRequestWritten(webs_t wp)
+{
+ a_assert(websValid(wp));
+
+ return wp->written;
+}
+
+
+char_t *websGetRequestUserName(webs_t wp)
+{
+ a_assert(websValid(wp));
+
+ return wp->userName;
+}
+
+void websSetHost(char_t *host)
+{
+ gstrncpy(websHost, host, TSZ(websHost)-1);
+}
+
+
+void websSetIpaddr(char_t *ipaddr)
+{
+ a_assert(ipaddr && *ipaddr);
+
+ gstrncpy(websIpaddr, ipaddr, TSZ(websIpaddr)-1);
+}
+
+void websSetHostUrl(char_t *url)
+{
+ a_assert(url && *url);
+
+ bfreeSafe(B_L, websHostUrl);
+ websHostUrl = gstrdup(B_L, url);
+}
+
+
+void websSetRequestBytes(webs_t wp, int bytes)
+{
+ a_assert(websValid(wp));
+ a_assert(bytes >= 0);
+
+ wp->numbytes = bytes;
+}
+
+
+void websSetRequestLpath(webs_t wp, char_t *lpath)
+{
+ a_assert(websValid(wp));
+ a_assert(lpath && *lpath);
+
+ if (wp->lpath) {
+ bfree(B_L, wp->lpath);
+ }
+ wp->lpath = bstrdup(B_L, lpath);
+ websSetVar(wp, T("PATH_TRANSLATED"), wp->lpath);
+}
+
+void websSetRequestFlags(webs_t wp, int flags)
+{
+ a_assert(websValid(wp));
+
+ wp->flags = flags;
+}
+
+
+void websSetRequestPath(webs_t wp, char_t *dir, char_t *path)
+{
+ char_t *tmp;
+
+ a_assert(websValid(wp));
+
+ if (dir) {
+ tmp = wp->dir;
+ wp->dir = bstrdup(B_L, dir);
+ if (tmp) {
+ bfree(B_L, tmp);
+ }
+ }
+ if (path) {
+ tmp = wp->path;
+ wp->path = bstrdup(B_L, path);
+ websSetVar(wp, T("PATH_INFO"), wp->path);
+ if (tmp) {
+ bfree(B_L, tmp);
+ }
+ }
+}
+
+
+void websSetRequestWritten(webs_t wp, int written)
+{
+ a_assert(websValid(wp));
+
+ wp->written = written;
+}
+
+
+void websSetRequestSocketHandler(webs_t wp, int mask, void (*fn)(webs_t wp))
+{
+ a_assert(websValid(wp));
+
+ wp->writeSocket = fn;
+ socketCreateHandler(wp->sid, SOCKET_WRITABLE, websSocketEvent, (int) wp);
+}
+
+
+char_t *websGetDateString(websStatType *sbuf)
+{
+ char_t* cp, *r;
+ time_t now;
+
+ if (sbuf == NULL) {
+ time(&now);
+ } else {
+ now = sbuf->mtime;
+ }
+ if ((cp = gctime(&now)) != NULL) {
+ cp[gstrlen(cp) - 1] = '\0';
+ r = bstrdup(B_L, cp);
+ return r;
+ }
+ return NULL;
+}
+
+
+int websValid(webs_t wp)
+{
+ int wid;
+
+ for (wid = 0; wid < websMax; wid++) {
+ if (wp == webs[wid]) {
+ return 1;
+ }
+ }
+ return 0;
+}
+
+
+void websSetTimeMark(webs_t wp)
+{
+ wp->timestamp = get_sys_uptime();
+}
+
+
+void websSetRealm(char_t *realmName)
+{
+ a_assert(realmName);
+
+ gstrncpy(websRealm, realmName, TSZ(websRealm)-1);
+}
+
+
+char_t *websGetRealm()
+{
+ return websRealm;
+}
+
+
+static int websGetTimeSinceMark(webs_t wp)
+{
+ return get_sys_uptime() - wp->timestamp;
+}
+
+void websSetLoginTimemark(webs_t wp)
+{
+
+ char_t login_timemark[64] = {0};
+ char_t login_info[20] = {0};
+ char_t nv_ipaddr[40] = {0};
+ char_t *ip_address = NULL;
+ zte_topsw_state_e_type status = ZTE_NVIO_MAX;
+ long timemark = 0;
+ char_t user_login_timemark[64] = {0};
+ long timemark_check = 0;
+ long luser_login_timemark = 0;
+
+
+ status = zte_web_read(NV_LOGINFO, login_info);
+
+ if(0 == strcmp(login_info,"ok"))
+ {
+
+ zte_web_read("user_login_timemark", user_login_timemark);
+
+ luser_login_timemark = atol(user_login_timemark);
+ if(luser_login_timemark < 0 || luser_login_timemark > LONG_MAX-1){
+ luser_login_timemark = LONG_MAX;
+ }
+
+ timemark_check = time(0) - luser_login_timemark;
+ if(timemark_check > LOGIN_TIMEOUT)
+ {
+ (void)zte_web_write(NV_USER_IP_ADDR,"");
+ (void)zte_web_write(NV_LOGINFO,"timeout");
+ (void)zte_web_write(NV_COOKIE_ID, "");
+ (void)zte_web_write(NV_USER_LOGIN_TIMEMARK,"0");
+ slog(MISC_PRINT,SLOG_ERR,"zte_mgmt_login_timemark_check: the login is timeout .\n");
+ }
+ else
+ {
+ ip_address = websGetRequestIpaddr(wp);
+#if 0 // kw 3 INVARIANT_CONDITION.UNREACH wp->ipaddr is array, address can not be null
+ if (NULL == ip_address)
+ {
+ slog(MISC_PRINT,SLOG_ERR,"websSetLoginTimemark: ip_address is null.\n");
+ return ;
+ }
+#endif
+ zte_web_read(NV_USER_IP_ADDR, nv_ipaddr);
+
+
+ if (0 == strcmp(ip_address,nv_ipaddr))
+ {
+ timemark = time(0);
+ sprintf(login_timemark,"%ld",timemark);
+ (void)zte_web_write(NV_USER_LOGIN_TIMEMARK, login_timemark);
+ }
+
+ }
+ }
+
+}
+
diff --git a/lynq/R305/ap/app/goahead/server/webs.h b/lynq/R305/ap/app/goahead/server/webs.h
new file mode 100755
index 0000000..9dcb6af
--- /dev/null
+++ b/lynq/R305/ap/app/goahead/server/webs.h
@@ -0,0 +1,267 @@
+#ifndef _h_WEBS
+#define _h_WEBS 1
+
+#include "ej.h"
+#ifdef WEBS_SSL_SUPPORT
+ #include "websSSL.h"
+#else
+static inline int websSSLIsOpen()
+{
+ return 0;
+}
+#endif
+
+
+#ifdef WEBINSPECT_FIX
+#define WEBS_NAME T("Demo-Webs")
+#else
+#define WEBS_NAME T("GoAhead-Webs")
+#endif
+#define WEBS_VERSION T("2.1.8")
+
+#define WEBS_HEADER_BUFINC 512
+#define WEBS_ASP_BUFINC 512
+#define WEBS_MAX_PASS 32
+
+#define WEBS_BUFSIZE (8*1024)
+
+#define WEBS_MAX_HEADER (5 * 1024)
+#define WEBS_MAX_URL 4096
+#ifdef FEATURE_ZTE_WEB_TCARD
+//added for http share 20111001 start
+#define WEBS_SOCKET_BUFSIZ 4*1024
+#else
+#define WEBS_SOCKET_BUFSIZ 4*1024
+//added for http share 20111001 end
+#endif
+//added for PC Client begin, 20120829
+#define HTTP_BUFFER_SIZE (5*1024)
+//added for PC Client end, 20120829
+#define WEBS_HTTP_PORT T("httpPort")
+#define CGI_BIN T("cgi-bin")
+#define CGI_BIN_UPLOAD T("cgi-bin/upload/")
+#define CGI_BIN_HTTPSHARE T("cgi-bin/httpshare/")
+
+
+#define WEBS_LOCAL_PAGE 0x1
+#define WEBS_KEEP_ALIVE 0x2
+#define WEBS_DONT_USE_CACHE 0x4
+#define WEBS_COOKIE 0x8
+#define WEBS_IF_MODIFIED 0x10
+#define WEBS_POST_REQUEST 0x20
+#define WEBS_LOCAL_REQUEST 0x40
+#define WEBS_HOME_PAGE 0x80
+#define WEBS_ASP 0x100
+#define WEBS_HEAD_REQUEST 0x200
+#define WEBS_CLEN 0x400
+#define WEBS_FORM 0x800
+#define WEBS_REQUEST_DONE 0x1000
+#define WEBS_POST_DATA 0x2000
+#define WEBS_CGI_REQUEST 0x4000
+#define WEBS_SECURE 0x8000
+#define WEBS_AUTH_BASIC 0x10000
+#define WEBS_AUTH_DIGEST 0x20000
+#define WEBS_HEADER_DONE 0x40000
+#define WEBS_CGI_UPLOAD 0x80000
+#define WEBS_CGI_FIRMWARE_UPLOAD 0x100000
+#define WEBS_CGI_HTTPSHARE_UPLOAD 0x200000
+
+
+#define CGI_UPLOAD T("upload")
+#define CGI_FIRMWARE_UPLOAD T("upload.cgi")
+#define CGI_FIRMWARE_WRITE T("upload.write")
+#define CGI_HTTPSHARE_UPLOAD T("httpshare.up")
+
+//#define FIRMWARE_TMP_FILE T("/var/firmware_tmp_file")
+#define FIRMWARE_TMP_FILE T("/firmware_tmp_file")
+
+//added by liuyingnan for PC Client begin, 20120829
+#define WEBS_REST_CLIENT_REQUEST 0x200000
+#define WEBS_XML_CLIENT_REQUEST 0x400000
+//added by liuyingnan for PC Client end, 20120829
+
+
+#define WEBS_HANDLER_FIRST 0x1
+#define WEBS_HANDLER_LAST 0x2
+
+typedef struct websRec {
+ ringq_t header;
+ time_t since;
+ sym_fd_t cgiVars;
+ sym_fd_t cgiQuery;
+ time_t timestamp;
+ int timeout;
+ char_t ipaddr[40];
+ char_t ifaddr[32];
+ char_t type[64];
+ char_t *dir;
+ char_t *path;
+ char_t *url;
+ char_t *host;
+ char_t *lpath;
+ char_t *query;
+ char_t *decodedQuery;
+ char_t *authType;
+ char_t *password;
+ char_t *userName;
+ char_t *cookie;
+ char_t *referer;
+ char_t *userAgent;
+ char_t *protocol;
+ char_t *protoVersion;
+ int sid;
+ int listenSid;
+ int port;
+ int state;
+ int flags;
+ int code;
+ int clen;
+ int wid;
+ char_t *cgiStdin;
+ int docfd;
+ int numbytes;
+ int written;
+ int has_firmware_upload_clean;
+ int has_firmware_upload_shell;
+ void (*writeSocket)(struct websRec *wp);
+#ifdef DIGEST_ACCESS_SUPPORT
+ char_t *realm;
+ char_t *nonce;
+ char_t *digest;
+ char_t *uri;
+ char_t *opaque;
+ char_t *nc;
+ char_t *cnonce;
+ char_t *qop;
+#endif
+#ifdef WEBS_SSL_SUPPORT
+ websSSL_t *wsp;
+#endif
+} websRec;
+
+typedef websRec *webs_t;
+typedef websRec websType;
+
+extern void websSetDefaultDir(char_t *dir);
+extern void websSetDefaultPage(char_t *page);
+
+extern int websAccept(int sid, char *ipaddr, int port, int listenSid);
+extern int websAspDefine(char_t *name,
+ int (*fn)(int ejid, webs_t wp, int argc, char_t **argv));
+extern int websAspRequest(webs_t wp, char_t *lpath);
+
+extern void websFooter(webs_t wp);
+extern int websFormDefine(char_t *name, void (*fn)(webs_t wp,
+ char_t *path, char_t *query));
+
+extern int websDecode64(char_t *outbuf, char_t *string, int buflen);
+extern void websDecodeUrl(char_t *token, char_t *decoded, int len);
+
+extern void websEncode64(char_t *outbuf, char_t *string, int buflen);
+
+
+extern void websCloseListen();
+extern void websDone(webs_t wp, int code);
+
+extern void websError(webs_t wp, int code, char_t *msg, ...);
+extern char_t *websErrorMsg(int code);
+
+extern char_t *websGetDefaultDir();
+extern char_t *websGetDefaultPage();
+
+extern char_t *websGetRealm();
+extern int websGetRequestBytes(webs_t wp);
+extern char_t *websGetRequestDir(webs_t wp);
+extern int websGetRequestFlags(webs_t wp);
+
+extern char_t *websGetHostUrl();
+extern char_t *websGetIpaddrUrl();
+extern char_t *websGetPassword();
+extern int websGetPort();
+
+extern char_t *websGetPublishDir(char_t *path, char_t **urlPrefix);
+extern char_t *websGetRequestType(webs_t wp);
+extern int websGetRequestWritten(webs_t wp);
+
+extern char_t *websGetRequestIpaddr(webs_t wp);
+extern int websGetSid(webs_t wp);
+extern char_t *websGetRequestLpath(webs_t wp);
+extern char_t *websGetRequestPath(webs_t wp);
+extern char_t *websGetRequestPassword(webs_t wp);
+
+extern char_t *websGetVar(webs_t wp, char_t *var, char_t *def);
+extern int websCompareVar(webs_t wp, char_t *var, char_t *value);
+
+
+extern int websPublish(char_t *urlPrefix, char_t *path);
+extern void websRedirect(webs_t wp, char_t *url);
+extern void websSecurityDelete();
+extern int websSecurityHandler(webs_t wp, char_t *urlPrefix,
+ char_t *webDir, int arg, char_t *url, char_t *path,
+ char_t *query);
+
+extern void websHeader(webs_t wp);
+extern int websOpenListen(int port, int retries);
+extern int websPageOpen(webs_t wp, char_t *lpath, char_t *path,
+ int mode, int perm);
+extern void websPageClose(webs_t wp);
+
+extern void websSetEnv(webs_t wp);
+extern void websSetHost(char_t *host);
+extern void websSetIpaddr(char_t *ipaddr);
+extern void websSetPassword(char_t *password);
+extern void websSetRealm(char_t *realmName);
+
+extern void websSetVar(webs_t wp, char_t *var, char_t *value);
+extern int websTestVar(webs_t wp, char_t *var);
+
+extern int websUrlHandlerDefine(char_t *urlPrefix, char_t *webDir,
+ int arg, int (*fn)(webs_t wp, char_t *urlPrefix,
+ char_t *webDir, int arg, char_t *url, char_t *path,
+ char_t *query), int flags);
+extern int websUrlHandlerDelete(int (*fn)(webs_t wp, char_t *urlPrefix,
+ char_t *webDir, int arg, char_t *url, char_t *path,
+ char_t *query));
+extern int websUrlHandlerRequest(webs_t wp);
+extern int websUrlParse(char_t *url, char_t **buf, char_t **host,
+ char_t **path, char_t **port, char_t **query,
+ char_t **proto, char_t **tag, char_t **ext);
+extern char_t *websUrlType(char_t *webs, char_t *buf, int charCnt);
+
+extern int websValid(webs_t wp);
+extern int websValidateUrl(webs_t wp, char_t *path);
+
+extern void websSetRequestBytes(webs_t wp, int bytes);
+extern void websSetRequestFlags(webs_t wp, int flags);
+extern void websSetRequestLpath(webs_t wp, char_t *lpath);
+extern void websSetRequestPath(webs_t wp, char_t *dir, char_t *path);
+extern char_t *websGetRequestUserName(webs_t wp);
+extern void websSetRequestWritten(webs_t wp, int written);
+
+extern int websWrite(webs_t wp, char_t* fmt, ...);
+extern int websWriteBlock(webs_t wp, char_t *buf, int nChars);
+extern int websWriteDataNonBlock(webs_t wp, char *buf, int nChars);
+
+
+extern void websTimeout(void *arg, int id);
+extern void websSetTimeMark(webs_t wp);
+extern void websTimeoutCancel(webs_t wp);
+
+
+extern int websAlloc(int sid);
+extern void websFree(webs_t wp);
+
+extern void websReadEvent(webs_t wp);
+
+
+extern char websRecvHttpBuffer[HTTP_BUFFER_SIZE];
+extern int is_print_str(char *str, int len);
+
+#ifdef EMF
+extern void websFormExplain(webs_t wp, char_t *path, char_t *query);
+#endif
+
+extern int web_make_salt_base64(char *id, int len);
+
+#endif /* _h_WEBS */
+
diff --git a/lynq/R305/ap/app/zte_comm/at_ctl/inc/ps_normal.h b/lynq/R305/ap/app/zte_comm/at_ctl/inc/ps_normal.h
new file mode 100755
index 0000000..c3b81f4
--- /dev/null
+++ b/lynq/R305/ap/app/zte_comm/at_ctl/inc/ps_normal.h
@@ -0,0 +1,878 @@
+/************************************************************************
+*¹¦ÄܽéÉÜ£º»ù±¾at×¢²á
+*¸ºÔðÈË£ºÎÂÇÙ
+*±¸·ÝÈË£º
+*ÐÞ¸ÄÈÕ£º
+*ÐÞ¸ÄÄÚÈÝ£º
+*°æ±¾ºÅ£º
+************************************************************************/
+#ifndef __PS_NORMAL_H__
+#define __PS_NORMAL_H__
+/*****************************ÒýÓÃÍ·Îļþ****************************/
+#include "sqlite3.h"
+#include "at_msg.h"
+#include "at_com.h"
+#include "at_context.h"
+#include "syncnv.h"
+#include "ppp_dial.h"
+/****************************ºê¶¨Òå****************************/
+/*Êý¾Ý¿â·¾¶*/
+#define ZAPN_DB_PATH "/etc_ro/config/auto_apn/auto_apn.db"
+#define ZLOCKNET_DB_PATH "/etc_ro/config/db/locknet.db"
+#define ZNETPROVIDER_DB_PATH "/etc_ro/config/db/netprovider.db"
+#define ZROAM_DB_PATH "/etc_ro/config/db/roam.db"
+
+/*<cm_mode>: ÍøÂçģʽ*/
+#define ZAT_SYSCONFIG_MODE_AUTO 2
+#define ZAT_SYSCONFIG_MODE_GSM_ONLY 13
+#define ZAT_SYSCONFIG_MODE_WCDMA_ONLY 14
+#define ZAT_SYSCONFIG_MODE_TD_SCDMA_ONLY 15
+#define ZAT_SYSCONFIG_MODE_LTE 17
+#define ZAT_SYSCONFIG_MODE_GSM_TD 18
+#define ZAT_SYSCONFIG_MODE_GSM_LTE 19
+#define ZAT_SYSCONFIG_MODE_TD_LTE 20
+#define ZAT_SYSCONFIG_MODE_TD_W 22
+#define ZAT_SYSCONFIG_MODE_WCDMA_LTE 23
+#define ZAT_SYSCONFIG_MODE_GSM_TD_LTE 24
+#define ZAT_SYSCONFIG_MODE_TD_W_LTE 25
+#define ZAT_SYSCONFIG_MODE_TD_W_GSM 26
+#define ZAT_SYSCONFIG_MODE_W_GSM_LTE 27
+
+/*<pref_acq>: ÓÅѡģʽ*/
+#define ZAT_SYSCONFIG_PREF_ACQ_AUTO 0
+#define ZAT_SYSCONFIG_PREF_ACQ_GSM_WCDMA 1
+#define ZAT_SYSCONFIG_PREF_ACQ_WCDMA_GSM 2
+#define ZAT_SYSCONFIG_PREF_ACQ_GSM_LTE 4
+#define ZAT_SYSCONFIG_PREF_ACQ_TDPRE 5
+#define ZAT_SYSCONFIG_PREF_ACQ_LTEPRE 6
+#define ZAT_SYSCONFIG_PREF_ACQ_LTE_GSM 7
+#define ZAT_SYSCONFIG_PREF_ACQ_LTE_W_GSM 12
+
+#define PDP_AUTH_TYPE_NONE "none"
+#define PDP_AUTH_TYPE_PAP "pap"
+#define PDP_AUTH_TYPE_CHAP "chap"
+#define PDP_AUTH_TYPE_PAP_CHAP "pap+chap"
+
+#define ZAT_AIRMODE "AirMode"
+#define ZAT_POWERON "PowerOn"
+#define ZAT_POWEROFF "PowerOff"
+
+/*SysinfoÉϱ¨µÄsysmodeÖµ*/
+#define ZAT_SYSINFORES_SYSMODE_CDMA1X 2
+#define ZAT_SYSINFORES_SYSMODE_GSM 3
+#define ZAT_SYSINFORES_SYSMODE_EVDO 4
+#define ZAT_SYSINFORES_SYSMODE_WCDMA 5
+#define ZAT_SYSINFORES_SYSMODE_GPS 6
+#define ZAT_SYSINFORES_SYSMODE_GSM_WCDMA 7
+#define ZAT_SYSINFORES_SYSMODE_EVDO_CDMA1X 8
+#define ZAT_SYSINFORES_SYSMODE_TD_SCDMA 15
+#define ZAT_SYSINFORES_SYSMODE_FDD_LTE 16
+#define ZAT_SYSINFORES_SYSMODE_TDD_LTE 17
+
+#define PDP_AUTH_USER_PWD_LENGTH 65
+
+#define ZAT_PROFILE_MEMBER_LEN 32
+#define LOCK_NET_PLMN_LEN 32
+
+#define ZAT_RES_OPERATOR_MAX_NUM 16 /* AT ÏìÓ¦ÖÐÖ§³ÖµÄ×î´óÔËÓªÉÌÁбí¸öÊý */
+
+/* ϵͳ֧³ÖµÄATÏûÏ¢Ïà¹Ø¶¨Òå */
+#define ZAT_RES_PARAM_MAX_LEN 128//512 cops²»¿ÉÄÜÕâô³¤ /* ATÏìÓ¦²ÎÊýÐÐ×î´ó³¤¶È */
+#define ZAT_RES_PARAM_MAX_NUM 16 /* ATÏìÓ¦²ÎÊý×î´óÐÐÊý */
+
+#define NETWORK_TYPE_INIT "Searching"
+
+#define TIMER_FLAG_RESTART 1 /*´Ë¶¨Ê±Æ÷³ÖÐøÓÐЧ*/
+
+#define SIGNALBAR_NUM_MAX 12
+
+//memory modify ZAT_MCC_MAXLEN
+/*Qualcomm listÖж¨ÒåµÄºê*/
+#define ZAT_MCC_MAXLEN 4
+#define ZAT_NETWORK_PROVIDER_MAXLEN 16
+#define ZAT_NETWORK_PROVIDER_NAME_MAXLEN 64
+#define ZAT_APN_MAXLEN 32 //»¹ÓиöAPN_MAX_LEN
+#define ZAT_RESERVE_MAXLEN 68
+#define ZAT_AUTHENTIC_MODE_MAXLEN 12
+#define ZAT_LANGUAGE_ABBREV_MAXLEN 16
+
+#define IPTYPE_MAX_LEN 10
+#define APN_MAX_LEN 100
+/****************************½á¹¹Ìå****************************/
+
+//¶¨ÒåÍøÂçÀàÐÍ
+typedef struct
+{
+ char *netselect;
+ unsigned char modeValue;
+ unsigned char acqOrder;
+} T_zAt_SysConfigParaSet;
+
+/*csqÖ÷¶¯Éϱ¨*/
+typedef struct
+{
+ long rssi;
+ long ber;
+ long act;
+} T_zAt_CsqUnSolicite;
+
+/*ceregÖ÷¶¯Éϱ¨*/
+typedef struct
+{
+ unsigned int stat;
+ char tac[10]; /*×Ö·û´®ÀàÐÍ£»ÒÔÊ®Áù½øÖƸñʽÏÔʾµÄÁ½×ֽڵı¾µØÇøÓòÂë»ò¸ú×ÙÇøÓòÂë lac-->tac */
+ char ci[30]; /*×Ö·û´®ÀàÐÍ£»Ê®Áù½øÖƸñʽÖеÄËÄ×Ö½ÚµÄGERAN/UTRAN/E-UTRAN»ùÕ¾ID */
+ unsigned int act; /*µ±Ç°ÒÑ×¢²áÍøÂçµÄ½ÓÈë¼¼Êõ */
+ unsigned int subact;
+} T_zAt_CeregRes;
+
+/*cgregÖ÷¶¯Éϱ¨*/
+typedef struct
+{
+ unsigned int stat; /*µ±Ç°µÄ×¢²á״̬ */
+ char lac[10]; /*λÖÃÂëÐÅÏ¢£¬Á½¸ö×Ö½Ú£¬16½øÖƱíʾ */
+ char ci[30]; /*Ð¡ÇøÐÅÏ¢£¬Á½¸ö×Ö½Ú»ò4¸ö×Ö½Ú£¬16½øÖƱíʾ */
+ unsigned int act; /*µ±Ç°ÒÑ×¢²áÍøÂçµÄ½ÓÈë¼¼Êõ */
+ char rac[30]; /*×Ö·û´®ÀàÐÍ£»ÒÔÊ®Áù½øÖƸñʽÏÔʾµÄÒ»×ֽڵķÓÉÇøÓòÂë*/
+ unsigned int subact;
+} T_zAt_CgregRes;
+
+/*cregÖ÷¶¯Éϱ¨*/
+typedef struct
+{
+ unsigned int stat;
+ char tac[10]; /*×Ö·û´®ÀàÐÍ£»ÒÔÊ®Áù½øÖƸñʽÏÔʾµÄÁ½×ֽڵı¾µØÇøÓòÂë»ò¸ú×ÙÇøÓòÂë lac-->tac */
+ char ci[30]; /*×Ö·û´®ÀàÐÍ£»Ê®Áù½øÖƸñʽÖеÄËÄ×Ö½ÚµÄGERAN/UTRAN/E-UTRAN»ùÕ¾ID */
+ unsigned int act; /*µ±Ç°ÒÑ×¢²áÍøÂçµÄ½ÓÈë¼¼Êõ */
+ unsigned int subact;
+} T_zAt_CregRes;
+
+/* µ¥ÌõÔËÓªÉÌÐÅÏ¢µÄ¶¨Òå */
+typedef struct
+{
+ int stat;
+ char lalphaOper[70];
+ char salphaOper[30];
+ char numericOper[20];
+ int netType;
+ int subType;
+} T_zAt_ResOperator;
+
+/* COPS ²âÊÔÏìÓ¦²ÎÊý¶¨Òå */
+typedef struct
+{
+ long count;
+ T_zAt_ResOperator oplist[ZAT_RES_OPERATOR_MAX_NUM];
+} T_zAt_CopsTestRes;
+
+/*ËÑÍøCopsÉèÖÃÃüÁî²ÎÊý*/
+typedef struct
+{
+ long mode; /*ÍøÂçÑ¡Ôñģʽ */
+ long format; /*ÔËÓªÉÌÐÅÏ¢<oper>µÄ¸ñʽ*/
+ char oper[70]; /*ÔËÓªÉ̵ÄÐÅÏ¢ */
+ long nettype; /*ÍøÂçµÄ״̬±êʶ */
+ long subtype; /*ÍøÂçµÄ×Ó״̬±êʶ */
+} T_zAt_CopsSet;
+
+/* COPS ¶ÁÈ¡ÏìÓ¦²ÎÊý¶¨Òå */
+typedef struct
+{
+ long mode;
+ long format;
+ char oper[70];
+ long act;
+ long subact;
+} T_zAt_CopsReadRes;
+
+typedef struct
+{
+ char OperFullName[70];
+ char OperShortName[30];
+} T_zAt_OperatorName;
+
+typedef struct
+{
+ char profile_name[ZAT_PROFILE_MEMBER_LEN];
+ char apn_name[ZAT_PROFILE_MEMBER_LEN];//Õâ¸ö³¤¶È²»¶Ô£¬APN_MAX_LENÊÇ70
+ char dial_num[ZAT_PROFILE_MEMBER_LEN];
+ char ppp_auth_mode[ZAT_PROFILE_MEMBER_LEN];
+ char ppp_username[ZAT_PROFILE_MEMBER_LEN];
+ char ppp_passwd[ZAT_PROFILE_MEMBER_LEN];
+ char pdp_type[ZAT_PROFILE_MEMBER_LEN];
+} T_zAt_APN_PROFILE;
+
+
+typedef struct
+{
+ unsigned char sysmode;
+ char *netType;
+} T_zAt_SysInfoSetNetType;
+
+/* at ÏìÓ¦²ÎÊýÁбíÀàÐͶ¨Òå */
+typedef struct
+{
+ unsigned int listCount;
+ char strParasLine[ZAT_RES_PARAM_MAX_NUM][ZAT_RES_PARAM_MAX_LEN];
+} T_zAt_RES_PARAS_LIST;
+
+//״̬±êʶ
+typedef struct
+{
+ int cgdcont_state;//at+cgdcont=
+ int zrap_state;//at+zrap?
+ int powersave_state;//at+powersave
+ int apnset_state;//zgpcoauthºóÊÇ·ñÐèÒª·¢ËÍÆäËüatÃüÁî(ÐèÒª1)
+ int clck_state;//ÉèÖᢲéѯ±ê×¢
+}psnormal_state;
+
+typedef struct {
+ int signalbar0_low;
+ int signalbar0_high;
+ int signalbar1_low;
+ int signalbar1_high;
+ int signalbar2_low;
+ int signalbar2_high;
+ int signalbar3_low;
+ int signalbar3_high;
+ int signalbar4_low;
+ int signalbar4_high;
+ int signalbar5_low;
+ int signalbar5_high;
+}T_zAt_SignalBarInfo;
+
+//µ±Ç°Éè±¸ËøÍø×´Ì¬
+typedef struct
+{
+ unsigned int status;
+ unsigned int items;
+} T_zAt_Zsec_Res;
+
+//lteÏÂËø»ò½âËøÆµ²ÎÊý
+typedef struct
+{
+ long actionlte;
+ long uarfcnlte;
+ long cellParaIdlte;
+} T_zAt_ZltelcPara;
+
+/*CLCK²éѯÃüÁî*/
+typedef struct
+{
+ unsigned char status;
+ unsigned char uclass;
+} T_zAt_ClckSet_RES;
+
+//MSG_ID_WIFIµÄMSG_CMD_GET_MODE_INFOµÄÏûÏ¢ÖÐʹÓã¬Çë¶Å¼Ò½¿È·¶¨ÊÇ·ñ»¹Ê¹ÓÃ
+typedef struct
+{
+ long sys_mode;
+ long sys_submode;
+} T_zUfi_ModeInfoInd;
+
+//memory modify userName passWord
+typedef struct
+{
+ char mcc[ZAT_MCC_MAXLEN];
+ char mnc[ZAT_MCC_MAXLEN];
+ char networkProvider[ZAT_NETWORK_PROVIDER_MAXLEN]; /*ÔËÓªÉÌ brand */
+ char networkProviderName[ZAT_NETWORK_PROVIDER_NAME_MAXLEN]; /*ÔËÓªÉÌÃû³Æ operator */
+ char autoAPN[ZAT_APN_MAXLEN]; /*APN */
+ char userName[ZAT_AUTHENTIC_MODE_MAXLEN]; /*username */
+ char passWord[ZAT_AUTHENTIC_MODE_MAXLEN]; /*password */
+ char authenticMode[ZAT_AUTHENTIC_MODE_MAXLEN]; /*authentic mode */
+}T_zAt_QualcommListNode;
+//7100
+typedef enum
+{
+ MODEM_UNINIT = 0,
+ SIM_READY,
+ SIM_PIN,
+ SIM_PUK,
+ SIM_INVALID,
+ CFUN_OK,
+ CFUN_ERROR,
+ PDP_ACTIVED,
+ PDP_DEACTIVE,
+
+ MODEM_STATE_MAX,
+}T_Modem_State;
+
+typedef struct
+{
+ unsigned char init_stat; /*see T_Modem_State*/
+ unsigned char net_stat; /*1,5ÍøÂçÒÑ×¢²á*/
+ unsigned char connect_stat; /*0δ¼¤»î,1¼¤»î,2¼¤»îÖÐ,3È¥¼¤»îÖÐ*/
+ unsigned char net_opt; /*0 no support,1 control plane,2 user plane,3 both*/
+} T_AT_State;
+
+typedef struct
+{
+ unsigned char resume_cid; /*bitmap 3ȫԤÁô*/
+ unsigned char modem_model; /*yes init modem,no not init*/
+ char ip_type[IPTYPE_MAX_LEN]; /*IP,IPV6,IPV4V6,Non-IP*/
+ char apn[APN_MAX_LEN]; /*apn, same as struct cid_resource_t*/
+
+} T_Cfg_Set;
+
+typedef struct
+{
+ int cid;
+ int data_len;
+ unsigned char *data_addr;
+ int rai;
+ int data_type;
+ int param_num; //²ÎÊý¸öÊý
+ int at_fd; //Èç¹û>0˵Ã÷ÊÇÆ¬Íâ·¢ÆðµÄ£¬´Ó¸ÃͨµÀ»Ø¸´ÏìÓ¦
+}MSG_ZSODCP;
+
+typedef struct
+{
+ char res; /*0 OK, 1 2 ERROR, 2 carray error code*/
+ char errcode[7]; /*use if ERROR*/
+}MSG_ZSODCP_RES;
+/*****************************È«¾Ö±äÁ¿****************************/
+
+/****************************³£Á¿****************************/
+static const T_zAt_SysConfigParaSet G_ZAT_SYSCONFIG_CFGPARA_SET[] =
+{
+ {"GSM_preferred", ZAT_SYSCONFIG_MODE_AUTO, ZAT_SYSCONFIG_PREF_ACQ_GSM_WCDMA},
+ {"TD_preferred", ZAT_SYSCONFIG_MODE_AUTO, ZAT_SYSCONFIG_PREF_ACQ_WCDMA_GSM},
+ {"Only_GSM", ZAT_SYSCONFIG_MODE_GSM_ONLY, ZAT_SYSCONFIG_PREF_ACQ_AUTO},
+ {"Only_WCDMA", ZAT_SYSCONFIG_MODE_WCDMA_ONLY, ZAT_SYSCONFIG_PREF_ACQ_AUTO},
+ {"Only_TD", ZAT_SYSCONFIG_MODE_TD_SCDMA_ONLY, ZAT_SYSCONFIG_PREF_ACQ_AUTO},
+ {"Only_LTE", ZAT_SYSCONFIG_MODE_LTE, ZAT_SYSCONFIG_PREF_ACQ_AUTO},
+ {"GSM_TD", ZAT_SYSCONFIG_MODE_GSM_TD, ZAT_SYSCONFIG_PREF_ACQ_GSM_WCDMA},
+ {"TD_GSM", ZAT_SYSCONFIG_MODE_GSM_TD, ZAT_SYSCONFIG_PREF_ACQ_WCDMA_GSM},
+ {"GSM_LTE", ZAT_SYSCONFIG_MODE_GSM_LTE, ZAT_SYSCONFIG_PREF_ACQ_GSM_LTE},
+ {"LTE_GSM", ZAT_SYSCONFIG_MODE_GSM_LTE, ZAT_SYSCONFIG_PREF_ACQ_LTE_GSM},
+ {"GSM_TD_auto", ZAT_SYSCONFIG_MODE_GSM_TD, ZAT_SYSCONFIG_PREF_ACQ_AUTO},
+ {"TD_LTE_auto", ZAT_SYSCONFIG_MODE_TD_LTE, ZAT_SYSCONFIG_PREF_ACQ_AUTO},
+ {"TD_W", ZAT_SYSCONFIG_MODE_TD_W, ZAT_SYSCONFIG_PREF_ACQ_AUTO},
+ {"TD_W_LTE", ZAT_SYSCONFIG_MODE_TD_W_LTE, ZAT_SYSCONFIG_PREF_ACQ_AUTO},
+ {"TD_W_GSM", ZAT_SYSCONFIG_MODE_TD_W_GSM, ZAT_SYSCONFIG_PREF_ACQ_AUTO},
+};
+
+static const char suffixSignalBarNV[][20] = {
+ {"signalbar0_low"},
+ {"signalbar0_high"},
+ {"signalbar1_low"},
+ {"signalbar1_high"},
+ {"signalbar2_low"},
+ {"signalbar2_high"},
+ {"signalbar3_low"},
+ {"signalbar3_high"},
+ {"signalbar4_low"},
+ {"signalbar4_high"},
+ {"signalbar5_low"},
+ {"signalbar5_high"},
+};
+
+static const char prefixSignalBarNV[][10] = {
+ {""},
+ {"gsm_"},
+ {"wcdma_"},
+ {"tds_"},
+ {"lte_"},
+};
+
+typedef enum
+{
+ ZAT_SIGNALBAR_TYPE_NONE=0,
+ ZAT_SIGNALBAR_TYPE_GSM,
+ ZAT_SIGNALBAR_TYPE_WCDMA,
+ ZAT_SIGNALBAR_TYPE_TDS,
+ ZAT_SIGNALBAR_TYPE_LTE,
+ ZAT_SIGNALBAR_TYPE_MAX
+}T_zAt_SignalBar_Type;
+
+enum ZRAP_TYPE{
+ ZRAP_OTHER_CMD = 0,
+ ZRAP_READ_FIR_CMD,//¿ª»ú²éѯ
+ ZRAP_READ_SEC_CMD,//×Ô¶¯pinÂëÑéÖ¤ºó²éѯ
+};
+
+enum POWERSAVE_TYPE{
+ POWERSAVE_OTHER_CMD = 0,
+ POWERSAVE_CARDERROR_CMD,//²éѯ¿¨×´Ì¬´íÎó
+ POWERSAVE_LOCKNET_CMD,//ËøÍø
+ POWERSAVE_CARDREMOVE_CMD,//°Î¿¨
+};
+
+enum CLCK_TYPE{
+ CLCK_OTHER_CMD = 0,
+ CLCK_SET_CMD,//ÉèÖÃ(pinÂëʹÄÜ)
+ CLCK_REQ_CMD,//²éѯ
+};
+
+typedef enum
+{
+ DB_OK = 0,
+ DB_ERROR_INVALIDPTR = 100,
+ DB_ERROR_NOTOPENDB,
+ DB_ERROR_FULL,
+ DB_ERROR = -1
+}DbResult;
+
+/*Web·¢ÏûÏ¢¶ÔPinÂëµÄ²Ù×÷*/
+typedef enum
+{
+ ZAT_PIN_MANAGE_DISABLE = 0,
+ ZAT_PIN_MANAGE_ENABLE,
+ ZAT_PIN_MANAGE_MODIFY
+} T_zAt_PinManageion;
+
+typedef enum
+{
+ ZAT_CLCK_UNLOCK = 0, /*0 ½â³ýËø¶¨ */
+ ZAT_CLCK_LOCK, /*1 Ëø¶¨ */
+ ZAT_CLCK_QUERY /*2 ²éѯµ±Ç°Ëø¶¨×´Ì¬*/
+} T_zAt_ClckSetMode;
+
+/*ÓÃÀ´ÉèÖÃSYSINFOÉϱ¨µÄÍøÂçÀàÐÍ*/
+static const T_zAt_SysInfoSetNetType G_ZAT_SYSINFO_SET_NETTYPE[] =
+{
+ {ZAT_SYSINFORES_SYSMODE_CDMA1X, "CDMA1X" },
+ {ZAT_SYSINFORES_SYSMODE_GSM, "GSM" },
+ {ZAT_SYSINFORES_SYSMODE_EVDO, "EVDO" },
+ {ZAT_SYSINFORES_SYSMODE_WCDMA, "WCDMA" },
+ {ZAT_SYSINFORES_SYSMODE_GPS, "GPS" },
+ {ZAT_SYSINFORES_SYSMODE_GSM_WCDMA, "GSM/WCDMA" },
+ {ZAT_SYSINFORES_SYSMODE_EVDO_CDMA1X, "EVDO/CDMA1X" },
+ {ZAT_SYSINFORES_SYSMODE_TD_SCDMA, "TD-SCDMA" },
+ {ZAT_SYSINFORES_SYSMODE_FDD_LTE, "FDD-LTE" },
+ {ZAT_SYSINFORES_SYSMODE_TDD_LTE, "LTE" }
+};
+
+/*ÊÊÅäÖÐÒÆ*/
+static const T_zAt_SysInfoSetNetType G_ZAT_SYSINFO_CMCC_NETTYPE[] =
+{
+ {ZAT_SYSINFORES_SYSMODE_GSM, "G" },
+ {ZAT_SYSINFORES_SYSMODE_WCDMA, "3G" },
+ {ZAT_SYSINFORES_SYSMODE_TD_SCDMA, "3G" },
+ {ZAT_SYSINFORES_SYSMODE_FDD_LTE, "4G" },
+ {ZAT_SYSINFORES_SYSMODE_TDD_LTE, "4G" }
+};
+
+static const T_zAt_SysInfoSetNetType G_ZAT_SYSINFO_SET_SUBNETTYPE[] =
+{
+ {1, "GSM" },
+ {2, "GPRS" },
+ {3, "EDGE" },
+ {4, "WCDMA" }, //WCDMA
+ {5, "HSDPA" }, //utran
+ {6, "HSUPA" }, //utran
+ {7, "HSPA" }, //utran
+ {8, "TD_SCDMA" },
+ {9, "TDD_LTE" },
+ {10, "FDD_LTE" },
+ {11, "HSPA+" }, //utran
+};
+
+static const T_zAt_QualcommListNode G_ZAT_QUALCOMMLISTNODE[]=
+{
+ /* MCC MNC ÔËÓªÉÌ ÔËÓªÉÌÃû³Æ APN User_Name Pass_Word Authentic_Mode*/
+ { "460", "0", "China Mobile", "China Mobile Communication Corp.", "default" , "default", "default", "default"},
+ { "460", "1", "China Unicom", "China Unicom", "default" , "default", "default", "default"},
+ { "460", "2", "China Mobile", "China Mobile Communication Corp.", "default", "default", "default", "default"},
+ { "460", "3", "China Telecom", "China Telecom", "default" , "default", "default", "default"},
+ { "460", "7", "China Mobile", "China Mobile Communication Corp.", "default", "default", "default", "default"},
+};
+
+/**************************º¯ÊýÉùÃ÷****************************/
+void normal_regist_init();
+MSG_BUF *normal_getmsg(unsigned short src_id,unsigned short dst_id,unsigned short Msg_cmd,unsigned short us_DataLen,unsigned char *pData);
+
+//zdm ÇëÕ×·áÈ·ÈÏÊÇ·ñÐèҪͬ²½µ½AP²à
+char* zurdy_convert_cmd(void *msg,struct at_context *context);
+int zurdy_auto_act(char *at_paras ,int is_query_report);
+int zschplmn_ok_act(char *at_paras,struct at_context *context,void **next_req,int *next_len);
+void pbsms_init_timerout(void *msg);
+extern int atCcapp_RecvOk(char *at_str,struct at_context *context,void **next_req,int *next_len);
+extern int atCcapp_RecvErr(char *at_str,struct at_context *context,void **next_req,int *next_len);
+/***********atÃüÁî»ñÈ¡****************/
+char* normal_getzrapread();
+
+char* normal_getcpinread();
+
+char* normal_getcpinset(char *pin);
+
+char* normal_getcpukset(char *puk,char *newpin);
+
+char* normal_getcgsn();
+
+char* normal_getcrsmset(char *param);
+
+char* normal_getcimi();
+
+/*¸ù¾Ýµ±Ç°NVÖµ,·µ»ØsysconfigÉèÖÃÃüÁî*/
+char* normal_getsysconfigset();
+
+/*¸ù¾Ýµ±Ç°NVÖµ,·µ»ØcgdcontÉèÖÃÃüÁî*/
+char* normal_getcgdcontset(int cid);
+
+
+/*¸ù¾Ýµ±Ç°NVÖµ,·µ»ØzgpcoauthÉèÖÃÃüÁî*/
+char* normal_getzgpcoauthset(int cid);
+
+char* normal_getcfunset(char *cmdtype);
+
+char* normal_getcgregset(char *param);
+
+char* normal_getceregset(char *param);
+
+char* normal_getzsqrset(char *param);
+
+char* normal_getcopsset(int paramnum,...);
+
+char* normal_getcopstest();
+
+char* normal_getcsq();
+
+char* normal_getzversion();
+
+char* normal_getsyctimeset(long sec,long usec);
+char* normal_getmtnetset(char *mcc);
+char* normal_getboardnumread();
+
+char* normal_getsysinfo();
+
+
+char* normal_getcusdset_clean();
+
+
+char* normal_getcusdset(char *param);
+
+
+char* normal_getclckset(int paramnum,...);
+
+
+char* normal_getcpwdset(char *type,char *oldPin,char *newPin);
+
+char* normal_getzmodeset(int param);
+
+char* normal_getmacread();
+
+char* normal_getmac2read();
+
+char *normal_getzltelcset();
+
+/***********atÃüÁî»ñÈ¡****************/
+
+int normal_count_callback(void *fvarg,int line,char **zresult,char **lname);
+
+
+/*¸ù¾ÝÉ豸ÐͺźÍplmn,²éѯlocknet.db*/
+int normal_islocknetwhitelist(char *pmodel, char *pplmn);
+
+
+/*ËøÍø¼ì²â*/
+BOOL normal_locknetmatch(const char* mcc, const char* mnc);
+
+
+int normal_getsysconfigsetParam(int *mode, int *acqOrder, int *roam);
+
+
+int normal_getauthtype(char* pAuthType);
+
+void normal_cfunOkSet();
+
+
+void *normal_copstimeractstart(VOID *arg);
+
+void normal_copstest_timerout(void *msg);
+
+void normal_calcltesignalbar(long rssi);
+
+void normal_calctdsignalbar(long rssi);
+
+void normal_calcothersignalbar(long rssi);
+
+
+void normal_calcunknowsignalbar(void);
+
+
+void normal_calcsignalbar(T_zAt_SignalBar_Type signalBarType);
+
+
+void normal_calcltesignalstrength(long rssi);
+
+
+void normal_calctdsignalstrength(long rssi);
+
+
+void normal_calcothersignalstrength(long rssi);
+
+
+VOID normal_sysinfosysmodecfgset(long sysModeIn, long sysSubModeIn);
+
+
+VOID normal_sysinfonetworktypeSet(long sysMode,long sysSubmode);
+
+
+long normal_isroam(char *sim_plmn, char *net_plmn);
+
+
+BOOL normal_checkroam(const char* mcc, const char* mnc);
+
+
+VOID normal_simcardcfgreset();
+
+char *normal_findsubstr(const char *pStr, const char *pSubStr);
+
+/*Ô¤´¦Àí*/
+VOID normal_preprocresparalineex(char *pParaLine,int paraSize);
+
+
+/*Ô¤´¦Àí*/
+void normal_preprocresparalist(T_zAt_RES_PARAS_LIST *pParaList, const char *pParas);
+
+VOID normal_recvcopstestrsp(char *at_paras);
+
+
+int normal_getautoapn_callback(void *fvarg,int line,char **zresult,char **lname);
+
+/*»ñÈ¡auto apn*/
+long normal_getautoapn(char *CCMNC);
+
+
+void normal_recvzrapok();
+
+int zmsri_auto_act(char *at_paras ,int is_query_report);
+
+int zupci_auto_act(char *at_paras ,int is_query_report);
+char* start_zutr_cmd(void *msg,struct at_context *context);
+
+int zrefreshind_auto_act(char *at_paras ,int is_query_report);
+
+int zuslot_auto_act(char *at_paras ,int is_query_report);
+
+char* start_start_zmsri(void *msg,struct at_context *context);
+
+char* start_query_csq(void *msg,struct at_context *context);
+
+char* start_verifypin_cmd(void *msg,struct at_context *context);
+
+char* start_verifypuk_cmd(void *msg,struct at_context *context);
+
+char* start_netselect_cmd(void *msg,struct at_context *context);
+
+char *start_pinmanage_cmd(void *msg,struct at_context *context);
+
+char* start_setnetwork_cmd(void *msg,struct at_context *context);
+
+char* start_syctimeset_cmd(void *msg,struct at_context *context);
+
+char *start_ussdset_cmd(void *msg,struct at_context *context);
+
+char *start_ussdcancel_cmd(void *msg,struct at_context *context);
+
+char *start_airmode_cmd(void *msg,struct at_context *context);
+
+char *start_celllock_cmd(void *msg,struct at_context *context);
+
+char *start_imeireq_cmd(void *msg,struct at_context *context);
+
+char *start_zversionreq_cmd(void *msg,struct at_context *context);
+
+char *start_cgdcontset_cmd(void *msg,struct at_context *context);
+
+char *start_query_sysinfo(void *msg,struct at_context *context);
+
+char *start_start_zuslot(void *msg,struct at_context *context);
+
+char *start_setroam_cmd(void *msg,struct at_context *context);
+
+int sysconfigread_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int sysconfigread_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int sysconfig_auto_act( char *at_paras ,int is_query_report);
+
+int zrap_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int zrap_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int zrap_auto_act( char *at_paras ,int is_query_report);
+
+int cpin_read_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int cpin_read_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int cpin_set_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int cpin_set_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int cpin_auto_act(char *at_paras ,int is_query_report);
+
+int cgsn_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int cgsn_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int cgsn_auto_act(char *at_paras ,int is_query_report);
+
+int crsm_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int crsm_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int crsm_auto_act(char *at_paras ,int is_query_report);
+
+int cimi_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int cimi_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int cimi_auto_act(char *at_paras ,int is_query_report);
+
+int zapnsave_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int zapnsave_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int sysconfig_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int sysconfig_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int cgdcont_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int cgdcont_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int cfun_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+
+int cfun_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+
+int cgreg_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+
+int cgreg_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+
+int cereg_set_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+
+int cereg_set_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+
+int zsqr_auto_act(char *at_paras ,int is_query_report);
+
+
+int cops_set_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+
+int cops_set_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+
+int cops_read_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int cops_read_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+
+int cops_test_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+
+int cops_test_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+
+int cops_auto_act(char *at_paras ,int is_query_report);
+
+int zversion_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+
+int zversion_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int zversion_auto_act(char *at_paras ,int is_query_report);
+
+
+int syctime_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int syctime_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+int zsetmtnet_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int zsetmtnet_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int mac_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+
+int mac_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+
+int mac2_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+
+int mac2_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int zltelc_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int zltelc_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int sysinfo_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int sysinfo_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int cusd_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int clck_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int clck_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int cpwd_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int cpwd_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int mode_auto_act(char *at_paras ,int is_query_report);
+
+int cereg_auto_act(char *at_paras ,int is_query_report);
+
+int cgreg_auto_act(char *at_paras ,int is_query_report);
+
+int creg_auto_act(char *at_paras ,int is_query_report);
+
+int sysinfo_auto_act(char *at_paras ,int is_query_report);
+
+int mac_auto_act(char *at_paras ,int is_query_report);
+
+int mac2_auto_act(char *at_paras ,int is_query_report);
+
+int clck_auto_act(char *at_paras ,int is_query_report);
+
+int zpbic_auto_act(char *at_paras ,int is_query_report);
+
+int cnum_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int cnum_auto_act( char *at_paras ,int is_query_report);
+
+char* start_query_cnum(void *msg,struct at_context *context);
+
+char *start_getmodeminfo(void *msg,struct at_context *context);
+
+int ziccid_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+
+int ziccid_auto_act( char *at_paras ,int is_query_report);
+
+//iot
+int cciotopt_set_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+int cciotopt_set_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+char* normal_cciotopt_set(void);
+
+char* start_pdpact_cmd(void *msg,struct at_context *context);
+char* start_pdpdeact_cmd(void *msg,struct at_context *context);
+int zmmi_auto_act(char *at_paras ,int is_query_report);
+
+//оƬÈÏÖ¤
+char* start_zeact_cmd(void *msg,struct at_context *context);
+char* start_zmmi_cmd(void *msg,struct at_context *context);
+char* start_zimsamrw_cmd(void *msg,struct at_context *context);
+int cmd_ok_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+int cmd_err_act(char *at_str,struct at_context *context,void **next_req,int *next_len);
+int atd_req_rcv_act( char *at_paras,int at_fd,struct at_context *context);
+
+void at_ctl_startisms(void);
+void pbsms_init_msg_proc();
+MSG_BUF *normal_getmsg(unsigned short src_id,unsigned short dst_id,unsigned short Msg_cmd,unsigned short us_DataLen,unsigned char *pData);
+char* start_cvmod_cmd(void *msg,struct at_context *context);
+char* start_zchnelset_cmd(void *msg,struct at_context *context);
+char *start_querycgdcont_cmd(void *msg,struct at_context *context);
+
+int cusd_auto_act(char *at_paras ,int is_query_report);
+
+#endif
diff --git a/lynq/R305/ap/app/zte_comm/zte_mmi/mmi_ctrl.c b/lynq/R305/ap/app/zte_comm/zte_mmi/mmi_ctrl.c
new file mode 100755
index 0000000..b210be3
--- /dev/null
+++ b/lynq/R305/ap/app/zte_comm/zte_mmi/mmi_ctrl.c
@@ -0,0 +1,300 @@
+/*****************************************************************************
+* °æ±¾ËùÓÐ (C)ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾
+* Ä£¿éÃû £ºMMI
+* ÎļþÃû £ºmmi_ctrl.c
+* Îļþ±êʶ £º
+* Ïà¹ØÎļþ £º
+* ʵÏÖ¹¦ÄÜ £ºMMIÊ¡µç´¦Àí
+* ×÷Õß £º
+* °æ±¾ £ºV1.0
+* Íê³ÉÈÕÆÚ £º2014-6-20
+* ÆäËü˵Ã÷ £º
+*
+******************************************************************************/
+
+/*****************************************************************************
+ Í·Îļþ
+******************************************************************************/
+#include "mmi_common.h"
+#include "mmi_lcd.h"
+
+/*****************************************************************************
+ È«¾Ö±äÁ¿¶¨Òå
+******************************************************************************/
+//lcd/ledµÄ¹¤×÷ģʽ£¬ÓÃÀ´¾ö¶¨ÁÁÃðÆÁ/µÆ¡¢Ê¡µçµÈ
+static E_zMmi_Work_Mode g_mmi_lcd_mode = MMI_ACTIVE_MODE;
+static E_zMmi_Work_Mode g_mmi_led_mode = MMI_ACTIVE_MODE;
+SINT32 g_mmi_softtimer_flag = 0;//ÓÃÀ´²âÊÔsofttimer»Øµ÷ÊÇ·ñÖ´ÐеÄdebug±äÁ¿
+
+/*****************************************************************************
+ ÒýÓñäÁ¿
+******************************************************************************/
+extern pthread_mutex_t g_mmi_lcdmode_mutex;
+extern pthread_mutex_t g_mmi_ledmode_mutex;
+extern E_zMmiShowMode g_showMode;
+extern UINT32 g_led_sleep_mode;
+extern UINT32 g_led_standby_mode;
+
+
+/*****************************************************************************
+ º¯Êý˵Ã÷:×¢²áÃðÆÁÃðµÆ¿ØÖÆÄ£¿é
+******************************************************************************/
+SINT32 mmi_get_ctrlinfo(UINT32 ctrlinfo)
+{
+ if (ctrlinfo != 0) {
+ T_zMMICtrlInfo * pCtrlInfo = (T_zMMICtrlInfo *)ctrlinfo;
+ pCtrlInfo->lcdmode = mmi_get_lcd_mode();
+ pCtrlInfo->ledmode = mmi_get_led_mode();
+ }
+ return MMI_SUCCESS;
+}
+
+
+SINT32 mmi_RegisterCtrlTaskInfoItem()
+{
+ T_zMMITaskInfoItem ctrlInfoItem = {0};
+ ctrlInfoItem.task = MMI_TASK_CTRL;
+ ctrlInfoItem.taskinfo = (VOID*)malloc(sizeof(T_zMMICtrlInfo));
+ ctrlInfoItem.get_taskinfo_fun = mmi_get_ctrlinfo;
+ ctrlInfoItem.get_ledinfo_fun = mmi_getLedCtrlInfo;
+#ifndef DISABLE_LCD
+ ctrlInfoItem.get_lcdinfo_fun = mmi_getLcdCtrlInfo;
+#endif
+ ctrlInfoItem.ledinfo = (VOID*)malloc(sizeof(T_zMmi_Led_Info));
+ //ctrlInfoItem.show_mode = 2;
+ mmi_register_taskinfo_item(&ctrlInfoItem);
+ return MMI_SUCCESS;
+}
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:´ý»úʱÎÞ°´¼ü¹Ø±³¹â,Ïȱ䰵 5Ãë
+***********************************************************************************/
+static VOID * mmi_idle_halfbright_timer_cb(VOID *arg)
+{
+ slog(MMI_PRINT, SLOG_DEBUG, "ZTE_MMI mmi_idle_halfbright_timer_cb !!\n");
+ mmi_set_lcd_mode(MMI_BACKLIGHT_OFF_MODE);
+ mmi_set_update_flag(MMI_TASK_CTRL);
+ return NULL;
+}
+
+static VOID mmi_idle_halfbright_timer_start(VOID)
+{
+ int ret = -1;
+ slog(MMI_PRINT, SLOG_DEBUG, "ZTE_MMI mmi_idle_halfbright_timer_start !!\n");
+#if MMI_SOFTTIMER_DEBUG
+ g_mmi_softtimer_flag = 5;
+#endif
+ ret = CreateSoftTimer(SET_BACKLIGHT_HALFBRIGHT_TIMER, TIMER_FLAG_ONCE, SET_BACKLIGHT_HALFBRIGHT_TIME, &mmi_idle_halfbright_timer_cb, NULL);
+ if (ret != 0) {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI mmi_idle_halfbright_timer_start FAILED !!");
+ }
+}
+
+static VOID mmi_idle_halfbright_timer_stop(VOID)
+{
+
+ DeleteSoftTimer(SET_BACKLIGHT_HALFBRIGHT_TIMER);
+}
+
+SINT32 zMMI_Handle_Msg_BacklightOff(VOID *data)
+{
+ //mmi_idle_halfbright_timer_start();
+ mmi_set_lcd_mode(MMI_BACKLIGHT_OFF_MODE);
+ mmi_set_update_flag(MMI_TASK_CTRL);
+ return 0;
+}
+/**********************************************************************************
+º¯Êý×÷ÓÃ:MMI´ý»úʱ¶¨Ê±Æ÷µÄ»Øµ÷º¯Êý
+***********************************************************************************/
+static VOID * mmi_idle_timer_cb(VOID *arg)
+{
+ slog(MMI_PRINT, SLOG_DEBUG, "ZTE_MMI mmi_idle_timer_cb !!\n");
+ if (g_showMode == MMI_MODE_LCD || g_showMode == MMI_MODE_ALL) {
+ if (mmi_get_lcd_mode() == MMI_FAKE_POWEROFF_CHARGE_MODE || mmi_get_lcd_mode() == MMI_FAKE_POWEROFF_MODE) {
+ mmi_set_lcd_mode(MMI_FAKE_POWEROFF_MODE);
+ mmi_set_update_flag(MMI_TASK_CTRL);
+ } else {
+ mmi_set_lcd_mode(MMI_BACKLIGHT_HALFBRIGHT_MODE);
+ mmi_set_update_flag(MMI_TASK_CTRL);
+ //mmi_send_message(MODULE_ID_MMI, (USHORT)MSG_CMD_MMISTART_BACKLIGHTOFF_TIMER, 0, NULL);
+ ipc_send_message(MODULE_ID_MMI, MODULE_ID_MMI, MSG_CMD_MMISTART_BACKLIGHTOFF_TIMER, 0, NULL, 0);
+ }
+ }
+
+ if (g_led_sleep_mode) {
+ if (g_showMode == MMI_MODE_LED || g_showMode == MMI_MODE_ALL) {
+ E_zMmi_Work_Mode led_mode = mmi_get_led_mode();
+ if (led_mode == MMI_FAKE_POWEROFF_MODE || led_mode == MMI_IDLE_STANDBY_LEDOFF_MODE) {
+ mmi_set_update_flag(MMI_TASK_CTRL);
+ return NULL;
+ }
+ if (led_mode == MMI_FAKE_POWEROFF_CHARGE_MODE) {
+ return NULL;
+ }
+ if (mmi_get_charge_state() == STATE_CHARGING || mmi_get_charge_state() == STATE_FULL) {
+ mmi_set_led_mode(MMI_IDLE_CHG_LEDOFF_MODE);
+ } else if (g_led_standby_mode && mmi_get_wifi_state() == FALSE) {
+ mmi_set_led_mode(MMI_IDLE_STANDBY_LEDOFF_MODE);
+ } else {
+ mmi_set_led_mode(MMI_IDLE_LEDOFF_MODE);
+ }
+ mmi_set_update_flag(MMI_TASK_CTRL);
+ }
+ }
+ return NULL;
+}
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:´ý»úʱÎÞ°´¼ü¹Ø±³¹â¶¨Ê±Æ÷£¬Ê±¼ä20Ã룬һ´ÎÐÔ¶¨Ê±Æ÷
+***********************************************************************************/
+static VOID mmi_idle_timer_create(VOID)
+{
+ int ret = -1;
+ ret = CreateSoftTimer(SET_MMI_IDLE_TIMER, TIMER_FLAG_ONCE, SET_MMI_IDLE_TIME, &mmi_idle_timer_cb, NULL);
+ if (ret != 0) {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI mmi_idle_timer_create FAILED !!");
+ }
+}
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:STOP ´ý»úʱÎÞ°´¼üÃðµÆ¶¨Ê±Æ÷
+***********************************************************************************/
+VOID mmi_idle_timer_stop(VOID)
+{
+
+ DeleteSoftTimer(SET_MMI_IDLE_TIMER);
+}
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:MMI¿ìËٹػúʱ¶¨Ê±Æ÷µÄ»Øµ÷º¯Êý
+***********************************************************************************/
+static VOID * mmi_fast_poweron_idle_timer_cb(VOID *arg)
+{
+ slog(MMI_PRINT, SLOG_DEBUG, "ZTE_MMI mmi_fast_poweron_idle_timer_cb !!\n");
+ if (mmi_get_lcd_mode() == MMI_FAKE_POWEROFF_MODE && (mmi_get_charge_state() == STATE_DISCHARGE)) {
+ mmi_set_update_flag(MMI_TASK_CTRL);
+ }
+ return NULL;
+}
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:¿ìËٹػúʱ¶Ì°´¼ü½øÈë˯Ãß¶¨Ê±Æ÷£¬Ê±¼ä4Ã룬һ´ÎÐÔ¶¨Ê±Æ÷
+***********************************************************************************/
+static VOID mmi_fast_poweron_idle_timer_create(VOID)
+{
+ int ret = -1;
+ ret = CreateSoftTimer(SET_MMI_FAST_POWERON_IDLE_TIMER, TIMER_FLAG_ONCE, SET_MMI_FAST_POWERON_IDLE_TIME, &mmi_fast_poweron_idle_timer_cb, NULL);
+ if (ret != 0) {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI mmi_fast_poweron_idle_timer_create FAILED\n");
+ }
+}
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:KILL¿ìËٹػúʱʡµç¶¨Ê±Æ÷
+***********************************************************************************/
+VOID mmi_fast_poweron_idle_timer_stop(VOID)
+{
+
+ DeleteSoftTimer(SET_MMI_FAST_POWERON_IDLE_TIMER);
+}
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:ÉèÖÃ/»ñÈ¡µ±Ç°LCDģʽ
+***********************************************************************************/
+E_zMmi_Work_Mode mmi_get_lcd_mode(VOID)
+{
+ E_zMmi_Work_Mode tmpMode = MMI_ACTIVE_MODE;
+ mmi_getMutex(&g_mmi_lcdmode_mutex);
+ tmpMode = g_mmi_lcd_mode;
+ mmi_putMutex(&g_mmi_lcdmode_mutex);
+ return tmpMode;
+}
+
+VOID mmi_set_lcd_mode(E_zMmi_Work_Mode tmpMode)
+{
+ mmi_getMutex(&g_mmi_lcdmode_mutex);
+ g_mmi_lcd_mode = tmpMode;
+ mmi_putMutex(&g_mmi_lcdmode_mutex);
+}
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:ÉèÖÃ/»ñÈ¡µ±Ç°LEDģʽ
+***********************************************************************************/
+E_zMmi_Work_Mode mmi_get_led_mode(VOID)
+{
+ E_zMmi_Work_Mode tmpMode = MMI_ACTIVE_MODE;
+ mmi_getMutex(&g_mmi_ledmode_mutex);
+ tmpMode = g_mmi_led_mode;
+ mmi_putMutex(&g_mmi_ledmode_mutex);
+ return tmpMode;
+}
+
+VOID mmi_set_led_mode(E_zMmi_Work_Mode tmpMode)
+{
+ mmi_getMutex(&g_mmi_ledmode_mutex);
+ g_mmi_led_mode = tmpMode;
+ mmi_putMutex(&g_mmi_ledmode_mutex);
+}
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:½«MMIÉèΪæµ״̬
+***********************************************************************************/
+VOID mmi_set_mode_active(VOID)
+{
+ if (g_showMode == MMI_MODE_LCD || g_showMode == MMI_MODE_ALL) {
+ E_zMmi_Work_Mode lcd_mode = mmi_get_lcd_mode();
+ if (lcd_mode == MMI_BACKLIGHT_OFF_MODE || lcd_mode == MMI_BACKLIGHT_HALFBRIGHT_MODE) {
+ mmi_set_lcd_mode(MMI_ACTIVE_MODE);
+ mmi_set_update_flag(MMI_TASK_CTRL);
+ }
+ }
+ if (g_showMode == MMI_MODE_LED || g_showMode == MMI_MODE_ALL) {
+ E_zMmi_Work_Mode led_mode = mmi_get_led_mode();
+ if (led_mode == MMI_IDLE_LEDOFF_MODE || led_mode == MMI_IDLE_STANDBY_LEDOFF_MODE || led_mode == MMI_IDLE_CHG_LEDOFF_MODE) {
+ mmi_set_led_mode(MMI_ACTIVE_MODE);
+ mmi_set_update_flag(MMI_TASK_CTRL);
+ }
+ }
+}
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:MMIÊ¡µçʱµÄÏà¹Ø¶¨Ê±Æ÷reset£¬°´¼üºÍUSB²å°Îʱµ÷ÓÃ
+***********************************************************************************/
+VOID mmi_reset_idle_timer(VOID)
+{
+ if (g_showMode == MMI_MODE_LCD || g_showMode == MMI_MODE_ALL) {
+ mmi_idle_halfbright_timer_stop();
+ }
+ mmi_idle_timer_stop();
+ mmi_idle_timer_create();
+}
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:¿ìËٹػúʱÈôÓа´¼ü²Ù×÷£¬MMIÊ¡µçʱµÄÏà¹Ø¶¨Ê±Æ÷reset£¬°´¼üʱµ÷ÓÃ
+***********************************************************************************/
+VOID mmi_reset_fast_poweron_idle_timer(VOID)
+{
+ mmi_fast_poweron_idle_timer_stop();
+ mmi_fast_poweron_idle_timer_create();
+}
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:MMIÊ¡µçʱµÄÏà¹Ø¶¨Ê±Æ÷KILL£¬ ¹Ø»úºÍÖØÆôʱµ÷ÓÃ
+***********************************************************************************/
+VOID mmi_kill_idle_timer(VOID)
+{
+ if (g_showMode == MMI_MODE_LCD || g_showMode == MMI_MODE_ALL) {
+ mmi_idle_halfbright_timer_stop();
+ }
+ mmi_idle_timer_stop();
+ mmi_fast_poweron_idle_timer_stop();
+}
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:³õʼ»¯MMIÊ¡µç¹ÜÀí
+***********************************************************************************/
+VOID mmi_init_idle_control(VOID)
+{
+ mmi_idle_timer_create();
+}
+
diff --git a/lynq/R305/ap/app/zte_comm/zte_mmi/mmi_wifi.c b/lynq/R305/ap/app/zte_comm/zte_mmi/mmi_wifi.c
new file mode 100755
index 0000000..7f26c30
--- /dev/null
+++ b/lynq/R305/ap/app/zte_comm/zte_mmi/mmi_wifi.c
@@ -0,0 +1,857 @@
+/*****************************************************************************
+* °æ±¾ËùÓÐ (C)ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾
+* Ä£¿éÃû £ºMMI
+* ÎļþÃû £ºmmi_wifi.c
+* Îļþ±êʶ £º
+* Ïà¹ØÎļþ £º
+* ʵÏÖ¹¦ÄÜ £ºMMI wifiµÆ²Ù×÷
+* ×÷Õß £º
+* °æ±¾ £ºV1.0
+* Íê³ÉÈÕÆÚ £º2014-6-20
+* ÆäËü˵Ã÷ £º
+*
+*******************************************************************************/
+#include <sys/inotify.h>
+#include <limits.h>
+#include "mmi_common.h"
+#include "mmi_lcd.h"
+#include "wlan_interface.h"
+
+/*****************************************************************************
+ È«¾Ö±äÁ¿¶¨Òå
+******************************************************************************/
+static BOOL s_mmi_wifiState = FALSE;//´Ó¼à¿ØÎļþÖлñÈ¡µÄwifi״̬
+static BOOL s_mmi_wifidata_state = FALSE;//ÅжÏlan¿ÚÊÇ·ñÓÐÊý¾Ý´«Êä
+static E_zMmi_WpsAct_Tip s_mmi_wpsState = WPS_ACTIVE_MAX;//´Ó¼à¿ØÎļþÖлñÈ¡µÄwps״̬
+static BOOL g_wps_switch_ssid_show = TRUE;
+static BOOL g_wifi_code_show_flag = FALSE;//±ê¼Çwifi¶þάÂëÊÇ·ñ´æÔÚ
+static SINT32 s_mmi_wifi_connect_num = 0; //Óû§Á¬½ÓÊý
+static SINT32 s_mmi_wifi_connect_numEx = 0;
+static SINT32 s_mmi_Isconnected_user = 0; //ÊÇ·ñÓÐÓû§Á¬½Ówifi 1:ÓÐ 0:ûÓÐ
+static BOOL s_mmi_qrcode_exist = FALSE; //¶þάÂëÊÇ·ñ´æÔÚ
+static BOOL s_mmi_qrcode_existPre = FALSE; //±£´æ¶þλÉÏÒ»´Î¶þάÂëÊÇ·ñ´æÔÚ
+static BOOL s_mmi_wifiStationConnected = FALSE;//wifistationÊÇ·ñ´æÔÚ
+static SINT32 s_mmi_wifistation_signal_num = 0; //wifistationÐźŸñÊý
+static char s_mmi_wifistation_ssid[64] = {0};//wifistation¶ÔÓ¦µÄssid
+extern BOOL g_mmi_key_longpress_flag;
+
+long long s_mmi_wifidata0_lastsend = 0;//wif¶Ë¿Úva0ÉÏÒ»´ÎµÄ·¢ËÍÊý¾Ý
+long long s_mmi_wifidata0_lastrecv = 0;//wif¶Ë¿Úva0ÉÏÒ»´ÎµÄ½ÓÊÕÊý¾Ý
+long long s_mmi_wifidata1_lastsend = 0;//wif¶Ë¿Úva0ÉÏÒ»´ÎµÄ·¢ËÍÊý¾Ý
+long long s_mmi_wifidata1_lastrecv = 0;//wif¶Ë¿Úva0ÉÏÒ»´ÎµÄ½ÓÊÕÊý¾Ý
+
+struct st_files file_wd[WD_NUM];
+extern E_zMmiShowMode g_showMode;
+extern UINT32 g_led_standby_mode;
+extern UINT32 g_led_sleep_mode;
+extern UINT32 g_use_wifi_usernum;
+extern int g_customer_type;
+SINT32 mmi_get_wifiinfo(UINT32 wifiinfo)
+{
+ if (wifiinfo != 0) {
+ T_zMMIWifiInfo * pWifiInfo = (T_zMMIWifiInfo *)wifiinfo;
+ pWifiInfo->wifi_state = s_mmi_wifiState;
+ pWifiInfo->wifidata_state = s_mmi_wifidata_state;
+ pWifiInfo->wps_state = s_mmi_wpsState;
+ pWifiInfo->Isconnected_user = s_mmi_Isconnected_user;
+ pWifiInfo->connected_userNum = s_mmi_wifi_connect_num;
+ }
+ return MMI_SUCCESS;
+}
+
+SINT32 mmi_get_wificodeinfo(UINT32 wificodeinfo)
+{
+ if (wificodeinfo != 0) {
+ T_zMMIWifiCodeInfo * pWifiCodeInfo = (T_zMMIWifiCodeInfo *)wificodeinfo;
+ pWifiCodeInfo->multi_ssid_switch = mmi_get_multi_ssid_switch_flag();
+ pWifiCodeInfo->is_wificode_exist = s_mmi_qrcode_exist;
+ }
+ return MMI_SUCCESS;
+}
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:»ñÈ¡wifiStationÁ¬½Ó״̬
+***********************************************************************************/
+BOOL mmi_get_wifiStationConnect_state()
+{
+ return s_mmi_wifiStationConnected;
+}
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:»ñÈ¡wifiStationÁ¬½ÓºóÐźÅÇ¿¶ÈÐÅÏ¢
+***********************************************************************************/
+SINT32 mmi_get_wifiStation_signalNum()
+{
+ return s_mmi_wifistation_signal_num;
+}
+
+static VOID mmi_get_wifiStation_ssid_from_nv()
+{
+ cfg_get_item(NV_WIFISTA_SSID, s_mmi_wifistation_ssid, sizeof(s_mmi_wifistation_ssid));
+}
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:»ñÈ¡WifiStationÐÅϢģ¿é
+***********************************************************************************/
+SINT32 mmi_get_wifistationinfo(UINT32 wifistationinfo)
+{
+ if (wifistationinfo != 0) {
+ T_zMMIWifiStationInfo * pWifiStationInfo = (T_zMMIWifiStationInfo *)wifistationinfo;
+ pWifiStationInfo->wifistation_connect_state = mmi_get_wifiStationConnect_state();
+ pWifiStationInfo->signal_num = mmi_get_wifiStation_signalNum();
+ pWifiStationInfo->wifista_ssid = s_mmi_wifistation_ssid;
+ }
+ return MMI_SUCCESS;
+}
+
+
+SINT32 mmi_RegisterWifiTaskInfoItem()
+{
+ T_zMMITaskInfoItem wifiInfoItem = {0};
+ wifiInfoItem.task = MMI_TASK_WIFI;
+ wifiInfoItem.taskinfo = (VOID *)malloc(sizeof(T_zMMIWifiInfo));
+ wifiInfoItem.get_taskinfo_fun = mmi_get_wifiinfo;
+#ifndef DISABLE_LCD
+ wifiInfoItem.get_lcdinfo_fun = mmi_getLcdWifiInfo;
+#endif
+ wifiInfoItem.get_ledinfo_fun = mmi_getLedWifiInfo;
+ wifiInfoItem.ledinfo = (VOID *)malloc(sizeof(T_zMmi_Led_Info));
+ //wifiAppInfoItem.show_mode = 2;
+ mmi_register_taskinfo_item(&wifiInfoItem);
+ return MMI_SUCCESS;
+}
+
+SINT32 mmi_RegisterWpsTaskInfoItem()
+{
+ T_zMMITaskInfoItem wifiInfoItem = {0};
+ wifiInfoItem.task = MMI_TASK_LED_WPS;
+ wifiInfoItem.taskinfo = (VOID *)malloc(sizeof(T_zMMIWifiInfo));
+ wifiInfoItem.get_taskinfo_fun = mmi_get_wifiinfo;
+#ifndef DISABLE_LCD
+ //wifiInfoItem.get_lcdinfo_fun = mmi_getLcdWifiInfo;
+#endif
+ wifiInfoItem.get_ledinfo_fun = mmi_getLedWpsInfo;
+ wifiInfoItem.ledinfo = (VOID *)malloc(sizeof(T_zMmi_Led_Info));
+ //wifiAppInfoItem.show_mode = 2;
+ mmi_register_taskinfo_item(&wifiInfoItem);
+ return MMI_SUCCESS;
+}
+
+
+SINT32 mmi_RegisterWifiCodeTaskInfoItem()
+{
+ T_zMMITaskInfoItem wifiInfoItem = {0};
+ wifiInfoItem.task = MMI_TASK_WIFICODE;
+ wifiInfoItem.taskinfo = (VOID *)malloc(sizeof(T_zMMIWifiInfo));
+ wifiInfoItem.get_taskinfo_fun = mmi_get_wificodeinfo;
+#ifndef DISABLE_LCD
+ wifiInfoItem.get_lcdinfo_fun = mmi_getLcdWifiCodeInfo;
+#endif
+ wifiInfoItem.ledinfo = (VOID *)malloc(sizeof(T_zMmi_Led_Info));
+ //wifiAppInfoItem.show_mode = 2;
+ mmi_register_taskinfo_item(&wifiInfoItem);
+ return MMI_SUCCESS;
+}
+/**********************************************************************************
+º¯Êý×÷ÓÃ:×¢²áwifiStationÐÅϢģ¿é
+***********************************************************************************/
+SINT32 mmi_RegisterTipWifiStationConnectTaskInfoItem()
+{
+ T_zMMITaskInfoItem wifiStationInfoItem = {0};
+ wifiStationInfoItem.task = MMI_TASK_TIP_WIFISTATION;
+ wifiStationInfoItem.taskinfo = (VOID *)malloc(sizeof(T_zMMIWifiStationInfo));
+ wifiStationInfoItem.get_taskinfo_fun = mmi_get_wifistationinfo;
+#ifndef DISABLE_LCD
+ wifiStationInfoItem.get_lcdinfo_fun = mmi_getLcdWifiStationInfo;
+#endif
+ //wifiStationInfoItem.show_mode = 2;
+ mmi_register_taskinfo_item(&wifiStationInfoItem);
+ return MMI_SUCCESS;
+}
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:×¢²áWPSÌáʾģ¿é
+***********************************************************************************/
+SINT32 mmi_RegisterTipWpsTaskInfoItem()
+{
+ T_zMMITaskInfoItem wpsInfoItem = {0};
+ wpsInfoItem.task = MMI_TASK_TIP_WPS;
+ wpsInfoItem.taskinfo = (VOID *)malloc(sizeof(T_zMMIWifiInfo));
+ wpsInfoItem.get_taskinfo_fun = mmi_get_wifiinfo;
+#ifndef DISABLE_LCD
+ wpsInfoItem.get_lcdinfo_fun = mmi_getLcdTipWpsInfo;
+#endif
+ //wpsInfoItem.show_mode = 2;
+ mmi_register_taskinfo_item(&wpsInfoItem);
+ return MMI_SUCCESS;
+}
+
+static VOID mmi_set_wifi_update()
+{
+ if (g_showMode == MMI_MODE_LCD || g_showMode == MMI_MODE_ALL) {
+ mmi_set_update_flag(MMI_TASK_WIFI);
+ }
+ if (g_showMode == MMI_MODE_LED || g_showMode == MMI_MODE_ALL) {
+ E_zMmi_Work_Mode mode = mmi_get_led_mode();
+ if (mode != MMI_IDLE_LEDOFF_MODE && mode != MMI_IDLE_CHG_LEDOFF_MODE
+ && mode != MMI_FAKE_POWEROFF_MODE && mode != MMI_FAKE_POWEROFF_CHARGE_MODE && mode != MMI_IDLE_STANDBY_LEDOFF_MODE) {
+ mmi_set_update_flag(MMI_TASK_WIFI);
+ }
+ }
+}
+
+
+/***********************************************************************************
+ º¯Êý×÷ÓÃ:ÊÇ·ñÏÔʾwifi ¶þάÂë
+***********************************************************************************/
+VOID mmi_set_wificode_show_flag(BOOL flag)
+{
+ g_wifi_code_show_flag = flag;
+}
+
+BOOL mmi_get_wificode_show_flag(VOID)
+{
+ return g_wifi_code_show_flag;
+}
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:»ñÈ¡wifi/wps״̬
+***********************************************************************************/
+BOOL mmi_get_wifi_state()
+{
+ return s_mmi_wifiState;
+}
+
+E_zMmi_WpsAct_Tip mmi_get_wps_state()
+{
+ return s_mmi_wpsState;
+}
+
+void mmi_ms_sleep(unsigned long mSec)
+{
+
+ struct timeval tv;
+ tv.tv_sec = mSec / 1000;
+ tv.tv_usec = (mSec % 1000) * 1000;
+ int err;
+ do {
+ err = select(0, NULL, NULL, NULL, &tv);
+ } while (err < 0 && errno == EINTR);
+
+}
+
+/***********************************************************************************
+ º¯Êý×÷ÓÃ:WIFI¿ª¹Ø
+***********************************************************************************/
+VOID mmi_wifi_operate(char* mode)
+{
+ char wifi_mode[2] = {0};
+ cfg_get_item(WLAN_NV_CUR_STATE, wifi_mode, 2);
+ slog(MMI_PRINT, SLOG_NORMAL, "ZTE_MMI handle_wifi_opt mode = %s RadioOff=%s\n", mode, wifi_mode);
+ if (!strcmp(mode, WIFI_TURN_OFF_FAKE_POWEROFF)) {
+ if (g_mmi_key_longpress_flag) {
+ g_mmi_key_longpress_flag = FALSE;
+
+ int wait_times = 0;
+ char wifi_process_state[11] = {0};
+ cfg_get_item(WLAN_NV_PROCESS_STATE, wifi_process_state, 11);
+ //¿ìËÙ¿ª¹Ø»úʱ²Ù×÷¹ý¿ìwifi״̬»áÂÒµô£¬Ôڴ˼ӵȴýwifi¿ª¹Ø²Ù×÷½áÊø
+ while (wait_times < 100 && !strcmp(wifi_process_state, "processing")) {
+ wait_times++;
+ mmi_ms_sleep(30);
+ cfg_get_item(WLAN_NV_PROCESS_STATE, wifi_process_state, 11);
+ }
+ slog(MMI_PRINT, SLOG_DEBUG, "ZTE_MMI wait for wifi processing end wait_times = %d\n", wait_times);
+ }
+ cfg_get_item(WLAN_NV_CUR_STATE, wifi_mode, 2);
+ if (!strcmp(wifi_mode, WIFI_OPENED)) {
+ slog(MMI_PRINT, SLOG_NORMAL, "ZTE_MMI handle_wifi_opt FAKE_POWEROFF\n");
+ ipc_send_message(MODULE_ID_MMI, MODULE_ID_WIFI, (USHORT)MSG_CMD_WIFI_CLOSE, NULL, NULL, 0);
+ }
+ } else {
+ if (strcmp(wifi_mode, mode)) {
+ if (strcmp(wifi_mode, WIFI_OPENED) == 0) {
+ slog(MMI_PRINT, SLOG_NORMAL, "ZTE_MMI handle_wifi_opt mode close wifi\n");
+ ipc_send_message(MODULE_ID_MMI, MODULE_ID_WIFI, (USHORT)MSG_CMD_WIFI_CLOSE, NULL, NULL, 0); //ÏòWIFI·¢Ë͹رÕÏûÏ¢
+ } else if (strcmp(wifi_mode, WIFI_CLOSED) == 0) {
+ slog(MMI_PRINT, SLOG_NORMAL, "ZTE_MMI handle_wifi_opt mode open wifi\n");
+ ipc_send_message(MODULE_ID_MMI, MODULE_ID_WIFI, (USHORT)MSG_CMD_WIFI_OPEN, NULL, NULL, 0); //ÏòWIFI·¢ËÍ»½ÐÑÏûÏ¢
+ }
+ }
+ }
+}
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:wps¼¤»î»òÈ¥¼¤»î³É¹¦ºóÏÔʾ2Ã붨ʱÆ÷
+***********************************************************************************/
+static VOID * mmi_wps_tip_check_timer_cb(VOID *arg)
+{
+ s_mmi_wpsState = WPS_ACTIVE_MAX;
+ mmi_set_update_flag(MMI_TASK_TIP);
+ return NULL;
+}
+
+static VOID mmi_wps_tip_timer_start(VOID)
+{
+ int ret = -1;
+ ret = CreateSoftTimer(SET_WPS_TIP_CHECK_TIMER, TIMER_FLAG_ONCE, SET_WPS_TIP_CHECK_TIME, &mmi_wps_tip_check_timer_cb, NULL);
+ if (ret != 0) {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI mmi_wps_tip_timer_start FAILED\n");
+ }
+}
+
+static VOID mmi_wps_tip_timer_stop(VOID)
+{
+ DeleteSoftTimer(SET_WPS_TIP_CHECK_TIMER);
+}
+
+VOID mmi_wps_operate(VOID)
+{
+ char authmode[16] = {0};
+ char hidessid[2] = {0};
+ char encrypType[16] = {0};
+ char WscModeOption[2] = {0};
+ char wps_mode[10] = {0};
+ long lRet = -1;
+ cfg_get_item(WLAN_NV_AUTHMODE_NAME, authmode, sizeof(authmode));
+ cfg_get_item(WLAN_NV_AP_HIDESSID_NAME, hidessid, sizeof(hidessid));
+ cfg_get_item(WLAN_NV_ENCRYP_TYPE_NAME, encrypType, sizeof(encrypType));
+ cfg_get_item(WLAN_NV_WSC_MODE_NAME, WscModeOption, sizeof(WscModeOption));
+ //unsupported auth type, syn from wifi.js
+ if ((!strcmp(hidessid, "1"))
+ || ((!strcmp(authmode, "OPEN")) && (!strcmp(encrypType, "WEP")))
+ || ((!strcmp(authmode, "SHARED")) && (!strcmp(encrypType, "WEP")))
+ || ((!strcmp(authmode, "WPAPSK")) && (!strcmp(encrypType, "TKIP")))
+ || ((!strcmp(authmode, "WPAPSK")) && (!strcmp(encrypType, "AES")))
+ || ((!strcmp(authmode, "WPAPSK")) && (!strcmp(encrypType, "TKIPCCMP")))
+ || ((!strcmp(authmode, "WPA2PSK")) && (!strcmp(encrypType, "TKIP")))
+ || ((!strcmp(authmode, "WPAPSKWPA2PSK")) && (!strcmp(encrypType, "TKIP")))
+ || (!strcmp(authmode, "WPA3Personal"))
+ || (!strcmp(authmode, "WPA2WPA3"))) {
+ slog(MMI_PRINT, SLOG_NORMAL, "ZTE_MMI mmi_wps_operate authmode = %s, encryptype = %s, hidessid = %s \n", authmode, encrypType, hidessid);
+ s_mmi_wpsState = WPS_FAIL;
+ mmi_wps_tip_timer_start();
+ mmi_set_wifi_update();
+ mmi_set_update_flag(MMI_TASK_TIP_WPS);
+ mmi_set_update_flag(MMI_TASK_LED_WPS);
+ return;
+ }
+
+ slog(MMI_PRINT, SLOG_DEBUG, "ZTE_MMI mmi_wps_operate authmode = %s, encryptype = %s, hidessid = %s \n", authmode, encrypType, hidessid);
+ if (mmi_get_wifi_state() && (mmi_get_wps_state() == WPS_ACTIVE_MAX)) { //³¤°´Æô¶¯WPS
+ strncpy(wps_mode, "PBC", 9);
+
+ if (!strcmp(WscModeOption, "1")) {
+ return;
+ }
+ cfg_set(WLAN_NV_WSC_MODE_NAME, "1");
+ cfg_set(WLAM_NV_WPS_MODE_NAME, wps_mode);
+ lRet = ipc_send_message(MODULE_ID_MMI, MODULE_ID_WIFI, (USHORT)MSG_CMD_WIFI_WPS, 0, NULL, 0);
+ if (0 == lRet) {
+ slog(MMI_PRINT, SLOG_NORMAL, "ZTE_MMI mmi_wps_operate send to wifi ok \n");
+ //send_rsp_str_to_farps(MODULE_ID_MMI, "\r\n+TKEYEVENT: wps actived\r\n", strlen("\r\n+TKEYEVENT: wps actived\r\n"));
+ ipc_send_message(MODULE_ID_MMI, MODULE_ID_AT_CTL, MSG_CMD_SEND_RSP_TO_OUTSIDE, strlen("\r\n+TKEYEVENT: wps actived\r\n"), "\r\n+TKEYEVENT: wps actived\r\n", 0);
+ }
+ }
+}
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:ͨ¹ýnv»ñÈ¡Ö÷¡¢¸±SSIDµÄwifiÓû§Á¬½ÓÊý
+***********************************************************************************/
+static VOID mmi_get_wifi_stanum(VOID)
+{
+ char va0_wifi_num[8] = {0};
+ char va1_wifi_num[8] = {0};
+ SINT32 wifi_num = 0;
+ SINT32 m_wifi_num = 0;
+ cfg_get_item(WLAN_NV_VA0_WIIF_NUM, va0_wifi_num, sizeof(va0_wifi_num));
+ cfg_get_item(WLAN_NV_VA1_WIIF_NUM, va1_wifi_num, sizeof(va1_wifi_num));
+ wifi_num = atoi(va0_wifi_num);
+ m_wifi_num = atoi(va1_wifi_num);
+ if ((wifi_num < 0 || wifi_num > INT_MAX-1) ||
+ (m_wifi_num < 0 || m_wifi_num > INT_MAX-1)){//kw 3, 0~32?
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI mmi_get_wifi_stanum wifi_num = %d, m_wifi_num = %d\n", wifi_num, m_wifi_num);
+ return;
+ }
+ s_mmi_wifi_connect_num = wifi_num + m_wifi_num;
+ slog(MMI_PRINT, SLOG_DEBUG, "ZTE_MMI mmi_get_wifi_stanum wifi_num = %d,m_wifi_num = %d, s_mmi_wifi_connect_num = %d \n", wifi_num, m_wifi_num, s_mmi_wifi_connect_num);
+}
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:²éѯwifi Á¬½ÓÊý¶¨Ê±Æ÷»Øµ÷
+***********************************************************************************/
+SINT32 zMMI_Handle_Msg_Get_Wifi_StaNum(VOID *data)
+{
+ //#if MMI_USE_WIFI_USERNUM
+ if (g_use_wifi_usernum) {
+#if 0
+ s_mmi_wifi_connect_num = zte_wlan_capture_sta_num();
+ if (s_mmi_wifi_connect_num != 0 && s_mmi_wifi_connect_numEx == 0) {
+ slog(MMI_PRINT, SLOG_DEBUG, "ZTE_MMI zMMI_Get_wifi_Stanum_Callback s_mmi_connected_user = 1!!!\n");
+ s_mmi_Isconnected_user = 1;
+ } else if (s_mmi_wifi_connect_num == 0 && s_mmi_wifi_connect_numEx != 0) {
+ slog(MMI_PRINT, SLOG_DEBUG, "ZTE_MMI zMMI_Get_wifi_Stanum_Callback s_mmi_connected_user = 0!!!\n");
+ s_mmi_Isconnected_user = 0;
+ }
+ s_mmi_wifi_connect_numEx = s_mmi_wifi_connect_num;
+ mmi_set_wifi_update();
+#else
+ SINT32 va_state = -1;
+ va_state = *(SINT32*)data;
+ slog(MMI_PRINT, SLOG_DEBUG, "ZTE_MMI zMMI_Handle_Msg_Get_Wifi_StaNum va_state = %d\n", va_state);
+ mmi_get_wifi_stanum();
+ mmi_set_wifi_update();
+#endif
+ }
+ //#endif
+ return 0;
+}
+
+static VOID * mmi_wifi_stanum_timer_cb(VOID *arg)
+{
+ if (s_mmi_wifiState) {
+ ipc_send_message(MODULE_ID_MMI, MODULE_ID_MMI, (USHORT)MSG_CMD_MMIGET_WIFI_STANUM, 0, NULL, 0);
+ }
+ return NULL;
+}
+
+
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:²éѯwifi Á¬½ÓÊý¶¨Ê±Æ÷ 3S
+***********************************************************************************/
+static VOID mmi_wifi_stanum_timer_create(VOID)
+{
+ int ret = -1;
+ ret = CreateSoftTimer(SET_WIFI_STANUM_CHECK_TIMER, TIMER_FLAG_RESTART, SET_WIFI_STANUM_CHECK_TIME, &mmi_wifi_stanum_timer_cb, NULL);
+ if (ret != 0) {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI mmi_wifi_stanum_timer_create FAILED\n");
+ }
+}
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:²éѯwifi Êý¾Ý´«Ê䶨ʱÆ÷»Øµ÷
+***********************************************************************************/
+SINT32 zMMI_Handle_Msg_Get_Wifi_Data(VOID *data)
+{
+ unsigned long long s_mmi_wifidata0_send = 0, s_mmi_wifidata0_recv = 0;
+ unsigned long long s_mmi_wifidata1_send = 0, s_mmi_wifidata1_recv = 0;
+ getIfStatistic(WIFI_DATA_VA0, WIFI_TXBYTE, &s_mmi_wifidata0_send); //¶ÁÈ¡wif¶Ë¿Úva0µÄ·¢ËÍÊý¾Ý
+ getIfStatistic(WIFI_DATA_VA0, WIFI_RXBYTE, &s_mmi_wifidata0_recv); //¶ÁÈ¡wif¶Ë¿Úva0µÄ½ÓÊÕÊý¾Ý
+ if(g_customer_type == CUSTOMER_SDK_MIN)
+ {
+ getIfStatistic("wlan0", WIFI_TXBYTE, &s_mmi_wifidata1_send); //¶ÁÈ¡wif¶Ë¿Úva1µÄ·¢ËÍÊý¾Ý
+ getIfStatistic("wlan0", WIFI_RXBYTE, &s_mmi_wifidata1_recv); //¶ÁÈ¡wif¶Ë¿Úva1µÄ½ÓÊÕÊý¾Ý
+ }
+ else
+ {
+ getIfStatistic(WIFI_DATA_VA1, WIFI_TXBYTE, &s_mmi_wifidata1_send); //¶ÁÈ¡wif¶Ë¿Úva1µÄ·¢ËÍÊý¾Ý
+ getIfStatistic(WIFI_DATA_VA1, WIFI_RXBYTE, &s_mmi_wifidata1_recv); //¶ÁÈ¡wif¶Ë¿Úva1µÄ½ÓÊÕÊý¾Ý
+ }
+#if 0 //kw 3
+ if (s_mmi_wifidata0_send == -1 || s_mmi_wifidata0_recv == -1 || s_mmi_wifidata1_send == -1 || s_mmi_wifidata1_recv == -1) {
+ s_mmi_wifidata_state = FALSE;
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI mmi_wifi_data_timer_cb invalid wifi data!\n");
+ s_mmi_wifidata0_lastsend = 0;
+ s_mmi_wifidata0_lastrecv = 0;
+ s_mmi_wifidata1_lastsend = 0;
+ s_mmi_wifidata1_lastrecv = 0;
+ mmi_set_wifi_update();
+ return 0;
+ } else
+#endif
+ if ((s_mmi_wifidata0_send != s_mmi_wifidata0_lastsend) || (s_mmi_wifidata0_recv != s_mmi_wifidata0_lastrecv)
+ || (s_mmi_wifidata1_send != s_mmi_wifidata1_lastsend) || (s_mmi_wifidata1_recv != s_mmi_wifidata1_lastrecv)) {
+ s_mmi_wifidata_state = TRUE; //ÓÐÊý¾Ý´«Êä
+ slog(MMI_PRINT, SLOG_DEBUG, "ZTE_MMI mmi_wifi_data_timer_cb having data transfer!\n");
+ } else {
+ s_mmi_wifidata_state = FALSE;
+ slog(MMI_PRINT, SLOG_DEBUG, "ZTE_MMI mmi_wifi_data_timer_cb no data transfer!\n");
+ }
+ s_mmi_wifidata0_lastsend = s_mmi_wifidata0_send;
+ s_mmi_wifidata0_lastrecv = s_mmi_wifidata0_recv;
+ s_mmi_wifidata1_lastsend = s_mmi_wifidata1_send;
+ s_mmi_wifidata1_lastrecv = s_mmi_wifidata1_recv;
+ if(g_customer_type == CUSTOMER_SDK_MIN && s_mmi_wpsState == WPS_ACTIVING) {
+ s_mmi_wifidata_state = TRUE; //ÀÖоwpsʱwlan0ÎÞÊý¾Ý
+ }
+ mmi_set_wifi_update();
+ return 0;
+}
+
+static VOID * mmi_wifi_data_timer_cb(VOID *arg)
+{
+ if (s_mmi_wifiState) {
+ ipc_send_message(MODULE_ID_MMI, MODULE_ID_MMI, (USHORT)MSG_CMD_MMIGET_WIFI_DATA, 0, NULL, 0);
+ }
+ return NULL;
+}
+
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:²éѯwifi ÊÇ·ñÓÐÊý¾Ý´«Ê䶨ʱÆ÷ 3S
+***********************************************************************************/
+static VOID mmi_wifi_data_timer_create(VOID)
+{
+ int ret = -1;
+ ret = CreateSoftTimer(SET_WIFI_DATA_CHECK_TIMER, TIMER_FLAG_RESTART, SET_WIFI_DATA_CHECK_TIME, &mmi_wifi_data_timer_cb, NULL);
+ if (ret != 0) {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI mmi_wifi_data_timer_create FAILED\n");
+ }
+}
+
+static VOID mmi_wifi_data_timer_stop(VOID)
+{
+ DeleteSoftTimer(SET_WIFI_DATA_CHECK_TIMER);
+}
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:¶þάÂëÊÇ·ñ´æÔÚ״̬ÉèÖÃ
+***********************************************************************************/
+SINT32 mmi_set_qrcode_state()
+{
+ char buf_qrcode[8] = {0};
+ FILE* fd_qrcode = NULL;
+ int len = 0;
+
+
+ fd_qrcode = fopen(QRCODE_STATE_PATH, "r");
+ if (fd_qrcode == NULL) {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI mmi_set_qrcode_state open qrcode file fail!\n");
+ perror(QRCODE_STATE_PATH);
+ return 0;
+ }
+ len = fread(buf_qrcode, 1, 1, fd_qrcode);
+ if (len > 0) { //kw 3, have 0x0a
+ buf_qrcode[len] = '\0';
+ if (strcmp(buf_qrcode, "1") == 0) {
+ s_mmi_qrcode_exist = TRUE;
+ } else if (strcmp(buf_qrcode, "0") == 0) {
+ s_mmi_qrcode_exist = FALSE;
+ } else {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI qrcode file state error!\n");
+ }
+ } else {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI read qrcode file fail!\n");
+ }
+
+ fclose(fd_qrcode);
+
+ if (mmi_get_wificode_show_flag() == TRUE && s_mmi_qrcode_existPre == FALSE && s_mmi_qrcode_exist == TRUE) {
+ mmi_set_update_flag(MMI_TASK_WIFICODE);
+ }
+
+ s_mmi_qrcode_existPre = s_mmi_qrcode_exist;
+ return 0;
+}
+
+BOOL mmi_get_qrcode_state()
+{
+ return s_mmi_qrcode_exist ;
+}
+/**********************************************************************************
+º¯Êý×÷ÓÃ:wifi¿ªÆô\¹Ø±Õ״̬ÉèÖÃ
+***********************************************************************************/
+VOID mmi_set_wifi_state(VOID)
+{
+ char buf_wifi[8] = {0};
+ FILE* fd_wifi = NULL;
+ int len = 0;
+
+ fd_wifi = fopen(WIFI_STATE_PATH, "r");
+ if (fd_wifi == NULL) {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI mmi_set_wifi_state open wifi file fail!\n");
+ perror(WIFI_STATE_PATH);
+ return;
+ }
+ len = fread(buf_wifi, 1, 1, fd_wifi);
+ if (len > 0) { //kw 3
+ buf_wifi[len] = '\0';
+ if (strcmp(buf_wifi, "1") == 0) {
+ s_mmi_wifiState = TRUE;
+ ipc_send_message(MODULE_ID_MMI, MODULE_ID_MMI, (USHORT)MSG_CMD_STA_COUNT_CHANGE, 0, NULL, 0);
+ } else if (strcmp(buf_wifi, "0") == 0) {
+ s_mmi_wifiState = FALSE;
+ s_mmi_wpsState = WPS_ACTIVE_MAX;
+ s_mmi_Isconnected_user = 0;
+ s_mmi_wifi_connect_num = 0;
+ //#if MMI_LED_STANDBY_MODE
+ if (g_led_standby_mode && mmi_get_led_mode() == MMI_IDLE_LEDOFF_MODE) {
+ mmi_set_led_mode(MMI_IDLE_STANDBY_LEDOFF_MODE);
+ mmi_set_update_flag(MMI_TASK_CTRL);
+ }
+ //#endif
+ } else {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI wifi file state error!\n");
+ }
+ } else {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI read wifi file fail!\n");
+ }
+
+ fclose(fd_wifi);
+}
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:wps¿ªÆô\¹Ø±Õ״̬ÉèÖÃ
+***********************************************************************************/
+static VOID mmi_set_wps_state(VOID)
+{
+ char buf_wps[8] = {0};
+ FILE* fd_wps = NULL;
+ int len = 0;
+
+
+ fd_wps = fopen(WPS_STATE_PATH, "r");
+ if (fd_wps == NULL) {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI mmi_set_wifi_state open wps file fail!\n");
+ perror(WPS_STATE_PATH);
+ return;
+ }
+ len = fread(buf_wps, 1, 1, fd_wps);
+ if (len > 0) { //kw 3
+ buf_wps[len] = '\0';
+ if (strcmp(buf_wps, "1") == 0) {
+ s_mmi_wpsState = WPS_ACTIVING;
+ } else if (strcmp(buf_wps, "0") == 0) {
+ s_mmi_wpsState = WPS_DEACTIVED;
+ mmi_wps_tip_timer_start();
+ } else {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI wps file state error!\n");
+ }
+ } else {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI read wps file fail!\n");
+ }
+
+ fclose(fd_wps);
+}
+
+static VOID mmi_set_wpsEx_state(VOID)
+{
+ char buf_wps[8] = {0};
+ FILE* fd_wps = NULL;
+ int len = 0;
+
+ fd_wps = fopen(WPS_STATEEX_PATH, "r");
+ if (fd_wps == NULL) {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI mmi_set_wifi_state open wpsEX file fail!\n");
+ perror(WPS_STATEEX_PATH);
+ return;
+ }
+ len = fread(buf_wps, 1, 1, fd_wps);
+ if (len > 0) { //kw 3
+ buf_wps[len] = '\0';
+ if (strcmp(buf_wps, "1") == 0) {
+ s_mmi_wpsState = WPS_ACTIVED;
+ mmi_wps_tip_timer_start();
+ } else if (strcmp(buf_wps, "2") == 0) {
+ s_mmi_wpsState = WPS_DEACTIVING;
+ } else {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI wps file state error!\n");
+ }
+ } else {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI read wps file fail!\n");
+ }
+
+ fclose(fd_wps);
+}
+/**********************************************************************************
+º¯Êý×÷ÓÃ:wifiStation¿ªÆô\¹Ø±Õ״̬ÉèÖÃ
+***********************************************************************************/
+VOID mmi_set_wifiStation_state(VOID)
+{
+ char buf_wifiStation[8] = {0};
+ FILE* fd_wifiStation = NULL;
+ int len = 0;
+
+
+ fd_wifiStation = fopen(WIFI_STATION_PATH, "r");
+ if (fd_wifiStation == NULL) {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI mmi_set_wifiStation_state open wifiStation file fail!\n");
+ perror(WIFI_STATION_PATH);
+ return;
+ }
+ len = fread(buf_wifiStation, 1, 1, fd_wifiStation);
+ if (len > 0) { //kw 3
+ buf_wifiStation[len] = '\0';
+ if (strcmp(buf_wifiStation, "F") == 0) {
+ s_mmi_wifiStationConnected = FALSE;
+ } else {
+ s_mmi_wifiStationConnected = TRUE;
+ mmi_get_wifiStation_ssid_from_nv();
+ if (strcmp(buf_wifiStation, "4") == 0) {
+ s_mmi_wifistation_signal_num = 4;
+ } else if (strcmp(buf_wifiStation, "3") == 0) {
+ s_mmi_wifistation_signal_num = 3;
+ } else if (strcmp(buf_wifiStation, "2") == 0) {
+ s_mmi_wifistation_signal_num = 2;
+ } else if (strcmp(buf_wifiStation, "1") == 0) { //cov m
+ s_mmi_wifistation_signal_num = 1;
+ } else if (strcmp(buf_wifiStation, "0") == 0) {
+ s_mmi_wifistation_signal_num = 0;
+ } else {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI wifiStation file state error!\n");
+ }
+ }
+ } else {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI read wifiStation file fail!\n");
+ }
+ fclose(fd_wifiStation);
+}
+
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:wifiָʾµÆÏß³ÌÈë¿Úº¯Êý
+***********************************************************************************/
+static void mmi_wifiwps_file_operate(char *filename)
+{
+ if (filename == NULL) {
+ return;
+ }
+ if (strcmp(filename, WIFI_STATE_PATH) == 0) {
+ mmi_set_wifi_state();
+ mmi_set_wifi_update();
+ mmi_set_update_flag(MMI_TASK_LED_WPS);
+ } else if (strcmp(filename, WPS_STATE_PATH) == 0) {
+ mmi_set_wps_state();
+ mmi_set_wifi_update();
+ mmi_set_update_flag(MMI_TASK_TIP_WPS);
+ mmi_set_update_flag(MMI_TASK_LED_WPS);
+ } else if (strcmp(filename, WPS_STATEEX_PATH) == 0) {
+ mmi_set_wpsEx_state();
+ mmi_set_wifi_update();
+ mmi_set_update_flag(MMI_TASK_TIP_WPS);
+ mmi_set_update_flag(MMI_TASK_LED_WPS);
+ } else if (strcmp(filename, QRCODE_STATE_PATH) == 0) {
+ mmi_set_qrcode_state();
+ } else if (strcmp(filename, WIFI_STATION_PATH) == 0) {
+ mmi_set_wifiStation_state();
+ mmi_set_update_flag(MMI_TASK_TIP_WIFISTATION);
+ }
+}
+
+void *mmi_wifi_thread_function(void *arg)
+{
+ int fd = -1;
+ int wd;
+ char buffer[1024] = {0};
+ char *offset = NULL;
+ struct inotify_event *event = NULL;
+ int len = 0;
+ int tmp_len = 0;
+ int offs_len = 0;
+ int i = 0;
+
+ fd = inotify_init();
+ if (fd < 0) {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI fail to inotify_init\n");
+ assert(0);
+ }
+ prctl(PR_SET_NAME, "mmiwificheck", 0, 0, 0);
+ file_wd[0].filename = WIFI_STATE_PATH;
+ wd = inotify_add_watch(fd, file_wd[0].filename, IN_CLOSE_WRITE);
+ if (wd < 0) {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI can't add watch for %s\n", file_wd[0].filename);
+ }
+ file_wd[0].wd = wd;
+
+ file_wd[1].filename = WPS_STATE_PATH;
+ wd = inotify_add_watch(fd, file_wd[1].filename, IN_CLOSE_WRITE);
+ if (wd < 0) {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI can't add watch for %s\n", file_wd[1].filename);
+ }
+ file_wd[1].wd = wd;
+
+ file_wd[3].filename = WPS_STATEEX_PATH;
+ wd = inotify_add_watch(fd, file_wd[3].filename, IN_CLOSE_WRITE);
+ if (wd < 0) {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI can't add watch for %s\n", file_wd[3].filename);
+ }
+ file_wd[3].wd = wd;
+
+#ifndef DISABLE_LCD
+ if (g_showMode == MMI_MODE_LCD || g_showMode == MMI_MODE_ALL) {
+ file_wd[2].filename = QRCODE_STATE_PATH;
+ wd = inotify_add_watch(fd, file_wd[2].filename, IN_CLOSE_WRITE);
+ if (wd < 0) {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI can't add watch for %s\n", file_wd[2].filename);
+ }
+ file_wd[2].wd = wd;
+
+ file_wd[4].filename = WIFI_STATION_PATH;
+ wd = inotify_add_watch(fd, file_wd[4].filename, IN_CLOSE_WRITE);
+ if (wd < 0) {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI can't add watch for %s\n", file_wd[4].filename);
+ }
+ file_wd[4].wd = wd;
+ }
+#endif
+
+ while (1) {
+ if ((len = read(fd, buffer, 1024)) > 0) { //kw 3
+ offset = buffer;
+ offs_len = 0;
+
+ event = (struct inotify_event *)buffer;
+ while ((char *)event - buffer < len) {
+ int event_len = event->len;
+ if (event_len < 0 || event_len > INT_MAX-1) {//kw 3, <len-offs_len
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI mmi_wifi_thread_function %d!!\n", event_len);
+ break;
+ }
+ for (i = 0; i < WD_NUM; i++) {
+ if (event->wd != file_wd[i].wd) {
+ continue;
+ }
+ mmi_wifiwps_file_operate(file_wd[i].filename);
+ break;
+ }
+ tmp_len = sizeof(struct inotify_event *) + event_len;
+ offs_len += tmp_len;
+ if (offs_len > len)//kw
+ break;
+ event = (struct inotify_event *)(offset + tmp_len);
+ offset += tmp_len;
+ }
+ }
+ }
+
+}
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:create Ï̼߳ì²âwifiÎļþ±ä»¯
+***********************************************************************************/
+static VOID mmi_create_wifi_inotify_thread(VOID)
+{
+ pthread_t mmi_wifi_thread;
+ if (pthread_create(&mmi_wifi_thread, NULL, &mmi_wifi_thread_function, NULL) == -1) {
+ slog(MMI_PRINT, SLOG_ERR, "ZTE_MMI create wifi thread error!\n");
+ MMI_ASSERT(0);
+ }
+ slog(MMI_PRINT, SLOG_DEBUG, "ZTE_MMI create wifi_thread success!!!\n");
+}
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:MMI wifiÊý¾Ý´«ÊäÑ»·¼ì²â¶¨Ê±Æ÷KILL£¬ ¹Ø»úºÍÖØÆôʱµ÷ÓÃ
+***********************************************************************************/
+VOID mmi_kill_wifi_data_timer(VOID)
+{
+ if (g_showMode == MMI_MODE_LED || g_showMode == MMI_MODE_ALL) {
+ mmi_wifi_data_timer_stop();
+ }
+}
+
+/**********************************************************************************
+º¯Êý×÷ÓÃ:wifiָʾµÆ³õʼ»¯£¬ ÉèÖûص÷º¯Êý
+***********************************************************************************/
+VOID mmi_wifi_init(VOID)
+{
+ mmi_set_wifi_state();
+ mmi_set_wifi_update();
+ mmi_set_qrcode_state();
+ mmi_create_wifi_inotify_thread();
+ mmi_wifi_data_timer_create();
+ if (g_use_wifi_usernum) {
+ mmi_get_wifi_stanum();
+ }
+}
+
diff --git a/lynq/R305/ap/app/zte_webui/css/com.css b/lynq/R305/ap/app/zte_webui/css/com.css
new file mode 100755
index 0000000..9ac8585
--- /dev/null
+++ b/lynq/R305/ap/app/zte_webui/css/com.css
@@ -0,0 +1,2602 @@
+/* Reset the container */
+.container {
+ width: 970px !important;
+ max-width: none !important;
+}
+
+.container .navbar-header,
+.container .navbar-collapse {
+ margin-right: 0;
+ margin-left: 0;
+}
+
+/* Always float the navbar header */
+.navbar-header {
+ float: left;
+}
+
+/* Undo the collapsing navbar */
+.navbar-collapse {
+ display: block !important;
+ height: auto !important;
+ padding-bottom: 0;
+ overflow: visible !important;
+}
+
+.navbar-toggle {
+ display: none;
+}
+.navbar-collapse {
+ border-top: 0;
+}
+
+.navbar-brand {
+ margin-left: -15px;
+}
+
+/* Always apply the floated nav */
+.navbar-nav {
+ float: left;
+ margin: 0;
+}
+.navbar-nav > li {
+ float: left;
+}
+.navbar-nav > li > a {
+ padding: 15px;
+}
+
+/* Redeclare since we override the float above */
+.navbar-nav.navbar-right {
+ float: right;
+}
+
+/* Undo custom dropdowns */
+.navbar .navbar-nav .open .dropdown-menu {
+ position: absolute;
+ float: left;
+ background-color: #fff;
+ border: 1px solid #ccc;
+ border: 1px solid rgba(0, 0, 0, .15);
+ border-width: 0 1px 1px;
+ border-radius: 0 0 4px 4px;
+ -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
+ box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
+}
+.navbar-default .navbar-nav .open .dropdown-menu > li > a {
+ color: #333;
+}
+.navbar .navbar-nav .open .dropdown-menu > li > a:hover,
+.navbar .navbar-nav .open .dropdown-menu > li > a:focus,
+.navbar .navbar-nav .open .dropdown-menu > .active > a,
+.navbar .navbar-nav .open .dropdown-menu > .active > a:hover,
+.navbar .navbar-nav .open .dropdown-menu > .active > a:focus {
+ color: #fff !important;
+ background-color: #008AD7 !important;
+}
+.navbar .navbar-nav .open .dropdown-menu > .disabled > a,
+.navbar .navbar-nav .open .dropdown-menu > .disabled > a:hover,
+.navbar .navbar-nav .open .dropdown-menu > .disabled > a:focus {
+ color: #999 !important;
+ background-color: transparent !important;
+}
+
+body {
+ min-width: 970px;
+ padding-bottom: 30px;
+}
+
+.lead {
+ font-size: 16px;
+}
+
+.page-header {
+ margin-bottom: 30px;
+}
+.page-header .lead {
+ margin-bottom: 10px;
+}
+h1, .h1 {
+ font-size: 20px;
+}
+h2, .h2 {
+ font-size: 18px;
+}
+h3, .h3 {
+ font-size: 18px;
+}
+label{
+ font-weight: normal;
+}
+h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6{
+ font-weight: bold;
+}
+
+.label-primary {
+ background-color: #018AD8;
+}
+
+.arrow-down {
+ bottom:0;
+ border-width: 8px 4px 0;
+ width: 0;
+ height: 0;
+ border-color: #018AD8 transparent transparent;
+ border-style: solid;
+}
+
+.absolute-center {
+ position: absolute;
+ left: 49%;
+}
+
+.info-title.label {
+ padding: 0.3em 0.7em 0.3em;
+}
+
+.margin-top-10 {margin-top: 10px;}
+.margin-top-15 {margin-top: 15px;}
+.margin-top-20 {margin-top: 20px;}
+.margin-top-50 {margin-top: 50px;}
+.margin-top-80 {margin-top: 80px;}
+.margin-top-160 {margin-top: 160px;}
+
+.margin-bottom-10{margin-bottom: 10px;}
+.margin-bottom-20{margin-bottom: 20px;}
+.margin-bottom-50{margin-bottom: 50px;}
+
+.margin-left-10{margin-left: 10px;}
+.margin-left-15{margin-left: 15px;}
+.margin-left-3em{margin-left: 3em;}
+
+.margin-right-20{margin-right: 20px;}
+
+.padding-top-10{padding-top: 10px;}
+
+.padding-right-10{padding-right: 10px;}
+.padding-right-15{padding-right: 15px;}
+.padding-right-90 {
+ padding-right: 90px;
+}
+
+.line-height-20{line-height: 20px;}
+.line-height-30{line-height: 30px;}
+.line-height-40{line-height: 40px;}
+.line-height-60{line-height: 60px;}
+
+.width-60{width: 60px;}
+
+.font-weight-bold{
+ font-weight: bold;
+}
+
+.smsUnreadCount {
+ width: 30px;
+ height: 20px;
+ line-height: 20px;
+ padding: 2px;
+ top: -13px;
+ left: 20px;
+ position: absolute;
+ text-align: center;
+ z-index: 10;
+ background: url("../pic/png_new_sms_bg.png") no-repeat scroll 0 -5px transparent;
+ color: white;
+}
+
+.tooltip {
+ width: auto;
+ min-width: 5px;
+ position: absolute;
+ padding: 6px;
+ display: none;
+ color: #fff;
+ background-color: #4B4B4B;
+ border-radius: 4px;
+ -moz-border-radius: 4px;
+ -webkit-border-radius: 4px;
+ box-shadow: 0 3px 5px #999;
+ -moz-box-shadow: 0 3px 5px #999;
+ -webkit-box-shadow: 0 3px 5px #999;
+ margin-top: 5px;
+ *+margin-top:0px;
+}
+
+#statusBar span{
+ margin-right: 10px;
+}
+
+#statusBar span.smsUnreadCount{
+ margin-left: 0;
+}
+
+#statusBar .statusItem{
+ color: #696E72;
+ font-weight: bold;
+ line-height: 35px;
+ vertical-align: middle;
+}
+
+#statusBar #wifi_status{
+ width: 36px;
+ display: inline-block;
+}
+
+#statusBar #wifi_status i{
+ width: 36px;
+ height: 24px;
+ line-height: 24px;
+ display: inline-block;
+}
+
+#statusBar .icon_connection{
+ width: 50px;
+ display: inline-block;
+}
+
+#statusBar .wifi_connected{
+ width: 42px;
+ height: 30px;
+ background:url("../pic/pic_wifi_connect.png") no-repeat scroll center 2px transparent;
+}
+
+#statusBar .rj45_connected{
+ width: 42px;
+ height: 30px;
+ background:url("../pic/pic_rj45_connect.png") no-repeat scroll center 2px transparent;
+}
+
+#statusBar .connecting{
+ width: 36px;
+ height: 30px;
+ background:url("../pic/pic_connecting.gif") no-repeat scroll center 3px transparent;
+}
+
+#statusBar .disconnect{
+ width: 42px;
+ height: 30px;
+ background:url("../pic/pic_disconnect.png") no-repeat scroll center 3px transparent;
+}
+
+#statusBar .connectionNone{
+ height: 30px;
+ background:url("../pic/pic_connection.png") no-repeat scroll center 3px transparent;
+}
+
+#statusBar .connectionUp{
+ height: 30px;
+ background:url("../pic/pic_connection.png") no-repeat scroll center -27px transparent;
+}
+
+#statusBar .connectionDown{
+ height: 30px;
+ background:url("../pic/pic_connection.png") no-repeat scroll center -57px transparent;
+}
+
+#statusBar .connectionBoth{
+ height: 30px;
+ background:url("../pic/pic_connection.png") no-repeat scroll center -87px transparent;
+}
+
+#statusBar .signal{
+ width: 40px;
+ height: 30px;
+ display: inline-block;
+}
+
+#statusBar .signal_none{
+ width: 30px;
+ height: 30px;
+ background:url("../pic/res_signal.png") no-repeat scroll 6px -268px transparent;
+}
+
+#statusBar .signal0{
+ height: 30px;
+ background:url("../pic/res_signal.png") no-repeat scroll center -3px transparent;
+}
+
+#statusBar .signal1{
+ height: 30px;
+ background:url("../pic/res_signal.png") no-repeat scroll center -45px transparent;
+}
+
+#statusBar .signal2{
+ height: 30px;
+ background:url("../pic/res_signal.png") no-repeat scroll center -92px transparent;
+}
+
+#statusBar .signal3{
+ height: 30px;
+ background:url("../pic/res_signal.png") no-repeat scroll center -140px transparent;
+}
+
+#statusBar .signal4{
+ height: 30px;
+ background:url("../pic/res_signal.png") no-repeat scroll center -185px transparent;
+}
+
+#statusBar .signal5{
+ height: 30px;
+ background:url("../pic/res_signal.png") no-repeat scroll center -227px transparent;
+}
+
+#statusBar .wifi_status0{
+ background: url("../pic/wlan.png") no-repeat scroll 0 4px transparent;
+}
+
+#statusBar .wifi_status1{
+ background: url("../pic/wlan.png") no-repeat scroll 0 -20px transparent;
+}
+
+#statusBar .wifi_status2{
+ background: url("../pic/wlan.png") no-repeat scroll 0 -45px transparent;
+}
+
+#statusBar .wifi_status3{
+ background: url("../pic/wlan.png") no-repeat scroll 0 -70px transparent;
+}
+
+#statusBar .wifi_status4{
+ background: url("../pic/wlan.png") no-repeat scroll 0 -95px transparent;
+}
+
+#statusBar .wifi_status5{
+ background: url("../pic/wlan.png") no-repeat scroll 0 -120px transparent;
+}
+
+#statusBar .wifi_status6{
+ background: url("../pic/wlan.png") no-repeat scroll 0 -145px transparent;
+}
+
+#statusBar .wifi_status7{
+ background: url("../pic/wlan.png") no-repeat scroll 0 -170px transparent;
+}
+
+#statusBar .wifi_status8{
+ background: url("../pic/wlan.png") no-repeat scroll 0 -195px transparent;
+}
+
+#statusBar .wifi_status9{
+ background: url("../pic/wlan.png") no-repeat scroll 0 -220px transparent;
+}
+
+#statusBar .wifi_status10{
+ background: url("../pic/wlan.png") no-repeat scroll -40px 4px transparent;
+}
+
+#statusBar .wifi_status11{
+ background: url("../pic/wlan.png") no-repeat scroll -40px -20px transparent;
+}
+
+#statusBar .wifi_status12{
+ background: url("../pic/wlan.png") no-repeat scroll -40px -45px transparent;
+}
+
+#statusBar .wifi_status13{
+ background: url("../pic/wlan.png") no-repeat scroll -40px -70px transparent;
+}
+
+#statusBar .wifi_status14{
+ background: url("../pic/wlan.png") no-repeat scroll -40px -95px transparent;
+}
+
+#statusBar .wifi_status15{
+ background: url("../pic/wlan.png") no-repeat scroll -40px -120px transparent;
+}
+
+#statusBar .wifi_status16{
+ background: url("../pic/wlan.png") no-repeat scroll -40px -145px transparent;
+}
+
+#statusBar .wifi_status17{
+ background: url("../pic/wlan.png") no-repeat scroll -40px -170px transparent;
+}
+
+#statusBar .wifi_status18{
+ background: url("../pic/wlan.png") no-repeat scroll -40px -195px transparent;
+}
+
+#statusBar .wifi_status19{
+ background: url("../pic/wlan.png") no-repeat scroll -40px -220px transparent;
+}
+
+#statusBar .wifi_status20{
+ background: url("../pic/wlan.png") no-repeat scroll -78px 5px transparent;
+}
+
+#statusBar .wifi_status21{
+ background: url("../pic/wlan.png") no-repeat scroll -78px -20px transparent;
+}
+
+#statusBar .wifi_status22{
+ background: url("../pic/wlan.png") no-repeat scroll -78px -45px transparent;
+}
+
+#statusBar .wifi_status23{
+ background: url("../pic/wlan.png") no-repeat scroll -78px -70px transparent;
+}
+
+#statusBar .wifi_status24{
+ background: url("../pic/wlan.png") no-repeat scroll -78px -95px transparent;
+}
+
+#statusBar .wifi_status25{
+ background: url("../pic/wlan.png") no-repeat scroll -78px -120px transparent;
+}
+
+#statusBar .wifi_status26{
+ background: url("../pic/wlan.png") no-repeat scroll -78px -145px transparent;
+}
+
+#statusBar .wifi_status27{
+ background: url("../pic/wlan.png") no-repeat scroll -78px -170px transparent;
+}
+
+#statusBar .wifi_status28{
+ background: url("../pic/wlan.png") no-repeat scroll -78px -195px transparent;
+}
+
+#statusBar .wifi_status29{
+ background: url("../pic/wlan.png") no-repeat scroll -78px -220px transparent;
+}
+
+#statusBar .wifi_status30{
+ background: url("../pic/wlan.png") no-repeat scroll -116px 5px transparent;
+}
+
+#statusBar .wifi_status31{
+ background: url("../pic/wlan.png") no-repeat scroll -116px -20px transparent;
+}
+
+#statusBar .wifi_status32{
+ background: url("../pic/wlan.png") no-repeat scroll -116px -45px transparent;
+}
+
+#statusBar .wifi_status_off{
+ background:url('../pic/wlan_off.png') no-repeat;
+}
+
+/* Overlay */
+#loading {
+ display: none;
+}
+
+#result-overlay {
+ display: none;
+}
+
+#result_wording h2{
+ font-size: 20px;
+ margin-top: 5px;
+ margin-bottom: 8px;
+}
+
+#result-overlay #result-image {
+ height: 75px;
+ margin: 0 auto;
+ width: 75px;
+}
+
+#result-overlay .overlay-success {
+ background: url("../pic/res_succ.png") no-repeat scroll 0 0 transparent;
+}
+
+#result-overlay .overlay-error {
+ background: url("../pic/res_failure.png") no-repeat scroll 0 0 transparent;
+}
+
+#loading_container{padding-bottom: 15px;}
+
+#loading_container a {
+ outline: none;
+}
+
+#progress {
+ display: none;
+}
+
+
+.ko-grid-search{
+ box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
+ margin-top: 3px;
+ margin-right: 15px;
+ width: 155px;
+ height: 30px;
+ line-height: 30px;
+ padding-right: 5px;
+ display: inline-block;
+ border: 1px solid #a1a1a1 ;
+ border-radius: 5px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -khtml-border-radius: 5px;
+ -ms-border-radius: 5px;
+ -o-border-radius: 5px;
+}
+
+.ko-grid-search input{
+ border: 0;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+ border: none;
+ height: 20px;
+ line-height: 20px;
+ padding: 5px 0;
+ background: none;
+ outline: none;
+ display: inline;
+}
+
+.ko-grid-search input.focusIn[type="text"]{
+ width: 100px;
+ padding: 2px 0;
+ margin: 0;
+ color: #767676;
+ background: none;
+ border: none;
+ box-shadow: none;
+}
+
+#frmPhoneBook #ko_grid_search_txt{
+ width: 100px;
+ padding: 2px 0;
+ color: #767676;
+ font-style:italic;
+}
+
+#smsListForm #searchInput{
+ width: 100px;
+ padding: 2px 0;
+ color: #767676;
+ font-style:italic;
+}
+
+#ko_grid_search_txt::-ms-clear {
+ display: none;
+}
+
+.ko-grid-search input.focusIn[type="text"], input.focusIn[type="password"] ,textarea:focus{
+ border-color:none;
+ outline: 0;
+ /* IE6-9 */
+ -webkit-box-shadow:none;
+ -moz-box-shadow: none;
+ box-shadow: none;
+}
+
+.checkbox {
+ width: 16px;
+ height: 16px;
+ margin-top: 0;
+ margin-bottom: 0;
+ cursor: pointer;
+ vertical-align: middle;
+ display: inline-block;
+ background:url("../pic/tickbox.png") no-repeat;
+}
+
+.checkbox:hover {
+ display: inline-block;
+}
+
+.checkbox input {
+ display: none;
+}
+
+.checkbox_selected {
+ background:url("../pic/tickbox_in.png") no-repeat;
+}
+
+p.checkbox.disable{
+ background:url("../pic/tickbox_disable.png") no-repeat;
+}
+
+p.checkbox.checked_disable{
+ background:url("../pic/tickbox_in_disable.png") no-repeat;
+}
+
+.header-bottom {
+ padding-bottom: 10px;
+ border-bottom: 1px solid #d3d3d3;
+}
+
+.popover_title{
+ font-size: 14px;
+ font-weight: normal;
+ line-height: 18px;
+ margin: 0;
+ padding: 8px 14px;
+ border-bottom: 1px solid #ebebeb;
+ border-radius: 5px 5px 0 0;
+ background-color: #f7f7f7;
+}
+
+.popover_content{
+ margin-top: 1em;
+ padding: 0 8px 8px 8px;
+}
+
+.popover_row label.error{
+ width: 100%;
+ text-align: left;
+}
+
+.form-title{
+ margin-bottom: 20px;
+ border-bottom: 1px solid #eee;
+}
+
+#footer{
+ /*margin-top: 40px;
+ background: #eeeeee;*/
+ height: 60px;
+ line-height: 60px;
+ text-align: center;
+}
+
+#smsChatRoom {
+ width: 100%;
+ font-size: 12px;
+ padding-left: 0;
+ float: left;
+ display: none;
+}
+
+#smsChatRoom #chosenUserSelect{
+ width: 690px;
+}
+
+#chosenUser {
+ padding: 10px;
+ background-color: #D4DAE2;
+ box-shadow: 0 -3px 8px #ddd;
+}
+
+#chosenUser1{
+ margin-top: 0;
+}
+
+#chatlist {
+ padding-left: 10px;
+ padding-top: 10px;
+ background-color: white;
+ position: relative;
+ min-height: 240px;
+ box-shadow: 0 -3px 8px #D4DAE2;
+ *display: inline;
+}
+
+#chatlist a{
+ text-decoration: underline;
+ color: blue;
+}
+
+#chatpanel {
+ height: 250px;
+ border: 1px solid #e1e1e1;
+ overflow-x: hidden;
+ overflow-y: hidden;
+ background-color: white;
+}
+
+#chatpanel .clear-container {
+ width: 100%;
+ height: 250px;
+ border: 1px solid #e1e1e1;
+ border-top: none;
+ border-left: none;
+ position: relative;
+ overflow-x: hidden;
+ overflow-y: auto;
+}
+
+#inputpanel {
+ height: 142px;
+ padding: 10px 0;
+ position: relative;
+}
+
+.chatform {
+ margin: 0;
+ height: 120px;
+}
+
+textarea {
+ resize: none;
+}
+
+.chatform .chattextinput textarea {
+ height: 110px;
+ line-height:normal;
+ font-size: 14px;
+ color: #696e72;
+ overflow: auto;
+}
+
+#sendSmsErrorLi{
+ color: #CC0000;
+}
+
+.chatfun {
+ padding-top: 8px;
+}
+
+.chatfun ul.ext {
+ float: left;
+}
+
+.chatfun ul.ext li {
+ float: left;
+ padding-left: 10px;
+ margin-right: 20px;
+}
+
+.chatfun ul.btn {
+ float: right;
+}
+
+.chatfun ul.btn li {
+ float: left;
+ margin-right: 10px;
+}
+
+.chatfun ul.btn li button {
+ padding: 1px 0;
+}
+
+.grid-talk .main-wrap {
+ margin-right: 36px;
+ _margin-right: 18px;
+}
+
+.grid-talkf .main-wrap {
+ margin-left: 36px;
+ _margin-left: 18px;
+}
+
+.col-main {
+ float: left;
+ width: 100%;
+ min-height: 1px;
+}
+
+
+.progress-content{
+ text-align: center
+}
+
+.progress-bar-container{
+ width:400px; height:32px;
+ margin:0 auto;
+ padding:1px;
+ border:1px #CCC solid;
+ text-align: left;
+ position:relative;
+}
+
+.progress-bar{
+ width:200px;
+ height:28px;
+ background:#429aff;
+}
+
+.progress-bar-value{
+ top:7px;
+ width:400px;
+ position:absolute;
+ text-align:center;
+ overflow:hidden;
+ font-weight:bold;
+}
+
+.progress-prompt{
+ font-size:small;
+ font-weight:bold;
+ padding-bottom: 15px;
+}
+
+#simplemodal-overlay {
+ cursor: wait;
+ background-color: #000;
+}
+
+#confirm,#popupSettingWindow{
+ display: none;
+}
+
+/* Overlay */
+#confirm-overlay {
+ cursor: wait;
+ background-color: #000;
+}
+
+/* Container */
+#confirm-container {
+ width: 420px;
+ border: 2px solid #dddddd;
+ border-radius: 6px;
+ -webkit-border-radius: 6px;
+ -moz-border-radius: 6px;
+ text-align: left;
+ background: none repeat scroll 0 0 #fff;
+}
+
+#confirm-container .header {
+ width: 100%;
+ height: 30px;
+ line-height: 30px;
+ color: #000;
+ font-weight: bold;
+ background-color: #eaeaea;
+ border-bottom: 1px solid #cbcbcb;
+}
+
+#confirm-container .header span {
+ padding-left: 8px;
+}
+
+#confirm-container .buttons {
+ padding: 10px 8px;
+ text-align: right;
+}
+
+#confirm-container .message {
+ color: #000;
+ font-size: 14px;
+}
+
+#confirm .message > i {
+ font-size: 0.9em;
+}
+
+#confirm-message-container{
+ margin: 10px 5px;
+}
+
+#confirm .icon {
+ width: 50px;
+ margin: 0 0 0 10px;
+ vertical-align: top;
+ display: inline-block;
+}
+
+#confirm .confirm-message {
+ width: 310px;
+ margin: 10px 10px 10px 0;
+ vertical-align: top;
+ display: inline-block;
+}
+
+.simplemodal-wrap .form-title{
+ font-size: 16px;
+ font-weight: bold;
+}
+
+.cursorhand{
+ cursor: pointer;
+}
+
+.device-block{
+ width: 100px;
+ margin: 0 24px 5px 0;
+ text-align: center;
+ text-decoration: none;
+ display: inline-block;
+}
+
+.device-block-desc{
+ padding-top: 100px;
+ width: 100px;
+ display: inline-block;
+ overflow: hidden;
+ vertical-align: middle;
+ text-align: center;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ background: url("../pic/mobile.png") no-repeat scroll 0 0 transparent;
+}
+
+.expend-desc{
+ padding-left: 2em;
+}
+
+.arrow-right{
+ padding-right: 30px;
+ background: url("../pic/direct-right.png") no-repeat scroll right center transparent;
+}
+
+#pc_main_form .content {
+ padding-left: 2em;
+}
+
+table.colorHoverTable thead tr {
+ height: 27px;
+}
+
+.header-center th{
+ text-align: center;
+}
+
+#pc_time_limited_form table thead tr{
+ background: none;
+}
+
+#pc_time_limited_form table thead td{
+ min-width: 4%;
+}
+
+#pc_time_limited_form table tbody td{
+ border: 1px solid #ccc;
+ height: 40px;
+ vertical-align: middle;
+ /*line-height: 40px;*/
+ padding: 0;
+ border-collapse: collapse;
+}
+
+#pc_time_limited_form table tbody td.active{
+ background-color: red;
+}
+
+#pc_time_limited_form table tbody td:first-child{
+ width: 50px;
+ border-width: 0 1px 0 0;
+}
+
+#pc_time_limited_form .pc_time_block{
+ width: 20px;
+ height: 20px;
+ display: inline-block;
+ border: 1px solid #ccc;
+}
+
+#pc_time_limited_form .time_td_hover{
+ background: #eee;
+}
+
+#pc_time_limited_form .forbid_time{
+ background-color: red;
+}
+
+#pc_children_group_form table td{
+ line-height: 32px;
+}
+
+.layout:after,.main-wrap:after,.col-sub:after,.col-extra:after {
+ content: '\20';
+ display: block;
+ height: 0;
+ clear: both;
+}
+
+.talk-item {
+ margin: 10px 0 5px 0;
+}
+
+.talk-item .info-user {
+ width: 30px;
+ padding: 2px;
+ border: 1px solid #335A8B;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
+ background-color: #fff;
+}
+
+.talk-item .info-user img {
+ width: 30px;
+ display: block;
+}
+
+.talk-item .time {
+ height: 20px;
+ line-height: 20px;
+ clear: both;
+}
+
+.talk-item .msg {
+ padding: 10px;
+ max-width: 560px;
+ line-height: 180%;
+ position: relative;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
+ word-break: break-all;
+ word-wrap: break-word;
+ color: #000;
+}
+
+.talk-item .msg s.arrow {
+ width: 7px;
+ height: 13px;
+ bottom: 10px;
+ display: block;
+ position: absolute;
+ background: url(../pic/a-direct.png) no-repeat;
+}
+
+.talk-b .msg_fail s.arrow{
+ bottom: 10px;
+ display: block;
+ width: 7px;
+ height: 13px;
+ left: 100%;
+ position: absolute;
+ background: url(../pic/c-direct.png) no-repeat;
+}
+
+.talk-item .msg_fail {
+ padding: 10px;
+ line-height: 180%;
+ max-width: 560px;
+ position: relative;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
+ word-break: break-all;
+ word-wrap: break-word;
+ color: #000;
+}
+
+.talk-b .msg_fail{
+ float: right;
+ min-width: 70px;
+ padding: 10px 10px 15px 10px;
+ background: #ffdbdb;
+ border: 1px solid #f46c6c;
+ min-width: 350px;
+}
+
+.msg_fail pre{
+ border: medium none;
+ line-height: 17px;
+ margin: 0;
+ overflow-x: auto;
+ padding: 0;
+ white-space: pre-wrap;
+ word-wrap: break-word;
+ color: #696e72;
+ background: none repeat scroll 0 0 transparent;
+}
+
+#smsChatRoom .error {
+ color: #CC0000;
+}
+
+.info-talk{
+ color: #87acd6;
+}
+
+.talk-a .info-talk {
+ float: left;
+ padding: 0 20% 10px 10px;
+ min-width: 420px;
+ _float: none;
+ _padding-left: 26px;
+}
+
+.talk-a .msg {
+ min-width: 350px;
+ min-height: 20px;
+ border: 1px solid #ccc;
+ background: #eef2f4;
+}
+
+.talk-a .msg s.arrow {
+ left: -7px;
+ _left: -17px;
+}
+
+.talk-b {
+ margin-right: 10px;
+ _margin-right: 20px;
+}
+
+.talk-b .info-talk {
+ float: right;
+ min-width: 420px;
+ padding: 0 10px 10px 20%;
+}
+
+.talk-b .msg {
+ float: right;
+ min-width: 350px;
+ min-height: 20px;
+ border: 1px solid #ADCAE3;
+ padding: 10px 10px 10px 10px;
+ background: #bce3f4;
+}
+
+.talk-c {
+ margin-right: 20px;
+ _margin-right: 30px;
+}
+
+.talk-b .info-talk {
+ float: right;
+ min-width: 420px;
+ padding: 0 10px 10px 20%;
+}
+
+.talk-c .msg {
+ float: right;
+ min-width: 70px;
+ padding: 10px 10px 15px 10px;
+ border: 1px solid #ADCAE3;
+ background: #bce3f4;
+}
+
+.talk-b .msg s.arrow {
+ left: 100%;
+ background: url("../pic/b-direct.png") no-repeat;
+}
+
+#smslist-main .smslist-btns.smsListFloatButs{
+ position: fixed;
+ top: 0;
+ width: 770px;
+ height: 50px;
+ padding: 6px 0 0 0;
+ border: 1px solid #018AD8;
+ display: block;
+ z-index: 9999;
+ background: #F5F9FE;
+ background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#F5F9FE), to(#018AD8) );
+ background: -ms-linear-gradient(top, #F5F9FE, #018AD8);
+ background: -moz-linear-gradient(top, #F5F9FE, #018AD8);
+ background: -o-linear-gradient(top, #F5F9FE, #018AD8);
+ filter: progid:dximagetransform.microsoft.gradient(enabled='true', startColorstr='#FFF5F9FE', endColorstr='#FF018AD8', GradientType=0);
+}
+
+#popupSettingWindow .tag-popup-close{
+ height: 0;
+ position: relative;
+ z-index: 2000;
+}
+
+#popupSettingWindow .tag-popup-close a {
+ float: right;
+ display: block;
+ top: 15px;
+ right: 15px;
+ width: 12px;
+ height: 13px;
+ font-size: 1px;
+ background: url("../pic/select-sprite.png") no-repeat scroll right -11px transparent;
+ position: absolute;
+}
+
+#innerTagPopup{
+ z-index: 250;
+ width: 185px;
+ line-height: 130%;
+ border: 1px solid #D4DAE2;
+ border-radius: 5px;
+ position: absolute;
+ background-color: #D4DAE2;
+ box-shadow: 0 -3px 8px #DDDDDD;
+}
+
+#innerTagPopup label.error{
+ color: #CC0000;
+ display: block;
+}
+
+#innerTagPopup .popup-wrapper {
+ background: #fff;
+ border: 2px solid #76b2de;
+ padding: 5px;
+}
+
+#innerTagPopup .tag-popup-close a {
+ float: right;
+ display: block;
+ width: 12px;
+ height: 13px;
+ font-size: 1px;
+ background: url("../pic/select-sprite.png") no-repeat scroll right -11px transparent;
+}
+
+
+#home_control{
+ color: #fff;
+ margin: 4px 0 0;
+}
+
+#home_control #change{
+ color: #ffffff;
+ font-weight: bold;
+ padding: 3px 15px;
+ background-color: transparent;
+}
+
+#home_image{
+ height: 400px;
+ color: #fff;
+}
+
+.label-font-normal label{
+ font-weight: normal;
+}
+
+#showDetailInfo ~ .popover{
+ min-width: 400px;
+}
+
+#showDetailInfo ~ .popover label{
+ font-size: 12px;
+ line-height: 1.5em;
+ word-wrap: break-word;
+}
+
+#h_qrcode {
+ width: 115px;
+ height: 115px;
+ background-color: #ffffff;
+ border: 1px solid #ffffff;
+}
+
+#h_wire_device {
+ top: 38px;
+ left: 130px;
+ display:inline;
+ margin-right:25px;
+ font-size: 30px;
+ display:inline-block;
+}
+
+#h_wireless_device {
+ font-size: 30px;
+ top: 105px;
+ left: 60px;
+ display:inline-block;
+}
+
+#h_network_type{
+ height: 30px;
+ top: 183px;
+ left: 415px;
+ line-height: 30px;
+ text-align: center;
+ font-size: 18px;
+}
+
+.data-card #h_network_type{
+ top: 156px;
+ left: 218px;
+}
+
+#h_network_type.no-btn {
+}
+
+#h_connect_btn{
+ width: 72px;
+ height: 35px;
+ display:inline-block;
+}
+
+.data-card #h_connect_btn{
+ top: 153px;
+ left: 323px;
+}
+
+.h_connect_on{
+ background: url('../pic/dial-on.png') no-repeat scroll 0 0 transparent;
+}
+
+.h_connect_off{
+ background: url('../pic/dial-off.png') no-repeat scroll 0 0 transparent;
+}
+
+#h_internet_setting_div{
+ top: 222px;
+ left: 418px;
+ width: 170px;
+ height: 35px;
+ margin-top:20px;
+ line-height: 35px;
+ text-align: center;
+}
+
+.data-card #h_internet_setting_div{
+ top: 205px;
+ left: 221px;
+}
+
+#h_internet_setting_btn{
+ width: 170px;
+ height: 35px;
+ line-height: 35px;
+ padding-right: 25px;
+ color: #fff;
+ display: block;
+ font-weight: bold;
+}
+
+#h_wifi_setting_div{
+ top: 318px;
+ left: 418px;
+ width: 170px;
+ height: 35px;
+ line-height: 35px;
+ text-align: center;
+}
+
+#h_wifi_setting_btn{
+ width: 170px;
+ height: 35px;
+ line-height: 35px;
+ padding-right: 25px;
+ color: #fff;
+ display: block;
+ font-weight: bold;
+}
+
+#h_connect_status{
+ top: 272px;
+ left: 670px;
+ width: 25px;
+ height: 25px;
+ position: absolute;
+}
+
+.h_status_connected{
+ background: url('../pic/local-connected.png') no-repeat scroll 0 0 transparent;
+}
+
+.h_status_disconnected{
+ background: url('../pic/local-disconnected.png') no-repeat scroll 0 0 transparent;
+}
+
+.h_status_connecting{
+ background: url('../pic/local-connecting.png') no-repeat scroll 0 0 transparent;
+}
+
+.h_status_disconnecting{
+ background: url('../pic/local-disconnecting.png') no-repeat scroll 0 0 transparent;
+}
+
+.color_block{
+ width: 20px;
+ height: 20px;
+ line-height: 20px;
+ border: 1px solid #ccc;
+ vertical-align: middle;
+ display: inline-block;
+}
+
+.color_block_desc{
+ line-height: 20px;
+ vertical-align: middle;
+ margin-left: 8px;
+ display: inline-block;
+}
+
+.colorRed{
+ color: #CC0000;
+}
+
+.msg pre{
+ line-height: 17px;
+ border: none;
+ margin: 0;
+ padding: 0;
+ overflow-x: hidden;
+ white-space: pre-wrap;
+ word-wrap: break-word;
+ color: #696e72;
+ background: none;
+}
+
+.smslist-item-icon {
+ width: 80px;
+ height: 80px;
+ margin-left: 10px;
+ margin-top: -6px;
+}
+
+.smslist-item-name {
+ max-width: 550px;
+ color: #000;
+ display: inline-block;
+ overflow: hidden;
+}
+
+.smslist-item-name2 {
+ color: #000;
+}
+
+.smslist-item-name-draftShowName{
+ display:inline;
+}
+
+.smslist-item-total-count-style{
+ float:left;
+ width:50px;
+ display:inline-block;
+ color:#696e72;
+}
+
+.smslist-item-repeat {
+ font-weight: bold;
+ line-height: 18px;
+ text-indent: 3px;
+ color: #7D8DA3;
+}
+
+.smslist-item-repeat:hover {
+ color: #207DDD;
+}
+
+.smslist-item{
+ border-bottom: 1px solid #e1e1e1;
+ margin-bottom: 10px;
+}
+
+.repeat-icon {
+ width: 18px;
+ height: 18px;
+ display: block;
+ background: url("../pic/png_forward.png") no-repeat;
+}
+
+.repeat-icon:hover {
+ width: 18px;
+ height: 18px;
+ display: block;
+ background: url("../pic/png_forward_hover.png") no-repeat;
+}
+
+.sms-forward-icon {
+ width: 18px;
+ height: 18px;
+ display: block;
+ background: url("../pic/png_forward.png") no-repeat scroll;
+}
+
+.sms-forward-icon:hover {
+ width: 18px;
+ height: 18px;
+ display: block;
+ background: url("../pic/png_forward_hover.png") no-repeat scroll;
+}
+
+.smslist-item-delete {
+ width: 18px;
+ height: 18px;
+ display: block;
+}
+
+.smslist-item-delete:hover {
+ width: 18px;
+ height: 18px;
+ display: block;
+}
+
+.sms-add-contact-icon {
+ width: 13px;
+ height: 13px;
+ display: inline-block;
+ background: url("../pic/png_add_contact.png") no-repeat scroll 0 0 transparent;
+}
+
+.sms-add-contact-icon:hover {
+ width: 13px;
+ height: 13px;
+ display: inline-block;
+ background: url("../pic/png_add_contact_hover.png") no-repeat scroll 0 0 transparent;
+}
+
+.smslist-item-delete:hover .trash-icon {
+ width: 18px;
+ height: 18px;
+ display: block;
+ background: url("../pic/png_delete_hover.png") no-repeat;
+}
+
+.trash-icon {
+ width: 18px;
+ height: 18px;
+ display: block;
+ background: url("../pic/png_delete.png") no-repeat;
+}
+
+.smslist-item-resend {
+ font-weight: bold;
+ line-height: 22px;
+ text-indent: 3px;
+ color: #7D8DA3;
+}
+
+.sms-resend-icon {
+ width: 18px;
+ height: 18px;
+ display: block;
+ background: transparent url("../pic/png_resend1.png") no-repeat;
+}
+
+.smslist-item-resend:hover {
+ color: #207DDD;
+}
+
+.smslist-item-resend:hover .sms-resend-icon{
+ background: transparent url("../pic/png_resend_hover.png") no-repeat;
+}
+
+.clock-icon {
+ width: 18px;
+ height: 30px;
+ line-height: 30px;
+ display: block;
+ background: url("../pic/png_time.png") no-repeat;
+}
+
+.clock-icon:hover {
+ width: 18px;
+ height: 30px;
+ line-height: 30px;
+ display: block;
+ background: url("../pic/png_time.png") no-repeat;
+}
+
+.smslist-item-new-count {
+ width: 29px;
+ height: 35px;
+ line-height: 35px;
+ margin-right: 5px;
+ text-align: center;
+ font-weight: bold;
+ color: #ffffff;
+ background: url("../pic/png_new_sms_bg.png") no-repeat scroll 0 0 transparent;
+}
+
+#mainContainer .width100p {
+ width: 100%;
+}
+
+.height15 {
+ height: 15px;
+ line-height: 15px;
+}
+
+
+label.error{
+ color: #a94442;
+}
+
+#frmPassword label.error {
+ white-space: nowrap;
+}
+
+.form-information{
+ margin-top: 10px;
+}
+
+.form-information p{
+ padding: 15px;
+}
+
+body[lang=en] .label-absolute{
+ height: 40px;
+}
+
+body[lang=en] .label-absolute > label{
+ top: 0;
+ left: 40px;
+ position: absolute;
+}
+
+.ko-grid-pageLinks {
+
+ padding-left: 0;
+ margin: 20px 0;
+ border-radius: 4px;
+ width: 100%;
+ display: inline-block;
+}
+
+.ko-grid-pageLinks > a,
+.ko-grid-pageLinks > span {
+ display: inline;
+ position: relative;
+ float: left;
+ padding: 6px 12px;
+ line-height: 1.42857143;
+ text-decoration: none;
+ color: #008AD7;
+ background-color: #ffffff;
+ border: 1px solid #dddddd;
+ margin-left: -1px;
+}
+
+.ko-grid-pageLinks > a:first-child,
+.ko-grid-pageLinks > span:first-child {
+ margin-left: 0;
+ border-radius: 4px 0 0 4px;
+}
+
+.ko-grid-pageLinks > a:last-child,
+.ko-grid-pageLinks > span:last-child {
+ margin-left: 0;
+ border-radius: 0 4px 4px 0;
+}
+
+.ko-grid-pageLinks > a.ko-grid-pager-selected,
+.ko-grid-pageLinks > span.ko-grid-pager-selected,
+.ko-grid-pageLinks > a.ko-grid-pager-selected:hover,
+.ko-grid-pageLinks > span.ko-grid-pager-selected:hover {
+ z-index: 2;
+ cursor: default;
+ color: #ffffff;
+ background-color: #008AD7;
+ border-color: #008AD7;
+}
+
+.ko-grid-pageLinks > a:hover,
+.ko-grid-pageLinks > span:hover {
+ z-index: 2;
+ background-color: #EEEEEE;
+ border-color: #DDDDDD;
+}
+
+.ko-grid-pageLinks > span.ko-grid-pager-disabled,
+.ko-grid-pageLinks > span.ko-grid-pager-disabled:hover,
+.ko-grid-pageLinks > span.ko-grid-pager-disabled:focus,
+.ko-grid-pageLinks > a.ko-grid-pager-disabled,
+.ko-grid-pageLinks > a.ko-grid-pager-disabled:hover,
+.ko-grid-pageLinks > a.ko-grid-pager-disabled:focus {
+ color: #777777;
+ background-color: #ffffff;
+ border-color: #dddddd;
+ cursor: not-allowed;
+}
+
+.nav-tabs > li > a, .nav-tabs.nav-justified > li > a{
+ -webkit-border-radius: 0;
+ -moz-border-radius: 0;
+ border-radius: 0;
+}
+.nav-tabs > li > a, .nav-tabs > li > a:hover, .nav-tabs > li > a:focus{
+ color: #333333;
+ text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
+ background-color: #f5f5f5;
+ *background-color: #e6e6e6;
+ background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
+ background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
+ background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
+ background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
+ background-repeat: repeat-x;
+ border: 1px solid #cccccc;
+ *border: 0;
+ border-color: #e6e6e6 #e6e6e6 #bfbfbf;
+ border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+ border-bottom-color: #b3b3b3;
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled='true', startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
+ *zoom: 1;
+ -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
+ -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
+}
+
+.nav-tabs > li:first-child > a, .nav-tabs > li:first-child > a:hover, .nav-tabs > li:first-child > a:focus{
+ -webkit-border-radius: 4px 0 0 4px;
+ -moz-border-radius: 4px 0 0 4px;
+ border-radius: 4px 0 0 4px;
+}
+
+.nav-tabs > li:last-child > a, .nav-tabs > li:last-child > a:hover, .nav-tabs > li:last-child > a:focus{
+ -webkit-border-radius: 0 4px 4px 0;
+ -moz-border-radius: 0 4px 4px 0;
+ border-radius: 0 4px 4px 0;
+}
+
+.nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus,
+.nav-tabs.nav-justified > .active > a, .nav-tabs.nav-justified > .active > a:hover, .nav-tabs.nav-justified > .active > a:focus{
+ color: #ffffff;
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+ background-color: #006dcc;
+ *background-color: #0044cc;
+ border-color: #0044cc #0044cc #002a80;
+ border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+ background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
+ background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
+ background-image: -o-linear-gradient(top, #0088cc, #0044cc);
+ background-image: linear-gradient(to bottom, #0088cc, #0044cc);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled='true', startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);
+}
+
+#result-overlay .simplemodal-data, #result-overlay .simplemodal-wrap, #result-overlay .alert{
+ border-radius: 8px;
+ -moz-border-radius: 8px;
+ -webkit-border-radius: 8px;
+ box-shadow: 0 3px 5px #999;
+ -moz-box-shadow: 0 3px 5px #999;
+ -webkit-box-shadow: 0 3px 5px #999;
+}
+
+.form-note .notes-title {
+ height: 30px;
+ cursor: pointer;
+ padding-bottom: 5px;
+ background: url("../pic/res_help.png") no-repeat scroll left center transparent;
+}
+
+.form-note .notes-content {
+ display: none;
+}
+
+.form-note .notes-dot {
+ border-bottom: 1px solid #ffffff;
+}
+
+.form-body .form-note {
+ border-radius: 4px;
+ font-size: 12px;
+ margin-bottom: 10px;
+ margin-top: 20px;
+ padding: 10px;
+ background-color: #ededed;
+}
+
+.form-body .form-note li {
+ line-height: 30px;
+ list-style: none outside none;
+ padding-left: 15px;
+ background: url("../pic/res_point.png") no-repeat scroll 0 12px transparent;
+}
+
+.form-body .form-note li.no-style {
+ background: none;
+}
+
+.border-color-transition {;
+ -moz-transition: border-color .5s ease-in;
+ -webkit-transition: border-color .5s ease-in;
+ -o-transition: border-color .5s ease-in;
+ -ms-transition: border-color .5s ease-in;
+ transition: border-color .5s ease-in;
+}
+
+.attention-focus{
+ border-color: red;
+}
+
+.popover-title{
+ background-color: #eaeaea;
+ border-bottom: 1px solid #cbcbcb;
+}
+
+.fixTableScroll {
+ width:100%;
+ overflow-x:auto;
+ overflow-y:hidden;
+ height:100%;
+ overflow-scrolling: touch;
+}
+
+.fixTableScroll:hover {
+ height:100%;
+}
+
+#h_internet_setting_btn:hover {
+ background-image: url("../pic/internet_setting_hover.png");
+}
+
+#h_wifi_setting_btn:hover {
+ background-image: url("../pic/wlan_setting_hover.jpg");
+}
+
+.connected_devices_container {
+ float:left;
+ width: 280px;
+ height: 400px;
+ margin-left:20px;
+ text-align: center;
+ border-radius:10px;
+ cursor: pointer;
+ filter: progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr = #70EBE6, endColorstr = #059EC4);
+ background: -webkit-linear-gradient(left top, #70EBE6 , #059EC4); /* Safari 5.1 - 6.0 */
+ background: -o-linear-gradient(bottom right, #70EBE6 , #059EC4); /* Opera 11.1 - 12.0 */
+ background: -moz-linear-gradient(bottom right, #70EBE6 , #059EC4); /* Firefox 3.6 - 15 */
+ background: linear-gradient(to bottom right, #70EBE6 , #059EC4); /* 标准的语法(必须放在最后)*/
+}
+
+.connected_devices_container .item_icon{
+ height: 45%;
+ background: url(../pic/new/device.png) center center no-repeat;
+}
+
+.home_h3{
+ font-size: 25px;
+ -webkit-text-shadow: 0px 1px 2px rgba(100, 100, 10, 0.5);
+ -moz-text-shadow: 0px 1px 2px rgba(100, 100, 10, 0.5);
+ -ms-text-shadow: 0px 1px 2px rgba(100, 100, 10, 0.5);
+ text-shadow: 0px 1px 2px rgba(100, 100, 10, 0.5);
+ text-align: center;
+}
+
+.network_control_container {
+ float:left;
+ width: 280px;
+ height: 400px;
+ margin-left:20px;
+ border-radius:10px;
+ filter: progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr = #36A4FF, endColorstr = #0877D4);
+ background: -webkit-linear-gradient(left top, #36A4FF , #0877D4); /* Safari 5.1 - 6.0 */
+ background: -o-linear-gradient(bottom right, #36A4FF , #0877D4); /* Opera 11.1 - 12.0 */
+ background: -moz-linear-gradient(bottom right, #36A4FF , #0877D4); /* Firefox 3.6 - 15 */
+ background: linear-gradient(to bottom right, #36A4FF , #0877D4); /* 标准的语法(必须放在最后)*/
+}
+
+.network_control_container .item_icon{
+ height: 45%;
+ background: url(../pic/new/router.png) center center no-repeat;
+}
+
+.internet_status_container{
+ float:left;
+ width: 280px;
+ height: 400px;
+ margin-left:60px;
+ border-radius:10px;
+ filter: progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr = #D014FE, endColorstr = #7109D5);
+ background: -webkit-linear-gradient(left top, #D014FE , #7109D5); /* Safari 5.1 - 6.0 */
+ background: -o-linear-gradient(bottom right, #D014FE , #7109D5); /* Opera 11.1 - 12.0 */
+ background: -moz-linear-gradient(bottom right, #D014FE , #7109D5); /* Firefox 3.6 - 15 */
+ background: linear-gradient(to bottom right, #D014FE , #7109D5); /* 标准的语法(必须放在最后)*/
+ text-align: center;
+}
+
+.internet_status_container .item_icon_connect{
+ height: 45%;
+ background: url(../pic/new/surfing1.png) center center no-repeat;
+}
+
+.internet_status_container .item_icon_disconnect{
+ height: 45%;
+ background: url(../pic/new/surfing2.png) center center no-repeat;
+}
+
+.internet_status_container .data-card{
+ top: 180px;
+ left: 636px;
+}
+
+.traffic_control_container{
+ float:left;
+ width: 280px;
+ height: 280px;
+ margin-left:45px;
+ border-radius:10px;
+ color:#fff;
+ filter: progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr = #FCCA53, endColorstr = #F45406);
+ background: -webkit-gradient(linear, 0 0, 0 100%, from(#FCCA53), to(#F45406));
+ background: -webkit-linear-gradient(left top, #FCCA53 , #F45406); /* Safari 5.1 - 6.0 */
+ background: -o-linear-gradient(bottom right, #FCCA53 , #F45406); /* Opera 11.1 - 12.0 */
+ background: -moz-linear-gradient(bottom right, #FCCA53 , #F45406); /* Firefox 3.6 - 15 */
+ background: -ms-linear-gradient(left, #FCCA53, #F45406);
+ background: linear-gradient(to bottom right, #FCCA53 , #F45406); /* 标准的语法(必须放在最后)*/
+
+}
+.device_info_container{
+ float:left;
+ width: 580px;
+ height: 280px;
+ border-radius:10px;
+ filter: progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr = #B454F6, endColorstr = #0096D7);
+ background: -webkit-linear-gradient(left top, #B454F6 , #0096D7); /* Safari 5.1 - 6.0 */
+ background: -o-linear-gradient(bottom right, #B454F6 , #0096D7); /* Opera 11.1 - 12.0 */
+ background: -moz-linear-gradient(bottom right, #B454F6 , #0096D7); /* Firefox 3.6 - 15 */
+ background: linear-gradient(to bottom right, #B454F6 , #0096D7); /* 标准的语法(必须放在最后)*/
+}
+
+.device_info_container_hastraffic{
+ margin-left:20px;
+}
+
+.device_info_container_notraffic{
+ margin-left:210px;
+}
+
+.device_info_container a{
+ padding-right: 2em;
+ margin-right:1em;
+ color: #FFF;
+ background: url(../pic/new/direct.png) right center no-repeat;
+}
+
+
+#smslist-table td{
+ vertical-align: middle;
+ line-height: 1.2;
+}
+
+#simMsgList_container td{
+ vertical-align: middle;
+ line-height: 1.2;
+}
+
+.smslist-item-msg pre{
+ overflow: hidden;
+ text-overflow: ellipsis;
+ border: none;
+ padding: 0;
+ margin:0;
+ font-size: 14px;
+ line-height: 1.2;
+ white-space: nowrap;
+ background-color: transparent;
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+}
+
+.smslist-btns {
+}
+
+#smsScrollLoading {
+ margin: 25px auto;
+ font-size: 22px;
+ font-weight: bold;
+ text-align: center;
+ color: #7D8DA3;
+}
+
+#smsScrollLoadingBtn {
+ margin: 25px auto;
+ font-size: 22px;
+ font-weight: bold;
+ text-align: center;
+ color: #7D8DA3;
+ cursor: pointer;
+}
+
+#smslist_container{
+ position: relative;
+}
+
+#smslist_container table,#smslist_container table td,#smslist_container table th {
+ padding: 0;
+ margin: 0;
+ border: none;
+}
+
+.smslist-item-checkbox{float: left; width: 20px;}
+.chosen-container-multi .chosen-choices li.search-field input[type="text"]{
+ height: auto;
+}
+
+.sms-table-content{
+ width: 450px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.showFullHeight{
+ white-space: normal;
+}
+
+#buttom-bubble{
+ width: 230px;
+ height: auto;
+ right: 0;
+ bottom: 0;
+ margin-right: 10px;
+ position: fixed;
+ z-index: 100;
+}
+
+#buttom-bubble .bubbleItem{
+ margin-top: 8px;
+ border-radius: 10px 10px 0 0;
+ position: relative;
+}
+
+#buttom-bubble h3{
+ padding: 8px 30px 8px 8px;
+ background-color: #eaeaea;
+ border: 2px solid #eaeaea;
+ border-bottom: 0;
+ border-radius: 8px 8px 0 0;
+ margin-bottom: 0;
+ font-size: 14px;
+}
+
+#buttom-bubble .bubbleItem.report h3{
+ color: #E47602;
+}
+
+#buttom-bubble h3 a.bubbleCloseBtn{
+ position: absolute;
+ top: 10px;
+ right: 10px;
+ border: 1px solid #E2E2E2;
+ -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
+ -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
+ box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
+}
+
+#buttom-bubble h3 a.bubbleCloseBtn:hover{
+ border: 1px solid #2063AB;
+}
+
+#buttom-bubble .bubbleCloseBtn{
+ width: 16px;
+ height: 14px;
+ display: block;
+ background: url("../pic/res_delete.png");
+}
+
+#buttom-bubble .bubbleContainer{
+ border: 2px solid #E2E2E2;
+ padding: 2px 8px 8px 8px;
+ line-height: 150%;
+ overflow: hidden;
+ border-top: 0;
+ font-size: 12px;
+ background: #F2F2F2;
+ background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(white), to(#eaeaea) );
+ background: -ms-linear-gradient(top, white, #eaeaea);
+ background: -moz-linear-gradient(top, white, #eaeaea);
+ background: -o-linear-gradient(top, white,#eaeaea);
+ filter: progid:dximagetransform.microsoft.gradient(enabled='true', startColorstr='#FFFFFFFF', endColorstr='#ffeaeaea', GradientType=0);
+}
+
+#buttom-bubble .bubbleContent{
+ max-height: 55px;
+ overflow: hidden;
+ line-height: 18px;
+ word-break: break-all;
+ word-wrap: break-word;
+}
+
+#buttom-bubble .bubbleDatetime{
+ padding-right: 10px;
+ text-align: right;
+ font-size: 10px;
+}
+
+#topContainer{
+ padding-top: 10px;
+ padding-bottom: 10px;
+ background-color: #EAEAEA;
+}
+
+.login-page-bg{
+ background: url("../pic/res_login-bg.png") repeat-x scroll 0 0 transparent;
+}
+
+#login-form-container{
+ border: 1px solid gray;
+ border-radius: 8px;
+ -moz-border-radius: 8px;
+ -webkit-border-radius: 8px;
+ background-color: white;
+ box-shadow: 0 3px 5px #053984;
+ -moz-box-shadow: 0 3px 5px #053984;
+ -webkit-box-shadow: 0 3px 5px #053984;
+}
+
+#htmlContainer{
+ padding: 0;
+}
+
+#htmlContainer .form-title{
+ padding: 10px 15px 10px 15px;
+ margin-bottom: 0;
+ border-bottom: 1px solid #cbcbcb;
+ background-color: #eaeaea;
+}
+
+#htmlContainer .content{
+ padding: 15px;
+}
+
+#simplemodal-data .alert{
+ border: 1px solid gray;
+ border-radius: 8px;
+ box-shadow: 0 6px 10px #053984;
+ width: 400px;
+ height: 150px;
+ background-color: white;
+}
+
+.btn-primary{
+ background-color: #008AD7;
+}
+
+#pblist tr td {
+ cursor: pointer;
+}
+
+#pblist tr td:first-child {
+ cursor: default;
+}
+
+.form-buttons {
+ margin-right: 20px;
+ margin-bottom: 5px;
+ text-align: right;
+}
+
+.align-right {
+ text-align: right;
+}
+
+.margin-right-10 {
+ margin-right: 10px;
+}
+
+.beautiful_bg #indexContainer{
+}
+
+.header-row {
+ background-color: #018ad8;
+ border-left-width: 0;
+ border-radius: 10px 10px 0 0;
+ margin: -1px 0 30px -11px;
+ width: 940px;
+ color: white;
+ filter: progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr = #B454F6, endColorstr = #0096D7);
+ background: -webkit-gradient(linear, 0 0, 0 100%, from(#B454F6), to(#0096D7));
+ background: -webkit-linear-gradient(left top, #B454F6 , #0096D7); /* Safari 5.1 - 6.0 */
+ background: -o-linear-gradient(bottom right, #B454F6 , #0096D7); /* Opera 11.1 - 12.0 */
+ background: -moz-linear-gradient(bottom right, #B454F6 , #0096D7); /* Firefox 3.6 - 15 */
+ background: -ms-linear-gradient(left, #B454F6, #0096D7);
+ background: linear-gradient(to bottom right, #B454F6 , #0096D7); /* 标准的语法(必须放在最后)*/
+}
+
+.header-row .form-title {
+ border: none;
+ margin-bottom: 0;
+ text-align:center;
+}
+
+#innerContainer {
+ width: 100%;
+ margin: 35px auto;
+ padding: 0 10px 20px 10px;
+ border: 1px solid #fff;
+ border-bottom:0px;
+ border-radius: 10px;
+ background: -webkit-linear-gradient(top, #F1F9FC , #fff); /* Safari 5.1 - 6.0 */
+ background: -o-linear-gradient(bottom, #F1F9FC , #fff); /* Opera 11.1 - 12.0 */
+ background: -moz-linear-gradient(bottom, #F1F9FC , #fff); /* Firefox 3.6 - 15 */
+ background: linear-gradient(to bottom, #F1F9FC , #fff); /* 标准的语法(必须放在最后)*/
+ }
+
+.form-title-multi h1 {
+ margin-top: 10px;
+ margin-bottom: 5px;
+}
+
+.form-title-multi p {
+ margin-bottom: 0;
+}
+.mobile_version_link{
+ color: #A0AFCB;
+}
+
+#opmode_form .content {
+ background-color: #FFFFFF;
+}
+
+#sms_unread_count a:hover {
+ text-decoration: none;
+}
+
+.customfile-input {
+ outline: none;
+ position: absolute;
+ height: 100px;
+ cursor: pointer;
+ background: transparent;
+ border: 0;
+ z-index: 999;
+ opacity: 0;
+ -moz-opacity: 0;
+ filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0 );
+}
+
+.customfile {
+ width: 400px;
+ padding: 2px;
+ border: 1px solid #444;
+ line-height: 30px;
+ background: #FAFAFA;
+ background: -ms-linear-gradient(#FAFAFA, #CACACA);
+ background: -moz-linear-gradient(#FAFAFA, #CACACA);
+ background : -webkit-linear-gradient( #FAFAFA, #EAEAEA);
+ cursor: pointer;
+ overflow: hidden;
+ -moz-border-radius: 7px;
+ -webkit-border-radius: 7px;
+ border-radius: 7px;
+ position: relative;
+ float: left;
+}
+
+.customfile-disabled {
+ opacity: .5;
+ filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0 );
+ cursor: default;
+}
+
+.customfile-feedback {
+ display: block;
+ margin: 1px 1px 1px 5px;
+ font-size: 1.2em;
+ color: #767676;
+ font-style: italic;
+}
+
+.customfile-feedback-populated {
+ color: #111;
+ padding-left: 20px;
+ line-height: 24px;
+ margin-top: 6px;
+ width:290px;
+ font-style: normal;
+ font-weight: bold;
+ background: url(../pic/pic-file.png) left 0px no-repeat;
+ white-space:nowrap;
+ display: block;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.customfile-button {
+ border: 1px solid #999;
+ background-color: #008AD7;
+ color: #fff;
+ float: right;
+ padding: 0px 10px;
+ text-align: center;
+ text-decoration: none;
+ font-size: 1em;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ border-radius: 5px;
+}
+
+.customfile-hover .customfile-button,.customfile-focus .customfile-button {
+ background-color: #3071A9;
+ border-color: #285E8E;
+ padding: 0px 10px;
+ color: #fff;
+}
+
+.customfile-focus .customfile-button {
+ outline: 1px dotted #ccc;
+}
+
+/*file type icons*/
+.customfile-ext-jpg, .customfile-ext-gif, .customfile-ext-png, .customfile-ext-jpeg, .customfile-ext-bmp { background-image: url(../pic/pic-picture.png);}
+.customfile-ext-mp4, .customfile-ext-mov, .customfile-ext-swf, .customfile-ext-m4v { background-image: url(../pic/pic-film.png);}
+.customfile-ext-mp3, .customfile-ext-wav { background-image: url(../pic/pic-mp3.png);}
+.customfile-ext-zip, .customfile-ext-tar, .customfile-ext-sit { background-image: url(../pic/pic-rar.png);}
+
+input[type='file']:focus{
+ outline: none;
+}
+
+#smslist-checkAll, #simMsgList-checkAll {
+ margin-left: -4px;
+}
+
+.not-allowed {
+ color: #D1D1D1 !important;
+ cursor: not-allowed;
+}
+
+.not-allowed:hover {
+ outline: 0;
+ text-decoration: none;
+}
+
+.not-allowed:focus {
+ outline: 0;
+ text-decoration: none;
+}
+
+.margin-top-5 {
+ margin-top: 5px;
+}
+
+.colorLightBlue{
+ color: #09F;
+}
+
+.sd_invalid_notes ul li{
+ height: 2em;
+ line-height: 2em;
+}
+
+.sd_invalid_notes .notes-content{
+ display: block;
+}
+
+#fileControlSection li {
+ list-style: outside none none;
+ display: inline;
+}
+
+
+.my_router_list,.net_surfing_list{
+ margin-top: 20px;
+}
+
+.my_router_list ul,.net_surfing_list ul,.statistics_list ul,.nav_right ul{
+ -webkit-padding-start: 0px;
+ margin:0px;
+ padding:0px;
+}
+
+.my_router_list li,.net_surfing_list li,.statistics_list li{
+ padding: 0 1em;
+ list-style:none;
+}
+
+.my_router_list li,.my_router_list li a,.net_surfing_list li{
+ text-align: left;
+ line-height: 2em;
+ font-size: 18px;
+
+}
+
+.my_router_list li a{
+ display: block;
+ color: #FFF;
+ background: url(../pic/new/direct.png) right center no-repeat;
+ -webkit-transition: all ease-in .3s;
+ -moz-transition: all ease-in .3s;
+ -ms-transition: all ease-in .3s;
+ transition: all ease-in .3s;
+}
+
+.my_router_list li a:hover{
+ color: #FAFAFA;
+ -webkit-text-shadow: 0px 1px 2px rgba(100, 100, 10, 0.5);
+ -moz-text-shadow: 0px 1px 2px rgba(100, 100, 10, 0.5);
+ -ms-text-shadow: 0px 1px 2px rgba(100, 100, 10, 0.5);
+ text-shadow: 0px 1px 2px rgba(100, 100, 10, 0.5);
+}
+
+.net_surfing_list li{
+ text-align: center;
+}
+
+.net_surfing_list i{
+ display: inline-block;
+ width: 17px;
+ height: 24px;
+ margin-right: 15px;
+ vertical-align: middle;
+}
+
+.net_surfing_list i.up{
+ background: url(../pic/new/direct_top.png);
+}
+
+.net_surfing_list i.down{
+ background: url(../pic/new/direct_down.png);
+}
+
+.statistics_list ul li{
+ padding: 0 20px;
+ text-align: left;
+ margin-top: 15px;
+ font-size:18px;
+}
+
+.statistics_list ul li a{
+ color: #FFF;
+ display: block;
+ background: url(../pic/new/direct.png) right center no-repeat;
+ -webkit-transition: all ease-in .3s;
+ -moz-transition: all ease-in .3s;
+ -ms-transition: all ease-in .3s;
+ transition: all ease-in .3s;
+}
+
+.statistics_list ul li a:hover{
+ -webkit-text-shadow: 0px 1px 2px rgba(100, 100, 10, 0.5);
+ -moz-text-shadow: 0px 1px 2px rgba(100, 100, 10, 0.5);
+ -ms-text-shadow: 0px 1px 2px rgba(100, 100, 10, 0.5);
+ text-shadow: 0px 1px 2px rgba(100, 100, 10, 0.5);
+}
+
+.type_items{
+ width:880px;
+ height: 100px;
+ text-align: center;
+ margin:0 0 0 45px;
+ -webkit-box-shadow: 0px 2px 4px rgba(172, 172, 172, 0.5);
+ -moz-box-shadow: 0px 2px 4px rgba(172, 172, 172, 0.5);
+ -ms-box-shadow: 0px 2px 4px rgba(172, 172, 172, 0.5);
+ box-shadow: 0px 2px 4px rgba(172, 172, 172, 0.5);
+ -webkit-border-radius: 8px;
+ -moz-border-radius: 8px;
+ -ms-border-radius: 8px;
+ border-radius: 10px;
+ filter: progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr = #B454F6, endColorstr = #0096D7);
+ background: -webkit-linear-gradient(left top, #B454F6 , #0096D7); /* Safari 5.1 - 6.0 */
+ background: -o-linear-gradient(bottom right, #B454F6 , #0096D7); /* Opera 11.1 - 12.0 */
+ background: -moz-linear-gradient(bottom right, #B454F6 , #0096D7); /* Firefox 3.6 - 15 */
+ background: linear-gradient(to bottom right, #B454F6 , #0096D7); /* 标准的语法(必须放在最后)*/
+}
+
+.type_items ul{
+ width: auto;
+ -webkit-padding-start: 0px;
+ margin:0px;
+ padding:0px;
+}
+
+.type_items ul li{
+ display: inline-block;
+ float:left;
+ list-style:none;
+}
+
+.type_items a{
+ display: table-cell;
+ width: 125px;
+ height: 100px;
+ color: #FFF;
+ vertical-align: middle;
+ -webkit-transition: all ease-in .3s;
+ -moz-transition: all ease-in .3s;
+ -ms-transition: all ease-in .3s;
+ transition: all ease-in .3s;
+ border-left: 1px solid;
+}
+
+.type_items a,.nav_right a:hover{
+ -webkit-box-shadow: 0px 2px 4px rgba(172, 172, 172, 0.5);
+ -moz-box-shadow: 0px 2px 4px rgba(172, 172, 172, 0.5);
+ -ms-box-shadow: 0px 2px 4px rgba(172, 172, 172, 0.5);
+ box-shadow: 0px 2px 4px rgba(172, 172, 172, 0.5);
+}
+
+.nav_right{
+ margin: 0 auto 0px -10px;
+ text-align: center;
+
+}
+
+.nav_right ul{
+ width: auto;
+ margin: 0 auto;
+}
+
+.nav_right ul li{
+ margin: 15px 20px 0 0;
+ width:100%;
+ list-style:none;
+}
+
+.nav_right .active a{
+ display: table-cell;
+ width: 138px;
+ height: 50px;
+ color: #fff;
+ font-weight:bold;
+ vertical-align: middle;
+ -webkit-transition: all ease-in .3s;
+ -moz-transition: all ease-in .3s;
+ -ms-transition: all ease-in .3s;
+ transition: all ease-in .3s;
+ -webkit-box-shadow: 0px 2px 4px rgba(172, 172, 172, 0.5);
+ -moz-box-shadow: 0px 2px 4px rgba(172, 172, 172, 0.5);
+ -ms-box-shadow: 0px 2px 4px rgba(172, 172, 172, 0.5);
+ box-shadow: 0px 8px 10px rgba(172, 172, 172, 0.5);
+ background-color:rgb(66, 153, 237);
+}
+
+.nav_right a{
+ width: 138px;
+ height: 50px;
+ display: table-cell;
+ color: #000;
+ vertical-align: middle;
+ -webkit-transition: all ease-in .3s;
+ -moz-transition: all ease-in .3s;
+ -ms-transition: all ease-in .3s;
+ transition: all ease-in .3s;
+ -webkit-box-shadow: 0px 2px 4px rgba(172, 172, 172, 0.5);
+ -moz-box-shadow: 0px 2px 4px rgba(172, 172, 172, 0.5);
+ -ms-box-shadow: 0px 2px 4px rgba(172, 172, 172, 0.5);
+ box-shadow: 0px 8px 10px rgba(172, 172, 172, 0.5);
+ background-color:rgb(182, 214, 232);
+}
+
+.sd-total {
+ text-align: right;
+ padding-right: 20px;
+}
+
+.icon-folder{
+ background: url("../pic/pic-folder.png") no-repeat;
+}
+
+.icon-pdf{
+ background: url("../pic/pic-pdf.png") no-repeat;
+}
+
+.icon-rar{
+ background: url("../pic/pic-rar.png") no-repeat;
+}
+
+.icon-mp3{
+ background: url("../pic/pic-mp3.png") no-repeat;
+}
+
+.icon-file{
+ background: url("../pic/pic-file.png") no-repeat;
+}
+
+.icon-film{
+ background: url("../pic/pic-film.png") no-repeat;
+}
+
+.icon-picture{
+ background: url("../pic/pic-picture.png") no-repeat;
+}
+
+.icon-doc{
+ background: url("../pic/pic-doc.png") no-repeat;
+}
+
+.icon-ppt{
+ background: url("../pic/pic-ppt.png") no-repeat;
+}
+
+.icon-xls{
+ background: url("../pic/pic-xls.png") no-repeat;
+}
+
+.icon-xml{
+ background: url("../pic/pic-xml.png") no-repeat;
+}
+
+.icon-download{
+ background: url("../pic/pic-download.png") no-repeat;
+}
+
+.mini-icon{
+ width: 20px;
+ height: 20px;
+ font-size: 16px;
+ display: block;
+}
+
+.cursor-pointer {
+ cursor: pointer;
+}
+
+#fileListSection th {
+ text-align: center;
+}
+
+.margin-left-5 {
+ margin-left: 5px;
+}
+
+.margin-top-2 {
+ margin-top: 2px;
+}
+
+.push-right {
+ text-align: right;
+}
+
+.data-card-language {
+ top: -25px;
+ right: 10px;
+ position: absolute;
+ display: block;
+}
diff --git a/lynq/R305/ap/app/zte_webui/js/ext/menu.js b/lynq/R305/ap/app/zte_webui/js/ext/menu.js
new file mode 100755
index 0000000..6277652
--- /dev/null
+++ b/lynq/R305/ap/app/zte_webui/js/ext/menu.js
@@ -0,0 +1,308 @@
+define(function () {
+ var needLogin = true;
+ var menu = [{
+ hash: '#more',
+ path: 'adm_others',
+ level: '3',
+ parent: '#local_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#filter_url',
+ path: 'firewall_url_filter',
+ level: '3',
+ parent: '#filter_main',
+ requireLogin: needLogin
+ }, {
+ hash: '#demilitarized_zone',
+ path: 'firewall_dmz_set',
+ level: '3',
+ parent: '#filter_main',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#universal_plug_and_play',
+ path: 'firewall_upnp_set',
+ level: '3',
+ parent: '#filter_main',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#map_port',
+ path: 'firewall_port_map',
+ level: '3',
+ parent: '#filter_main',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#foward_port',
+ path: 'firewall_port_forward',
+ level: '3',
+ parent: '#filter_main',
+ requireLogin: needLogin
+ }, {
+ hash: '#filter_port',
+ path: 'firewall_port_filter',
+ level: '3',
+ parent: '#filter_main',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#wlan_sleep',
+ path: 'wifi_sleep_mode',
+ level: '3',
+ parent: '#local_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#pin_mode',
+ path: 'adm_pin',
+ level: '3',
+ parent: '#local_set',
+ requireLogin: needLogin,
+ checkSIMStatus: true
+ }, {
+ hash: '#pwd_mode',
+ path: 'adm_management',
+ level: '3',
+ parent: '#local_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#filter_mac',
+ path: 'wifi_mac_filter',
+ level: '3',
+ parent: '#wlan_basic',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#wlan_wps',
+ path: 'wifi_wps',
+ level: '3',
+ parent: '#wlan_basic',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#wlan_adv',
+ path: 'wifi_advance',
+ level: '3',
+ parent: '#wlan_basic',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#conn_device',
+ path: 'wifi_station_info',
+ level: '3',
+ parent: '#normal_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#wlan_guset',
+ path: 'wifi_guest',
+ level: '3',
+ parent: '#normal_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#wlan_main',
+ path: 'wifi_main',
+ level: '3',
+ parent: '#normal_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#fota',
+ path: 'ota_update',
+ level: '3',
+ parent: '#local_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#dynamic_dns',
+ path: 'ddns',
+ level: '3',
+ parent: '#local_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#cgdcont_set',
+ path: 'network_apn_set',
+ level: '3',
+ parent: '#network_set',
+ requireLogin: needLogin,
+ checkSIMStatus: true
+ }, {
+ hash: '#network_choose',
+ path: 'network_net_select',
+ level: '3',
+ parent: '#network_set',
+ requireLogin: needLogin,
+ checkSIMStatus: true
+ }, {
+ hash: '#conn_set',
+ path: 'network_dial_set',
+ level: '3',
+ parent: '#network_set',
+ requireLogin: needLogin,
+ checkSIMStatus: true
+ },
+ {
+ hash: '#wlan_station',
+ path: 'wifi_ap_station',
+ level: '2',
+ parent: '#normal_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#msg_set',
+ path: 'sms_set',
+ level: '2',
+ parent: '#msg_main',
+ requireLogin: needLogin,
+ checkSIMStatus: true
+ }, {
+ hash: '#msg_sim',
+ path: 'sms_sim_messages',
+ level: '2',
+ parent: '#msg_main',
+ requireLogin: needLogin,
+ checkSIMStatus: true
+ }, {
+ hash: '#msg_list',
+ path: 'sms_list',
+ level: '2',
+ parent: '#msg_main',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#flow_ctl',
+ path: 'status_traffic_alert',
+ level: '1',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#pb_work_grp',
+ path: 'phonebook',
+ level: '2',
+ parent: '#pb_main',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#pb_friend_grp',
+ path: 'phonebook',
+ level: '2',
+ parent: '#pb_main',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#pb_family_grp',
+ path: 'phonebook',
+ level: '2',
+ parent: '#pb_main',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#pb_com_grp',
+ path: 'phonebook',
+ level: '2',
+ parent: '#pb_main',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#pb_all_grp',
+ path: 'phonebook',
+ level: '2',
+ parent: '#pb_main',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#usat',
+ path: 'ussd',
+ level: '2',
+ parent: '#normal_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#route_set',
+ path: 'adm_lan',
+ level: '2',
+ parent: '#normal_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#filter_main',
+ path: 'firewall',
+ level: '2',
+ parent: '#normal_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#local_set',
+ path: 'adm_management',
+ level: '2',
+ parent: '#normal_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#wlan_basic',
+ path: 'wifi_basic',
+ level: '2',
+ parent: '#normal_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#network_set',
+ path: 'network_dial_set_cpe',
+ level: '2',
+ parent: '#normal_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#fast_set',
+ path: 'adm_quick_set',
+ level: '2',
+ parent: '#normal_set',
+ requireLogin: needLogin,
+ checkSIMStatus: true
+ },
+ {
+ hash: '#child_ctl',
+ path: 'firewall_parental_control',
+ level: '1',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#normal_set',
+ path: 'adm_quick_set',
+ level: '1',
+ requireLogin: needLogin,
+ checkSIMStatus: true
+ }, {
+ hash: '#pb_main',
+ path: 'phonebook',
+ level: '1',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#msg_main',
+ path: 'sms_list',
+ level: '1',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#main',
+ path: 'main',
+ level: '1',
+ requireLogin: needLogin,
+ checkSIMStatus: true
+ }, {
+ hash: '#entry',
+ path: 'entry',
+ level: '1',
+ requireLogin: false,
+ checkSIMStatus: false
+ },
+ ];
+
+ return menu;
+});
diff --git a/lynq/R305/ap/app/zte_webui/js/ext/menu_pppoe.js b/lynq/R305/ap/app/zte_webui/js/ext/menu_pppoe.js
new file mode 100755
index 0000000..a1bf328
--- /dev/null
+++ b/lynq/R305/ap/app/zte_webui/js/ext/menu_pppoe.js
@@ -0,0 +1,308 @@
+define(function () {
+ var needLogin = true;
+ var menu = [{
+ hash: '#more',
+ path: 'adm_others',
+ level: '3',
+ parent: '#local_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#filter_url',
+ path: 'firewall_url_filter',
+ level: '3',
+ parent: '#filter_main',
+ requireLogin: needLogin
+ }, {
+ hash: '#demilitarized_zone',
+ path: 'firewall_dmz_set',
+ level: '3',
+ parent: '#filter_main',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#universal_plug_and_play',
+ path: 'firewall_upnp_set',
+ level: '3',
+ parent: '#filter_main',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#map_port',
+ path: 'firewall_port_map',
+ level: '3',
+ parent: '#filter_main',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#foward_port',
+ path: 'firewall_port_forward',
+ level: '3',
+ parent: '#filter_main',
+ requireLogin: needLogin
+ }, {
+ hash: '#filter_port',
+ path: 'firewall_port_filter',
+ level: '3',
+ parent: '#filter_main',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#wlan_sleep',
+ path: 'wifi_sleep_mode',
+ level: '3',
+ parent: '#local_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#pin_mode',
+ path: 'adm_pin',
+ level: '3',
+ parent: '#local_set',
+ requireLogin: needLogin,
+ checkSIMStatus: true
+ }, {
+ hash: '#pwd_mode',
+ path: 'adm_management',
+ level: '3',
+ parent: '#local_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#filter_mac',
+ path: 'wifi_mac_filter',
+ level: '3',
+ parent: '#wlan_basic',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#wlan_wps',
+ path: 'wifi_wps',
+ level: '3',
+ parent: '#wlan_basic',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#wlan_adv',
+ path: 'wifi_advance',
+ level: '3',
+ parent: '#wlan_basic',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#conn_device',
+ path: 'wifi_station_info',
+ level: '3',
+ parent: '#normal_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#wlan_guset',
+ path: 'wifi_guest',
+ level: '3',
+ parent: '#normal_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#wlan_main',
+ path: 'wifi_main',
+ level: '3',
+ parent: '#normal_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#fota',
+ path: 'ota_update',
+ level: '3',
+ parent: '#local_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#dynamic_dns',
+ path: 'ddns',
+ level: '3',
+ parent: '#local_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#cgdcont_set',
+ path: 'network_apn_set',
+ level: '3',
+ parent: '#network_set',
+ requireLogin: needLogin,
+ checkSIMStatus: true
+ }, {
+ hash: '#network_choose',
+ path: 'network_net_select',
+ level: '3',
+ parent: '#network_set',
+ requireLogin: needLogin,
+ checkSIMStatus: true
+ }, {
+ hash: '#conn_set',
+ path: 'network_dial_set',
+ level: '3',
+ parent: '#network_set',
+ requireLogin: needLogin,
+ checkSIMStatus: true
+ },
+ {
+ hash: '#wlan_station',
+ path: 'wifi_ap_station',
+ level: '2',
+ parent: '#normal_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#msg_set',
+ path: 'sms_set',
+ level: '2',
+ parent: '#msg_main',
+ requireLogin: needLogin,
+ checkSIMStatus: true
+ }, {
+ hash: '#msg_sim',
+ path: 'sms_sim_messages',
+ level: '2',
+ parent: '#msg_main',
+ requireLogin: needLogin,
+ checkSIMStatus: true
+ }, {
+ hash: '#msg_list',
+ path: 'sms_list',
+ level: '2',
+ parent: '#msg_main',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#flow_ctl',
+ path: 'status_traffic_alert',
+ level: '1',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#pb_work_grp',
+ path: 'phonebook',
+ level: '2',
+ parent: '#pb_main',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#pb_friend_grp',
+ path: 'phonebook',
+ level: '2',
+ parent: '#pb_main',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#pb_family_grp',
+ path: 'phonebook',
+ level: '2',
+ parent: '#pb_main',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#pb_com_grp',
+ path: 'phonebook',
+ level: '2',
+ parent: '#pb_main',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#pb_all_grp',
+ path: 'phonebook',
+ level: '2',
+ parent: '#pb_main',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#usat',
+ path: 'ussd',
+ level: '2',
+ parent: '#normal_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#route_set',
+ path: 'adm_lan',
+ level: '2',
+ parent: '#normal_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#filter_main',
+ path: 'firewall',
+ level: '2',
+ parent: '#normal_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#local_set',
+ path: 'adm_management',
+ level: '2',
+ parent: '#normal_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#wlan_basic',
+ path: 'wifi_basic',
+ level: '2',
+ parent: '#normal_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#network_set',
+ path: 'network_dial_set_cpe',
+ level: '2',
+ parent: '#normal_set',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#fast_set',
+ path: 'adm_quick_set',
+ level: '2',
+ parent: '#normal_set',
+ requireLogin: needLogin,
+ checkSIMStatus: true
+ },
+ {
+ hash: '#child_ctl',
+ path: 'firewall_parental_control',
+ level: '1',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#normal_set',
+ path: 'adm_quick_set',
+ level: '1',
+ requireLogin: needLogin,
+ checkSIMStatus: true
+ }, {
+ hash: '#pb_main',
+ path: 'phonebook',
+ level: '1',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#msg_main',
+ path: 'sms_list',
+ level: '1',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#main',
+ path: 'main',
+ level: '1',
+ requireLogin: needLogin,
+ checkSIMStatus: false
+ }, {
+ hash: '#entry',
+ path: 'entry',
+ level: '1',
+ requireLogin: false,
+ checkSIMStatus: false
+ },
+ ];
+
+ return menu;
+});
diff --git a/lynq/R305/ap/app/zte_webui/js/main.js b/lynq/R305/ap/app/zte_webui/js/main.js
new file mode 100755
index 0000000..a771f7d
--- /dev/null
+++ b/lynq/R305/ap/app/zte_webui/js/main.js
@@ -0,0 +1,121 @@
+require.config({
+ shim: {
+ knockoutbase: ['jq_tmpl'],
+ jq_additional: ['jq_validate'],
+ jq_simplemodal: ['3rd/twbs.bootstrap'],
+ jq_translate: ['jq_i18n'],
+ },
+ paths: {
+ base64: '3rd/webtoolkit.base64',
+ echarts: '3rd/apache.echarts',
+ knockout: '3rd/knockout',
+ knockoutbase: '3rd/knockout.base',
+ jq_additional: '3rd/jquery.additional-methods',
+ jq_chosen: '3rd/jquery.chosen',
+ jq_fileinput: '3rd/jquery.fileinput',
+ jq_i18n: '3rd/jquery.i18n',
+ jq_simplemodal: '3rd/jquery.simplemodal',
+ jq_tmpl: '3rd/jquery.tmpl',
+ jq_translate: '3rd/jquery.translate',
+ jq_validate: '3rd/jquery.validate',
+ jquery: '3rd/require-jquery',
+ jqui: '3rd/jqui',
+ text: '3rd/require-text',
+ tmpl: '../subpg',
+ underscore: '3rd/underscore',
+ service: 'com',
+
+ CryptoJS: '3rd/crypto-js',
+
+ menu: 'com',
+ adm_lan: 'com',
+ adm_others: 'com',
+ adm_management: 'com',
+ adm_pin: 'com',
+ adm_quick_set: 'com',
+ main: 'com',
+ language: 'com',
+ entry: 'com',
+ logout: 'com',
+ opmode: 'com',
+ opmode_popup: 'com',
+ router: 'com',
+ statusBar: 'com',
+ status_traffic_alert: 'com',
+ tooltip: 'com',
+
+ phonebook: 'sim_device',
+ sim_abnormal: 'sim_device',
+ ota_update: 'sim_device',
+ sd: 'sim_device',
+ sd_httpshare: 'sim_device',
+ sms_set: 'sim_device',
+ sms_sim_messages: 'sim_device',
+ sms_list: 'sim_device',
+ ussd: 'sim_device',
+ network_apn_set: 'net',
+ network_dial_set: 'net',
+ network_dial_set_cpe: 'net',
+ locknet: 'net',
+ network_net_select: 'net',
+ ddns: 'net',
+ firewall: 'net',
+ firewall_dmz_set: 'net',
+ firewall_parental_control: 'net',
+ firewall_port_filter: 'net',
+ firewall_port_forward: 'net',
+ firewall_port_map: 'net',
+ firewall_upnp_set: 'net',
+ firewall_url_filter: 'net',
+ wifi_advance: 'wifi',
+ wifi_ap_station: 'wifi',
+ wifi_guest: 'wifi',
+ wifi_mac_filter: 'wifi',
+ wifi_main: 'wifi',
+ wifi_sleep_mode: 'wifi',
+ wifi_station_info: 'wifi',
+ wifi_wps: 'wifi',
+ },
+
+});
+
+require("set service lib".split(" "),
+ function (set, fnc, util) {
+ function initAndLoad(cfg) {
+ require([cfg.menu, cfg.set], function (params) {
+ require("menu language logout statusBar router entry jq_additional jq_translate jq_simplemodal base64".split(" "),
+ function (menu, language, logout, statusBar, router, entry) {
+ menu.init();
+ language.init();
+ router.init();
+ logout.init();
+ statusBar.init();
+ });
+ });
+ }
+ if (!set.RJ45_SUPPORT) {
+ initAndLoad({
+ set: set.DEVICE + '/set',
+ menu: set.DEVICE + '/menu'
+ });
+ } else {
+ var tmp = "menu";
+ fnc.getOpMode({}, function (mod) {
+ set.blc_wan_mode = mod.blc_wan_mode;
+ switch (mod.blc_wan_mode) {
+ case "AUTO_PPPOE":
+ case "PPPOE":
+ tmp = "menu_pppoe";
+ break;
+ default:
+ tmp = "menu";
+ break;
+ }
+ initAndLoad({
+ set: set.DEVICE + '/set',
+ menu: set.DEVICE + '/' + tmp
+ });
+ });
+ }
+
+});
diff --git a/lynq/R305/ap/app/zte_webui/subpg/main.html b/lynq/R305/ap/app/zte_webui/subpg/main.html
new file mode 100755
index 0000000..c5f8c00
--- /dev/null
+++ b/lynq/R305/ap/app/zte_webui/subpg/main.html
@@ -0,0 +1,216 @@
+
+<div class="row margin-top-20">
+<div class="type_items">
+ <ul>
+ <li><a href="#child_ctl" data-bind="visible: hasParentalControl" data-trans="parental_control" class="c0EC6DC"></a></li>
+ <li><a href="#msg_main" data-bind="visible: hasSms" data-trans="sms" class="cF53A58"></a></li>
+ <li><a href="#pb_main" data-bind="visible: hasPhonebook" data-trans="phonebook" class="c00AEFF"></a></li>
+ <li><a href="#sdcard" data-bind="visible: isSupportSD" data-trans="sd" class="c2175FF"></a></li>
+ <li><a data-bind="attr: {href: notDataCard? '#wlan_sleep' : '#demilitarized_zone'}" data-trans="advanced_settings" class="cFFCE2B"></a></li>
+ <li><a href="#fast_set" data-bind="visible: isSupportQuicksetting()" data-trans="quick_setting" class="cFFCE2B"></a></li>
+ </ul>
+</div>
+</div>
+
+<div class="row margin-top-20" id="home_image">
+
+<div class="row">
+ <div style="position: relative">
+ <div class="internet_status_container">
+ <div data-bind=" css: {'item_icon_connect': cStatus()== 1, 'item_icon_disconnect': cStatus() != 1}"></div>
+ <h3 data-trans="net_surfing" class="home_h3"></h3>
+ <div class="net_surfing_list">
+ <ul>
+ <li><a id="h_connect_btn" href="javascript: void(0)" data-bind="visible: canConnect() && isShowHomeConnect(), click: connectHandler , css: {'h_connect_on': cStatus()== 1, 'h_connect_off': cStatus() != 1}" style="display: none;"></a></li>
+ <li><i class="up"></i><span data-bind="text: up_Speed"></span></li>
+ <li><i class="down"></i><span data-bind="text: down_Speed"></span></li>
+ <li><span data-bind="text: connected_Time"></span></li>
+ </ul>
+ </div>
+ </div>
+
+ <div class="network_control_container">
+ <div class="item_icon"></div>
+ <h3 data-trans="my_router" class="home_h3"></h3>
+ <!--div id="h_network_type" data-bind="text: networkType, css: {'no-btn': !(canConnect() && isShowHomeConnect())}"></div-->
+ <div class="my_router_list">
+ <ul>
+ <li data-bind="visible: hasRj45"><a id="opmode" data-bind="click: showOpModeWindow, css: {'not-allowed': enableFlag}" href="javascript:void(0)"></a></li>
+ <li><a data-bind="click: showNetworkSettingsWindow" data-trans="settings_internet" href="javascript:void(0)"></a></li>
+ <!--li><div id="h_ssid"></div></li-->
+ <li data-bind="visible: notDataCard"><a data-trans="settings_wireless" href="#wlan_main"></a></li>
+ </ul>
+ </div>
+ </div>
+
+ <!--div id="h_connect_status" data-bind="visible:notDataCard, css: {'h_status_connected': cStatus()== 1, 'h_status_disconnected': cStatus()== 2, 'h_status_connecting': cStatus()== 3, 'h_status_disconnecting': cStatus()== 4, }">
+ </div-->
+
+ <div data-bind="visible: notDataCard" onclick="window.location.hash='#conn_device'" class="connected_devices_container">
+ <div class="item_icon"></div>
+ <h3 data-trans="station_info" class="home_h3" ></h3>
+ <div style="text-align:center;display:inline" class="margin-top-20">
+ <div id="h_wire_device" data-bind="visible: hasRj45 && isCPE">
+ <span data-bind="text: wireDeviceNum" style="font-size:70px;"><em></em></span><sub data-trans="device_unit" style="font-size: 16px;"></sub>
+ <span data-trans="cable" style="font-size:15px;text-align:center;display:block"></span>
+ </div>
+ <div id="h_wireless_device" style="display-block">
+ <span data-bind="text: wirelessDeviceNum" style="font-size:70px"></span><sub data-trans="device_unit" style="font-size: 16px;"></sub>
+ <span data-trans="wireless" style="font-size:15px;text-align:center;display:block"></span>
+ </div>
+ </div>
+ <!--a href="#conn_device" id="h_attached_device_link">
+ </a-->
+ </div>
+ </div>
+</div>
+</div>
+
+
+<div class="row margin-top-20 label-font-normal margin-bottom-20">
+ <div class="text-center traffic_control_container" data-bind="visible: showTraffic()">
+ <h4 data-trans="traffic_data_plan" style="font-size:14px;text-align:right;padding-right:15px"></h4>
+ <div style="display:inline-block">
+ <div id="traffic_graphic" style="width: 200px; height: 165px; visibility: visible;"></div>
+ </div>
+ <div style="text-align: left;padding-left:20px;font-size:18px">
+ <span style="background-color: #8CC916;" class="color_block"></span>
+ <span data-trans="traffic_used" class="color_block_desc"></span>
+ <span class="color_block_desc">:</span>
+ <span data-bind="text: trafficUsed" class="color_block_desc"></span>
+ </div>
+ <div class="statistics_list">
+ <ul>
+ <li><a href="#flow_ctl">
+ <div data-bind="visible: trafficAlertEnable">
+ <span data-bind="text: trafficLimited" class="line-height-20"></span>
+ <span data-trans="traffic_limit_data" class="line-height-20"></span>
+ </div>
+ <div data-bind="visible: trafficAlertEnable() == false">
+ <div data-trans="traffic_not_set_limited" class="line-height-20"></div>
+ </div>
+ </a></li>
+ </ul>
+ </div>
+ </div>
+
+
+ <div data-bind="css:{'device_info_container_hastraffic':showTraffic(),'device_info_container_notraffic':!showTraffic()}" class="device_info_container">
+ <h4 data-trans="device_info" style="font-size:14px;text-align:left;padding-left:15px;color:#fff"></h4>
+ <div style="color:#fff;position: relative;height: 210px;font-size: 18px;line-height: 1.5em;padding:20px 0px 0px 15px;">
+ <div class="row">
+ <label data-trans="sim_serial_number" class="col-xs-5"></label>
+ <label data-bind="text: simSerialNumber" class="col-xs-7"></label>
+ </div>
+ <div class="row">
+ <label data-trans="imei" class="col-xs-5"></label>
+ <label data-bind="text: imei" class="col-xs-7"></label>
+ </div>
+ <div class="row">
+ <label data-trans="imsi" class="col-xs-5"></label>
+ <label data-bind="text: imsi" class="col-xs-7"></label>
+ </div>
+ <!--div class="row" data-bind="visible: notDataCard">
+ <label class="col-xs-5" data-trans="wifi_range"></label>
+ <label class="col-xs-7" data-bind="attr: {'data-trans': wifiLongMode}"></label>
+ </div-->
+ <div class="row">
+ <label data-trans="signal_strength_label" class="col-xs-5"></label>
+ <label id="fresh_signal_strength" class="col-xs-7"></label>
+ </div>
+ <div class="row" data-bind="visible: hasWifi && showMultiSsid()">
+ <label data-trans="network_name_ssid1" class="col-xs-5"></label>
+ <label data-bind="text: ssid" style="word-wrap: break-word;" class="col-xs-7"></label>
+ </div>
+ <div class="row" data-bind="visible: hasWifi && !showMultiSsid()">
+ <label data-trans="network_name" class="col-xs-5"></label>
+ <label data-bind="text: ssid" style="word-wrap: break-word;" class="col-xs-7"></label>
+ </div>
+ </div>
+ <div style="text-align:right;">
+ <a href="javascript: void(0)" data-trans="detail_info" id="showDetailInfo" tabindex="0"></a>
+ </div>
+ </div>
+</div>
+
+
+<div id="h_qrcode" data-bind="visible: showQRCode" style="float:right" class="text-center">
+ <img id="qrcode_img" data-bind="attr: {src: qrcodeSrc}" src="./pic/res_blacktrans.png" width="111"/>
+</div>
+
+<script type="text/x-jquery-tmpl" id="detailInfoTmpl">
+<div class="row">
+ <label class="col-xs-6" data-trans="sim_serial_number" class="col-xs-6"></label>
+ <label class="col-xs-6"><%= simSerialNumber %></label>
+</div>
+<div class="row">
+ <label data-trans="imei" class="col-xs-6"></label>
+ <label class="col-xs-6"><%= imei %></label>
+</div>
+<div class="row">
+ <label data-trans="imsi" class="col-xs-6"></label>
+ <label class="col-xs-6"><%= imsi %></label>
+</div>
+<div class="row">
+ <label data-trans="signal_strength_label" class="col-xs-6"></label>
+ <label class="col-xs-6" id="popoverSignalTxt"><%= signal %></label>
+</div>
+<% if(hasWifi){ %>
+<div class="row">
+ <label data-trans="<%= showMultiSsid ? 'network_name_ssid1': 'network_name' %>" class="col-xs-6"></label>
+ <label style="word-wrap: break-word; word-break: break-all;" class="col-xs-6"><%= ssid %></label>
+</div>
+<div class="row">
+ <label data-trans="<%= showMultiSsid ? 'max_access_num_ssid1': 'max_access_num' %>" class="col-xs-6"></label>
+ <label class="col-xs-6"><%= max_access_num %></label>
+</div>
+ <% if(showMultiSsid){ %>
+ <div class="row">
+ <label data-trans="network_name_ssid2" class="col-xs-6"></label>
+ <label style="word-wrap: break-word; word-break: break-all;" class="col-xs-6"><%= m_ssid %></label>
+ </div>
+ <div class="row">
+ <label data-trans="max_access_num_ssid2" class="col-xs-6"></label>
+ <label class="col-xs-6"><%= m_max_access_num %></label>
+ </div>
+ <% } %>
+<div class="row">
+ <label data-trans="wifi_range" class="col-xs-6"></label>
+ <label data-trans="<%= wifi_long_mode %>" class="col-xs-6"></label>
+</div>
+<% } %>
+<div class="row">
+ <label data-trans="lan_domain" class="col-xs-6"></label>
+ <label class="col-xs-6"><%= lanDomain %></label>
+</div>
+<div class="row">
+ <label data-trans="ip_address" class="col-xs-6"></label>
+ <label class="col-xs-6"><%= ipAddress %></label>
+</div>
+<% if(showMacAddress){ %>
+<div class="row">
+ <label data-trans="mac_address" class="col-xs-6"></label>
+ <label class="col-xs-6"><%= macAddress %></label>
+</div>
+<% } %>
+<% if(showIpv4WanIpAddr){ %>
+<div class="row">
+ <label data-trans="wan_ip_address" class="col-xs-6"></label>
+ <label class="col-xs-6"><%= wanIpAddress %></label>
+</div>
+<% } %>
+<% if(showIpv6WanIpAddr){ %>
+<div class="row">
+ <label data-trans="ipv6_wan_ip_address" class="col-xs-6"></label>
+ <label class="col-xs-6"><%= ipv6WanIpAddress %></label>
+</div>
+<% } %>
+<div class="row">
+ <label data-trans="software_version" class="col-xs-6"></label>
+ <label class="col-xs-6"><%= sw_version %></label>
+</div>
+<div class="row">
+ <label data-trans="hardware_version" class="col-xs-6"></label>
+ <label class="col-xs-6"><%= hw_version %></label>
+</div>
+</script>
diff --git a/lynq/R305/ap/app/zte_webui/subpg/network_apn_set.html b/lynq/R305/ap/app/zte_webui/subpg/network_apn_set.html
new file mode 100755
index 0000000..c308b85
--- /dev/null
+++ b/lynq/R305/ap/app/zte_webui/subpg/network_apn_set.html
@@ -0,0 +1,220 @@
+<div id="innerContainer">
+ <div class="row header-row">
+ <div class="col-xs-1">
+ <a href="#main">
+ <img alt="" src="pic/direct-back.png">
+ </a>
+ </div>
+ <div class="col-xs-11">
+ <div class="form-title">
+ <h1 data-trans='net_setting'></h1>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-xs-2">
+ <div class="nav_right">
+ <ul>
+ <li><a data-trans="dial_mode" href="#conn_set"></a></li>
+ <li><a data-trans="net_select" href="#network_choose"></a></li>
+ <li class="active"><a data-trans="apn_setting" href="#cgdcont_set"></a></li>
+ </ul>
+ </div>
+ </div>
+
+ <div class="col-xs-10">
+
+<form id="apn_setting_form">
+ <div class="form-body">
+ <h3 data-trans="apn_setting" class="form-title"></h3>
+ <div class="content">
+ <!-- 当前APN -->
+ <div class="row form-group">
+ <label data-trans="apn_currentApn" class="col-xs-3 side-right"></label>
+ <label data-bind="text: defApn" class="col-xs-6"></label>
+ </div>
+ <!-- 模式 手动、自动 -->
+ <div class="row form-group">
+ <label data-trans="apn_mode" class="col-xs-3 side-right"></label>
+ <div class="col-xs-6">
+ <div class="row">
+ <div class="col-xs-4">
+ <input id="apnMode_auto" type="radio" name="apnMode" data-bind="checked: apnMode, event: {click: apnModeChangeHandler}, disable: autoApnChecked() == false && disableProfile() == true" value="auto"/>
+ <label for="apnMode_auto" data-trans="apn_auto_apn"></label>
+ </div>
+ <div class="col-xs-4">
+ <input id="apnMode_manual" type="radio" name="apnMode" data-bind="checked: apnMode, event: {click: apnModeChangeHandler}, disable: autoApnChecked() == false && disableProfile() == true" value="manual"/>
+ <label for="apnMode_manual" data-trans="apn_manual_apn"></label>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div id="apn_form_container" data-bind="visible: showAutoApnDetail()">
+ <div class="row form-group">
+ <label class="col-xs-3 side-right" for="profile" data-trans="apn_profile"></label>
+ <div class="col-xs-4">
+ <select id="autoProfile" name="autoProfile" data-bind="options: autoProfiles, value: selectedAutoProfile, optionsText: 'text', optionsValue: 'value', disable: disableProfile, event:{ change: autoProfileChangeHandler}, visible: apnMode() == 'auto'" class="form-control"></select>
+ <select id="profile" name="profile" data-bind="options: profiles, value: selectedProfile, optionsText: 'text', optionsValue: 'value', disable: disableProfile, event:{ change: profileChangeHandler}, visible: apnMode() == 'manual'" class="form-control"></select>
+ </div>
+
+ <div class="col-xs-2">
+ <input type="button" data-bind="click: addAct, visible: autoApnChecked() == false && disableProfile() == false && hasCapacity() == true" data-trans="add_new" class="btn btn-primary"/>
+ <input type="button" data-bind="click: cancelAddAct, visible: autoApnChecked() == false && disableProfile() == true && hasCapacity() == true" data-trans="cancel" class="btn btn-primary"/>
+ </div>
+ </div>
+ <div data-bind="visible: supportIPv6()" class="row form-group">
+ <label for="apn_pdp_type" data-trans="apn_pdp_type" class="col-xs-3 side-right"></label>
+ <div class="col-xs-6">
+ <select id="apn_pdp_type" name="apn_pdp_type" data-bind="options: pdpTypes, value: selectedPdpType, optionsText: 'text', optionsValue: 'value', disable: checkInputDisable, event:{ change: pdpTypeChangeAlert}" class="form-control"></select>
+ </div>
+ </div>
+ <div class="row form-group">
+ <label for="profile_name" data-trans="apn_profile_name" class="col-xs-3 side-right"></label>
+ <div class="col-xs-6">
+ <input id="profile_name" type="text" name="profile_name" data-bind="value: profileName, disable: checkInputDisable" maxlength="15" class="required form-control"/>
+ </div>
+ </div>
+ <div id="ipv4_section" data-bind="visible: selectedPdpType() != 'IPv6'">
+ <div class="row form-group">
+ <label for="apn_ipv4_apn" data-bind="attr:{'data-trans': transApn}" class="col-xs-3 side-right"></label>
+ <div class="col-xs-6">
+ <input id="apn_ipv4_apn" type="text" name="apn_ipv4_apn" data-bind="value: apn, disable: checkInputDisable" maxlength="64" class="required form-control"/>
+ </div>
+ </div>
+ <div class="row form-group" data-bind="visible: showApnDns()">
+ <label data-bind="attr:{'data-trans': transDnsMode}" class="col-xs-3 side-right"></label>
+ <div class="col-xs-6">
+ <input id="apn_auto_dns_ipv4" type="radio" name="apn_auto_dns_ipv4" data-bind="checked: dnsMode, disable: checkInputDisable" value="auto"/>
+ <label for="apn_auto_dns_ipv4" data-trans="apn_auto_dns"></label>
+ <input id="apn_manual_dns_ipv4" type="radio" name="apn_manual_dns_ipv4" data-bind="checked: dnsMode, disable: checkInputDisable" value="manual"/>
+ <label for="apn_manual_dns_ipv4" data-trans="apn_manual_dns"></label>
+ </div>
+ </div>
+ <div data-bind="visible: showDns() && showApnDns()" class="row form-group">
+ <label for="apn_dns1_ipv4" data-bind="attr:{'data-trans': transDns1}" class="col-xs-3 side-right"></label>
+ <div class="col-xs-6">
+ <input id="apn_dns1_ipv4" type="text" name="apn_dns1_ipv4" data-bind="value: dns1, disable: checkInputDisable" maxlength="15" class="required ipv4 form-control"/>
+ </div>
+ </div>
+ <div data-bind="visible: showDns() && showApnDns()" class="row form-group">
+ <label for="apn_dns2_ipv4" data-bind="attr:{'data-trans': transDns2}" class="col-xs-3 side-right"></label>
+ <div class="col-xs-6">
+ <input id="apn_dns2_ipv4" type="text" name="apn_dns2_ipv4" data-bind="value: dns2, disable: checkInputDisable" maxlength="15" class="ipv4 form-control"/>
+ </div>
+ </div>
+ <div class="row form-group">
+ <label for="apn_authentication_ipv4" data-bind="attr:{'data-trans': transAuth}" class="col-xs-3 side-right"></label>
+ <div class="col-xs-6">
+ <select id="apn_authentication_ipv4" name="apn_authentication_ipv4" data-bind="options: authModes, disable: checkInputDisable, value: selectedAuthentication, optionsText: 'text', optionsValue: 'value'" class="form-control"></select>
+ </div>
+ </div>
+ <div class="row form-group">
+ <label for="apn_user_name_ipv4" data-bind="attr:{'data-trans': transUserName}" class="col-xs-3 side-right"></label>
+ <div class="col-xs-6">
+ <input id="apn_user_name_ipv4" type="text" name="apn_user_name_ipv4" data-bind="value: username, disable: checkInputDisable" maxlength="64" class="form-control"/>
+ </div>
+ </div>
+ <div class="row form-group">
+ <label class="col-xs-3 side-right" for="apn_secretcode_ipv4" data-bind="attr:{'data-trans': transPassword}"></label>
+ <div class="col-xs-6">
+ <input id="apn_secretcode_ipv4" type="password" name="apn_secretcode_ipv4" data-bind="value: password,visible:!showPassword(), disable: checkInputDisable" maxlength="64" class="form-control"/>
+ <input id="apn_secretcode_ipv4_show" type="text" name="apn_secretcode_ipv4" data-bind="value: password,visible:showPassword(), disable: checkInputDisable" maxlength="64" class="form-control"/>
+ <div class="margin-top-10">
+ <p data-bind="css:{'checkbox_selected': showPassword()}, click: showPasswordHandler" manualControl="true" class="checkbox">
+ <input id="showPassword" data-bind="checked:showPassword" type="checkbox"/>
+ </p>
+ <label data-trans="display_password" class="floatleft lineheight25 margintop5"></label>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <!-- 以下是ipv6 -->
+
+ <div data-bind="visible: (selectedPdpType() == 'IPv4v6' && supportIpv4AndIpv6()) || selectedPdpType() == 'IPv6'">
+ <div class="row form-group">
+ <label for="apn_ipv6_apn" data-bind="attr:{'data-trans': transApnV6}" class="col-xs-3 side-right"></label>
+ <div class="col-xs-6">
+ <input id="apn_ipv6_apn" type="text" name="apn_ipv6_apn" data-bind="value: apnV6, disable: checkInputDisable" maxlength="64" class="required form-control"/>
+ </div>
+ </div>
+ <div data-bind="visible: showApnDns()" class="row form-group">
+ <label data-bind="attr:{'data-trans': transDnsModeV6}" class="col-xs-3 side-right"></label>
+ <div class="col-xs-6">
+ <input id="apn_auto_dns_ipv6" type="radio" name="dns_ipv6" data-bind="checked: dnsModeV6, disable: checkInputDisable" value="auto"/>
+ <label for="apn_auto_dns_ipv6" data-trans="apn_auto_dns"></label>
+ <input id="apn_manual_dns_ipv6" type="radio" name="dns_ipv6" data-bind="checked: dnsModeV6, disable: checkInputDisable" value="manual"/>
+ <label for="apn_manual_dns_ipv6" data-trans="apn_manual_dns"></label>
+ </div>
+ </div>
+ <div data-bind="visible: showDnsV6() && showApnDns()" class="row form-group">
+ <label for="apn_dns1_ipv6" data-bind="attr:{'data-trans': transDns1V6}" class="col-xs-3 side-right"></label>
+ <div class="col-xs-6">
+ <input id="apn_dns1_ipv6" type="text" name="apn_dns1_ipv6" data-bind="value: dns1V6, disable: checkInputDisable" class="required ipv6 form-control"/>
+ </div>
+ </div>
+ <div class="row form-group" data-bind="visible: showDnsV6() && showApnDns()">
+ <label class="col-xs-3 side-right" for="apn_dns2_ipv6" data-bind="attr:{'data-trans': transDns2V6}"></label>
+ <div class="col-xs-6">
+ <input id="apn_dns2_ipv6" type="text" name="apn_dns2_ipv6" data-bind="value: dns2V6, disable: checkInputDisable" class="ipv6 form-control"/>
+ </div>
+ </div>
+
+ <div class="row form-group">
+ <label for="authentication_ipv6" data-bind="attr:{'data-trans': transAuthV6}" class="col-xs-3 side-right"></label>
+ <div class="col-xs-6">
+ <select id="authentication_ipv6" name="authentication_ipv6" data-bind="options: authModes, disable: checkInputDisable, value: selectedAuthenticationV6, optionsText: 'text', optionsValue: 'value'" class="form-control"></select>
+ </div>
+ </div>
+ <div class="row form-group">
+ <label for="apn_user_name_ipv6" data-bind="attr:{'data-trans': transUserNameV6}" class="col-xs-3 side-right"></label>
+ <div class="col-xs-6">
+ <input id="apn_user_name_ipv6" type="text" name="apn_user_name_ipv6" data-bind="value: usernameV6, disable: checkInputDisable" maxlength="64" class="form-control"/>
+ </div>
+ </div>
+ <div class="row form-group">
+ <label for="apn_secretcode_ipv6" data-bind="attr:{'data-trans': transPasswordV6}" class="col-xs-3 side-right"></label>
+ <div class="col-xs-6">
+ <input id="apn_secretcode_ipv6" type="password" name="apn_secretcode_ipv6" data-bind="value: passwordV6,visible:!showPassword(), disable: checkInputDisable" maxlength="64" class="form-control"/>
+ <input id="apn_secretcode_ipv6_show" type="text" name="apn_secretcode_ipv6" data-bind="value: passwordV6,visible:showPassword(), disable: checkInputDisable" maxlength="64" class="form-control"/>
+ <div class="margin-top-10">
+ <p data-bind="css:{'checkbox_selected': showPassword()}, click: showPasswordHandler" manualControl="true" class="checkbox">
+ <input id="showV6Password" data-bind="checked:showPassword" type="checkbox"/>
+ </p>
+ <label data-trans="display_password" class="floatleft lineheight25 margintop5"></label>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="row form-group">
+ <label for="apn_secretcode_ipv6" data-trans="dial_num" class="col-xs-3 side-right"></label>
+ <label class="col-xs-6" data-bind="text: wanDial"></label>
+ </div>
+ </div>
+ </div>
+ <div class="form-buttons">
+ <input type="button" data-bind="click: setDefaultAct, visible: disableProfile() == false && setDefaultVisible() && !defaultCfg()" data-trans="set_default" class="btn btn-primary"/>
+ <input type="submit" formmethod="post" data-bind="visible: (!autoApnChecked() && !predeterminedCfg()) || disableProfile() == true" data-trans="apply" class="btn btn-primary"/>
+ <input type="button" data-bind="click: deleteAct, visible: !autoApnChecked() && !defaultCfg() && !predeterminedCfg() && !disableProfile()" data-trans="delete" class="btn btn-primary"/>
+ </div>
+ <div class="form-note">
+ <div class="notes-title"> </div>
+ <ul class="notes-content">
+ <li data-trans="apn_note_whole_page"></li>
+ <li data-trans="apn_note_mode"></li>
+ <li data-trans="apn_note_profile"></li>
+ <li data-trans="apn_note_pdp_type" data-bind="visible: supportIPv6()"></li>
+ <li data-trans="apn_note_profile_name"></li>
+ <li data-trans="apn_note_apn"></li>
+ <li data-trans="apn_note_dns_mode" data-bind="visible: showApnDns()"></li>
+ <li data-trans="apn_note_authentication"></li>
+ <li data-trans="apn_note_username"></li>
+ <li data-trans="apn_note_password"></li>
+ <li data-trans="apn_note_set_default"></li>
+ </ul>
+ </div>
+ </div>
+</form>
+ </div>
+</div>
+</div>
\ No newline at end of file
diff --git a/lynq/R305/ap/app/zte_webui/subpg/network_dial_set.html b/lynq/R305/ap/app/zte_webui/subpg/network_dial_set.html
new file mode 100755
index 0000000..e59b1ca
--- /dev/null
+++ b/lynq/R305/ap/app/zte_webui/subpg/network_dial_set.html
@@ -0,0 +1,68 @@
+<div id="innerContainer">
+ <div class="row header-row">
+ <div class="col-xs-1">
+ <a href="#main">
+ <img alt="" src="pic/direct-back.png">
+ </a>
+ </div>
+ <div class="col-xs-11">
+ <div class="form-title">
+ <h1 data-trans='net_setting'></h1>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-xs-2">
+ <div class="nav_right">
+ <ul>
+ <li class="active"><a data-trans="dial_mode" href="#conn_set"></a></li>
+ <li><a data-trans="net_select" href="#network_choose"></a></li>
+ <li><a data-trans="apn_setting" href="#cgdcont_set"></a></li>
+ </ul>
+ </div>
+ </div>
+
+ <div class="col-xs-10">
+
+<form>
+<div class="form-body">
+ <h3 data-trans="dial_mode" class="form-title"></h3>
+ <div class="content">
+ <div class="row form-group">
+ <label data-trans='dial_mode' class="col-xs-3 side-right"></label>
+ <div class="col-xs-2">
+ <input id='auto_mode' type="radio" name="modeGroup" value="auto_dial" data-bind="checked: selectMode, enable: enableFlag" />
+ <label for='auto_mode' data-trans='auto_select'></label>
+ </div>
+ <div class="col-xs-2">
+ <input id='manual_mode' type="radio" name="modeGroup" value="manual_dial" data-bind="checked: selectMode, enable: enableFlag" />
+ <label for='manual_mode' data-trans='manual_select'></label>
+ </div>
+ </div>
+
+ <div data-bind="visible: selectMode() == 'auto_dial'" class="row form-group">
+ <div class="col-xs-3"></div>
+ <div class="col-xs-8 label-absolute">
+ <p id="roamBtn" data-bind="css:{'checkbox_selected': isAllowedRoaming()=='on'}, click: setAllowedRoaming" manualControl="true"class="checkbox floatleft margintop5 checkboxToggle">
+ <input type="checkbox" id="isAllowedRoaming" value="on" data-bind="checked:isAllowedRoaming()=='on'" />
+ </p>
+ <label for="isAllowedRoaming" data-trans="dial_roaming_remind" class="update_inline floatleft lineheight25"></label>
+ </div>
+ </div>
+ </div>
+ <div class="form-buttons">
+ <input type="button" data-bind='click: save, enable: enableFlag' data-trans="apply" class="btn btn-primary"/>
+ </div>
+ <div class="form-note">
+ <div class="notes-title"> </div>
+ <ul class="notes-content">
+ <li data-trans="diconneted_operate_note"></li>
+ <li data-trans="dial_setting_note_automatic"></li>
+ <li data-trans="dial_setting_note_manual"></li>
+ </ul>
+ </div>
+</div>
+</form>
+ </div>
+</div>
+</div>
\ No newline at end of file
diff --git a/lynq/R305/ap/app/zte_webui/subpg/network_net_select.html b/lynq/R305/ap/app/zte_webui/subpg/network_net_select.html
new file mode 100755
index 0000000..c7bb48c
--- /dev/null
+++ b/lynq/R305/ap/app/zte_webui/subpg/network_net_select.html
@@ -0,0 +1,106 @@
+<div id="innerContainer">
+ <div class="row header-row">
+ <div class="col-xs-1">
+ <a href="#main">
+ <img alt="" src="pic/direct-back.png">
+ </a>
+ </div>
+ <div class="col-xs-11">
+ <div class="form-title">
+ <h1 data-trans='net_setting'></h1>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-xs-2">
+ <div class="nav_right">
+ <ul>
+ <li><a data-trans="dial_mode" href="#conn_set"></a></li>
+ <li class="active"><a data-trans="net_select" href="#network_choose"></a></li>
+ <li><a data-trans="apn_setting" href="#cgdcont_set"></a></li>
+ </ul>
+ </div>
+ </div>
+
+ <div class="col-xs-10">
+
+<form role="form">
+<div class="form-body">
+ <h3 data-trans="net_select" class="form-title"></h3>
+ <div class="content">
+ <div class="row form-group">
+ <label data-trans='net_select' class="col-xs-4 side-right"></label>
+ <div class="col-xs-8">
+ <div class="row">
+ <div class="col-xs-4">
+ <input id='auto_select' type="radio" name="selectGroup" value="auto_select" data-bind="checked: selectMode, enable: enableFlag" />
+ <label for='auto_select' data-trans='auto_select'></label>
+ </div>
+ <div class="col-xs-6">
+ <select id="type" data-transid='auto_select_type' data-bind="options: types, value: selectedType, optionsText: transOption('auto_select_type'), optionsValue: 'value', enable: enableFlag() && selectMode() == 'auto_select'" class="form-control"></select>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="row form-group">
+ <label class="col-xs-4 side-right"></label>
+ <div class="col-xs-8">
+ <input id='manual_select' type="radio" name="selectGroup" value="manual_select" data-bind="checked: selectMode, enable: enableFlag" />
+ <label for='manual_select' data-trans='manual_select'></label>
+ </div>
+ </div>
+ </div>
+ <div class="form-buttons">
+ <input type="button" data-bind='click: save, visible: selectMode() == "auto_select", enable: enableFlag, css: {disabled: !enableFlag()}' data-trans='apply' class="btn btn-primary"/>
+ <input type="button" data-bind='click: search, visible: selectMode() != "auto_select", enable: enableFlag, css: {disabled: !enableFlag()}' data-trans='search' class="btn btn-primary"/>
+ </div>
+
+ <div data-bind='visible: networkList().length > 0 && selectMode() == "manual_select"' class="content">
+ <div class="form-title">
+ <h2 data-trans='network_list'></h2>
+ </div>
+ <div class="content">
+ <div class="ko-grid-container marginnone">
+ <table cellspacing="0" cellpadding="0" class="table table-striped table-hover">
+ <thead>
+ <tr>
+ <th width="12%" data-trans="option"></th>
+ <th width="16%" data-trans="net_status"></th>
+ <th width="21%" data-trans="network_provider"></th>
+ <th width="18%" data-trans="mccmnc"></th>
+ <th width="18%" data-trans="networktype"></th>
+ <th width="15%" data-trans="subnet"></th>
+ </tr>
+ </thead>
+ <tbody data-bind='foreach: networkList'>
+ <tr data-bind="css:{odd:$index()%2==1, even:$index()%2==0}">
+ <td><input type="radio" name="networkGroup"
+ data-bind='value: $root.networkValue($data), checked: $root.selectNetwork, attr: {id: $root.networkValue($data)}, enable: $root.enableFlag'/>
+ </td>
+ <td data-bind='attr: {"data-trans": $root.networkStatusId($data)}, text: $root.networkStatus($data)'></td>
+ <td data-bind='text: $root.operatorName($data)'></td>
+ <td data-bind='text: $root.networkText($data)'></td>
+ <td data-bind='attr: {"data-trans": $root.networkTypeId($data)}, text: $root.networkType($data)'></td>
+ <td data-bind='attr: {"data-trans": $root.subnetTypeId($data)}, text: $root.subnetworkType($data)'></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <div class="form-buttons">
+ <input type="button" data-bind='click: register, enable: selectNetwork() != "" && enableFlag, css: {disabled: selectNetwork() == "" || !enableFlag()}' data-trans='register' class="btn btn-primary"/>
+ </div>
+ </div>
+ <div class="form-note">
+ <div class="notes-title"> </div>
+ <ul class="notes-content">
+ <li data-trans="diconneted_operate_note"></li>
+ <li data-trans="net_select_note_automatic"></li>
+ <li data-trans="net_select_note_manual"></li>
+ </ul>
+ </div>
+</div>
+</form>
+ </div>
+</div>
+</div>
\ No newline at end of file
diff --git a/lynq/R305/ap/app/zte_webui/subpg/ota_update.html b/lynq/R305/ap/app/zte_webui/subpg/ota_update.html
new file mode 100755
index 0000000..f7a84de
--- /dev/null
+++ b/lynq/R305/ap/app/zte_webui/subpg/ota_update.html
@@ -0,0 +1,148 @@
+<div id="innerContainer">
+ <div class="row header-row">
+ <div class="col-xs-1">
+ <a href="#main">
+ <img alt="" src="pic/direct-back.png">
+ </a>
+ </div>
+ <div class="col-xs-11">
+ <div class="form-title">
+ <h1 data-trans='advanced_settings'></h1>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-xs-2">
+ <div class="nav_right">
+ <ul>
+ <li data-bind="visible: isDataCard"><a href="#demilitarized_zone" data-trans="dmz_setting"></a></li>
+ <li data-bind="visible: isDataCard"><a href="#pin_mode" data-trans="pin_management"></a></li>
+ <li data-bind="visible: !isDataCard"><a href="#wlan_sleep" data-trans="sleep_mode"></a></li>
+ <li data-bind="visible: !isDataCard"><a href="#route_set" data-trans="router_setting"></a></li>
+ <li data-bind="visible: !isDataCard"><a href="#filter_main" data-trans="firewall"></a></li>
+ <li data-bind="visible:hasUpdateCheck" class="active"><a href="#fota" data-trans="update_settings"></a></li>
+ <li data-bind="visible:hasUssd"><a href="#usat" data-trans="USSD"></a></li>
+ <li data-bind="visible:hasDdns"><a href="#dynamic_dns" data-trans="DDNS"></a></li>
+ <li data-bind="visible: !isDataCard"><a href="#more" data-trans="others"></a></li>
+ </ul>
+ </div>
+ </div>
+
+<div class="col-xs-10">
+<form id="frmOTAUpdate" role="form" data-bind="visible: updateType() == 'mifi_fota'">
+ <h3 data-trans="ota_update_manual" class="form-title"></h3>
+ <div class="form-body margin-top-20">
+ <div class="content">
+ <div class="row">
+ <div class="col-xs-6">
+ <!--span data-trans="ota_last_update_check"></span>
+ <span data-bind="text: lastCheckTime"></span-->
+ </div>
+ <div class="col-xs-6 align-right">
+ <input id="btnCheckNewVersion" data-bind="click:checkNewVersion" data-trans="ota_check_new_version" type="button" class="btn btn-primary margin-right-20"/>
+ </div>
+ </div>
+ <div class="form-note">
+ <div class="notes-title"> </div>
+ <ul class="notes-content">
+ <li data-trans="ota_check_new_version_desc"></li>
+ </ul>
+ </div>
+ </div>
+
+ <!--div class="form-title" data-trans='ota_update_manual'></div>
+ <div class="content">
+ <span class="paddingleft25" data-trans="ota_check_new_version_desc"></span>
+ </div>
+ <div class="form-buttons">
+ <input id="btnCheckNewVersion" type="button" class="btn btn-primary" data-trans="ota_check_new_version"
+ data-bind="click:checkNewVersion"/>
+ </div>
+ <div class="form-title" data-trans='ota_update_setting'></div-->
+ <div class="content">
+ <h3 data-trans="ota_update_setting" class="form-title"></h3>
+ <div class="row">
+ <label data-trans="ota_auto_update_switch" class="col-xs-4 side-right"></label>
+ <div class="col-xs-8">
+ <div class="row form-group">
+ <div class="col-xs-3">
+ <input id="auto_update_enable" name="updateMode" data-bind="checked: updateMode" type="radio" value="1"/>
+ <label data-trans="enable" for="auto_update_enable"></label>
+ </div>
+ <div class="col-xs-3">
+ <input id="auto_update_disable" name="updateMode" data-bind="checked: updateMode" type="radio" value="0"/>
+ <label data-trans="disable" for="auto_update_disable"></label>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="row form-group" data-bind="visible: false">
+ <label data-trans="ota_update_interval_day" for="selInterValDay" class="col-xs-4 side-right"></label>
+
+ <div class="col-xs-3">
+ <select id="selInterValDay" name="selInterValDay" data-bind="value: updateIntervalDay" class="form-control">
+ <option data-trans="ota_update_every_day" value="1"></option>
+ <option data-trans="ota_update_15_day" value="15"></option>
+ <option data-trans="ota_update_30_day" value="30"></option>
+ </select>
+ </div>
+ </div>
+ <div class="row form-group" data-bind="visible: updateMode()=='1'">
+ <div class="col-xs-12 padding-top-10">
+ <p class="checkbox" data-bind="css:{'checkbox_selected': allowRoamingUpdate()=='1'}, click: clickAllowRoamingUpdate"
+ manualControl="true">
+ <input id="chkUpdateRoamPermission" name="chkUpdateRoamPermission" data-bind="checked:allowRoamingUpdate()=='1'" type="checkbox" value="1"/>
+ </p>
+ <label data-trans="ota_update_roaming_remind" class="update_inline floatleft"></label>
+ </div>
+ </div>
+
+ <div class="form-buttons">
+ <input id="btnApply" data-trans="apply" type="submit" formmethod="post" class="btn btn-primary"/>
+ </div>
+ <div class="form-note">
+ <div class="notes-title"> </div>
+ <ul class="notes-content">
+ <li data-trans="fota_note1"></li>
+ </ul>
+ </div>
+ </div>
+
+ </div>
+</form>
+<!--form id="frmNativeUpdate" data-bind="visible: updateType() == 'mifi_local'" method="post" name="UploadFile" id="UploadFile" action="../../cgi-bin/upload.cgi" enctype="multipart/form-data" target="ifr">
+ <div class="form-body">
+ <h3 class="form-title" data-trans="software_upload"></h3>
+ <table style="width:100%">
+ <input type="text" id="upfile" size="20" style="height:35px; width:200px; display:inline-block;" readonly />
+ <input type="button" class="btn btn-primary" data-trans='browse_btn' style="height:34px; width:81px;" />
+ <input id="fileName" class="form-control" type="file" name="fileName" style="margin-left: 15px;background-color:#E3E3E3;opacity:0;filter:alpha(opacity=0);position:absolute;left:0px; width:280px; display:inline-block;" />
+ <input class="btn btn-primary" id="fileuploadsubmit" type="submit" formmethod="post" data-trans="ota_title" style="float:right; margin-top:8px; margin-right: 20px;" />
+ </table>
+ <iframe name="ifr" id="ifr" style="display:none;"></iframe>
+ </div>
+</form-->
+ <div id="uploadSection" data-bind="visible: updateType() == 'mifi_local'">
+ <h3 class="form-title" data-trans="software_upload"></h3>
+ <iframe id="fileUploadIframe" name="fileUploadIframe" frameborder="0" height="0" scrolling="no" style="height:0px;width:0px;" width="0"></iframe>
+ <form id="fileUploadForm" name="fileUploadForm" action="../../cgi-bin/upload/upload.cgi" enctype="multipart/form-data" method="post" target="fileUploadIframe">
+ <input id="fileField" name="filename" dir="ltr" maxlength="200" type="file"/>
+ <div class="fileUploadDiv">
+ <input id="fileUploadApplyBtn" name="fileUploadApplyBtn" data-trans="ota_title" type="button" onclick="fileUploadSubmitClickHandler();" class="btn btn-primary margin-left-5 margin-top-2"/>
+ </div>
+ <div class="clear"></div>
+ </form>
+ </div>
+ <form data-bind="visible: updateType() == 'mifi_local'">
+ <div class="form-body">
+ <div class="form-note">
+ <div class="notes-title"> </div>
+ <ul class="notes-content">
+ <li data-trans="local_note"></li>
+ </ul>
+ </div>
+ </div>
+ </form>
+</div>
+</div>
+</div>