iPXE
stp.h
Go to the documentation of this file.
1#ifndef _IPXE_STP_H
2#define _IPXE_STP_H
4/** @file
5 *
6 * Spanning Tree Protocol (STP)
7 *
8 */
10FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11FILE_SECBOOT ( PERMITTED );
12
13#include <stdint.h>
14#include <ipxe/if_ether.h>
16/** "Protocol" value for STP
17 *
18 * This is the concatenated {DSAP,SSAP} value used internally by iPXE
19 * as the network-layer protocol for LLC frames.
20 */
21#define ETH_P_STP 0x4242
22
23/** A switch identifier */
24struct stp_switch {
25 /** Priotity */
27 /** MAC address */
29} __attribute__ (( packed ));
30
31/** A Spanning Tree bridge protocol data unit */
32struct stp_bpdu {
33 /** LLC DSAP */
35 /** LLC SSAP */
37 /** LLC control field */
39 /** Protocol ID */
41 /** Protocol version */
43 /** Message type */
45 /** Flags */
47 /** Root switch */
49 /** Root path cost */
51 /** Sender switch */
53 /** Port */
55 /** Message age */
57 /** Maximum age */
59 /** Hello time */
61 /** Forward delay */
63} __attribute__ (( packed ));
64
65/** Spanning Tree protocol ID */
66#define STP_PROTOCOL 0x0000
67
68/** Rapid Spanning Tree protocol version */
69#define STP_VERSION_RSTP 0x02
70
71/** Rapid Spanning Tree bridge PDU type */
72#define STP_TYPE_RSTP 0x02
73
74/** Port is forwarding */
75#define STP_FL_FORWARDING 0x20
76
77#endif /* _IPXE_STP_H */
unsigned short uint16_t
Definition stdint.h:11
unsigned int uint32_t
Definition stdint.h:12
unsigned char uint8_t
Definition stdint.h:10
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
#define ETH_ALEN
Definition if_ether.h:9
#define __attribute__(x)
Definition compiler.h:10
A Spanning Tree bridge protocol data unit.
Definition stp.h:32
uint8_t type
Message type.
Definition stp.h:44
uint16_t protocol
Protocol ID.
Definition stp.h:40
struct stp_switch sender
Sender switch.
Definition stp.h:52
uint16_t max
Maximum age.
Definition stp.h:58
uint32_t cost
Root path cost.
Definition stp.h:50
uint8_t flags
Flags.
Definition stp.h:46
uint8_t dsap
LLC DSAP.
Definition stp.h:34
uint16_t hello
Hello time.
Definition stp.h:60
struct stp_switch root
Root switch.
Definition stp.h:48
uint16_t age
Message age.
Definition stp.h:56
uint16_t delay
Forward delay.
Definition stp.h:62
uint8_t version
Protocol version.
Definition stp.h:42
uint8_t ssap
LLC SSAP.
Definition stp.h:36
uint16_t port
Port.
Definition stp.h:54
uint8_t control
LLC control field.
Definition stp.h:38
A switch identifier.
Definition stp.h:24
uint8_t mac[ETH_ALEN]
MAC address.
Definition stp.h:28
uint16_t priority
Priotity.
Definition stp.h:26