learning-switch: Send Features Request and Set Config with correct version

Signed-off-by: Simon Horman <horms@verge.net.au>

---

v8
* No change

v7
* No change

v6
* Initial post
ofp-util: Allow encoding of Open Flow 1.2 Flow Mod messages

Signed-off-by: Simon Horman <horms@verge.net.au>

---

v8
* Manual Rebase
* Do not use memset from ofputil_encode_flow_mod it is (now) unnecessary

v7
* Manual Rebase

v6
* No change

v5
* No change

v4
* Manual rebase
* Use OFPT11_FLOW_MOD as type of message.
  Previously OFPT10_FLOW_MOD was incorrectly used.

v3
* Open Flow 1.2 uses an 8bit command, previously 16 bits was used incorrectly
* Use Open Flow 1.2 action encoding, previously Open Flow 1.0 encoding
  was used incorrectly
* ofp11_match_header is added by ofputil_put_match(),
  previously it was incorectly added in ofputil_encode_flow_mod() as well.

v2
* Use ofputil_put_match()

Conflicts:
	lib/ofp-util.c
ofp-util: Allow decoding of Open Flow 1.2 Flow Mod messages

Signed-off-by: Simon Horman <horms@verge.net.au>

---

v8
* Manual rebase
* Add ofp-print test

v7
* Manual rebase

v6
* No change

v5
* Manual rebase

v4
* No change

v3
* No change

v2
* No change

Conflicts:
	lib/ofp-util.c

flow mod test
ofp-util: Allow encoding of Open Flow 1.2 Packet In Messages

Signed-off-by: Simon Horman <horms@verge.net.au>

---

v8
* Manual Rebase

v7
* Manual Rebase
* Use struct ofp12_packet_in instead of struct ofp11_packet_in

v6
* No change

v5
* No change

v4
* No change

v3
* Add protocol parameter to ofputil_encode_packet_in().
  This allows packet_in_format to be ignored for Open Flow 1.2.

v2
* Update for new ofputil_put_match() implementation

Conflicts:
	lib/ofp-util.c
ofp-util: Allow decoding of Open Flow 1.2 Packet In Messages

Signed-off-by: Simon Horman <horms@verge.net.au>

---

v8
* Manual rebase
* Add ofp-print test

v7
* Manual rebase
* Use struct ofp12_packet_in instead of struct ofp11_packet_in

v6
* No change

v5
* Manual rebase

v4
* No change

v3
* Add OF1.2 entry to to ofputil_msg_types
* Make OF1.2 the first option in the if statement in ofputil_decode_packet_in()
* Rename o11pi as opi, which is consistent with the style used elsewhere
* Rebase

v2
* No change

Conflicts:
	lib/ofp-util.c
ofp-msgs: Update OFPRAW_OFPT_SET_CONFIG for OpenFlow 1.2

This is sufficient to allow encoding and decoding of
OpenFlow 1.2 Set Config messages as the format is the same
as OpenFlow 1.0 and OpenFlow 1.2.

Signed-off-by: Simon Horman <horms@verge.net.au>

---

v8
* No change

v7
* Initial Post
ofp-actions: Return action size

Modify ofpacts_put_openflow11_actions() to return the length of actions
appended. This will be used when encoding Packet Out messages for
Open Flow 1.1 and 1.2. The motivation for this is to avoid open coding
the size calculation which may end up being needed elsewhere too.

Signed-off-by: Simon Horman <horms@verge.net.au>

---

v8
* Initial post
ofp-util: Prepare Packet Out encoder for other Open Flow versions

Signed-off-by: Simon Horman <horms@verge.net.au>

---

v8
* Make use of enum ofp_version

v7
* Manual Rebase

v6
* No change

v5
* No change

v4
* Manual rebase

v3
* Add protocol variable to do_probe().
  Previously this was added by a separate patch.

v2
* No change

Conflicts:
	lib/ofp-util.c
ofp-util: Allow encoding of Open Flow 1.1 and 1.2 Packet Out Messages

Signed-off-by: Simon Horman <horms@verge.net.au>

---

v8
* Manual Rebase
* ofpacts_put_openflow11_actions() now returns the length of encoded
  actions, make use of this.

v7
* Manual Rebase

v6
* No change

v5
* No change

v4
* Manual rebase

v3
* Correct title: this patch relates to Packet Out not Packet In
* Correct decoding of buffer_id, it is 32bits wide not 16bits wide
* Add decoding of stats reply messages

v2
* No change

ofp-actions: Return action size

Modify ofpacts_put_openflow11_actions() to return the length of actions
appended. This will be used when encoding Packet Out messages for
Open Flow 1.1 and 1.2. The motivation for this is to avoid open coding
the size calculation which may end up being needed elsewhere too.

Signed-off-by: Simon Horman <horms@verge.net.au>
ofp-util: Prepare Packet Out decoder for other Open Flow versions

Signed-off-by: Simon Horman <horms@verge.net.au>

---

v8
* No change

v7
* Manual Rebase
* Only use OFPERR_NXBRC_BAD_IN_PORT in the case of OFPRAW_OFPT10_PACKET_OUT

