app_manager: Fix a crash in unregister_handler

This fixes a regression introduced by commit d3f8f4eb.
("RyuApp: delete a key without handlers when unregistering a handler")

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
packet lib: add Connectivity Fault Management Protocol(CFM, IEEE 802.1ag)

Signed-off-by: TAKAHASHI Minoru <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
rest_qos: Enable queue setting to interface individually

Added an option command to enable the queue setting to interface
individually.  Also, some minor fixes.

Signed-off-by: Kiyonari Harigae <lakshmi@cloudysunny14.org>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
sw test tool: Improve readability of tcp options

    option='\\x00\\x00\\x00\\x00'
->  option=str('\\x00' * 4)

    option='\\x11\\x11\\x11\\x11'
->  option=str('\\x11' * 4)

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
sw test tool: Improve readability of padding data

    str(\"\\x00\" * (60 - 42))
->  str('\\x00' * (60 - 42))

    str(\"\\x11\" * (1500 - 54))
->  str('\\x11' * (1500 - 54))

    '\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'
->  str('\\x00' * 30)

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
sw test tool: Improve readability of MAC mask values

    1099511627775
->  "00:ff:ff:ff:ff:ff"

    281474976710400
->  "ff:ff:ff:ff:ff:00"

    281474959998975
->  "ff:ff:ff:00:ff:ff"

    281470698520575
->  "ff:ff:00:ff:ff:ff"

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
sw test tool: Improve readability of IP mask values

    4294967040
->  "255.255.255.0"

    4294902015
->  "255.255.0.255"

    340282366920938463463374607431768145920
->  "ffff:ffff:ffff:ffff:ffff:ffff:ffff:0"

    5192296858534827628530496329220095
->  "0:ffff:ffff:ffff:ffff:ffff:ffff:ffff"

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
fix: wrong copyright

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
fix failure of instantiating app

For example, app-A has app-X in CONTEXTS, and app-B depends on app-X as
SERVICE.  When app-B is specified in the app-lists before app-A, the
instantiating app-X fails by an assertion.

$ PYTHONPATH=. bin/ryu-manager ryu.app.quantum_adapter ryu.app.gre_tunnel
loading app ryu.app.quantum_adapter
loading app ryu.app.gre_tunnel
loading app ryu.controller.dpset
loading app ryu.controller.ofp_handler
loading app ryu.controller.ofp_handler
loading app ryu.controller.ofp_handler
instantiating app None of QuantumIfaces
creating context quantum_ifaces
instantiating app None of ConfSwitchSet
creating context conf_switch
instantiating app None of Network
creating context network
instantiating app None of Tunnels
creating context tunnels
instantiating app None of DPSet
creating context dpset
instantiating app ryu.app.gre_tunnel of GRETunnel
instantiating app ryu.controller.dpset of DPSet
Traceback (most recent call last):
  File "/opt/stack/ryu/bin/ryu-manager", line 19, in <module>
    main()
  File "/opt/stack/ryu/ryu/cmd/manager.py", line 77, in main
    services.extend(app_mgr.instantiate_apps(**contexts))
  File "/opt/stack/ryu/ryu/base/app_manager.py", line 434, in instantiate_apps
    self._instantiate(app_name, cls, *args, **kwargs)
  File "/opt/stack/ryu/ryu/base/app_manager.py", line 421, in _instantiate
    register_app(app)
  File "/opt/stack/ryu/ryu/base/app_manager.py", line 50, in register_app
    assert app.name not in SERVICE_BRICKS
AssertionError

This patch avoid the double loading of app in context and service.

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
app_manager: Let client app to use require_app() directly

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