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

📄 pgvlan.c

📁 vt6528芯片交换机API函数和文档运行程序
💻 C
📖 第 1 页 / 共 2 页
字号:
/*
 * 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:    vlandef.c
 *
 * Purpose: VLAN module UI definitions
 *
 * Author:  Jenda Jao
 *
 * Date:    Jan 08, 2002
 *
 * Functions:
 *
 * Revision History:
 *
 */


#if !defined(__KEY_H__)
#include "key.h"
#endif
#include "engine.h"
#include "eng_act.h"
#include "allpages.h"
#include "pgvlan.h"
#include "pigencfg.h"
#include "cfgstr.h"
#include "gen_act.h"
#include "pimsg.h"

#include "str.h"
#include "tty.h"
#include "eng_io.h"
#include "piportmp.h"

#include "swsys.h"


#define VLAN_POS_COL_OFFSET 12

UINT8 g_byVlanTotalPageNum;
UINT8 g_byVlanLineNumPerPage;

static void s_vUpdateGrpNumPerPage(void);

////
//// vlan menu page
////
SFixLabel aSFixLabelVlan[] = {
    {{2,31}, g_strVlanCfg, 0},
    {{3,31}, "=", 18},
    {{24,2}, g_strHelpMsg, 0}
};
SItemPageSel aSIPageSelVlan[] = {
    {g_strVlanCfg,    PAGE_VLAN_MODE_DIS},
    {g_strAdvVlanCfg, PAGE_VLAN_8021Q_INGR},
    {g_strRtnToMain,  PAGE_MAIN_MENU}
};
SItem aSItemVlan[] = {
    {{5,26},   aSIPageSelVlan,   "", ITEM_MENU_PAGESEL, REPEAT_TYPE_NONE, LINK_TYPE_EDITPAGE},
    {{5+(1*ITEM_INTERVAL),26}, aSIPageSelVlan+1, "", ITEM_MENU_PAGESEL, REPEAT_TYPE_NONE, LINK_TYPE_EDITPAGE},
    {{5+(2*ITEM_INTERVAL),26}, aSIPageSelVlan+2, "", ITEM_MENU_PAGESEL, REPEAT_TYPE_NONE, LINK_TYPE_EDITPAGE},
};
SPage g_SPageVlanMenu = {
    aSFixLabelVlan, 3,
    NULL, 0,
    aSItemVlan, 3,
};


////
//// vlan mode & vlan group list
////
// assign fix label
SFixLabel aSFixLabelVlanCfg[] = {
    {{2,31}, g_strVlanCfg, 0},
    {{3,31}, "=", 18},
    {{5,2}, "VLAN Mode :", 0},
    {{24,2}, g_strHelpMsg, 0},
    {{7,2}, "VLAN Group List :", 0},
    {{8,2}, "-", 76},
};

// assign var item
SItemListbox SIListboxVlanMode = {
    &g_UCfgBuf.SPageCfg_Vlan.byVlanMode,
    0, 7, 0,
#ifdef __PRTCL_VLAN_REMOVE
    g_aszVlanModeCfg, 3
#else
    g_aszVlanModeCfg, 4
#endif
};
SItemNum SIDecVlanGrpID = {
    (PUINT8)&g_UCfgBuf.SPageCfg_Vlan.awValidGrpIdList[0],
    2, 4, 2
};

// all items
SItem aSItemVlanGrpList[] = {
    {{5,14}, &SIListboxVlanMode, g_strChgModeMsg, ITEM_LISTBOX, REPEAT_TYPE_NONE, LINK_TYPE_LISTBOX},
    {{9,2}, &SIDecVlanGrpID,    g_strEditGrpMsg, ITEM_DECNUM, REPEAT_TYPE_RECT_SINGLE, LINK_TYPE_EDITPAGE, ROW_NUM_IN_3_FIELD, VLAN_POS_COL_OFFSET}
};

// action
SActItem aSActionVlanMode[] = {
    {{22, 12}, g_strActionQuit, PAACT_bQuit},
    {{22, 22}, g_strActionEdit, PAVLAN_bEditVlanMode},
};
SActItem aSActionVlanGrpList_P[] = {
    {{22, 12}, g_strActionQuit, PAACT_bQuit},
    {{22, 22}, g_strActionEdit, PAVLAN_bEditVlanMode},
    {{22, 32}, g_strActionAdd,  PAVLAN_bAddVlanMode},
    {{22, 42}, g_strActionDel,  PAVLAN_bDelVlanMode},
    {{22, 55}, "<NextPage>",    PAVLAN_bNextPage}
};

// assign page
SPage g_SPageVlanMode = {
    aSFixLabelVlanCfg, 4,
    NULL, 0,
    aSItemVlanGrpList, 1,
    aSActionVlanMode, 2,
    PAVLAN_bLoadVlanMode
};
SPage g_SPageVlanGrpList_P = {
    aSFixLabelVlanCfg, 6,
    NULL, 0,
    aSItemVlanGrpList, 2,
    aSActionVlanGrpList_P, 5,
    PAVLAN_bLoadVlanMode
};
SPage g_SPageVlanGrpList_Q = {
    aSFixLabelVlanCfg, 6,
    NULL, 0,
    aSItemVlanGrpList, 2,
    aSActionVlanGrpList_P, 5,
    PAVLAN_bLoadVlanMode
};
SPage g_SPageVlanGrpList_PRV = {
    aSFixLabelVlanCfg, 6,
    NULL, 0,
    aSItemVlanGrpList, 2,
    aSActionVlanGrpList_P, 5,
    PAVLAN_bLoadVlanMode
};


////
//// edit a vlan group
////
// assign fix label
char strTitleAdd[] = "Add";
char strTitleEdit[] = "Edit";
char strTitleVlanP[] = "a PortBased VLAN Group";
char strTitleVlanQ[] = "a 802.1Q VLAN Group";
char strTitleVlanPRV[] = "a ProtocolBased VLAN Group";
char strGroupID[] = "Group ID   : [    ]";
char strVlanID[] =  "VLAN ID   :  [    ]";
char strProtocol[] =  "Protocol  :";
char strVlanIDRange[] = "(1~    )";
char strVlanIDRangePRV[] = "(2~    )";
char strGroupMbr[] = "VLAN Group Member :";

SFixLabel aSFixLabelVlanGrpAdd_P[] = {
    {{2,27}, strTitleAdd, 0},
    {{2,31}, strTitleVlanP, 0},
    {{3,27}, "=", 26},
    {{7,13}, strGroupID, 0},
    {{7,33}, strVlanIDRange, 0},
    {{9,13}, strGroupMbr, 0},
    {{10,13}, "-", 53},
    {{24,2}, g_strHelpMsg, 0}
};
SFixLabel aSFixLabelVlanGrpAdd_Q[] = {
    {{2,29}, strTitleAdd, 0},
    {{2,33}, strTitleVlanQ, 0},
    {{3,29}, "=", 23},
    {{7,13}, strVlanID, 0},
    {{7,33}, strVlanIDRangePRV, 0},
    {{9,13}, strGroupMbr, 0},
    {{10,13}, "-", 55},
    {{24,2}, g_strHelpMsg, 0}
};
SFixLabel aSFixLabelVlanGrpAdd_PRV[] = {
    {{2,29}, strTitleAdd, 0},
    {{2,33}, strTitleVlanPRV, 0},
    {{3,29}, "=", 30},
    {{6,13}, strProtocol, 0},
    {{7,13}, strVlanID, 0},
    {{7,33}, strVlanIDRangePRV, 0},
    {{9,13}, strGroupMbr, 0},
    {{10,13}, "-", 55},
    {{24,2}, g_strHelpMsg, 0}
};
SFixLabel aSFixLabelVlanGrpEdit_P[] = {
    {{2,27}, strTitleEdit, 0},
    {{2,32}, strTitleVlanP, 0},
    {{3,27}, "=", 27},
    {{7,13}, strGroupID, 0},
    {{9,13}, strGroupMbr, 0},
    {{10,13}, "-", 53},
    {{24,2}, g_strHelpMsg, 0}
};
SFixLabel aSFixLabelVlanGrpEdit_Q[] = {
    {{2,28}, strTitleEdit, 0},
    {{2,33}, strTitleVlanQ, 0},
    {{3,28}, "=", 24},
    {{7,13}, strVlanID, 0},
    {{9,13}, strGroupMbr, 0},
    {{10,13}, "-", 55},
    {{24,2}, g_strHelpMsg, 0}
};
SFixLabel aSFixLabelVlanGrpEdit_PRV[] = {
    {{2,28}, strTitleEdit, 0},
    {{2,33}, strTitleVlanPRV, 0},
    {{3,28}, "=", 31},
    {{6,13}, strProtocol, 0},
    {{7,13}, strVlanID, 0},
    {{9,13}, strGroupMbr, 0},
    {{10,13}, "-", 55},
    {{24,2}, g_strHelpMsg, 0}
};


// assign var label
SItemNum SIDecNumVID = {
    (PUINT8)&g_UCfgBuf.SPageCfg_Vlan.SCurGrp.u16Vid,
    2, 4, 0
};
SItemNum SIDecNumMaxVID = {
    (PUINT8)&g_UCfgBuf.SPageCfg_Vlan.wMaxVid,
    2, 4, 0
};
SItemListbox SIListboxVlanGrpProIndex_PRV = {
    &g_UCfgBuf.SPageCfg_Vlan.SCurGrp.u8ProtoIndx,
    0, 7, 0,
    g_aszPRVTBProIndexSel, 17
};

SVarLabel aSVarLabelVlanGrp[] = {
    {{ 6,26}, &SIListboxVlanGrpProIndex_PRV,    "", ITEM_LISTBOX,  REPEAT_TYPE_NONE, LINK_TYPE_LISTBOX},
    {{ 7,27}, &SIDecNumVID,            "", ITEM_DECNUM,  REPEAT_TYPE_NONE, LINK_TYPE_NONE},
    {{11,13}, &g_SIListboxLogPortName, "", ITEM_LISTBOX, REPEAT_TYPE_RECT_SINGLE, LINK_TYPE_NONE, ROW_NUM_IN_3_FIELD, 20},
    {{ 7,36}, &SIDecNumMaxVID,         "", ITEM_DECNUM,  REPEAT_TYPE_NONE, LINK_TYPE_NONE}
};

// assign var item
SItemListbox SIListboxVlanGrpMember_P = {
    g_UCfgBuf.SPageCfg_Vlan.SCurGrp.abyMbrMsk,
    0, 1, 2,
    g_aszMbrNotCfg, 2
};
SItem aSItemVlanGrp_P[] = {
    {{ 7,27}, &SIDecNumVID,              "", ITEM_DECNUM,  REPEAT_TYPE_NONE, LINK_TYPE_NONE},
    {{11,20}, &SIListboxVlanGrpMember_P, "", ITEM_LISTBOX, REPEAT_TYPE_RECT_SINGLE, LINK_TYPE_NONE, ROW_NUM_IN_3_FIELD, 20}
};
SItemListbox SIListboxVlanGrpMember_Q = {
    g_UCfgBuf.SPageCfg_Vlan.SCurGrp.abyMbrMsk,
    0, 1, 2,
    g_aszVlanMbrCfg, 3
};
SItemListbox SIListboxVlanGrpMember_PRV = {
    g_UCfgBuf.SPageCfg_Vlan.SCurGrp.abyMbrMsk,
    0, 1, 2,
    g_aszVlanMbrCfg, 2
};
SItem aSItemVlanGrp_Q[] = {
    {{ 7,27}, &SIDecNumVID,              "", ITEM_DECNUM,  REPEAT_TYPE_NONE, LINK_TYPE_NONE},
    {{11,20}, &SIListboxVlanGrpMember_Q, "", ITEM_LISTBOX, REPEAT_TYPE_RECT_SINGLE, LINK_TYPE_NONE, ROW_NUM_IN_3_FIELD, 20}
};
SItem aSItemVlanGrp_PRV[] = {
    {{ 6,26}, &SIListboxVlanGrpProIndex_PRV,    "", ITEM_LISTBOX,  REPEAT_TYPE_NONE, LINK_TYPE_LISTBOX},
    {{ 7,27}, &SIDecNumVID,              "", ITEM_DECNUM,  REPEAT_TYPE_NONE, LINK_TYPE_NONE},
    {{11,20}, &SIListboxVlanGrpMember_PRV, "", ITEM_LISTBOX, REPEAT_TYPE_RECT_SINGLE, LINK_TYPE_NONE, ROW_NUM_IN_3_FIELD, 20}
};


// action
SActItem aSActionVlanGrpEdit[] = {
    {{22, 12}, g_strActionQuit, PAACT_bQuit},
    {{22, 22}, g_strActionEdit, PAACT_bEdit},
    {{22, 32}, g_strActionSave, PAVLAN_bSaveVlanGrpEdit}
};
// assign page
SPage g_SPageVlanGrpEdit_P = {
    aSFixLabelVlanGrpEdit_P, 7,
    aSVarLabelVlanGrp+1, 2,
    aSItemVlanGrp_P+1, 1,
    aSActionVlanGrpEdit, 3,
    PAVLAN_bLoadVlanGrpEdit
};
SPage g_SPageVlanGrpEdit_Q = {
    aSFixLabelVlanGrpEdit_Q, 7,
    aSVarLabelVlanGrp+1, 2,
    aSItemVlanGrp_Q+1, 1,
    aSActionVlanGrpEdit, 3,
    PAVLAN_bLoadVlanGrpEdit
};
SPage g_SPageVlanGrpEdit_PRV = {
    aSFixLabelVlanGrpEdit_PRV, 8,
    aSVarLabelVlanGrp, 3,
    aSItemVlanGrp_PRV+2, 1,
    aSActionVlanGrpEdit, 3,
    PAVLAN_bLoadVlanGrpEdit
};
SPage g_SPageVlanGrpEdit_PRVdft = {
    aSFixLabelVlanGrpEdit_PRV, 8,
    aSVarLabelVlanGrp, 3,
    aSItemVlanGrp_Q+1, 1,
    aSActionVlanGrpEdit, 1,
    PAVLAN_bLoadVlanGrpEdit
};


//// add a vlan group
SActItem aSActionVlanGrpAdd[] = {
    {{22, 12}, g_strActionQuit, PAACT_bQuit},
    {{22, 22}, g_strActionEdit, PAACT_bEdit},
    {{22, 32}, g_strActionSave, PAVLAN_bSaveVlanGrpAdd},
};

SPage g_SPageVlanGrpAdd_P = {
    aSFixLabelVlanGrpAdd_P, 8,
    aSVarLabelVlanGrp+2, 2,

⌨️ 快捷键说明

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