From eb94ee01bc91479517f1e1641a1702eb0f17575d Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Mon, 5 Nov 2018 21:19:50 +0000 Subject: [PATCH] Rename "ryu" to "os_ken" everywhere Change-Id: Id227a6672fb89cd512b17cddfb1fce7bb22fb0c8 --- .gitignore | 1 - .travis.yml | 2 +- MANIFEST.in | 6 +- bin/{ryu => osken} | 2 +- bin/{ryu-manager => osken-manager} | 2 +- doc/source/api_ref.rst | 2 +- doc/source/components.rst | 4 +- doc/source/library_mrt.rst | 2 +- doc/source/library_ovsdb_manager.rst | 2 +- doc/source/library_pcap.rst | 2 +- doc/source/man/{ryu.rst => osken.rst} | 4 +- .../{ryu_manager.rst => osken_manager.rst} | 6 +- doc/source/os_ken_app_api.rst | 8 +-- doc/source/parameters.rst | 10 ++-- doc/source/snort_integrate.rst | 4 +- doc/source/test-of-config-with-linc.rst | 4 +- doc/source/test-vrrp.rst | 4 +- doc/source/tls.rst | 2 +- doc/source/writing_os_ken_app.rst | 8 +-- etc/{ryu/ryu.conf => os_ken/os_ken.conf} | 0 os_ken/app/bmpstation.py | 10 ++-- os_ken/app/cbench.py | 2 +- os_ken/app/example_switch_13.py | 2 +- os_ken/app/gui_topology/gui_topology.py | 2 +- os_ken/app/gui_topology/html/index.html | 6 +- .../{ryu.topology.css => osken.topology.css} | 4 +- .../{ryu.topology.js => osken.topology.js} | 0 os_ken/app/ofctl/api.py | 8 +-- os_ken/app/ofctl/exception.py | 2 +- os_ken/app/ofctl/service.py | 2 +- os_ken/app/ofctl_rest.py | 8 +-- os_ken/app/rest_conf_switch.py | 4 +- os_ken/app/rest_firewall.py | 2 +- os_ken/app/rest_qos.py | 2 +- os_ken/app/rest_router.py | 8 +-- os_ken/app/rest_topology.py | 2 +- os_ken/app/rest_vtep.py | 14 ++--- os_ken/app/simple_switch.py | 2 +- os_ken/app/simple_switch_12.py | 2 +- os_ken/app/simple_switch_13.py | 2 +- os_ken/app/simple_switch_14.py | 2 +- os_ken/app/simple_switch_15.py | 2 +- os_ken/app/simple_switch_igmp.py | 2 +- os_ken/app/simple_switch_lacp.py | 2 +- os_ken/app/simple_switch_snort.py | 2 +- os_ken/app/simple_switch_stp.py | 2 +- os_ken/app/ws_topology.py | 4 +- os_ken/base/app_manager.py | 58 +++++++++---------- os_ken/cfg.py | 2 +- os_ken/cmd/manager.py | 6 +- os_ken/cmd/{ryu_base.py => osken_base.py} | 0 os_ken/controller/conf_switch.py | 2 +- os_ken/controller/controller.py | 2 +- os_ken/controller/dpset.py | 4 +- os_ken/controller/event.py | 6 +- os_ken/controller/handler.py | 4 +- os_ken/controller/network.py | 4 +- os_ken/controller/ofp_event.py | 2 +- os_ken/controller/ofp_handler.py | 10 ++-- os_ken/controller/tunnels.py | 8 +-- os_ken/exception.py | 24 ++++---- os_ken/lib/bfdlib.py | 14 ++--- os_ken/lib/hub.py | 2 +- os_ken/lib/igmplib.py | 2 +- os_ken/lib/lacplib.py | 2 +- os_ken/lib/mrtlib.py | 4 +- os_ken/lib/of_config/capable_switch.py | 4 +- os_ken/lib/ovs/bridge.py | 4 +- os_ken/lib/packet/__init__.py | 2 +- os_ken/lib/pcaplib.py | 2 +- os_ken/lib/snortlib.py | 2 +- os_ken/lib/stplib.py | 8 +-- os_ken/ofproto/ofproto_v1_0_parser.py | 10 ++-- os_ken/ofproto/ofproto_v1_2.py | 2 +- os_ken/ofproto/ofproto_v1_2_parser.py | 10 ++-- os_ken/ofproto/ofproto_v1_3.py | 2 +- os_ken/ofproto/ofproto_v1_3_parser.py | 10 ++-- os_ken/ofproto/ofproto_v1_4.py | 2 +- os_ken/ofproto/ofproto_v1_4_parser.py | 10 ++-- os_ken/ofproto/ofproto_v1_5_parser.py | 10 ++-- os_ken/services/protocols/bgp/api/jsonrpc.py | 2 +- os_ken/services/protocols/bgp/application.py | 28 ++++----- os_ken/services/protocols/bgp/bgpspeaker.py | 2 +- os_ken/services/protocols/bgp/bmp.py | 2 +- os_ken/services/protocols/bgp/operator/ssh.py | 2 +- os_ken/services/protocols/ovsdb/client.py | 2 +- os_ken/services/protocols/ovsdb/manager.py | 2 +- os_ken/services/protocols/vrrp/dumper.py | 2 +- os_ken/services/protocols/vrrp/event.py | 2 +- os_ken/services/protocols/vrrp/manager.py | 4 +- os_ken/services/protocols/vrrp/monitor.py | 2 +- os_ken/services/protocols/vrrp/router.py | 2 +- os_ken/services/protocols/vrrp/rpc_manager.py | 2 +- .../services/protocols/vrrp/sample_manager.py | 4 +- .../services/protocols/vrrp/sample_router.py | 4 +- .../protocols/zebra/client/zclient.py | 4 +- .../protocols/zebra/server/sample_dumper.py | 4 +- .../protocols/zebra/server/zserver.py | 4 +- os_ken/tests/integrated/bgp/base.py | 2 +- os_ken/tests/integrated/bgp/base_ip6.py | 2 +- .../common/install_docker_test_pkg.sh | 4 +- .../install_docker_test_pkg_for_travis.sh | 4 +- .../common/{ryubgp.py => oskenbgp.py} | 20 +++---- .../tests/integrated/run_tests_with_ovs12.py | 14 ++--- os_ken/tests/integrated/test_of_config.py | 4 +- .../tests/integrated/test_vrrp_linux_multi.py | 6 +- os_ken/tests/integrated/test_vrrp_multi.py | 4 +- os_ken/tests/integrated/tester.py | 2 +- os_ken/tests/integrated/vrrp_common.py | 2 +- os_ken/tests/mininet/l2/mpls/PopMPLS_mpls.mn | 2 +- os_ken/tests/mininet/l2/mpls/PushMPLS_ip.mn | 2 +- os_ken/tests/mininet/l2/mpls/PushMPLS_mpls.mn | 2 +- os_ken/tests/mininet/l2/mpls/test_mpls.py | 2 +- os_ken/tests/mininet/l2/vlan/PopVLAN_vlan.mn | 2 +- .../tests/mininet/l2/vlan/PopVLAN_vlanvlan.mn | 2 +- os_ken/tests/mininet/l2/vlan/PushVLAN_icmp.mn | 2 +- os_ken/tests/mininet/l2/vlan/test_vlan.py | 2 +- os_ken/tests/mininet/l3/icmp/ICMP_ping.mn | 2 +- os_ken/tests/mininet/l3/icmp/ICMP_reply.mn | 2 +- os_ken/tests/mininet/l3/icmp/test_icmp.py | 2 +- os_ken/tests/mininet/l3/ip_ttl/DecNwTtl.mn | 2 +- os_ken/tests/mininet/l3/ip_ttl/test_ip_ttl.py | 2 +- .../mininet/packet_lib/arp/ARP_gratuitous.mn | 2 +- .../tests/mininet/packet_lib/arp/ARP_reply.mn | 2 +- .../mininet/packet_lib/arp/ARP_request.mn | 2 +- .../tests/mininet/packet_lib/arp/test_arp.py | 18 +++--- os_ken/tests/mininet/run_mnet-test.sh | 42 +++++++------- os_ken/tests/packet_data_generator/src/x1.erl | 2 +- os_ken/tests/packet_data_generator2/README | 4 +- os_ken/tests/switch/tester.py | 14 ++--- os_ken/tests/test_lib.py | 8 +-- os_ken/tests/unit/app/test_tester.py | 2 +- os_ken/tests/unit/cmd/dummy_app.py | 2 +- os_ken/tests/unit/cmd/dummy_openflow_app.py | 2 +- os_ken/tests/unit/cmd/test_manager.py | 12 ++-- .../tests/unit/controller/test_controller.py | 4 +- os_ken/tests/unit/packet/test_bmp.py | 2 +- os_ken/tests/unit/test_requirements.py | 14 ++--- os_ken/topology/dumper.py | 2 +- os_ken/topology/switches.py | 6 +- run_tests.sh | 16 ++--- tools/normalize_json.py | 2 +- .../{ryu-manager.spec => osken-manager.spec} | 8 +-- tools/pyang_plugins/{ryu.py => osken.py} | 36 ++++++------ 144 files changed, 386 insertions(+), 389 deletions(-) rename bin/{ryu => osken} (94%) rename bin/{ryu-manager => osken-manager} (94%) rename doc/source/man/{ryu.rst => osken.rst} (92%) rename doc/source/man/{ryu_manager.rst => osken_manager.rst} (97%) rename etc/{ryu/ryu.conf => os_ken/os_ken.conf} (100%) rename os_ken/app/gui_topology/html/{ryu.topology.css => osken.topology.css} (84%) rename os_ken/app/gui_topology/html/{ryu.topology.js => osken.topology.js} (100%) rename os_ken/cmd/{ryu_base.py => osken_base.py} (100%) rename os_ken/tests/integrated/common/{ryubgp.py => oskenbgp.py} (91%) rename tools/{ryu-manager.spec => osken-manager.spec} (76%) rename tools/pyang_plugins/{ryu.py => osken.py} (83%) diff --git a/.gitignore b/.gitignore index 05ad6cf0..d8e22410 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,6 @@ dist build eggs parts -bin var sdist develop-eggs diff --git a/.travis.yml b/.travis.yml index 4f67934d..33b4a63e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,7 @@ sudo: required # Required to enable Docker service install: - pip install tox coveralls - - bash ryu/tests/integrated/common/install_docker_test_pkg_for_travis.sh + - bash os_ken/tests/integrated/common/install_docker_test_pkg_for_travis.sh script: - NOSE_VERBOSE=0 tox -e $TOX_ENV diff --git a/MANIFEST.in b/MANIFEST.in index 990c333f..df52dea0 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,13 +1,13 @@ include LICENSE include MANIFEST.in include *.rst -recursive-include ryu *.xsd +recursive-include os_ken *.xsd graft doc graft etc graft tools recursive-exclude doc/build * -recursive-exclude ryu/tests/packet_data_generator * -recursive-exclude ryu/tests/packet_data_generator2 * +recursive-exclude os_ken/tests/packet_data_generator * +recursive-exclude os_ken/tests/packet_data_generator2 * global-exclude *~ global-exclude *.pyc global-exclude .gitignore diff --git a/bin/ryu b/bin/osken similarity index 94% rename from bin/ryu rename to bin/osken index d726b481..5cc8469e 100755 --- a/bin/ryu +++ b/bin/osken @@ -16,5 +16,5 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ryu.cmd.ryu_base import main +from os_ken.cmd.osken_base import main main() diff --git a/bin/ryu-manager b/bin/osken-manager similarity index 94% rename from bin/ryu-manager rename to bin/osken-manager index 28979a1d..a8490cf7 100755 --- a/bin/ryu-manager +++ b/bin/osken-manager @@ -15,5 +15,5 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ryu.cmd.manager import main +from os_ken.cmd.manager import main main() diff --git a/doc/source/api_ref.rst b/doc/source/api_ref.rst index bed9c37e..c9209cb8 100644 --- a/doc/source/api_ref.rst +++ b/doc/source/api_ref.rst @@ -8,7 +8,7 @@ OS-Ken API Reference .. XXX https://bitbucket.org/birkenfeld/sphinx/issue/1362 .. py:currentmodule:: os_ken.base.app_manager -.. autoclass:: os_ken.base.app_manager.RyuApp +.. autoclass:: os_ken.base.app_manager.OSKenApp :members: OFP_VERSIONS,_CONTEXTS,_EVENTS,close,context_iteritems,reply_to_request,send_event,send_event_to_observers,send_request,start .. autoclass:: os_ken.controller.dpset.DPSet diff --git a/doc/source/components.rst b/doc/source/components.rst index 1cd9f641..b2269ca0 100644 --- a/doc/source/components.rst +++ b/doc/source/components.rst @@ -5,7 +5,7 @@ Components of OS-Ken Executables =========== -bin/os_ken-manager +bin/osken-manager ------------------ The main executable. @@ -134,7 +134,7 @@ Open vSwitch python binding. Used by os_ken.lib.ovs. os_ken.contrib.oslo.config -------------------------- -Oslo configuration library. Used for os_ken-manager's command-line options +Oslo configuration library. Used for osken-manager's command-line options and configuration files. os_ken.contrib.ncclient diff --git a/doc/source/library_mrt.rst b/doc/source/library_mrt.rst index dd9bb7a2..0d0c79ff 100644 --- a/doc/source/library_mrt.rst +++ b/doc/source/library_mrt.rst @@ -22,7 +22,7 @@ mrtlib.Reader. Writing MRT file ================ -For dumping the routing information which your RyuApp generated, you can use +For dumping the routing information which your OSKenApp generated, you can use mrtlib.Writer. .. autoclass:: os_ken.lib.mrtlib.Writer diff --git a/doc/source/library_ovsdb_manager.rst b/doc/source/library_ovsdb_manager.rst index 39610263..9f0b8ab3 100644 --- a/doc/source/library_ovsdb_manager.rst +++ b/doc/source/library_ovsdb_manager.rst @@ -56,7 +56,7 @@ and also provides the API "create_port" for creating a port on a bridge. from os_ken.services.protocols.ovsdb import event as ovsdb_event - class MyApp(app_manager.RyuApp): + class MyApp(app_manager.OSKenApp): @set_ev_cls(ovsdb_event.EventNewOVSDBConnection) def handle_new_ovsdb_connection(self, ev): system_id = ev.system_id diff --git a/doc/source/library_pcap.rst b/doc/source/library_pcap.rst index b9264031..4a9e0a33 100644 --- a/doc/source/library_pcap.rst +++ b/doc/source/library_pcap.rst @@ -21,7 +21,7 @@ pcaplib.Reader. Writing PCAP file ================= -For dumping the packet data which your RyuApp received, you can use +For dumping the packet data which your OSKenApp received, you can use pcaplib.Writer. .. autoclass:: os_ken.lib.pcaplib.Writer diff --git a/doc/source/man/ryu.rst b/doc/source/man/osken.rst similarity index 92% rename from doc/source/man/ryu.rst rename to doc/source/man/osken.rst index cad4a2ea..a39c9a41 100644 --- a/doc/source/man/ryu.rst +++ b/doc/source/man/osken.rst @@ -5,13 +5,13 @@ os_ken manual page Synopsis -------- -**os_ken** [-h] [--config-dir DIR] [--config-file PATH] [--version] [subcommand] ... +**osken** [-h] [--config-dir DIR] [--config-file PATH] [--version] [subcommand] ... Description ----------- :program:`os_ken` is the executable for OS-Ken applications. os_ken loads a sub-module corresponding to the sub-command and run it. 'run' sub-command is an -equivalent to os_ken-manager. +equivalent to osken-manager. OS-Ken is a component-based software defined networking framework. OS-Ken provides software components with well defined API that make it easy for diff --git a/doc/source/man/ryu_manager.rst b/doc/source/man/osken_manager.rst similarity index 97% rename from doc/source/man/ryu_manager.rst rename to doc/source/man/osken_manager.rst index 666eae3d..ed99cd69 100644 --- a/doc/source/man/ryu_manager.rst +++ b/doc/source/man/osken_manager.rst @@ -1,12 +1,12 @@ :orphan: -os_ken-manager manual page +osken-manager manual page ========================== Synopsis -------- -**os_ken-manager** [-h] +**osken-manager** [-h] [--app-lists APP_LISTS] [--ca-certs CA_CERTS] [--config-dir DIR] [--config-file PATH] [--ctl-cert CTL_CERT] [--ctl-privkey CTL_PRIVKEY] @@ -37,7 +37,7 @@ Synopsis Description ----------- -:program:`os_ken-manager` is the executable for OS-Ken applications. os_ken-manager +:program:`osken-manager` is the executable for OS-Ken applications. osken-manager loads OS-Ken applications and run it. OS-Ken is a component-based software defined networking framework. OS-Ken diff --git a/doc/source/os_ken_app_api.rst b/doc/source/os_ken_app_api.rst index 31a6e2f6..34eda589 100644 --- a/doc/source/os_ken_app_api.rst +++ b/doc/source/os_ken_app_api.rst @@ -46,7 +46,7 @@ The use of contexts is discouraged for new code. Create a OS-Ken application =========================== A OS-Ken application is a python module which defines a subclass of -os_ken.base.app_manager.RyuApp. +os_ken.base.app_manager.OSKenApp. If two or more such classes are defined in a module, the first one (by name order) will be picked by app_manager. An OS-Ken application is singleton: only a single instance of a given OS-Ken @@ -60,7 +60,7 @@ using os_ken.controller.handler.set_ev_cls decorator. Generate events =============== A OS-Ken application can raise events by calling appropriate -os_ken.base.app_manager.RyuApp's methods like send_event or +os_ken.base.app_manager.OSKenApp's methods like send_event or send_event_to_observers. Event classes @@ -88,8 +88,8 @@ OpenFlow event classes are subclasses of the following class. See :ref:`ofproto_ref` for more info about OpenFlow messages. -os_ken.base.app_manager.RyuApp -============================== +os_ken.base.app_manager.OSKenApp +================================ See :ref:`api_ref`. diff --git a/doc/source/parameters.rst b/doc/source/parameters.rst index 7f268964..7d02f404 100644 --- a/doc/source/parameters.rst +++ b/doc/source/parameters.rst @@ -25,22 +25,22 @@ Extract source code and just type:: % python ./setup.py install -Then, run os_ken-manager. +Then, run osken-manager. It listens to ip address 0.0.0.0 and port 6633 by default. Then have your openflow switch (hardware or openvswitch OVS) to connect to -os_ken-manager. +osken-manager. For OVS case, you can done it by % ovs-vsctl set-controller tcp:[:] -At the moment, os_ken-manager supports only tcp method. +At the moment, osken-manager supports only tcp method. invoking application and Configuration ====================================== It can be configured by passing configuration file like:: - os_ken-manager [generic/application specific options...] + osken-manager [generic/application specific options...] At the moment applications including the following ones are available (And more to come as OS-Ken evolves.) @@ -102,7 +102,7 @@ Invoking Example ================ The example is as follows:: - % PYTHONPATH=. ./bin/os_ken-manager --wsapi-port 8081 --verbose --app-lists os_ken.app.simple_isolation,os_ken.app.rest + % PYTHONPATH=. ./bin/osken-manager --wsapi-port 8081 --verbose --app-lists os_ken.app.simple_isolation,os_ken.app.rest loading app os_ken.app.simple_isolation loading app os_ken.app.rest loading app os_ken.controller.ofp_handler diff --git a/doc/source/snort_integrate.rst b/doc/source/snort_integrate.rst index a9f61cfa..4ae9d472 100644 --- a/doc/source/snort_integrate.rst +++ b/doc/source/snort_integrate.rst @@ -87,7 +87,7 @@ Usage 2. Run OS-Ken with sample application: :: - $ sudo ./bin/os_ken-manager os_ken/app/simple_switch_snort.py + $ sudo ./bin/osken-manager os_ken/app/simple_switch_snort.py The incoming packets will all mirror to **port 3** which should be connect to Snort network interface. You can modify the mirror port by assign a new value in the ``self.snort_port = 3`` of ``simple_switch_snort.py`` @@ -114,7 +114,7 @@ The incoming packets will all mirror to **port 3** which should be connect to Sn 2. Run OS-Ken with sample application (On the Controller): :: - $ ./bin/os_ken-manager os_ken/app/simple_switch_snort.py + $ ./bin/osken-manager os_ken/app/simple_switch_snort.py 3. Run Snort (On the Snort machine): :: diff --git a/doc/source/test-of-config-with-linc.rst b/doc/source/test-of-config-with-linc.rst index eae6dc07..4611170f 100644 --- a/doc/source/test-of-config-with-linc.rst +++ b/doc/source/test-of-config-with-linc.rst @@ -183,8 +183,8 @@ Run OS-Ken test_of_config app Run test_of_config app:: - # os_ken-manager --verbose os_ken.tests.integrated.test_of_config os_ken.app.rest + # osken-manager --verbose os_ken.tests.integrated.test_of_config os_ken.app.rest If you don't install os_ken and are working in the git repo directly:: - # PYTHONPATH=. ./bin/os_ken-manager --verbose os_ken.tests.integrated.test_of_config os_ken.app.rest + # PYTHONPATH=. ./bin/osken-manager --verbose os_ken.tests.integrated.test_of_config os_ken.app.rest diff --git a/doc/source/test-vrrp.rst b/doc/source/test-vrrp.rst index 3ac6575f..dbce8893 100644 --- a/doc/source/test-vrrp.rst +++ b/doc/source/test-vrrp.rst @@ -21,7 +21,7 @@ Running multiple OS-Ken VRRP in network namespace The following command lines set up necessary bridges and interfaces. -And then run RYU-VRRP:: +And then run OSKen-VRRP:: # ip netns add gateway1 # ip netns add gateway2 @@ -160,7 +160,7 @@ Here's the helper executable, os_ken-vrrp:: _PRIORITY = 100 - class VRRPTestRouter(app_manager.RyuApp): + class VRRPTestRouter(app_manager.OSKenApp): def __init__(self, *args, **kwargs): super(VRRPTestRouter, self).__init__(*args, **kwargs) print args diff --git a/doc/source/tls.rst b/doc/source/tls.rst index c5926570..87332770 100644 --- a/doc/source/tls.rst +++ b/doc/source/tls.rst @@ -60,7 +60,7 @@ above. You should use absolute file names. Run OS-Ken with CA files:: - % os_ken-manager --ctl-privkey ctl-privkey.pem \ + % osken-manager --ctl-privkey ctl-privkey.pem \ --ctl-cert ctl-cert.pem \ --ca-certs /usr/local/var/lib/openvswitch/pki/switchca/cacert.pem \ --verbose diff --git a/doc/source/writing_os_ken_app.rst b/doc/source/writing_os_ken_app.rst index fd3ef67a..1bd92d73 100644 --- a/doc/source/writing_os_ken_app.rst +++ b/doc/source/writing_os_ken_app.rst @@ -25,7 +25,7 @@ Open a text editor creating a new file with the following content: from os_ken.base import app_manager - class L2Switch(app_manager.RyuApp): + class L2Switch(app_manager.OSKenApp): def __init__(self, *args, **kwargs): super(L2Switch, self).__init__(*args, **kwargs) @@ -36,12 +36,12 @@ any name, extensions, and any place you want. Let's name the file This application does nothing useful yet, however it's a complete OS-Ken application. In fact, you can run this OS-Ken application:: - % os_ken-manager ~/l2.py + % osken-manager ~/l2.py loading app /Users/fujita/l2.py instantiating app /Users/fujita/l2.py -All you have to do is defining needs a new subclass of RyuApp to run +All you have to do is defining needs a new subclass of OSKenApp to run your Python script as a OS-Ken application. Next let's add the functionality of sending a received packet to all @@ -55,7 +55,7 @@ the ports. from os_ken.controller.handler import set_ev_cls from os_ken.ofproto import ofproto_v1_0 - class L2Switch(app_manager.RyuApp): + class L2Switch(app_manager.OSKenApp): OFP_VERSIONS = [ofproto_v1_0.OFP_VERSION] def __init__(self, *args, **kwargs): diff --git a/etc/ryu/ryu.conf b/etc/os_ken/os_ken.conf similarity index 100% rename from etc/ryu/ryu.conf rename to etc/os_ken/os_ken.conf diff --git a/os_ken/app/bmpstation.py b/os_ken/app/bmpstation.py index db83f363..40172272 100644 --- a/os_ken/app/bmpstation.py +++ b/os_ken/app/bmpstation.py @@ -24,14 +24,14 @@ from os_ken.lib.hub import StreamServer from os_ken.lib.packet import bmp -class BMPStation(app_manager.RyuApp): +class BMPStation(app_manager.OSKenApp): def __init__(self): super(BMPStation, self).__init__() self.name = 'bmpstation' - self.server_host = os.environ.get('RYU_BMP_SERVER_HOST', '0.0.0.0') - self.server_port = int(os.environ.get('RYU_BMP_SERVER_PORT', 11019)) - output_file = os.environ.get('RYU_BMP_OUTPUT_FILE', 'os_ken_bmp.log') - failed_dump = os.environ.get('RYU_BMP_FAILED_DUMP', + self.server_host = os.environ.get('OSKEN_BMP_SERVER_HOST', '0.0.0.0') + self.server_port = int(os.environ.get('OSKEN_BMP_SERVER_PORT', 11019)) + output_file = os.environ.get('OSKEN_BMP_OUTPUT_FILE', 'os_ken_bmp.log') + failed_dump = os.environ.get('OSKEN_BMP_FAILED_DUMP', 'os_ken_bmp_failed.dump') self.output_fd = open(output_file, 'w') diff --git a/os_ken/app/cbench.py b/os_ken/app/cbench.py index b962e4cb..5d8a9031 100644 --- a/os_ken/app/cbench.py +++ b/os_ken/app/cbench.py @@ -26,7 +26,7 @@ from os_ken.controller.handler import set_ev_cls from os_ken.ofproto import ofproto_v1_0 -class Cbench(app_manager.RyuApp): +class Cbench(app_manager.OSKenApp): OFP_VERSIONS = [ofproto_v1_0.OFP_VERSION] def __init__(self, *args, **kwargs): diff --git a/os_ken/app/example_switch_13.py b/os_ken/app/example_switch_13.py index 85947b95..e2881ade 100644 --- a/os_ken/app/example_switch_13.py +++ b/os_ken/app/example_switch_13.py @@ -22,7 +22,7 @@ from os_ken.lib.packet import packet from os_ken.lib.packet import ethernet -class ExampleSwitch13(app_manager.RyuApp): +class ExampleSwitch13(app_manager.OSKenApp): OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION] def __init__(self, *args, **kwargs): diff --git a/os_ken/app/gui_topology/gui_topology.py b/os_ken/app/gui_topology/gui_topology.py index 79928c23..24063ae6 100644 --- a/os_ken/app/gui_topology/gui_topology.py +++ b/os_ken/app/gui_topology/gui_topology.py @@ -38,7 +38,7 @@ PATH = os.path.dirname(__file__) # Serving static files -class GUIServerApp(app_manager.RyuApp): +class GUIServerApp(app_manager.OSKenApp): _CONTEXTS = { 'wsgi': WSGIApplication, } diff --git a/os_ken/app/gui_topology/html/index.html b/os_ken/app/gui_topology/html/index.html index 47f05e3a..5133b022 100644 --- a/os_ken/app/gui_topology/html/index.html +++ b/os_ken/app/gui_topology/html/index.html @@ -2,11 +2,11 @@ - + -

