⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 weblib.h

📁 VIA VT6524 8口网管交换机源码
💻 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"
#include "taskweb.h"



/*---------------------  Export Definitions  ------------------------*/
#define MAX_CGI_PARA_NUM        104 //26*4

#define WEBg_pSPortPage     (&WEBg_UCfgBuf.SPageCfg_Port)
#ifdef __ASIC_VT6526
#define WEBg_pSRatePage     (&WEBg_UCfgBuf.SPageCfg_Rate)
#endif
#ifndef __ASIC_VT6524
#define WEBg_pSQosPage      (&WEBg_UCfgBuf.SPageCfg_Qos)
#else
#define WEBg_pSQosPage      (&WEBg_UCfgBuf.SPageCfg_Port)
#endif
#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)

/*---------------------  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];
    BYTE    byParaNum;
} SWEBCgiInfo;


/*---------------------  Export Macros  -----------------------------*/

/*---------------------  Export Classes  ----------------------------*/

/*---------------------  Export Variables  --------------------------*/
extern UConfigBuf  WEBg_UCfgBuf;
extern SWEBCgiInfo WEBg_SCgiInfo;
extern BOOL        WEBg_bLoginEbl;

extern DIRECT_MEMTYPE_CODE char g_szHtmlOkHeader[];

/*---------------------  Export Functions  --------------------------*/
// Generate packet from HTTP request
UINT16  WEB_wProcHttpRequest(PBYTE 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 WEBg_szLoginID
void    WEB_vGenUniqueLoginID(void);

// Output <SELECT> tag for listbox option
UINT16  WEB_wAddSelectTag(PBYTE pbyOutBuf, char cName, BYTE byName, char** aszStringTable, BYTE byStringNum, BYTE bySelected, BOOL bIsAddTD, char* szExtraAttrib);
// Output <INPUT type=checkbox> tag for multiple-checked option
UINT16  WEB_wAddCheckboxTag(PBYTE pbyOutBuf, BYTE byName, BYTE byValue, BOOL bChecked);
// Output <INPUT type=radio> tag for only-one-checked option
//UINT16  WEB_wAddRadioTag(PBYTE pbyOutBuf, BYTE byName, BYTE byValue, BYTE byChecked);




#endif /* __WEBLIB_H__ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -