📄 weblib.h
字号:
/*
* Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
* All rights reserved.
*
* This software is copyrighted by and is the sole property of
* VIA Networking Technologies, Inc. This software may only be used
* in accordance with the corresponding license agreement. Any unauthorized
* use, duplication, transmission, distribution, or disclosure of this
* software is expressly forbidden.
*
* This software is provided by VIA Networking Technologies, Inc. "as is"
* and any express or implied warranties, including, but not limited to, the
* implied warranties of merchantability and fitness for a particular purpose
* are disclaimed. In no event shall VIA Networking Technologies, Inc.
* be liable for any direct, indirect, incidental, special, exemplary, or
* consequential damages.
*
*
* File: weblib.h
*
* Purpose:
*
* Author: Jenda Jao
*
* Date: Jan 08, 2002
*
*/
#ifndef __WEBLIB_H__
#define __WEBLIB_H__
#if !defined(__TTYPE_H__)
#include "ttype.h"
#endif
#include "pigencfg.h"
/*--------------------- Export Definitions ------------------------*/
#define MAX_CGI_PARA_NUM 4100 //4096+4
#define WEBg_pSPortPage (&WEBg_UCfgBuf.SPageCfg_Port)
#define WEBg_pSRatePage (&WEBg_UCfgBuf.SPageCfg_Rate)
#define WEBg_pSQosPage (&WEBg_UCfgBuf.SPageCfg_Qos)
#define WEBg_pSPortStatus (&WEBg_UCfgBuf.SPage_PortStatus)
#define WEBg_pSTrkPage (&WEBg_UCfgBuf.SPageCfg_Trunk)
#define WEBg_pSVlanPage (&WEBg_UCfgBuf.SPageCfg_Vlan)
#define WEBg_pSCurGrp (&WEBg_UCfgBuf.SPageCfg_Vlan.SCurGrp)
#define WEBg_pSVlanIngrFlt (&WEBg_UCfgBuf.SPageCfg_VlanIngrFlt)
#define WEBg_pSMiscPage (&WEBg_UCfgBuf.SPageCfg_Misc)
#define WEBg_pSAdmPage (&WEBg_UCfgBuf.SPageCfg_Admin)
#define WEBg_pSSniffPage (&WEBg_UCfgBuf.SPageCfg_Sniff)
#define WEBg_pbyChipVer (&WEBg_UCfgBuf.byChipVer)
#define WEBg_pSIpConfPage (&WEBg_UCfgBuf.SPageCfg_IpConf)
#define WEBg_pSFwUpdtPage (&WEBg_UCfgBuf.SPageCfg_FwUpdt)
#define WEBg_pSSTPPage (&WEBg_UCfgBuf.SPageCfg_STP)
#define WEBg_pSIGMPPage (&WEBg_UCfgBuf.SPageCfg_IGMP)
#define WEBg_pSMibCnt (&WEBg_UCfgBuf.SPageCfg_MIB)
#define WEBg_pSSMacPage (&WEBg_UCfgBuf.SPageCfg_SMAC)
#define WEBg_pSGMRPPage (&WEBg_UCfgBuf.SPageCfg_GMRP)
#define WEBg_pS8021XPage (&WEBg_UCfgBuf.SPageCfg_8021X)
#define WEBg_pSPrvMiscPage (&WEBg_UCfgBuf.SPageCfg_ProvMisc)
#define WEBg_pSACLPage (&WEBg_UCfgBuf.SPageCfg_ACL)
#define WEBg_pSMacFltPage (&WEBg_UCfgBuf.SPageCfg_MACFlt)
/*--------------------- Export Types ------------------------------*/
// Parameter list struct used by CGI
// Jenda:
// HTML supported limination:
// 1.Only implement "GET" method.
// 2.Do NOT convert '+' to space or decode HTML 8bit encoded string.
// 3.All output HTML content is printed by CGI functions.
// Normally, the parameters of CGI are in the form of name-value pair, and the
// order of parameters is trivial. However, in order to save ram and code size,
// the value of pair is parsed out and dealt with. The order of parameter array
// should be handled by programmer. Usually, the order of parameters is the one
// of form input HTML tags. It depends on the kinds of browsers.
typedef struct tagSWEBCgiInfo {
PSTR apszParaVal[MAX_CGI_PARA_NUM];
UINT16 u16ParaNum;
} SWEBCgiInfo;
/*--------------------- Export Macros -----------------------------*/
/*--------------------- Export Classes ----------------------------*/
/*--------------------- Export Variables --------------------------*/
extern UConfigBuf WEBg_UCfgBuf;
extern SWEBCgiInfo WEBg_SCgiInfo;
extern BOOL WEBg_bLoginEn;
extern char g_szHtmlOkHeader[];
/*--------------------- Export Functions --------------------------*/
void WEB_vReboot(void);
// Generate packet from HTTP request
UINT16 WEB_wProcHttpRequest(PUINT8 abyInBuf);
UINT16 WEB_wGenResultMsgPkt(char* szMsg);
UINT16 WEB_wGenRedirectPkt(char* szFilename);
UINT16 WEB_wPopupMsgBoxThenRedirect(char* szMsg, char* szUrl);
// generate a unique key and set it to g_aszWebLoginID
void WEB_vGenUniqueLoginID(void);
// Output <SELECT> tag for listbox option
UINT16 WEB_wAddSelectTag(PSTR pszOutBuf, char cName, UINT8 byName, char** aszStringTable, UINT8 byStringNum, UINT8 bySelected, BOOL bIsAddTD, char* szExtraAttrib);
// Output <INPUT type=checkbox> tag for multiple-checked option
UINT16 WEB_wAddCheckboxTag(PSTR pszOutBuf, UINT8 byName, UINT8 byValue, BOOL bChecked);
// Output <INPUT type=radio> tag for only-one-checked option
UINT16 WEB_wAddRadioTag(PSTR pszOutBuf, UINT8 byName, UINT8 byValue, BOOL bChecked);
#endif /* __WEBLIB_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -