📄 swlogtb.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: swlogtb.h
*
* Purpose: MAC address table change log table operation functions
*
* Author: Henry Lin
*
* Date: Nov 08, 2004
*
*/
#ifndef __SWLOGTB_H__
#define __SWLOGTB_H__
#if !defined(__TTYPE_H__)
#include "ttype.h"
#endif
/*--------------------- Export Definitions ------------------------*/
//
// Bit position for change log table
//
#define LOG_BIT_FID_S 0
#define LOG_BIT_FID_E 12
#define LOG_BIT_MACADDR_S 16
#define LOG_BIT_MACADDR_E 63
#define LOG_BIT_ENTRYID_S 64
#define LOG_BIT_ENTRYID_E 79
#define LOG_BIT_EXTRA_ENTRYID_S 80
#define LOG_BIT_EXTRA_ENTRYID_E 95
// log entry property
#define LOG_BIT_LOCCHG_S 96
#define LOG_BIT_LOCCHG_E 96
#define LOG_BIT_AGEOUT_S 97
#define LOG_BIT_AGEOUT_E 97
#define LOG_BIT_SCAN_S 98
#define LOG_BIT_SCAN_E 99
#define LOG_BIT_LEARNING_S 100
#define LOG_BIT_LEARNING_E 100
#define LOG_BIT_SECU_VIO_S 101
#define LOG_BIT_SECU_VIO_E 103
// port index
#define LOG_BIT_MCST_MASK_S 104
#define LOG_BIT_MCST_MASK_E 113
#define LOG_BIT_SRC_ID_S 104
#define LOG_BIT_SRC_ID_E 108
#define LOG_BIT_TRK_TYPE_S 109
#define LOG_BIT_TRK_TYPE_E 109
#define LOG_BIT_SMAC_REDIR_S 112
#define LOG_BIT_SMAC_REDIR_E 112
#define LOG_BIT_FLT_SMAC_S 113
#define LOG_BIT_FLT_SMAC_E 113
// port index type
#define LOG_BIT_CAST_TYPE_S 114
#define LOG_BIT_CAST_TYPE_E 114
#define MAC_ADDR_SIZE 6
/*--------------------- Export Types ------------------------------*/
// Change log table entry structure
struct tagSLogEntry {
BOOL bTypeMcst; // Is unicast or multicast ?
// for unicast
BOOL bFltrSmac; // Filter packet when it's SMAC
BOOL bNotRedirSmac; // Is entry not enforce L2+ redirect action when it's SMAC?
BOOL bTrkGrp; // Is src port single port/trunk grp?
UINT8 u8SrcId; // Src port/Trunk grp ID
// for multicast
UINT16 u16McstIdx; // multicast mask
UINT8 u8SecuVio;
BOOL bLearning;
UINT8 u8Scan;
BOOL bAgeOut;
BOOL bLocChg;
UINT16 u16ExtraEntryId;
UINT16 u16EntryId;
UINT8 abyMacAddr[MAC_ADDR_SIZE]; // Mac address of the entry
UINT16 u16Fid; // FID of the entry
};
typedef struct tagSLogEntry SLogEntry;
/*--------------------- Export Macros -----------------------------*/
#define MACLOG_SA_TO_INDEX(dwAddr) ((dwAddr - SRAM_MAC_LOG_TBL_BASE_ADDR)>>SHIFT_NUM_SIZE_16Byte)
/*--------------------- Export Classes ----------------------------*/
/*--------------------- Export Variables --------------------------*/
/*--------------------- Export Functions --------------------------*/
BOOL SWLOGTB_bIsEntryEmpty(UINT16 u16Indx);
BOOL SWLOGTB_bGetEntry(SLogEntry *pSEntry);
BOOL SWLOGTB_bGetEntryByIndx(UINT16 u16Indx, SLogEntry *pSEntry);
#endif // __SWLOGTB_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -