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

📄 pgqos.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:    qosdef.c
 *
 * Purpose: QoS module UI definitions
 *
 * Author:  Jenda Jao
 *
 * Date:    Jan 08, 2002
 *
 * Functions:
 *
 * Revision History:
 *
 */


#include "tty.h"
#include "engine.h"
#include "eng_act.h"
#include "allpages.h"
#include "pigencfg.h"
#include "cfgstr.h"
#include "pgqos.h"
#include "gen_act.h"
#include "pimsg.h"

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

#define g_byQosMode     (g_pSQosPageCfg->byQosMode)


SFixLabel aSFixLabelQos[] = {
    {{ 2,32}, g_strQosCfg, 0},
    {{ 3,32}, "=", 17},
    {{ 5,17}, "QoS Mode :", 0},
    {{24, 2}, g_strHelpMsg, 0},
    {{ 7,17}, "Static Port Ingress Priority :", 0},
    {{ 8,17}, "-", 42},
    {{19,17}, "802.1p Priority [7-0] :", 0},
};

// assign item
SItemListbox aSIListboxQos[] = {
    {&g_byQosMode,  0, 7, 0, g_aszQosMode, 5},
    {g_pSQosPageCfg->abyStaticPrior, 0, 7, 8, g_aszStaticPortPriorCfg, 9},

#if defined(__BIG_ENDIAN)
    {(PUINT8)&g_pSQosPageCfg->w8021pMap, 6, 7, 0, g_aszLoHiCfg, 4}, //because w8021pMap not bit defined, so no ENDIAN_OF_BIT issue
    {(PUINT8)&g_pSQosPageCfg->w8021pMap, 4, 5, 0, g_aszLoHiCfg, 4},
    {(PUINT8)&g_pSQosPageCfg->w8021pMap, 2, 3, 0, g_aszLoHiCfg, 4},
    {(PUINT8)&g_pSQosPageCfg->w8021pMap, 0, 1, 0, g_aszLoHiCfg, 4},
    {(PUINT8)&g_pSQosPageCfg->w8021pMap + 1, 6, 7, 0, g_aszLoHiCfg, 4},
    {(PUINT8)&g_pSQosPageCfg->w8021pMap + 1, 4, 5, 0, g_aszLoHiCfg, 4},
    {(PUINT8)&g_pSQosPageCfg->w8021pMap + 1, 2, 3, 0, g_aszLoHiCfg, 4},
    {(PUINT8)&g_pSQosPageCfg->w8021pMap + 1, 0, 1, 0, g_aszLoHiCfg, 4},

#else
    {(PUINT8)&g_pSQosPageCfg->w8021pMap + 1, 6, 7, 0, g_aszLoHiCfg, 4},
    {(PUINT8)&g_pSQosPageCfg->w8021pMap + 1, 4, 5, 0, g_aszLoHiCfg, 4},
    {(PUINT8)&g_pSQosPageCfg->w8021pMap + 1, 2, 3, 0, g_aszLoHiCfg, 4},
    {(PUINT8)&g_pSQosPageCfg->w8021pMap + 1, 0, 1, 0, g_aszLoHiCfg, 4},
    {(PUINT8)&g_pSQosPageCfg->w8021pMap,     6, 7, 0, g_aszLoHiCfg, 4},
    {(PUINT8)&g_pSQosPageCfg->w8021pMap,     4, 5, 0, g_aszLoHiCfg, 4},
    {(PUINT8)&g_pSQosPageCfg->w8021pMap,     2, 3, 0, g_aszLoHiCfg, 4},
    {(PUINT8)&g_pSQosPageCfg->w8021pMap,     0, 1, 0, g_aszLoHiCfg, 4},
#endif
};

// all items
SVarLabel aSVarLabelQos[] = {
    {{9,17}, &g_SIListboxLogPortName, "", ITEM_LISTBOX, REPEAT_TYPE_RECT_SINGLE, LINK_TYPE_NONE, ROW_NUM_IN_3_FIELD, 15}
};

