/************************************************************************
* 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 Transmit state machine : 17.27 */
#include "base.h"
#include "stpm.h"
#include "stp_to.h" /* for STP_OUT_get_port_mac & STP_OUT_tx_bpdu */
#define STATES { \
CHOOSE(TRANSMIT_INIT), \
CHOOSE(TRANSMIT_TCN), \
}
#include "choose.h"
typedef struct tx_tcn_bpdu_t {
} TCN_BPDU_T;
typedef struct tx_stp_bpdu_t {
typedef struct tx_rstp_bpdu_t {
} RSTP_BPDU_T;
{/* MAC_HEADER_T */
{0x01, 0x80, 0xc2, 0x00, 0x00, 0x00}, /* dst_mac */
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00} /* src_mac */
},
{ /* ETH_HEADER_T */
{0x00, 0x00}, /* len8023 */
},
{/* BPDU_HEADER_T */
{0x00, 0x00}, /* protocol */
},
{
0x00, /* flags; */
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* root_id[8]; */
{0x00,0x00,0x00,0x00}, /* root_path_cost[4]; */
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* bridge_id[8]; */
{0x00,0x00}, /* port_id[2]; */
{0x00,0x00}, /* message_age[2]; */
{0x00,0x00}, /* max_age[2]; */
{0x00,0x00}, /* hello_time[2]; */
{0x00,0x00}, /* forward_delay[2]; */
},
{0x00,0x00}, /* ver_1_length[2]; */
};
static size_t
unsigned char bpdu_type,
unsigned short pkt_len)
{
unsigned short len8023;
/* NOTE: I suppose, that sizeof(unsigned short)=2 ! */
return pkt_len;
}
static int
{ /* 17.19.17 (page 68) & 9.3.2 (page 25) */
#ifdef STP_DBG
stp_trace ("port %s stop tx skipping",
return STP_Nothing_To_Do;
}
#endif
sizeof (BPDU_HEADER_T));
#ifdef STP_DBG
#endif
(unsigned char *) &bpdu_packet,
pkt_len);
}
static void
{
#ifdef STP_DBG
stp_trace ("tcWhile=%d =>tx TOPOLOGY_CHANGE_BIT to port %s",
#endif
}
}
}
static int
{/* 17.19.15 (page 67) & 9.3.1 (page 23) */
#ifdef STP_DBG
stp_trace ("port %s stop tx skipping",
return STP_Nothing_To_Do;
}
#endif
sizeof (BPDU_HEADER_T) + sizeof (BPDU_BODY_T));
#ifdef STP_DBG
stp_trace ("port %s txConfig flags=0X%lx",
#endif
(unsigned char *) &bpdu_packet,
pkt_len);
}
static int
{/* 17.19.16 (page 68) & 9.3.3 (page 25) */
unsigned char role;
#ifdef STP_DBG
stp_trace ("port %s stop tx skipping",
else
stp_trace ("port %s skip tx %d",
return STP_Nothing_To_Do;
}
#endif
switch (port->selectedRole) {
default:
case DisabledPort:
break;
case AlternatePort:
break;
case BackupPort:
break;
case RootPort:
break;
case DesignatedPort:
break;
}
#if 0 /* def STP_DBG */
#endif
}
#if 0 /* def STP_DBG */
#endif
}
#ifdef STP_DBG
stp_trace ("port %s txRstp flags=0X%lx",
#endif
(unsigned char *) &bpdu_packet,
pkt_len);
}
void
{
case BEGIN:
case TRANSMIT_INIT:
break;
case TRANSMIT_PERIODIC:
break;
case IDLE:
break;
case TRANSMIT_CONFIG:
break;
case TRANSMIT_TCN:
break;
case TRANSMIT_RSTP:
break;
};
}
{
case BEGIN:
case TRANSMIT_INIT:
case TRANSMIT_PERIODIC:
case IDLE:
break;
case TRANSMIT_CONFIG:
case TRANSMIT_TCN:
case TRANSMIT_RSTP:
};
return False;
}