Process incoming STP packets.
- Parameters
-
| iobuf | I/O buffer |
| netdev | Network device |
| ll_source | Link-layer source address |
| flags | Packet flags |
- Return values
-
Definition at line 64 of file stp.c.
67 {
71
72
73 if (
iob_len ( iobuf ) <
sizeof ( *stp ) ) {
74 DBGC (
netdev,
"STP %s received underlength packet (%zd "
79 }
81
82
84 DBGC (
netdev,
"STP %s ignoring non-STP packet (protocol "
88 }
90 DBGC (
netdev,
"STP %s received legacy STP packet (version "
94 }
96 DBGC (
netdev,
"STP %s received non-RSTP packet (type %#02x)\n",
100 }
101
102
103 DBGC2 (
netdev,
"STP %s %s port %#04x flags %#02x hello %d delay %d\n",
106
107
109
110 DBGC (
netdev,
"STP %s %s port %#04x flags %#02x is not "
111 "forwarding\n",
118 }
119
120
122 DBGC (
netdev,
"STP %s %s port %#04x flags %#02x is "
123 "forwarding\n",
126 }
129
133}
struct arbelprm_rc_send_wqe rc
struct bofm_section_header done
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
static struct net_device * netdev
#define EINVAL
Invalid argument.
#define ENETUNREACH
Network unreachable.
#define TICKS_PER_SEC
Number of ticks per second.
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
void netdev_link_block(struct net_device *netdev, unsigned long timeout)
Mark network device link as being blocked.
void netdev_link_unblock(struct net_device *netdev)
Mark network device link as being unblocked.
static int netdev_link_blocked(struct net_device *netdev)
Check link block state of network device.
#define STP_FL_FORWARDING
Port is forwarding.
uint16_t hello
Hello time.
#define STP_VERSION_RSTP
Rapid Spanning Tree protocol version.
#define STP_PROTOCOL
Spanning Tree protocol ID.
#define STP_TYPE_RSTP
Rapid Spanning Tree bridge PDU type.
void * data
Start of data.
A Spanning Tree bridge protocol data unit.
uint8_t type
Message type.
uint16_t protocol
Protocol ID.
struct stp_switch sender
Sender switch.
uint16_t hello
Hello time.
uint16_t delay
Forward delay.
uint8_t version
Protocol version.
uint8_t mac[ETH_ALEN]
MAC address.
References __unused, io_buffer::data, DBGC, DBGC2, DBGC_HDA, stp_bpdu::delay, done, EINVAL, ENETUNREACH, ENOTSUP_PROTOCOL, ENOTSUP_TYPE, ENOTSUP_VERSION, eth_ntoa(), flags, stp_bpdu::flags, free_iob(), hello, stp_bpdu::hello, htons, iob_len(), stp_switch::mac, netdev, netdev_link_block(), netdev_link_blocked(), netdev_link_unblock(), ntohs, stp_bpdu::port, stp_bpdu::protocol, rc, stp_bpdu::sender, STP_FL_FORWARDING, STP_PROTOCOL, STP_TYPE_RSTP, STP_VERSION_RSTP, TICKS_PER_SEC, stp_bpdu::type, and stp_bpdu::version.