SItem aSItemQos[] = {
    {{ 5,28},    aSIListboxQos,    g_strChgModeMsg, ITEM_LISTBOX, REPEAT_TYPE_NONE, LINK_TYPE_LISTBOX},
    {{ 9,25},    aSIListboxQos+1,  "", ITEM_LISTBOX, REPEAT_TYPE_RECT_SINGLE,   LINK_TYPE_NONE, ROW_NUM_IN_3_FIELD, 15},
    {{20,17},    aSIListboxQos+2,  "", ITEM_LISTBOX, REPEAT_TYPE_NONE, LINK_TYPE_NONE},
    {{20,17+8},  aSIListboxQos+3,  "", ITEM_LISTBOX, REPEAT_TYPE_NONE, LINK_TYPE_NONE},
    {{20,17+16}, aSIListboxQos+4,  "", ITEM_LISTBOX, REPEAT_TYPE_NONE, LINK_TYPE_NONE},
    {{20,17+24}, aSIListboxQos+5,  "", ITEM_LISTBOX, REPEAT_TYPE_NONE, LINK_TYPE_NONE},
    {{20,17+32}, aSIListboxQos+6,  "", ITEM_LISTBOX, REPEAT_TYPE_NONE, LINK_TYPE_NONE},
    {{20,17+40}, aSIListboxQos+7,  "", ITEM_LISTBOX, REPEAT_TYPE_NONE, LINK_TYPE_NONE},
    {{20,17+48}, aSIListboxQos+8,  "", ITEM_LISTBOX, REPEAT_TYPE_NONE, LINK_TYPE_NONE},
    {{20,17+56}, aSIListboxQos+9,  "", ITEM_LISTBOX, REPEAT_TYPE_NONE, LINK_TYPE_NONE},

};


// action
SActItem aSActionQos[] = {
    {{22, 12}, g_strActionQuit, PAACT_bQuit},
    {{22, 22}, g_strActionEdit, PAQOS_bEditQosCfg},
    {{22, 32}, g_strActionSave, PAQOS_bSaveQosCfg},
};


// assign page
SPage g_SPageQosEn = {
    aSFixLabelQos, 7,
    aSVarLabelQos, 1,
    aSItemQos, 10,
    aSActionQos, 3,
    PAQOS_bLoadQosCfg
};
// assign page
SPage g_SPageQosDis = {
    aSFixLabelQos, 4,
    NULL, 0,
    aSItemQos, 1,
    aSActionQos, 3,
    PAQOS_bLoadQosCfg
};

//////////////////////////////////////////////////////////////////////////

// the array size should be equal to the array size of g_aszQosMode
static UINT8 sg_abyQosPageID[] = {PAGE_QOS_DISABLE, PAGE_QOS_ENABLE, PAGE_QOS_ENABLE, PAGE_QOS_ENABLE, PAGE_QOS_ENABLE};

BOOL PAQOS_bChangeQosPage(void)
{
    if (g_byCurPageID != sg_abyQosPageID[g_byQosMode])
    {
        g_byCurPageID = sg_abyQosPageID[g_byQosMode];
        return RELOAD_PAGE;
    }
    return DONT_RELOAD_PAGE;
}

BOOL PAQOS_bLoadQosCfg(void)
{

    PIQOS_vInitPage(g_pSQosPageCfg);
    g_wTotalLineNum = g_byLogIdNum;
    PAQOS_bChangeQosPage();
    return DONT_RELOAD_PAGE;
}

BOOL PAQOS_bEditQosCfg(void)
{
    if (PAACT_bEdit())
        return RELOAD_PAGE;

    if (PAQOS_bChangeQosPage())
        ENGvPrintPage();        // in this page, changing page may not reload config, just re-print page only

    return DONT_RELOAD_PAGE;
}

BOOL PAQOS_bSaveQosCfg(void)
{
    PIMSG_vPutSavingMsg();
    PIQOS_vSavePage(g_pSQosPageCfg);
    PIMSG_vPutMsgThenPause(OP_OK);
    g_bDataDirty = 0;
    return DONT_RELOAD_PAGE;
}

⌨️ 快捷键说明

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