test: Add "Decrement IP TTL" integration test

Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
test: add mininet-test suite

This patch adds a test framework using mininet. The following tests
can be performed.

- Set the flow for the OVS-switch from Ryu-app, we test the actual
  packet is to be handled properly in accordance with the flow; The
  packet that generated by "mz" or replayed by "tcpreplay" is routed
  through the ovs-switch, are processed according to the flow, then
  compare test conditions and the results captured by "tshark".

- Create a packet with ryu using the packet-lib, we test the packet
  and response are correct; to compare test conditions and the results
  captured by "tshark".

  $ ./run_mnet-test.sh [OPTION] [TEST DIR or FILE]...
  $ ./run_mnet-test.sh l2 l3/icmp packet_lib/arp/ARP_gratuitous.mn
  $ ./run_mnet-test.sh --help

Requirements package:
 - mininet: git://github.com/mininet/mininet.git
 - openvswitch: git://openvswitch.org/openvswitch
 - Mausezahn 0.40: http://www.perihel.at/sec/mz/
 - TShark 1.6.2: http://www.wireshark.org/
 - tcpreplay 3.4: http://tcpreplay.synfin.net/

Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Ryu 1.6

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
test: remove some unnecessary bash dependencies

/bin/bash is not so ubiquitous.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
packet lib: pep8 warning fix

run_tests.sh complained.

	ryu/lib/packet/icmp.py:102:15: E271 multiple spaces after keyword
		return  msg
		      ^

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
dpset: fix join race

the datapath object should be added to the list in DPSet before
datapath_join event is fired.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
contrib: fix a comment typo

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
replace dispatcher mechanism

This is purely internal change and no API for applications is
changed. At least, I confirmed that folsom OpenStack plugin works.

With the current dispatcher mechanism, multiple greenlets call
applications' handlers and might be blocked anywhere so we need
various locks to handle that concurrency. This makes things difficult
for application developers.

With this patch, each applications are connected with events. Each
application has the own greenlet(s) to handle events and might send
events to other applications.

If an application registers handlers for some OF events, it subscribes
to OF component and registers the OF events that it's interested. OF
application delivers such OF events to the application and the
application's greenlet executes the handlers.

With this, we can completely remove dispatcher.py and its friends.

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