#include "rstp.h"
#include <stdbool.h>
#include <stdint.h>
+#include "hmap.h"
#include "list.h"
#include "ovs-atomic.h"
#include "packets.h"
PORT_ROLE_TRANSITION_SM_DESIGNATED_DISCARD_EXEC,
PORT_ROLE_TRANSITION_SM_ALTERNATE_PORT_EXEC,
PORT_ROLE_TRANSITION_SM_ALTERNATE_PORT,
- PORT_ROLE_TRANSITION_SM_ALTERNATE_AGREED,
+ PORT_ROLE_TRANSITION_SM_ALTERNATE_AGREED_EXEC,
PORT_ROLE_TRANSITION_SM_ALTERNATE_PROPOSED_EXEC,
PORT_ROLE_TRANSITION_SM_BLOCK_PORT_EXEC,
PORT_ROLE_TRANSITION_SM_BLOCK_PORT,
OVS_PACKED(
struct rstp_bpdu {
ovs_be16 protocol_identifier;
- uint8_t protocol_version_identifier;
- uint8_t bpdu_type;
- uint8_t flags;
+ uint8_t protocol_version_identifier;
+ uint8_t bpdu_type;
+ uint8_t flags;
ovs_be64 root_bridge_id;
ovs_be32 root_path_cost;
ovs_be64 designated_bridge_id;
ovs_be16 designated_port_id;
- ovs_be16 message_age;
- ovs_be16 max_age;
- ovs_be16 hello_time;
- ovs_be16 forward_delay;
- uint8_t version1_length;
- uint8_t padding[7];
+ ovs_be16 message_age;
+ ovs_be16 max_age;
+ ovs_be16 hello_time;
+ ovs_be16 forward_delay;
+ uint8_t version1_length;
+ uint8_t padding[7];
});
-enum rstp_admin_point_to_point_mac_state {
- RSTP_ADMIN_P2P_MAC_FORCE_TRUE,
- RSTP_ADMIN_P2P_MAC_FORCE_FALSE,
- RSTP_ADMIN_P2P_MAC_FORCE_AUTO
-};
-
enum rstp_info_is {
INFO_IS_DISABLED,
INFO_IS_RECEIVED,
struct ovs_refcount ref_cnt;
struct rstp *rstp OVS_GUARDED_BY(rstp_mutex);
- struct list node OVS_GUARDED_BY(rstp_mutex); /* Node in rstp->ports list. */
+ struct hmap_node node OVS_GUARDED_BY(rstp_mutex); /* In rstp->ports. */
void *aux OVS_GUARDED_BY(rstp_mutex);
struct rstp_bpdu received_bpdu_buffer OVS_GUARDED_BY(rstp_mutex);
/*************************************************************************
};
struct rstp {
- struct list node OVS_GUARDED_BY(rstp_mutex); /* In rstp instances list */
+ struct ovs_list node OVS_GUARDED_BY(rstp_mutex); /* In rstp instances list */
char *name; /* Bridge name. */
/* Changes in last SM execution. */
bool stp_version OVS_GUARDED_BY(rstp_mutex);
/* Ports */
- struct list ports OVS_GUARDED_BY(rstp_mutex);
- uint16_t ports_count OVS_GUARDED_BY(rstp_mutex);
+ struct hmap ports OVS_GUARDED_BY(rstp_mutex);
struct ovs_refcount ref_cnt;
/* Interface to client. */
- void (*send_bpdu)(struct ofpbuf *bpdu, void *port_aux, void *rstp_aux);
+ void (*send_bpdu)(struct dp_packet *bpdu, void *port_aux, void *rstp_aux);
void *aux;
+
+ bool root_changed;
+ void *old_root_aux;
+ void *new_root_aux;
};
#endif /* rstp-common.h */