summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2014-06-23 17:17:35 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-06-23 17:23:40 +0900
commit6b9f5580ac47b877392460c66cd975d14869b060 (patch)
treed30d8866ab06739b898273b96b017dff85020ba4
parent5b1f5aea29df7738bcc0c80b6c986e6dfe4dc5c5 (diff)
bgp: add ssh_console option for bgpspeaker module
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/services/protocols/bgp/bgpspeaker.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/ryu/services/protocols/bgp/bgpspeaker.py b/ryu/services/protocols/bgp/bgpspeaker.py
index b0726004..8e33e85e 100644
--- a/ryu/services/protocols/bgp/bgpspeaker.py
+++ b/ryu/services/protocols/bgp/bgpspeaker.py
@@ -17,6 +17,9 @@
"""
from ryu.lib import hub
+from ryu.base import app_manager
+from ryu.services.protocols.bgp.operator import ssh
+
from ryu.services.protocols.bgp.core_manager import CORE_MANAGER
from ryu.services.protocols.bgp.signals.emit import BgpSignalBus
from ryu.services.protocols.bgp.api.base import call
@@ -78,7 +81,8 @@ class BGPSpeaker(object):
bgp_server_port=DEFAULT_BGP_SERVER_PORT,
refresh_stalepath_time=DEFAULT_REFRESH_STALEPATH_TIME,
refresh_max_eor_time=DEFAULT_REFRESH_MAX_EOR_TIME,
- best_path_change_handler=None):
+ best_path_change_handler=None,
+ ssh_console=False):
"""Create a new BGPSpeaker object with as_number and router_id to
listen on bgp_server_port.
@@ -120,6 +124,11 @@ class BGPSpeaker(object):
self._init_signal_listeners()
self._best_path_change_handler = best_path_change_handler
+ if ssh_console:
+ app_mgr = app_manager.AppManager.get_instance()
+ ssh_cli = app_mgr.instantiate(ssh.Cli)
+ ssh_cli.start()
+
def _notify_best_path_changed(self, path):
if not path.source:
# ours