Discussion:
[Ryu-devel] [PATCH] service/ovsdb: get socket from RemoteOvsdb
Satoshi Fujimoto
2017-06-30 01:58:50 UTC
Permalink
This patch adds "socket" field to RemoteOvsdb
to get sockets which connects to switches.

e.g.)
@set_ev_cls(ovsdb_event.EventNewOVSDBConnection)
def handle_new_ovsdb_connection(self, ev):
print(ev.client.socket.getsockname()[0])

Signed-off-by: Satoshi Fujimoto <***@gmail.com>
---
ryu/services/protocols/ovsdb/client.py | 2 ++
1 file changed, 2 insertions(+)

diff --git a/ryu/services/protocols/ovsdb/client.py b/ryu/services/protocols/ovsdb/client.py
index 7e7d271..7c939f0 100644
--- a/ryu/services/protocols/ovsdb/client.py
+++ b/ryu/services/protocols/ovsdb/client.py
@@ -333,6 +333,7 @@ class RemoteOvsdb(app_manager.RyuApp):
fsm.set_name(name)

kwargs = kwargs.copy()
+ kwargs['socket'] = sock
kwargs['address'] = address
kwargs['idl'] = idl
kwargs['name'] = name
@@ -359,6 +360,7 @@ class RemoteOvsdb(app_manager.RyuApp):

def __init__(self, *args, **kwargs):
super(RemoteOvsdb, self).__init__(*args, **kwargs)
+ self.socket = kwargs['socket']
self.address = kwargs['address']
self._idl = kwargs['idl']
self.system_id = kwargs['system_id']
--
2.7.4
FUJITA Tomonori
2017-07-02 12:03:31 UTC
Permalink
On Fri, 30 Jun 2017 10:58:50 +0900
Post by Satoshi Fujimoto
This patch adds "socket" field to RemoteOvsdb
to get sockets which connects to switches.
e.g.)
@set_ev_cls(ovsdb_event.EventNewOVSDBConnection)
print(ev.client.socket.getsockname()[0])
---
ryu/services/protocols/ovsdb/client.py | 2 ++
1 file changed, 2 insertions(+)
Applied, thanks.

Loading...