📄 pgmib.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: pgmib.c
*
* Purpose:
*
* Author: Freeya Lin
*
* Date: 06 / 14, 2004
*
* Functions:
*
* Revision History:
*
*/
#include "engine.h"
#include "eng_act.h"
#include "allpages.h"
#include "pigencfg.h"
#include "gen_act.h"
#include "piportmp.h"
#include "pimsg.h"
#include "pgmib.h"
#include "pimib.h"
/* 10 20 30 40 50 60 70 80*/
/*12345678901234567890123456789012345678901234567890123456789012345678901234567890*/
char strMibCntTitle[] = "Port RxGoodPkt RxBadPkt TxGoodPkt TxBadPkt DropPkt TxAbrt Collision ";
// assign fix label
SFixLabel aSFixLabelMibCntCfgPrev[] = {
{{2,31}, g_strPortCntrs, 0},
{{3,31}, "=", 18},
{{6,3}, strMibCntTitle, 0},
{{7,3}, "-", 75},
{{8,3}, "PORT1", 0},
{{9,3}, "PORT2", 0},
{{10,3}, "PORT3", 0},
{{11,3}, "PORT4", 0},
{{12,3}, "PORT5", 0},
{{13,3}, "PORT6", 0},
{{14,3}, "PORT7", 0},
{{15,3}, "PORT8", 0},
{{16,3}, "PORT9", 0},
{{17,3}, "PORT10", 0},
{{18,3}, "PORT11", 0},
{{19,3}, "PORT12", 0},
{{20,3}, "PORT13", 0},
{{24,2}, g_strHelpMsg, 0},
};
SItemNum SIHexIGMPMibCnt1 = {
(PUINT8)&g_pSMIBPageCfg->aSPortStatistic[0].dwRxGoodPkt,
4, 8, sizeof(SPortStatistic)
};
SItemNum SIHexIGMPMibCnt2 = {
(PUINT8)&g_pSMIBPageCfg->aSPortStatistic[0].dwRxBadPkt,
4, 8, sizeof(SPortStatistic)
};
SItemNum SIHexIGMPMibCnt3 = {
(PUINT8)&g_pSMIBPageCfg->aSPortStatistic[0].dwTxGoodPkt,
4, 8, sizeof(SPortStatistic)
};
SItemNum SIHexIGMPMibCnt4 = {
(PUINT8)&g_pSMIBPageCfg->aSPortStatistic[0].dwTxBadPkt,
4, 8, sizeof(SPortStatistic)
};
SItemNum SIHexIGMPMibCnt5 = {
(PUINT8)&g_pSMIBPageCfg->aSPortStatistic[0].dwDropPkt,
4, 8, sizeof(SPortStatistic)
};
SItemNum SIHexIGMPMibCnt6 = {
(PUINT8)&g_pSMIBPageCfg->aSPortStatistic[0].dwTxAbort,
4, 8, sizeof(SPortStatistic)
};
SItemNum SIHexIGMPMibCnt7 = {
(PUINT8)&g_pSMIBPageCfg->aSPortStatistic[0].dwCollision,
4, 8, sizeof(SPortStatistic)
};
SVarLabel aSVarLabelMibCnt[] = {
{{8,11}, &SIHexIGMPMibCnt1, "", ITEM_HEXNUM, REPEAT_TYPE_RECT_MULTI, LINK_TYPE_NONE, ROW_NUM_IN_2_FIELD, 40},
{{8,21}, &SIHexIGMPMibCnt2, "", ITEM_HEXNUM, REPEAT_TYPE_RECT_MULTI, LINK_TYPE_NONE, ROW_NUM_IN_2_FIELD, 40},
{{8,31}, &SIHexIGMPMibCnt3, "", ITEM_HEXNUM, REPEAT_TYPE_RECT_MULTI, LINK_TYPE_NONE, ROW_NUM_IN_2_FIELD, 40},
{{8,41}, &SIHexIGMPMibCnt4, "", ITEM_HEXNUM, REPEAT_TYPE_RECT_MULTI, LINK_TYPE_NONE, ROW_NUM_IN_2_FIELD, 40},
{{8,51}, &SIHexIGMPMibCnt5, "", ITEM_HEXNUM, REPEAT_TYPE_RECT_MULTI, LINK_TYPE_NONE, ROW_NUM_IN_2_FIELD, 40},
{{8,60}, &SIHexIGMPMibCnt6, "", ITEM_HEXNUM, REPEAT_TYPE_RECT_MULTI, LINK_TYPE_NONE, ROW_NUM_IN_2_FIELD, 40},
{{8,70}, &SIHexIGMPMibCnt7, "", ITEM_HEXNUM, REPEAT_TYPE_RECT_MULTI, LINK_TYPE_NONE, ROW_NUM_IN_2_FIELD, 40},
};
// action
SActItem aSActionMibCnt[] = {
{{22, 12}, g_strActionQuit, PAACT_bQuit},
{{22, 22}, "<NextPage>", PAMIB_bNextPage},
{{22, 36}, "<ClearAllCntr>", PAMIB_bClearAllCntrPage},
};
// assign fix label
SFixLabel aSFixLabelMibCntCfgNext[] = {
{{2,31}, g_strPortCntrs, 0},
{{3,31}, "=", 18},
{{6,3}, strMibCntTitle, 0},
{{7,3}, "-", 75},
{{8,3}, "PORT14", 0},
{{9,3}, "PORT15", 0},
{{10,3}, "PORT16", 0},
{{11,3}, "PORT17", 0},
{{12,3}, "PORT18", 0},
{{13,3}, "PORT19", 0},
{{14,3}, "PORT20", 0},
{{15,3}, "PORT21", 0},
{{16,3}, "PORT22", 0},
{{17,3}, "PORT23", 0},
{{18,3}, "PORT24", 0},
{{19,3}, "MOD1", 0},
{{20,3}, "MOD2", 0},
{{24,2}, g_strHelpMsg, 0},
};
// assign page
SPage g_SPageMibCntNext = {
aSFixLabelMibCntCfgNext, 18,
aSVarLabelMibCnt, 7,
NULL, 0,
aSActionMibCnt, 3,
PAMIB_bLoadMibCnt
};
SPage g_SPageMibCntPrev = {
aSFixLabelMibCntCfgPrev, 18,
aSVarLabelMibCnt, 7,
NULL, 0,
aSActionMibCnt, 3,
PAMIB_bLoadMibCnt
};
////////////////////////////////////////////////////////////////////////
// load config
BOOL PAMIB_bLoadMibCnt(void)
{
if (g_byCurPageID == PAGE_PORT_COUNTERS_PREV)
PIMIB_vInitPage(g_pSMIBPageCfg, 0);
else //next page : port start from port14
PIMIB_vInitPage(g_pSMIBPageCfg, 1);
g_wTotalLineNum = UI_SWITCH_PORT_NUM/2;
return DONT_RELOAD_PAGE;
}
BOOL PAMIB_bNextPage(void)
{
if (g_byCurPageID == PAGE_PORT_COUNTERS_PREV)
g_byCurPageID = PAGE_PORT_COUNTERS_NEXT;
else
g_byCurPageID = PAGE_PORT_COUNTERS_PREV;
return RELOAD_PAGE; // reload cfg and print whole page
}
BOOL PAMIB_bClearAllCntrPage(void)
{
PIMIB_vClearAllCntr();
return RELOAD_PAGE; // reload cfg and print whole page
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -