/************************************************************************
* 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.
**********************************************************************/
/* Port Role Selection state machine : 17.22 */
#include "base.h"
#include "stpm.h"
#include "stp_vectors.h"
#define STATES { \
CHOOSE(INIT_BRIDGE), \
}
#include "choose.h"
#if 0
{
}
#endif
static Bool
{
#if 0 /* def STP_DBG */
STP_VECT_br_id_print ("portPrio.design_bridge",
STP_VECT_br_id_print (" this->BrId",
}
#endif
return True;
} else {
return False;
}
}
/* ARGSUSED */
static void
{
#ifdef STP_DBG
char* new_role_name;
#endif
return;
switch (newRole) {
case DisabledPort:
#ifdef STP_DBG
new_role_name = "Disabled";
#endif
break;
case AlternatePort:
#ifdef STP_DBG
new_role_name = "Alternate";
#endif
break;
case BackupPort:
#ifdef STP_DBG
new_role_name = "Backup";
#endif
break;
case RootPort:
#ifdef STP_DBG
new_role_name = "Root";
#endif
break;
case DesignatedPort:
#ifdef STP_DBG
new_role_name = "Designated";
#endif
break;
case NonStpPort:
#ifdef STP_DBG
new_role_name = "NonStp";
#endif
break;
default:
#ifdef STP_DBG
stp_trace ("%s-%s:port %s => Unknown (%d ?)",
#else
abort();
#endif
return;
}
#ifdef STP_DBG
stp_trace ("%s(%s-%s) => %s",
#endif
}
static void
{ /* 17.10.20 */
}
}
static void
{ /* 17.19.1 */
}
}
static void
{
register unsigned int dm;
if (port->admin_non_stp) {
continue;
}
continue;
continue;
#if 0 /* def STP_DBG */
#endif
continue;
}
if (!dm)
dm = 1;
#ifdef STP_DBG
stp_trace ("updtRootPrio: dm=%d rootTimes.MessageAge=%d on port %s",
#endif
}
}
}
static void
{ /* 17.19.21 */
#ifdef STP_DBG
#endif
#ifdef STP_DBG
#endif
stpm->rootPortId = 0;
updtRootPrio (this);
if (port->admin_non_stp) {
continue;
}
#if 0
#ifdef STP_DBG
STP_VECT_br_id_print ("ch:designPrio.design_bridge",
}
#endif
#endif
}
#ifdef STP_DBG
if (! stpm->rootPortId) {
} else {
stp_trace ("bridge %s new root port: %s",
}
}
#endif
if (port->admin_non_stp) {
continue;
}
case Disabled:
break;
case Aged:
break;
case Mine:
&port->designPrio) ||
&port->designTimes)) {
}
break;
case Received:
/* Note: this important piece has been inserted after
* discussion with Mick Sieman and reading 802.1y Z1 */
break;
} else {
} else {
}
}
break;
default:
break;
}
}
}
static Bool
{
#ifdef STP_DBG
#endif
return False;
}
}
}
return True;
}
void
{
case BEGIN:
case INIT_BRIDGE:
break;
case ROLE_SELECTION:
(void) setSelectedBridge (stpm);
break;
}
}
{
/*
* This doesn't look right. Why should we hop state twice in a single check
* condition call? It means we can never perform the enter-state action for
* INIT_BRIDGE.
*/
#ifdef carlsonj_removed
(void) STP_hop_2_state (s, INIT_BRIDGE);
}
#endif
switch (s->State) {
case BEGIN:
return STP_hop_2_state (s, INIT_BRIDGE);
case INIT_BRIDGE:
return STP_hop_2_state (s, ROLE_SELECTION);
case ROLE_SELECTION:
/* stp_trace ("reselect on port %s", port->port_name); */
return STP_hop_2_state (s, ROLE_SELECTION);
}
}
break;
}
return False;
}
void
{
if (!this->rootPortId ||
}
}
}
}