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