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>
lib/ovs: add constants for ovsdb Open_vSwitch db

Those constants are used to manipulate Open_vSwitch db of ovsdb.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
lib/ovs/vsctl: python reimplementation of ovs-vsctl

This implements subset of ovs-vsctl which is used later.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
lib/ovs/bridge: helper class to manipulate ovs bridge

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
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>
app/rest: add requirements to path component

This patch adds requirements to path component so that URL is verified.
And simplify with submapper.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
app/rest_nw_id: add port type for reserved port and vport-gre

This patch adds new port type for reserved port and vport-gre.
They will be used later. Via this REST API, ryu knows which port is used
for gre or reserved port.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ryu/app/client: factor out rest client code

REST API will be enhanced. So factor out reset client code such that
it affords extension.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
app/client: add helper function to ignore NOT_FOUND, 404

Sometimes client code just wants to ignore 404 when deleting resources.
So provide helper function for it.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
bin/ryu-manager: import ryu.flags for common options

Otherwise those options can't be specified.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
remove old dispatcher and friends

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

This needs to be reimplemented so that each componet is enable to
debug its own events.

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

This patch only implements netflowV5 parser.

Signed-off-by: OHMURA Kei <ohmura.kei@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
packet lib: add LLDP support.

See "ryu/tests/unit/packet/test_lldp.py" to use this library.

This patch is based on Yamahata's topology discovery patch series.
http://thread.gmane.org/gmane.network.ryu.devel/467

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

Signed-off-by: "Henkel, Michael" <michael.henkel@hp.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>