of1.2: fix bugs

- typo in OFPQueueGetConfigRequest
- OFPFlowRemoved offset
- OFPActionDecMplsTtl and OFPActionDecNwTtl parsers

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of1.2: add unittest workaround to OFPPortStatus parser

Add unittest workaround to OFPPortStatus parser. Another Option is
defining something like OFP_PORT_STATUS_PACK_STR0, 'B'. I don't care
much. Let's just do as we do with OF1.0.

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

Bump the major version because:

- Ryu fully support OpenFlow 1.0, Nicira Extensions, and OpenFlow 1.2.
- Ryu was tested with various OpenFlow Hardware switches.
- There is lots of improvement since the last release.

Ryu is usable now so let's use the major version that implies so.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of1.2: implement FlowStats instruction parser

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of1.2: add missing struct ofp_bucket definition

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
test: add more of1.2 unittests

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of1.2: make pack_str class variable

So the parser classmethod can use it too.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of1.2: add common field_parser for MT* classes

Most of MT* classes can use this helper classmethod.

We get value and mask values but don't set them to an instance. It's
done later.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of1.2: remove unused parser method in MT* classes

Some MT* classes need the own parser though.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of1.2: set value and mask in MT* instance

Set value and mask that the parser gets.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of1.2: make MT* class make method take value and mask

- MT* class serialize method doesn't need match argument so we can use
  MT* class for set_field action nicely.

- we can create the common serialize method for most of MT* classes

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of1.2: add the common serialize method for MT* classes

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of1.2: remove match argument in MT* class serialize method

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

Parse and serialize OXM TLV.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of1.2: fix OFAActionCopyTtlOut and OFPActionCopyTtlIn's parsers

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of1.2: fix OFPBucket parser and serialize methods

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of1.2: Correct pad calculation for OFPMatch

In the case where the match length is a multiple of 8 the pad should be 0.
Previously a pad of 8 was used.

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

Fix some alignment bugs.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of1.2: change IPv6 address representation

8H is more fitter than 4I for IPV6 address string representation.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
app/rest: fix value error exception

This patch fixes value error exception.
The datapath-id is given in hex.

> Traceback (most recent call last):
>   File "/usr/lib/python2.7/dist-packages/gevent/pywsgi.py", line 438,
>   in handle_one_response
>     self.run_application()
>   File "/usr/lib/python2.7/dist-packages/gevent/pywsgi.py", line 424,
>   in run_application
>     self.result = self.application(self.environ, self.start_response)
>   File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line
>   130, in __call__
>     resp = self.call_func(req, *args, **self.kwargs)
>   File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line
>   195, in call_func
>     return self.func(req, *args, **kwargs)
>   File "/opt/stack/ryu/ryu/app/wsgi.py", line 81, in __call__
>     return controller(req)
>   File "/opt/stack/ryu/ryu/app/wsgi.py", line 52, in __call__
>     return getattr(self, action)(req, **kwargs)
>   File "/opt/stack/ryu/ryu/app/rest.py", line 104, in create
>     self.nw.create_port(network_id, int(dpid), int(port_id))
> ValueError: invalid literal for int() with base 10: '0000666a9c296241'

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>