📄 pimsg.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: pimsg.c
*
* Purpose: Functions related to messages shown on UI
*
* Author: Tevin Chen
*
* Date: Jan 08, 2002
*
* Functions:
*
* Revision History:
*
*/
#include "swmsg.h"
#include "pigencfg.h"
#include "ttyio.h"
#include "piportmp.h"
#include "str.h"
#include "eng_io.h"
DIRECT_MEMTYPE_CODE char g_strSavingMsg[] = "Saving...";
DIRECT_MEMTYPE_CODE char g_strChgModeMsg[] = "Press SPACE to select and ENTER to set mode";
DIRECT_MEMTYPE_CODE char g_strEditGrpMsg[] = "Press ENTER to edit/delete group";
DIRECT_MEMTYPE_CODE char g_strQosCfgMsg[] = "NOTE: Static port priority will overwrite 802.1p priority";
DIRECT_MEMTYPE_CODE char g_strSniffCfgMsg[] = "NOTE: Cross-VLAN monitoring is not supported";
//DIRECT_MEMTYPE_CODE char g_strSpdDupDscrp[] = "N:Nway force, L:Lagecy force, F:Full, H:Half";
// must be sync with "hierr.h"
DIRECT_MEMTYPE_CODE PSTR g_aszErrMsg[] = {
"Operation completed successfully", //OP_OK,
"Wrong Spd/Dpx setting at ", //PORT_OP_WRONG_AUTO_ABY
// Trunk module error message
"Member number not 2 ~ 4 at ", //TRK_OP_MBR_NUM_INVALID,
"VLAN setting inconsistent at ", //TRK_OP_MBR_DIFF_VLAN_CFG,
"802.1Q ingress filter inconsistent at ", //TRK_OP_MBR_DIFF_8021Q_INGS,
"Member include monitoring port at ", //TRK_OP_MBR_IS_MONITORING,
"Port monitoring setting inconsistent at ", //TRK_OP_MBR_DIFF_MONITORED,
"Port setting inconsistent at ", //TRK_OP_MBR_DIFF_PORT_CFG,
"Bandwidth setting inconsistent at ", //TRK_OP_MBR_DIFF_RATE_CFG,
// Sniffer module error message
"Monitoring port cannot be monitored", //SNIFF_OP_DEST_AND_SRC_OVERLAP,
"Not supported if all ports are trunked", //SNIFF_OP_ALL_PORT_TRUNKED,
// Administrator module error message
"New and re-entered password inconsistent", //ADMIN_OP_DIFF_AGAIN_PASSWORD
#ifdef __MODULE_WEB_SMART
"Invalid IP address",
"Invalid subnet mask",
"Invalid default gateway",
#endif
// VLAN module error message
"VID out of range", //VLAN_OP_VID_INVALID,
"Group already exist", //VLAN_OP_GRP_EXIST,
"Group unexist", //VLAN_OP_GRP_NOT_EXIST,
"No free group", //VLAN_OP_NO_EMPTY_GRP,
"Default group cannot be deleted", //VLAN_OP_DEFAULT_GRP_CANNOT_DEL,
"Untagged member already belong to group ", //VLAN_OP_UNTAG_BELONG_OTHER_GRP, +vid
"Not supported if VLAN mode is not 802.1Q", //VLAN_OP_NOT_8021Q_MODE,
"Operation OK! NOTE port not in any group at " //VLAN_OP_FOUND_ISO_PORT + port
};
/*--------------------- Export Functions --------------------------*/
void PIMSG_vPutExtMsgThenPause(BYTE byErrCode, UINT16 wAppendDec, BOOL bIfLogPtr) DIRECT_FUNTYPE_REENT
{
if ( (wAppendDec != UINT16_MAX) && (byErrCode != OP_OK) )
{
// In order to save ram and code size
// refer to ENGcPrintMessage in eng_io.c
TTYvRevChar();
TTYvDrawLine(23,2,' ',77);
TTYvSetCurPos(23,(80-STRbyStrlen(g_aszErrMsg[byErrCode]))/2);
TTYvPutString(g_aszErrMsg[byErrCode]);
if (bIfLogPtr)
TTYvPutString(g_aszPortNameTable[wAppendDec]);
else
TTYvPutDec(wAppendDec);
TTYvRstChar();
TTYcGetChar();
}
else
ENGcPrintMessage(g_aszErrMsg[byErrCode], PRINT_THEN_PAUSE);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -