We might want a bgp speaker to talk with multiple bmp servers in the
future so I renamed these functions. Note that currently a speaker can
connect to only one bmp server.

I also update the example code on how to make the speaker to connect
to a bmp server.

Signed-off-by: FUJITA Tomonori <[email protected]>
---
 doc/source/library_bgp_speaker.rst       |  3 ++-
 ryu/services/protocols/bgp/bgpspeaker.py | 24 ++++++++++++++++++++----
 2 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/doc/source/library_bgp_speaker.rst 
b/doc/source/library_bgp_speaker.rst
index d6c5942..e17d824 100644
--- a/doc/source/library_bgp_speaker.rst
+++ b/doc/source/library_bgp_speaker.rst
@@ -43,7 +43,8 @@ instance advertizes some prefixes.
                              
best_path_change_handler=dump_remote_best_path_change)
 
         speaker.neighbor_add('192.168.177.32', 64513)
-
+       # uncomment the below line if the speaker needs to talk with a bmp 
server.
+       # speaker.bmp_server_add('192.168.177.2', 11019)
         count = 1
         while True:
             eventlet.sleep(30)
diff --git a/ryu/services/protocols/bgp/bgpspeaker.py 
b/ryu/services/protocols/bgp/bgpspeaker.py
index a2993be..73899aa 100644
--- a/ryu/services/protocols/bgp/bgpspeaker.py
+++ b/ryu/services/protocols/bgp/bgpspeaker.py
@@ -506,16 +506,32 @@ class BGPSpeaker(object):
         in_filter = call(func_name, **param)
         return in_filter
 
-    def bmp_start(self, host, port):
+    def bmp_server_add(self, address, port):
+        """This method registers a new BMP (BGP monitoring Protocol)
+        server. The BGP speaker starts to send BMP messages to the
+        server. Currently, only one BMP server can be registered.
+
+        ``address`` specifies the IP address of a BMP server.
+
+        ``port`` specifies the listen port number of a BMP server.
+        """
+
         func_name = 'bmp.start'
         param = {}
-        param['host'] = host
+        param['host'] = address
         param['port'] = port
         call(func_name, **param)
 
-    def bmp_stop(self, host, port):
+    def bmp_server_del(self, address, port):
+        """ This method unregister the registered BMP server.
+
+        ``address`` specifies the IP address of a BMP server.
+
+        ``port`` specifies the listen port number of a BMP server.
+        """
+
         func_name = 'bmp.stop'
         param = {}
-        param['host'] = host
+        param['host'] = address
         param['port'] = port
         call(func_name, **param)
-- 
1.8.5.2 (Apple Git-48)


------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to