These changes are the raw update to qemu-2.6.
[kvmfornfv.git] / qemu / roms / ipxe / src / include / ipxe / stp.h
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 */
25         uint16_t priority;
26         /** MAC address */
27         uint8_t mac[ETH_ALEN];
28 } __attribute__ (( packed ));
29
30 /** A Spanning Tree bridge protocol data unit */
31 struct stp_bpdu {
32         /** LLC DSAP */
33         uint8_t dsap;
34         /** LLC SSAP */
35         uint8_t ssap;
36         /** LLC control field */
37         uint8_t control;
38         /** Protocol ID */
39         uint16_t protocol;
40         /** Protocol version */
41         uint8_t version;
42         /** Message type */
43         uint8_t type;
44         /** Flags */
45         uint8_t flags;
46         /** Root switch */
47         struct stp_switch root;
48         /** Root path cost */
49         uint32_t cost;
50         /** Sender switch */
51         struct stp_switch sender;
52         /** Port */
53         uint16_t port;
54         /** Message age */
55         uint16_t age;
56         /** Maximum age */
57         uint16_t max;
58         /** Hello time */
59         uint16_t hello;
60         /** Forward delay */
61         uint16_t 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 */