diff options
author | Ben Pfaff <blp@nicira.com> | 2012-02-10 13:30:23 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2012-03-07 13:59:02 -0800 |
commit | 27527aa09ce456796eeea728cef9528aa5612b70 (patch) | |
tree | fe9f12d78b25a5520a25b6cec7e3dd5b2727ea20 /lib/learning-switch.h | |
parent | 032f3fbd856864cdcbdf505d404e826999b8a2ae (diff) |
Introduce ofputil_protocol, to abstract the protocol in use on a connection.
Open vSwitch already handles a few different protocol variations, but it
does so in a nonuniform manner:
- OpenFlow 1.0 and NXM flow formats are distinguished using the NXFF_*
constant values from nicira-ext.h.
- The "flow_mod_table_id" feature setting is maintained in ofproto as
part of an OpenFlow connection's (ofconn's) state.
There's no way to easily communicate this state among components. It's
not much of a problem yet, but as more protocol support is added it seems
better to have an abstract, uniform way to represent protocol versions and
variants. This commit implements that by introducing a new type
"enum ofputil_protocol". Each ofputil_protocol value represents a variant
of a protocol version. Each value is a separate bit, so a single enum
can also represent a set of protocols, which is often useful as well.
Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/learning-switch.h')
-rw-r--r-- | lib/learning-switch.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/learning-switch.h b/lib/learning-switch.h index c6f347e1..833b94da 100644 --- a/lib/learning-switch.h +++ b/lib/learning-switch.h @@ -46,10 +46,10 @@ struct lswitch_config { * OFP_FLOW_PERMANENT: Set up permanent flows. */ int max_idle; - /* Optionally, a list of one or more "struct ofpbuf"s containing OpenFlow - * messages to send to the switch at time of connection. Presumably these - * will be OFPT_FLOW_MOD requests to set up the flow table. */ - const struct list *default_flows; + /* Optional "flow mod" requests to send to the switch at connection time, + * to set up the flow table. */ + const struct ofputil_flow_mod *default_flows; + size_t n_default_flows; /* The OpenFlow queue to use by default. Use UINT32_MAX to avoid * specifying a particular queue. */ |