controller/handler: allow set_ev_cls not to specify dispatchers

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
controller/network: add event supports

Base on the following patch:

From: Isaku Yamahata <yamahata@valinux.co.jp>
Subject: controller/network: factor out network.py and add event generator for gre tunnel and helper methods

- Factor out from network.py the logic to track network and dpid
- introduce class Port to allow other info
  Later we'll track mac address associated to port. So allow intermediate
  layer to contain infos related to Port.
- make network track mac address associated to port
- generate events

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
dpset: add port event support

Based on the following patch:

From: Isaku Yamahata <yamahata@valinux.co.jp>
Subject: dpset: add port{add, delete, modify} event for convenience and helper functions

It is sometimes commonly interesting to track datapath/port
appearance/disappearance. The applications usually want to see that ports
appear after datapath becomes ready, and ports disappear when datapath is dead.
It requires to handle properly events, hand shaking, port_mod event,
switch_feature_reply. So introduce a common layer to handle them.

GRE tunnel is interested in datapath/port appearance/disappearance.
With this, tunnel app doesn't have to handle those conditions.
Discovery is interested only in datapath/port appearance/disappearance.
With this, discovery app would not have to handle OFP events directly.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
controller/tunnel: introduce new class for tunneling

This should be renamed (already used for non tunnel stuff, e.g. VLAN).

Based on the following patch:

From: Isaku Yamahata <yamahata@valinux.co.jp>
Subject: controller/tunnel: introduce new class that tracks infos related to tunneling

- helper functions and event generator for gre tunnel
- plug events for gre tunnel app

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
app/rest_tunnel: REST API for tunnel

With this API, other component such as openstack quantum tells informations
necessary for tunnel.
- tunnel key corresponding to network id
- tunnel port related information
  which tunnel port of a given datapath connected to which remote datapath

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
app/client: add tunnel client

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
controller/switch_conf: introduce a class to manage per-switch configuration

This should be merged into dpset...

Based on the following patch:

From: Isaku Yamahata <yamahata@valinux.co.jp>
Subject: controller/switch_conf: introduce a class to manage per-switch configuration

For tunnel application and generally, it is necessary to associate
configurations to each switches. Such as tunnel port ip address for each
switches.
So introduce a helper class to manage those configurations.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ryu/app: REST API to set per-switch configuration

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

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
bin/ryu-client: support gre tunnel client

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
bin/ryu-client: support switch_conf

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ryu/lib/quantum_ifaces.py: track the relation of quantum iface-id

Based on the following patch:

From: Isaku Yamahata <yamahata@valinux.co.jp>
Date: Tue, 20 Nov 2012 12:21:51 +0900
Subject: ryu/lib/quantum_ifaces.py: track the relation of quantum iface-id

This is needed for quantum plugin in order to track the association
from iface-id to network id or other info.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
rest/quantum: quantum iface REST API

Quantum teach ryu the relation iface-id and network_id

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ryu/app/client: teach quantum iface api

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
bin/ryu-client: teach quantum iface rest api

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
app: Add quantum adapter

Based on the following patch:

From: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Subject: app: Add quantum adapter

Thanks to Kaneko for finding and fixing my bugs.

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ryu/app/simple_vlan: simple VLAN app for OVS

Based on the following patch:

Subject: ryu/app/simple_vlan: simple VLAN spp

This application provides VLAN separation with ovs tag function.
Something similar openstack quantum openvswitch vlan function.

Example to run:
ryu-manager ryu/app/simple_vlan.py \
            ryu/app/quantum_adapter.py \
            ryu/app/rest.py \
            ryu/app/rest_conf_switch.py \
            ryu/app/rest_tunnel.py \
            ryu/app/rest_quantum.py

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