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 63 of file stp.c.
72 if (
iob_len ( iobuf ) <
sizeof ( *stp ) ) {
73 DBGC (
netdev,
"STP %s received underlength packet (%zd " 83 DBGC (
netdev,
"STP %s ignoring non-STP packet (protocol " 89 DBGC (
netdev,
"STP %s received legacy STP packet (version " 95 DBGC (
netdev,
"STP %s received non-RSTP packet (type %#02x)\n",
102 DBGC2 (
netdev,
"STP %s %s port %#04x flags %#02x hello %d delay %d\n",
109 DBGC (
netdev,
"STP %s %s port %#04x flags %#02x is not " 121 DBGC (
netdev,
"STP %s %s port %#04x flags %#02x is " #define EINVAL
Invalid argument.
struct arbelprm_rc_send_wqe rc
#define TICKS_PER_SEC
Number of ticks per second.
uint16_t protocol
Protocol ID.
A Spanning Tree bridge protocol data unit.
uint8_t version
Protocol version.
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
struct stp_switch sender
Sender switch.
static int netdev_link_blocked(struct net_device *netdev)
Check link block state of network device.
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.
#define STP_TYPE_RSTP
Rapid Spanning Tree bridge PDU type.
static struct net_device * netdev
uint16_t delay
Forward delay.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
uint16_t hello
Hello time.
uint8_t type
Message type.
uint8_t mac[ETH_ALEN]
MAC address.
#define STP_FL_FORWARDING
Port is forwarding.
#define STP_PROTOCOL
Spanning Tree protocol ID.
char name[NETDEV_NAME_LEN]
Name of this network device.
void * data
Start of data.
#define STP_VERSION_RSTP
Rapid Spanning Tree protocol version.
uint16_t hello
Hello time.
#define ENETUNREACH
Network unreachable.
struct bofm_section_header done
References io_buffer::data, DBGC, DBGC2, DBGC_HDA, stp_bpdu::delay, done, EINVAL, ENETUNREACH, ENOTSUP_PROTOCOL, ENOTSUP_TYPE, ENOTSUP_VERSION, eth_ntoa(), stp_bpdu::flags, free_iob(), hello, stp_bpdu::hello, htons, iob_len(), stp_switch::mac, net_device::name, 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.