iPXE
include
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 */
26
uint16_t
priority
;
27
/** MAC address */
28
uint8_t
mac
[
ETH_ALEN
];
29
}
__attribute__
(( packed ));
30
31
/** A Spanning Tree bridge protocol data unit */
32
struct
stp_bpdu
{
33
/** LLC DSAP */
34
uint8_t
dsap
;
35
/** LLC SSAP */
36
uint8_t
ssap
;
37
/** LLC control field */
38
uint8_t
control
;
39
/** Protocol ID */
40
uint16_t
protocol
;
41
/** Protocol version */
42
uint8_t
version
;
43
/** Message type */
44
uint8_t
type
;
45
/** Flags */
46
uint8_t
flags
;
47
/** Root switch */
48
struct
stp_switch
root
;
49
/** Root path cost */
50
uint32_t
cost
;
51
/** Sender switch */
52
struct
stp_switch
sender
;
53
/** Port */
54
uint16_t
port
;
55
/** Message age */
56
uint16_t
age
;
57
/** Maximum age */
58
uint16_t
max
;
59
/** Hello time */
60
uint16_t
hello
;
61
/** Forward delay */
62
uint16_t
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 */
uint16_t
unsigned short uint16_t
Definition
stdint.h:11
uint32_t
unsigned int uint32_t
Definition
stdint.h:12
uint8_t
unsigned char uint8_t
Definition
stdint.h:10
FILE_LICENCE
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition
compiler.h:896
FILE_SECBOOT
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition
compiler.h:926
if_ether.h
ETH_ALEN
#define ETH_ALEN
Definition
if_ether.h:9
__attribute__
#define __attribute__(x)
Definition
compiler.h:10
stdint.h
stp_bpdu
A Spanning Tree bridge protocol data unit.
Definition
stp.h:32
stp_bpdu::type
uint8_t type
Message type.
Definition
stp.h:44
stp_bpdu::protocol
uint16_t protocol
Protocol ID.
Definition
stp.h:40
stp_bpdu::sender
struct stp_switch sender
Sender switch.
Definition
stp.h:52
stp_bpdu::max
uint16_t max
Maximum age.
Definition
stp.h:58
stp_bpdu::cost
uint32_t cost
Root path cost.
Definition
stp.h:50
stp_bpdu::flags
uint8_t flags
Flags.
Definition
stp.h:46
stp_bpdu::dsap
uint8_t dsap
LLC DSAP.
Definition
stp.h:34
stp_bpdu::hello
uint16_t hello
Hello time.
Definition
stp.h:60
stp_bpdu::root
struct stp_switch root
Root switch.
Definition
stp.h:48
stp_bpdu::age
uint16_t age
Message age.
Definition
stp.h:56
stp_bpdu::delay
uint16_t delay
Forward delay.
Definition
stp.h:62
stp_bpdu::version
uint8_t version
Protocol version.
Definition
stp.h:42
stp_bpdu::ssap
uint8_t ssap
LLC SSAP.
Definition
stp.h:36
stp_bpdu::port
uint16_t port
Port.
Definition
stp.h:54
stp_bpdu::control
uint8_t control
LLC control field.
Definition
stp.h:38
stp_switch
A switch identifier.
Definition
stp.h:24
stp_switch::mac
uint8_t mac[ETH_ALEN]
MAC address.
Definition
stp.h:28
stp_switch::priority
uint16_t priority
Priotity.
Definition
stp.h:26
Generated by
1.14.0