代码拉取完成,页面将自动刷新
#ifndef SWITCH_DATA_H__
#define SWITCH_DATA_H__
#define IF_TYPE_ACCESS 0
#define IF_TYPE_TRUNK 1
#define IF_TYPE_NULL 2
#define SW_MACNODE_IS_DYNAMIC(age) (0 != ((age) & 0x80000000))
#define SW_MACNODE_IS_STATIC(age) (0 == ((age) & 0x80000000))
#define SW_MACNODE_SET_STATIC(age) ((age) |= 0x80000000)
#define SW_MACNODE_RESET_STATIC(age) ((age) &= (~0x80000000))
typedef struct tagSwitchMacnode
{
UINT8 aucMacAddr[MAC_BYTE]; /* MAC地址(6字节) */
UINT16 usSwitchPortNum; /* 交换机的端口号,从小到大 */
UINT32 uiAgingTime; /* 静态表项,为0x80000000;动态表项,此字段存储的是添加的时刻(ms) */
} SWITCH_MACNODE_S;
typedef struct TagSwithMactable
{
SWITCH_MACNODE_S astMacNode[SWITCH_MACTABLE_MAXNODE]; /* mac地址表 */
UINT16 usMacCount; /* 总的mac地址数目 */
UINT16 usVlanId; /* vlan id */
UINT16 usFlag; /* 0表示未配置该VLAN */
} MAC_TABLE_S;
typedef struct tagInterfaceNode
{
UINT16 usPortMode; /* 接口类型access:0 trunk:1 */
UINT16 usVlanCount; /* access:1 trunk视配置决定 */
UINT16 astPermitVlanId[DEVICE_MAX_VLAN]; /* permit vlanid */
} SWITCH_IFCFG_S;
typedef struct tagSwitchDevice
{
UINT32 uiDeviceId; /* 交换机标识 */
SWITCH_IFCFG_S astIfCfg[DEVICE_MAX_VLAN_IF];
MAC_TABLE_S astMacTable[DEVICE_MAX_VLAN]; /* mac地址表每个vlan一个 */
struct tagSwtichDevice* pstNextDevice;
} SWITCH_DEVICE_S;
INT32 MacData_Init(VOID);
INT32 MacData_AddDevice(IN UINT32 uiDeviceId);
INT32 MacData_DeleteDevice(IN UINT32 uiDeviceId);
SWITCH_DEVICE_S* MacData_FindDevice(IN UINT32 uiDeviceId);
INT32 MacData_Add(IN UINT16 usDeviceId, IN UINT8* pucMacAddr, IN UINT32 uiAgingTime, IN UINT16 usSwitchPortNum, IN UINT16 usVlanId);
INT32 MacData_Delete(IN UINT32 uiDeviceId, IN UINT8* aucMacAddr, IN UINT16 usSwitchPortNum, IN UINT16 uiVlanId);
INT32 MacData_Print(IN SWITCH_DEVICE_S* pstSwitchDevice, IN UINT16 usVlanid);
SWITCH_MACNODE_S* MacData_BestMatch(UINT8* aucMacaddr, UINT16 uiDeviceId, IN UINT16 usVlanid, IN UINT16 usifIndex);
INT32 Vlan_Add(IN UINT16 usDeviceId, IN UINT16 usVlanid);
INT32 Vlan_Delete(IN UINT16 usDeviceId, IN UINT16 usVlanid);
INT32 Port_AddPermitVlan(IN UINT16 usDeviceId, IN UINT16 usVlanid, IN UINT16 usSwitchPortNum, IN UINT16 usPortMode);
INT32 Port_DeletePermitVlan(IN UINT16 usDeviceId, IN UINT16 usVlanid, IN UINT16 usSwitchPortNum, IN UINT16 usPortMode);
INT32 Port_SetMode(IN UINT16 usDeviceId, IN UINT16 usPortMode, IN UINT16 usSwitchPortNum, IN UINT16 usVlanid);
INT32 Port_DeleteMode(IN UINT16 usDeviceId, IN UINT16 usSwitchPortNum, IN UINT16 usPortMode);
#endif // !SWITCH_DATA_H__
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。