Move files from ryu/* to os_ken/*
After forking from Ryu, the namespace needs to change from 'ryu' to 'os_ken' so that it won't collide with the namespace of the old library. Change-Id: I807a8785e525cc02825d15a1a01eec3d5d20cce4
This commit is contained in:
parent
af2e4fcee4
commit
9f1f1726d0
1
.gitignore
vendored
1
.gitignore
vendored
@ -15,7 +15,6 @@ var
|
||||
sdist
|
||||
develop-eggs
|
||||
.installed.cfg
|
||||
lib
|
||||
lib64
|
||||
|
||||
# Installer logs
|
||||
|
@ -17,11 +17,11 @@ import os
|
||||
import socket
|
||||
import time
|
||||
|
||||
from ryu.base import app_manager
|
||||
from os_ken.base import app_manager
|
||||
|
||||
from ryu.lib import hub
|
||||
from ryu.lib.hub import StreamServer
|
||||
from ryu.lib.packet import bmp
|
||||
from os_ken.lib import hub
|
||||
from os_ken.lib.hub import StreamServer
|
||||
from os_ken.lib.packet import bmp
|
||||
|
||||
|
||||
class BMPStation(app_manager.RyuApp):
|
||||
@ -30,9 +30,9 @@ class BMPStation(app_manager.RyuApp):
|
||||
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', 'ryu_bmp.log')
|
||||
output_file = os.environ.get('RYU_BMP_OUTPUT_FILE', 'os_ken_bmp.log')
|
||||
failed_dump = os.environ.get('RYU_BMP_FAILED_DUMP',
|
||||
'ryu_bmp_failed.dump')
|
||||
'os_ken_bmp_failed.dump')
|
||||
|
||||
self.output_fd = open(output_file, 'w')
|
||||
self.failed_dump_fd = open(failed_dump, 'w')
|
@ -19,11 +19,11 @@ A dumb OpenFlow 1.0 responder for benchmarking the controller framework.
|
||||
Intended to be used with oflops cbench.
|
||||
"""
|
||||
|
||||
from ryu.base import app_manager
|
||||
from ryu.controller import ofp_event
|
||||
from ryu.controller.handler import MAIN_DISPATCHER
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
from ryu.ofproto import ofproto_v1_0
|
||||
from os_ken.base import app_manager
|
||||
from os_ken.controller import ofp_event
|
||||
from os_ken.controller.handler import MAIN_DISPATCHER
|
||||
from os_ken.controller.handler import set_ev_cls
|
||||
from os_ken.ofproto import ofproto_v1_0
|
||||
|
||||
|
||||
class Cbench(app_manager.RyuApp):
|
@ -13,13 +13,13 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from ryu.base import app_manager
|
||||
from ryu.controller import ofp_event
|
||||
from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
from ryu.ofproto import ofproto_v1_3
|
||||
from ryu.lib.packet import packet
|
||||
from ryu.lib.packet import ethernet
|
||||
from os_ken.base import app_manager
|
||||
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.ofproto import ofproto_v1_3
|
||||
from os_ken.lib.packet import packet
|
||||
from os_ken.lib.packet import ethernet
|
||||
|
||||
|
||||
class ExampleSwitch13(app_manager.RyuApp):
|
@ -20,18 +20,18 @@ Usage example
|
||||
$ sudo mn --controller remote --topo tree,depth=3
|
||||
|
||||
2. Run this application:
|
||||
$ PYTHONPATH=. ./bin/ryu run \
|
||||
--observe-links ryu/app/gui_topology/gui_topology.py
|
||||
$ PYTHONPATH=. ./bin/os_ken run \
|
||||
--observe-links os_ken/app/gui_topology/gui_topology.py
|
||||
|
||||
3. Access http://<ip address of ryu host>:8080 with your web browser.
|
||||
3. Access http://<ip address of os_ken host>:8080 with your web browser.
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
from webob.static import DirectoryApp
|
||||
|
||||
from ryu.app.wsgi import ControllerBase, WSGIApplication, route
|
||||
from ryu.base import app_manager
|
||||
from os_ken.app.wsgi import ControllerBase, WSGIApplication, route
|
||||
from os_ken.base import app_manager
|
||||
|
||||
|
||||
PATH = os.path.dirname(__file__)
|
||||
@ -63,6 +63,6 @@ class GUIServerController(ControllerBase):
|
||||
return self.static_app(req)
|
||||
|
||||
|
||||
app_manager.require_app('ryu.app.rest_topology')
|
||||
app_manager.require_app('ryu.app.ws_topology')
|
||||
app_manager.require_app('ryu.app.ofctl_rest')
|
||||
app_manager.require_app('os_ken.app.rest_topology')
|
||||
app_manager.require_app('os_ken.app.ws_topology')
|
||||
app_manager.require_app('os_ken.app.ofctl_rest')
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
@ -14,9 +14,9 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# client for ryu.app.ofctl.service
|
||||
# client for os_ken.app.ofctl.service
|
||||
|
||||
from ryu.base import app_manager
|
||||
from os_ken.base import app_manager
|
||||
from . import event
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ def get_datapath(app, dpid=None):
|
||||
Example::
|
||||
|
||||
# ...(snip)...
|
||||
import ryu.app.ofctl.api as ofctl_api
|
||||
import os_ken.app.ofctl.api as ofctl_api
|
||||
|
||||
|
||||
class MyApp(app_manager.RyuApp):
|
||||
@ -71,7 +71,7 @@ def send_msg(app, msg, reply_cls=None, reply_multi=False):
|
||||
Example::
|
||||
|
||||
# ...(snip)...
|
||||
import ryu.app.ofctl.api as ofctl_api
|
||||
import os_ken.app.ofctl.api as ofctl_api
|
||||
|
||||
|
||||
class MyApp(app_manager.RyuApp):
|
||||
@ -89,4 +89,4 @@ def send_msg(app, msg, reply_cls=None, reply_multi=False):
|
||||
reply_multi=reply_multi))()
|
||||
|
||||
|
||||
app_manager.require_app('ryu.app.ofctl.service', api_style=True)
|
||||
app_manager.require_app('os_ken.app.ofctl.service', api_style=True)
|
@ -16,7 +16,7 @@
|
||||
|
||||
import numbers
|
||||
|
||||
from ryu.controller import event
|
||||
from os_ken.controller import event
|
||||
|
||||
|
||||
# base classes
|
@ -14,7 +14,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from ryu import exception
|
||||
from os_ken import exception
|
||||
|
||||
|
||||
# base classes
|
@ -18,12 +18,12 @@
|
||||
|
||||
import numbers
|
||||
|
||||
from ryu.base import app_manager
|
||||
from os_ken.base import app_manager
|
||||
|
||||
from ryu.controller import ofp_event
|
||||
from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER,\
|
||||
from os_ken.controller import ofp_event
|
||||
from os_ken.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER,\
|
||||
DEAD_DISPATCHER
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
from os_ken.controller.handler import set_ev_cls
|
||||
|
||||
from . import event
|
||||
from . import exception
|
@ -17,27 +17,27 @@ import logging
|
||||
import json
|
||||
import ast
|
||||
|
||||
from ryu.base import app_manager
|
||||
from ryu.controller import ofp_event
|
||||
from ryu.controller import dpset
|
||||
from ryu.controller.handler import MAIN_DISPATCHER
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
from ryu.exception import RyuException
|
||||
from ryu.ofproto import ofproto_v1_0
|
||||
from ryu.ofproto import ofproto_v1_2
|
||||
from ryu.ofproto import ofproto_v1_3
|
||||
from ryu.ofproto import ofproto_v1_4
|
||||
from ryu.ofproto import ofproto_v1_5
|
||||
from ryu.lib import ofctl_v1_0
|
||||
from ryu.lib import ofctl_v1_2
|
||||
from ryu.lib import ofctl_v1_3
|
||||
from ryu.lib import ofctl_v1_4
|
||||
from ryu.lib import ofctl_v1_5
|
||||
from ryu.app.wsgi import ControllerBase
|
||||
from ryu.app.wsgi import Response
|
||||
from ryu.app.wsgi import WSGIApplication
|
||||
from os_ken.base import app_manager
|
||||
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.ofproto import ofproto_v1_0
|
||||
from os_ken.ofproto import ofproto_v1_2
|
||||
from os_ken.ofproto import ofproto_v1_3
|
||||
from os_ken.ofproto import ofproto_v1_4
|
||||
from os_ken.ofproto import ofproto_v1_5
|
||||
from os_ken.lib import ofctl_v1_0
|
||||
from os_ken.lib import ofctl_v1_2
|
||||
from os_ken.lib import ofctl_v1_3
|
||||
from os_ken.lib import ofctl_v1_4
|
||||
from os_ken.lib import ofctl_v1_5
|
||||
from os_ken.app.wsgi import ControllerBase
|
||||
from os_ken.app.wsgi import Response
|
||||
from os_ken.app.wsgi import WSGIApplication
|
||||
|
||||
LOG = logging.getLogger('ryu.app.ofctl_rest')
|
||||
LOG = logging.getLogger('os_ken.app.ofctl_rest')
|
||||
|
||||
# supported ofctl versions in this restful app
|
||||
supported_ofctl = {
|
@ -25,11 +25,11 @@ import json
|
||||
|
||||
from six.moves import http_client
|
||||
|
||||
from ryu.app.wsgi import ControllerBase
|
||||
from ryu.app.wsgi import Response
|
||||
from ryu.base import app_manager
|
||||
from ryu.controller import conf_switch
|
||||
from ryu.lib import dpid as dpid_lib
|
||||
from os_ken.app.wsgi import ControllerBase
|
||||
from os_ken.app.wsgi import Response
|
||||
from os_ken.base import app_manager
|
||||
from os_ken.controller import conf_switch
|
||||
from os_ken.lib import dpid as dpid_lib
|
||||
|
||||
|
||||
# REST API for switch configuration
|
@ -17,28 +17,28 @@
|
||||
import logging
|
||||
import json
|
||||
|
||||
from ryu.app.wsgi import ControllerBase
|
||||
from ryu.app.wsgi import Response
|
||||
from ryu.app.wsgi import WSGIApplication
|
||||
from ryu.base import app_manager
|
||||
from ryu.controller import ofp_event
|
||||
from ryu.controller import dpset
|
||||
from ryu.controller.handler import MAIN_DISPATCHER
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
from ryu.exception import OFPUnknownVersion
|
||||
from ryu.lib import mac
|
||||
from ryu.lib import dpid as dpid_lib
|
||||
from ryu.lib import ofctl_v1_0
|
||||
from ryu.lib import ofctl_v1_2
|
||||
from ryu.lib import ofctl_v1_3
|
||||
from ryu.lib.packet import packet
|
||||
from ryu.ofproto import ether
|
||||
from ryu.ofproto import inet
|
||||
from ryu.ofproto import ofproto_v1_0
|
||||
from ryu.ofproto import ofproto_v1_2
|
||||
from ryu.ofproto import ofproto_v1_2_parser
|
||||
from ryu.ofproto import ofproto_v1_3
|
||||
from ryu.ofproto import ofproto_v1_3_parser
|
||||
from os_ken.app.wsgi import ControllerBase
|
||||
from os_ken.app.wsgi import Response
|
||||
from os_ken.app.wsgi import WSGIApplication
|
||||
from os_ken.base import app_manager
|
||||
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 OFPUnknownVersion
|
||||
from os_ken.lib import mac
|
||||
from os_ken.lib import dpid as dpid_lib
|
||||
from os_ken.lib import ofctl_v1_0
|
||||
from os_ken.lib import ofctl_v1_2
|
||||
from os_ken.lib import ofctl_v1_3
|
||||
from os_ken.lib.packet import packet
|
||||
from os_ken.ofproto import ether
|
||||
from os_ken.ofproto import inet
|
||||
from os_ken.ofproto import ofproto_v1_0
|
||||
from os_ken.ofproto import ofproto_v1_2
|
||||
from os_ken.ofproto import ofproto_v1_2_parser
|
||||
from os_ken.ofproto import ofproto_v1_3
|
||||
from os_ken.ofproto import ofproto_v1_3_parser
|
||||
|
||||
|
||||
# =============================
|
@ -18,30 +18,30 @@ import logging
|
||||
import json
|
||||
import re
|
||||
|
||||
from ryu.app import conf_switch_key as cs_key
|
||||
from ryu.app.wsgi import ControllerBase
|
||||
from ryu.app.wsgi import Response
|
||||
from ryu.app.wsgi import route
|
||||
from ryu.app.wsgi import WSGIApplication
|
||||
from ryu.base import app_manager
|
||||
from ryu.controller import conf_switch
|
||||
from ryu.controller import ofp_event
|
||||
from ryu.controller import dpset
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
from ryu.controller.handler import MAIN_DISPATCHER
|
||||
from ryu.exception import OFPUnknownVersion
|
||||
from ryu.lib import dpid as dpid_lib
|
||||
from ryu.lib import mac
|
||||
from ryu.lib import ofctl_v1_0
|
||||
from ryu.lib import ofctl_v1_2
|
||||
from ryu.lib import ofctl_v1_3
|
||||
from ryu.lib.ovs import bridge
|
||||
from ryu.ofproto import ofproto_v1_0
|
||||
from ryu.ofproto import ofproto_v1_2
|
||||
from ryu.ofproto import ofproto_v1_3
|
||||
from ryu.ofproto import ofproto_v1_3_parser
|
||||
from ryu.ofproto import ether
|
||||
from ryu.ofproto import inet
|
||||
from os_ken.app import conf_switch_key as cs_key
|
||||
from os_ken.app.wsgi import ControllerBase
|
||||
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.controller import conf_switch
|
||||
from os_ken.controller import ofp_event
|
||||
from os_ken.controller import dpset
|
||||
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.lib import dpid as dpid_lib
|
||||
from os_ken.lib import mac
|
||||
from os_ken.lib import ofctl_v1_0
|
||||
from os_ken.lib import ofctl_v1_2
|
||||
from os_ken.lib import ofctl_v1_3
|
||||
from os_ken.lib.ovs import bridge
|
||||
from os_ken.ofproto import ofproto_v1_0
|
||||
from os_ken.ofproto import ofproto_v1_2
|
||||
from os_ken.ofproto import ofproto_v1_3
|
||||
from os_ken.ofproto import ofproto_v1_3_parser
|
||||
from os_ken.ofproto import ether
|
||||
from os_ken.ofproto import inet
|
||||
|
||||
|
||||
# =============================
|
@ -21,34 +21,34 @@ import struct
|
||||
|
||||
import json
|
||||
|
||||
from ryu.app.wsgi import ControllerBase
|
||||
from ryu.app.wsgi import Response
|
||||
from ryu.app.wsgi import WSGIApplication
|
||||
from ryu.base import app_manager
|
||||
from ryu.controller import dpset
|
||||
from ryu.controller import ofp_event
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
from ryu.controller.handler import MAIN_DISPATCHER
|
||||
from ryu.exception import OFPUnknownVersion
|
||||
from ryu.exception import RyuException
|
||||
from ryu.lib import dpid as dpid_lib
|
||||
from ryu.lib import hub
|
||||
from ryu.lib import mac as mac_lib
|
||||
from ryu.lib import addrconv
|
||||
from ryu.lib.packet import arp
|
||||
from ryu.lib.packet import ethernet
|
||||
from ryu.lib.packet import icmp
|
||||
from ryu.lib.packet import ipv4
|
||||
from ryu.lib.packet import packet
|
||||
from ryu.lib.packet import packet_base
|
||||
from ryu.lib.packet import tcp
|
||||
from ryu.lib.packet import udp
|
||||
from ryu.lib.packet import vlan
|
||||
from ryu.ofproto import ether
|
||||
from ryu.ofproto import inet
|
||||
from ryu.ofproto import ofproto_v1_0
|
||||
from ryu.ofproto import ofproto_v1_2
|
||||
from ryu.ofproto import ofproto_v1_3
|
||||
from os_ken.app.wsgi import ControllerBase
|
||||
from os_ken.app.wsgi import Response
|
||||
from os_ken.app.wsgi import WSGIApplication
|
||||
from os_ken.base import app_manager
|
||||
from os_ken.controller import dpset
|
||||
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.lib import dpid as dpid_lib
|
||||
from os_ken.lib import hub
|
||||
from os_ken.lib import mac as mac_lib
|
||||
from os_ken.lib import addrconv
|
||||
from os_ken.lib.packet import arp
|
||||
from os_ken.lib.packet import ethernet
|
||||
from os_ken.lib.packet import icmp
|
||||
from os_ken.lib.packet import ipv4
|
||||
from os_ken.lib.packet import packet
|
||||
from os_ken.lib.packet import packet_base
|
||||
from os_ken.lib.packet import tcp
|
||||
from os_ken.lib.packet import udp
|
||||
from os_ken.lib.packet import vlan
|
||||
from os_ken.ofproto import ether
|
||||
from os_ken.ofproto import inet
|
||||
from os_ken.ofproto import ofproto_v1_0
|
||||
from os_ken.ofproto import ofproto_v1_2
|
||||
from os_ken.ofproto import ofproto_v1_3
|
||||
|
||||
|
||||
# =============================
|
@ -15,13 +15,13 @@
|
||||
|
||||
import json
|
||||
|
||||
from ryu.app.wsgi import ControllerBase
|
||||
from ryu.app.wsgi import Response
|
||||
from ryu.app.wsgi import route
|
||||
from ryu.app.wsgi import WSGIApplication
|
||||
from ryu.base import app_manager
|
||||
from ryu.lib import dpid as dpid_lib
|
||||
from ryu.topology.api import get_switch, get_link, get_host
|
||||
from os_ken.app.wsgi import ControllerBase
|
||||
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.lib import dpid as dpid_lib
|
||||
from os_ken.topology.api import get_switch, get_link, get_host
|
||||
|
||||
# REST API for switch configuration
|
||||
#
|
@ -231,8 +231,8 @@ supports only the OpenFlow version 1.3.
|
||||
|
||||
::
|
||||
|
||||
$ ryu --version
|
||||
ryu 4.19
|
||||
$ os_ken --version
|
||||
os_ken 4.19
|
||||
|
||||
$ ovs-vsctl --version
|
||||
ovs-vsctl (Open vSwitch) 2.5.2 # APT packaged version of Ubuntu 16.04
|
||||
@ -245,25 +245,25 @@ supports only the OpenFlow version 1.3.
|
||||
|
||||
import json
|
||||
|
||||
from ryu.app.ofctl import api as ofctl_api
|
||||
from ryu.app.wsgi import ControllerBase
|
||||
from ryu.app.wsgi import Response
|
||||
from ryu.app.wsgi import route
|
||||
from ryu.app.wsgi import WSGIApplication
|
||||
from ryu.base import app_manager
|
||||
from ryu.exception import RyuException
|
||||
from ryu.lib.ovs import bridge as ovs_bridge
|
||||
from ryu.lib.packet import arp
|
||||
from ryu.lib.packet import ether_types
|
||||
from ryu.lib.packet.bgp import _RouteDistinguisher
|
||||
from ryu.lib.packet.bgp import EvpnNLRI
|
||||
from ryu.lib.stringify import StringifyMixin
|
||||
from ryu.ofproto import ofproto_v1_3
|
||||
from ryu.services.protocols.bgp.bgpspeaker import BGPSpeaker
|
||||
from ryu.services.protocols.bgp.bgpspeaker import RF_L2_EVPN
|
||||
from ryu.services.protocols.bgp.bgpspeaker import EVPN_MAC_IP_ADV_ROUTE
|
||||
from ryu.services.protocols.bgp.bgpspeaker import EVPN_MULTICAST_ETAG_ROUTE
|
||||
from ryu.services.protocols.bgp.info_base.evpn import EvpnPath
|
||||
from os_ken.app.ofctl import api as ofctl_api
|
||||
from os_ken.app.wsgi import ControllerBase
|
||||
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.lib.ovs import bridge as ovs_bridge
|
||||
from os_ken.lib.packet import arp
|
||||
from os_ken.lib.packet import ether_types
|
||||
from os_ken.lib.packet.bgp import _RouteDistinguisher
|
||||
from os_ken.lib.packet.bgp import EvpnNLRI
|
||||
from os_ken.lib.stringify import StringifyMixin
|
||||
from os_ken.ofproto import ofproto_v1_3
|
||||
from os_ken.services.protocols.bgp.bgpspeaker import BGPSpeaker
|
||||
from os_ken.services.protocols.bgp.bgpspeaker import RF_L2_EVPN
|
||||
from os_ken.services.protocols.bgp.bgpspeaker import EVPN_MAC_IP_ADV_ROUTE
|
||||
from os_ken.services.protocols.bgp.bgpspeaker import EVPN_MULTICAST_ETAG_ROUTE
|
||||
from os_ken.services.protocols.bgp.info_base.evpn import EvpnPath
|
||||
|
||||
|
||||
API_NAME = 'restvtep'
|
@ -15,11 +15,11 @@
|
||||
|
||||
from operator import attrgetter
|
||||
|
||||
from ryu.app import simple_switch_13
|
||||
from ryu.controller import ofp_event
|
||||
from ryu.controller.handler import MAIN_DISPATCHER, DEAD_DISPATCHER
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
from ryu.lib import hub
|
||||
from os_ken.app import simple_switch_13
|
||||
from os_ken.controller import ofp_event
|
||||
from os_ken.controller.handler import MAIN_DISPATCHER, DEAD_DISPATCHER
|
||||
from os_ken.controller.handler import set_ev_cls
|
||||
from os_ken.lib import hub
|
||||
|
||||
|
||||
class SimpleMonitor13(simple_switch_13.SimpleSwitch13):
|
@ -18,15 +18,15 @@ An OpenFlow 1.0 L2 learning switch implementation.
|
||||
"""
|
||||
|
||||
|
||||
from ryu.base import app_manager
|
||||
from ryu.controller import ofp_event
|
||||
from ryu.controller.handler import MAIN_DISPATCHER
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
from ryu.ofproto import ofproto_v1_0
|
||||
from ryu.lib.mac import haddr_to_bin
|
||||
from ryu.lib.packet import packet
|
||||
from ryu.lib.packet import ethernet
|
||||
from ryu.lib.packet import ether_types
|
||||
from os_ken.base import app_manager
|
||||
from os_ken.controller import ofp_event
|
||||
from os_ken.controller.handler import MAIN_DISPATCHER
|
||||
from os_ken.controller.handler import set_ev_cls
|
||||
from os_ken.ofproto import ofproto_v1_0
|
||||
from os_ken.lib.mac import haddr_to_bin
|
||||
from os_ken.lib.packet import packet
|
||||
from os_ken.lib.packet import ethernet
|
||||
from os_ken.lib.packet import ether_types
|
||||
|
||||
|
||||
class SimpleSwitch(app_manager.RyuApp):
|
@ -13,14 +13,14 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from ryu.base import app_manager
|
||||
from ryu.controller import ofp_event
|
||||
from ryu.controller.handler import MAIN_DISPATCHER
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
from ryu.ofproto import ofproto_v1_2
|
||||
from ryu.lib.packet import packet
|
||||
from ryu.lib.packet import ethernet
|
||||
from ryu.lib.packet import ether_types
|
||||
from os_ken.base import app_manager
|
||||
from os_ken.controller import ofp_event
|
||||
from os_ken.controller.handler import MAIN_DISPATCHER
|
||||
from os_ken.controller.handler import set_ev_cls
|
||||
from os_ken.ofproto import ofproto_v1_2
|
||||
from os_ken.lib.packet import packet
|
||||
from os_ken.lib.packet import ethernet
|
||||
from os_ken.lib.packet import ether_types
|
||||
|
||||
|
||||
class SimpleSwitch12(app_manager.RyuApp):
|
@ -13,14 +13,14 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from ryu.base import app_manager
|
||||
from ryu.controller import ofp_event
|
||||
from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
from ryu.ofproto import ofproto_v1_3
|
||||
from ryu.lib.packet import packet
|
||||
from ryu.lib.packet import ethernet
|
||||
from ryu.lib.packet import ether_types
|
||||
from os_ken.base import app_manager
|
||||
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.ofproto import ofproto_v1_3
|
||||
from os_ken.lib.packet import packet
|
||||
from os_ken.lib.packet import ethernet
|
||||
from os_ken.lib.packet import ether_types
|
||||
|
||||
|
||||
class SimpleSwitch13(app_manager.RyuApp):
|
@ -13,14 +13,14 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from ryu.base import app_manager
|
||||
from ryu.controller import ofp_event
|
||||
from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
from ryu.ofproto import ofproto_v1_4
|
||||
from ryu.lib.packet import packet
|
||||
from ryu.lib.packet import ethernet
|
||||
from ryu.lib.packet import ether_types
|
||||
from os_ken.base import app_manager
|
||||
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.ofproto import ofproto_v1_4
|
||||
from os_ken.lib.packet import packet
|
||||
from os_ken.lib.packet import ethernet
|
||||
from os_ken.lib.packet import ether_types
|
||||
|
||||
|
||||
class SimpleSwitch14(app_manager.RyuApp):
|
@ -13,14 +13,14 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from ryu.base import app_manager
|
||||
from ryu.controller import ofp_event
|
||||
from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
from ryu.ofproto import ofproto_v1_5
|
||||
from ryu.lib.packet import packet
|
||||
from ryu.lib.packet import ethernet
|
||||
from ryu.lib.packet import ether_types
|
||||
from os_ken.base import app_manager
|
||||
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.ofproto import ofproto_v1_5
|
||||
from os_ken.lib.packet import packet
|
||||
from os_ken.lib.packet import ethernet
|
||||
from os_ken.lib.packet import ether_types
|
||||
|
||||
|
||||
class SimpleSwitch15(app_manager.RyuApp):
|
@ -15,13 +15,13 @@
|
||||
|
||||
import struct
|
||||
|
||||
from ryu.base import app_manager
|
||||
from ryu.controller.handler import MAIN_DISPATCHER
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
from ryu.ofproto import ofproto_v1_0
|
||||
from ryu.lib import addrconv
|
||||
from ryu.lib import igmplib
|
||||
from ryu.lib.dpid import str_to_dpid
|
||||
from os_ken.base import app_manager
|
||||
from os_ken.controller.handler import MAIN_DISPATCHER
|
||||
from os_ken.controller.handler import set_ev_cls
|
||||
from os_ken.ofproto import ofproto_v1_0
|
||||
from os_ken.lib import addrconv
|
||||
from os_ken.lib import igmplib
|
||||
from os_ken.lib.dpid import str_to_dpid
|
||||
|
||||
|
||||
class SimpleSwitchIgmp(app_manager.RyuApp):
|
@ -13,17 +13,17 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from ryu.base import app_manager
|
||||
from ryu.controller import ofp_event
|
||||
from ryu.controller.handler import CONFIG_DISPATCHER
|
||||
from ryu.controller.handler import MAIN_DISPATCHER
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
from ryu.ofproto import ofproto_v1_3
|
||||
from ryu.lib import igmplib
|
||||
from ryu.lib.dpid import str_to_dpid
|
||||
from ryu.lib.packet import packet
|
||||
from ryu.lib.packet import ethernet
|
||||
from ryu.app import simple_switch_13
|
||||
from os_ken.base import app_manager
|
||||
from os_ken.controller import ofp_event
|
||||
from os_ken.controller.handler import CONFIG_DISPATCHER
|
||||
from os_ken.controller.handler import MAIN_DISPATCHER
|
||||
from os_ken.controller.handler import set_ev_cls
|
||||
from os_ken.ofproto import ofproto_v1_3
|
||||
from os_ken.lib import igmplib
|
||||
from os_ken.lib.dpid import str_to_dpid
|
||||
from os_ken.lib.packet import packet
|
||||
from os_ken.lib.packet import ethernet
|
||||
from os_ken.app import simple_switch_13
|
||||
|
||||
|
||||
class SimpleSwitchIgmp13(simple_switch_13.SimpleSwitch13):
|
@ -15,13 +15,13 @@
|
||||
|
||||
import struct
|
||||
|
||||
from ryu.base import app_manager
|
||||
from ryu.controller.handler import MAIN_DISPATCHER
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
from ryu.ofproto import ofproto_v1_0
|
||||
from ryu.lib import addrconv
|
||||
from ryu.lib import lacplib
|
||||
from ryu.lib.dpid import str_to_dpid
|
||||
from os_ken.base import app_manager
|
||||
from os_ken.controller.handler import MAIN_DISPATCHER
|
||||
from os_ken.controller.handler import set_ev_cls
|
||||
from os_ken.ofproto import ofproto_v1_0
|
||||
from os_ken.lib import addrconv
|
||||
from os_ken.lib import lacplib
|
||||
from os_ken.lib.dpid import str_to_dpid
|
||||
|
||||
|
||||
class SimpleSwitchLacp(app_manager.RyuApp):
|
@ -13,17 +13,17 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from ryu.base import app_manager
|
||||
from ryu.controller import ofp_event
|
||||
from ryu.controller.handler import CONFIG_DISPATCHER
|
||||
from ryu.controller.handler import MAIN_DISPATCHER
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
from ryu.ofproto import ofproto_v1_3
|
||||
from ryu.lib import lacplib
|
||||
from ryu.lib.dpid import str_to_dpid
|
||||
from ryu.lib.packet import packet
|
||||
from ryu.lib.packet import ethernet
|
||||
from ryu.app import simple_switch_13
|
||||
from os_ken.base import app_manager
|
||||
from os_ken.controller import ofp_event
|
||||
from os_ken.controller.handler import CONFIG_DISPATCHER
|
||||
from os_ken.controller.handler import MAIN_DISPATCHER
|
||||
from os_ken.controller.handler import set_ev_cls
|
||||
from os_ken.ofproto import ofproto_v1_3
|
||||
from os_ken.lib import lacplib
|
||||
from os_ken.lib.dpid import str_to_dpid
|
||||
from os_ken.lib.packet import packet
|
||||
from os_ken.lib.packet import ethernet
|
||||
from os_ken.app import simple_switch_13
|
||||
|
||||
|
||||
class SimpleSwitchLacp13(simple_switch_13.SimpleSwitch13):
|
@ -15,15 +15,15 @@
|
||||
|
||||
import json
|
||||
|
||||
from ryu.app import simple_switch_13
|
||||
from ryu.controller import ofp_event
|
||||
from ryu.controller.handler import CONFIG_DISPATCHER
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
from ryu.app.wsgi import ControllerBase
|
||||
from ryu.app.wsgi import Response
|
||||
from ryu.app.wsgi import route
|
||||
from ryu.app.wsgi import WSGIApplication
|
||||
from ryu.lib import dpid as dpid_lib
|
||||
from os_ken.app import simple_switch_13
|
||||
from os_ken.controller import ofp_event
|
||||
from os_ken.controller.handler import CONFIG_DISPATCHER
|
||||
from os_ken.controller.handler import set_ev_cls
|
||||
from os_ken.app.wsgi import ControllerBase
|
||||
from os_ken.app.wsgi import Response
|
||||
from os_ken.app.wsgi import route
|
||||
from os_ken.app.wsgi import WSGIApplication
|
||||
from os_ken.lib import dpid as dpid_lib
|
||||
|
||||
simple_switch_instance_name = 'simple_switch_api_app'
|
||||
url = '/simpleswitch/mactable/{dpid}'
|
@ -17,16 +17,16 @@ from __future__ import print_function
|
||||
|
||||
import array
|
||||
|
||||
from ryu.base import app_manager
|
||||
from ryu.controller import ofp_event
|
||||
from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
from ryu.ofproto import ofproto_v1_3
|
||||
from ryu.lib.packet import packet
|
||||
from ryu.lib.packet import ethernet
|
||||
from ryu.lib.packet import ipv4
|
||||
from ryu.lib.packet import icmp
|
||||
from ryu.lib import snortlib
|
||||
from os_ken.base import app_manager
|
||||
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.ofproto import ofproto_v1_3
|
||||
from os_ken.lib.packet import packet
|
||||
from os_ken.lib.packet import ethernet
|
||||
from os_ken.lib.packet import ipv4
|
||||
from os_ken.lib.packet import icmp
|
||||
from os_ken.lib import snortlib
|
||||
|
||||
|
||||
class SimpleSwitchSnort(app_manager.RyuApp):
|
@ -15,13 +15,13 @@
|
||||
|
||||
import struct
|
||||
|
||||
from ryu.base import app_manager
|
||||
from ryu.controller.handler import MAIN_DISPATCHER
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
from ryu.ofproto import ofproto_v1_0
|
||||
from ryu.lib import dpid as dpid_lib
|
||||
from ryu.lib import stplib
|
||||
from ryu.lib.mac import haddr_to_str
|
||||
from os_ken.base import app_manager
|
||||
from os_ken.controller.handler import MAIN_DISPATCHER
|
||||
from os_ken.controller.handler import set_ev_cls
|
||||
from os_ken.ofproto import ofproto_v1_0
|
||||
from os_ken.lib import dpid as dpid_lib
|
||||
from os_ken.lib import stplib
|
||||
from os_ken.lib.mac import haddr_to_str
|
||||
|
||||
|
||||
class SimpleSwitchStp(app_manager.RyuApp):
|
@ -13,16 +13,16 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from ryu.base import app_manager
|
||||
from ryu.controller import ofp_event
|
||||
from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
from ryu.ofproto import ofproto_v1_3
|
||||
from ryu.lib import dpid as dpid_lib
|
||||
from ryu.lib import stplib
|
||||
from ryu.lib.packet import packet
|
||||
from ryu.lib.packet import ethernet
|
||||
from ryu.app import simple_switch_13
|
||||
from os_ken.base import app_manager
|
||||
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.ofproto import ofproto_v1_3
|
||||
from os_ken.lib import dpid as dpid_lib
|
||||
from os_ken.lib import stplib
|
||||
from os_ken.lib.packet import packet
|
||||
from os_ken.lib.packet import ethernet
|
||||
from os_ken.app import simple_switch_13
|
||||
|
||||
|
||||
class SimpleSwitch13(simple_switch_13.SimpleSwitch13):
|
@ -17,7 +17,7 @@
|
||||
Usage example
|
||||
|
||||
Run this application:
|
||||
$ PYTHONPATH=. ./bin/ryu run --verbose ryu.app.simple_switch_websocket_13
|
||||
$ PYTHONPATH=. ./bin/os_ken run --verbose os_ken.app.simple_switch_websocket_13
|
||||
|
||||
Install and run websocket client(in other terminal):
|
||||
$ pip install websocket-client
|
||||
@ -42,15 +42,15 @@ Get arp table:
|
||||
15:0c:de:49": 2}}}
|
||||
"""
|
||||
|
||||
from ryu.app import simple_switch_13
|
||||
from ryu.app.wsgi import ControllerBase
|
||||
from ryu.app.wsgi import rpc_public
|
||||
from ryu.app.wsgi import websocket
|
||||
from ryu.app.wsgi import WebSocketRPCServer
|
||||
from ryu.app.wsgi import WSGIApplication
|
||||
from ryu.controller import ofp_event
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
from ryu.lib.packet import packet
|
||||
from os_ken.app import simple_switch_13
|
||||
from os_ken.app.wsgi import ControllerBase
|
||||
from os_ken.app.wsgi import rpc_public
|
||||
from os_ken.app.wsgi import websocket
|
||||
from os_ken.app.wsgi import WebSocketRPCServer
|
||||
from os_ken.app.wsgi import WSGIApplication
|
||||
from os_ken.controller import ofp_event
|
||||
from os_ken.controller.handler import set_ev_cls
|
||||
from os_ken.lib.packet import packet
|
||||
|
||||
|
||||
simple_switch_instance_name = 'simple_switch_api_app'
|
@ -17,7 +17,7 @@
|
||||
Usage example
|
||||
|
||||
1. Run this application:
|
||||
$ ryu-manager --verbose --observe-links ryu.app.ws_topology
|
||||
$ os_ken-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
|
||||
@ -38,15 +38,15 @@ from socket import error as SocketError
|
||||
from tinyrpc.exc import InvalidReplyError
|
||||
|
||||
|
||||
from ryu.app.wsgi import (
|
||||
from os_ken.app.wsgi import (
|
||||
ControllerBase,
|
||||
WSGIApplication,
|
||||
websocket,
|
||||
WebSocketRPCClient
|
||||
)
|
||||
from ryu.base import app_manager
|
||||
from ryu.topology import event, switches
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
from os_ken.base import app_manager
|
||||
from os_ken.topology import event, switches
|
||||
from os_ken.controller.handler import set_ev_cls
|
||||
|
||||
|
||||
class WebSocketTopology(app_manager.RyuApp):
|
@ -31,8 +31,8 @@ import webob.exc
|
||||
from webob.request import Request as webob_Request
|
||||
from webob.response import Response as webob_Response
|
||||
|
||||
from ryu import cfg
|
||||
from ryu.lib import hub
|
||||
from os_ken import cfg
|
||||
from os_ken.lib import hub
|
||||
|
||||
DEFAULT_WSGI_HOST = '0.0.0.0'
|
||||
DEFAULT_WSGI_PORT = 8080
|
@ -30,17 +30,17 @@ import sys
|
||||
import os
|
||||
import gc
|
||||
|
||||
from ryu import cfg
|
||||
from ryu import utils
|
||||
from ryu.app import wsgi
|
||||
from ryu.controller.handler import register_instance, get_dependent_services
|
||||
from ryu.controller.controller import Datapath
|
||||
from ryu.controller import event
|
||||
from ryu.controller.event import EventRequestBase, EventReplyBase
|
||||
from ryu.lib import hub
|
||||
from ryu.ofproto import ofproto_protocol
|
||||
from os_ken import cfg
|
||||
from os_ken import utils
|
||||
from os_ken.app import wsgi
|
||||
from os_ken.controller.handler import register_instance, get_dependent_services
|
||||
from os_ken.controller.controller import Datapath
|
||||
from os_ken.controller import event
|
||||
from os_ken.controller.event import EventRequestBase, EventReplyBase
|
||||
from os_ken.lib import hub
|
||||
from os_ken.ofproto import ofproto_protocol
|
||||
|
||||
LOG = logging.getLogger('ryu.base.app_manager')
|
||||
LOG = logging.getLogger('os_ken.base.app_manager')
|
||||
|
||||
SERVICE_BRICKS = {}
|
||||
|
||||
@ -92,7 +92,7 @@ class RyuApp(object):
|
||||
"""
|
||||
The base class for Ryu applications.
|
||||
|
||||
RyuApp subclasses are instantiated after ryu-manager loaded
|
||||
RyuApp subclasses are instantiated after os_ken-manager loaded
|
||||
all requested Ryu application modules.
|
||||
__init__ should call RyuApp.__init__ with the same arguments.
|
||||
It's illegal to send any events in __init__.
|
@ -18,13 +18,13 @@ import oslo_config.cfg
|
||||
|
||||
# there are 3 ways to access the configuration.
|
||||
#
|
||||
# a. ryu.cfg.CONF (used to register cli options)
|
||||
# b. RyuApp.CONF (preferred way for ryu applications)
|
||||
# a. os_ken.cfg.CONF (used to register cli options)
|
||||
# b. RyuApp.CONF (preferred way for os_ken applications)
|
||||
# c. oslo_config.cfg.CONF
|
||||
#
|
||||
# Currently a. and b. shares a single ConfigOpts instance.
|
||||
# We intentionally avoid using c. for our options as a python program
|
||||
# which embeds ryu applications (eg. neutron agent) might want to put
|
||||
# which embeds os_ken applications (eg. neutron agent) might want to put
|
||||
# its own set of cli options into it, which can conflict with ours.
|
||||
# (Currently there seems no conflict for the neutron agent. But who knows?)
|
||||
# At some point later we might want to unshare a. and b. as well, in order
|
@ -19,21 +19,21 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
from ryu.lib import hub
|
||||
from os_ken.lib import hub
|
||||
hub.patch(thread=False)
|
||||
|
||||
from ryu import cfg
|
||||
from os_ken import cfg
|
||||
|
||||
import logging
|
||||
from ryu import log
|
||||
from os_ken import log
|
||||
log.early_init_log(logging.DEBUG)
|
||||
|
||||
from ryu import flags
|
||||
from ryu import version
|
||||
from ryu.app import wsgi
|
||||
from ryu.base.app_manager import AppManager
|
||||
from ryu.controller import controller
|
||||
from ryu.topology import switches
|
||||
from os_ken import flags
|
||||
from os_ken import version
|
||||
from os_ken.app import wsgi
|
||||
from os_ken.base.app_manager import AppManager
|
||||
from os_ken.controller import controller
|
||||
from os_ken.topology import switches
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
@ -62,7 +62,7 @@ def _parse_user_flags():
|
||||
user_flags_file = ''
|
||||
|
||||
if user_flags_file and os.path.isfile(user_flags_file):
|
||||
from ryu.utils import _import_module_file
|
||||
from os_ken.utils import _import_module_file
|
||||
_import_module_file(user_flags_file)
|
||||
|
||||
|
||||
@ -70,11 +70,11 @@ def main(args=None, prog=None):
|
||||
_parse_user_flags()
|
||||
try:
|
||||
CONF(args=args, prog=prog,
|
||||
project='ryu', version='ryu-manager %s' % version,
|
||||
default_config_files=['/usr/local/etc/ryu/ryu.conf'])
|
||||
project='os_ken', version='os_ken-manager %s' % version,
|
||||
default_config_files=['/usr/local/etc/os_ken/os_ken.conf'])
|
||||
except cfg.ConfigFilesNotFoundError:
|
||||
CONF(args=args, prog=prog,
|
||||
project='ryu', version='ryu-manager %s' % version)
|
||||
project='os_ken', version='os_ken-manager %s' % version)
|
||||
|
||||
log.init_log()
|
||||
logger = logging.getLogger(__name__)
|
||||
@ -92,7 +92,7 @@ def main(args=None, prog=None):
|
||||
app_lists = CONF.app_lists + CONF.app
|
||||
# keep old behavior, run ofp if no application is specified.
|
||||
if not app_lists:
|
||||
app_lists = ['ryu.controller.ofp_handler']
|
||||
app_lists = ['os_ken.controller.ofp_handler']
|
||||
|
||||
app_mgr = AppManager.get_instance()
|
||||
app_mgr.load_apps(app_lists)
|
@ -31,10 +31,10 @@ import sys
|
||||
import lxml.etree as ET
|
||||
from ncclient.operations.rpc import RPCError
|
||||
|
||||
from ryu import cfg
|
||||
from ryu.lib import of_config
|
||||
from ryu.lib.of_config import capable_switch
|
||||
import ryu.lib.of_config.classes as ofc
|
||||
from os_ken import cfg
|
||||
from os_ken.lib import of_config
|
||||
from os_ken.lib.of_config import capable_switch
|
||||
import os_ken.lib.of_config.classes as ofc
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
@ -22,18 +22,18 @@
|
||||
# IceHouse release. Juno and later releases do not use this.
|
||||
# TODO: Remove this module when IceHouse is EOL'ed.
|
||||
|
||||
from ryu.lib import hub
|
||||
from os_ken.lib import hub
|
||||
hub.patch()
|
||||
|
||||
from ryu import cfg
|
||||
from os_ken import cfg
|
||||
|
||||
from neutron.common import config as logging_config
|
||||
|
||||
from ryu.base.app_manager import AppManager
|
||||
from os_ken.base.app_manager import AppManager
|
||||
|
||||
|
||||
def main():
|
||||
cfg.CONF(project='ryu')
|
||||
cfg.CONF(project='os_ken')
|
||||
logging_config.setup_logging(cfg.CONF)
|
||||
AppManager.run_apps(['neutron.plugins.ofagent.agent.ofa_neutron_agent'])
|
||||
|
@ -38,8 +38,8 @@ import socket
|
||||
import sys
|
||||
import termios
|
||||
|
||||
from ryu import cfg
|
||||
from ryu.lib import rpc
|
||||
from os_ken import cfg
|
||||
from os_ken.lib import rpc
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
@ -18,15 +18,15 @@ import argparse
|
||||
import os.path
|
||||
import sys
|
||||
|
||||
from ryu import cfg
|
||||
from ryu import utils
|
||||
from ryu import version
|
||||
from os_ken import cfg
|
||||
from os_ken import utils
|
||||
from os_ken import version
|
||||
|
||||
|
||||
subcommands = {
|
||||
'run': 'ryu.cmd.manager',
|
||||
'of-config-cli': 'ryu.cmd.of_config_cli',
|
||||
'rpc-cli': 'ryu.cmd.rpc_cli',
|
||||
'run': 'os_ken.cmd.manager',
|
||||
'of-config-cli': 'os_ken.cmd.of_config_cli',
|
||||
'rpc-cli': 'os_ken.cmd.rpc_cli',
|
||||
}
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@ class SubCommand(object):
|
||||
|
||||
def main():
|
||||
try:
|
||||
base_conf(project='ryu', version='ryu %s' % version)
|
||||
base_conf(project='os_ken', version='os_ken %s' % version)
|
||||
except cfg.RequiredOptError as e:
|
||||
base_conf.print_help()
|
||||
raise SystemExit(1)
|
@ -16,9 +16,9 @@
|
||||
|
||||
import logging
|
||||
|
||||
from ryu.controller import event
|
||||
from ryu.lib.dpid import dpid_to_str
|
||||
from ryu.base import app_manager
|
||||
from os_ken.controller import event
|
||||
from os_ken.lib.dpid import dpid_to_str
|
||||
from os_ken.base import app_manager
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -31,25 +31,25 @@ from socket import SHUT_WR
|
||||
from socket import timeout as SocketTimeout
|
||||
import ssl
|
||||
|
||||
from ryu import cfg
|
||||
from ryu.lib import hub
|
||||
from ryu.lib.hub import StreamServer
|
||||
from os_ken import cfg
|
||||
from os_ken.lib import hub
|
||||
from os_ken.lib.hub import StreamServer
|
||||
|
||||
import ryu.base.app_manager
|
||||
import os_ken.base.app_manager
|
||||
|
||||
from ryu.ofproto import ofproto_common
|
||||
from ryu.ofproto import ofproto_parser
|
||||
from ryu.ofproto import ofproto_protocol
|
||||
from ryu.ofproto import ofproto_v1_0
|
||||
from ryu.ofproto import nx_match
|
||||
from os_ken.ofproto import ofproto_common
|
||||
from os_ken.ofproto import ofproto_parser
|
||||
from os_ken.ofproto import ofproto_protocol
|
||||
from os_ken.ofproto import ofproto_v1_0
|
||||
from os_ken.ofproto import nx_match
|
||||
|
||||
from ryu.controller import ofp_event
|
||||
from ryu.controller.handler import HANDSHAKE_DISPATCHER, DEAD_DISPATCHER
|
||||
from os_ken.controller import ofp_event
|
||||
from os_ken.controller.handler import HANDSHAKE_DISPATCHER, DEAD_DISPATCHER
|
||||
|
||||
from ryu.lib.dpid import dpid_to_str
|
||||
from ryu.lib import ip
|
||||
from os_ken.lib.dpid import dpid_to_str
|
||||
from os_ken.lib import ip
|
||||
|
||||
LOG = logging.getLogger('ryu.controller.controller')
|
||||
LOG = logging.getLogger('os_ken.controller.controller')
|
||||
|
||||
DEFAULT_OFP_HOST = '0.0.0.0'
|
||||
DEFAULT_OFP_SW_CON_INTERVAL = 1
|
||||
@ -216,19 +216,19 @@ class Datapath(ofproto_protocol.ProtocolDesc):
|
||||
==================================== ======================================
|
||||
id 64-bit OpenFlow Datapath ID.
|
||||
Only available for
|
||||
ryu.controller.handler.MAIN_DISPATCHER
|
||||
os_ken.controller.handler.MAIN_DISPATCHER
|
||||
phase.
|
||||
ofproto A module which exports OpenFlow
|
||||
definitions, mainly constants appeared
|
||||
in the specification, for the
|
||||
negotiated OpenFlow version. For
|
||||
example, ryu.ofproto.ofproto_v1_0 for
|
||||
example, os_ken.ofproto.ofproto_v1_0 for
|
||||
OpenFlow 1.0.
|
||||
ofproto_parser A module which exports OpenFlow wire
|
||||
message encoder and decoder for the
|
||||
negotiated OpenFlow version.
|
||||
For example,
|
||||
ryu.ofproto.ofproto_v1_0_parser
|
||||
os_ken.ofproto.ofproto_v1_0_parser
|
||||
for OpenFlow 1.0.
|
||||
ofproto_parser.OFPxxxx(datapath,...) A callable to prepare an OpenFlow
|
||||
message for the given switch. It can
|
||||
@ -276,7 +276,7 @@ class Datapath(ofproto_protocol.ProtocolDesc):
|
||||
self.id = None # datapath_id is unknown yet
|
||||
self._ports = None
|
||||
self.flow_format = ofproto_v1_0.NXFF_OPENFLOW10
|
||||
self.ofp_brick = ryu.base.app_manager.lookup_service_brick('ofp_event')
|
||||
self.ofp_brick = os_ken.base.app_manager.lookup_service_brick('ofp_event')
|
||||
self.state = None # for pylint
|
||||
self.set_state(HANDSHAKE_DISPATCHER)
|
||||
|
||||
@ -358,7 +358,7 @@ class Datapath(ofproto_protocol.ProtocolDesc):
|
||||
buf_len = len(buf)
|
||||
remaining_read_len = min_read_len
|
||||
|
||||
# We need to schedule other greenlets. Otherwise, ryu
|
||||
# We need to schedule other greenlets. Otherwise, os_ken
|
||||
# can't accept new switches or handle the existing
|
||||
# switches. The limit is arbitrary. We need the better
|
||||
# approach in the future.
|
@ -17,22 +17,22 @@
|
||||
"""
|
||||
Manage switches.
|
||||
|
||||
Planned to be replaced by ryu/topology.
|
||||
Planned to be replaced by os_ken/topology.
|
||||
"""
|
||||
|
||||
import logging
|
||||
import warnings
|
||||
|
||||
from ryu.base import app_manager
|
||||
from ryu.controller import event
|
||||
from ryu.controller import handler
|
||||
from ryu.controller import ofp_event
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
import ryu.exception as ryu_exc
|
||||
from os_ken.base import app_manager
|
||||
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
|
||||
import os_ken.exception as os_ken_exc
|
||||
|
||||
from ryu.lib.dpid import dpid_to_str
|
||||
from os_ken.lib.dpid import dpid_to_str
|
||||
|
||||
LOG = logging.getLogger('ryu.controller.dpset')
|
||||
LOG = logging.getLogger('os_ken.controller.dpset')
|
||||
|
||||
DPSET_EV_DISPATCHER = "dpset"
|
||||
|
||||
@ -48,13 +48,13 @@ class EventDP(EventDPBase):
|
||||
An event class to notify connect/disconnect of a switch.
|
||||
|
||||
For OpenFlow switches, one can get the same notification by observing
|
||||
ryu.controller.ofp_event.EventOFPStateChange.
|
||||
os_ken.controller.ofp_event.EventOFPStateChange.
|
||||
An instance has at least the following attributes.
|
||||
|
||||
========= =================================================================
|
||||
Attribute Description
|
||||
========= =================================================================
|
||||
dp A ryu.controller.controller.Datapath instance of the switch
|
||||
dp A os_ken.controller.controller.Datapath instance of the switch
|
||||
enter True when the switch connected to our controller. False for
|
||||
disconnect.
|
||||
ports A list of port instances.
|
||||
@ -89,13 +89,13 @@ class EventPortAdd(EventPortBase):
|
||||
|
||||
This event is generated when a new port is added to a switch.
|
||||
For OpenFlow switches, one can get the same notification by observing
|
||||
ryu.controller.ofp_event.EventOFPPortStatus.
|
||||
os_ken.controller.ofp_event.EventOFPPortStatus.
|
||||
An instance has at least the following attributes.
|
||||
|
||||
========= =================================================================
|
||||
Attribute Description
|
||||
========= =================================================================
|
||||
dp A ryu.controller.controller.Datapath instance of the switch
|
||||
dp A os_ken.controller.controller.Datapath instance of the switch
|
||||
port port number
|
||||
========= =================================================================
|
||||
"""
|
||||
@ -110,13 +110,13 @@ class EventPortDelete(EventPortBase):
|
||||
|
||||
This event is generated when a port is removed from a switch.
|
||||
For OpenFlow switches, one can get the same notification by observing
|
||||
ryu.controller.ofp_event.EventOFPPortStatus.
|
||||
os_ken.controller.ofp_event.EventOFPPortStatus.
|
||||
An instance has at least the following attributes.
|
||||
|
||||
========= =================================================================
|
||||
Attribute Description
|
||||
========= =================================================================
|
||||
dp A ryu.controller.controller.Datapath instance of the switch
|
||||
dp A os_ken.controller.controller.Datapath instance of the switch
|
||||
port port number
|
||||
========= =================================================================
|
||||
"""
|
||||
@ -131,13 +131,13 @@ class EventPortModify(EventPortBase):
|
||||
|
||||
This event is generated when some attribute of a port is changed.
|
||||
For OpenFlow switches, one can get the same notification by observing
|
||||
ryu.controller.ofp_event.EventOFPPortStatus.
|
||||
os_ken.controller.ofp_event.EventOFPPortStatus.
|
||||
An instance has at least the following attributes.
|
||||
|
||||
========= ====================================================================
|
||||
Attribute Description
|
||||
========= ====================================================================
|
||||
dp A ryu.controller.controller.Datapath instance of the switch
|
||||
dp A os_ken.controller.controller.Datapath instance of the switch
|
||||
port port number
|
||||
========= ====================================================================
|
||||
"""
|
||||
@ -169,7 +169,7 @@ class DPSet(app_manager.RyuApp):
|
||||
Usage Example::
|
||||
|
||||
# ...(snip)...
|
||||
from ryu.controller import dpset
|
||||
from os_ken.controller import dpset
|
||||
|
||||
|
||||
class MyApp(app_manager.RyuApp):
|
||||
@ -252,7 +252,7 @@ class DPSet(app_manager.RyuApp):
|
||||
|
||||
def get(self, dp_id):
|
||||
"""
|
||||
This method returns the ryu.controller.controller.Datapath
|
||||
This method returns the os_ken.controller.controller.Datapath
|
||||
instance for the given Datapath ID.
|
||||
"""
|
||||
return self.dps.get(dp_id)
|
||||
@ -262,7 +262,7 @@ class DPSet(app_manager.RyuApp):
|
||||
This method returns a list of tuples which represents
|
||||
instances for switches connected to this controller.
|
||||
The tuple consists of a Datapath ID and an instance of
|
||||
ryu.controller.controller.Datapath.
|
||||
os_ken.controller.controller.Datapath.
|
||||
|
||||
A return value looks like the following::
|
||||
|
||||
@ -324,24 +324,24 @@ class DPSet(app_manager.RyuApp):
|
||||
|
||||
def get_port(self, dpid, port_no):
|
||||
"""
|
||||
This method returns the ryu.controller.dpset.PortState
|
||||
This method returns the os_ken.controller.dpset.PortState
|
||||
instance for the given Datapath ID and the port number.
|
||||
Raises ryu_exc.PortNotFound if no such a datapath connected to
|
||||
Raises os_ken_exc.PortNotFound if no such a datapath connected to
|
||||
this controller or no such a port exists.
|
||||
"""
|
||||
try:
|
||||
return self.port_state[dpid][port_no]
|
||||
except KeyError:
|
||||
raise ryu_exc.PortNotFound(dpid=dpid, port=port_no,
|
||||
raise os_ken_exc.PortNotFound(dpid=dpid, port=port_no,
|
||||
network_id=None)
|
||||
|
||||
def get_ports(self, dpid):
|
||||
"""
|
||||
This method returns a list of ryu.controller.dpset.PortState
|
||||
This method returns a list of os_ken.controller.dpset.PortState
|
||||
instances for the given Datapath ID.
|
||||
Raises KeyError if no such a datapath connected to this controller.
|
||||
"""
|
||||
return list(self.port_state[dpid].values())
|
||||
|
||||
|
||||
handler.register_service('ryu.controller.dpset')
|
||||
handler.register_service('os_ken.controller.dpset')
|
@ -18,7 +18,7 @@ import inspect
|
||||
import logging
|
||||
import sys
|
||||
|
||||
LOG = logging.getLogger('ryu.controller.handler')
|
||||
LOG = logging.getLogger('os_ken.controller.handler')
|
||||
|
||||
# just represent OF datapath state. datapath specific so should be moved.
|
||||
HANDSHAKE_DISPATCHER = "handshake"
|
||||
@ -62,14 +62,14 @@ def set_ev_cls(ev_cls, dispatchers=None):
|
||||
=========================================== ===============================
|
||||
Negotiation phase Description
|
||||
=========================================== ===============================
|
||||
ryu.controller.handler.HANDSHAKE_DISPATCHER Sending and waiting for hello
|
||||
os_ken.controller.handler.HANDSHAKE_DISPATCHER Sending and waiting for hello
|
||||
message
|
||||
ryu.controller.handler.CONFIG_DISPATCHER Version negotiated and sent
|
||||
os_ken.controller.handler.CONFIG_DISPATCHER Version negotiated and sent
|
||||
features-request message
|
||||
ryu.controller.handler.MAIN_DISPATCHER Switch-features message
|
||||
os_ken.controller.handler.MAIN_DISPATCHER Switch-features message
|
||||
received and sent set-config
|
||||
message
|
||||
ryu.controller.handler.DEAD_DISPATCHER Disconnect from the peer. Or
|
||||
os_ken.controller.handler.DEAD_DISPATCHER Disconnect from the peer. Or
|
||||
disconnecting due to some
|
||||
unrecoverable errors.
|
||||
=========================================== ===============================
|
||||
@ -138,7 +138,7 @@ def get_dependent_services(cls):
|
||||
|
||||
def register_service(service):
|
||||
"""
|
||||
Register the ryu application specified by 'service' as
|
||||
Register the os_ken application specified by 'service' as
|
||||
a provider of events defined in the calling module.
|
||||
|
||||
If an application being loaded consumes events (in the sense of
|
@ -16,10 +16,10 @@
|
||||
|
||||
import logging
|
||||
|
||||
from ryu.exception import MacAddressDuplicated
|
||||
from ryu.lib.mac import haddr_to_str
|
||||
from os_ken.exception import MacAddressDuplicated
|
||||
from os_ken.lib.mac import haddr_to_str
|
||||
|
||||
LOG = logging.getLogger('ryu.controller.mac_to_network')
|
||||
LOG = logging.getLogger('os_ken.controller.mac_to_network')
|
||||
|
||||
|
||||
class MacToNetwork(object):
|
@ -15,9 +15,9 @@
|
||||
# limitations under the License.
|
||||
|
||||
import logging
|
||||
from ryu.lib.mac import haddr_to_str
|
||||
from os_ken.lib.mac import haddr_to_str
|
||||
|
||||
LOG = logging.getLogger('ryu.controller.mac_to_port')
|
||||
LOG = logging.getLogger('os_ken.controller.mac_to_port')
|
||||
|
||||
|
||||
class MacToPortTable(object):
|
@ -16,17 +16,17 @@
|
||||
|
||||
import collections
|
||||
|
||||
from ryu.base import app_manager
|
||||
import ryu.exception as ryu_exc
|
||||
from ryu.controller import event
|
||||
from ryu.exception import NetworkNotFound, NetworkAlreadyExist
|
||||
from ryu.exception import PortAlreadyExist, PortNotFound, PortUnknown
|
||||
from os_ken.base import app_manager
|
||||
import os_ken.exception as os_ken_exc
|
||||
from os_ken.controller import event
|
||||
from os_ken.exception import NetworkNotFound, NetworkAlreadyExist
|
||||
from os_ken.exception import PortAlreadyExist, PortNotFound, PortUnknown
|
||||
|
||||
|
||||
NW_ID_UNKNOWN = '__NW_ID_UNKNOWN__'
|
||||
|
||||
|
||||
class MacAddressAlreadyExist(ryu_exc.RyuException):
|
||||
class MacAddressAlreadyExist(os_ken_exc.RyuException):
|
||||
message = 'port (%(dpid)s, %(port)s) has already mac %(mac_address)s'
|
||||
|
||||
|
@ -14,14 +14,14 @@
|
||||
# limitations under the License.
|
||||
|
||||
"""
|
||||
OpenFlow related APIs of ryu.controller module.
|
||||
OpenFlow related APIs of os_ken.controller module.
|
||||
"""
|
||||
|
||||
import netaddr
|
||||
|
||||
from ryu.base import app_manager
|
||||
from ryu.lib import hub
|
||||
from ryu.lib import ip
|
||||
from os_ken.base import app_manager
|
||||
from os_ken.lib import hub
|
||||
from os_ken.lib import ip
|
||||
from . import ofp_event
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ def register_switch_address(addr, interval=None):
|
||||
Registers a new address to initiate connection to switch.
|
||||
|
||||
Registers a new IP address and port pair of switch to let
|
||||
ryu.controller.controller.OpenFlowController to try to initiate
|
||||
os_ken.controller.controller.OpenFlowController to try to initiate
|
||||
connection to switch.
|
||||
|
||||
:param addr: A tuple of (host, port) pair of switch.
|
||||
@ -62,7 +62,7 @@ def unregister_switch_address(addr):
|
||||
Unregister the given switch address.
|
||||
|
||||
Unregisters the given switch address to let
|
||||
ryu.controller.controller.OpenFlowController stop trying to initiate
|
||||
os_ken.controller.controller.OpenFlowController stop trying to initiate
|
||||
connection to switch.
|
||||
|
||||
:param addr: A tuple of (host, port) pair of switch.
|
@ -21,8 +21,8 @@ OpenFlow event definitions.
|
||||
import inspect
|
||||
import time
|
||||
|
||||
from ryu.controller import handler
|
||||
from ryu import ofproto
|
||||
from os_ken.controller import handler
|
||||
from os_ken import ofproto
|
||||
from . import event
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ class EventOFPMsgBase(event.EventBase):
|
||||
Attribute Description
|
||||
============ ==============================================================
|
||||
msg An object which describes the corresponding OpenFlow message.
|
||||
msg.datapath A ryu.controller.controller.Datapath instance
|
||||
msg.datapath A os_ken.controller.controller.Datapath instance
|
||||
which describes an OpenFlow switch from which we received
|
||||
this OpenFlow message.
|
||||
timestamp Timestamp when Datapath instance generated this event.
|
||||
@ -116,7 +116,7 @@ class EventOFPStateChange(event.EventBase):
|
||||
========= =================================================================
|
||||
Attribute Description
|
||||
========= =================================================================
|
||||
datapath ryu.controller.controller.Datapath instance of the switch
|
||||
datapath os_ken.controller.controller.Datapath instance of the switch
|
||||
========= =================================================================
|
||||
"""
|
||||
|
||||
@ -136,7 +136,7 @@ class EventOFPPortStateChange(event.EventBase):
|
||||
========= =================================================================
|
||||
Attribute Description
|
||||
========= =================================================================
|
||||
datapath ryu.controller.controller.Datapath instance of the switch
|
||||
datapath os_ken.controller.controller.Datapath instance of the switch
|
||||
reason one of OFPPR_*
|
||||
port_no Port number which state was changed
|
||||
========= =================================================================
|
||||
@ -149,4 +149,4 @@ class EventOFPPortStateChange(event.EventBase):
|
||||
self.port_no = port_no
|
||||
|
||||
|
||||
handler.register_service('ryu.controller.ofp_handler')
|
||||
handler.register_service('os_ken.controller.ofp_handler')
|
@ -22,16 +22,16 @@ import itertools
|
||||
import logging
|
||||
import warnings
|
||||
|
||||
import ryu.base.app_manager
|
||||
import os_ken.base.app_manager
|
||||
|
||||
from ryu.lib import hub
|
||||
from ryu import utils
|
||||
from ryu.controller import ofp_event
|
||||
from ryu.controller.controller import OpenFlowController
|
||||
from ryu.controller.handler import set_ev_handler
|
||||
from ryu.controller.handler import HANDSHAKE_DISPATCHER, CONFIG_DISPATCHER,\
|
||||
from os_ken.lib import hub
|
||||
from os_ken import utils
|
||||
from os_ken.controller import ofp_event
|
||||
from os_ken.controller.controller import OpenFlowController
|
||||
from os_ken.controller.handler import set_ev_handler
|
||||
from os_ken.controller.handler import HANDSHAKE_DISPATCHER, CONFIG_DISPATCHER,\
|
||||
MAIN_DISPATCHER
|
||||
from ryu.ofproto import ofproto_parser
|
||||
from os_ken.ofproto import ofproto_parser
|
||||
|
||||
|
||||
# The state transition: HANDSHAKE -> CONFIG -> MAIN
|
||||
@ -48,7 +48,7 @@ from ryu.ofproto import ofproto_parser
|
||||
# back Echo Reply message.
|
||||
|
||||
|
||||
class OFPHandler(ryu.base.app_manager.RyuApp):
|
||||
class OFPHandler(os_ken.base.app_manager.RyuApp):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(OFPHandler, self).__init__(*args, **kwargs)
|
||||
self.name = ofp_event.NAME
|
@ -17,21 +17,21 @@
|
||||
import collections
|
||||
import logging
|
||||
|
||||
import ryu.exception as ryu_exc
|
||||
from ryu.base import app_manager
|
||||
from ryu.controller import event
|
||||
import os_ken.exception as os_ken_exc
|
||||
from os_ken.base import app_manager
|
||||
from os_ken.controller import event
|
||||
|
||||
|
||||
class RemoteDPIDAlreadyExist(ryu_exc.RyuException):
|
||||
class RemoteDPIDAlreadyExist(os_ken_exc.RyuException):
|
||||
message = ('port (%(dpid)s, %(port)s) has already '
|
||||
'remote dpid %(remote_dpid)s')
|
||||
|
||||
|
||||
class TunnelKeyAlreadyExist(ryu_exc.RyuException):
|
||||
class TunnelKeyAlreadyExist(os_ken_exc.RyuException):
|
||||
message = 'tunnel key %(tunnel_key)s already exists'
|
||||
|
||||
|
||||
class TunnelKeyNotFound(ryu_exc.RyuException):
|
||||
class TunnelKeyNotFound(os_ken_exc.RyuException):
|
||||
message = 'no tunnel key for network %(network_id)s'
|
||||
|
||||
|
||||
@ -126,7 +126,7 @@ class TunnelKeys(dict):
|
||||
|
||||
def register_key(self, network_id, tunnel_key):
|
||||
if network_id in self:
|
||||
raise ryu_exc.NetworkAlreadyExist(network_id=network_id)
|
||||
raise os_ken_exc.NetworkAlreadyExist(network_id=network_id)
|
||||
if tunnel_key in self.values():
|
||||
raise TunnelKeyAlreadyExist(tunnel_key=tunnel_key)
|
||||
self._set_key(network_id, tunnel_key)
|
||||
@ -140,7 +140,7 @@ class TunnelKeys(dict):
|
||||
self._set_key(network_id, tunnel_key)
|
||||
return
|
||||
if key != tunnel_key:
|
||||
raise ryu_exc.NetworkAlreadyExist(network_id=network_id)
|
||||
raise os_ken_exc.NetworkAlreadyExist(network_id=network_id)
|
||||
|
||||
def delete_key(self, network_id):
|
||||
try:
|
||||
@ -148,7 +148,7 @@ class TunnelKeys(dict):
|
||||
self.send_event(EventTunnelKeyDel(network_id, tunnel_key))
|
||||
del self[network_id]
|
||||
except KeyError:
|
||||
raise ryu_exc.NetworkNotFound(network_id=network_id)
|
||||
raise os_ken_exc.NetworkNotFound(network_id=network_id)
|
||||
|
||||
|
||||
class DPIDs(object):
|
||||
@ -168,7 +168,7 @@ class DPIDs(object):
|
||||
|
||||
def add_remote_dpid(self, dpid, port_no, remote_dpid):
|
||||
if port_no in self.dpids[dpid]:
|
||||
raise ryu_exc.PortAlreadyExist(dpid=dpid, port=port_no,
|
||||
raise os_ken_exc.PortAlreadyExist(dpid=dpid, port=port_no,
|
||||
network_id=None)
|
||||
self._add_remote_dpid(dpid, port_no, remote_dpid)
|
||||
|
||||
@ -177,14 +177,14 @@ class DPIDs(object):
|
||||
if remote_dpid_ is None:
|
||||
self._add_remote_dpid(dpid, port_no, remote_dpid)
|
||||
elif remote_dpid_ != remote_dpid:
|
||||
raise ryu_exc.RemoteDPIDAlreadyExist(dpid=dpid, port=port_no,
|
||||
raise os_ken_exc.RemoteDPIDAlreadyExist(dpid=dpid, port=port_no,
|
||||
remote_dpid=remote_dpid)
|
||||
|
||||
def get_remote_dpid(self, dpid, port_no):
|
||||
try:
|
||||
return self.dpids[dpid][port_no]
|
||||
except KeyError:
|
||||
raise ryu_exc.PortNotFound(dpid=dpid, port=port_no)
|
||||
raise os_ken_exc.PortNotFound(dpid=dpid, port=port_no)
|
||||
|
||||
def delete_port(self, dpid, port_no):
|
||||
try:
|
||||
@ -192,19 +192,19 @@ class DPIDs(object):
|
||||
self.send_event(EventTunnelPort(dpid, port_no, remote_dpid, False))
|
||||
del self.dpids[dpid][port_no]
|
||||
except KeyError:
|
||||
raise ryu_exc.PortNotFound(dpid=dpid, port=port_no)
|
||||
raise os_ken_exc.PortNotFound(dpid=dpid, port=port_no)
|
||||
|
||||
def get_port(self, dpid, remote_dpid):
|
||||
try:
|
||||
dp = self.dpids[dpid]
|
||||
except KeyError:
|
||||
raise ryu_exc.PortNotFound(dpid=dpid, port=None, network_id=None)
|
||||
raise os_ken_exc.PortNotFound(dpid=dpid, port=None, network_id=None)
|
||||
|
||||
res = [port_no for (port_no, remote_dpid_) in dp.items()
|
||||
if remote_dpid_ == remote_dpid]
|
||||
assert len(res) <= 1
|
||||
if len(res) == 0:
|
||||
raise ryu_exc.PortNotFound(dpid=dpid, port=None, network_id=None)
|
||||
raise os_ken_exc.PortNotFound(dpid=dpid, port=None, network_id=None)
|
||||
return res[0]
|
||||
|
||||
|
@ -19,7 +19,7 @@ global flags
|
||||
|
||||
from distutils.version import LooseVersion
|
||||
|
||||
from ryu import cfg
|
||||
from os_ken import cfg
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
@ -45,7 +45,7 @@ CONF.register_cli_opts([
|
||||
cfg.IntOpt('tester_recv_port_2', default=3,
|
||||
help='tester sw receiving port 2 '
|
||||
'(default: 3)'),
|
||||
cfg.StrOpt('dir', default='ryu/tests/switch/of13',
|
||||
cfg.StrOpt('dir', default='os_ken/tests/switch/of13',
|
||||
help='test files directory'),
|
||||
cfg.StrOpt('target-version', default='openflow13',
|
||||
help='target sw OFP version '
|
@ -18,7 +18,7 @@
|
||||
import os
|
||||
import sys
|
||||
from setuptools.command import easy_install
|
||||
from ryu import version
|
||||
from os_ken import version
|
||||
|
||||
|
||||
# Global variables in this module doesn't work as we expect
|
||||
@ -63,7 +63,7 @@ def setup_hook(config):
|
||||
orig_get_version = packaging.get_version
|
||||
|
||||
def my_get_version(package_name, pre_version=None):
|
||||
if package_name == 'ryu':
|
||||
if package_name == 'os_ken':
|
||||
return str(version)
|
||||
return orig_get_version(package_name, pre_version)
|
||||
|
@ -39,23 +39,23 @@ import random
|
||||
|
||||
import six
|
||||
|
||||
from ryu.base import app_manager
|
||||
from ryu.controller import event
|
||||
from ryu.controller import ofp_event
|
||||
from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
from ryu.exception import RyuException
|
||||
from ryu.ofproto.ether import ETH_TYPE_IP, ETH_TYPE_ARP
|
||||
from ryu.ofproto import ofproto_v1_3
|
||||
from ryu.ofproto import inet
|
||||
from ryu.lib import hub
|
||||
from ryu.lib.packet import packet
|
||||
from ryu.lib.packet import ethernet
|
||||
from ryu.lib.packet import ipv4
|
||||
from ryu.lib.packet import udp
|
||||
from ryu.lib.packet import bfd
|
||||
from ryu.lib.packet import arp
|
||||
from ryu.lib.packet.arp import ARP_REQUEST, ARP_REPLY
|
||||
from os_ken.base import app_manager
|
||||
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.ofproto.ether import ETH_TYPE_IP, ETH_TYPE_ARP
|
||||
from os_ken.ofproto import ofproto_v1_3
|
||||
from os_ken.ofproto import inet
|
||||
from os_ken.lib import hub
|
||||
from os_ken.lib.packet import packet
|
||||
from os_ken.lib.packet import ethernet
|
||||
from os_ken.lib.packet import ipv4
|
||||
from os_ken.lib.packet import udp
|
||||
from os_ken.lib.packet import bfd
|
||||
from os_ken.lib.packet import arp
|
||||
from os_ken.lib.packet.arp import ARP_REQUEST, ARP_REPLY
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
@ -657,11 +657,11 @@ class BFDLib(app_manager.RyuApp):
|
||||
|
||||
Example::
|
||||
|
||||
from ryu.base import app_manager
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
from ryu.ofproto import ofproto_v1_3
|
||||
from ryu.lib import bfdlib
|
||||
from ryu.lib.packet import bfd
|
||||
from os_ken.base import app_manager
|
||||
from os_ken.controller.handler import set_ev_cls
|
||||
from os_ken.ofproto import ofproto_v1_3
|
||||
from os_ken.lib import bfdlib
|
||||
from os_ken.lib.packet import bfd
|
||||
|
||||
class Foo(app_manager.RyuApp):
|
||||
OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION]
|
@ -16,7 +16,7 @@
|
||||
|
||||
import logging
|
||||
import os
|
||||
from ryu.lib import ip
|
||||
from os_ken.lib import ip
|
||||
|
||||
|
||||
# We don't bother to use cfg.py because monkey patch needs to be
|
||||
@ -24,7 +24,7 @@ from ryu.lib import ip
|
||||
# select the type of hub.
|
||||
HUB_TYPE = os.getenv('RYU_HUB_TYPE', 'eventlet')
|
||||
|
||||
LOG = logging.getLogger('ryu.lib.hub')
|
||||
LOG = logging.getLogger('os_ken.lib.hub')
|
||||
|
||||
if HUB_TYPE == 'eventlet':
|
||||
import eventlet
|
@ -16,24 +16,24 @@
|
||||
import logging
|
||||
import struct
|
||||
|
||||
from ryu.base import app_manager
|
||||
from ryu.controller import event
|
||||
from ryu.controller import ofp_event
|
||||
from ryu.controller.handler import DEAD_DISPATCHER
|
||||
from ryu.controller.handler import MAIN_DISPATCHER
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
from ryu.ofproto import ether
|
||||
from ryu.ofproto import inet
|
||||
from ryu.ofproto import ofproto_v1_0
|
||||
from ryu.ofproto import ofproto_v1_2
|
||||
from ryu.ofproto import ofproto_v1_3
|
||||
from ryu.lib import addrconv
|
||||
from ryu.lib import hub
|
||||
from ryu.lib.dpid import dpid_to_str
|
||||
from ryu.lib.packet import packet
|
||||
from ryu.lib.packet import ethernet
|
||||
from ryu.lib.packet import ipv4
|
||||
from ryu.lib.packet import igmp
|
||||
from os_ken.base import app_manager
|
||||
from os_ken.controller import event
|
||||
from os_ken.controller import ofp_event
|
||||
from os_ken.controller.handler import DEAD_DISPATCHER
|
||||
from os_ken.controller.handler import MAIN_DISPATCHER
|
||||
from os_ken.controller.handler import set_ev_cls
|
||||
from os_ken.ofproto import ether
|
||||
from os_ken.ofproto import inet
|
||||
from os_ken.ofproto import ofproto_v1_0
|
||||
from os_ken.ofproto import ofproto_v1_2
|
||||
from os_ken.ofproto import ofproto_v1_3
|
||||
from os_ken.lib import addrconv
|
||||
from os_ken.lib import hub
|
||||
from os_ken.lib.dpid import dpid_to_str
|
||||
from os_ken.lib.packet import packet
|
||||
from os_ken.lib.packet import ethernet
|
||||
from os_ken.lib.packet import ipv4
|
||||
from os_ken.lib.packet import igmp
|
||||
|
||||
|
||||
class EventPacketIn(event.EventBase):
|
@ -18,8 +18,8 @@ import struct
|
||||
|
||||
import netaddr
|
||||
|
||||
from ryu.lib import addrconv
|
||||
from ryu.lib import type_desc
|
||||
from os_ken.lib import addrconv
|
||||
from os_ken.lib import type_desc
|
||||
|
||||
|
||||
def _valid_ip(strategy, bits, addr, flags=0):
|
@ -15,20 +15,20 @@
|
||||
|
||||
import logging
|
||||
|
||||
from ryu.base import app_manager
|
||||
from ryu.controller import event
|
||||
from ryu.controller import ofp_event
|
||||
from ryu.controller.handler import MAIN_DISPATCHER
|
||||
from ryu.controller.handler import set_ev_cls
|
||||
from ryu.ofproto import ether
|
||||
from ryu.ofproto import ofproto_v1_0
|
||||
from ryu.ofproto import ofproto_v1_2
|
||||
from ryu.ofproto import ofproto_v1_3
|
||||
from ryu.lib import addrconv
|
||||
from ryu.lib.dpid import dpid_to_str
|
||||
from ryu.lib.packet import packet
|
||||
from ryu.lib.packet import ethernet
|
||||
from ryu.lib.packet import slow
|
||||
from os_ken.base import app_manager
|
||||
from os_ken.controller import event
|
||||
from os_ken.controller import ofp_event
|
||||
from os_ken.controller.handler import MAIN_DISPATCHER
|
||||
from os_ken.controller.handler import set_ev_cls
|
||||
from os_ken.ofproto import ether
|
||||
from os_ken.ofproto import ofproto_v1_0
|
||||
from os_ken.ofproto import ofproto_v1_2
|
||||
from os_ken.ofproto import ofproto_v1_3
|
||||
from os_ken.lib import addrconv
|
||||
from os_ken.lib.dpid import dpid_to_str
|
||||
from os_ken.lib.packet import packet
|
||||
from os_ken.lib.packet import ethernet
|
||||
from os_ken.lib.packet import slow
|
||||
|
||||
|
||||
class EventPacketIn(event.EventBase):
|
@ -16,7 +16,7 @@
|
||||
|
||||
import six
|
||||
|
||||
from ryu.lib import addrconv
|
||||
from os_ken.lib import addrconv
|
||||
|
||||
if six.PY3:
|
||||
_ord = int
|
@ -26,12 +26,12 @@ import time
|
||||
import netaddr
|
||||
import six
|
||||
|
||||
from ryu.lib import addrconv
|
||||
from ryu.lib import ip
|
||||
from ryu.lib import stringify
|
||||
from ryu.lib import type_desc
|
||||
from ryu.lib.packet import bgp
|
||||
from ryu.lib.packet import ospf
|
||||
from os_ken.lib import addrconv
|
||||
from os_ken.lib import ip
|
||||
from os_ken.lib import stringify
|
||||
from os_ken.lib import type_desc
|
||||
from os_ken.lib.packet import bgp
|
||||
from os_ken.lib.packet import ospf
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
@ -1128,7 +1128,7 @@ class Reader(object):
|
||||
Example of Usage::
|
||||
|
||||
import bz2
|
||||
from ryu.lib import mrtlib
|
||||
from os_ken.lib import mrtlib
|
||||
|
||||
count = 0
|
||||
for record in mrtlib.Reader(
|
||||
@ -1181,8 +1181,8 @@ class Writer(object):
|
||||
|
||||
import bz2
|
||||
import time
|
||||
from ryu.lib import mrtlib
|
||||
from ryu.lib.packet import bgp
|
||||
from os_ken.lib import mrtlib
|
||||
from os_ken.lib.packet import bgp
|
||||
|
||||
mrt_writer = mrtlib.Writer(
|
||||
bz2.BZ2File('rib.YYYYMMDD.hhmm.bz2', 'wb'))
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user