/************************************************************************
* RSTP library - Rapid Spanning Tree (802.1t, 802.1w)
* Copyright (C) 2001-2003 Optical Access
* Author: Alex Rozin
*
* This file is part of RSTP library.
*
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation; version 2.1
*
* RSTP library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with RSTP library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
**********************************************************************/
#include "base.h"
#include "stpm.h"
#include "stp_vectors.h"
/* The Port Information State Machine : 17.21 */
#define STATES { \
}
#include "choose.h"
#if 0 /* for debug */
void
{
register int iii;
}
stp_trace ("\n");
}
#endif
static RCVD_MSG_T
{/* 17.19.8 */
int bridcmp;
#ifdef STP_DBG
}
#endif
return OtherMsg;
}
}
if (bridcmp < 0 ||
#ifdef STP_DBG
}
#endif
return SuperiorDesignateMsg;
}
}
#ifdef STP_DBG
}
#endif
return RepeatedDesignateMsg;
}
}
#ifdef STP_DBG
}
#endif
return ConfirmedRootMsg;
}
#ifdef STP_DBG
if (!port->operPointToPointMac) {
stp_trace("rcvBpdu: OtherMsg: not point-to-point MAC");
} else {
stp_trace("rcvBpdu: OtherMsg: agreement bit not set");
}
} else {
}
}
#endif
return OtherMsg;
}
/* ARGSUSED */
static Bool
{/* 17.19.9 */
return True;
}
return False;
}
static void
{/* 17.19.13 */
#ifdef STP_DBG
}
#endif
} else {
#ifdef STP_DBG
stp_trace ("(%s-%s) rx rcvdTc 0X%lx",
}
#endif
}
#ifdef STP_DBG
stp_trace ("port %s rx rcvdTcAck 0X%lx",
}
#endif
}
}
}
static void
{/* 17.19.18 */
}
}
/* port->port->owner->ForceVersion >= NORMAL_RSTP
we have checked in STP_info_rx_bpdu */
}
}
static void
{/* 17.19.19 */
register int hello3;
else
/****
stp_trace ("ma=%d eff_age=%d dm=%d dt=%d p=%s",
(int) port->portTimes.MessageAge,
(int) eff_age, (int) dm, (int) dt, port->port_name);
****/
} else {
port->rcvdInfoWhile = 0;
/****/
#ifdef STP_DBG
/*if (this->debug) */
{
stp_trace ("port %s: MaxAge=%d MessageAge=%d HelloTime=%d rcvdInfoWhile=null !",
}
#endif
/****/
}
}
/* ARGSUSED */
void
{
#if 0
stp_trace ("protocol=%02x%02x version=%02x bpdu_type=%02x\n",
#endif
/* check bpdu type */
case BPDU_CONFIG_TYPE:
port->rx_cfg_bpdu_cnt++;
#ifdef STP_DBG
#endif
if (port->admin_non_stp) return;
break;
case BPDU_TOPO_CHANGE_TYPE:
port->rx_tcn_bpdu_cnt++;
#ifdef STP_DBG
#endif
if (port->admin_non_stp) return;
return;
default:
return;
case BPDU_RSTP:
port->rx_rstp_bpdu_cnt++;
if (port->admin_non_stp) return;
} else {
return;
}
#ifdef STP_DBG
#endif
break;
}
/* 17.18.11 */
/* 17.18.12 */
/* 17.18.25, 17.18.26 : see setTcFlags() */
}
{
case BEGIN:
/* clear port statistics */
port->rx_tcn_bpdu_cnt = 0;
/* FALLTHRU */
case DISABLED:
port->rcvdInfoWhile = 0;
break;
case ENABLED: /* IEEE 802.1y, 17.21, Z.14 */
break;
case AGED:
break;
case UPDATE:
#ifdef STP_DBG
STP_VECT_br_id_print ("updated: portPrio.design_bridge",
STP_VECT_br_id_print ("updated: portPrio.root_bridge",
}
#endif
break;
case CURRENT:
break;
case RECEIVE:
setTcFlags (this);
break;
case SUPERIOR:
#if 1 /* due 802.1y, Z.7 */
#endif
#ifdef STP_DBG
STP_VECT_br_id_print ("stored: portPrio.design_bridge",
STP_VECT_br_id_print ("stored: portPrio.root_bridge",
stp_trace ("proposed=%d on port %s",
}
#endif
break;
case REPEAT:
break;
case AGREEMENT:
#ifdef STP_DBG
stp_trace ("(%s-%s) rx AGREEMENT flag !",
}
#endif
break;
}
}
{
}
case DISABLED:
}
}
}
break;
case ENABLED: /* IEEE 802.1y, 17.21, Z.14 */
case AGED:
}
break;
case UPDATE:
case CURRENT:
}
! port->rcvdInfoWhile &&
}
}
break;
case RECEIVE:
case SuperiorDesignateMsg:
case RepeatedDesignateMsg:
case ConfirmedRootMsg:
default:
}
case SUPERIOR:
case REPEAT:
case AGREEMENT:
}
return False;
}