Probably incomplete. Signed-off-by: Ben Pfaff <b...@nicira.com> --- include/openflow/nicira-ext.h | 4 ++-- include/openflow/openflow-1.0.h | 19 ++++--------------- include/openflow/openflow-common.h | 14 ++++++++++++++ lib/ofp-print.c | 4 ++-- lib/ofp-print.h | 1 - lib/ofp-util.c | 2 +- ofproto/ofproto.c | 2 +- utilities/ovs-ofctl.c | 2 +- 8 files changed, 25 insertions(+), 23 deletions(-)
diff --git a/include/openflow/nicira-ext.h b/include/openflow/nicira-ext.h index ebe05d4..341c5ac 100644 --- a/include/openflow/nicira-ext.h +++ b/include/openflow/nicira-ext.h @@ -101,7 +101,7 @@ enum nicira_type { NXT_FLOW_MOD = 13, /* Analogous to OFPT_FLOW_MOD. */ NXT_FLOW_REMOVED = 14, /* Analogous to OFPT_FLOW_REMOVED. */ - /* Use the upper 8 bits of the 'command' member in struct ofp_flow_mod to + /* Use the upper 8 bits of the 'command' member in struct ofp10_flow_mod to * designate the table to which a flow is to be added? See the big comment * on struct nx_flow_mod_table_id for more information. */ NXT_FLOW_MOD_TABLE_ID = 15, @@ -167,7 +167,7 @@ enum nx_hash_fields { * instead of having the switch decide which table is most appropriate as * required by OpenFlow 1.0. By default, the extension is disabled. * - * When this feature is enabled, Open vSwitch treats struct ofp_flow_mod's + * When this feature is enabled, Open vSwitch treats struct ofp10_flow_mod's * 16-bit 'command' member as two separate fields. The upper 8 bits are used * as the table ID, the lower 8 bits specify the command as usual. A table ID * of 0xff is treated like a wildcarded table ID. diff --git a/include/openflow/openflow-1.0.h b/include/openflow/openflow-1.0.h index d56147e..7f29ffa 100644 --- a/include/openflow/openflow-1.0.h +++ b/include/openflow/openflow-1.0.h @@ -307,14 +307,6 @@ struct ofp_packet_out { }; OFP_ASSERT(sizeof(struct ofp_packet_out) == 16); -enum ofp_flow_mod_command { - OFPFC_ADD, /* New flow. */ - OFPFC_MODIFY, /* Modify all matching flows. */ - OFPFC_MODIFY_STRICT, /* Modify entry strictly matching wildcards */ - OFPFC_DELETE, /* Delete all matching flows. */ - OFPFC_DELETE_STRICT /* Strictly match wildcards and priority. */ -}; - /* Flow wildcards. */ enum ofp_flow_wildcards { OFPFW10_IN_PORT = 1 << 0, /* Switch input port. */ @@ -399,15 +391,12 @@ OFP_ASSERT(sizeof(struct ofp10_match) == 40); /* By default, choose a priority in the middle. */ #define OFP_DEFAULT_PRIORITY 0x8000 -enum ofp_flow_mod_flags { - OFPFF_SEND_FLOW_REM = 1 << 0, /* Send flow removed message when flow - * expires or is deleted. */ - OFPFF_CHECK_OVERLAP = 1 << 1, /* Check for overlapping entries first. */ - OFPFF_EMERG = 1 << 2 /* Ramark this is for emergency. */ +enum ofp10_flow_mod_flags { + OFPFF10_EMERG = 1 << 2 /* Ramark this is for emergency. */ }; /* Flow setup and teardown (controller -> datapath). */ -struct ofp_flow_mod { +struct ofp10_flow_mod { struct ofp_header header; struct ofp10_match match; /* Fields to match */ ovs_be64 cookie; /* Opaque controller-issued identifier. */ @@ -428,7 +417,7 @@ struct ofp_flow_mod { from the length field in the header. */ }; -OFP_ASSERT(sizeof(struct ofp_flow_mod) == 72); +OFP_ASSERT(sizeof(struct ofp10_flow_mod) == 72); /* Flow removed (datapath -> controller). */ struct ofp_flow_removed { diff --git a/include/openflow/openflow-common.h b/include/openflow/openflow-common.h index 55d0737..1a73cd6 100644 --- a/include/openflow/openflow-common.h +++ b/include/openflow/openflow-common.h @@ -222,6 +222,20 @@ enum ofp_packet_in_reason { OFPR_N_REASONS }; +enum ofp_flow_mod_command { + OFPFC_ADD, /* New flow. */ + OFPFC_MODIFY, /* Modify all matching flows. */ + OFPFC_MODIFY_STRICT, /* Modify entry strictly matching wildcards */ + OFPFC_DELETE, /* Delete all matching flows. */ + OFPFC_DELETE_STRICT /* Strictly match wildcards and priority. */ +}; + +enum ofp_flow_mod_flags { + OFPFF_SEND_FLOW_REM = 1 << 0, /* Send flow removed message when flow + * expires or is deleted. */ + OFPFF_CHECK_OVERLAP = 1 << 1, /* Check for overlapping entries first. */ +}; + /* Action structure for OFPAT10_SET_VLAN_VID and OFPAT11_SET_VLAN_VID. */ struct ofp_action_vlan_vid { ovs_be16 type; /* Type. */ diff --git a/lib/ofp-print.c b/lib/ofp-print.c index 3fa93b2..a041a4f 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -762,11 +762,11 @@ ofp_print_flow_mod(struct ds *s, const struct ofp_header *oh, if (flags & OFPFF_CHECK_OVERLAP) { ds_put_cstr(s, "check_overlap "); } - if (flags & OFPFF_EMERG) { + if (flags & OFPFF10_EMERG) { ds_put_cstr(s, "emerg "); } - flags &= ~(OFPFF_SEND_FLOW_REM | OFPFF_CHECK_OVERLAP | OFPFF_EMERG); + flags &= ~(OFPFF_SEND_FLOW_REM | OFPFF_CHECK_OVERLAP | OFPFF10_EMERG); if (flags) { ds_put_format(s, "flags:0x%"PRIx16" ", flags); } diff --git a/lib/ofp-print.h b/lib/ofp-print.h index 49bcfcd..9039668 100644 --- a/lib/ofp-print.h +++ b/lib/ofp-print.h @@ -22,7 +22,6 @@ #include <stdint.h> #include <stdio.h> -struct ofp_flow_mod; struct ofp10_match; struct ds; diff --git a/lib/ofp-util.c b/lib/ofp-util.c index b8dca6d..f8ad6e4 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -1595,7 +1595,7 @@ struct ofpbuf * ofputil_encode_flow_mod(const struct ofputil_flow_mod *fm, enum ofputil_protocol protocol) { - struct ofp_flow_mod *ofm; + struct ofp10_flow_mod *ofm; struct nx_flow_mod *nfm; struct ofpbuf *msg; uint16_t command; diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 741a78b..0d1617c 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -3135,9 +3135,9 @@ handle_flow_mod(struct ofconn *ofconn, const struct ofp_header *oh) goto exit_free_ofpacts; } + if (fm.flags & OFPFF10_EMERG) { /* We do not support the OpenFlow 1.0 emergency flow cache, which is not * required in OpenFlow 1.0.1 and removed from OpenFlow 1.1. */ - if (fm.flags & OFPFF_EMERG) { /* We do not support the emergency flow cache. It will hopefully get * dropped from OpenFlow in the near future. There is no good error * code, so just state that the flow table is full. */ diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index 96901d1..5e041d1 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -1606,7 +1606,7 @@ read_flows_from_file(const char *filename, struct classifier *cls, int index) version->cookie = fm.new_cookie; version->idle_timeout = fm.idle_timeout; version->hard_timeout = fm.hard_timeout; - version->flags = fm.flags & (OFPFF_SEND_FLOW_REM | OFPFF_EMERG); + version->flags = fm.flags & (OFPFF_SEND_FLOW_REM | OFPFF10_EMERG); version->ofpacts = fm.ofpacts; version->ofpacts_len = fm.ofpacts_len; -- 1.7.2.5 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev