Rename "ryu" to "os_ken" everywhere
Change-Id: Id227a6672fb89cd512b17cddfb1fce7bb22fb0c8
This commit is contained in:
parent
5e304b1f87
commit
eb94ee01bc
1
.gitignore
vendored
1
.gitignore
vendored
@ -10,7 +10,6 @@ dist
|
||||
build
|
||||
eggs
|
||||
parts
|
||||
bin
|
||||
var
|
||||
sdist
|
||||
develop-eggs
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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()
|
@ -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()
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
@ -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
|
@ -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`.
|
||||
|
||||
|
@ -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 <your bridge> tcp:<ip addr>[:<port: default 6633>]
|
||||
|
||||
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
|
||||
|
@ -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): ::
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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):
|
||||
|
@ -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')
|
||||
|
@ -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):
|
||||
|
@ -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):
|
||||
|
@ -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,
|
||||
}
|
||||
|
@ -2,11 +2,11 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" type="text/css" href="./ryu.topology.css">
|
||||
<link rel="stylesheet" type="text/css" href="./osken.topology.css">
|
||||
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Ryu Topology Viewer</h1>
|
||||
<script src="./ryu.topology.js" charset="utf-8"></script>
|
||||
<h1>OSKen Topology Viewer</h1>
|
||||
<script src="./osken.topology.js" charset="utf-8"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,5 +1,5 @@
|
||||
#topology {
|
||||
border: 1px solid #000000;
|
||||
#topology {
|
||||
border: 1px solid #000000;
|
||||
}
|
||||
|
||||
.node {
|
@ -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)...
|
||||
|
@ -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)
|
||||
|
@ -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'
|
||||
|
@ -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/<dpid>
|
||||
|
||||
|
||||
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,
|
||||
|
@ -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,
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -47,7 +47,7 @@ from os_ken.topology.api import get_switch, get_link, get_host
|
||||
# <dpid>: datapath id in 16 hex
|
||||
|
||||
|
||||
class TopologyAPI(app_manager.RyuApp):
|
||||
class TopologyAPI(app_manager.OSKenApp):
|
||||
_CONTEXTS = {
|
||||
'wsgi': WSGIApplication
|
||||
}
|
||||
|
@ -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}
|
||||
|
||||
|
@ -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):
|
||||
|
@ -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):
|
||||
|
@ -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):
|
||||
|
@ -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):
|
||||
|
@ -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):
|
||||
|
@ -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}
|
||||
|
||||
|
@ -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}
|
||||
|
||||
|
@ -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}
|
||||
|
||||
|
@ -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}
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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.
|
||||
|
@ -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()
|
||||
|
||||
|
@ -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'
|
||||
|
@ -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
|
||||
|
||||
"""
|
||||
|
||||
|
@ -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,
|
||||
}
|
||||
|
@ -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):
|
||||
|
@ -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
|
||||
|
@ -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'
|
||||
|
@ -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.
|
||||
|
||||
|
@ -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.
|
||||
#
|
||||
|
@ -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'
|
||||
|
@ -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'
|
||||
|
@ -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 = {
|
||||
|
@ -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')
|
||||
|
||||
|
@ -72,7 +72,7 @@ class EventMulticastGroupStateChanged(event.EventBase):
|
||||
self.dsts = dsts
|
||||
|
||||
|
||||
class IgmpLib(app_manager.RyuApp):
|
||||
class IgmpLib(app_manager.OSKenApp):
|
||||
"""IGMP snooping library."""
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
|
@ -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."""
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
|
@ -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):
|
||||
|
@ -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'
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
"""
|
||||
|
||||
|
@ -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):
|
||||
|
@ -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__()
|
||||
|
@ -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
|
||||
|
@ -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::
|
||||
|
@ -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.
|
||||
|
@ -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::
|
||||
|
@ -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.
|
||||
|
@ -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::
|
||||
|
@ -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.
|
||||
|
@ -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::
|
||||
|
@ -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::
|
||||
|
@ -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,
|
||||
}
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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'
|
||||
|
@ -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,
|
||||
|
@ -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]
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
@ -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'
|
||||
|
@ -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 = {}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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([
|
||||
|
@ -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,
|
||||
|
@ -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__,
|
||||
|
@ -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.
|
||||
"""
|
||||
|
@ -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,
|
||||
}
|
||||
|
@ -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.
|
||||
"""
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user