Ryu Topology Viewer

- +

OSKen Topology Viewer

+ diff --git a/os_ken/app/gui_topology/html/ryu.topology.css b/os_ken/app/gui_topology/html/osken.topology.css similarity index 84% rename from os_ken/app/gui_topology/html/ryu.topology.css rename to os_ken/app/gui_topology/html/osken.topology.css index b921f867..479cd423 100644 --- a/os_ken/app/gui_topology/html/ryu.topology.css +++ b/os_ken/app/gui_topology/html/osken.topology.css @@ -1,5 +1,5 @@ -#topology { - border: 1px solid #000000; +#topology { + border: 1px solid #000000; } .node { diff --git a/os_ken/app/gui_topology/html/ryu.topology.js b/os_ken/app/gui_topology/html/osken.topology.js similarity index 100% rename from os_ken/app/gui_topology/html/ryu.topology.js rename to os_ken/app/gui_topology/html/osken.topology.js diff --git a/os_ken/app/ofctl/api.py b/os_ken/app/ofctl/api.py index d8c58f37..c5db1c74 100644 --- a/os_ken/app/ofctl/api.py +++ b/os_ken/app/ofctl/api.py @@ -24,7 +24,7 @@ def get_datapath(app, dpid=None): """ Get datapath object by dpid. - :param app: Client RyuApp instance + :param app: Client OSKenApp instance :param dpid: Datapath ID (int type) or None to get all datapath objects Returns a object of datapath, a list of datapath objects when no dpid @@ -38,7 +38,7 @@ def get_datapath(app, dpid=None): import os_ken.app.ofctl.api as ofctl_api - class MyApp(app_manager.RyuApp): + class MyApp(app_manager.OSKenApp): def _my_handler(self, ev): # Get all datapath objects @@ -54,7 +54,7 @@ def send_msg(app, msg, reply_cls=None, reply_multi=False): """ Send an OpenFlow message and wait for reply messages. - :param app: Client RyuApp instance + :param app: Client OSKenApp instance :param msg: An OpenFlow controller-to-switch message to send :param reply_cls: OpenFlow message class for expected replies. None means no replies are expected. The default is None. @@ -74,7 +74,7 @@ def send_msg(app, msg, reply_cls=None, reply_multi=False): import os_ken.app.ofctl.api as ofctl_api - class MyApp(app_manager.RyuApp): + class MyApp(app_manager.OSKenApp): def _my_handler(self, ev): # ...(snip)... diff --git a/os_ken/app/ofctl/exception.py b/os_ken/app/ofctl/exception.py index 3367304e..b83baeac 100644 --- a/os_ken/app/ofctl/exception.py +++ b/os_ken/app/ofctl/exception.py @@ -19,7 +19,7 @@ from os_ken import exception # base classes -class _ExceptionBase(exception.RyuException): +class _ExceptionBase(exception.OSKenException): def __init__(self, result): self.result = result super(_ExceptionBase, self).__init__(result=result) diff --git a/os_ken/app/ofctl/service.py b/os_ken/app/ofctl/service.py index 3704550d..0adc4ac4 100644 --- a/os_ken/app/ofctl/service.py +++ b/os_ken/app/ofctl/service.py @@ -37,7 +37,7 @@ class _SwitchInfo(object): self.results = {} -class OfctlService(app_manager.RyuApp): +class OfctlService(app_manager.OSKenApp): def __init__(self, *args, **kwargs): super(OfctlService, self).__init__(*args, **kwargs) self.name = 'ofctl_service' diff --git a/os_ken/app/ofctl_rest.py b/os_ken/app/ofctl_rest.py index 2232f69d..dae3c0e6 100644 --- a/os_ken/app/ofctl_rest.py +++ b/os_ken/app/ofctl_rest.py @@ -22,7 +22,7 @@ from os_ken.controller import ofp_event from os_ken.controller import dpset from os_ken.controller.handler import MAIN_DISPATCHER from os_ken.controller.handler import set_ev_cls -from os_ken.exception import RyuException +from os_ken.exception import OSKenException from os_ken.ofproto import ofproto_v1_0 from os_ken.ofproto import ofproto_v1_2 from os_ken.ofproto import ofproto_v1_3 @@ -184,11 +184,11 @@ supported_ofctl = { # POST /stats/experimenter/ -class CommandNotFoundError(RyuException): +class CommandNotFoundError(OSKenException): message = 'No such command : %(cmd)s' -class PortNotFoundError(RyuException): +class PortNotFoundError(OSKenException): message = 'No such port info: %(port_no)s' @@ -499,7 +499,7 @@ class StatsController(ControllerBase): ofctl.set_role(dp, role) -class RestStatsApi(app_manager.RyuApp): +class RestStatsApi(app_manager.OSKenApp): OFP_VERSIONS = [ofproto_v1_0.OFP_VERSION, ofproto_v1_2.OFP_VERSION, ofproto_v1_3.OFP_VERSION, diff --git a/os_ken/app/rest_conf_switch.py b/os_ken/app/rest_conf_switch.py index bb660331..2d2438c9 100644 --- a/os_ken/app/rest_conf_switch.py +++ b/os_ken/app/rest_conf_switch.py @@ -17,8 +17,6 @@ """ This module provides a set of REST API for switch configuration. - Per-switch Key-Value store - -Used by OpenStack Ryu agent. """ import json @@ -145,7 +143,7 @@ class ConfSwitchController(ControllerBase): return self._do_key(dpid, key, _delete_key, _ret) -class ConfSwitchAPI(app_manager.RyuApp): +class ConfSwitchAPI(app_manager.OSKenApp): _CONTEXTS = { 'conf_switch': conf_switch.ConfSwitchSet, } diff --git a/os_ken/app/rest_firewall.py b/os_ken/app/rest_firewall.py index c60a3b5c..a4f41ecb 100644 --- a/os_ken/app/rest_firewall.py +++ b/os_ken/app/rest_firewall.py @@ -194,7 +194,7 @@ VLANID_MAX = 4094 COOKIE_SHIFT_VLANID = 32 -class RestFirewallAPI(app_manager.RyuApp): +class RestFirewallAPI(app_manager.OSKenApp): OFP_VERSIONS = [ofproto_v1_0.OFP_VERSION, ofproto_v1_2.OFP_VERSION, diff --git a/os_ken/app/rest_qos.py b/os_ken/app/rest_qos.py index 28864a57..3855fe91 100644 --- a/os_ken/app/rest_qos.py +++ b/os_ken/app/rest_qos.py @@ -254,7 +254,7 @@ REQUIREMENTS = {'switchid': SWITCHID_PATTERN, LOG = logging.getLogger(__name__) -class RestQoSAPI(app_manager.RyuApp): +class RestQoSAPI(app_manager.OSKenApp): OFP_VERSIONS = [ofproto_v1_0.OFP_VERSION, ofproto_v1_2.OFP_VERSION, diff --git a/os_ken/app/rest_router.py b/os_ken/app/rest_router.py index 1c39a0d9..0de7ab25 100644 --- a/os_ken/app/rest_router.py +++ b/os_ken/app/rest_router.py @@ -30,7 +30,7 @@ from os_ken.controller import ofp_event from os_ken.controller.handler import set_ev_cls from os_ken.controller.handler import MAIN_DISPATCHER from os_ken.exception import OFPUnknownVersion -from os_ken.exception import RyuException +from os_ken.exception import OSKenException from os_ken.lib import dpid as dpid_lib from os_ken.lib import hub from os_ken.lib import mac as mac_lib @@ -198,15 +198,15 @@ def get_priority_type(priority, vid): return priority -class NotFoundError(RyuException): +class NotFoundError(OSKenException): message = 'Router SW is not connected. : switch_id=%(switch_id)s' -class CommandFailure(RyuException): +class CommandFailure(OSKenException): pass -class RestRouterAPI(app_manager.RyuApp): +class RestRouterAPI(app_manager.OSKenApp): OFP_VERSIONS = [ofproto_v1_0.OFP_VERSION, ofproto_v1_2.OFP_VERSION, diff --git a/os_ken/app/rest_topology.py b/os_ken/app/rest_topology.py index dd513e0c..5e534e2d 100644 --- a/os_ken/app/rest_topology.py +++ b/os_ken/app/rest_topology.py @@ -47,7 +47,7 @@ from os_ken.topology.api import get_switch, get_link, get_host # : datapath id in 16 hex -class TopologyAPI(app_manager.RyuApp): +class TopologyAPI(app_manager.OSKenApp): _CONTEXTS = { 'wsgi': WSGIApplication } diff --git a/os_ken/app/rest_vtep.py b/os_ken/app/rest_vtep.py index 478ed92f..f76cafa8 100644 --- a/os_ken/app/rest_vtep.py +++ b/os_ken/app/rest_vtep.py @@ -41,7 +41,7 @@ This example supposes the following environment:: Host A (172.17.0.1) Host B (172.17.0.2) +--------------------+ +--------------------+ - | Ryu1 | --- BGP(EVPN) --- | Ryu2 | + | OSKen1 | --- BGP(EVPN) --- | OSKen2 | +--------------------+ +--------------------+ | | +--------------------+ +--------------------+ @@ -129,7 +129,7 @@ Configuration steps Testing ------- -If BGP (EVPN) connection between Ryu1 and Ryu2 has been established, +If BGP (EVPN) connection between OSKen1 and OSKen2 has been established, pings between the client s1h1 and s2h1 should work. :: @@ -203,7 +203,7 @@ please check the followings. } } -4. Make sure that the IPv6 is enabled on your environment. Some Ryu BGP +4. Make sure that the IPv6 is enabled on your environment. Some OSKen BGP features require the IPv6 connectivity to bind sockets. Mininet seems to disable IPv6 on its installation. @@ -226,7 +226,7 @@ supports only the OpenFlow version 1.3. .. Note:: - At the time of this writing, we use the the following version of Ryu, + At the time of this writing, we use the the following version of OSKen, Open vSwitch and Mininet. :: @@ -251,7 +251,7 @@ from os_ken.app.wsgi import Response from os_ken.app.wsgi import route from os_ken.app.wsgi import WSGIApplication from os_ken.base import app_manager -from os_ken.exception import RyuException +from os_ken.exception import OSKenException from os_ken.lib.ovs import bridge as ovs_bridge from os_ken.lib.packet import arp from os_ken.lib.packet import ether_types @@ -292,7 +292,7 @@ def to_str_list(l): # Exception classes related to OpenFlow and OVSDB -class RestApiException(RyuException): +class RestApiException(OSKenException): def to_response(self, status): body = { @@ -417,7 +417,7 @@ class EvpnClient(StringifyMixin): self.next_hop = next_hop -class RestVtep(app_manager.RyuApp): +class RestVtep(app_manager.OSKenApp): OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION] _CONTEXTS = {'wsgi': WSGIApplication} diff --git a/os_ken/app/simple_switch.py b/os_ken/app/simple_switch.py index 0ac9446a..18b01a9f 100644 --- a/os_ken/app/simple_switch.py +++ b/os_ken/app/simple_switch.py @@ -29,7 +29,7 @@ from os_ken.lib.packet import ethernet from os_ken.lib.packet import ether_types -class SimpleSwitch(app_manager.RyuApp): +class SimpleSwitch(app_manager.OSKenApp): OFP_VERSIONS = [ofproto_v1_0.OFP_VERSION] def __init__(self, *args, **kwargs): diff --git a/os_ken/app/simple_switch_12.py b/os_ken/app/simple_switch_12.py index cfecef3f..ca6880cb 100644 --- a/os_ken/app/simple_switch_12.py +++ b/os_ken/app/simple_switch_12.py @@ -23,7 +23,7 @@ from os_ken.lib.packet import ethernet from os_ken.lib.packet import ether_types -class SimpleSwitch12(app_manager.RyuApp): +class SimpleSwitch12(app_manager.OSKenApp): OFP_VERSIONS = [ofproto_v1_2.OFP_VERSION] def __init__(self, *args, **kwargs): diff --git a/os_ken/app/simple_switch_13.py b/os_ken/app/simple_switch_13.py index 5ea66a2f..3bf8cc17 100644 --- a/os_ken/app/simple_switch_13.py +++ b/os_ken/app/simple_switch_13.py @@ -23,7 +23,7 @@ from os_ken.lib.packet import ethernet from os_ken.lib.packet import ether_types -class SimpleSwitch13(app_manager.RyuApp): +class SimpleSwitch13(app_manager.OSKenApp): OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION] def __init__(self, *args, **kwargs): diff --git a/os_ken/app/simple_switch_14.py b/os_ken/app/simple_switch_14.py index 64e3e95b..3a48de1f 100644 --- a/os_ken/app/simple_switch_14.py +++ b/os_ken/app/simple_switch_14.py @@ -23,7 +23,7 @@ from os_ken.lib.packet import ethernet from os_ken.lib.packet import ether_types -class SimpleSwitch14(app_manager.RyuApp): +class SimpleSwitch14(app_manager.OSKenApp): OFP_VERSIONS = [ofproto_v1_4.OFP_VERSION] def __init__(self, *args, **kwargs): diff --git a/os_ken/app/simple_switch_15.py b/os_ken/app/simple_switch_15.py index 1fa57b0d..9e445b8c 100644 --- a/os_ken/app/simple_switch_15.py +++ b/os_ken/app/simple_switch_15.py @@ -23,7 +23,7 @@ from os_ken.lib.packet import ethernet from os_ken.lib.packet import ether_types -class SimpleSwitch15(app_manager.RyuApp): +class SimpleSwitch15(app_manager.OSKenApp): OFP_VERSIONS = [ofproto_v1_5.OFP_VERSION] def __init__(self, *args, **kwargs): diff --git a/os_ken/app/simple_switch_igmp.py b/os_ken/app/simple_switch_igmp.py index 310837dd..f0e43b04 100644 --- a/os_ken/app/simple_switch_igmp.py +++ b/os_ken/app/simple_switch_igmp.py @@ -24,7 +24,7 @@ from os_ken.lib import igmplib from os_ken.lib.dpid import str_to_dpid -class SimpleSwitchIgmp(app_manager.RyuApp): +class SimpleSwitchIgmp(app_manager.OSKenApp): OFP_VERSIONS = [ofproto_v1_0.OFP_VERSION] _CONTEXTS = {'igmplib': igmplib.IgmpLib} diff --git a/os_ken/app/simple_switch_lacp.py b/os_ken/app/simple_switch_lacp.py index 46c1e8a3..bf9810ef 100644 --- a/os_ken/app/simple_switch_lacp.py +++ b/os_ken/app/simple_switch_lacp.py @@ -24,7 +24,7 @@ from os_ken.lib import lacplib from os_ken.lib.dpid import str_to_dpid -class SimpleSwitchLacp(app_manager.RyuApp): +class SimpleSwitchLacp(app_manager.OSKenApp): OFP_VERSIONS = [ofproto_v1_0.OFP_VERSION] _CONTEXTS = {'lacplib': lacplib.LacpLib} diff --git a/os_ken/app/simple_switch_snort.py b/os_ken/app/simple_switch_snort.py index db50c7ab..5849f3b2 100644 --- a/os_ken/app/simple_switch_snort.py +++ b/os_ken/app/simple_switch_snort.py @@ -29,7 +29,7 @@ from os_ken.lib.packet import icmp from os_ken.lib import snortlib -class SimpleSwitchSnort(app_manager.RyuApp): +class SimpleSwitchSnort(app_manager.OSKenApp): OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION] _CONTEXTS = {'snortlib': snortlib.SnortLib} diff --git a/os_ken/app/simple_switch_stp.py b/os_ken/app/simple_switch_stp.py index 0778fb08..48ebafd3 100644 --- a/os_ken/app/simple_switch_stp.py +++ b/os_ken/app/simple_switch_stp.py @@ -24,7 +24,7 @@ from os_ken.lib import stplib from os_ken.lib.mac import haddr_to_str -class SimpleSwitchStp(app_manager.RyuApp): +class SimpleSwitchStp(app_manager.OSKenApp): OFP_VERSIONS = [ofproto_v1_0.OFP_VERSION] _CONTEXTS = {'stplib': stplib.Stp} diff --git a/os_ken/app/ws_topology.py b/os_ken/app/ws_topology.py index 80e2d306..6b616ec5 100644 --- a/os_ken/app/ws_topology.py +++ b/os_ken/app/ws_topology.py @@ -17,7 +17,7 @@ Usage example 1. Run this application: -$ os_ken-manager --verbose --observe-links os_ken.app.ws_topology +$ osken-manager --verbose --observe-links os_ken.app.ws_topology 2. Connect to this application by WebSocket (use your favorite client): $ wscat -c ws://localhost:8080/v1.0/topology/ws @@ -49,7 +49,7 @@ from os_ken.topology import event, switches from os_ken.controller.handler import set_ev_cls -class WebSocketTopology(app_manager.RyuApp): +class WebSocketTopology(app_manager.OSKenApp): _CONTEXTS = { 'wsgi': WSGIApplication, 'switches': switches.Switches, diff --git a/os_ken/base/app_manager.py b/os_ken/base/app_manager.py index f1972389..62b8a467 100644 --- a/os_ken/base/app_manager.py +++ b/os_ken/base/app_manager.py @@ -15,11 +15,11 @@ # limitations under the License. """ -The central management of Ryu applications. +The central management of OSKen applications. -- Load Ryu applications -- Provide `contexts` to Ryu applications -- Route messages among Ryu applications +- Load OSKen applications +- Provide `contexts` to OSKen applications +- Route messages among OSKen applications """ @@ -58,7 +58,7 @@ def _lookup_service_brick_by_mod_name(mod_name): def register_app(app): - assert isinstance(app, RyuApp) + assert isinstance(app, OSKenApp) assert app.name not in SERVICE_BRICKS SERVICE_BRICKS[app.name] = app register_instance(app) @@ -88,28 +88,28 @@ def require_app(app_name, api_style=False): LOG.debug('require_app: %s is required by %s', app_name, m.__name__) -class RyuApp(object): +class OSKenApp(object): """ - The base class for Ryu applications. + The base class for OSKen applications. - RyuApp subclasses are instantiated after os_ken-manager loaded - all requested Ryu application modules. - __init__ should call RyuApp.__init__ with the same arguments. + OSKenApp subclasses are instantiated after osken-manager loaded + all requested OSKen application modules. + __init__ should call OSKenApp.__init__ with the same arguments. It's illegal to send any events in __init__. The instance attribute 'name' is the name of the class used for - message routing among Ryu applications. (Cf. send_event) - It's set to __class__.__name__ by RyuApp.__init__. + message routing among OSKen applications. (Cf. send_event) + It's set to __class__.__name__ by OSKenApp.__init__. It's discouraged for subclasses to override this. """ _CONTEXTS = {} """ - A dictionary to specify contexts which this Ryu application wants to use. + A dictionary to specify contexts which this OSKen application wants to use. Its key is a name of context and its value is an ordinary class which implements the context. The class is instantiated by app_manager - and the instance is shared among RyuApp subclasses which has _CONTEXTS - member with the same key. A RyuApp subclass can obtain a reference to + and the instance is shared among OSKenApp subclasses which has _CONTEXTS + member with the same key. A OSKenApp subclass can obtain a reference to the instance via its __init__'s kwargs as the following. Example:: @@ -124,14 +124,14 @@ class RyuApp(object): _EVENTS = [] """ - A list of event classes which this RyuApp subclass would generate. + A list of event classes which this OSKenApp subclass would generate. This should be specified if and only if event classes are defined in - a different python module from the RyuApp subclass is. + a different python module from the OSKenApp subclass is. """ OFP_VERSIONS = None """ - A list of supported OpenFlow versions for this RyuApp. + A list of supported OpenFlow versions for this OSKenApp. The default is all versions supported by the framework. Examples:: @@ -139,7 +139,7 @@ class RyuApp(object): OFP_VERSIONS = [ofproto_v1_0.OFP_VERSION, ofproto_v1_2.OFP_VERSION] - If multiple Ryu applications are loaded in the system, + If multiple OSKen applications are loaded in the system, the intersection of their OFP_VERSIONS is used. """ @@ -151,7 +151,7 @@ class RyuApp(object): return iter(cls._CONTEXTS.items()) def __init__(self, *_args, **_kwargs): - super(RyuApp, self).__init__() + super(OSKenApp, self).__init__() self.name = self.__class__.__name__ self.event_handlers = {} # ev_cls -> handlers:list self.observers = {} # ev_cls -> observer-name -> states:set @@ -165,7 +165,7 @@ class RyuApp(object): self.logger = logging.getLogger(self.name) self.CONF = cfg.CONF - # prevent accidental creation of instances of this class outside RyuApp + # prevent accidental creation of instances of this class outside OSKenApp class _EventThreadStop(event.EventBase): pass self._event_stop = _EventThreadStop() @@ -265,7 +265,7 @@ class RyuApp(object): def send_request(self, req): """ Make a synchronous request. - Set req.sync to True, send it to a Ryu application specified by + Set req.sync to True, send it to a OSKen application specified by req.dst, and block until receiving a reply. Returns the received reply. The argument should be an instance of EventRequestBase. @@ -304,7 +304,7 @@ class RyuApp(object): def send_event(self, name, ev, state=None): """ - Send the specified event to the RyuApp instance specified by name. + Send the specified event to the OSKenApp instance specified by name. """ if name in SERVICE_BRICKS: @@ -319,7 +319,7 @@ class RyuApp(object): def send_event_to_observers(self, ev, state=None): """ - Send the specified event to all observers of this RyuApp. + Send the specified event to all observers of this OSKenApp. """ for observer in self.get_observers(ev, state): @@ -354,7 +354,7 @@ class AppManager(object): @staticmethod def run_apps(app_lists): - """Run a set of Ryu applications + """Run a set of OSKen applications A convenient method to load and instantiate apps. This blocks until all relevant apps stop. @@ -392,7 +392,7 @@ class AppManager(object): mod = utils.import_module(name) clses = inspect.getmembers(mod, lambda cls: (inspect.isclass(cls) and - issubclass(cls, RyuApp) and + issubclass(cls, OSKenApp) and mod.__name__ == cls.__module__)) if clses: @@ -424,7 +424,7 @@ class AppManager(object): assert v == context_cls context_modules.append(context_cls.__module__) - if issubclass(context_cls, RyuApp): + if issubclass(context_cls, OSKenApp): services.extend(get_dependent_services(context_cls)) # we can't load an app that will be initiataed for @@ -438,7 +438,7 @@ class AppManager(object): def create_contexts(self): for key, cls in self.contexts_cls.items(): - if issubclass(cls, RyuApp): + if issubclass(cls, OSKenApp): # hack for dpset context = self._instantiate(None, cls) else: @@ -462,7 +462,7 @@ class AppManager(object): brick.register_observer(ev_cls, i.name, c.dispatchers) - # allow RyuApp and Event class are in different module + # allow OSKenApp and Event class are in different module for brick in SERVICE_BRICKS.values(): if ev_cls in brick._EVENTS: brick.register_observer(ev_cls, i.name, diff --git a/os_ken/cfg.py b/os_ken/cfg.py index dfd34974..796f83cb 100644 --- a/os_ken/cfg.py +++ b/os_ken/cfg.py @@ -19,7 +19,7 @@ import oslo_config.cfg # there are 3 ways to access the configuration. # # a. os_ken.cfg.CONF (used to register cli options) -# b. RyuApp.CONF (preferred way for os_ken applications) +# b. OSKenApp.CONF (preferred way for os_ken applications) # c. oslo_config.cfg.CONF # # Currently a. and b. shares a single ConfigOpts instance. diff --git a/os_ken/cmd/manager.py b/os_ken/cmd/manager.py index 123e7415..74ba1523 100755 --- a/os_ken/cmd/manager.py +++ b/os_ken/cmd/manager.py @@ -70,11 +70,11 @@ def main(args=None, prog=None): _parse_user_flags() try: CONF(args=args, prog=prog, - project='os_ken', version='os_ken-manager %s' % version, + project='os_ken', version='osken-manager %s' % version, default_config_files=['/usr/local/etc/os_ken/os_ken.conf']) except cfg.ConfigFilesNotFoundError: CONF(args=args, prog=prog, - project='os_ken', version='os_ken-manager %s' % version) + project='os_ken', version='osken-manager %s' % version) log.init_log() logger = logging.getLogger(__name__) @@ -109,7 +109,7 @@ def main(args=None, prog=None): hub.joinall(services) except KeyboardInterrupt: logger.debug("Keyboard Interrupt received. " - "Closing RYU application manager...") + "Closing OSKen application manager...") finally: app_mgr.close() diff --git a/os_ken/cmd/ryu_base.py b/os_ken/cmd/osken_base.py similarity index 100% rename from os_ken/cmd/ryu_base.py rename to os_ken/cmd/osken_base.py diff --git a/os_ken/controller/conf_switch.py b/os_ken/controller/conf_switch.py index af4f2ab2..81c3bae4 100644 --- a/os_ken/controller/conf_switch.py +++ b/os_ken/controller/conf_switch.py @@ -55,7 +55,7 @@ class EventConfSwitchDel(event.EventBase): self.key) -class ConfSwitchSet(app_manager.RyuApp): +class ConfSwitchSet(app_manager.OSKenApp): def __init__(self): super(ConfSwitchSet, self).__init__() self.name = 'conf_switch' diff --git a/os_ken/controller/controller.py b/os_ken/controller/controller.py index f6e72800..151eb4f0 100644 --- a/os_ken/controller/controller.py +++ b/os_ken/controller/controller.py @@ -18,7 +18,7 @@ The main component of OpenFlow controller. - Handle connections from switches -- Generate and route events to appropriate entities like Ryu applications +- Generate and route events to appropriate entities like OSKen applications """ diff --git a/os_ken/controller/dpset.py b/os_ken/controller/dpset.py index f46a81a8..806f24db 100644 --- a/os_ken/controller/dpset.py +++ b/os_ken/controller/dpset.py @@ -161,7 +161,7 @@ class PortState(dict): # this depends on controller::Datapath and dispatchers in handler -class DPSet(app_manager.RyuApp): +class DPSet(app_manager.OSKenApp): """ DPSet application manages a set of switches (datapaths) connected to this controller. @@ -172,7 +172,7 @@ class DPSet(app_manager.RyuApp): from os_ken.controller import dpset - class MyApp(app_manager.RyuApp): + class MyApp(app_manager.OSKenApp): _CONTEXTS = { 'dpset': dpset.DPSet, } diff --git a/os_ken/controller/event.py b/os_ken/controller/event.py index 3f5c3dbf..67e592b8 100644 --- a/os_ken/controller/event.py +++ b/os_ken/controller/event.py @@ -19,7 +19,7 @@ class EventBase(object): """ The base of all event classes. - A Ryu application can define its own event type by creating a subclass. + A OSKen application can define its own event type by creating a subclass. """ def __init__(self): @@ -28,7 +28,7 @@ class EventBase(object): class EventRequestBase(EventBase): """ - The base class for synchronous request for RyuApp.send_request. + The base class for synchronous request for OSKenApp.send_request. """ def __init__(self): @@ -41,7 +41,7 @@ class EventRequestBase(EventBase): class EventReplyBase(EventBase): """ - The base class for synchronous request reply for RyuApp.send_reply. + The base class for synchronous request reply for OSKenApp.send_reply. """ def __init__(self, dst): diff --git a/os_ken/controller/handler.py b/os_ken/controller/handler.py index b4dcd89c..7a9acb4c 100644 --- a/os_ken/controller/handler.py +++ b/os_ken/controller/handler.py @@ -48,10 +48,10 @@ class _Caller(object): # should be named something like 'observe_event' def set_ev_cls(ev_cls, dispatchers=None): """ - A decorator for Ryu application to declare an event handler. + A decorator for OSKen application to declare an event handler. Decorated method will become an event handler. - ev_cls is an event class whose instances this RyuApp wants to receive. + ev_cls is an event class whose instances this OSKenApp wants to receive. dispatchers argument specifies one of the following negotiation phases (or a list of them) for which events should be generated for this handler. Note that, in case an event changes the phase, the phase before the change diff --git a/os_ken/controller/network.py b/os_ken/controller/network.py index fd4c6649..56b693f0 100644 --- a/os_ken/controller/network.py +++ b/os_ken/controller/network.py @@ -26,7 +26,7 @@ from os_ken.exception import PortAlreadyExist, PortNotFound, PortUnknown NW_ID_UNKNOWN = '__NW_ID_UNKNOWN__' -class MacAddressAlreadyExist(os_ken_exc.RyuException): +class MacAddressAlreadyExist(os_ken_exc.OSKenException): message = 'port (%(dpid)s, %(port)s) has already mac %(mac_address)s' @@ -347,7 +347,7 @@ class MacAddresses(dict): return mac2port.get_ports(mac_address) -class Network(app_manager.RyuApp): +class Network(app_manager.OSKenApp): def __init__(self, nw_id_unknown=NW_ID_UNKNOWN): super(Network, self).__init__() self.name = 'network' diff --git a/os_ken/controller/ofp_event.py b/os_ken/controller/ofp_event.py index c83d1755..8a0bda32 100644 --- a/os_ken/controller/ofp_event.py +++ b/os_ken/controller/ofp_event.py @@ -129,7 +129,7 @@ class EventOFPPortStateChange(event.EventBase): """ An event class to notify the port state changes of Dtatapath instance. - This event performs like EventOFPPortStatus, but Ryu will + This event performs like EventOFPPortStatus, but OSKen will send this event after updating ``ports`` dict of Datapath instances. An instance has at least the following attributes. diff --git a/os_ken/controller/ofp_handler.py b/os_ken/controller/ofp_handler.py index 207cc16a..0a13447a 100644 --- a/os_ken/controller/ofp_handler.py +++ b/os_ken/controller/ofp_handler.py @@ -48,7 +48,7 @@ from os_ken.ofproto import ofproto_parser # back Echo Reply message. -class OFPHandler(os_ken.base.app_manager.RyuApp): +class OFPHandler(os_ken.base.app_manager.OSKenApp): def __init__(self, *args, **kwargs): super(OFPHandler, self).__init__(*args, **kwargs) self.name = ofp_event.NAME @@ -96,7 +96,7 @@ class OFPHandler(os_ken.base.app_manager.RyuApp): if negotiated_versions and not usable_versions: # e.g. # versions of OF 1.0 and 1.1 from switch - # max of OF 1.2 from Ryu and supported_ofp_version = (1.2, ) + # max of OF 1.2 from OSKen and supported_ofp_version = (1.2, ) # negotiated version = 1.1 # usable version = None error_desc = ( @@ -114,11 +114,11 @@ class OFPHandler(os_ken.base.app_manager.RyuApp): max(negotiated_versions) != max(usable_versions)): # e.g. # versions of OF 1.0 and 1.1 from switch - # max of OF 1.2 from Ryu and supported_ofp_version = (1.0, 1.2) + # max of OF 1.2 from OSKen and supported_ofp_version = (1.0, 1.2) # negotiated version = 1.1 # usable version = 1.0 # - # TODO: In order to get the version 1.0, Ryu need to send + # TODO: In order to get the version 1.0, OSKen need to send # supported verions. error_desc = ( 'no compatible version found: ' @@ -145,7 +145,7 @@ class OFPHandler(os_ken.base.app_manager.RyuApp): # the switch is able to understand lower version. # e.g. # OF 1.1 from switch - # OF 1.2 from Ryu and supported_ofp_version = (1.0, 1.2) + # OF 1.2 from OSKen and supported_ofp_version = (1.0, 1.2) # In this case, 1.1 should be used according to the spec, # but 1.1 can't be used. # diff --git a/os_ken/controller/tunnels.py b/os_ken/controller/tunnels.py index 9210a130..5eb164c4 100644 --- a/os_ken/controller/tunnels.py +++ b/os_ken/controller/tunnels.py @@ -22,16 +22,16 @@ from os_ken.base import app_manager from os_ken.controller import event -class RemoteDPIDAlreadyExist(os_ken_exc.RyuException): +class RemoteDPIDAlreadyExist(os_ken_exc.OSKenException): message = ('port (%(dpid)s, %(port)s) has already ' 'remote dpid %(remote_dpid)s') -class TunnelKeyAlreadyExist(os_ken_exc.RyuException): +class TunnelKeyAlreadyExist(os_ken_exc.OSKenException): message = 'tunnel key %(tunnel_key)s already exists' -class TunnelKeyNotFound(os_ken_exc.RyuException): +class TunnelKeyNotFound(os_ken_exc.OSKenException): message = 'no tunnel key for network %(network_id)s' @@ -208,7 +208,7 @@ class DPIDs(object): return res[0] -class Tunnels(app_manager.RyuApp): +class Tunnels(app_manager.OSKenApp): def __init__(self): super(Tunnels, self).__init__() self.name = 'tunnels' diff --git a/os_ken/exception.py b/os_ken/exception.py index 93fba6c7..94356f0c 100644 --- a/os_ken/exception.py +++ b/os_ken/exception.py @@ -15,7 +15,7 @@ # limitations under the License. -class RyuException(Exception): +class OSKenException(Exception): message = 'An unknown exception' def __init__(self, msg=None, **kwargs): @@ -28,18 +28,18 @@ class RyuException(Exception): except Exception: msg = self.message - super(RyuException, self).__init__(msg) + super(OSKenException, self).__init__(msg) -class OFPUnknownVersion(RyuException): +class OFPUnknownVersion(OSKenException): message = 'unknown version %(version)x' -class OFPMalformedMessage(RyuException): +class OFPMalformedMessage(OSKenException): message = 'malformed message' -class OFPTruncatedMessage(RyuException): +class OFPTruncatedMessage(OSKenException): message = 'truncated message: %(orig_ex)s' def __init__(self, ofpmsg, residue, original_exception, @@ -52,30 +52,30 @@ class OFPTruncatedMessage(RyuException): super(OFPTruncatedMessage, self).__init__(msg, **kwargs) -class OFPInvalidActionString(RyuException): +class OFPInvalidActionString(OSKenException): message = 'unable to parse: %(action_str)s' -class NetworkNotFound(RyuException): +class NetworkNotFound(OSKenException): message = 'no such network id %(network_id)s' -class NetworkAlreadyExist(RyuException): +class NetworkAlreadyExist(OSKenException): message = 'network id %(network_id)s already exists' -class PortNotFound(RyuException): +class PortNotFound(OSKenException): message = 'no such port (%(dpid)s, %(port)s) in network %(network_id)s' -class PortAlreadyExist(RyuException): +class PortAlreadyExist(OSKenException): message = 'port (%(dpid)s, %(port)s) in network %(network_id)s ' \ 'already exists' -class PortUnknown(RyuException): +class PortUnknown(OSKenException): message = 'unknown network id for port (%(dpid)s %(port)s)' -class MacAddressDuplicated(RyuException): +class MacAddressDuplicated(OSKenException): message = 'MAC address %(mac)s is duplicated' diff --git a/os_ken/lib/bfdlib.py b/os_ken/lib/bfdlib.py index 5b6993cc..9859f3c3 100644 --- a/os_ken/lib/bfdlib.py +++ b/os_ken/lib/bfdlib.py @@ -17,7 +17,7 @@ """ Implementation of Bidirectional Forwarding Detection for IPv4 (Single Hop) -This module provides a simple way to let Ryu act like a daemon for running +This module provides a simple way to let OSKen act like a daemon for running IPv4 single hop BFD (RFC5881). Please note that: @@ -44,7 +44,7 @@ from os_ken.controller import event from os_ken.controller import ofp_event from os_ken.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER from os_ken.controller.handler import set_ev_cls -from os_ken.exception import RyuException +from os_ken.exception import OSKenException from os_ken.ofproto.ether import ETH_TYPE_IP, ETH_TYPE_ARP from os_ken.ofproto import ofproto_v1_3 from os_ken.ofproto import inet @@ -132,7 +132,7 @@ class BFDSession(object): auth_keys = auth_keys if auth_keys else {} assert not (auth_type and len(auth_keys) == 0) - # RyuApp reference to BFDLib + # OSKenApp reference to BFDLib self.app = app # RFC5880 Section 6.8.1. @@ -517,7 +517,7 @@ class BFDPacket(object): Ethernet, IPv4, and UDP headers. """ - class BFDUnknownFormat(RyuException): + class BFDUnknownFormat(OSKenException): message = '%(msg)s' @staticmethod @@ -589,7 +589,7 @@ class ARPPacket(object): Ethernet header. """ - class ARPUnknownFormat(RyuException): + class ARPUnknownFormat(OSKenException): message = '%(msg)s' @staticmethod @@ -648,7 +648,7 @@ class EventBFDSessionStateChanged(event.EventBase): self.new_state = new_state -class BFDLib(app_manager.RyuApp): +class BFDLib(app_manager.OSKenApp): """ BFD daemon library. @@ -663,7 +663,7 @@ class BFDLib(app_manager.RyuApp): from os_ken.lib import bfdlib from os_ken.lib.packet import bfd - class Foo(app_manager.RyuApp): + class Foo(app_manager.OSKenApp): OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION] _CONTEXTS = { diff --git a/os_ken/lib/hub.py b/os_ken/lib/hub.py index 8b0aa7ad..c5da9c80 100644 --- a/os_ken/lib/hub.py +++ b/os_ken/lib/hub.py @@ -22,7 +22,7 @@ from os_ken.lib import ip # We don't bother to use cfg.py because monkey patch needs to be # called very early. Instead, we use an environment variable to # select the type of hub. -HUB_TYPE = os.getenv('RYU_HUB_TYPE', 'eventlet') +HUB_TYPE = os.getenv('OSKEN_HUB_TYPE', 'eventlet') LOG = logging.getLogger('os_ken.lib.hub') diff --git a/os_ken/lib/igmplib.py b/os_ken/lib/igmplib.py index fa65ed0b..6d77bdaf 100644 --- a/os_ken/lib/igmplib.py +++ b/os_ken/lib/igmplib.py @@ -72,7 +72,7 @@ class EventMulticastGroupStateChanged(event.EventBase): self.dsts = dsts -class IgmpLib(app_manager.RyuApp): +class IgmpLib(app_manager.OSKenApp): """IGMP snooping library.""" # ------------------------------------------------------------------- diff --git a/os_ken/lib/lacplib.py b/os_ken/lib/lacplib.py index 7f3006b9..9caa93b5 100644 --- a/os_ken/lib/lacplib.py +++ b/os_ken/lib/lacplib.py @@ -52,7 +52,7 @@ class EventSlaveStateChanged(event.EventBase): self.enabled = enabled -class LacpLib(app_manager.RyuApp): +class LacpLib(app_manager.OSKenApp): """LACP exchange library. this works only in a PASSIVE mode.""" # ------------------------------------------------------------------- diff --git a/os_ken/lib/mrtlib.py b/os_ken/lib/mrtlib.py index 08501a19..7c27786e 100644 --- a/os_ken/lib/mrtlib.py +++ b/os_ken/lib/mrtlib.py @@ -1101,14 +1101,14 @@ class Bgp4MpMessageAs4LocalMrtMessage(Bgp4MpMessageAs4MrtMessage): # TODO: -# Currently, Ryu does not provide the packet library for ISIS protocol. +# Currently, OSKen does not provide the packet library for ISIS protocol. # Implement parser for ISIS MRT message. # class IsisMrtRecord(MrtCommonRecord): # class IsisMrtMessage(MrtMessage): # TODO: -# Currently, Ryu does not provide the packet library for OSPFv3 protocol. +# Currently, OSKen does not provide the packet library for OSPFv3 protocol. # Implement the parser for OSPFv3 MRT message. # class Ospf3MrtRecord(MrtCommonRecord): # class Ospf3MrtMessage(MrtMessage): diff --git a/os_ken/lib/of_config/capable_switch.py b/os_ken/lib/of_config/capable_switch.py index 47b9b2b1..43a9e35c 100644 --- a/os_ken/lib/of_config/capable_switch.py +++ b/os_ken/lib/of_config/capable_switch.py @@ -25,8 +25,8 @@ from os_ken.lib.of_config import classes as ofc # TODO: When we re-organize ncclient, its NCClientError will be -# subclass of RyuException. -class OFConfigCapableSwitchNotFound(os_ken_exc.RyuException, +# subclass of OSKenException. +class OFConfigCapableSwitchNotFound(os_ken_exc.OSKenException, ncclient.NCClientError): message = 'OpenFlow Capable Switch not found' diff --git a/os_ken/lib/ovs/bridge.py b/os_ken/lib/ovs/bridge.py index a7061aca..3cd47f05 100644 --- a/os_ken/lib/ovs/bridge.py +++ b/os_ken/lib/ovs/bridge.py @@ -36,7 +36,7 @@ CONF.register_opts([ ]) -class OVSBridgeNotFound(os_ken_exc.RyuException): +class OVSBridgeNotFound(os_ken_exc.OSKenException): message = 'no bridge for datapath_id %(datapath_id)s' @@ -96,7 +96,7 @@ class OVSBridge(object): Class to provide wrapper utilities of :py:mod:`os_ken.lib.ovs.vsctl.VSCtl` ``CONF`` is a instance of ``oslo_config.cfg.ConfigOpts``. - Mostly ``self.CONF`` is sufficient to instantiate this class from your Ryu + Mostly ``self.CONF`` is sufficient to instantiate this class from your OSKen application. ``datapath_id`` specifies Datapath ID of the target OVS instance. diff --git a/os_ken/lib/packet/__init__.py b/os_ken/lib/packet/__init__.py index 656fab44..0bdd7ea2 100644 --- a/os_ken/lib/packet/__init__.py +++ b/os_ken/lib/packet/__init__.py @@ -1,5 +1,5 @@ """ -Ryu packet library. Decoder/Encoder implementations of popular protocols +OSKen packet library. Decoder/Encoder implementations of popular protocols like TCP/IP. """ diff --git a/os_ken/lib/pcaplib.py b/os_ken/lib/pcaplib.py index 69dc0bcc..5994b768 100644 --- a/os_ken/lib/pcaplib.py +++ b/os_ken/lib/pcaplib.py @@ -264,7 +264,7 @@ class Writer(object): from os_ken.lib import pcaplib - class SimpleSwitch13(app_manager.RyuApp): + class SimpleSwitch13(app_manager.OSKenApp): OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION] def __init__(self, *args, **kwargs): diff --git a/os_ken/lib/snortlib.py b/os_ken/lib/snortlib.py index 0c38498c..28c6f68b 100644 --- a/os_ken/lib/snortlib.py +++ b/os_ken/lib/snortlib.py @@ -33,7 +33,7 @@ class EventAlert(event.EventBase): self.msg = msg -class SnortLib(app_manager.RyuApp): +class SnortLib(app_manager.OSKenApp): def __init__(self): super(SnortLib, self).__init__() diff --git a/os_ken/lib/stplib.py b/os_ken/lib/stplib.py index b90afd45..c7916732 100644 --- a/os_ken/lib/stplib.py +++ b/os_ken/lib/stplib.py @@ -22,7 +22,7 @@ from os_ken.controller import event from os_ken.controller import handler from os_ken.controller import ofp_event from os_ken.controller.handler import set_ev_cls -from os_ken.exception import RyuException +from os_ken.exception import OSKenException from os_ken.exception import OFPUnknownVersion from os_ken.lib import hub from os_ken.lib import mac @@ -177,7 +177,7 @@ def cmp(a, b): return (a > b) - (a < b) -class Stp(app_manager.RyuApp): +class Stp(app_manager.OSKenApp): """ STP(spanning tree) library. """ OFP_VERSIONS = [ofproto_v1_0.OFP_VERSION, @@ -832,7 +832,7 @@ class Port(object): except hub.Timeout as t: if t is not timeout: err_msg = 'Internal error. Not my timeout.' - raise RyuException(msg=err_msg) + raise OSKenException(msg=err_msg) new_state = self._get_next_state() self._change_status(new_state, thread_switch=False) finally: @@ -975,7 +975,7 @@ class Port(object): except hub.Timeout as t: if t is not timeout: err_msg = 'Internal error. Not my timeout.' - raise RyuException(msg=err_msg) + raise OSKenException(msg=err_msg) self.logger.info('[port=%d] Wait BPDU timer is exceeded.', self.ofport.port_no, extra=self.dpid_str) time_exceed = True diff --git a/os_ken/ofproto/ofproto_v1_0_parser.py b/os_ken/ofproto/ofproto_v1_0_parser.py index 6f5236af..611cdeb7 100644 --- a/os_ken/ofproto/ofproto_v1_0_parser.py +++ b/os_ken/ofproto/ofproto_v1_0_parser.py @@ -1203,7 +1203,7 @@ class OFPHello(MsgBase): When connection is started, the hello message is exchanged between a switch and a controller. - This message is handled by the Ryu framework, so the Ryu application + This message is handled by the OSKen framework, so the OSKen application do not need to process this typically. """ @@ -1285,7 +1285,7 @@ class OFPEchoRequest(MsgBase): """ Echo request message - This message is handled by the Ryu framework, so the Ryu application + This message is handled by the OSKen framework, so the OSKen application do not need to process this typically. ========== ========================================================= @@ -1325,7 +1325,7 @@ class OFPEchoReply(MsgBase): """ Echo reply message - This message is handled by the Ryu framework, so the Ryu application + This message is handled by the OSKen framework, so the OSKen application do not need to process this typically. ========== ========================================================= @@ -1671,7 +1671,7 @@ class OFPSwitchFeatures(MsgBase): The switch responds with a features reply message to a features request. - This message is handled by the Ryu framework, so the Ryu application + This message is handled by the OSKen framework, so the OSKen application do not need to process this typically. ================ ====================================================== @@ -2549,7 +2549,7 @@ class OFPFeaturesRequest(MsgBase): The controller sends a feature request to the switch upon session establishment. - This message is handled by the Ryu framework, so the Ryu application + This message is handled by the OSKen framework, so the OSKen application do not need to process this typically. Example:: diff --git a/os_ken/ofproto/ofproto_v1_2.py b/os_ken/ofproto/ofproto_v1_2.py index 74b5f204..9d4e28af 100644 --- a/os_ken/ofproto/ofproto_v1_2.py +++ b/os_ken/ofproto/ofproto_v1_2.py @@ -741,7 +741,7 @@ OFPQOFC_EPERM = 2 # Permissions error. OFPSCFC_BAD_FLAGS = 0 # Specified flags is invalid. OFPSCFC_BAD_LEN = 1 # Specified len is invalid. OFPQCFC_EPERM = 2 # Permissions error (depracated). - # New or updated Ryu applications shall use + # New or updated OSKen applications shall use # OFPSCFC_EPERM. The variable name is a typo of # in specifications before v1.3.1 (EXT-208). OFPSCFC_EPERM = 2 # Permissions error. diff --git a/os_ken/ofproto/ofproto_v1_2_parser.py b/os_ken/ofproto/ofproto_v1_2_parser.py index 7524ca59..065447b8 100644 --- a/os_ken/ofproto/ofproto_v1_2_parser.py +++ b/os_ken/ofproto/ofproto_v1_2_parser.py @@ -69,7 +69,7 @@ class OFPHello(MsgBase): When connection is started, the hello message is exchanged between a switch and a controller. - This message is handled by the Ryu framework, so the Ryu application + This message is handled by the OSKen framework, so the OSKen application do not need to process this typically. """ @@ -208,7 +208,7 @@ class OFPEchoRequest(MsgBase): """ Echo request message - This message is handled by the Ryu framework, so the Ryu application + This message is handled by the OSKen framework, so the OSKen application do not need to process this typically. ========== ========================================================= @@ -254,7 +254,7 @@ class OFPEchoReply(MsgBase): """ Echo reply message - This message is handled by the Ryu framework, so the Ryu application + This message is handled by the OSKen framework, so the OSKen application do not need to process this typically. ========== ========================================================= @@ -398,7 +398,7 @@ class OFPFeaturesRequest(MsgBase): The controller sends a feature request to the switch upon session establishment. - This message is handled by the Ryu framework, so the Ryu application + This message is handled by the OSKen framework, so the OSKen application do not need to process this typically. Example:: @@ -423,7 +423,7 @@ class OFPSwitchFeatures(MsgBase): The switch responds with a features reply message to a features request. - This message is handled by the Ryu framework, so the Ryu application + This message is handled by the OSKen framework, so the OSKen application do not need to process this typically. Example:: diff --git a/os_ken/ofproto/ofproto_v1_3.py b/os_ken/ofproto/ofproto_v1_3.py index 03252be0..596205d2 100644 --- a/os_ken/ofproto/ofproto_v1_3.py +++ b/os_ken/ofproto/ofproto_v1_3.py @@ -1062,7 +1062,7 @@ OFPQOFC_EPERM = 2 # Permissions error. OFPSCFC_BAD_FLAGS = 0 # Specified flags is invalid. OFPSCFC_BAD_LEN = 1 # Specified len is invalid. OFPQCFC_EPERM = 2 # Permissions error (depracated). - # New or updated Ryu applications shall use + # New or updated OSKen applications shall use # OFPSCFC_EPERM. The variable name is a typo of # in specifications before v1.3.1 (EXT-208). OFPSCFC_EPERM = 2 # Permissions error. diff --git a/os_ken/ofproto/ofproto_v1_3_parser.py b/os_ken/ofproto/ofproto_v1_3_parser.py index 58167e1e..6e42847a 100644 --- a/os_ken/ofproto/ofproto_v1_3_parser.py +++ b/os_ken/ofproto/ofproto_v1_3_parser.py @@ -103,7 +103,7 @@ class OFPHello(MsgBase): When connection is started, the hello message is exchanged between a switch and a controller. - This message is handled by the Ryu framework, so the Ryu application + This message is handled by the OSKen framework, so the OSKen application do not need to process this typically. ========== ========================================================= @@ -318,7 +318,7 @@ class OFPEchoRequest(MsgBase): """ Echo request message - This message is handled by the Ryu framework, so the Ryu application + This message is handled by the OSKen framework, so the OSKen application do not need to process this typically. ========== ========================================================= @@ -364,7 +364,7 @@ class OFPEchoReply(MsgBase): """ Echo reply message - This message is handled by the Ryu framework, so the Ryu application + This message is handled by the OSKen framework, so the OSKen application do not need to process this typically. ========== ========================================================= @@ -461,7 +461,7 @@ class OFPFeaturesRequest(MsgBase): The controller sends a feature request to the switch upon session establishment. - This message is handled by the Ryu framework, so the Ryu application + This message is handled by the OSKen framework, so the OSKen application do not need to process this typically. Example:: @@ -486,7 +486,7 @@ class OFPSwitchFeatures(MsgBase): The switch responds with a features reply message to a features request. - This message is handled by the Ryu framework, so the Ryu application + This message is handled by the OSKen framework, so the OSKen application do not need to process this typically. Example:: diff --git a/os_ken/ofproto/ofproto_v1_4.py b/os_ken/ofproto/ofproto_v1_4.py index 97535a12..1f389e60 100644 --- a/os_ken/ofproto/ofproto_v1_4.py +++ b/os_ken/ofproto/ofproto_v1_4.py @@ -1409,7 +1409,7 @@ OFPACPT_REQUESTFORWARD_SLAVE = 10 # RequestForward mask for slave. OFPACPT_REQUESTFORWARD_MASTER = 11 # RequestForward mask for master. OFPTFPT_EXPERIMENTER_SLAVE = 0xFFFE # Experimenter for slave (depracated). OFPTFPT_EXPERIMENTER_MASTER = 0xFFFF # Experimenter for master (depracated). - # New or updated Ryu applications shall use + # New or updated OSKen applications shall use # OFPACPT_EXPERIMENTER_SLAVE and OFPACPT_EXPERIMENTER_MASTER. # The variable name is a typo of in specifications before v1.5.0. OFPACPT_EXPERIMENTER_SLAVE = 0xFFFE # Experimenter for slave. diff --git a/os_ken/ofproto/ofproto_v1_4_parser.py b/os_ken/ofproto/ofproto_v1_4_parser.py index 4dbd823d..10c5a70c 100644 --- a/os_ken/ofproto/ofproto_v1_4_parser.py +++ b/os_ken/ofproto/ofproto_v1_4_parser.py @@ -67,7 +67,7 @@ class OFPHello(MsgBase): When connection is started, the hello message is exchanged between a switch and a controller. - This message is handled by the Ryu framework, so the Ryu application + This message is handled by the OSKen framework, so the OSKen application do not need to process this typically. ========== ========================================================= @@ -155,7 +155,7 @@ class OFPEchoRequest(MsgBase): """ Echo request message - This message is handled by the Ryu framework, so the Ryu application + This message is handled by the OSKen framework, so the OSKen application do not need to process this typically. ========== ========================================================= @@ -329,7 +329,7 @@ class OFPEchoReply(MsgBase): """ Echo reply message - This message is handled by the Ryu framework, so the Ryu application + This message is handled by the OSKen framework, so the OSKen application do not need to process this typically. ========== ========================================================= @@ -377,7 +377,7 @@ class OFPFeaturesRequest(MsgBase): The controller sends a feature request to the switch upon session establishment. - This message is handled by the Ryu framework, so the Ryu application + This message is handled by the OSKen framework, so the OSKen application do not need to process this typically. Example:: @@ -443,7 +443,7 @@ class OFPSwitchFeatures(MsgBase): The switch responds with a features reply message to a features request. - This message is handled by the Ryu framework, so the Ryu application + This message is handled by the OSKen framework, so the OSKen application do not need to process this typically. Example:: diff --git a/os_ken/ofproto/ofproto_v1_5_parser.py b/os_ken/ofproto/ofproto_v1_5_parser.py index f7c08456..ce462e58 100644 --- a/os_ken/ofproto/ofproto_v1_5_parser.py +++ b/os_ken/ofproto/ofproto_v1_5_parser.py @@ -68,7 +68,7 @@ class OFPHello(MsgBase): When connection is started, the hello message is exchanged between a switch and a controller. - This message is handled by the Ryu framework, so the Ryu application + This message is handled by the OSKen framework, so the OSKen application do not need to process this typically. ========== ========================================================= @@ -156,7 +156,7 @@ class OFPEchoRequest(MsgBase): """ Echo request message - This message is handled by the Ryu framework, so the Ryu application + This message is handled by the OSKen framework, so the OSKen application do not need to process this typically. ========== ========================================================= @@ -329,7 +329,7 @@ class OFPEchoReply(MsgBase): """ Echo reply message - This message is handled by the Ryu framework, so the Ryu application + This message is handled by the OSKen framework, so the OSKen application do not need to process this typically. ========== ========================================================= @@ -377,7 +377,7 @@ class OFPFeaturesRequest(MsgBase): The controller sends a feature request to the switch upon session establishment. - This message is handled by the Ryu framework, so the Ryu application + This message is handled by the OSKen framework, so the OSKen application do not need to process this typically. Example:: @@ -443,7 +443,7 @@ class OFPSwitchFeatures(MsgBase): The switch responds with a features reply message to a features request. - This message is handled by the Ryu framework, so the Ryu application + This message is handled by the OSKen framework, so the OSKen application do not need to process this typically. Example:: diff --git a/os_ken/services/protocols/bgp/api/jsonrpc.py b/os_ken/services/protocols/bgp/api/jsonrpc.py index b25171d6..4f14f2ac 100644 --- a/os_ken/services/protocols/bgp/api/jsonrpc.py +++ b/os_ken/services/protocols/bgp/api/jsonrpc.py @@ -28,7 +28,7 @@ bgp_instance_name = 'bgp_api_app' url = '/bgp/ws' -class BgpWSJsonRpc(app_manager.RyuApp): +class BgpWSJsonRpc(app_manager.OSKenApp): _CONTEXTS = { 'wsgi': WSGIApplication, } diff --git a/os_ken/services/protocols/bgp/application.py b/os_ken/services/protocols/bgp/application.py index 2311eb64..365af0c1 100644 --- a/os_ken/services/protocols/bgp/application.py +++ b/os_ken/services/protocols/bgp/application.py @@ -14,7 +14,7 @@ # limitations under the License. """ -This module provides a convenient application for using Ryu BGPSpeaker and for +This module provides a convenient application for using OSKen BGPSpeaker and for writing your BGP application. It reads a configuration file which includes settings for neighbors, routes @@ -24,7 +24,7 @@ sample configuration. Usage Example:: - $ os_ken-manager os_ken/services/protocols/bgp/application.py \\ + $ osken-manager os_ken/services/protocols/bgp/application.py \\ --bgp-app-config-file os_ken/services/protocols/bgp/bgp_sample_conf.py SSH Console @@ -39,7 +39,7 @@ Example:: $ ssh localhost -p 4990 - Hello, this is Ryu BGP speaker (version 4.19). + Hello, this is OSKen BGP speaker (version 4.19). bgpd> # Hit '?' key clear - allows to reset BGP connections @@ -58,8 +58,8 @@ Example:: Integration with Other Applications =================================== -``os_ken.services.protocols.bgp.application.RyuBGPSpeaker`` will notifies the -following events to other Ryu applications. +``os_ken.services.protocols.bgp.application.OSKenBGPSpeaker`` will notifies the +following events to other OSKen applications. - ``EventBestPathChanged`` - ``EventAdjRibInChanged`` @@ -67,7 +67,7 @@ following events to other Ryu applications. - ``EventPeerUp`` To catch these events, specify ``@set_ev_cls()`` decorator to the event -handlers in the Ryu applications. +handlers in the OSKen applications. Example Application:: @@ -78,15 +78,15 @@ Example Application:: from os_ken.services.protocols.bgp import application as bgp_application - class MyBGPApp(app_manager.RyuApp): + class MyBGPApp(app_manager.OSKenApp): _CONTEXTS = { - 'os_kenbgpspeaker': bgp_application.RyuBGPSpeaker, + 'os_kenbgpspeaker': bgp_application.OSKenBGPSpeaker, } def __init__(self, *args, **kwargs): super(MyBGPApp, self).__init__(*args, **kwargs) - # Stores "os_ken.services.protocols.bgp.application.RyuBGPSpeaker" + # Stores "os_ken.services.protocols.bgp.application.OSKenBGPSpeaker" # instance in order to call the APIs of # "os_ken.services.protocols.bgp.bgpspeaker.BGPSpeaker" via # "self.app.speaker". @@ -101,7 +101,7 @@ Example Application:: Usage Example:: - $ os_ken-manager my_bgp_app.py \\ + $ osken-manager my_bgp_app.py \\ --bgp-app-config-file os_ken/services/protocols/bgp/bgp_sample_conf.py .. note:: @@ -119,7 +119,7 @@ import os from os_ken import cfg from os_ken.lib import hub from os_ken.utils import load_source -from os_ken.base.app_manager import RyuApp +from os_ken.base.app_manager import OSKenApp from os_ken.controller.event import EventBase from os_ken.services.protocols.bgp.base import add_bgp_error_metadata from os_ken.services.protocols.bgp.base import BGPSException @@ -260,7 +260,7 @@ class EventPeerUp(EventBase): self.remote_as = remote_as -class RyuBGPSpeaker(RyuApp): +class OSKenBGPSpeaker(OSKenApp): """ Base application for implementing BGP applications. """ @@ -272,14 +272,14 @@ class RyuBGPSpeaker(RyuApp): ] def __init__(self, *args, **kwargs): - super(RyuBGPSpeaker, self).__init__(*args, **kwargs) + super(OSKenBGPSpeaker, self).__init__(*args, **kwargs) self.config_file = CONF.config_file # BGPSpeaker instance (not instantiated yet) self.speaker = None def start(self): - super(RyuBGPSpeaker, self).start() + super(OSKenBGPSpeaker, self).start() # If configuration file was provided and loaded successfully, we start # BGPSpeaker using the given settings. diff --git a/os_ken/services/protocols/bgp/bgpspeaker.py b/os_ken/services/protocols/bgp/bgpspeaker.py index 16ab8ca9..2c3ad0c7 100644 --- a/os_ken/services/protocols/bgp/bgpspeaker.py +++ b/os_ken/services/protocols/bgp/bgpspeaker.py @@ -223,7 +223,7 @@ class EventPrefix(object): class BGPSpeaker(object): - """Class to provide the APIs of Ryu BGP Speaker. + """Class to provide the APIs of OSKen BGP Speaker. ``as_number`` specifies an Autonomous Number. It must be an integer between 1 and 65535. diff --git a/os_ken/services/protocols/bgp/bmp.py b/os_ken/services/protocols/bgp/bmp.py index e31489b6..ac9b1dde 100644 --- a/os_ken/services/protocols/bgp/bmp.py +++ b/os_ken/services/protocols/bgp/bmp.py @@ -204,7 +204,7 @@ class BMPClient(Activity): self._socket = socket # send init message init_info = {'type': bmp.BMP_INIT_TYPE_STRING, - 'value': u'This is Ryu BGP BMP message'} + 'value': u'This is OSKen BGP BMP message'} init_msg = bmp.BMPInitiation([init_info]) self._send(init_msg) diff --git a/os_ken/services/protocols/bgp/operator/ssh.py b/os_ken/services/protocols/bgp/operator/ssh.py index e1582a3f..7efe5683 100644 --- a/os_ken/services/protocols/bgp/operator/ssh.py +++ b/os_ken/services/protocols/bgp/operator/ssh.py @@ -75,7 +75,7 @@ def find_ssh_server_key(): class SshServer(paramiko.ServerInterface): TERM = "ansi" PROMPT = "bgpd> " - WELCOME = "\n\rHello, this is Ryu BGP speaker (version %s).\n\r" % version + WELCOME = "\n\rHello, this is OSKen BGP speaker (version %s).\n\r" % version class HelpCmd(Command): help_msg = 'show this help' diff --git a/os_ken/services/protocols/ovsdb/client.py b/os_ken/services/protocols/ovsdb/client.py index eb10b0b1..893e95e4 100644 --- a/os_ken/services/protocols/ovsdb/client.py +++ b/os_ken/services/protocols/ovsdb/client.py @@ -272,7 +272,7 @@ class Idl(idl.Idl): return changed -class RemoteOvsdb(app_manager.RyuApp): +class RemoteOvsdb(app_manager.OSKenApp): _EVENTS = [event.EventRowUpdate, event.EventRowDelete, event.EventRowInsert, diff --git a/os_ken/services/protocols/ovsdb/manager.py b/os_ken/services/protocols/ovsdb/manager.py index 732cf556..8aa5a9be 100644 --- a/os_ken/services/protocols/ovsdb/manager.py +++ b/os_ken/services/protocols/ovsdb/manager.py @@ -49,7 +49,7 @@ opts = (cfg.StrOpt('address', default='0.0.0.0', help='OVSDB address'), cfg.CONF.register_opts(opts, 'ovsdb') -class OVSDB(app_manager.RyuApp): +class OVSDB(app_manager.OSKenApp): _EVENTS = [event.EventNewOVSDBConnection, event.EventModifyRequest, event.EventReadRequest] diff --git a/os_ken/services/protocols/vrrp/dumper.py b/os_ken/services/protocols/vrrp/dumper.py index f4536af3..4d9a500d 100644 --- a/os_ken/services/protocols/vrrp/dumper.py +++ b/os_ken/services/protocols/vrrp/dumper.py @@ -24,7 +24,7 @@ from os_ken.controller import handler from os_ken.services.protocols.vrrp import event as vrrp_event -class VRRPDumper(app_manager.RyuApp): +class VRRPDumper(app_manager.OSKenApp): def __init__(self, *args, **kwargs): super(VRRPDumper, self).__init__(*args, **kwargs) diff --git a/os_ken/services/protocols/vrrp/event.py b/os_ken/services/protocols/vrrp/event.py index 91cb5e7c..9e1636b5 100644 --- a/os_ken/services/protocols/vrrp/event.py +++ b/os_ken/services/protocols/vrrp/event.py @@ -177,7 +177,7 @@ class EventVRRPConfigRequest(event.EventRequestBase): class EventVRRPConfigReply(event.EventReplyBase): def __init__(self, instance_name, interface, config): - # dst = None. dst is filled by app_base.RyuApp#reply_to_request() + # dst = None. dst is filled by app_base.OSKenApp#reply_to_request() super(EventVRRPConfigReply, self).__init__(None) self.instance_name = instance_name # None means failure self.interface = interface diff --git a/os_ken/services/protocols/vrrp/manager.py b/os_ken/services/protocols/vrrp/manager.py index d27c764f..00e5d3a0 100644 --- a/os_ken/services/protocols/vrrp/manager.py +++ b/os_ken/services/protocols/vrrp/manager.py @@ -20,7 +20,7 @@ VRRPManager creates/deletes VRRPRouter, VRRPInterfaceMonitor dynamically as requested. Usage example -PYTHONPATH=. ./bin/os_ken-manager --verbose \ +PYTHONPATH=. ./bin/osken-manager --verbose \ os_ken.services.protocols.vrrp.manager \ os_ken.services.protocols.vrrp.dumper """ @@ -48,7 +48,7 @@ class VRRPInstance(object): self.state = new_state -class VRRPManager(app_manager.RyuApp): +class VRRPManager(app_manager.OSKenApp): @staticmethod def _instance_name(interface, vrid, is_ipv6): ip_version = 'ipv6' if is_ipv6 else 'ipv4' diff --git a/os_ken/services/protocols/vrrp/monitor.py b/os_ken/services/protocols/vrrp/monitor.py index 684ad18e..0f20cee0 100644 --- a/os_ken/services/protocols/vrrp/monitor.py +++ b/os_ken/services/protocols/vrrp/monitor.py @@ -28,7 +28,7 @@ from os_ken.lib.packet import vrrp from os_ken.services.protocols.vrrp import event as vrrp_event -class VRRPInterfaceMonitor(app_manager.RyuApp): +class VRRPInterfaceMonitor(app_manager.OSKenApp): # subclass of VRRPInterfaceBase -> subclass of VRRPInterfaceMonitor _CONSTRUCTORS = {} diff --git a/os_ken/services/protocols/vrrp/router.py b/os_ken/services/protocols/vrrp/router.py index b16fcee2..a3d3c717 100644 --- a/os_ken/services/protocols/vrrp/router.py +++ b/os_ken/services/protocols/vrrp/router.py @@ -135,7 +135,7 @@ class VRRPState(object): pass -class VRRPRouter(app_manager.RyuApp): +class VRRPRouter(app_manager.OSKenApp): _EVENTS = [vrrp_event.EventVRRPStateChanged] _CONSTRUCTORS = {} _STATE_MAP = {} # should be overrided by concrete class diff --git a/os_ken/services/protocols/vrrp/rpc_manager.py b/os_ken/services/protocols/vrrp/rpc_manager.py index b6aa3de1..48946d75 100644 --- a/os_ken/services/protocols/vrrp/rpc_manager.py +++ b/os_ken/services/protocols/vrrp/rpc_manager.py @@ -41,7 +41,7 @@ class Peer(object): self.queue.put((self, data)) -class RpcVRRPManager(app_manager.RyuApp): +class RpcVRRPManager(app_manager.OSKenApp): def __init__(self, *args, **kwargs): super(RpcVRRPManager, self).__init__(*args, **kwargs) self.CONF.register_opts([ diff --git a/os_ken/services/protocols/vrrp/sample_manager.py b/os_ken/services/protocols/vrrp/sample_manager.py index b8b16945..e633f23f 100644 --- a/os_ken/services/protocols/vrrp/sample_manager.py +++ b/os_ken/services/protocols/vrrp/sample_manager.py @@ -18,7 +18,7 @@ sample router manager. (un-)instantiate routers Usage example: -PYTHONPATH=. ./bin/os_ken-manager --verbose \ +PYTHONPATH=. ./bin/osken-manager --verbose \ os_ken.services.protocols.vrrp.manager \ os_ken.services.protocols.vrrp.dumper \ os_ken.services.protocols.vrrp.sample_manager @@ -30,7 +30,7 @@ from os_ken.services.protocols.vrrp import event as vrrp_event from os_ken.services.protocols.vrrp import sample_router -class RouterManager(app_manager.RyuApp): +class RouterManager(app_manager.OSKenApp): _ROUTER_CLASSES = { vrrp_event.VRRPInterfaceNetworkDevice: { 4: sample_router.RouterIPV4Linux, diff --git a/os_ken/services/protocols/vrrp/sample_router.py b/os_ken/services/protocols/vrrp/sample_router.py index 5e997c11..19c344f2 100644 --- a/os_ken/services/protocols/vrrp/sample_router.py +++ b/os_ken/services/protocols/vrrp/sample_router.py @@ -20,7 +20,7 @@ a template for router implementation that support VRRP Those routers needs to be created by someone else. sample_manager.routerManager is an example. Usage example: -PYTHONPATH=. ./bin/os_ken-manager --verbose \ +PYTHONPATH=. ./bin/osken-manager --verbose \ os_ken.services.protocols.vrrp.manager \ os_ken.services.protocols.vrrp.dumper \ os_ken.services.protocols.vrrp.sample_manager @@ -47,7 +47,7 @@ from os_ken.services.protocols.vrrp import event as vrrp_event from os_ken.services.protocols.vrrp import utils -class RouterBase(app_manager.RyuApp): +class RouterBase(app_manager.OSKenApp): def _router_name(self, config, interface): ip_version = 'ipv6' if config.is_ipv6 else 'ipv4' return '%s-%s-%d-%s' % (self.__class__.__name__, diff --git a/os_ken/services/protocols/zebra/client/zclient.py b/os_ken/services/protocols/zebra/client/zclient.py index 8d343f79..b0ca5650 100644 --- a/os_ken/services/protocols/zebra/client/zclient.py +++ b/os_ken/services/protocols/zebra/client/zclient.py @@ -22,7 +22,7 @@ import socket import struct from os_ken import cfg -from os_ken.base.app_manager import RyuApp +from os_ken.base.app_manager import OSKenApp from os_ken.lib import hub from os_ken.lib import ip from os_ken.lib.packet import zebra @@ -184,7 +184,7 @@ class ZServer(object): self.stop() -class ZClient(RyuApp): +class ZClient(OSKenApp): """ The base class for Zebra client application. """ diff --git a/os_ken/services/protocols/zebra/server/sample_dumper.py b/os_ken/services/protocols/zebra/server/sample_dumper.py index 8f164e78..ccf9c5f6 100644 --- a/os_ken/services/protocols/zebra/server/sample_dumper.py +++ b/os_ken/services/protocols/zebra/server/sample_dumper.py @@ -17,14 +17,14 @@ Sample Zebra Server application dumping received events. """ -from os_ken.base.app_manager import RyuApp +from os_ken.base.app_manager import OSKenApp from os_ken.controller.handler import set_ev_cls from os_ken.services.protocols.zebra import event from os_ken.services.protocols.zebra.server.zserver import ZServer from os_ken.services.protocols.zebra.server import event as zserver_event -class ZServerDumper(RyuApp): +class ZServerDumper(OSKenApp): _CONTEXTS = { "zserver": ZServer, } diff --git a/os_ken/services/protocols/zebra/server/zserver.py b/os_ken/services/protocols/zebra/server/zserver.py index a1799b7c..981dba19 100644 --- a/os_ken/services/protocols/zebra/server/zserver.py +++ b/os_ken/services/protocols/zebra/server/zserver.py @@ -25,7 +25,7 @@ import struct from os_ken import cfg from os_ken.base import app_manager -from os_ken.base.app_manager import RyuApp +from os_ken.base.app_manager import OSKenApp from os_ken.controller.handler import set_ev_cls from os_ken.lib import hub from os_ken.lib import ip @@ -178,7 +178,7 @@ def detect_address_family(host): return None -class ZServer(RyuApp): +class ZServer(OSKenApp): """ The base class for Zebra server application. """ diff --git a/os_ken/tests/integrated/bgp/base.py b/os_ken/tests/integrated/bgp/base.py index 44ae34aa..1ab2c398 100644 --- a/os_ken/tests/integrated/bgp/base.py +++ b/os_ken/tests/integrated/bgp/base.py @@ -48,7 +48,7 @@ class BgpSpeakerTestBase(unittest.TestCase): cls.q_img = 'osrg/quagga' cls.images.append(cls.q_img) - cls.r1 = os_kenbgp.RyuBGPContainer(name='r1', asn=64512, + cls.r1 = os_kenbgp.OSKenBGPContainer(name='r1', asn=64512, router_id='192.168.0.1', ctn_image_name=cls.r_img) cls.containers.append(cls.r1) diff --git a/os_ken/tests/integrated/bgp/base_ip6.py b/os_ken/tests/integrated/bgp/base_ip6.py index d0c9fcf8..0038d1ae 100644 --- a/os_ken/tests/integrated/bgp/base_ip6.py +++ b/os_ken/tests/integrated/bgp/base_ip6.py @@ -48,7 +48,7 @@ class BgpSpeakerTestBase(unittest.TestCase): cls.q_img = 'osrg/quagga' cls.images.append(cls.q_img) - cls.r1 = os_kenbgp.RyuBGPContainer(name='r1', asn=64512, + cls.r1 = os_kenbgp.OSKenBGPContainer(name='r1', asn=64512, router_id='192.168.0.1', ctn_image_name=cls.r_img) cls.containers.append(cls.r1) diff --git a/os_ken/tests/integrated/common/install_docker_test_pkg.sh b/os_ken/tests/integrated/common/install_docker_test_pkg.sh index a771dfc1..b6c8183e 100644 --- a/os_ken/tests/integrated/common/install_docker_test_pkg.sh +++ b/os_ken/tests/integrated/common/install_docker_test_pkg.sh @@ -1,9 +1,9 @@ #!/bin/bash set -ex -RYU_PATH=`dirname $0` +OSKEN_PATH=`dirname $0` -source ${RYU_PATH}/install_docker_test_pkg_common.sh +source ${OSKEN_PATH}/install_docker_test_pkg_common.sh function add_docker_aptline { sudo apt-get update diff --git a/os_ken/tests/integrated/common/install_docker_test_pkg_for_travis.sh b/os_ken/tests/integrated/common/install_docker_test_pkg_for_travis.sh index d8c3b499..5f2997e8 100644 --- a/os_ken/tests/integrated/common/install_docker_test_pkg_for_travis.sh +++ b/os_ken/tests/integrated/common/install_docker_test_pkg_for_travis.sh @@ -1,9 +1,9 @@ #!/bin/bash set -ex -RYU_PATH=`dirname $0` +OSKEN_PATH=`dirname $0` -source ${RYU_PATH}/install_docker_test_pkg_common.sh +source ${OSKEN_PATH}/install_docker_test_pkg_common.sh init_variables process_options "$@" diff --git a/os_ken/tests/integrated/common/ryubgp.py b/os_ken/tests/integrated/common/oskenbgp.py similarity index 91% rename from os_ken/tests/integrated/common/ryubgp.py rename to os_ken/tests/integrated/common/oskenbgp.py index c053877f..e209b74b 100644 --- a/os_ken/tests/integrated/common/ryubgp.py +++ b/os_ken/tests/integrated/common/oskenbgp.py @@ -24,16 +24,16 @@ from . import docker_base as base LOG = logging.getLogger(__name__) -class RyuBGPContainer(base.BGPContainer): +class OSKenBGPContainer(base.BGPContainer): WAIT_FOR_BOOT = 1 SHARED_VOLUME = '/etc/os_ken' def __init__(self, name, asn, router_id, ctn_image_name): - super(RyuBGPContainer, self).__init__(name, asn, router_id, + super(OSKenBGPContainer, self).__init__(name, asn, router_id, ctn_image_name) - self.RYU_CONF = os.path.join(self.config_dir, 'os_ken.conf') - self.SHARED_RYU_CONF = os.path.join(self.SHARED_VOLUME, 'os_ken.conf') + self.OSKEN_CONF = os.path.join(self.config_dir, 'os_ken.conf') + self.SHARED_OSKEN_CONF = os.path.join(self.SHARED_VOLUME, 'os_ken.conf') self.SHARED_BGP_CONF = os.path.join(self.SHARED_VOLUME, 'bgp_conf.py') self.shared_volumes.append((self.config_dir, self.SHARED_VOLUME)) @@ -42,7 +42,7 @@ class RyuBGPContainer(base.BGPContainer): c << '[DEFAULT]' c << 'verbose=True' c << 'log_file=/etc/os_ken/manager.log' - with open(self.RYU_CONF, 'w') as f: + with open(self.OSKEN_CONF, 'w') as f: LOG.info("[%s's new config]" % self.name) LOG.info(str(c)) f.writelines(str(c)) @@ -159,7 +159,7 @@ class RyuBGPContainer(base.BGPContainer): results = self.exec_on_ctn('ps ax') running = False for line in results.split('\n')[1:]: - if 'os_ken-manager' in line: + if 'osken-manager' in line: running = True return running @@ -172,8 +172,8 @@ class RyuBGPContainer(base.BGPContainer): try_times = 3 else: try_times = 1 - cmd = "os_ken-manager --verbose " - cmd += "--config-file %s " % self.SHARED_RYU_CONF + cmd = "osken-manager --verbose " + cmd += "--config-file %s " % self.SHARED_OSKEN_CONF cmd += "--bgp-app-config-file %s " % self.SHARED_BGP_CONF cmd += "os_ken.services.protocols.bgp.application" for _ in range(try_times): @@ -194,7 +194,7 @@ class RyuBGPContainer(base.BGPContainer): else: try_times = 1 for _ in range(try_times): - cmd = '/usr/bin/pkill os_ken-manager -SIGTERM' + cmd = '/usr/bin/pkill osken-manager -SIGTERM' self.exec_on_ctn(cmd) if not self.is_running_os_ken(): result = True @@ -203,7 +203,7 @@ class RyuBGPContainer(base.BGPContainer): return result def run(self, wait=False, w_time=WAIT_FOR_BOOT): - w_time = super(RyuBGPContainer, + w_time = super(OSKenBGPContainer, self).run(wait=wait, w_time=self.WAIT_FOR_BOOT) return w_time diff --git a/os_ken/tests/integrated/run_tests_with_ovs12.py b/os_ken/tests/integrated/run_tests_with_ovs12.py index df7584d8..79c4bd15 100755 --- a/os_ken/tests/integrated/run_tests_with_ovs12.py +++ b/os_ken/tests/integrated/run_tests_with_ovs12.py @@ -26,10 +26,10 @@ from mininet.net import Mininet from mininet.node import RemoteController, OVSKernelSwitch TIMEOUT = 60 -RYU_HOST = '127.0.0.1' -RYU_PORT = 6633 +OSKEN_HOST = '127.0.0.1' +OSKEN_PORT = 6633 PYTHON_BIN = '.venv/bin/python' -RYU_MGR = './bin/os_ken-manager' +OSKEN_MGR = './bin/osken-manager' class OVS12KernelSwitch(OVSKernelSwitch): @@ -46,7 +46,7 @@ class TestWithOVS12(unittest.TestCase): def setUpClass(cls): cls.mn = Mininet() c = cls.mn.addController(controller=RemoteController, - ip=RYU_HOST, port=RYU_PORT) + ip=OSKEN_HOST, port=OSKEN_PORT) c.start() s1 = cls.mn.addSwitch('s1', cls=OVS12KernelSwitch) @@ -87,19 +87,19 @@ class TestWithOVS12(unittest.TestCase): pass def _run_os_ken_manager_and_check_output(self, app): - cmd = [PYTHON_BIN, RYU_MGR, app] + cmd = [PYTHON_BIN, OSKEN_MGR, app] p = Popen(cmd, stdout=PIPE, stderr=STDOUT) while True: if p.poll() is not None: - raise Exception('Another os_ken-manager already running?') + raise Exception('Another osken-manager already running?') line = p.stdout.readline().strip() if line == '': time.sleep(1) continue - print("os_ken-manager: %s" % line) + print("osken-manager: %s" % line) if line.find('TEST_FINISHED') != -1: ok_(line.find('Completed=[True]') != -1) p.terminate() diff --git a/os_ken/tests/integrated/test_of_config.py b/os_ken/tests/integrated/test_of_config.py index ac574061..d251a14e 100644 --- a/os_ken/tests/integrated/test_of_config.py +++ b/os_ken/tests/integrated/test_of_config.py @@ -33,7 +33,7 @@ Then run linc # rel/linc/bin/linc console Then run os_ken -# PYTHONPATH=. ./bin/os_ken-manager --verbose \ +# PYTHONPATH=. ./bin/osken-manager --verbose \ os_ken/tests/integrated/test_of_config.py @@ -214,7 +214,7 @@ def _get_schema(): return lxml.etree.XMLSchema(file=file_name) -class OFConfigClient(app_manager.RyuApp): +class OFConfigClient(app_manager.OSKenApp): def __init__(self, *args, **kwargs): super(OFConfigClient, self).__init__(*args, **kwargs) self.switch = capable_switch.OFCapableSwitch( diff --git a/os_ken/tests/integrated/test_vrrp_linux_multi.py b/os_ken/tests/integrated/test_vrrp_linux_multi.py index 4de530c4..7e360322 100644 --- a/os_ken/tests/integrated/test_vrrp_linux_multi.py +++ b/os_ken/tests/integrated/test_vrrp_linux_multi.py @@ -16,18 +16,18 @@ r""" Usage: -PYTHONPATH=. ./bin/os_ken-manager --verbose \ +PYTHONPATH=. ./bin/osken-manager --verbose \ os_ken.services.protocols.vrrp.dumper \ os_ken.services.protocols.vrrp.sample_manager.py \ os_ken.tests.integrated.test_vrrp_linux_multi \ os_ken.app.rest os_ken.services.protocols.vrrp.dumper is optional. -os_ken.app.rest is merely to prevent os_ken-manager from exiting. +os_ken.app.rest is merely to prevent osken-manager from exiting. ---------------- /--<--veth0-->| | - Ryu | linux bridge |<--veth2--> command to generate packets + OSKen | linux bridge |<--veth2--> command to generate packets \--<--veth1-->| (vrrpbr) | ---------------- diff --git a/os_ken/tests/integrated/test_vrrp_multi.py b/os_ken/tests/integrated/test_vrrp_multi.py index 93f073b1..ea75ad92 100644 --- a/os_ken/tests/integrated/test_vrrp_multi.py +++ b/os_ken/tests/integrated/test_vrrp_multi.py @@ -16,7 +16,7 @@ r""" Usage: -PYTHONPATH=. ./bin/os_ken-manager --verbose \ +PYTHONPATH=. ./bin/osken-manager --verbose \ os_ken.topology.switches \ os_ken.tests.integrated.test_vrrp_multi \ os_ken.services.protocols.vrrp.dumper @@ -25,7 +25,7 @@ os_ken.services.protocols.vrrp.dumper is optional. +---+ ---------------- /--|OVS|<--veth-->| | - Ryu +---+ | linux bridge |<--veth--> command to generate packets + OSKen +---+ | linux bridge |<--veth--> command to generate packets \--|OVS|<--veth-->| | +---+ ---------------- diff --git a/os_ken/tests/integrated/tester.py b/os_ken/tests/integrated/tester.py index 6f533831..4d46bc3a 100644 --- a/os_ken/tests/integrated/tester.py +++ b/os_ken/tests/integrated/tester.py @@ -41,7 +41,7 @@ LOG_TEST_FINISH = 'TEST_FINISHED: Completed=[%s] (OK=%s NG=%s SKIP=%s)' LOG_TEST_UNSUPPORTED = 'SKIP (unsupported)' -class TestFlowBase(app_manager.RyuApp): +class TestFlowBase(app_manager.OSKenApp): """ To run the tests is required for the following pair of functions. 1. test_() diff --git a/os_ken/tests/integrated/vrrp_common.py b/os_ken/tests/integrated/vrrp_common.py index e76cfa2a..65a58082 100644 --- a/os_ken/tests/integrated/vrrp_common.py +++ b/os_ken/tests/integrated/vrrp_common.py @@ -32,7 +32,7 @@ _PRIMARY_IP_ADDRESS0 = '10.0.0.2' _PRIMARY_IP_ADDRESS1 = '10.0.0.3' -class VRRPCommon(app_manager.RyuApp): +class VRRPCommon(app_manager.OSKenApp): _IFNAME0 = None _IFNAME1 = None diff --git a/os_ken/tests/mininet/l2/mpls/PopMPLS_mpls.mn b/os_ken/tests/mininet/l2/mpls/PopMPLS_mpls.mn index 45fa9f96..3ad0df4f 100644 --- a/os_ken/tests/mininet/l2/mpls/PopMPLS_mpls.mn +++ b/os_ken/tests/mininet/l2/mpls/PopMPLS_mpls.mn @@ -1,6 +1,6 @@ TEST_NAME=MPLS-PopMPLS DUMP_HOST=h2 DUMP_IF=h2-eth0 -RYU_APP=test_mpls +OSKEN_APP=test_mpls PCAP_MZ="-t tcp -M 80 -P $TEST_NAME -c 3 -r" PCAP_FILTER="! mpls && ip.proto==TCP" diff --git a/os_ken/tests/mininet/l2/mpls/PushMPLS_ip.mn b/os_ken/tests/mininet/l2/mpls/PushMPLS_ip.mn index 2634e788..6e0a53b5 100644 --- a/os_ken/tests/mininet/l2/mpls/PushMPLS_ip.mn +++ b/os_ken/tests/mininet/l2/mpls/PushMPLS_ip.mn @@ -1,6 +1,6 @@ TEST_NAME=IP-PushMPLS DUMP_HOST=h2 DUMP_IF=h2-eth0 -RYU_APP=test_mpls +OSKEN_APP=test_mpls PCAP_MZ="-t tcp -P $TEST_NAME -c 3 -b 00:00:00:00:00:02" PCAP_FILTER="mpls && ip.proto==TCP" diff --git a/os_ken/tests/mininet/l2/mpls/PushMPLS_mpls.mn b/os_ken/tests/mininet/l2/mpls/PushMPLS_mpls.mn index 5ac1702f..580519c7 100644 --- a/os_ken/tests/mininet/l2/mpls/PushMPLS_mpls.mn +++ b/os_ken/tests/mininet/l2/mpls/PushMPLS_mpls.mn @@ -1,6 +1,6 @@ TEST_NAME=MPLS-PushMPLS DUMP_HOST=h2 DUMP_IF=h2-eth0 -RYU_APP=test_mpls +OSKEN_APP=test_mpls PCAP_MZ="-t tcp -M 100 -P $TEST_NAME -c 3 -r" PCAP_FILTER="mpls.label==100 && mpls.label==200 && ip.proto==TCP" diff --git a/os_ken/tests/mininet/l2/mpls/test_mpls.py b/os_ken/tests/mininet/l2/mpls/test_mpls.py index 4b44a2fe..7f7dc99b 100644 --- a/os_ken/tests/mininet/l2/mpls/test_mpls.py +++ b/os_ken/tests/mininet/l2/mpls/test_mpls.py @@ -29,7 +29,7 @@ from os_ken.lib.mac import haddr_to_str LOG = logging.getLogger(__name__) -class RunTestMininet(app_manager.RyuApp): +class RunTestMininet(app_manager.OSKenApp): _CONTEXTS = {'dpset': dpset.DPSet} OFP_VERSIONS = [ofproto_v1_2.OFP_VERSION] diff --git a/os_ken/tests/mininet/l2/vlan/PopVLAN_vlan.mn b/os_ken/tests/mininet/l2/vlan/PopVLAN_vlan.mn index f1d1c6dd..771e6f7b 100644 --- a/os_ken/tests/mininet/l2/vlan/PopVLAN_vlan.mn +++ b/os_ken/tests/mininet/l2/vlan/PopVLAN_vlan.mn @@ -1,6 +1,6 @@ TEST_NAME=VLAN-PopVLAN DUMP_HOST=h2 DUMP_IF=h2-eth0 -RYU_APP=test_vlan +OSKEN_APP=test_vlan PCAP_MZ="-t tcp -Q 8 -P $TEST_NAME -c 3 -r" PCAP_FILTER="! vlan && ip.proto==TCP" diff --git a/os_ken/tests/mininet/l2/vlan/PopVLAN_vlanvlan.mn b/os_ken/tests/mininet/l2/vlan/PopVLAN_vlanvlan.mn index 90444a75..721744ac 100644 --- a/os_ken/tests/mininet/l2/vlan/PopVLAN_vlanvlan.mn +++ b/os_ken/tests/mininet/l2/vlan/PopVLAN_vlanvlan.mn @@ -1,6 +1,6 @@ TEST_NAME=VLAN:VLAN-PopVLAN DUMP_HOST=h2 DUMP_IF=h2-eth0 -RYU_APP=test_vlan +OSKEN_APP=test_vlan PCAP_MZ="-t tcp -Q 100,99 -P $TEST_NAME -c 3 -r" PCAP_FILTER="vlan.id!=100 && vlan.id==99 && ip.proto==TCP" diff --git a/os_ken/tests/mininet/l2/vlan/PushVLAN_icmp.mn b/os_ken/tests/mininet/l2/vlan/PushVLAN_icmp.mn index 439ad233..1fc5d445 100644 --- a/os_ken/tests/mininet/l2/vlan/PushVLAN_icmp.mn +++ b/os_ken/tests/mininet/l2/vlan/PushVLAN_icmp.mn @@ -1,6 +1,6 @@ TEST_NAME=ICMP-PushVLAN DUMP_HOST=h2 DUMP_IF=h2-eth0 -RYU_APP=test_vlan +OSKEN_APP=test_vlan PCAP_MZ="-t icmp ping -P $TEST_NAME -c 3 -r -b 00:00:00:00:00:02" PCAP_FILTER="vlan && icmp.type==8" diff --git a/os_ken/tests/mininet/l2/vlan/test_vlan.py b/os_ken/tests/mininet/l2/vlan/test_vlan.py index c92a1ec8..9565d5fe 100644 --- a/os_ken/tests/mininet/l2/vlan/test_vlan.py +++ b/os_ken/tests/mininet/l2/vlan/test_vlan.py @@ -30,7 +30,7 @@ from os_ken.lib.mac import haddr_to_str LOG = logging.getLogger(__name__) -class RunTestMininet(app_manager.RyuApp): +class RunTestMininet(app_manager.OSKenApp): _CONTEXTS = {'dpset': dpset.DPSet} OFP_VERSIONS = [ofproto_v1_2.OFP_VERSION] diff --git a/os_ken/tests/mininet/l3/icmp/ICMP_ping.mn b/os_ken/tests/mininet/l3/icmp/ICMP_ping.mn index f558693d..db964b83 100644 --- a/os_ken/tests/mininet/l3/icmp/ICMP_ping.mn +++ b/os_ken/tests/mininet/l3/icmp/ICMP_ping.mn @@ -1,6 +1,6 @@ TEST_NAME=ICMP-Req DUMP_HOST=h2 DUMP_IF=h2-eth0 -RYU_APP=test_icmp +OSKEN_APP=test_icmp PCAP_MZ="-t icmp ping -c 3 -r -b 00:00:00:00:00:00" PCAP_FILTER="icmp.type==8" diff --git a/os_ken/tests/mininet/l3/icmp/ICMP_reply.mn b/os_ken/tests/mininet/l3/icmp/ICMP_reply.mn index eb6bc8b6..d6529b55 100644 --- a/os_ken/tests/mininet/l3/icmp/ICMP_reply.mn +++ b/os_ken/tests/mininet/l3/icmp/ICMP_reply.mn @@ -1,6 +1,6 @@ TEST_NAME=ICMP-Reply DUMP_HOST=h1 DUMP_IF=h1-eth0 -RYU_APP=test_icmp +OSKEN_APP=test_icmp PCAP_MZ="-t icmp ping -c 3 -r -B h2" PCAP_FILTER="icmp.type==0" diff --git a/os_ken/tests/mininet/l3/icmp/test_icmp.py b/os_ken/tests/mininet/l3/icmp/test_icmp.py index 51660ae6..1d7b88c0 100644 --- a/os_ken/tests/mininet/l3/icmp/test_icmp.py +++ b/os_ken/tests/mininet/l3/icmp/test_icmp.py @@ -28,7 +28,7 @@ from os_ken.lib.mac import haddr_to_str LOG = logging.getLogger(__name__) -class RunTestMininet(app_manager.RyuApp): +class RunTestMininet(app_manager.OSKenApp): _CONTEXTS = {'dpset': dpset.DPSet} OFP_VERSIONS = [ofproto_v1_2.OFP_VERSION] diff --git a/os_ken/tests/mininet/l3/ip_ttl/DecNwTtl.mn b/os_ken/tests/mininet/l3/ip_ttl/DecNwTtl.mn index 60cd4623..d14f79eb 100644 --- a/os_ken/tests/mininet/l3/ip_ttl/DecNwTtl.mn +++ b/os_ken/tests/mininet/l3/ip_ttl/DecNwTtl.mn @@ -1,6 +1,6 @@ TEST_NAME=DecNwTtl DUMP_HOST=h2 DUMP_IF=h2-eth0 -RYU_APP=test_ip_ttl +OSKEN_APP=test_ip_ttl PCAP_MZ="-t icmp ttl=64 -P $TEST_NAME -c 3 -b 00:00:00:00:00:02" PCAP_FILTER="icmp && ip.ttl==63" diff --git a/os_ken/tests/mininet/l3/ip_ttl/test_ip_ttl.py b/os_ken/tests/mininet/l3/ip_ttl/test_ip_ttl.py index 11522547..7d8b67d7 100644 --- a/os_ken/tests/mininet/l3/ip_ttl/test_ip_ttl.py +++ b/os_ken/tests/mininet/l3/ip_ttl/test_ip_ttl.py @@ -29,7 +29,7 @@ from os_ken.lib.mac import haddr_to_str LOG = logging.getLogger(__name__) -class RunTestMininet(app_manager.RyuApp): +class RunTestMininet(app_manager.OSKenApp): _CONTEXTS = {'dpset': dpset.DPSet} OFP_VERSIONS = [ofproto_v1_2.OFP_VERSION] diff --git a/os_ken/tests/mininet/packet_lib/arp/ARP_gratuitous.mn b/os_ken/tests/mininet/packet_lib/arp/ARP_gratuitous.mn index ca7a30ae..856c019f 100644 --- a/os_ken/tests/mininet/packet_lib/arp/ARP_gratuitous.mn +++ b/os_ken/tests/mininet/packet_lib/arp/ARP_gratuitous.mn @@ -2,6 +2,6 @@ TEST_NAME=GARP-Request DUMP_HOST=h1 DUMP_IF=h1-eth0 -RYU_APP=test_arp +OSKEN_APP=test_arp PCAP_MZ="-S" PCAP_FILTER="arp.isgratuitous && arp.src.proto_ipv4==10.0.0.100 && arp.src.hw_mac==fe:ee:ee:ee:ee:ef" diff --git a/os_ken/tests/mininet/packet_lib/arp/ARP_reply.mn b/os_ken/tests/mininet/packet_lib/arp/ARP_reply.mn index 3969cba1..7d8c74cf 100644 --- a/os_ken/tests/mininet/packet_lib/arp/ARP_reply.mn +++ b/os_ken/tests/mininet/packet_lib/arp/ARP_reply.mn @@ -2,6 +2,6 @@ TEST_NAME=ARP-Reply DUMP_HOST=h1 DUMP_IF=h1-eth0 -RYU_APP=test_arp +OSKEN_APP=test_arp PCAP_MZ="-t arp request,targetip=10.0.0.100 -c 3 -r" PCAP_FILTER="arp.opcode==reply && arp.src.proto_ipv4==10.0.0.100 && arp.src.hw_mac==fe:ee:ee:ee:ee:ef" diff --git a/os_ken/tests/mininet/packet_lib/arp/ARP_request.mn b/os_ken/tests/mininet/packet_lib/arp/ARP_request.mn index b44450ef..b06b4e20 100644 --- a/os_ken/tests/mininet/packet_lib/arp/ARP_request.mn +++ b/os_ken/tests/mininet/packet_lib/arp/ARP_request.mn @@ -2,6 +2,6 @@ TEST_NAME=ARP-Request DUMP_HOST=h1 DUMP_IF=h1-eth0 -RYU_APP=test_arp +OSKEN_APP=test_arp PCAP_MZ="-t arp request,targetip=10.0.0.1" PCAP_FILTER="arp.opcode==request && arp.src.proto_ipv4==10.0.0.100 && arp.dst.proto_ipv4==10.0.0.1 && arp.src.hw_mac==fe:ee:ee:ee:ee:ef" diff --git a/os_ken/tests/mininet/packet_lib/arp/test_arp.py b/os_ken/tests/mininet/packet_lib/arp/test_arp.py index 57164d0c..7cbb7593 100644 --- a/os_ken/tests/mininet/packet_lib/arp/test_arp.py +++ b/os_ken/tests/mininet/packet_lib/arp/test_arp.py @@ -37,16 +37,16 @@ from os_ken.lib.packet import icmp LOG = logging.getLogger(__name__) -class RunTestMininet(app_manager.RyuApp): +class RunTestMininet(app_manager.OSKenApp): _CONTEXTS = {'dpset': dpset.DPSet} OFP_VERSIONS = [ofproto_v1_2.OFP_VERSION] ZERO_MAC = mac.haddr_to_bin('00:00:00:00:00:00') BROADCAST_MAC = mac.haddr_to_bin('ff:ff:ff:ff:ff:ff') - RYU_MAC = mac.haddr_to_bin('fe:ee:ee:ee:ee:ef') + OSKEN_MAC = mac.haddr_to_bin('fe:ee:ee:ee:ee:ef') HOST_MAC = mac.haddr_to_bin('00:00:00:00:00:01') - RYU_IP = int(netaddr.IPAddress('10.0.0.100')) + OSKEN_IP = int(netaddr.IPAddress('10.0.0.100')) HOST_IP = int(netaddr.IPAddress('10.0.0.1')) def __init__(self, *args, **kwargs): @@ -87,7 +87,7 @@ class RunTestMininet(app_manager.RyuApp): return protocols def _build_ether(self, ethertype, dst_mac=HOST_MAC): - e = ethernet.ethernet(dst_mac, self.RYU_MAC, ethertype) + e = ethernet.ethernet(dst_mac, self.OSKEN_MAC, ethertype) return e def _build_arp(self, opcode, dst_ip=HOST_IP): @@ -100,7 +100,7 @@ class RunTestMininet(app_manager.RyuApp): e = self._build_ether(ether.ETH_TYPE_ARP, _eth_dst_mac) a = arp.arp(hwtype=1, proto=ether.ETH_TYPE_IP, hlen=6, plen=4, - opcode=opcode, src_mac=self.RYU_MAC, src_ip=self.RYU_IP, + opcode=opcode, src_mac=self.OSKEN_MAC, src_ip=self.OSKEN_IP, dst_mac=_arp_dst_mac, dst_ip=dst_ip) p = packet.Packet() p.add_protocol(e) @@ -114,7 +114,7 @@ class RunTestMininet(app_manager.RyuApp): ip = ipv4.ipv4(version=4, header_length=5, tos=0, total_length=84, identification=0, flags=0, offset=0, ttl=64, proto=inet.IPPROTO_ICMP, csum=0, - src=self.RYU_IP, dst=self.HOST_IP) + src=self.OSKEN_IP, dst=self.HOST_IP) ping = icmp.icmp(_type, code=0, csum=0, data=echo) p = packet.Packet() @@ -125,7 +125,7 @@ class RunTestMininet(app_manager.RyuApp): return p def _garp(self): - p = self._build_arp(arp.ARP_REQUEST, self.RYU_IP) + p = self._build_arp(arp.ARP_REQUEST, self.OSKEN_IP) return p.data def _arp_request(self): @@ -159,7 +159,7 @@ class RunTestMininet(app_manager.RyuApp): dst_ip = str(netaddr.IPAddress(p_arp.dst_ip)) if p_arp.opcode == arp.ARP_REQUEST: LOG.debug("--- PacketIn: ARP_Request: %s->%s", src_ip, dst_ip) - if p_arp.dst_ip == self.RYU_IP: + if p_arp.dst_ip == self.OSKEN_IP: LOG.debug("--- send Pkt: ARP_Reply") data = self._arp_reply() self._send_msg(dp, data) @@ -180,7 +180,7 @@ class RunTestMininet(app_manager.RyuApp): dst = str(netaddr.IPAddress(p_ipv4.dst)) if p_icmp.type == icmp.ICMP_ECHO_REQUEST: LOG.debug("--- PacketIn: Echo_Request: %s->%s", src, dst) - if p_ipv4.dst == self.RYU_IP: + if p_ipv4.dst == self.OSKEN_IP: LOG.debug("--- send Pkt: Echo_Reply") echo = p_icmp.data echo.data = bytearray(echo.data) diff --git a/os_ken/tests/mininet/run_mnet-test.sh b/os_ken/tests/mininet/run_mnet-test.sh index c1ecbe23..b0884800 100755 --- a/os_ken/tests/mininet/run_mnet-test.sh +++ b/os_ken/tests/mininet/run_mnet-test.sh @@ -18,7 +18,7 @@ RTN=0 usage() { echo "Usage: $0 [OPTION] [TEST DIR or FILE]..." echo "" - echo "Run Ryu's test in mininet" + echo "Run OSKen's test in mininet" echo "ex.) $ $0 l2 l3/icmp/ICMP_ping.mn" echo "" echo "Options:" @@ -33,8 +33,8 @@ set_env() { DUMP_IF=h2-eth0 TEST_NAME= DUMP_FILE= - RYU_APP= - RYU_LOG= + OSKEN_APP= + OSKEN_LOG= PCAP_MZ= PCAP_FILE= PCAP_FILTER= @@ -85,17 +85,17 @@ ovs_cache_hit() { expr `sudo ovs-dpctl show|sed -n 's|lookups: hit:||gp'|awk '{print $1}'` - ${1:-0} } -# starting ryu-manager -run_ryu() { +# starting osken-manager +run_osken() { ERRSTAT=0 - ERRTAG="run_ryu() :" + ERRTAG="run_osken() :" - echo "Inf: RYU_APP=$RYU_APP" - echo "Inf: ryu-manager starting..." - ryu-manager --verbose $RYU_APP 2>$DUMP_DIR/$RYU_LOG & - PID_RYU=$! + echo "Inf: OSKEN_APP=$OSKEN_APP" + echo "Inf: osken-manager starting..." + osken-manager --verbose $OSKEN_APP 2>$DUMP_DIR/$OSKEN_LOG & + PID_OSKEN=$! sleep 1 - [ -d /proc/$PID_RYU ] || err $ERRTAG "failed to start ryu-manager." + [ -d /proc/$PID_OSKEN ] || err $ERRTAG "failed to start osken-manager." return $ERRSTAT } @@ -109,7 +109,7 @@ run_mn() { # cleaning after mininet clean_mn() { - wait_ryu + wait_osken rm -f $MN_PRE_FILE $MN_POST_FILE } @@ -129,10 +129,10 @@ check() { echo "TEST ${TEST_NAME} : $RESULT $REASON" } -# stoping ryu-manager -wait_ryu() { - kill -2 $PID_RYU - wait $PID_RYU +# stoping osken-manager +wait_osken() { + kill -2 $PID_OSKEN + wait $PID_OSKEN } # test-main @@ -143,7 +143,7 @@ test_mn() { [ "$CACHE_HIT" ] && CACHE_HIT=`ovs_cache_hit 0` mn_pre mn_post - run_ryu; [ $? -ne 0 ] && return 1 + run_osken; [ $? -ne 0 ] && return 1 run_mn; [ $? -ne 0 ] && return 1 check @@ -171,12 +171,12 @@ mnfile_check() { . $file || err $ERRTAG "failed to include $file" # parameter check - [ "$RYU_APP" ] || err $ERRTAG: "RYU_APP is not defined" + [ "$OSKEN_APP" ] || err $ERRTAG: "OSKEN_APP is not defined" [ "$PCAP_FILE" -o "$PCAP_MZ" ] || err $ERRTAG: "PCAP_FILE or PCAP_MZ is not defined" [ "$PCAP_FILTER" ] || err $ERRTAG "PCAP_FILTER is not defined" [ "$TEST_NAME" ] || TEST_NAME=$test [ "$DUMP_FILE" ] || DUMP_FILE=$test.dump - [ "$RYU_LOG" ] || RYU_LOG=ryu-manager.$test.log + [ "$OSKEN_LOG" ] || OSKEN_LOG=osken-manager.$test.log [ $ERRSTAT -ne 0 ] && return $ERRSTAT # pcap check (pcap-file or mz-option) @@ -189,8 +189,8 @@ mnfile_check() { fi [ $ERRSTAT -ne 0 ] && return $ERRSTAT - # ryu-app check - [ -r $TEST_DIR/$RYU_APP -o -r $TEST_DIR/${RYU_APP}.py ] && RYU_APP=$TEST_DIR/$RYU_APP + # osken-app check + [ -r $TEST_DIR/$OSKEN_APP -o -r $TEST_DIR/${OSKEN_APP}.py ] && OSKEN_APP=$TEST_DIR/$OSKEN_APP return $ERRSTAT } diff --git a/os_ken/tests/packet_data_generator/src/x1.erl b/os_ken/tests/packet_data_generator/src/x1.erl index 6935e021..58fc657b 100644 --- a/os_ken/tests/packet_data_generator/src/x1.erl +++ b/os_ken/tests/packet_data_generator/src/x1.erl @@ -46,7 +46,7 @@ x() -> #ofp_match{ wildcards = 16#3ffff7, dl_dst = <<"\362\v\244}\370\352">>, - % XXX ryu and flower have different defaults for the + % XXX os-ken and flower have different defaults for the % followin fields. in_port = 0, dl_src = <<0:6/unit:8>> diff --git a/os_ken/tests/packet_data_generator2/README b/os_ken/tests/packet_data_generator2/README index 3ad19301..a17d0549 100644 --- a/os_ken/tests/packet_data_generator2/README +++ b/os_ken/tests/packet_data_generator2/README @@ -4,8 +4,8 @@ unit tests [2]. As we have the generated files in the repository, you don't need to build this program unless you want to (re-)generate the files for some reasons, typically adding new test cases. -[1] ryu/tests/packet_data/of*/libofproto-*.packet -[2] ryu.tests.unit.ofproto.test_parser +[1] os_ken/tests/packet_data/of*/libofproto-*.packet +[2] os_ken.tests.unit.ofproto.test_parser The program requires libofproto library provided by Open vSwitch. It's a little tricky to build because Open vSwitch distribution diff --git a/os_ken/tests/switch/tester.py b/os_ken/tests/switch/tester.py index ef21be8b..8c5e02f0 100644 --- a/os_ken/tests/switch/tester.py +++ b/os_ken/tests/switch/tester.py @@ -32,7 +32,7 @@ from os_ken.base import app_manager from os_ken.controller import handler from os_ken.controller import ofp_event from os_ken.controller.handler import set_ev_cls -from os_ken.exception import RyuException +from os_ken.exception import OSKenException from os_ken.lib import dpid as dpid_lib from os_ken.lib import hub from os_ken.lib import stringify @@ -173,7 +173,7 @@ STATE_DISCONNECTED = 99 # Test result. TEST_OK = 'OK' TEST_ERROR = 'ERROR' -RYU_INTERNAL_ERROR = '- (Ryu internal error.)' +OSKEN_INTERNAL_ERROR = '- (OSKen internal error.)' TEST_FILE_ERROR = '%(file)s : Test file format error (%(detail)s)' NO_TEST_FILE = 'Test file (*.json) is not found.' INVALID_PATH = '%(path)s : No such file or directory.' @@ -255,7 +255,7 @@ MSG = {STATE_INIT_FLOW: ERR_MSG = 'OFPErrorMsg[type=0x%02x, code=0x%02x]' -class TestMessageBase(RyuException): +class TestMessageBase(OSKenException): def __init__(self, state, message_type, **argv): msg = MSG[state][message_type] % argv super(TestMessageBase, self).__init__(msg=msg) @@ -282,7 +282,7 @@ class TestError(TestMessageBase): super(TestError, self).__init__(state, ERROR, **argv) -class OfTester(app_manager.RyuApp): +class OfTester(app_manager.OSKenApp): """ OpenFlow Switch Tester. """ tester_ver = None @@ -555,7 +555,7 @@ class OfTester(app_manager.RyuApp): self.logger.info(' %-100s %s', test.description, result[0]) if 1 < len(result): self.logger.info(' %s', result[1]) - if result[1] == RYU_INTERNAL_ERROR\ + if result[1] == OSKEN_INTERNAL_ERROR\ or result == 'An unknown exception': self.logger.error(traceback.format_exc()) @@ -1041,7 +1041,7 @@ class OfTester(app_manager.RyuApp): measured_value = increased_bytes unit = 'kbps' else: - raise RyuException( + raise OSKenException( 'An invalid key exists that is neither "%s" nor "%s".' % (KEY_KBPS, KEY_PKTPS)) @@ -1071,7 +1071,7 @@ class OfTester(app_manager.RyuApp): self.waiter.wait() except hub.Timeout as t: if t is not timer: - raise RyuException('Internal error. Not my timeout.') + raise OSKenException('Internal error. Not my timeout.') timeout = True finally: timer.cancel() diff --git a/os_ken/tests/test_lib.py b/os_ken/tests/test_lib.py index 344c30a2..f80ea10a 100644 --- a/os_ken/tests/test_lib.py +++ b/os_ken/tests/test_lib.py @@ -140,7 +140,7 @@ class _NullColorizer(object): self.stream.write(text) -class RyuTestResult(result.TextTestResult): +class OSKenTestResult(result.TextTestResult): def __init__(self, *args, **kw): result.TextTestResult.__init__(self, *args, **kw) self._last_case = None @@ -231,9 +231,9 @@ class RyuTestResult(result.TextTestResult): self.stream.flush() -class RyuTestRunner(core.TextTestRunner): +class OSKenTestRunner(core.TextTestRunner): def _makeResult(self): - return RyuTestResult(self.stream, + return OSKenTestResult(self.stream, self.descriptions, self.verbosity, self.config) @@ -255,7 +255,7 @@ def run_tests(c=None): if not c: return True - runner = RyuTestRunner(stream=c.stream, + runner = OSKenTestRunner(stream=c.stream, verbosity=c.verbosity, config=c) return not core.run(config=c, testRunner=runner) diff --git a/os_ken/tests/unit/app/test_tester.py b/os_ken/tests/unit/app/test_tester.py index fc7ea791..8d186f37 100644 --- a/os_ken/tests/unit/app/test_tester.py +++ b/os_ken/tests/unit/app/test_tester.py @@ -47,7 +47,7 @@ from os_ken.base import app_manager from os_ken.controller import handler from os_ken.controller import ofp_event from os_ken.controller.handler import set_ev_cls -from os_ken.exception import RyuException +from os_ken.exception import OSKenException from os_ken.lib import dpid as dpid_lib from os_ken.lib import hub from os_ken.lib import stringify diff --git a/os_ken/tests/unit/cmd/dummy_app.py b/os_ken/tests/unit/cmd/dummy_app.py index 168d8843..d7066b6c 100644 --- a/os_ken/tests/unit/cmd/dummy_app.py +++ b/os_ken/tests/unit/cmd/dummy_app.py @@ -17,5 +17,5 @@ from os_ken.base import app_manager -class DummyApp(app_manager.RyuApp): +class DummyApp(app_manager.OSKenApp): pass diff --git a/os_ken/tests/unit/cmd/dummy_openflow_app.py b/os_ken/tests/unit/cmd/dummy_openflow_app.py index 4945c0d9..ea1e9595 100644 --- a/os_ken/tests/unit/cmd/dummy_openflow_app.py +++ b/os_ken/tests/unit/cmd/dummy_openflow_app.py @@ -18,5 +18,5 @@ from os_ken.base import app_manager from os_ken.ofproto import ofproto_v1_3 -class DummyOpenFlowApp(app_manager.RyuApp): +class DummyOpenFlowApp(app_manager.OSKenApp): OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION] diff --git a/os_ken/tests/unit/cmd/test_manager.py b/os_ken/tests/unit/cmd/test_manager.py index c4879ab5..4a1e4f48 100644 --- a/os_ken/tests/unit/cmd/test_manager.py +++ b/os_ken/tests/unit/cmd/test_manager.py @@ -30,7 +30,7 @@ from os_ken.cmd.manager import main class Test_Manager(unittest.TestCase): - """Test os_ken-manager command + """Test osken-manager command """ def __init__(self, methodName): @@ -43,33 +43,33 @@ class Test_Manager(unittest.TestCase): pass @raises(SystemExit) - @mock.patch('sys.argv', new=['os_ken-manager', '--version']) + @mock.patch('sys.argv', new=['osken-manager', '--version']) def test_version(self): main() @raises(SystemExit) - @mock.patch('sys.argv', new=['os_ken-manager', '--help']) + @mock.patch('sys.argv', new=['osken-manager', '--help']) def test_help(self): main() @staticmethod def _reset_globals(): # hack to reset globals like SERVICE_BRICKS. - # assumption: this is the only test which actually starts RyuApp. + # assumption: this is the only test which actually starts OSKenApp. import os_ken.base.app_manager import os_ken.ofproto.ofproto_protocol reload(os_ken.base.app_manager) reload(os_ken.ofproto.ofproto_protocol) - @mock.patch('sys.argv', new=['os_ken-manager', '--verbose', + @mock.patch('sys.argv', new=['osken-manager', '--verbose', 'os_ken.tests.unit.cmd.dummy_app']) def test_no_services(self): self._reset_globals() main() self._reset_globals() - @mock.patch('sys.argv', new=['os_ken-manager', '--verbose', + @mock.patch('sys.argv', new=['osken-manager', '--verbose', 'os_ken.tests.unit.cmd.dummy_openflow_app']) def test_openflow_app(self): self._reset_globals() diff --git a/os_ken/tests/unit/controller/test_controller.py b/os_ken/tests/unit/controller/test_controller.py index 3bc4f5e6..38e97b9f 100644 --- a/os_ken/tests/unit/controller/test_controller.py +++ b/os_ken/tests/unit/controller/test_controller.py @@ -151,11 +151,11 @@ class Test_Datapath(unittest.TestCase): return out # Prepare mock - ofp_brick_mock = mock.MagicMock(spec=app_manager.RyuApp) + ofp_brick_mock = mock.MagicMock(spec=app_manager.OSKenApp) app_manager_mock.lookup_service_brick.return_value = ofp_brick_mock sock_mock = SocketMock() sock_mock.buf = packet_buf - sock_mock.random = random.Random('Ryu SDN Framework') + sock_mock.random = random.Random('OSKen SDN Framework') addr_mock = mock.MagicMock() # Prepare test target diff --git a/os_ken/tests/unit/packet/test_bmp.py b/os_ken/tests/unit/packet/test_bmp.py index ce4b164e..64436e7a 100644 --- a/os_ken/tests/unit/packet/test_bmp.py +++ b/os_ken/tests/unit/packet/test_bmp.py @@ -117,7 +117,7 @@ class Test_bmp(unittest.TestCase): def test_initiation(self): initiation_info = [{'type': bmp.BMP_INIT_TYPE_STRING, - 'value': u'This is Ryu BGP BMP message'}] + 'value': u'This is OSKen BGP BMP message'}] msg = bmp.BMPInitiation(info=initiation_info) binmsg = msg.serialize() msg2, rest = bmp.BMPMessage.parser(binmsg) diff --git a/os_ken/tests/unit/test_requirements.py b/os_ken/tests/unit/test_requirements.py index 448404e4..a15cb66e 100644 --- a/os_ken/tests/unit/test_requirements.py +++ b/os_ken/tests/unit/test_requirements.py @@ -27,11 +27,11 @@ from nose.tools import ok_ LOG = logging.getLogger(__name__) MOD_DIR = os.path.dirname('file://' + sys.modules[__name__].__file__) -_RYU_REQUIREMENTS_FILES = [ +_OSKEN_REQUIREMENTS_FILES = [ '../../../requirements.txt', ] -RYU_REQUIREMENTS_FILES = [ - os.path.join(MOD_DIR, f) for f in _RYU_REQUIREMENTS_FILES] +OSKEN_REQUIREMENTS_FILES = [ + os.path.join(MOD_DIR, f) for f in _OSKEN_REQUIREMENTS_FILES] OPENSTACK_REQUIREMENTS_REPO = 'https://github.com/openstack/requirements' OPENSTACK_REQUIREMENTS_URL = ( @@ -57,12 +57,12 @@ def _get_requirements(files): OPENSTACK_REQUIREMENTS = _get_requirements(OPENSTACK_REQUIREMENTS_FILES) -RYU_REQUIREMENTS = _get_requirements(RYU_REQUIREMENTS_FILES) +OSKEN_REQUIREMENTS = _get_requirements(OSKEN_REQUIREMENTS_FILES) class TestRequirements(unittest.TestCase): """ - Test whether the requirements of Ryu has no conflict with that + Test whether the requirements of OSKen has no conflict with that of other projects. """ @@ -75,10 +75,10 @@ class TestRequirements(unittest.TestCase): def test_with_openstack_requirements(self): try: for name, req in OPENSTACK_REQUIREMENTS.items(): - if name in RYU_REQUIREMENTS: + if name in OSKEN_REQUIREMENTS: ok_(pkg_resources.require(req)) except pkg_resources.VersionConflict as e: LOG.exception( - 'Some requirements of Ryu are conflicting with that of ' + 'Some requirements of OSKen are conflicting with that of ' 'OpenStack project: %s', OPENSTACK_REQUIREMENTS_REPO) raise e diff --git a/os_ken/topology/dumper.py b/os_ken/topology/dumper.py index 1443184e..87beb3ae 100644 --- a/os_ken/topology/dumper.py +++ b/os_ken/topology/dumper.py @@ -26,7 +26,7 @@ from os_ken.topology import switches LOG = logging.getLogger(__name__) -class DiscoveryEventDumper(app_manager.RyuApp): +class DiscoveryEventDumper(app_manager.OSKenApp): ''' This app dumps discovery events ''' _CONTEXTS = { diff --git a/os_ken/topology/switches.py b/os_ken/topology/switches.py index f2805a98..dee33983 100644 --- a/os_ken/topology/switches.py +++ b/os_ken/topology/switches.py @@ -24,7 +24,7 @@ from os_ken.base import app_manager from os_ken.controller import ofp_event from os_ken.controller.handler import set_ev_cls from os_ken.controller.handler import MAIN_DISPATCHER, DEAD_DISPATCHER -from os_ken.exception import RyuException +from os_ken.exception import OSKenException from os_ken.lib import addrconv, hub from os_ken.lib.mac import DONTCARE_STR from os_ken.lib.dpid import dpid_to_str, str_to_dpid @@ -426,7 +426,7 @@ class LLDPPacket(object): PORT_ID_STR = '!I' # uint32_t PORT_ID_SIZE = 4 - class LLDPUnknownFormat(RyuException): + class LLDPUnknownFormat(OSKenException): message = '%(msg)s' @staticmethod @@ -493,7 +493,7 @@ class LLDPPacket(object): return src_dpid, src_port_no -class Switches(app_manager.RyuApp): +class Switches(app_manager.OSKenApp): OFP_VERSIONS = [ofproto_v1_0.OFP_VERSION, ofproto_v1_2.OFP_VERSION, ofproto_v1_3.OFP_VERSION, ofproto_v1_4.OFP_VERSION] _EVENTS = [event.EventSwitchEnter, event.EventSwitchLeave, diff --git a/run_tests.sh b/run_tests.sh index 659015fa..6f5a1d45 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -6,7 +6,7 @@ fi usage() { echo "Usage: $0 [OPTION]..." - echo "Run Ryu's test suite(s)" + echo "Run OSKen's test suite(s)" echo "" echo " -V, --virtual-env Always use virtualenv. Install automatically if not present" echo " -N, --no-virtual-env Don't use virtualenv. Run tests in local environment" @@ -62,7 +62,7 @@ done # If enabled, tell nose to collect coverage data if [ $coverage -eq 1 ]; then - noseopts="$noseopts --with-coverage --cover-package=ryu" + noseopts="$noseopts --with-coverage --cover-package=os_ken" fi run_tests() { @@ -90,13 +90,13 @@ run_tests() { run_pylint() { echo "Running pylint ..." PYLINT_OPTIONS="--rcfile=.pylintrc --output-format=parseable" - PYLINT_INCLUDE="ryu bin/ryu bin/ryu-manager ryu/tests/bin/ryu-client" - export PYTHONPATH=$PYTHONPATH:.ryu + PYLINT_INCLUDE="os_ken bin/osken bin/osken-manager os_ken/tests/bin/osken-client" + export PYTHONPATH=$PYTHONPATH:.os_ken PYLINT_LOG=pylint.log ${wrapper} pylint $PYLINT_OPTIONS $PYLINT_INCLUDE > $PYLINT_LOG #BASE_CMD="pylint $PYLINT_OPTIONS $PYLINT_INCLUDE > $PYLINT_LOG" - #[ $verbose -eq 1 ] && $BASE_CMD || msg_count=`$BASE_CMD | grep 'ryu/' | wc -l` + #[ $verbose -eq 1 ] && $BASE_CMD || msg_count=`$BASE_CMD | grep 'os_ken/' | wc -l` #if [ $verbose -eq 0 ]; then # echo "Pylint messages count: " $msg_count #fi @@ -113,7 +113,7 @@ run_pycodestyle() { echo "Running $(basename ${PYCODESTYLE}) ..." PYCODESTYLE_OPTIONS="--repeat --show-source" - PYCODESTYLE_INCLUDE="ryu setup*.py" + PYCODESTYLE_INCLUDE="os_ken setup*.py" PYCODESTYLE_LOG=pycodestyle.log ${wrapper} ${PYCODESTYLE} $PYCODESTYLE_OPTIONS $PYCODESTYLE_INCLUDE | tee $PYCODESTYLE_LOG } @@ -121,11 +121,11 @@ run_pycodestyle() { run_integrated() { echo "Running integrated test ..." - INTEGRATED_TEST_RUNNER="./ryu/tests/integrated/run_tests_with_ovs12.py" + INTEGRATED_TEST_RUNNER="./os_ken/tests/integrated/run_tests_with_ovs12.py" sudo PYTHONPATH=. nosetests -s $INTEGRATED_TEST_RUNNER } #NOSETESTS="nosetests $noseopts $noseargs" -NOSETESTS="${PYTHON} ./ryu/tests/run_tests.py $noseopts $noseargs" +NOSETESTS="${PYTHON} ./os_ken/tests/run_tests.py $noseopts $noseargs" #if [ -n "$PLUGIN_DIR" ] #then diff --git a/tools/normalize_json.py b/tools/normalize_json.py index 48243584..2d9cbb18 100755 --- a/tools/normalize_json.py +++ b/tools/normalize_json.py @@ -17,7 +17,7 @@ # limitations under the License. # usage example: -# for x in ../ryu/tests/unit/ofproto/json/**/*.json;do echo $x;./normalize_json.py < $x > xx&& mv xx $x;done +# for x in ../os_ken/tests/unit/ofproto/json/**/*.json;do echo $x;./normalize_json.py < $x > xx&& mv xx $x;done import json import sys diff --git a/tools/ryu-manager.spec b/tools/osken-manager.spec similarity index 76% rename from tools/ryu-manager.spec rename to tools/osken-manager.spec index 83df85a3..43dfe79b 100644 --- a/tools/ryu-manager.spec +++ b/tools/osken-manager.spec @@ -3,11 +3,11 @@ block_cipher = None -a = Analysis(['../bin/ryu-manager'], - pathex=['../ryu'], +a = Analysis(['../bin/osken-manager'], + pathex=['../os_ken'], binaries=None, datas=None, - hiddenimports=['ryu.controller.ofp_handler'], + hiddenimports=['os_ken.controller.ofp_handler'], hookspath=[], runtime_hooks=[], excludes=[], @@ -21,7 +21,7 @@ exe = EXE(pyz, a.binaries, a.zipfiles, a.datas, - name='ryu-manager', + name='osken-manager', debug=False, strip=False, upx=True, diff --git a/tools/pyang_plugins/ryu.py b/tools/pyang_plugins/osken.py similarity index 83% rename from tools/pyang_plugins/ryu.py rename to tools/pyang_plugins/osken.py index 1a1cb960..0f521ed5 100644 --- a/tools/pyang_plugins/ryu.py +++ b/tools/pyang_plugins/osken.py @@ -14,9 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -# this is a pyang plugin to generate ryu/lib/of_config/generated_classes.py +# this is a pyang plugin to generate os_ken/lib/of_config/generated_classes.py # usage example: -# PYTHONPATH=. ./bin/pyang --plugindir ~/git/ryu/tools/pyang_plugins -f ryu ~/git/ryu/tools/of-config1.1.1.yang > ~/git/ryu/lib/of_config/generated_classes.py +# PYTHONPATH=. ./bin/pyang --plugindir ~/git/os_ken/tools/pyang_plugins -f os_ken ~/git/os_ken/tools/of-config1.1.1.yang > ~/git/os_ken/lib/of_config/generated_classes.py _COPYRIGHT_NOTICE = """ @@ -45,24 +45,24 @@ from pyang import plugin def pyang_plugin_init(): - plugin.register_plugin(RyuPlugin()) + plugin.register_plugin(OSKenPlugin()) -class RyuPlugin(plugin.PyangPlugin): +class OSKenPlugin(plugin.PyangPlugin): def add_output_format(self, fmts): - fmts['ryu'] = self + fmts['os_ken'] = self def emit(self, ctx, modules, fd): - emit_ryu(ctx, modules[0], fd) + emit_os_ken(ctx, modules[0], fd) -def emit_ryu(ctx, module, fd): - ctx.i_ryu_queue = [] +def emit_os_ken(ctx, module, fd): + ctx.i_os_ken_queue = [] visit_children(ctx, module, fd, module.i_children) - ctx.i_ryu_queue.reverse() + ctx.i_os_ken_queue.reverse() generate_header(ctx) done = set() - for s in ctx.i_ryu_queue: + for s in ctx.i_os_ken_queue: name = generate_type_name(s) if name in done: continue @@ -73,7 +73,7 @@ def emit_ryu(ctx, module, fd): def visit_children(ctx, module, fd, children, prefix=''): for c in children: if not is_leaf(c): - ctx.i_ryu_queue.append(c) + ctx.i_os_ken_queue.append(c) if hasattr(c, 'i_children'): visit_children(ctx, module, fd, c.i_children, prefix + ' ') @@ -87,20 +87,20 @@ def generate_header(ctx): print '# do not edit.' print '# this file was mechanically generated with:' print '# pyang %s' % pyang.__version__ - print '# ryu.tools.pyang_plugins.ryu' + print '# os_ken.tools.pyang_plugins.osken' for mod, ver in sorted(ctx.modules): print '# %s@%s' % (mod, ver) print '' - print 'from ryu.lib.of_config.base import _Base, _e, _ct' + print 'from os_ken.lib.of_config.base import _Base, _e, _ct' def generate_class_def(s): try: - return s.i_ryu_class_def + return s.i_os_ken_class_def except AttributeError: pass - s.i_ryu_class_def = _generate_class_def(s) - return s.i_ryu_class_def + s.i_os_ken_class_def = _generate_class_def(s) + return s.i_os_ken_class_def def _generate_class_def(s): @@ -149,10 +149,10 @@ _classes = {} def generate_type_name(s): try: - return s.i_ryu_class_name + return s.i_os_ken_class_name except AttributeError: pass - s.i_ryu_class_name = name = _generate_type_name(s) + s.i_os_ken_class_name = name = _generate_type_name(s) assert (name not in _classes) or same_class_def(_classes[name], s) _classes[name] = s return name