diff options
author | Ben Pfaff <blp@nicira.com> | 2012-02-01 10:27:30 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2012-02-01 14:15:17 -0800 |
commit | 254750ceb233f44744c1a9331145c3c2287bd0df (patch) | |
tree | 429550eafed6e99c03efc4a40316c96576b157d3 /ofproto/ofproto.h | |
parent | 18b2a258c4c87ccd7d00fcd64722c669ba8a8cab (diff) |
Add support for limiting the number of flows in an OpenFlow flow table.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'ofproto/ofproto.h')
-rw-r--r-- | ofproto/ofproto.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/ofproto/ofproto.h b/ofproto/ofproto.h index 2d478784..dd42ecf6 100644 --- a/ofproto/ofproto.h +++ b/ofproto/ofproto.h @@ -217,7 +217,6 @@ 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. */ - void ofproto_port_unregister(struct ofproto *, uint16_t ofp_port); void ofproto_port_clear_cfm(struct ofproto *, uint16_t ofp_port); @@ -314,6 +313,27 @@ int ofproto_mirror_get_stats(struct ofproto *, void *aux, int ofproto_set_flood_vlans(struct ofproto *, unsigned long *flood_vlans); bool ofproto_is_mirror_output_bundle(const struct ofproto *, void *aux); +/* Configuration of OpenFlow tables. */ +struct ofproto_table_settings { + char *name; /* Name exported via OpenFlow or NULL. */ + unsigned int max_flows; /* Maximum number of flows or UINT_MAX. */ + + /* These members determine the handling of an attempt to add a flow that + * would cause the table to have more than 'max_flows' flows. + * + * If 'groups' is NULL, overflows will be rejected with an error. + * + * If 'groups' is nonnull, an overflow will cause a flow to be removed. + * The flow to be removed is chosen to give fairness among groups + * distinguished by different values for the subfields within 'groups'. */ + struct mf_subfield *groups; + size_t n_groups; +}; + +int ofproto_get_n_tables(const struct ofproto *); +void ofproto_configure_table(struct ofproto *, int table_id, + const struct ofproto_table_settings *); + /* Configuration querying. */ bool ofproto_has_snoops(const struct ofproto *); void ofproto_get_snoops(const struct ofproto *, struct sset *); |