v6
* No change

v5
* No change

v4
* No change

v3
* Differentiate versions using oh->version rather than relying
  on a separate code for each version of the Packet Out message.

v2
* No change

Conflicts:
	lib/ofp-util.c
ofp-util: Allow decoding of Open Flow 1.1 and 1.2 Packet Out Messages

Signed-off-by: Simon Horman <horms@verge.net.au>

---

v8
* Return error value returned by ofputil_port_from_ofp11()
  rather than OFPERR_OFPBMC_BAD_VALUE.
  - This fix, from v3, disappeared somewhere along the way
* Add ofp-print test for Open Flow 1.2
  - I'm not sure how to generate an Open Flow 1.1 message at this point

v7
* Manual rebase

v6
* No change

v5
* No change

v4
* No change

v3
* Manual rebase
* Correct title: This patch relates to Packet Out not Packet In
* Use OFPT_PACKET_OUT instead of OFPT11_PACKET_OUT, it seems
  easier to use a single code and differentiate using the version
  in the ofp_header
* Return error value returned by ofputil_port_from_ofp11()
  rather than OFPERR_OFPBMC_BAD_VALUE.

v2
* No change

Conflicts:
	lib/ofp-util.c

packet out test
ofp-util: Allow encoding of Open Flow 1.2 Flow Removed messages

Signed-off-by: Simon Horman <horms@verge.net.au>

---

v8
* Manual Rebase

v7
* Omitted

v6
* No change

v5
* No change

v4
* Manual rebase

v3
* No change

v2
* Use ofputil_put_match()

Conflicts:
	lib/ofp-util.c
ofp-util: Allow encoding Open Flow 1.2 Flow Stats Request Messages

Signed-off-by: Simon Horman <horms@verge.net.au>

---

v8
* Manual rebase

v7
* Omitted

v6
* No change

v5
* No change

v4
* Manual rebase

v3
* No change

v2
* Use ofputil_put_match()

Fix ofputil_encode_flow_stats_request
ofp-util: Allow use of OF12 flow format

This enables the use of the OF12 format, the prerequisites of which were
added by "Add OFPUTIL_P_OF12 and NXFF_OPENFLOW12" and patches to fill out
other functions that use OFPUTIL_P_OF12 directly.

Signed-off-by: Simon Horman <horms@verge.net.au>

---

v8
* Initial post
ofp-util: Allow encoding of Open Flow 1.2 Port Mod Messages

Signed-off-by: Simon Horman <horms@verge.net.au>

---

v8
* Manual Rebase

v7
* Omitted

v6
* No change

v5
* No change

v4
* Manual rebase

v3
* No change

v2
* No change
ofp-util: Allow decoding of Open Flow 1.2 Port Mod Message

Signed-off-by: Simon Horman <horms@verge.net.au>

---

v8
* Initial post
ofp-msgs: Split OFPRAW_OFPST_FLOW_{REQUEST,REPLY}

Split OFPRAW_OFPST_FLOW_{REQUEST,REPLY} into OpenFlow 1.0 and 1.1+
versions.

This is in preparation for adding encoding and decoding of
Open Flow 1.1 & 1.2 messages.

Signed-off-by: Simon Horman <horms@verge.net.au>

---

v8
* Initial post
ofp-util: Prepare Flow Statistics Request Decoder for other Open Flow versions

Signed-off-by: Simon Horman <horms@verge.net.au>

---

v8
* Initial post
ofp-util: Allow decoding of Open Flow 1.2 Flow Statistics Request Messages

Allow decoding of Open Flow 1.1 and 1.2 flow and aggregate flow statistics
request messages.

Signed-off-by: Simon Horman <horms@verge.net.au>

---

v8
* Manual rebase
* Add ofp-print test

v7
* Omitted

v6
* No change

v5
* Manual rebase

v4
* Use OFPG11_ANY in place of OFPG_ANY.
  The value is the same, but it seems to make sense to
  use the Open Flow 1.1 constant when working with Open Flow 1.1.
* Do not handle Open Flow 1.1, the parsing is slightly different
  and not supplied by this patch.
* Use sizeof(struct ofp11_flow_stats_request) as the minimum size of the
  message, previously sizeof(struct ofp10_flow_stats_request) was
  incorrectly used.
* Indicate that the message may be larger than the minimum size.
* Handle OFPUTIL_OFPST11_FLOW_REQUEST and OFPUTIL_OFPST11_AGGREGATE_REQUEST in
  ofputil_decode_flow_stats_request().
* Add entry for Open Flow 1.2 aggregate request to ofputil_msg_types[]

v3
* Initial post

Fix parsing of FlowMod instructions

Conflicts:
	lib/ofp-util.c

Signed-off-by: Simon Horman <horms@verge.net.au>
ofp-util: Allow encoding of Open Flow 1.2 Flow Statistics Response Messages

Signed-off-by: Simon Horman <horms@verge.net.au>

---

v8
* Manual Rebase

v7
* Omitted

v6
* No change

v5
* No change

v4
* Do not manually add header pad, it is handled by
  ofputil_postappend_stats_reply()

v3
* Initial post

fix