nxm: add NXM_NX_IP_FRAG

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Simon Horman <horms@verge.net.au>
fix test_lib.py for SkipTest

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
nxm: add NXM_NX_REG

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of1.3: initial OF1.3 support

Signed-off-by: OHMURA Kei <ohmura.kei@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Remove duplicated OFPMatch definition

Also fix some pep8 warnings.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Add OFPBarrierRequest and OFPBarrierReply

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of1.2: fix OFPFlowMod and OFPFlowRemoved

- fix OFPFlowMod and OFPFlowRemoved
- fix some actions

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of1.2: remove FWW_* constants

FWW_* constants are in not of1.2 spec so it's not a good idea to use
in of1.2 code.

Also using random bits for match field types isn't a good idea
either. Let's use OFPXMT_OFB_ constants.

Currently, we use various ways to see if match field types are enable
or not. Let's do in an uniform way.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Simon Horman <horms@verge.net.au>
of1.2: add OXM_OF_IP_DSCP

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Simon Horman <horms@verge.net.au>
of1.2: add OXM_OF_IP_ECN

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Simon Horman <horms@verge.net.au>
of1.2: add OXM_OF_IP_PROTO

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Simon Horman <horms@verge.net.au>
of1.2: add OXM_OF_IP_SRC and OXM_OF_IP_DST

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Simon Horman <horms@verge.net.au>
of1.2: add OXM_OF_TCP_SRC and OXM_OF_TCP_DST

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Simon Horman <horms@verge.net.au>
of1.2: add OXM_OF_UDP_SRC and OXM_OF_UDP_DST

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Simon Horman <horms@verge.net.au>
of1.2: add OXM_OF_SCTP_SRC and OXM_OF_SCTP_DST

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Simon Horman <horms@verge.net.au>
of1.2: add OXM_OF_ICMPV4_TYPE and OXM_OF_ICMPV4_CODE

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Simon Horman <horms@verge.net.au>
of1.2: support ofp_instruction for OFPFlowMod

Now OFPFlowMod should be able to modify flow tables.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Simon Horman <horms@verge.net.au>
of1.2: Correct arguments to OFPMatch.parser() in OFPPacketIn

This corrects what appear to be two errors in the arguments
passed to OFPMatch.parser() by OFPPacketIn.parser().

* The buffer is msg.buf, buf doesn't exist in this context
* ofproto_v1_2.OFP_PACKET_IN_SIZE includes ofproto_v1_2.OFP_HEADER_SIZE
  so it should not be added to the offset passed to OFPMatch.parser().

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
add round_up utility function

OF protocols need this in many places.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Simon Horman <horms@verge.net.au>
don't call send_delete_all_flows function in the core

calling send_delete_all_flows function in the core (for all
applications) is a bad idea since some applications don't want such
(e.g. failover).

send_delete_all_flows function doesn't work for OF1.2. nxm
code needs the specific code for each OF version. I really don't want
to do so.

So let's not call this function in the core. At this point, it's
impossible to write applications that can work with any OF versions
(incluing nxm). Let applications do whatever they want.

We should remove OF protocol version dependent functions
(send_delete_all_flows, send_flow_mod, and send_flow_del). Also trying
to enable NXM blindly is very bad for buggy hardware switches. But
they are not called in the core code so I leave them alone for now.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>