X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ofproto%2Fofproto.h;h=4b37bd78ffc7a732e0eec6e74d991e57fac4714f;hb=e008bc13d03e2abb75be7d2e9271c3c50d0085a5;hp=9a8f755e3a6496e3c227a9abf07d28998470a9b0;hpb=b4affc74175281b1300d879df56d8558bd553ea5;p=openvswitch diff --git a/ofproto/ofproto.h b/ofproto/ofproto.h index 9a8f755e..4b37bd78 100644 --- a/ofproto/ofproto.h +++ b/ofproto/ofproto.h @@ -26,6 +26,7 @@ #include "flow.h" #include "netflow.h" #include "sset.h" +#include "stp.h" #include "tag.h" #ifdef __cplusplus @@ -65,6 +66,36 @@ struct ofproto_sflow_options { char *control_ip; }; +struct ofproto_stp_settings { + stp_identifier system_id; + uint16_t priority; + uint16_t hello_time; + uint16_t max_age; + uint16_t fwd_delay; +}; + +struct ofproto_stp_status { + bool enabled; /* If false, ignore other members. */ + stp_identifier bridge_id; + stp_identifier designated_root; + int root_path_cost; +}; + +struct ofproto_port_stp_settings { + bool enable; + uint8_t port_num; /* In the range 1-255, inclusive. */ + uint8_t priority; + uint16_t path_cost; +}; + +struct ofproto_port_stp_status { + bool enabled; /* If false, ignore other members. */ + int port_id; + enum stp_state state; + unsigned int sec_in_state; + enum stp_role role; +}; + /* How the switch should act if the controller cannot be contacted. */ enum ofproto_fail_mode { OFPROTO_FAIL_SECURE, /* Preserve flow table. */ @@ -170,6 +201,8 @@ int ofproto_set_snoops(struct ofproto *, const struct sset *snoops); int ofproto_set_netflow(struct ofproto *, const struct netflow_options *nf_options); int ofproto_set_sflow(struct ofproto *, const struct ofproto_sflow_options *); +int ofproto_set_stp(struct ofproto *, const struct ofproto_stp_settings *); +int ofproto_get_stp_status(struct ofproto *, struct ofproto_stp_status *); /* Configuration of ports. */ @@ -179,6 +212,10 @@ void ofproto_port_clear_cfm(struct ofproto *, uint16_t ofp_port); void ofproto_port_set_cfm(struct ofproto *, uint16_t ofp_port, const struct cfm_settings *); int ofproto_port_is_lacp_current(struct ofproto *, uint16_t ofp_port); +int ofproto_port_set_stp(struct ofproto *, uint16_t ofp_port, + const struct ofproto_port_stp_settings *); +int ofproto_port_get_stp_status(struct ofproto *, uint16_t ofp_port, + struct ofproto_port_stp_status *); /* The behaviour of the port regarding VLAN handling */ enum port_vlan_mode {