📄 piacl.h
字号:
/*
* 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: piacl.h
*
* Purpose: ACL UI related definitions
*
* Author: Tim Feng
*
* Date: Dec 01, 2005
*
*/
#ifndef __PIACL_H__
#define __PIACL_H__
#include "ttype.h"
#if !defined(__CCONFIG_H__)
#include "cconfig.h"
#endif
#if !defined(__SWCFG_H__)
#include "swcfg.h"
#endif
#define ACL_MIN_VALID_GRP_ID (1)
// Patch : none IP SNAP with tag packet will always be ARP packet
//#define ACL_MAX_VALID_GRP_ID (255) //You can modify the value between 1~255
#define ACL_MAX_VALID_GRP_ID (255-RESERVE_ACL_GRP_NUM) //You can modify the value between 1~255
/*--------------------- Export Definitions -------------------------*/
// definitions of ACL configuration
#define EEP_SIZE_ACL_TBL_ENTRY (sizeof(struct tagSACLGrpEepCfg))
#define EEP_SIZE_ACL_CFG (EEP_SIZE_ACL_TBL_ENTRY * SWITCH_ACL_GRP_NUM)
#define EEP_ADDR_ACL_GROUP (EEP_ADDR_ACL_CFG)
#define ETH_PROTOCOL_IPV4 (0x0800)
#define L4_PROTOCOL_TCP (6)
#define L4_PROTOCOL_UDP (17)
/*--------------------- Export Classes -----------------------------*/
//Note :
//The struct tagSACLGrpEepCfg is only for ACL group in EEProm, and
//The struct tagSACLGrpPageCfg is only for ACL group in UI.
// When UI want to get group information from eeprom,function PIACL_vTransCfgFromEepToPage(SACLGrpPageCfg *pSGrpPageBuf, SACLGrpEepCfg* pSGrpEepBuf)
// can finish the transfer of ACL group from eeprom to page UI
// When UI want to set group information to eeprom,function PIACL_byTransCfgFromPageToEepHw(SACLGrpEepCfg* pSGrpEepBuf, SACLGrpPageCfg *pSGrpPageBuf)
// can finish the transfer of ACL group from page UI to eeprom
//Definitions of ACL group in Eeprom
struct SACLIPv4GrpEepCfg
{
UINT32 u32SIp;
UINT32 u32SIpMsk;
UINT32 u32DIp;
UINT32 u32DIpMsk;
BOOL bFragCheck;
UINT8 u8L4Proto;
UINT16 u16DstPort;
};
struct SACLNonIPv4GrpEepCfg
{
UINT16 wEthType;
};
typedef struct tagSACLGrpEepCfg
{
UINT8 u8GrpId;
BOOL bIsIpv4;
BOOL bFilter;
UINT16 u16Vid;
union{
struct SACLIPv4GrpEepCfg SACLIPv4GrpEepCfgBuf;
struct SACLNonIPv4GrpEepCfg SACLNonIPv4GrpEepCfgBuf;
}UACLGrpEepCfg;
}SACLGrpEepCfg;
//Definitions of ACL group in UI
struct SACLIpv4GrpPageCfg{
BOOL bSIpEn;
char szSIp[IP_STRING_LEN + 1];
char szSIpMsk[IP_STRING_LEN + 1];
BOOL bDIpEn;
char szDIp[IP_STRING_LEN + 1];
char szDIpMsk[IP_STRING_LEN + 1];
//fragment check
BOOL bFragCheck;
//L4 protocol
UINT8 byL4ProtoIndex;
UINT16 u16L4Proto; //Using 16 bits not 8 bits for L4 Protocol type to check weather input from UI overflow range(0~255)
UINT8 byTcpPortIndex;
UINT32 u32TcpPort; //Using 32 bits not 16 bits for TCP Dest port to check weather input from UI overflow range(0~65535)
UINT8 byUdpPortIndex;
UINT32 u32UdpPort; //Using 32 bits not 16 bits for UDP Dest port to check weather input from UI overflow range(0~65535)
};
struct SACLNonIpv4GrpPageCfg {
UINT8 byEthProtoIndex;
UINT16 wEthType; //Keep using 16 bits for Ether Type because in UI Value of Ether Type is HEX mode and width of
//Input box is 4. Input value of Ether Type can not larger than 0xFFFF
};
typedef struct tagSACLGrpPageCfg
{
UINT8 u8GrpId;
BOOL bFilter;
BOOL bVidEn;
UINT16 u16Vid;
BOOL bIsIpv4;
union{
struct SACLIpv4GrpPageCfg SACLIpv4GrpPgBuf;
struct SACLNonIpv4GrpPageCfg SACLNonIpv4GrpPgBuf;
}UACLPageCfgBuf;
}SACLGrpPageCfg;
typedef struct tagSACLPageCfg
{
UINT16 wValidEntryNum; // Valid table entry number
UINT8 abyValidGrpIdList[SWITCH_ACL_GRP_NUM]; // Valid ACL group id array
SACLGrpPageCfg SCurGrp; // Current Group being selected.
UINT8 u8MaxValidGrpId;
}SACLPageCfg;
/*--------------------- Export Variables --------------------------*/
/*--------------------- Export Macros ------------------------------*/
/*--------------------- Export Functions --------------------------*/
#endif /* __PIACL_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -