Advanced WSGI API

HTTP routing and implements will be in the same place. This idea was
inspired from Flask and Bottle of Python and JAX-RS of Java. This
modification keeps backward compatibility.

Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
tests/integrated: fix mac address format

This fix following error.

$ ./run_tests.sh -i
(...)
ryu-manager: hub: uncaught exception: Traceback (most recent call last):
ryu-manager: File "/home/hideki/git/ryu/ryu/lib/hub.py", line 48, in _launch
ryu-manager: func(*args, **kwargs)
ryu-manager: File "/home/hideki/git/ryu/ryu/base/app_manager.py", line 110, in _event_loop
ryu-manager: handler(ev)
ryu-manager: File "/home/hideki/git/ryu/ryu/tests/integrated/test_request_reply_v12.py", line 996, in echo_replay_handler
ryu-manager: self.run_verify(ev)
ryu-manager: File "/home/hideki/git/ryu/ryu/tests/integrated/test_request_reply_v12.py", line 78, in run_verify
ryu-manager: self.start_next_test(dp)
ryu-manager: File "/home/hideki/git/ryu/ryu/tests/integrated/test_request_reply_v12.py", line 56, in start_next_test
ryu-manager: getattr(self, t)(dp)
ryu-manager: File "/home/hideki/git/ryu/ryu/tests/integrated/test_request_reply_v12.py", line 203, in test_error_reply
ryu-manager: dp.send_msg(m)
ryu-manager: File "/home/hideki/git/ryu/ryu/controller/controller.py", line 220, in send_msg
ryu-manager: msg.serialize()
ryu-manager: File "/home/hideki/git/ryu/ryu/ofproto/ofproto_parser.py", line 194, in serialize
ryu-manager: self._serialize_body()
ryu-manager: File "/home/hideki/git/ryu/ryu/ofproto/ofproto_v1_2_parser.py", line 1754, in _serialize_body
ryu-manager: self.port_no, addrconv.mac.text_to_bin(self.hw_addr),
ryu-manager: File "/home/hideki/git/ryu/ryu/lib/addrconv.py", line 27, in text_to_bin
ryu-manager: return self._addr(text, **self._addr_kwargs).packed
ryu-manager: File "/home/hideki/git/ryu/.venv/local/lib/python2.7/site-packages/netaddr/eui/__init__.py", line 376, in __init__
ryu-manager: self.value = addr
ryu-manager: File "/home/hideki/git/ryu/.venv/local/lib/python2.7/site-packages/netaddr/eui/__init__.py", line 434, in _set_value
ryu-manager: % (value, self._module.version))
ryu-manager: AddrFormatError: address '\xff\xff\xff\xff\xff\xff' is not an EUIv48

Signed-off-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
packet lib: icmp: rewrite unittest

formerly this module tested only to_string(), so a bug in parser() of 'TimeExceeded' was overlooked.
this patch will bring the module to test all the methods of all the classes in 'icmp' module.

Signed-off-by: itoyuichi <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ofproto: fix OF1.0 packet_in parser

OF1.0 spec says OFP_ASSERT(sizeof(struct ofp_packet_in) == 20).
It's quite bogus as it assumes a specific class of C implementations.
(well, if it was C.  it's unclear from the spec itself.)
We just use the real size of the structure as this is not C.  This
agrees with on-wire messages OpenFlow Reference Release and Open vSwitch
produce.

This should fix a crash Chen Chen reported on ryu-devel recently.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ofproto: remove unused definitions

g/c unused OF1.2/1.3 OFP_PACKET_IN_DATA_OFFSET definitions.
they seem to be copy-and-paste leftover from OF1.0.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ofproto: remove a bogus comment

seems like a copy-and-paste leftover from OF1.0.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
topology.switches: fix link discovery

fix a regression introduced by text address changes.

problem reported by Tonh o - Antonio Brasolin
patch tested and fixed by YAMADA Hideki

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of1.2: set default arguments for FlowStatsRequest

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of1.3: set default arguments for FlowStatsRequest

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
packet lib: add get_protocol API

get_protocols returns the list of protocols. This is useful for a
packet including the same protocol multiple times (e.g. tunneling such
GRE). However, it's a rare use case. Instead of
'get_protocols(hoge)[0]', let's do 'get_protocol(hoge)' simply.

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