packet lib: add ICMP sub encoder/decoder class

Add ICMP sub encoder/decoder class for Destination Unreachable Message.
and, add parser to Time Exceeded Message class.

Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka@nttcom.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
packet lib: stop tlv parsing when finding LLDP_TLV_END

There may be padding at the end of payload.
So the assumption that there is no payload after LLDP_TLV_END
is not correct.

Reported-by: Q Lady <holynn.q@gmail.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
topology/switches: packet in handler

The logic of counting sent packet seems wrong.

Reported-by: Q Lady <holynn.q@gmail.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
topology/switches: exception during serialization

Datapath.send_packet_out() requires buffer_id, not dpid.

> Traceback (most recent call last):
>   File "/usr/lib/pymodules/python2.7/gevent/greenlet.py", line 390, in run
>     result = self._run(*self.args, **self.kwargs)
>   File "ryu/base/app_manager.py", line 126, in _event_loop
>     handler(ev)
>   File "/ryu/topology/switches.py", line 697, in packet_in_handler
>     self._drop_packet(msg)
>   File "/ryu/topology/switches.py", line 640, in _drop_packet
>     dp.send_packet_out(dp.id, msg.in_port, [])
>   File "/ryu/controller/controller.py", line 242, in send_packet_out
>     self.send_msg(packet_out)
>   File "/ryu/controller/controller.py", line 216, in send_msg
>     msg.serialize()
>   File "/ryu/ofproto/ofproto_parser.py", line 119, in serialize
>     self._serialize_body()
>   File "/ryu/ofproto/ofproto_v1_0_parser.py", line 1987, in _serialize_body
>     self.buffer_id, self.in_port, self.actions_len)
>   File "/ryu/ofproto/ofproto_parser.py", line 128, in msg_pack_into
>     buf += struct.pack(fmt, *args)
> error: 'I' format requires 0 <= number <= 4294967295
> <Greenlet at 0x229bd98: <bound method Switches._event_loop of <switches.Switches object at 0x1c8e690>>> failed with error

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of1.3: fix OFPMeterStats

len -> length
as the latter seems to be expected by OFPMultipartReply.parser_stats_body.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of1.3: fix OFP_GROUP_DESC_STATS_PACK_STR

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of1.2: OFPGroupFeaturesStats: tuple -> list

tuples are json-unfriendly.

(of1.3 version was completely broken until very recently
and the way i fixed it is consistent with this change.)

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of1.3: fix OFPSetConfig default arguments

The equivalent fix for of1.2 is the commit 3d90147.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
rename ryu-client under ryu/tests

Since it is debugging tool for developer, don't install it.
and move it under ryu/rests directory.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Ryu 2.1

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

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
msgpack-rpc fixes and improvements

- make create_request returns msgid
- fix msgid wrap around
- rename classes
- convenient transport classes for socket-like
- update requirements
- copyright notice, comments, and assertions
remove msgpack-python from pip-requires for now

msgpack-python makes quantum stop working.
https://bugs.launchpad.net/quantum/+bug/1178512
https://review.openstack.org/#/c/28504/
https://review.openstack.org/#/c/29182/
import msgpack into ryu/contrib

0.3.0 (commit df6449f17366b9d608895766cc1a151167460ae0)

only pure python code for now because:
- we don't want to worry about cython setup.py stuff
- cython version has a known bug
  cf. https://github.com/msgpack/msgpack-python/pull/64

why do we want to have this private copy?
- in order to avoid the above mentioned pyx incompatibility
- quantum stops working if msgpack-python is available
	https://bugs.launchpad.net/quantum/+bug/1178512
	https://review.openstack.org/#/c/28504/
	https://review.openstack.org/#/c/29182/
add a method to import a system (non ryu/contrib) module

will be used for rpc library.
rpc: use system msgpack library if available

the system version of the msgpack library might be a performance-wise
better choice than ryu/contrib one because of cython.
on the other hand, the cython version of the code has known bugs.
use the system msgpack library only if it seems to work without the bug.
msgpack-rpc: unit tests
rpc: add a test for https://github.com/yamt/ryu/pull/1
rpc: If the socket is closed by peer, endpoint stop the serve.

If client does socket.close() the serve will be non-wait looping.
So must stop the serve of endpoint that received 0 byte packet.
rpc: prefix closed_by_peer with _ as it's private