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 FILE_SECBOOT ( PERMITTED );
12 
13 #include <stdint.h>
14 #include <ipxe/if_ether.h>
15 
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 */
24 struct stp_switch {
25  /** Priotity */
27  /** MAC address */
29 } __attribute__ (( packed ));
30 
31 /** A Spanning Tree bridge protocol data unit */
32 struct 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 */
48  struct stp_switch root;
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 */
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:40
uint32_t cost
Root path cost.
Definition: stp.h:50
A Spanning Tree bridge protocol data unit.
Definition: stp.h:32
uint8_t version
Protocol version.
Definition: stp.h:42
struct stp_switch sender
Sender switch.
Definition: stp.h:52
uint8_t ssap
LLC SSAP.
Definition: stp.h:36
uint8_t control
LLC control field.
Definition: stp.h:38
uint8_t flags
Flags.
Definition: stp.h:46
FILE_SECBOOT(PERMITTED)
uint16_t age
Message age.
Definition: stp.h:56
uint16_t delay
Forward delay.
Definition: stp.h:62
unsigned char uint8_t
Definition: stdint.h:10
#define ETH_ALEN
Definition: if_ether.h:9
unsigned int uint32_t
Definition: stdint.h:12
uint8_t type
Message type.
Definition: stp.h:44
uint16_t port
Port.
Definition: stp.h:54
uint8_t mac[ETH_ALEN]
MAC address.
Definition: stp.h:28
struct stp_switch root
Root switch.
Definition: stp.h:48
uint8_t dsap
LLC DSAP.
Definition: stp.h:34
uint16_t priority
Priotity.
Definition: stp.h:26
A switch identifier.
Definition: stp.h:24
uint16_t hello
Hello time.
Definition: stp.h:60
uint16_t max
Maximum age.
Definition: stp.h:58