summaryrefslogtreecommitdiff
path: root/include/openflow
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2016-01-20 09:46:09 -0800
committerBen Pfaff <blp@ovn.org>2016-01-20 09:46:11 -0800
commit8fd0bb602e49bff8b5b6db594083572bb5604025 (patch)
treebfe53e6100f48f1e0424bdb232d98822c3a9a1c4 /include/openflow
parenta930d4c5a46e8d0e5aaf3bd83161e54db10275f1 (diff)
downloadopenvswitch-8fd0bb602e49bff8b5b6db594083572bb5604025.tar.gz
ofp-util: Rewrite async config encoding and decoding to be table-driven.
The encoding and decoding of the OpenFlow and Open vSwitch async config messages was, until now, a collection of disjoint code that had a lot of redundancy. This commit changes it all to be driven using a single central table. This rewrite fixes a bug in the OF1.4+ version of the code, which until now assumed that every TLV in an OF1.4+ asynchronous configuration message was exactly 8 bytes long, and reported an error if any was a different length. This invariant is true of all the standard TLVs already defined, but it won't be true of any experimenter TLVs (and won't necessarily be true of any new standard TLVs), so this commit changes it to be more tolerant. The OFPACPT_* constants are no longer useful (they are encoded directly in the table and do not need to be anywhere else), so this removes them. This commit also adds support for experimenter async config messages. We don't have any yet but an upcoming commit will add one. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
Diffstat (limited to 'include/openflow')
-rw-r--r--include/openflow/openflow-1.4.h23
1 files changed, 1 insertions, 22 deletions
diff --git a/include/openflow/openflow-1.4.h b/include/openflow/openflow-1.4.h
index ac5748b48..49a4f7b51 100644
--- a/include/openflow/openflow-1.4.h
+++ b/include/openflow/openflow-1.4.h
@@ -125,7 +125,7 @@ enum ofp14_table_mod_prop_eviction_flag {
enum ofp14_table_reason {
OFPTR_VACANCY_DOWN = 3, /* Vacancy down threshold event. */
OFPTR_VACANCY_UP = 4, /* Vacancy up threshold event. */
- OFPTR_N_REASONS /* Denotes number of reasons. */
+#define OFPTR_BITS ((1u << OFPTR_VACANCY_DOWN) | (1u << OFPTR_VACANCY_UP))
};
struct ofp14_table_mod_prop_vacancy {
@@ -255,27 +255,6 @@ enum ofp14_requestforward_reason {
OFPRFR_N_REASONS /* Denotes number of reasons. */
};
-/* Async Config property types.
-* Low order bit cleared indicates a property for the slave role.
-* Low order bit set indicates a property for the master/equal role.
-*/
-enum ofp14_async_config_prop_type {
- OFPACPT_PACKET_IN_SLAVE = 0, /* Packet-in mask for slave. */
- OFPACPT_PACKET_IN_MASTER = 1, /* Packet-in mask for master. */
- OFPACPT_PORT_STATUS_SLAVE = 2, /* Port-status mask for slave. */
- OFPACPT_PORT_STATUS_MASTER = 3, /* Port-status mask for master. */
- OFPACPT_FLOW_REMOVED_SLAVE = 4, /* Flow removed mask for slave. */
- OFPACPT_FLOW_REMOVED_MASTER = 5, /* Flow removed mask for master. */
- OFPACPT_ROLE_STATUS_SLAVE = 6, /* Role status mask for slave. */
- OFPACPT_ROLE_STATUS_MASTER = 7, /* Role status mask for master. */
- OFPACPT_TABLE_STATUS_SLAVE = 8, /* Table status mask for slave. */
- OFPACPT_TABLE_STATUS_MASTER = 9, /* Table status mask for master. */
- OFPACPT_REQUESTFORWARD_SLAVE = 10, /* RequestForward mask for slave. */
- OFPACPT_REQUESTFORWARD_MASTER = 11, /* RequestForward mask for master. */
- OFPTFPT_EXPERIMENTER_SLAVE = 0xFFFE, /* Experimenter for slave. */
- OFPTFPT_EXPERIMENTER_MASTER = 0xFFFF, /* Experimenter for master. */
-};
-
/* Role status event message. */
struct ofp14_role_status {
ovs_be32 role; /* One of OFPCR_ROLE_*. */