1N/A/************************************************************************
1N/A * RSTP library - Rapid Spanning Tree (802.1t, 802.1w)
1N/A * Copyright (C) 2001-2003 Optical Access
1N/A * Author: Alex Rozin
1N/A *
1N/A * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
1N/A * Use is subject to license terms.
1N/A *
1N/A * This file is part of RSTP library.
1N/A *
1N/A * RSTP library is free software; you can redistribute it and/or modify it
1N/A * under the terms of the GNU Lesser General Public License as published by the
1N/A * Free Software Foundation; version 2.1
1N/A *
1N/A * RSTP library is distributed in the hope that it will be useful, but
1N/A * WITHOUT ANY WARRANTY; without even the implied warranty of
1N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
1N/A * General Public License for more details.
1N/A *
1N/A * You should have received a copy of the GNU Lesser General Public License
1N/A * along with RSTP library; see the file COPYING. If not, write to the Free
1N/A * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1N/A * 02111-1307, USA.
1N/A **********************************************************************/
1N/A
1N/A#ifndef __STP_VECTORS_H__
1N/A#define __STP_VECTORS_H__
1N/A
1N/A/* This file defines callback vectors to be supplied by library user */
1N/A
1N/A/* In the best case: clean all Learning entries with
1N/A the vlan_id and the port (if 'exclude'=0) or for all ports,
1N/A exclude the port (if ''exclude'=1). If 'port'=0, delete all
1N/A entries with the vlan_id, don't care to 'exclude' */
1N/Atypedef enum {
1N/A LT_FLASH_ALL_PORTS_EXCLUDE_THIS,
1N/A LT_FLASH_ONLY_THE_PORT
1N/A} LT_FLASH_TYPE_T;
1N/A
1N/Astruct stp_vectors {
1N/A int (*flush_lt)(IN int port_index, IN int vlan_id,
1N/A IN LT_FLASH_TYPE_T type, IN char* reason);
1N/A
1N/A /* for bridge id calculation */
1N/A void (*get_port_mac) (IN int port_index, OUT unsigned char* mac);
1N/A
1N/A unsigned long (*get_port_oper_speed) (IN unsigned int portNo);
1N/A
1N/A /* 1- Up, 0- Down */
1N/A int (*get_port_link_status) (IN int port_index);
1N/A
1N/A /* 1- Full, 0- Half */
1N/A int (*get_duplex) (IN int port_index);
1N/A
1N/A#ifdef STRONGLY_SPEC_802_1W
1N/A int (*set_learning) (IN int port_index, IN int vlan_id, IN int enable);
1N/A int (*set_forwarding) (IN int port_index, IN int vlan_id,
1N/A IN int enable);
1N/A#else
1N/A/*
1N/A * In many kinds of hardware the state of ports may
1N/A * be changed with another method
1N/A */
1N/A int (*set_port_state) (IN int port_index, IN int vlan_id,
1N/A IN RSTP_PORT_STATE state);
1N/A#endif
1N/A
1N/A int (*set_hardware_mode) (int vlan_id, UID_STP_MODE_T mode);
1N/A int (*tx_bpdu) (IN int port_index, IN int vlan_id,
1N/A IN unsigned char* bpdu,
1N/A IN size_t bpdu_len);
1N/A const char *(*get_port_name) (IN int port_index);
1N/A int (*get_init_stpm_cfg) (IN int vlan_id,
1N/A INOUT UID_STP_CFG_T* cfg);
1N/A int (*get_init_port_cfg) (IN int vlan_id,
1N/A IN int port_index,
1N/A INOUT UID_STP_PORT_CFG_T* cfg);
1N/A void (*trace)(const char *fmt, ...);
1N/A};
1N/A
1N/A#ifndef __STP_VECTORS_T__
1N/A#define __STP_VECTORS_T__
1N/Atypedef struct stp_vectors STP_VECTORS_T;
1N/A#endif
1N/A
1N/A#ifdef __STP_INTERNAL__
1N/Aextern STP_VECTORS_T *stp_vectors;
1N/A#endif
1N/A
1N/A#endif /* __STP_VECTORS_H__ */