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

📄 pimsg.c

📁 vt6528芯片交换机API函数和文档运行程序
💻 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 "tty.h"
#include "piportmp.h"

#include "str.h"
#include "eng_io.h"




char g_strSavingMsg[]   = "Saving...";
char g_strChgModeMsg[]  = "Press SPACE to select and ENTER to set mode";
char g_strEditGrpMsg[]  = "Press ENTER to edit/delete group";
//char g_strQosCfgMsg[]   = "NOTE: Static port priority will overwrite 802.1p priority";
char g_strSniffCfgMsg[] = "NOTE: Cross-VLAN monitoring is not supported";
//char g_strSpdDupDscrp[] = "N:Nway force, L:Lagecy force, F:Full, H:Half";


// must be sync with "hierr.h"
PSTR g_aszErrMsg[] = {
    "Operation completed successfully",                     //OP_OK,
    "Wrong Spd/Dpx setting at ",                            //PORT_OP_WRONG_AUTO_ABY
    "Port setting inconsistent at Module Trunk Port",       //PORT_OP_MOD_TRK_DIFF_PORT_CFG

    // Trunk module error message
    "Member number not 2 ~ 8 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,
    "Giga port can not trunk with mega port at ",           //TRK_OP_MBR_DIFF_TRK_CFG,
    "Secure port in SMAC Permit could not be member at ",   //TRK_OP_MBR_IS_SECURITY

    // 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,
    "Only one port can be monitored port",                  //SNIFF_OP_MORE_THAN_ONE_PORT,
    "No any monitored port",                                //SNIFF_OP_NO_MONITORED_PORT,

    // Rate control module error message
    "Bandwidth setting value not valid",                   //RATE_OP_BAD_VALUE,

    // Administrator module error message
    "New and re-entered password inconsistent",             //ADMIN_OP_DIFF_AGAIN_PASSWORD

    // IP config
    "Invalid IP address",
    "Invalid subnet mask",
    "Invalid default gateway",

    // Firmware update
    "Invalid IP address",
    "Update firmware error",

    // 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
    "Member already belong to this protocol",               //VLAN_OP_MEMBER_BELONG_THE_SAME_PROTOCOL,
    "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

    "Group already exist",                                  //IGMP_OP_GRP_EXIST
    "Group unexist",                                        //IGMP_OP_GRP_NOT_EXIST,
    "No free group",                                        //IGMP_OP_NO_EMPTY_GRP,

    "Group already exist",                                  //SMAC_OP_GRP_EXIST
    "Group unexist",                                        //SMAC_OP_GRP_NOT_EXIST,
    "No free group",                                        //SMAC_OP_NO_EMPTY_GRP,
    "Group already exist as Filtered Source MAC" ,          //SMAC_OP_GRP_EXIST_AS_FLT_SMAC


    "Group already exist",                                  //GMRP_OP_GRP_EXIST
    "Group unexist",                                        //GMRP_OP_GRP_NOT_EXIST,
    "No free group",                                        //GMRP_OP_NO_EMPTY_GRP

//ACL module error message, added by Tim Feng
    "Priority of each Region could not be same",            //ACL_OP_PRIORITY_SAME
    "ACL is not supported if VLAN  mode is disabled",       //ACL_OP_VLAN_MODE_DISABLED
    "Groud Id Invalid",
    "Vid Invalid",                                          //ACL_OP_VID_INVALID,
    "Group already exist as  Ipv4 or Non-Ipv4 Group ",      //ACL_OP_GRP_EXIST,
    "Group unexist",                                        //ACL_OP_GRP_NOT_EXIST,
    "No free group",                                        //ACL_OP_NO_EMPTY_GRP,
    "Invalid Source IP address",                            //ACL_OP_SIP_INVALID
    "Invalid Source subnet mask",                           //ACL_OP_SIPMSK_INVALID
    "Invalid Dest IP address",                              //ACL_OP_DIP_INVALID
    "Invalid Dest subnet mask",                             //ACL_OP_DIPMSK_INVALID
    "L4 Protocol out of range,should bwtween 0~255",        //ACL_OP_L4PROTO_VAL_INVALID,
    "Could not input two types of L4 protocol",             //ACL_OP_TWO_TYPES_OF_L4PROTO_EXIST
    "TCP port out of range,should bwtween 0~65535",         //ACL_OP_TCP_PORT_VAL_INVALID
    "Could not input two types of TCP port",                //ACL_OP_TWO_TYPES_OF_TCP_PORT_EXIST
    "UDP port out of range,should bwtween 0~65535",         //ACL_OP_UDP_PORT_VAL_INVALID
    "Could not input two types of UDP port",                //ACL_OP_TWO_TYPES_OF_UDP_PORT_EXIST
    "L4 Protocol port could not exist with Ip fragment",    //ACL_OP_L4PROTO_PORT_WITH_IPFRAG
    "Could not input two types of Ether Type",              //ACL_OP_TWO_TYPES_OF_ETHER_TYPE_EXIST   
    "Ether Type out of range,should bwtween 0~65535",       //ACL_OP_ETHER_TYPE_INVALID
    "Could not input Ipv4 protocol as Ether Type ",         //ACL_OP_ETHER_TYPE_AS_IPV4
    
    "Group already exist",                                  //MACFLT_OP_GRP_EXIST
    "Group unexist",                                        //MACFLT_OP_GRP_NOT_EXIST,
    "No free group",                                        //MACFLT_OP_NO_EMPTY_GRP,
    "No space in HardWare for this group",                  //MACFLT_OP_NO_EMPTY_SPACE_HW
    "Could not add BroadCast address" ,                     //MACFLT_OP_MAC_ADDR_BCST,
    "Could not add Multicast address" ,                     //MACFLT_OP_MAC_ADDR_MCST,
    "MAC address Invalid",                                  //MACFLT_OP_MAC_ADDR_INVALID,
    "Vid Invalid",                                          //MACFLT_OP_FID_INVALID
    "Group already exist as Static Mac Address",            //MACFLT_OP_GRP_EXIST_AS_SMAC
};


/*---------------------  Export Functions  --------------------------*/

void PIMSG_vPutExtMsgThenPause(UINT8 byErrCode, UINT16 wAppendDec, BOOL bIsLogPtr)
{
    if ((wAppendDec != UINT16_MAX) && (byErrCode != OP_OK) )
    {
        // In order to save ram and code size
        // refer to ENGcPrintMessage in eng_io.c
        TTY_vRevChar();
        TTY_vDrawLine(23,2,' ',77);
        TTY_vSetCurPos(23,(80-STR_iStrlen(g_aszErrMsg[byErrCode]))/2);
        TTY_vPutStr(g_aszErrMsg[byErrCode]);
        if (bIsLogPtr)
            TTY_vPutStr(g_aszPortNameTable[wAppendDec]);
        else
            TTY_vPutDec(wAppendDec);
        TTY_vRstChar();
        TTY_cGetChar();
    }
    else
        ENGcPrintMessage(g_aszErrMsg[byErrCode], PRINT_THEN_PAUSE);
}


⌨️ 快捷键说明

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