topology/dumper: use handler.set_ev_cls instead of set_ev_handler

There is no point for dumper.py to use handler.set_ev_cls.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ryu/base/app_manager: pylint unused variables

pylint fix

> W:201,12:AppManager.instantiate_apps: Unused variable 'key'
> W:222,24:AppManager.instantiate_apps: Unused variable 'handler'

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
base/app_manager.py: sort out registering bricks

When registering RyuApps to observers with _EVENTS,
it should applied to @set_ev_cls methods, and dispatchers should be
honored.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ryu/base/app_manager: introduce RyuApp:replay_to_request()

This is a handy method for event request/reply.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ryu/topology/switches: simplify Switches with RyuApp.reply_to_request

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
topology/dumper: define contexts to receive events

Signed-off-by: OHMURA Kei <ohmura.kei@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
nx: make pack string of IPv6 address consistent with OF1.2/1.3

Changed pack string of IPv6 address in NXM from former '!4I' to
'!8H'. Registered IPv6 src/dst field header so we could parse IPv6
addresses now.

Signed-off-by: Can Zhang <can@canx.me>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
nx: match_tuple() function now handles nw src/dst

match_tuple() function now handles nw src/dst correctly. FIX:
match_tuple function now handles the nw src/dst masks correctly. If
the mask is not valid, because there is no NX, it will be ignored.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
setup.py: install xsd files

They are necessary for OF-config support.

Cc: Shivaram Mysore <shivaram.mysore@gmail.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
tests/integrated/test_of_config: disable known host check

This test can fail with unknow hosts as follows.
Since this is a OF-config test/sample, known host check is not essential.
Disable the check to avoid non-essential problem for easy test.

> ryu $ PYTHONPATH=. ./bin/ryu-manager --verbose ryu/tests/integrated/test_of_config.py
> loading app ryu/tests/integrated/test_of_config.py
> loading app ryu.controller.ofp_handler
> instantiating app ryu/tests/integrated/test_of_config.py of OFConfigClient
> <SSHSession(session, initial daemon)> created: client_capabilities=['urn:ietf:params:netconf:capability:writable-running:1.0', 'urn:ietf:params:netconf:capability:rollback-on-error:1.0', 'urn:ietf:params:netconf:capability:validate:1.0', 'urn:ietf:params:netconf:capability:confirmed-commit:1.0', 'urn:ietf:params:netconf:capability:url:1.0?scheme=http,ftp,file,https,sftp', 'urn:ietf:params:netconf:base:1.0', 'urn:liberouter:params:netconf:capability:power-control:1.0', 'urn:ietf:params:netconf:capability:candidate:1.0', 'urn:ietf:params:netconf:capability:xpath:1.0', 'urn:ietf:params:netconf:capability:startup:1.0', 'urn:ietf:params:netconf:capability:interleave:1.0']
> starting thread (client mode): 0x2348650L
> Connected (version 2.0, client Erlang)
> kex algos:['diffie-hellman-group1-sha1'] server key:['ssh-rsa', 'ssh-dss'] client encrypt:['aes128-cbc', '3des-cbc'] server encrypt:['aes128-cbc', '3des-cbc'] client mac:['hmac-sha1'] server mac:['hmac-sha1'] client compress:['none', 'zlib'] server compress:['none', 'zlib'] client lang:[''] server lang:[''] kex follows?False
> Ciphers agreed: local=aes128-cbc, remote=aes128-cbc
> using kex diffie-hellman-group1-sha1; server key type ssh-rsa; cipher: local aes128-cbc, remote aes128-cbc; mac: local hmac-sha1, remote hmac-sha1; compression: local none, remote none
> Switch to new keys ...
> Traceback (most recent call last):
>   File "./bin/ryu-manager", line 87, in <module>
>     main()
>   File "./bin/ryu-manager", line 67, in main
>     app_mgr.instantiate_apps(**contexts)
>   File "/ryu/ryu/base/app_manager.py", line 289, in instantiate_apps
>     self._instantiate(app_name, cls, *args, **kwargs)
>   File "/ryu/ryu/base/app_manager.py", line 275, in _instantiate
>     app = cls(*args, **kwargs)
>   File "/ryu/ryu/tests/integrated/test_of_config.py", line 123, in __init__
>     host=HOST, port=PORT, username=USERNAME, password=PASSWORD)
>   File "/ryu/ryu/lib/of_config/capable_switch.py", line 49, in __init__
>     self.netconf = connect(*self._connect_args, **self._connect_kwargs)
>   File "/ryu/ryu/contrib/ncclient/manager.py", line 67, in connect_ssh
>     session.connect(*args, **kwds)
>   File "/ryu/ryu/contrib/ncclient/transport/ssh.py", line 193, in connect
>     raise SSHUnknownHostError(host, fingerprint)
> ncclient.transport.errors.SSHUnknownHostError: Unknown host key [63:c2:19:95:97:29:84:f6:86:41:1a:15:17:d7:90:0d] for [127.0.0.1]

Cc: Shivaram Mysore <shivaram.mysore@gmail.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
tests/integrated/test_of_config: comment on how to run

Cc: Shivaram Mysore <shivaram.mysore@gmail.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
GUI support
GUI: import scrollbar library
tests/topology: auto topology create/delete script