BPDU processing. More...
#include "rstp/rstp.h"
#include "rstp/rstp_fsm.h"
#include "rstp/rstp_bpdu.h"
#include "rstp/rstp_conditions.h"
#include "rstp/rstp_misc.h"
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL RSTP_TRACE_LEVEL |
Functions | |
void | rstpProcessLlcFrame (NetInterface *interface, EthHeader *ethHeader, const uint8_t *data, size_t length, NetRxAncillary *ancillary, void *param) |
Process incoming LLC frame. More... | |
error_t | rstpProcessBpdu (RstpBridgePort *port, const RstpBpdu *bpdu, size_t length) |
Process incoming bridge protocol data unit. More... | |
error_t | rstpValidateConfigBpdu (RstpBridgePort *port, const RstpBpdu *bpdu, size_t length) |
Validate Configuration BPDU. More... | |
error_t | rstpSendBpdu (RstpBridgePort *port, const RstpBpdu *bpdu, size_t length) |
Send bridge protocol data unit. More... | |
error_t | rstpDumpBpdu (const RstpBpdu *bpdu, size_t length) |
Dump BPDU for debugging purpose. More... | |
void | rstpDumpFlags (uint8_t flags) |
Dump Flags field for debugging purpose. More... | |
Variables | |
const MacAddr | RSTP_BRIDGE_GROUP_ADDR = {{{0x01, 0x80, 0xC2, 0x00, 0x00, 0x00}}} |
const RstpParamName | rstpProtocolVersions [] |
const RstpParamName | rstpBpduTypes [] |
Detailed Description
BPDU processing.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2019-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneSTP Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.4.4
Definition in file rstp_bpdu.c.
Macro Definition Documentation
◆ TRACE_LEVEL
#define TRACE_LEVEL RSTP_TRACE_LEVEL |
Definition at line 32 of file rstp_bpdu.c.
Function Documentation
◆ rstpDumpBpdu()
Dump BPDU for debugging purpose.
- Parameters
-
[in] bpdu Pointer to the BPDU to dump [in] length Length of the BPDU, in bytes
- Returns
- Error code
Definition at line 389 of file rstp_bpdu.c.
◆ rstpDumpFlags()
void rstpDumpFlags | ( | uint8_t | flags | ) |
Dump Flags field for debugging purpose.
- Parameters
-
[in] flags Value of the Flags field
Definition at line 466 of file rstp_bpdu.c.
◆ rstpProcessBpdu()
error_t rstpProcessBpdu | ( | RstpBridgePort * | port, |
const RstpBpdu * | bpdu, | ||
size_t | length | ||
) |
Process incoming bridge protocol data unit.
- Parameters
-
[in] port Pointer to the bridge port context [in] bpdu Pointer to the received BPDU [in] length Length of the BPDU, in bytes
- Returns
- Error code
Definition at line 134 of file rstp_bpdu.c.
◆ rstpProcessLlcFrame()
void rstpProcessLlcFrame | ( | NetInterface * | interface, |
EthHeader * | ethHeader, | ||
const uint8_t * | data, | ||
size_t | length, | ||
NetRxAncillary * | ancillary, | ||
void * | param | ||
) |
Process incoming LLC frame.
- Parameters
-
[in] interface Underlying network interface [in] ethHeader Pointer to the Ethernet header [in] data Pointer to the LLC frame [in] length Length of the LLC frame, in bytes [in] ancillary Additional options passed to the stack along with the packet [in] param Pointer to the RSTP bridge context
Definition at line 75 of file rstp_bpdu.c.
◆ rstpSendBpdu()
error_t rstpSendBpdu | ( | RstpBridgePort * | port, |
const RstpBpdu * | bpdu, | ||
size_t | length | ||
) |
Send bridge protocol data unit.
- Parameters
-
[in] port Pointer to the bridge port context [in] bpdu Pointer to the BPDU to be transmitted [in] length Length of the BPDU, in bytes
- Returns
- Error code
Definition at line 308 of file rstp_bpdu.c.
◆ rstpValidateConfigBpdu()
error_t rstpValidateConfigBpdu | ( | RstpBridgePort * | port, |
const RstpBpdu * | bpdu, | ||
size_t | length | ||
) |
Validate Configuration BPDU.
- Parameters
-
[in] port Pointer to the bridge port context [in] bpdu Pointer to the received Configuration BPDU [in] length Length of the Configuration BPDU, in bytes
- Returns
- Error code
Definition at line 271 of file rstp_bpdu.c.
Variable Documentation
◆ RSTP_BRIDGE_GROUP_ADDR
const MacAddr RSTP_BRIDGE_GROUP_ADDR = {{{0x01, 0x80, 0xC2, 0x00, 0x00, 0x00}}} |
Definition at line 46 of file rstp_bpdu.c.
◆ rstpBpduTypes
const RstpParamName rstpBpduTypes[] |
Definition at line 56 of file rstp_bpdu.c.
◆ rstpProtocolVersions
const RstpParamName rstpProtocolVersions[] |
Definition at line 49 of file rstp_bpdu.c.