📄 pg8021x.c
字号:
/*
* 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: pg8021x.c
*
* Purpose: 802.1X module UI definitions
*
* Author: Freeya Lin
*
* Date: Dec 11, 2003
*
* Functions:
*
* Revision History:
*
*/
#include "engine.h"
#include "eng_act.h"
#include "allpages.h"
#include "piportmp.h"
#include "pigencfg.h"
#include "str.h"
#include "cfgstr.h"
#include "pgsniff.h"
#include "gen_act.h"
#include "pimsg.h"
#include "eng_io.h"
#include "pg8021x.h"
#include "cfgstr.h"
#include "pi8021x.h"
char str8021XTitle1[] = "Port Security";
// assign fix label
SFixLabel aSFixLabel8021X[] = {
{{ 2,26}, g_strProv8021X, 0},
{{ 3,26}, "=", 22},
{{ 5,3}, "802.1X protocol :", 0},
{{24, 2}, g_strHelpMsg, 0},
{{6,3}, str8021XTitle1, 0},
{{6,43}, str8021XTitle1, 0},
{{7, 3}, "-", 20},
{{7,43}, "-", 20},
};
// assign var label
SItem aSVarLabel8021XPortNum[] = {
{{8,3}, &g_SIListboxLogPortName, "", ITEM_LISTBOX, REPEAT_TYPE_RECT_SINGLE, LINK_TYPE_NONE, ROW_NUM_IN_2_FIELD, 40}
};
// assign item
SItemListbox aSIListbox8021X[] = {
{(PUINT8)g_pS8021XPageCfg, 0, 7, 0, g_aszEnDisCfg, 2},
{(PUINT8)g_pS8021XPageCfg->abySecPortMsk, 0, 0, 1, g_aszEnDisCfg, 2}
};
SItem aSItem8021XPortState[] = {
{{ 5,23}, aSIListbox8021X, "", ITEM_LISTBOX, REPEAT_TYPE_NONE, LINK_TYPE_LISTBOX},
{{ 8,15}, aSIListbox8021X+1, "", ITEM_LISTBOX, REPEAT_TYPE_RECT_SINGLE, LINK_TYPE_NONE, ROW_NUM_IN_2_FIELD, 40}
};
// action
SActItem aSActionProv8021XMenu[] = {
{{22, 12}, g_strActionQuit, PAACT_bQuit},
{{22, 22}, g_strActionEdit, PA8021X_bEdit8021X},
{{22, 32}, g_strActionSave, PA8021X_bSave8021X},
};
// sniff enable page
SPage g_SPage8021XEn = {
aSFixLabel8021X, 8,
aSVarLabel8021XPortNum, 1,
aSItem8021XPortState, 2,
aSActionProv8021XMenu, 3,
PA8021X_bLoad8021X
};
// sniff disable page
SPage g_SPage8021XDis = {
aSFixLabel8021X, 4,
0, 0,
aSItem8021XPortState, 1,
aSActionProv8021XMenu, 3,
PA8021X_bLoad8021X
};
//////////////////////////////////////////////////////////////////////////
#define g_8021XMode g_pS8021XPageCfg->byMode
static UINT8 sg_aby8021XPageID[] = {PAGE_PROV_8021X_DISABLE, PAGE_PROV_8021X_ENABLE};
BOOL PA8021X_bChangePage(void)
{
if (g_byCurPageID != sg_aby8021XPageID[g_8021XMode])
{
g_byCurPageID = sg_aby8021XPageID[g_8021XMode];
if (g_byCurPageID != PAGE_PROV_8021X_DISABLE)
g_wTotalLineNum = g_byLogIdNum;
return RELOAD_PAGE;
}
return DONT_RELOAD_PAGE;
}
BOOL PA8021X_bLoad8021X(void)
{
PI8021X_vInitPage(g_pS8021XPageCfg);
PA8021X_bChangePage();
return DONT_RELOAD_PAGE;
}
BOOL PA8021X_bEdit8021X(void)
{
if (PAACT_bEdit())
return RELOAD_PAGE;
// deal with dynamic page
if (PA8021X_bChangePage())
ENGvPrintPage(); // in this page, changing page may not reload config, just re-print page only
return DONT_RELOAD_PAGE;
}
BOOL PA8021X_bSave8021X(void)
{
UINT8 byErrCode;
PIMSG_vPutSavingMsg();
byErrCode = PI8021X_bySavePage(g_pS8021XPageCfg);
PIMSG_vPutMsgThenPause(byErrCode);
if (byErrCode == OP_OK)
g_bDataDirty = 0;
return DONT_RELOAD_PAGE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -