uid_stp.h revision 1
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 * 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/* External management communication API definitions */
1N/A
1N/A#ifndef _UID_STP_H__
1N/A#define _UID_STP_H__
1N/A
1N/A#define STP_DBG 1
1N/A
1N/A#define NAME_LEN 20
1N/A
1N/Atypedef enum {
1N/A STP_DISABLED,
1N/A STP_ENABLED
1N/A} UID_STP_MODE_T;
1N/A
1N/Atypedef struct {
1N/A unsigned short prio;
1N/A unsigned char addr[6];
1N/A} UID_BRIDGE_ID_T;
1N/A
1N/Atypedef struct {
1N/A char vlan_name[NAME_LEN]; /* name of the VLAN, key of the bridge */
1N/A char action; /* 1-create, 0- delete */
1N/A} UID_STP_BR_CTRL_T;
1N/A
1N/A#define BR_CFG_STATE (1L << 0)
1N/A#define BR_CFG_PRIO (1L << 1)
1N/A#define BR_CFG_AGE (1L << 2)
1N/A#define BR_CFG_HELLO (1L << 3)
1N/A#define BR_CFG_DELAY (1L << 4)
1N/A#define BR_CFG_FORCE_VER (1L << 5)
1N/A#define BR_CFG_AGE_MODE (1L << 6)
1N/A#define BR_CFG_AGE_TIME (1L << 7)
1N/A#define BR_CFG_HOLD_TIME (1L << 8)
1N/A#define BR_CFG_ALL BR_CFG_STATE | \
1N/A BR_CFG_PRIO | \
1N/A BR_CFG_AGE | \
1N/A BR_CFG_HELLO | \
1N/A BR_CFG_DELAY | \
1N/A BR_CFG_FORCE_VER | \
1N/A BR_CFG_AGE_MODE | \
1N/A BR_CFG_AGE_TIME | \
1N/A BR_CFG_HOLD_TIME
1N/A
1N/Atypedef struct {
1N/A /* service data */
1N/A unsigned long field_mask; /* which fields to change */
1N/A UID_STP_MODE_T stp_enabled;
1N/A char vlan_name[NAME_LEN]; /* name of the VLAN, key of the bridge */
1N/A
1N/A /* protocol data */
1N/A int bridge_priority;
1N/A int max_age;
1N/A int hello_time;
1N/A int forward_delay;
1N/A int force_version;
1N/A int hold_time;
1N/A} UID_STP_CFG_T;
1N/A
1N/Atypedef struct {
1N/A /* service data */
1N/A char vlan_name[NAME_LEN]; /* name of the VLAN, key of the bridge */
1N/A unsigned long vlan_id;
1N/A UID_STP_MODE_T stp_enabled;
1N/A
1N/A /* protocol data */
1N/A UID_BRIDGE_ID_T designated_root;
1N/A unsigned long root_path_cost;
1N/A
1N/A unsigned long timeSince_Topo_Change; /* 14.8.1.1.3.b: TBD */
1N/A unsigned long Topo_Change_Count; /* 14.8.1.1.3.c: TBD */
1N/A unsigned char Topo_Change; /* 14.8.1.1.3.d: TBD */
1N/A
1N/A unsigned short root_port;
1N/A int max_age;
1N/A int hello_time;
1N/A int forward_delay;
1N/A UID_BRIDGE_ID_T bridge_id;
1N/A} UID_STP_STATE_T;
1N/A
1N/Atypedef enum {
1N/A UID_PORT_DISABLED = 0,
1N/A UID_PORT_DISCARDING,
1N/A UID_PORT_LEARNING,
1N/A UID_PORT_FORWARDING,
1N/A UID_PORT_NON_STP,
1N/A UID_PORT_BADSDU
1N/A} RSTP_PORT_STATE;
1N/A
1N/Atypedef unsigned short UID_PORT_ID;
1N/A
1N/Atypedef enum {
1N/A P2P_FORCE_TRUE,
1N/A P2P_FORCE_FALSE,
1N/A P2P_AUTO
1N/A} ADMIN_P2P_T;
1N/A
1N/A#define PT_CFG_STATE (1L << 0)
1N/A#define PT_CFG_COST (1L << 1)
1N/A#define PT_CFG_PRIO (1L << 2)
1N/A#define PT_CFG_P2P (1L << 3)
1N/A#define PT_CFG_EDGE (1L << 4)
1N/A#define PT_CFG_MCHECK (1L << 5)
1N/A#define PT_CFG_NON_STP (1L << 6)
1N/A#ifdef STP_DBG
1N/A#define PT_CFG_DBG_SKIP_RX (1L << 16)
1N/A#define PT_CFG_DBG_SKIP_TX (1L << 17)
1N/A#endif
1N/A
1N/A#define PT_CFG_ALL PT_CFG_STATE | \
1N/A PT_CFG_COST | \
1N/A PT_CFG_PRIO | \
1N/A PT_CFG_P2P | \
1N/A PT_CFG_EDGE | \
1N/A PT_CFG_MCHECK | \
1N/A PT_CFG_NON_STP
1N/A
1N/A#define ADMIN_PORT_PATH_COST_AUTO 0
1N/A
1N/Atypedef struct {
1N/A /* service data */
1N/A unsigned long field_mask; /* which fields to change */
1N/A char vlan_name[NAME_LEN]; /* name of the VLAN, key of the bridge */
1N/A
1N/A /* protocol data */
1N/A int port_priority;
1N/A unsigned long admin_port_path_cost; /* ADMIN_PORT_PATH_COST_AUTO - auto sence */
1N/A ADMIN_P2P_T admin_point2point;
1N/A unsigned char admin_edge;
1N/A unsigned char admin_non_stp; /* 1- doesn't participate in STP, 1 - regular */
1N/A#ifdef STP_DBG
1N/A unsigned int skip_rx;
1N/A unsigned int skip_tx;
1N/A#endif
1N/A
1N/A} UID_STP_PORT_CFG_T;
1N/A
1N/Atypedef struct {
1N/A /* service data */
1N/A char vlan_name[NAME_LEN]; /* name of the VLAN, key of the bridge */
1N/A unsigned int port_no; /* key of the entry */
1N/A
1N/A /* protocol data */
1N/A UID_PORT_ID port_id;
1N/A RSTP_PORT_STATE state;
1N/A unsigned long path_cost;
1N/A
1N/A UID_BRIDGE_ID_T designated_root;
1N/A unsigned long designated_cost;
1N/A UID_BRIDGE_ID_T designated_bridge;
1N/A UID_PORT_ID designated_port;
1N/A
1N/A#if 0
1N/A int infoIs;
1N/A unsigned short handshake_flags;
1N/A#endif
1N/A
1N/A unsigned long rx_cfg_bpdu_cnt;
1N/A unsigned long rx_rstp_bpdu_cnt;
1N/A unsigned long rx_tcn_bpdu_cnt;
1N/A int fdWhile; /* 17.15.1 */
1N/A int helloWhen; /* 17.15.2 */
1N/A int mdelayWhile; /* 17.15.3 */
1N/A int rbWhile; /* 17.15.4 */
1N/A int rcvdInfoWhile;/* 17.15.5 */
1N/A int rrWhile; /* 17.15.6 */
1N/A int tcWhile; /* 17.15.7 */
1N/A int txCount; /* 17.18.40 */
1N/A int lnkWhile;
1N/A
1N/A unsigned long uptime; /* 14.8.2.1.3.a */
1N/A unsigned long oper_port_path_cost;
1N/A unsigned char role;
1N/A unsigned char oper_point2point;
1N/A unsigned char oper_edge;
1N/A unsigned char oper_stp_neigb;
1N/A unsigned char top_change_ack;
1N/A unsigned char tc;
1N/A} UID_STP_PORT_STATE_T;
1N/A
1N/A#endif