2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 22:35:15 +00:00

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>
This commit is contained in:
Ben Pfaff
2012-02-10 13:30:23 -08:00
parent 032f3fbd85
commit 27527aa09c
22 changed files with 969 additions and 512 deletions

View File

@@ -22,9 +22,7 @@
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include "openflow/nicira-ext.h"
struct list;
struct ofpbuf;
struct ofputil_flow_mod;
struct ofputil_flow_stats_request;
@@ -32,12 +30,10 @@ struct ofputil_flow_stats_request;
void parse_ofp_str(struct ofputil_flow_mod *, int command, const char *str_,
bool verbose);
void parse_ofp_flow_mod_str(struct list *packets,
enum nx_flow_format *cur, bool *flow_mod_table_id,
const char *string, uint16_t command, bool verbose);
bool parse_ofp_flow_mod_file(struct list *packets,
enum nx_flow_format *cur, bool *flow_mod_table_id,
FILE *, uint16_t command);
void parse_ofp_flow_mod_str(struct ofputil_flow_mod *, const char *string,
uint16_t command, bool verbose);
void parse_ofp_flow_mod_file(const char *file_name, uint16_t command,
struct ofputil_flow_mod **fms, size_t *n_fms);
void parse_ofp_flow_stats_request_str(struct ofputil_flow_stats_request *,
bool aggregate, const char *string);