diff options
author | Ben Pfaff <blp@ovn.org> | 2015-12-29 06:44:16 -0800 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2016-01-20 08:27:21 -0800 |
commit | c5562271fd3fb888ae26a6b7c8e12f622fa9c28f (patch) | |
tree | 2873c008a87143c6d18f490c331b11026a886e6e /include/openflow | |
parent | 3b32bb36a1d469207de22ec159be5d8d019a626b (diff) | |
download | openvswitch-c5562271fd3fb888ae26a6b7c8e12f622fa9c28f.tar.gz |
ofp-prop: New module for working with OpenFlow 1.3+ properties.
Several OpenFlow 1.3+ messages use TLV-based properties that take a
common form. Until now, ofp-util has had some static functions for
dealing with properties. Because properties will start to be needed
outside of ofp-util, this commit breaks them out into a new library,
renaming them to begin with ofpprop_.
The following commit will add a few new interfaces that add new
functionality.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'include/openflow')
-rw-r--r-- | include/openflow/openflow-common.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/openflow/openflow-common.h b/include/openflow/openflow-common.h index f152718f5..d2efa5f2a 100644 --- a/include/openflow/openflow-common.h +++ b/include/openflow/openflow-common.h @@ -209,6 +209,34 @@ enum ofp_port_features { OFPPF_10GB_FD = 1 << 6, /* 10 Gb full-duplex rate support. */ }; +/* Generic OpenFlow property header, as used by various messages in OF1.3+, and + * especially in OF1.4. + * + * The OpenFlow specs prefer to define a new structure with a specialized name + * each time this property structure comes up: struct + * ofp_port_desc_prop_header, struct ofp_controller_status_prop_header, struct + * ofp_table_mod_prop_header, and more. They're all the same, so it's easier + * to unify them. + */ +struct ofp_prop_header { + ovs_be16 type; + ovs_be16 len; +}; +OFP_ASSERT(sizeof(struct ofp_prop_header) == 4); + +/* Generic OpenFlow experimenter property header. + * + * Again the OpenFlow specs define this over and over again and it's easier to + * unify them. */ +struct ofp_prop_experimenter { + ovs_be16 type; /* Generally 0xffff (in one case 0xfffe). */ + ovs_be16 len; /* Length in bytes of this property. */ + ovs_be32 experimenter; /* Experimenter ID which takes the same form as + * in struct ofp_experimenter_header. */ + ovs_be32 exp_type; /* Experimenter defined. */ +}; +OFP_ASSERT(sizeof(struct ofp_prop_experimenter) == 12); + /* Switch features. */ struct ofp_switch_features { ovs_be64 datapath_id; /* Datapath unique ID. The lower 48-bits are for |