Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
ethernet_bridge_stp.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright The Zephyr Project Contributors
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
10
11#ifndef ZEPHYR_INCLUDE_NET_ETHERNET_BRIDGE_STP_H_
12#define ZEPHYR_INCLUDE_NET_ETHERNET_BRIDGE_STP_H_
13
14#include <stdbool.h>
15#include <stdint.h>
16
17#include <zephyr/net/net_if.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
31
45
53
63
95
131
149
164
176
208int eth_bridge_stp_enable(struct net_if *br, bool enable);
209
220
232int eth_bridge_stp_port_get_status(struct net_if *br, struct net_if *iface,
233 struct eth_bridge_stp_port_status *status);
234
247
260int eth_bridge_stp_set_times(struct net_if *br, uint8_t max_age, uint8_t forward_delay);
261
272
285
297int eth_bridge_stp_port_set_priority(struct net_if *br, struct net_if *iface, uint8_t priority);
298
311int eth_bridge_stp_port_set_path_cost(struct net_if *br, struct net_if *iface, uint32_t cost);
312
328int eth_bridge_stp_port_set_edge(struct net_if *br, struct net_if *iface, bool admin_edge,
329 bool auto_edge);
330
344int eth_bridge_stp_port_set_p2p(struct net_if *br, struct net_if *iface,
345 enum eth_bridge_stp_p2p p2p);
346
361int eth_bridge_stp_port_mcheck(struct net_if *br, struct net_if *iface);
362
366
367#ifdef __cplusplus
368}
369#endif
370
371#endif /* ZEPHYR_INCLUDE_NET_ETHERNET_BRIDGE_STP_H_ */
int eth_bridge_stp_port_set_p2p(struct net_if *br, struct net_if *iface, enum eth_bridge_stp_p2p p2p)
Set whether a bridge port is attached to a point-to-point link.
int eth_bridge_stp_port_mcheck(struct net_if *br, struct net_if *iface)
Make a bridge port check whether STP bridges are still attached.
int eth_bridge_stp_port_set_priority(struct net_if *br, struct net_if *iface, uint8_t priority)
Set the priority of a bridge port.
int eth_bridge_stp_set_times(struct net_if *br, uint8_t max_age, uint8_t forward_delay)
Set the Bridge Max Age and Bridge Forward Delay.
int eth_bridge_stp_port_set_edge(struct net_if *br, struct net_if *iface, bool admin_edge, bool auto_edge)
Set how a bridge port detects that it is an Edge Port.
int eth_bridge_stp_set_bridge_priority(struct net_if *br, uint16_t priority)
Set the Bridge Priority.
int eth_bridge_stp_port_get_status(struct net_if *br, struct net_if *iface, struct eth_bridge_stp_port_status *status)
Get the spanning tree state of a bridge port.
int eth_bridge_stp_enable(struct net_if *br, bool enable)
Start or stop the spanning tree protocol on a bridge.
int eth_bridge_stp_port_set_path_cost(struct net_if *br, struct net_if *iface, uint32_t cost)
Set the Port Path Cost of a bridge port.
eth_bridge_stp_version
Force Protocol Version (IEEE Std 802.1Q-2014 13.7.2).
Definition ethernet_bridge_stp.h:47
eth_bridge_stp_p2p
Point-to-point setting of a port (IEEE Std 802.1Q-2014 13.28.16).
Definition ethernet_bridge_stp.h:55
int eth_bridge_stp_set_version(struct net_if *br, enum eth_bridge_stp_version version)
Set the Force Protocol Version.
eth_bridge_stp_role
Port Role (IEEE Std 802.1Q-2014 13.27.66).
Definition ethernet_bridge_stp.h:33
int eth_bridge_stp_set_tx_hold_count(struct net_if *br, uint8_t count)
Set the Transmit Hold Count.
int eth_bridge_stp_get_status(struct net_if *br, struct eth_bridge_stp_status *status)
Get the spanning tree state of a bridge.
@ ETH_BRIDGE_STP_VERSION_RSTP
RSTP, the default.
Definition ethernet_bridge_stp.h:51
@ ETH_BRIDGE_STP_VERSION_STP
STP compatible: STP BPDUs and no rapid transitions.
Definition ethernet_bridge_stp.h:49
@ ETH_BRIDGE_STP_P2P_ON
The port is attached to a point-to-point link.
Definition ethernet_bridge_stp.h:59
@ ETH_BRIDGE_STP_P2P_AUTO
Point-to-point if the link is full duplex.
Definition ethernet_bridge_stp.h:57
@ ETH_BRIDGE_STP_P2P_OFF
The port is attached to a shared LAN.
Definition ethernet_bridge_stp.h:61
@ ETH_BRIDGE_STP_ROLE_ROOT
The port is the best path to the root bridge.
Definition ethernet_bridge_stp.h:37
@ ETH_BRIDGE_STP_ROLE_BACKUP
A backup path to a LAN another port of this bridge connects, blocked.
Definition ethernet_bridge_stp.h:43
@ ETH_BRIDGE_STP_ROLE_ALTERNATE
An alternate path to the root bridge, blocked.
Definition ethernet_bridge_stp.h:41
@ ETH_BRIDGE_STP_ROLE_DESIGNATED
The port connects its LAN to the root bridge.
Definition ethernet_bridge_stp.h:39
@ ETH_BRIDGE_STP_ROLE_DISABLED
The port is disabled, or the protocol is off.
Definition ethernet_bridge_stp.h:35
Public API for network interface.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT64_TYPE__ uint64_t
Definition stdint.h:91
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Information of the NET_EVENT_ETHERNET_BRIDGE_PORT_STATE event.
Definition ethernet_bridge_stp.h:139
struct net_if * bridge
Bridge interface of the port.
Definition ethernet_bridge_stp.h:141
bool learning
The port learns source addresses.
Definition ethernet_bridge_stp.h:145
bool forwarding
The port forwards frames.
Definition ethernet_bridge_stp.h:147
enum eth_bridge_stp_role role
Port Role.
Definition ethernet_bridge_stp.h:143
Spanning tree state of a bridge port.
Definition ethernet_bridge_stp.h:97
bool auto_edge
AutoEdge setting, see eth_bridge_stp_port_set_edge().
Definition ethernet_bridge_stp.h:109
uint16_t designated_port
Designated Port of the port's LAN.
Definition ethernet_bridge_stp.h:127
bool path_cost_auto
The Port Path Cost is derived from the link speed.
Definition ethernet_bridge_stp.h:115
uint16_t port_id
Port Identifier: priority in the 4 most significant bits, then the port number.
Definition ethernet_bridge_stp.h:119
enum eth_bridge_stp_p2p p2p
Point-to-point setting, see eth_bridge_stp_port_set_p2p().
Definition ethernet_bridge_stp.h:113
bool oper_p2p
The port is attached to a point-to-point link.
Definition ethernet_bridge_stp.h:111
bool forwarding
The port forwards frames.
Definition ethernet_bridge_stp.h:103
bool learning
The port learns source addresses.
Definition ethernet_bridge_stp.h:101
uint64_t designated_root
Root bridge known on the port's LAN.
Definition ethernet_bridge_stp.h:123
uint32_t path_cost
Port Path Cost in use.
Definition ethernet_bridge_stp.h:121
uint64_t designated_bridge
Designated Bridge of the port's LAN.
Definition ethernet_bridge_stp.h:125
enum eth_bridge_stp_role role
Port Role.
Definition ethernet_bridge_stp.h:99
bool oper_edge
The port is an Edge Port.
Definition ethernet_bridge_stp.h:105
uint32_t designated_cost
Root path cost of the Designated Bridge.
Definition ethernet_bridge_stp.h:129
bool send_rstp
The port sends RST BPDUs, false when it sends STP BPDUs.
Definition ethernet_bridge_stp.h:117
bool admin_edge
AdminEdge setting, see eth_bridge_stp_port_set_edge().
Definition ethernet_bridge_stp.h:107
Information of the NET_EVENT_ETHERNET_BRIDGE_NEW_ROOT event.
Definition ethernet_bridge_stp.h:156
uint64_t root_id
Bridge Identifier of the root bridge.
Definition ethernet_bridge_stp.h:158
struct net_if * root_port
Root Port, NULL if this bridge is the root.
Definition ethernet_bridge_stp.h:162
uint32_t root_path_cost
Cost of the path to the root bridge.
Definition ethernet_bridge_stp.h:160
Spanning tree state of a bridge.
Definition ethernet_bridge_stp.h:65
uint8_t tx_hold_count
Transmit Hold Count.
Definition ethernet_bridge_stp.h:87
uint64_t root_id
Bridge Identifier of the root bridge.
Definition ethernet_bridge_stp.h:73
uint32_t root_path_cost
Cost of the path to the root bridge.
Definition ethernet_bridge_stp.h:75
uint8_t bridge_forward_delay
Bridge Forward Delay, in seconds.
Definition ethernet_bridge_stp.h:85
enum eth_bridge_stp_version version
Force Protocol Version.
Definition ethernet_bridge_stp.h:69
uint8_t forward_delay
Forward Delay in use, in seconds.
Definition ethernet_bridge_stp.h:81
bool topology_change
A topology change is being propagated (IEEE Std 802.1Q-2014 12.8.1.1.3).
Definition ethernet_bridge_stp.h:89
uint8_t bridge_max_age
Bridge Max Age, in seconds.
Definition ethernet_bridge_stp.h:83
uint32_t time_since_topology_change
Seconds since the last topology change.
Definition ethernet_bridge_stp.h:93
struct net_if * root_port
Root Port, NULL if this bridge is the root.
Definition ethernet_bridge_stp.h:77
uint8_t max_age
Max Age in use, in seconds.
Definition ethernet_bridge_stp.h:79
bool enabled
The protocol runs on the bridge.
Definition ethernet_bridge_stp.h:67
uint64_t bridge_id
Bridge Identifier of this bridge.
Definition ethernet_bridge_stp.h:71
uint32_t topology_change_count
Topology changes since the bridge was initialized.
Definition ethernet_bridge_stp.h:91
Information of the NET_EVENT_ETHERNET_BRIDGE_TOPOLOGY_CHANGE event.
Definition ethernet_bridge_stp.h:172
uint32_t topology_change_count
Topology changes since the bridge was initialized, this one included.
Definition ethernet_bridge_stp.h:174
Network Interface structure.
Definition net_if.h:875