BPDU processing. More...
#include "stp/stp.h"
#include "stp/stp_operation.h"
#include "stp/stp_bpdu.h"
#include "stp/stp_misc.h"
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL STP_TRACE_LEVEL |
Functions | |
void | stpProcessLlcFrame (NetInterface *interface, EthHeader *ethHeader, const uint8_t *data, size_t length, NetRxAncillary *ancillary, void *param) |
Process incoming LLC frame. More... | |
error_t | stpProcessBpdu (StpBridgePort *port, const StpBpdu *bpdu, size_t length) |
Process incoming bridge protocol data unit. More... | |
error_t | stpSendBpdu (StpBridgePort *port, const StpBpdu *bpdu, size_t length) |
Send bridge protocol data unit. More... | |
error_t | stpDumpBpdu (const StpBpdu *bpdu, size_t length) |
Dump BPDU for debugging purpose. More... | |
void | stpDumpFlags (uint8_t flags) |
Dump Flags field for debugging purpose. More... | |
Variables | |
const MacAddr | STP_BRIDGE_GROUP_ADDR = {{{0x01, 0x80, 0xC2, 0x00, 0x00, 0x00}}} |
const StpParamName | stpProtocolVersions [] |
const StpParamName | stpBpduTypes [] |
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 stp_bpdu.c.
Macro Definition Documentation
◆ TRACE_LEVEL
#define TRACE_LEVEL STP_TRACE_LEVEL |
Definition at line 32 of file stp_bpdu.c.
Function Documentation
◆ stpDumpBpdu()
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 267 of file stp_bpdu.c.
◆ stpDumpFlags()
void stpDumpFlags | ( | uint8_t | flags | ) |
Dump Flags field for debugging purpose.
- Parameters
-
[in] flags Value of the Flags field
Definition at line 337 of file stp_bpdu.c.
◆ stpProcessBpdu()
error_t stpProcessBpdu | ( | StpBridgePort * | port, |
const StpBpdu * | 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 130 of file stp_bpdu.c.
◆ stpProcessLlcFrame()
void stpProcessLlcFrame | ( | 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 STP bridge context
Definition at line 72 of file stp_bpdu.c.
◆ stpSendBpdu()
error_t stpSendBpdu | ( | StpBridgePort * | port, |
const StpBpdu * | 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 186 of file stp_bpdu.c.
Variable Documentation
◆ STP_BRIDGE_GROUP_ADDR
const MacAddr STP_BRIDGE_GROUP_ADDR = {{{0x01, 0x80, 0xC2, 0x00, 0x00, 0x00}}} |
Definition at line 45 of file stp_bpdu.c.
◆ stpBpduTypes
const StpParamName stpBpduTypes[] |
Definition at line 54 of file stp_bpdu.c.
◆ stpProtocolVersions
const StpParamName stpProtocolVersions[] |
Definition at line 48 of file stp_bpdu.c.