hi  team

I have put the bmpstation server host and port configuration to flags.py

so user can use

    $ ryu-manager ryu/app/bmpstation.py

to use the default bind ip and port, or

   $ ryu-manager ryu/app/bmpstation.py --bmpstation-host=10.1.1.1
--bmpstation-port=20000

to a specific host ip and port


Index: ryu/flags.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- ryu/flags.py (revision 4b07ae47142fc53f1eaa8cb65790de187f1f08bc)
+++ ryu/flags.py (revision )
@@ -64,3 +64,8 @@
                help='tester sw OFP version [openflow13|openflow14] '
                '(default: openflow13)')
 ], group='test-switch')
+
+CONF.register_cli_opts([
+    cfg.StrOpt('bmpstation-host', default='0.0.0.0', help='bmpstation
listen host'),
+    cfg.IntOpt('bmpstation-port', default=11019, help='bmpstation listen
port')
+])
\ No newline at end of file
Index: ryu/app/bmpstation.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- ryu/app/bmpstation.py (revision
4b07ae47142fc53f1eaa8cb65790de187f1f08bc)
+++ ryu/app/bmpstation.py (revision )
@@ -13,20 +13,15 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.

-import socket
 import logging
 logging.basicConfig(level=logging.DEBUG)

 from ryu.base import app_manager
-
 from ryu.lib import hub
 from ryu.lib.hub import StreamServer
 from ryu.lib.packet import bmp

-SERVER_HOST = '0.0.0.0'
-SERVER_PORT = 11019

-
 class BMPStation(app_manager.RyuApp):
     def __init__(self):
         super(BMPStation, self).__init__()
@@ -34,8 +29,8 @@

     def start(self):
         super(BMPStation, self).start()
-
-        return hub.spawn(StreamServer((SERVER_HOST, SERVER_PORT),
+        print self.CONF
+        return hub.spawn(StreamServer((self.CONF.bmpstation_host,
self.CONF.bmpstation_port),
                                       self.loop).serve_forever)

     def loop(self, sock, addr):

Attachment: put_the_bmpstation_server_host_and_port_configuration_to_flags_py.patch
Description: Binary data

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

Reply via email to