From f1d6e38cc0f2fd4b0523f7f56fb2b33b489f9443 Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Tue, 9 Oct 2018 21:33:00 +0000 Subject: [PATCH] Convert namespace from 'ryu' to 'os_ken' Some python files under os_ken/lib/ still import from the 'ryu' namespace. This commit fixes it. Change-Id: Ia95d7c314142648aa32b3718d29ff7aaeb82028c --- os_ken/lib/netconf/__init__.py | 2 +- os_ken/lib/of_config/base.py | 2 +- os_ken/lib/of_config/capable_switch.py | 10 +- os_ken/lib/of_config/classes.py | 2 +- os_ken/lib/of_config/generated_classes.py | 2 +- os_ken/lib/ofctl_nicira_ext.py | 2 +- os_ken/lib/ofctl_string.py | 36 +++--- os_ken/lib/ofctl_utils.py | 6 +- os_ken/lib/ofctl_v1_0.py | 8 +- os_ken/lib/ofctl_v1_2.py | 12 +- os_ken/lib/ofctl_v1_3.py | 16 +-- os_ken/lib/ofctl_v1_4.py | 8 +- os_ken/lib/ofctl_v1_5.py | 8 +- os_ken/lib/ofp_pktinfilter.py | 2 +- os_ken/lib/ovs/bridge.py | 26 ++--- os_ken/lib/ovs/vsctl.py | 12 +- os_ken/lib/ovs/vswitch_idl.py | 2 +- os_ken/lib/packet/arp.py | 2 +- os_ken/lib/packet/bfd.py | 4 +- os_ken/lib/packet/bgp.py | 34 +++--- os_ken/lib/packet/bmp.py | 10 +- os_ken/lib/packet/bpdu.py | 2 +- os_ken/lib/packet/cfm.py | 34 +++--- os_ken/lib/packet/dhcp.py | 8 +- os_ken/lib/packet/dhcp6.py | 8 +- os_ken/lib/packet/ethernet.py | 4 +- os_ken/lib/packet/geneve.py | 4 +- os_ken/lib/packet/gre.py | 2 +- os_ken/lib/packet/icmp.py | 14 +-- os_ken/lib/packet/icmpv6.py | 48 ++++---- os_ken/lib/packet/igmp.py | 12 +- os_ken/lib/packet/ipv4.py | 2 +- os_ken/lib/packet/ipv6.py | 18 +-- os_ken/lib/packet/linux.py | 2 +- os_ken/lib/packet/llc.py | 8 +- os_ken/lib/packet/lldp.py | 4 +- os_ken/lib/packet/mpls.py | 2 +- os_ken/lib/packet/openflow.py | 10 +- os_ken/lib/packet/ospf.py | 12 +- os_ken/lib/packet/packet.py | 6 +- os_ken/lib/packet/packet_base.py | 2 +- os_ken/lib/packet/packet_utils.py | 2 +- os_ken/lib/packet/pbb.py | 4 +- os_ken/lib/packet/sctp.py | 136 +++++++++++----------- os_ken/lib/packet/slow.py | 2 +- os_ken/lib/packet/tcp.py | 4 +- os_ken/lib/packet/vrrp.py | 36 +++--- os_ken/lib/packet/vxlan.py | 4 +- os_ken/lib/packet/zebra.py | 14 +-- os_ken/lib/pcaplib.py | 6 +- os_ken/lib/snortlib.py | 6 +- os_ken/lib/sockaddr.py | 2 +- os_ken/lib/sockopt.py | 2 +- os_ken/lib/stplib.py | 34 +++--- os_ken/lib/type_desc.py | 2 +- os_ken/lib/xflow/sflow.py | 2 +- 56 files changed, 332 insertions(+), 332 deletions(-) diff --git a/os_ken/lib/netconf/__init__.py b/os_ken/lib/netconf/__init__.py index c21554ca..b51516b3 100644 --- a/os_ken/lib/netconf/__init__.py +++ b/os_ken/lib/netconf/__init__.py @@ -15,7 +15,7 @@ # limitations under the License. """ -NETCONF definitions used by ryu/lib/of_config. +NETCONF definitions used by os_ken/lib/of_config. """ import os.path diff --git a/os_ken/lib/of_config/base.py b/os_ken/lib/of_config/base.py index e2e4eb5c..9e71e762 100644 --- a/os_ken/lib/of_config/base.py +++ b/os_ken/lib/of_config/base.py @@ -18,7 +18,7 @@ # in a little more pythonic way. # currently assuming OF-Config 1.1.1. -from ryu.lib import stringify +from os_ken.lib import stringify from lxml import objectify import lxml.etree as ET diff --git a/os_ken/lib/of_config/capable_switch.py b/os_ken/lib/of_config/capable_switch.py index 91f40134..47b9b2b1 100644 --- a/os_ken/lib/of_config/capable_switch.py +++ b/os_ken/lib/of_config/capable_switch.py @@ -18,15 +18,15 @@ import ncclient import ncclient.manager import ncclient.xml_ -from ryu import exception as ryu_exc -from ryu.lib import of_config -from ryu.lib.of_config import constants as ofc_consts -from ryu.lib.of_config import classes as ofc +from os_ken import exception as os_ken_exc +from os_ken.lib import of_config +from os_ken.lib.of_config import constants as ofc_consts +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(ryu_exc.RyuException, +class OFConfigCapableSwitchNotFound(os_ken_exc.RyuException, ncclient.NCClientError): message = 'OpenFlow Capable Switch not found' diff --git a/os_ken/lib/of_config/classes.py b/os_ken/lib/of_config/classes.py index e747186e..78404eeb 100644 --- a/os_ken/lib/of_config/classes.py +++ b/os_ken/lib/of_config/classes.py @@ -18,7 +18,7 @@ # in a little more pythonic way. # currently assuming OF-Config 1.1.1. -from ryu.lib import stringify +from os_ken.lib import stringify from .base import _Base, _ct, _e, _ns_netconf diff --git a/os_ken/lib/of_config/generated_classes.py b/os_ken/lib/of_config/generated_classes.py index 14038b55..df740944 100644 --- a/os_ken/lib/of_config/generated_classes.py +++ b/os_ken/lib/of_config/generated_classes.py @@ -18,7 +18,7 @@ # file if/when OF-Config yang specification is available with a suitable # license. -from ryu.lib.of_config.base import _Base, _e, _ct +from os_ken.lib.of_config.base import _Base, _e, _ct class OFPortConfigurationType(_Base): diff --git a/os_ken/lib/ofctl_nicira_ext.py b/os_ken/lib/ofctl_nicira_ext.py index 98f5167a..046a97b9 100644 --- a/os_ken/lib/ofctl_nicira_ext.py +++ b/os_ken/lib/ofctl_nicira_ext.py @@ -16,7 +16,7 @@ import base64 import logging -from ryu.ofproto import nicira_ext +from os_ken.ofproto import nicira_ext LOG = logging.getLogger(__name__) diff --git a/os_ken/lib/ofctl_string.py b/os_ken/lib/ofctl_string.py index fe0eeaea..cf28c5d9 100644 --- a/os_ken/lib/ofctl_string.py +++ b/os_ken/lib/ofctl_string.py @@ -15,9 +15,9 @@ import re -import ryu.exception -from ryu.lib.ofctl_utils import str_to_int -from ryu.ofproto import nicira_ext +import os_ken.exception +from os_ken.lib.ofctl_utils import str_to_int +from os_ken.ofproto import nicira_ext def ofp_instruction_from_str(ofproto, action_str): @@ -44,7 +44,7 @@ def ofp_instruction_from_str(ofproto, action_str): while len(action_str): m = action_re.match(action_str) if not m: - raise ryu.exception.OFPInvalidActionString(action_str=action_str) + raise os_ken.exception.OFPInvalidActionString(action_str=action_str) action_name = m.group(1) this_action = m.group(0) paren_level = this_action.count('(') - this_action.count(')') @@ -59,14 +59,14 @@ def ofp_instruction_from_str(ofproto, action_str): assert rest[0] == ',' rest = rest[1:] except Exception: - raise ryu.exception.OFPInvalidActionString(action_str=action_str) + raise os_ken.exception.OFPInvalidActionString(action_str=action_str) if action_name == 'drop': assert this_action == 'drop' assert len(result) == 0 and rest == '' return [] converter = getattr(OfctlActionConverter, action_name, None) if converter is None or not callable(converter): - raise ryu.exception.OFPInvalidActionString(action_str=action_name) + raise os_ken.exception.OFPInvalidActionString(action_str=action_name) result.append(converter(ofproto, this_action)) action_str = rest @@ -113,7 +113,7 @@ def tokenize_ofp_instruction_arg(arg): rest = rest[1:] return result except Exception: - raise ryu.exception.OFPInvalidActionString(action_str=arg) + raise os_ken.exception.OFPInvalidActionString(action_str=arg) _OXM_FIELD_OFCTL_ALIASES = { @@ -137,8 +137,8 @@ _OXM_FIELD_OFCTL_ALIASES = { } -def ofp_ofctl_field_name_to_ryu(field): - """Convert an ovs-ofctl field name to ryu equivalent.""" +def ofp_ofctl_field_name_to_os_ken(field): + """Convert an ovs-ofctl field name to os_ken equivalent.""" mapped = _OXM_FIELD_OFCTL_ALIASES.get(field) if mapped: return mapped @@ -164,10 +164,10 @@ _NXM_OF_FIELD_MAP.update({ 'icmp_type': 'icmpv4_type_nxm', 'icmp_code': 'icmpv4_code_nxm'}) -def nxm_field_name_to_ryu(field): +def nxm_field_name_to_os_ken(field): """ Convert an ovs-ofctl style NXM_/OXM_ field name to - a ryu match field name. + a os_ken match field name. """ if field.endswith("_W"): field = field[:-2] @@ -219,7 +219,7 @@ class OfctlActionConverter(object): try: assert action_str.startswith("set_field:") value, key = action_str[len("set_field:"):].split("->", 1) - fieldarg = dict(field=ofp_ofctl_field_name_to_ryu(key)) + fieldarg = dict(field=ofp_ofctl_field_name_to_os_ken(key)) m = value.find('/') if m >= 0: fieldarg['value'] = str_to_int(value[:m]) @@ -227,7 +227,7 @@ class OfctlActionConverter(object): else: fieldarg['value'] = str_to_int(value) except Exception: - raise ryu.exception.OFPInvalidActionString(action_str=action_str) + raise os_ken.exception.OFPInvalidActionString(action_str=action_str) return dict(OFPActionSetField={ 'field': {'OXMTlv': fieldarg}}) @@ -249,7 +249,7 @@ class OfctlActionConverter(object): raise Exception return dict(NXActionResubmitTable=kwargs) except Exception: - raise ryu.exception.OFPInvalidActionString( + raise os_ken.exception.OFPInvalidActionString( action_str=action_str) @classmethod @@ -267,7 +267,7 @@ class OfctlActionConverter(object): 'n_clauses': clauses[1], 'id': id_}) except Exception: - raise ryu.exception.OFPInvalidActionString( + raise os_ken.exception.OFPInvalidActionString( action_str=action_str) @classmethod @@ -283,7 +283,7 @@ class OfctlActionConverter(object): if len(action_str) > 2: if (not action_str.startswith('ct(') or action_str[-1] != ')'): - raise ryu.exception.OFPInvalidActionString( + raise os_ken.exception.OFPInvalidActionString( action_str=action_str) rest = tokenize_ofp_instruction_arg(action_str[len('ct('):-1]) else: @@ -307,14 +307,14 @@ class OfctlActionConverter(object): if m: zone_ofs_nbits = nicira_ext.ofs_nbits( int(m.group(1)), int(m.group(2))) - zone_src = nxm_field_name_to_ryu( + zone_src = nxm_field_name_to_os_ken( v[:m.start(0)]) else: zone_ofs_nbits = str_to_int(v) elif k == 'alg': alg = str_to_port[arg[len('alg='):]] except Exception: - raise ryu.exception.OFPInvalidActionString( + raise os_ken.exception.OFPInvalidActionString( action_str=action_str) return dict(NXActionCT={'flags': flags, 'zone_src': zone_src, diff --git a/os_ken/lib/ofctl_utils.py b/os_ken/lib/ofctl_utils.py index 493ca354..83417c6b 100644 --- a/os_ken/lib/ofctl_utils.py +++ b/os_ken/lib/ofctl_utils.py @@ -19,9 +19,9 @@ import logging import netaddr import six -from ryu.lib import dpid -from ryu.lib import hub -from ryu.ofproto import ofproto_v1_2 +from os_ken.lib import dpid +from os_ken.lib import hub +from os_ken.ofproto import ofproto_v1_2 LOG = logging.getLogger(__name__) diff --git a/os_ken/lib/ofctl_v1_0.py b/os_ken/lib/ofctl_v1_0.py index b15073d8..5d601d32 100644 --- a/os_ken/lib/ofctl_v1_0.py +++ b/os_ken/lib/ofctl_v1_0.py @@ -17,12 +17,12 @@ import struct import socket import logging -from ryu.ofproto import ofproto_v1_0 -from ryu.lib import ofctl_utils -from ryu.lib.mac import haddr_to_bin, haddr_to_str +from os_ken.ofproto import ofproto_v1_0 +from os_ken.lib import ofctl_utils +from os_ken.lib.mac import haddr_to_bin, haddr_to_str -LOG = logging.getLogger('ryu.lib.ofctl_v1_0') +LOG = logging.getLogger('os_ken.lib.ofctl_v1_0') DEFAULT_TIMEOUT = 1.0 # TODO:XXX diff --git a/os_ken/lib/ofctl_v1_2.py b/os_ken/lib/ofctl_v1_2.py index 7dfc7b9e..16288c07 100644 --- a/os_ken/lib/ofctl_v1_2.py +++ b/os_ken/lib/ofctl_v1_2.py @@ -16,14 +16,14 @@ import logging import netaddr -from ryu.ofproto import ether -from ryu.ofproto import inet -from ryu.ofproto import ofproto_v1_2 -from ryu.ofproto import ofproto_v1_2_parser -from ryu.lib import ofctl_utils +from os_ken.ofproto import ether +from os_ken.ofproto import inet +from os_ken.ofproto import ofproto_v1_2 +from os_ken.ofproto import ofproto_v1_2_parser +from os_ken.lib import ofctl_utils -LOG = logging.getLogger('ryu.lib.ofctl_v1_2') +LOG = logging.getLogger('os_ken.lib.ofctl_v1_2') DEFAULT_TIMEOUT = 1.0 diff --git a/os_ken/lib/ofctl_v1_3.py b/os_ken/lib/ofctl_v1_3.py index 91ae9a0f..2d85502a 100644 --- a/os_ken/lib/ofctl_v1_3.py +++ b/os_ken/lib/ofctl_v1_3.py @@ -16,16 +16,16 @@ import base64 import logging -from ryu.ofproto import ether -from ryu.ofproto import inet -from ryu.ofproto import ofproto_common -from ryu.ofproto import ofproto_v1_3 -from ryu.ofproto import ofproto_v1_3_parser -from ryu.lib import ofctl_nicira_ext -from ryu.lib import ofctl_utils +from os_ken.ofproto import ether +from os_ken.ofproto import inet +from os_ken.ofproto import ofproto_common +from os_ken.ofproto import ofproto_v1_3 +from os_ken.ofproto import ofproto_v1_3_parser +from os_ken.lib import ofctl_nicira_ext +from os_ken.lib import ofctl_utils -LOG = logging.getLogger('ryu.lib.ofctl_v1_3') +LOG = logging.getLogger('os_ken.lib.ofctl_v1_3') DEFAULT_TIMEOUT = 1.0 diff --git a/os_ken/lib/ofctl_v1_4.py b/os_ken/lib/ofctl_v1_4.py index 600f9915..effa3e13 100644 --- a/os_ken/lib/ofctl_v1_4.py +++ b/os_ken/lib/ofctl_v1_4.py @@ -15,10 +15,10 @@ import logging -from ryu.ofproto import ether -from ryu.ofproto import ofproto_v1_4 -from ryu.ofproto import ofproto_v1_4_parser -from ryu.lib import ofctl_utils +from os_ken.ofproto import ether +from os_ken.ofproto import ofproto_v1_4 +from os_ken.ofproto import ofproto_v1_4_parser +from os_ken.lib import ofctl_utils LOG = logging.getLogger(__name__) diff --git a/os_ken/lib/ofctl_v1_5.py b/os_ken/lib/ofctl_v1_5.py index 90eb3829..c4e30148 100644 --- a/os_ken/lib/ofctl_v1_5.py +++ b/os_ken/lib/ofctl_v1_5.py @@ -16,10 +16,10 @@ import base64 import logging -from ryu.ofproto import ether -from ryu.ofproto import ofproto_v1_5 -from ryu.ofproto import ofproto_v1_5_parser -from ryu.lib import ofctl_utils +from os_ken.ofproto import ether +from os_ken.ofproto import ofproto_v1_5 +from os_ken.ofproto import ofproto_v1_5_parser +from os_ken.lib import ofctl_utils LOG = logging.getLogger(__name__) diff --git a/os_ken/lib/ofp_pktinfilter.py b/os_ken/lib/ofp_pktinfilter.py index 41db584b..3910758e 100644 --- a/os_ken/lib/ofp_pktinfilter.py +++ b/os_ken/lib/ofp_pktinfilter.py @@ -18,7 +18,7 @@ import logging from abc import ABCMeta, abstractmethod import six -from ryu.lib.packet import packet +from os_ken.lib.packet import packet LOG = logging.getLogger(__name__) diff --git a/os_ken/lib/ovs/bridge.py b/os_ken/lib/ovs/bridge.py index f86e9ae0..a7061aca 100644 --- a/os_ken/lib/ovs/bridge.py +++ b/os_ken/lib/ovs/bridge.py @@ -15,17 +15,17 @@ # limitations under the License. """ -Wrapper utility library of :py:mod:`ryu.lib.ovs.vsctl` +Wrapper utility library of :py:mod:`os_ken.lib.ovs.vsctl` """ import functools import logging -from ryu import cfg -import ryu.exception as ryu_exc -import ryu.lib.dpid as dpid_lib -import ryu.lib.ovs.vsctl as ovs_vsctl -from ryu.lib.ovs.vsctl import valid_ovsdb_addr +from os_ken import cfg +import os_ken.exception as os_ken_exc +import os_ken.lib.dpid as dpid_lib +import os_ken.lib.ovs.vsctl as ovs_vsctl +from os_ken.lib.ovs.vsctl import valid_ovsdb_addr LOG = logging.getLogger(__name__) @@ -36,7 +36,7 @@ CONF.register_opts([ ]) -class OVSBridgeNotFound(ryu_exc.RyuException): +class OVSBridgeNotFound(os_ken_exc.RyuException): message = 'no bridge for datapath_id %(datapath_id)s' @@ -93,7 +93,7 @@ class TunnelPort(object): class OVSBridge(object): """ - Class to provide wrapper utilities of :py:mod:`ryu.lib.ovs.vsctl.VSCtl` + 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 @@ -103,14 +103,14 @@ class OVSBridge(object): ``ovsdb_addr`` specifies the address of the OVS instance. Automatically validated when you call ``init()`` method. - Refer to :py:mod:`ryu.lib.ovs.vsctl.valid_ovsdb_addr` for the format of + Refer to :py:mod:`os_ken.lib.ovs.vsctl.valid_ovsdb_addr` for the format of this address. if ``timeout`` is omitted, ``CONF.ovsdb_timeout`` will be used as the default value. Usage of ``timeout`` and ``exception`` is the same with ``timeout_sec`` - and ``exception`` of :py:mod:`ryu.lib.ovs.vsctl.VSCtl.run_command`. + and ``exception`` of :py:mod:`os_ken.lib.ovs.vsctl.VSCtl.run_command`. """ def __init__(self, CONF, datapath_id, ovsdb_addr, timeout=None, @@ -129,10 +129,10 @@ class OVSBridge(object): Executes the given commands and sends OVSDB messages. ``commands`` must be a list of - :py:mod:`ryu.lib.ovs.vsctl.VSCtlCommand`. + :py:mod:`os_ken.lib.ovs.vsctl.VSCtlCommand`. The given ``timeout`` and ``exception`` when instantiation will be used - to call :py:mod:`ryu.lib.ovs.vsctl.VSCtl.run_command`. + to call :py:mod:`os_ken.lib.ovs.vsctl.VSCtl.run_command`. """ self.vsctl.run_command(commands, self.timeout, self.exception) @@ -142,7 +142,7 @@ class OVSBridge(object): If failed to connect to OVS instance or the given ``datapath_id`` does not match with the Datapath ID of the connected OVS instance, raises - :py:mod:`ryu.lib.ovs.bridge.OVSBridgeNotFound` exception. + :py:mod:`os_ken.lib.ovs.bridge.OVSBridgeNotFound` exception. """ if not valid_ovsdb_addr(self.ovsdb_addr): raise ValueError('Invalid OVSDB address: %s' % self.ovsdb_addr) diff --git a/os_ken/lib/ovs/vsctl.py b/os_ken/lib/ovs/vsctl.py index 53ee7f42..b20dbb1d 100644 --- a/os_ken/lib/ovs/vsctl.py +++ b/os_ken/lib/ovs/vsctl.py @@ -40,10 +40,10 @@ from ovs import ovsuuid from ovs import stream from ovs.db import idl -from ryu.lib import hub -from ryu.lib import ip -from ryu.lib.ovs import vswitch_idl -from ryu.lib.stringify import StringifyMixin +from os_ken.lib import hub +from os_ken.lib import ip +from os_ken.lib.ovs import vswitch_idl +from os_ken.lib.stringify import StringifyMixin LOG = logging.getLogger(__name__) # use ovs.vlog? @@ -1013,7 +1013,7 @@ class VSCtl(object): A class to describe an Open vSwitch instance. ``remote`` specifies the address of the OVS instance. - :py:mod:`ryu.lib.ovs.vsctl.valid_ovsdb_addr` is a convenient function to + :py:mod:`os_ken.lib.ovs.vsctl.valid_ovsdb_addr` is a convenient function to validate this address. """ @@ -1279,7 +1279,7 @@ class VSCtl(object): Executes the given commands and sends OVSDB messages. ``commands`` must be a list of - :py:mod:`ryu.lib.ovs.vsctl.VSCtlCommand`. + :py:mod:`os_ken.lib.ovs.vsctl.VSCtlCommand`. If ``timeout_sec`` is specified, raises exception after the given timeout [sec]. Additionally, if ``exception`` is specified, this diff --git a/os_ken/lib/ovs/vswitch_idl.py b/os_ken/lib/ovs/vswitch_idl.py index 523d5517..a1269717 100644 --- a/os_ken/lib/ovs/vswitch_idl.py +++ b/os_ken/lib/ovs/vswitch_idl.py @@ -15,7 +15,7 @@ # limitations under the License. # Do NOT edit. -# This is automatically generated by ryu/lib/ovs/vsctl.py +# This is automatically generated by os_ken/lib/ovs/vsctl.py # created based on version 7.14.0 diff --git a/os_ken/lib/packet/arp.py b/os_ken/lib/packet/arp.py index 5a0eea4d..144baf2b 100644 --- a/os_ken/lib/packet/arp.py +++ b/os_ken/lib/packet/arp.py @@ -15,7 +15,7 @@ import struct -from ryu.lib import addrconv +from os_ken.lib import addrconv from . import ether_types as ether from . import packet_base diff --git a/os_ken/lib/packet/bfd.py b/os_ken/lib/packet/bfd.py index 1082f9c0..e302616c 100644 --- a/os_ken/lib/packet/bfd.py +++ b/os_ken/lib/packet/bfd.py @@ -82,8 +82,8 @@ import six import struct from . import packet_base -from ryu.lib import addrconv -from ryu.lib import stringify +from os_ken.lib import addrconv +from os_ken.lib import stringify BFD_STATE_ADMIN_DOWN = 0 BFD_STATE_DOWN = 1 diff --git a/os_ken/lib/packet/bgp.py b/os_ken/lib/packet/bgp.py index 9e501515..26714800 100644 --- a/os_ken/lib/packet/bgp.py +++ b/os_ken/lib/packet/bgp.py @@ -37,20 +37,20 @@ import struct import netaddr import six -from ryu.lib.stringify import StringifyMixin -from ryu.lib.packet import afi as addr_family -from ryu.lib.packet import safi as subaddr_family -from ryu.lib.packet import packet_base -from ryu.lib.packet import stream_parser -from ryu.lib.packet import vxlan -from ryu.lib.packet import mpls -from ryu.lib import addrconv -from ryu.lib import type_desc -from ryu.lib.type_desc import TypeDisp -from ryu.lib import ip -from ryu.lib.pack_utils import msg_pack_into -from ryu.utils import binary_str -from ryu.utils import import_module +from os_ken.lib.stringify import StringifyMixin +from os_ken.lib.packet import afi as addr_family +from os_ken.lib.packet import safi as subaddr_family +from os_ken.lib.packet import packet_base +from os_ken.lib.packet import stream_parser +from os_ken.lib.packet import vxlan +from os_ken.lib.packet import mpls +from os_ken.lib import addrconv +from os_ken.lib import type_desc +from os_ken.lib.type_desc import TypeDisp +from os_ken.lib import ip +from os_ken.lib.pack_utils import msg_pack_into +from os_ken.utils import binary_str +from os_ken.utils import import_module reduce = six.moves.reduce @@ -2261,7 +2261,7 @@ class FlowSpecVPNv4NLRI(_FlowSpecNLRIBase): This function returns a NLRI instance from human readable format value. :param route_dist: Route Distinguisher. - :param kwargs: See :py:mod:`ryu.lib.packet.bgp.FlowSpecIPv4NLRI` + :param kwargs: See :py:mod:`os_ken.lib.packet.bgp.FlowSpecIPv4NLRI` Example:: @@ -2380,7 +2380,7 @@ class FlowSpecVPNv6NLRI(_FlowSpecNLRIBase): This function returns a NLRI instance from human readable format value. :param route_dist: Route Distinguisher. - :param kwargs: See :py:mod:`ryu.lib.packet.bgp.FlowSpecIPv6NLRI` + :param kwargs: See :py:mod:`os_ken.lib.packet.bgp.FlowSpecIPv6NLRI` """ return cls._from_user(route_dist, **kwargs) @@ -5647,7 +5647,7 @@ class BGPRouteRefresh(BGPMessage): class StreamParser(stream_parser.StreamParser): """Streaming parser for BGP-4 messages. - This is a subclass of ryu.lib.packet.stream_parser.StreamParser. + This is a subclass of os_ken.lib.packet.stream_parser.StreamParser. Its parse method returns a list of BGPMessage subclass instances. """ diff --git a/os_ken/lib/packet/bmp.py b/os_ken/lib/packet/bmp.py index 0b4c3b84..d2bcccef 100644 --- a/os_ken/lib/packet/bmp.py +++ b/os_ken/lib/packet/bmp.py @@ -21,11 +21,11 @@ import struct import six -from ryu.lib import addrconv -from ryu.lib.packet import packet_base -from ryu.lib.packet import stream_parser -from ryu.lib.packet.bgp import BGPMessage -from ryu.lib.type_desc import TypeDisp +from os_ken.lib import addrconv +from os_ken.lib.packet import packet_base +from os_ken.lib.packet import stream_parser +from os_ken.lib.packet.bgp import BGPMessage +from os_ken.lib.type_desc import TypeDisp VERSION = 3 diff --git a/os_ken/lib/packet/bpdu.py b/os_ken/lib/packet/bpdu.py index da3d9cba..23435d8b 100644 --- a/os_ken/lib/packet/bpdu.py +++ b/os_ken/lib/packet/bpdu.py @@ -130,7 +130,7 @@ Rapid Spanning Tree BPDUs(RST BPDUs) format import binascii import struct from . import packet_base -from ryu.lib import addrconv +from os_ken.lib import addrconv # BPDU destination diff --git a/os_ken/lib/packet/cfm.py b/os_ken/lib/packet/cfm.py index 0e8c2cf1..93632e48 100644 --- a/os_ken/lib/packet/cfm.py +++ b/os_ken/lib/packet/cfm.py @@ -16,9 +16,9 @@ import abc import six import struct -from ryu.lib import addrconv -from ryu.lib import stringify -from ryu.lib.packet import packet_base +from os_ken.lib import addrconv +from os_ken.lib import stringify +from os_ken.lib.packet import packet_base # IEEE 802.1ag OpCode CFM_CC_MESSAGE = 0x01 @@ -193,7 +193,7 @@ class cc_message(operation): """CFM (IEEE Std 802.1ag-2007) Continuity Check Message (CCM) encoder/decoder class. - This is used with ryu.lib.packet.cfm.cfm. + This is used with os_ken.lib.packet.cfm.cfm. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -407,7 +407,7 @@ class loopback_message(loopback): """CFM (IEEE Std 802.1ag-2007) Loopback Message (LBM) encoder/decoder class. - This is used with ryu.lib.packet.cfm.cfm. + This is used with os_ken.lib.packet.cfm.cfm. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -440,7 +440,7 @@ class loopback_reply(loopback): """CFM (IEEE Std 802.1ag-2007) Loopback Reply (LBR) encoder/decoder class. - This is used with ryu.lib.packet.cfm.cfm. + This is used with os_ken.lib.packet.cfm.cfm. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -498,7 +498,7 @@ class link_trace_message(link_trace): """CFM (IEEE Std 802.1ag-2007) Linktrace Message (LTM) encoder/decoder class. - This is used with ryu.lib.packet.cfm.cfm. + This is used with os_ken.lib.packet.cfm.cfm. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -584,7 +584,7 @@ class link_trace_reply(link_trace): """CFM (IEEE Std 802.1ag-2007) Linktrace Reply (LTR) encoder/decoder class. - This is used with ryu.lib.packet.cfm.cfm. + This is used with os_ken.lib.packet.cfm.cfm. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -700,7 +700,7 @@ class sender_id_tlv(tlv): """CFM (IEEE Std 802.1ag-2007) Sender ID TLV encoder/decoder class. - This is used with ryu.lib.packet.cfm.cfm. + This is used with os_ken.lib.packet.cfm.cfm. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -857,7 +857,7 @@ class port_status_tlv(tlv): """CFM (IEEE Std 802.1ag-2007) Port Status TLV encoder/decoder class. - This is used with ryu.lib.packet.cfm.cfm. + This is used with os_ken.lib.packet.cfm.cfm. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -910,7 +910,7 @@ class data_tlv(tlv): """CFM (IEEE Std 802.1ag-2007) Data TLV encoder/decoder class. - This is used with ryu.lib.packet.cfm.cfm. + This is used with os_ken.lib.packet.cfm.cfm. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -962,7 +962,7 @@ class interface_status_tlv(tlv): """CFM (IEEE Std 802.1ag-2007) Interface Status TLV encoder/decoder class. - This is used with ryu.lib.packet.cfm.cfm. + This is used with os_ken.lib.packet.cfm.cfm. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -1023,7 +1023,7 @@ class ltm_egress_identifier_tlv(tlv): """CFM (IEEE Std 802.1ag-2007) LTM EGRESS TLV encoder/decoder class. - This is used with ryu.lib.packet.cfm.cfm. + This is used with os_ken.lib.packet.cfm.cfm. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -1080,7 +1080,7 @@ class ltr_egress_identifier_tlv(tlv): """CFM (IEEE Std 802.1ag-2007) LTR EGRESS TLV encoder/decoder class. - This is used with ryu.lib.packet.cfm.cfm. + This is used with os_ken.lib.packet.cfm.cfm. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -1151,7 +1151,7 @@ class organization_specific_tlv(tlv): """CFM (IEEE Std 802.1ag-2007) Organization Specific TLV encoder/decoder class. - This is used with ryu.lib.packet.cfm.cfm. + This is used with os_ken.lib.packet.cfm.cfm. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -1280,7 +1280,7 @@ class reply_ingress_tlv(reply_tlv): """CFM (IEEE Std 802.1ag-2007) Reply Ingress TLV encoder/decoder class. - This is used with ryu.lib.packet.cfm.cfm. + This is used with os_ken.lib.packet.cfm.cfm. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -1329,7 +1329,7 @@ class reply_egress_tlv(reply_tlv): """CFM (IEEE Std 802.1ag-2007) Reply Egress TLV encoder/decoder class. - This is used with ryu.lib.packet.cfm.cfm. + This is used with os_ken.lib.packet.cfm.cfm. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. diff --git a/os_ken/lib/packet/dhcp.py b/os_ken/lib/packet/dhcp.py index 4917a53a..4bbe048c 100644 --- a/os_ken/lib/packet/dhcp.py +++ b/os_ken/lib/packet/dhcp.py @@ -55,8 +55,8 @@ import struct import netaddr -from ryu.lib import addrconv -from ryu.lib import stringify +from os_ken.lib import addrconv +from os_ken.lib import stringify from . import packet_base DHCP_BOOT_REQUEST = 1 @@ -216,7 +216,7 @@ class dhcp(packet_base.PacketBase): class options(stringify.StringifyMixin): """DHCP (RFC 2132) options encoder/decoder class. - This is used with ryu.lib.packet.dhcp.dhcp. + This is used with os_ken.lib.packet.dhcp.dhcp. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -289,7 +289,7 @@ class options(stringify.StringifyMixin): class option(stringify.StringifyMixin): """DHCP (RFC 2132) options encoder/decoder class. - This is used with ryu.lib.packet.dhcp.dhcp.options. + This is used with os_ken.lib.packet.dhcp.dhcp.options. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. diff --git a/os_ken/lib/packet/dhcp6.py b/os_ken/lib/packet/dhcp6.py index 3f917433..6f5b2d9a 100644 --- a/os_ken/lib/packet/dhcp6.py +++ b/os_ken/lib/packet/dhcp6.py @@ -60,8 +60,8 @@ import random import struct from . import packet_base -from ryu.lib import addrconv -from ryu.lib import stringify +from os_ken.lib import addrconv +from os_ken.lib import stringify # DHCPv6 message types DHCPV6_SOLICIT = 1 @@ -199,7 +199,7 @@ class dhcp6(packet_base.PacketBase): class options(stringify.StringifyMixin): """DHCP (RFC 3315) options encoder/decoder class. - This is used with ryu.lib.packet.dhcp6.dhcp6. + This is used with os_ken.lib.packet.dhcp6.dhcp6. """ def __init__(self, option_list=None, options_len=0): @@ -233,7 +233,7 @@ class options(stringify.StringifyMixin): class option(stringify.StringifyMixin): """DHCP (RFC 3315) options encoder/decoder class. - This is used with ryu.lib.packet.dhcp6.dhcp6.options. + This is used with os_ken.lib.packet.dhcp6.dhcp6.options. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. diff --git a/os_ken/lib/packet/ethernet.py b/os_ken/lib/packet/ethernet.py index dd3a65c1..70b54e75 100644 --- a/os_ken/lib/packet/ethernet.py +++ b/os_ken/lib/packet/ethernet.py @@ -18,8 +18,8 @@ from . import packet_base from . import vlan from . import mpls from . import ether_types as ether -from ryu.lib import addrconv -from ryu.lib.pack_utils import msg_pack_into +from os_ken.lib import addrconv +from os_ken.lib.pack_utils import msg_pack_into class ethernet(packet_base.PacketBase): diff --git a/os_ken/lib/packet/geneve.py b/os_ken/lib/packet/geneve.py index a28393a7..3c9b717d 100644 --- a/os_ken/lib/packet/geneve.py +++ b/os_ken/lib/packet/geneve.py @@ -19,8 +19,8 @@ Geneve packet parser/serializer import struct -from ryu.lib import stringify -from ryu.lib import type_desc +from os_ken.lib import stringify +from os_ken.lib import type_desc from . import packet_base from . import ether_types diff --git a/os_ken/lib/packet/gre.py b/os_ken/lib/packet/gre.py index a62f0d18..7ab351ca 100644 --- a/os_ken/lib/packet/gre.py +++ b/os_ken/lib/packet/gre.py @@ -15,7 +15,7 @@ import struct -from ryu.lib.pack_utils import msg_pack_into +from os_ken.lib.pack_utils import msg_pack_into from . import packet_base from . import packet_utils from . import ether_types diff --git a/os_ken/lib/packet/icmp.py b/os_ken/lib/packet/icmp.py index 72938e91..49905022 100644 --- a/os_ken/lib/packet/icmp.py +++ b/os_ken/lib/packet/icmp.py @@ -20,7 +20,7 @@ import six from . import packet_base from . import packet_utils -from ryu.lib import stringify +from os_ken.lib import stringify ICMP_ECHO_REPLY = 0 @@ -54,9 +54,9 @@ class icmp(packet_base.PacketBase): (0 means automatically-calculate when encoding) data Payload. \ Either a bytearray, or \ - ryu.lib.packet.icmp.echo or \ - ryu.lib.packet.icmp.dest_unreach or \ - ryu.lib.packet.icmp.TimeExceeded object \ + os_ken.lib.packet.icmp.echo or \ + os_ken.lib.packet.icmp.dest_unreach or \ + os_ken.lib.packet.icmp.TimeExceeded object \ NOTE for icmp.echo: \ This includes "unused" 16 bits and the following \ "Internet Header + 64 bits of Original Data Datagram" of \ @@ -137,7 +137,7 @@ class _ICMPv4Payload(stringify.StringifyMixin): class echo(_ICMPv4Payload): """ICMP sub encoder/decoder class for Echo and Echo Reply messages. - This is used with ryu.lib.packet.icmp.icmp for + This is used with os_ken.lib.packet.icmp.icmp for ICMP Echo and Echo Reply messages. An instance has the following attributes at least. @@ -195,7 +195,7 @@ class echo(_ICMPv4Payload): class dest_unreach(_ICMPv4Payload): """ICMP sub encoder/decoder class for Destination Unreachable Message. - This is used with ryu.lib.packet.icmp.icmp for + This is used with os_ken.lib.packet.icmp.icmp for ICMP Destination Unreachable Message. An instance has the following attributes at least. @@ -266,7 +266,7 @@ class dest_unreach(_ICMPv4Payload): class TimeExceeded(_ICMPv4Payload): """ICMP sub encoder/decoder class for Time Exceeded Message. - This is used with ryu.lib.packet.icmp.icmp for + This is used with os_ken.lib.packet.icmp.icmp for ICMP Time Exceeded Message. An instance has the following attributes at least. diff --git a/os_ken/lib/packet/icmpv6.py b/os_ken/lib/packet/icmpv6.py index a391c087..f0a60b0e 100644 --- a/os_ken/lib/packet/icmpv6.py +++ b/os_ken/lib/packet/icmpv6.py @@ -22,8 +22,8 @@ import binascii from . import packet_base from . import packet_utils -from ryu.lib import addrconv -from ryu.lib import stringify +from os_ken.lib import addrconv +from os_ken.lib import stringify ICMPV6_DST_UNREACH = 1 # dest unreachable, codes: ICMPV6_PACKET_TOO_BIG = 2 # packet too big @@ -92,11 +92,11 @@ class icmpv6(packet_base.PacketBase): (0 means automatically-calculate when encoding) data Payload. - ryu.lib.packet.icmpv6.echo object, \ - ryu.lib.packet.icmpv6.nd_neighbor object, \ - ryu.lib.packet.icmpv6.nd_router_solicit object, \ - ryu.lib.packet.icmpv6.nd_router_advert object, \ - ryu.lib.packet.icmpv6.mld object, \ + os_ken.lib.packet.icmpv6.echo object, \ + os_ken.lib.packet.icmpv6.nd_neighbor object, \ + os_ken.lib.packet.icmpv6.nd_router_solicit object, \ + os_ken.lib.packet.icmpv6.nd_router_advert object, \ + os_ken.lib.packet.icmpv6.mld object, \ or a bytearray. ============== ==================== """ @@ -165,7 +165,7 @@ class nd_neighbor(_ICMPv6Payload): """ICMPv6 sub encoder/decoder class for Neighbor Solicitation and Neighbor Advertisement messages. (RFC 4861) - This is used with ryu.lib.packet.icmpv6.icmpv6. + This is used with os_ken.lib.packet.icmpv6.icmpv6. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -179,7 +179,7 @@ class nd_neighbor(_ICMPv6Payload): res R,S,O Flags for Neighbor Advertisement. \ The 3 MSBs of "Reserved" field for Neighbor Solicitation. dst Target Address - option a derived object of ryu.lib.packet.icmpv6.nd_option \ + option a derived object of os_ken.lib.packet.icmpv6.nd_option \ or a bytearray. None if no options. ============== ==================== """ @@ -246,7 +246,7 @@ class nd_router_solicit(_ICMPv6Payload): """ICMPv6 sub encoder/decoder class for Router Solicitation messages. (RFC 4861) - This is used with ryu.lib.packet.icmpv6.icmpv6. + This is used with os_ken.lib.packet.icmpv6.icmpv6. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -258,7 +258,7 @@ class nd_router_solicit(_ICMPv6Payload): Attribute Description ============== ==================== res This field is unused. It MUST be initialized to zero. - option a derived object of ryu.lib.packet.icmpv6.nd_option \ + option a derived object of os_ken.lib.packet.icmpv6.nd_option \ or a bytearray. None if no options. ============== ==================== """ @@ -317,7 +317,7 @@ class nd_router_advert(_ICMPv6Payload): """ICMPv6 sub encoder/decoder class for Router Advertisement messages. (RFC 4861) - This is used with ryu.lib.packet.icmpv6.icmpv6. + This is used with os_ken.lib.packet.icmpv6.icmpv6. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -334,7 +334,7 @@ class nd_router_advert(_ICMPv6Payload): rea_t Reachable Time. ret_t Retrans Timer. options List of a derived object of \ - ryu.lib.packet.icmpv6.nd_option or a bytearray. \ + os_ken.lib.packet.icmpv6.nd_option or a bytearray. \ None if no options. ============== ==================== """ @@ -478,9 +478,9 @@ class nd_option_sla(nd_option_la): """ICMPv6 sub encoder/decoder class for Neighbor discovery Source Link-Layer Address Option. (RFC 4861) - This is used with ryu.lib.packet.icmpv6.nd_neighbor, - ryu.lib.packet.icmpv6.nd_router_solicit or - ryu.lib.packet.icmpv6.nd_router_advert. + This is used with os_ken.lib.packet.icmpv6.nd_neighbor, + os_ken.lib.packet.icmpv6.nd_router_solicit or + os_ken.lib.packet.icmpv6.nd_router_advert. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -518,7 +518,7 @@ class nd_option_tla(nd_option_la): """ICMPv6 sub encoder/decoder class for Neighbor discovery Target Link-Layer Address Option. (RFC 4861) - This is used with ryu.lib.packet.icmpv6.nd_neighbor. + This is used with os_ken.lib.packet.icmpv6.nd_neighbor. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -556,7 +556,7 @@ class nd_option_pi(nd_option): r"""ICMPv6 sub encoder/decoder class for Neighbor discovery Prefix Information Option. (RFC 4861) - This is used with ryu.lib.packet.icmpv6.nd_router_advert. + This is used with os_ken.lib.packet.icmpv6.nd_router_advert. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -628,7 +628,7 @@ class echo(_ICMPv6Payload): """ICMPv6 sub encoder/decoder class for Echo Request and Echo Reply messages. - This is used with ryu.lib.packet.icmpv6.icmpv6 for + This is used with os_ken.lib.packet.icmpv6.icmpv6 for ICMPv6 Echo Request and Echo Reply messages. An instance has the following attributes at least. @@ -686,7 +686,7 @@ class mld(_ICMPv6Payload): http://www.ietf.org/rfc/rfc2710.txt - This is used with ryu.lib.packet.icmpv6.icmpv6. + This is used with os_ken.lib.packet.icmpv6.icmpv6. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -740,7 +740,7 @@ class mldv2_query(mld): http://www.ietf.org/rfc/rfc3810.txt - This is used with ryu.lib.packet.icmpv6.icmpv6. + This is used with os_ken.lib.packet.icmpv6.icmpv6. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -828,7 +828,7 @@ class mldv2_report(mld): http://www.ietf.org/rfc/rfc3810.txt - This is used with ryu.lib.packet.icmpv6.icmpv6. + This is used with os_ken.lib.packet.icmpv6.icmpv6. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -838,7 +838,7 @@ class mldv2_report(mld): Attribute Description ============== ========================================= record_num a number of the group records. - records a list of ryu.lib.packet.icmpv6.mldv2_report_group. + records a list of os_ken.lib.packet.icmpv6.mldv2_report_group. None if no records. ============== ========================================= """ @@ -888,7 +888,7 @@ class mldv2_report_group(stringify.StringifyMixin): ICMPv6 sub encoder/decoder class for MLD v2 Lister Report Group Record messages. (RFC 3810) - This is used with ryu.lib.packet.icmpv6.mldv2_report. + This is used with os_ken.lib.packet.icmpv6.mldv2_report. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte diff --git a/os_ken/lib/packet/igmp.py b/os_ken/lib/packet/igmp.py index d4c9552c..7b417bcf 100644 --- a/os_ken/lib/packet/igmp.py +++ b/os_ken/lib/packet/igmp.py @@ -118,10 +118,10 @@ import six import struct from math import trunc -from ryu.lib import addrconv -from ryu.lib import stringify -from ryu.lib.packet import packet_base -from ryu.lib.packet import packet_utils +from os_ken.lib import addrconv +from os_ken.lib import stringify +from os_ken.lib.packet import packet_base +from os_ken.lib.packet import packet_utils IGMP_TYPE_QUERY = 0x11 @@ -335,7 +335,7 @@ class igmpv3_report(igmp): csum a check sum value. 0 means automatically-calculate when encoding. record_num a number of the group records. - records a list of ryu.lib.packet.igmp.igmpv3_report_group. + records a list of os_ken.lib.packet.igmp.igmpv3_report_group. None if no records. =============== ==================================================== """ @@ -397,7 +397,7 @@ class igmpv3_report_group(stringify.StringifyMixin): http://www.ietf.org/rfc/rfc3376.txt - This is used with ryu.lib.packet.igmp.igmpv3_report. + This is used with os_ken.lib.packet.igmp.igmpv3_report. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte diff --git a/os_ken/lib/packet/ipv4.py b/os_ken/lib/packet/ipv4.py index 83990719..3c4455be 100644 --- a/os_ken/lib/packet/ipv4.py +++ b/os_ken/lib/packet/ipv4.py @@ -25,7 +25,7 @@ from . import sctp from . import ospf from . import gre from . import in_proto as inet -from ryu.lib import addrconv +from os_ken.lib import addrconv IPV4_ADDRESS_PACK_STR = '!I' diff --git a/os_ken/lib/packet/ipv6.py b/os_ken/lib/packet/ipv6.py index 6ceaced3..950ec2f5 100644 --- a/os_ken/lib/packet/ipv6.py +++ b/os_ken/lib/packet/ipv6.py @@ -23,8 +23,8 @@ from . import udp from . import sctp from . import gre from . import in_proto as inet -from ryu.lib import addrconv -from ryu.lib import stringify +from os_ken.lib import addrconv +from os_ken.lib import stringify IPV6_ADDRESS_PACK_STR = '!16s' @@ -223,7 +223,7 @@ class opt_header(header): class hop_opts(opt_header): """IPv6 (RFC 2460) Hop-by-Hop Options header encoder/decoder class. - This is used with ryu.lib.packet.ipv6.ipv6. + This is used with os_ken.lib.packet.ipv6.ipv6. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -250,7 +250,7 @@ class hop_opts(opt_header): class dst_opts(opt_header): """IPv6 (RFC 2460) destination header encoder/decoder class. - This is used with ryu.lib.packet.ipv6.ipv6. + This is used with os_ken.lib.packet.ipv6.ipv6. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -276,8 +276,8 @@ class dst_opts(opt_header): class option(stringify.StringifyMixin): r"""IPv6 (RFC 2460) Options header encoder/decoder class. - This is used with ryu.lib.packet.ipv6.hop_opts or - ryu.lib.packet.ipv6.dst_opts. + This is used with os_ken.lib.packet.ipv6.hop_opts or + os_ken.lib.packet.ipv6.dst_opts. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -390,7 +390,7 @@ class routing_type3(header): An IPv6 Routing Header for Source Routes with the RPL (RFC 6554) encoder/decoder class. - This is used with ryu.lib.packet.ipv6.ipv6. + This is used with os_ken.lib.packet.ipv6.ipv6. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -498,7 +498,7 @@ class routing_type3(header): class fragment(header): r"""IPv6 (RFC 2460) fragment header encoder/decoder class. - This is used with ryu.lib.packet.ipv6.ipv6. + This is used with os_ken.lib.packet.ipv6.ipv6. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -549,7 +549,7 @@ class fragment(header): class auth(header): """IP Authentication header (RFC 2402) encoder/decoder class. - This is used with ryu.lib.packet.ipv6.ipv6. + This is used with os_ken.lib.packet.ipv6.ipv6. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. diff --git a/os_ken/lib/packet/linux.py b/os_ken/lib/packet/linux.py index f571cfee..45ae6e22 100644 --- a/os_ken/lib/packet/linux.py +++ b/os_ken/lib/packet/linux.py @@ -18,7 +18,7 @@ from . import packet_base from . import vlan from . import mpls from . import ether_types as ether -from ryu.lib import addrconv +from os_ken.lib import addrconv class linuxcooked(packet_base.PacketBase): diff --git a/os_ken/lib/packet/llc.py b/os_ken/lib/packet/llc.py index abdbe568..eb4d5f8e 100644 --- a/os_ken/lib/packet/llc.py +++ b/os_ken/lib/packet/llc.py @@ -92,7 +92,7 @@ commands/responses import struct from . import bpdu from . import packet_base -from ryu.lib import stringify +from os_ken.lib import stringify SAP_BPDU = 0x42 @@ -118,9 +118,9 @@ class llc(packet_base.PacketBase): control Control field \ [16 bits for formats that include sequence \ numbering, and 8 bits for formats that do not]. \ - Either ryu.lib.packet.llc.ControlFormatI or \ - ryu.lib.packet.llc.ControlFormatS or \ - ryu.lib.packet.llc.ControlFormatU object. + Either os_ken.lib.packet.llc.ControlFormatI or \ + os_ken.lib.packet.llc.ControlFormatS or \ + os_ken.lib.packet.llc.ControlFormatU object. =============== =============================================== """ diff --git a/os_ken/lib/packet/lldp.py b/os_ken/lib/packet/lldp.py index a48884d7..c2ef5d71 100644 --- a/os_ken/lib/packet/lldp.py +++ b/os_ken/lib/packet/lldp.py @@ -51,8 +51,8 @@ optional TLV may be inserted in any order """ import struct -from ryu.lib import stringify -from ryu.lib.packet import packet_base +from os_ken.lib import stringify +from os_ken.lib.packet import packet_base # LLDP destination MAC address diff --git a/os_ken/lib/packet/mpls.py b/os_ken/lib/packet/mpls.py index b1588844..862c7126 100644 --- a/os_ken/lib/packet/mpls.py +++ b/os_ken/lib/packet/mpls.py @@ -18,7 +18,7 @@ import struct import six from . import packet_base -from ryu.lib import type_desc +from os_ken.lib import type_desc class mpls(packet_base.PacketBase): diff --git a/os_ken/lib/packet/openflow.py b/os_ken/lib/packet/openflow.py index e2119941..0869d6d4 100644 --- a/os_ken/lib/packet/openflow.py +++ b/os_ken/lib/packet/openflow.py @@ -15,7 +15,7 @@ import struct -from ryu.lib import stringify +from os_ken.lib import stringify from . import packet_base @@ -42,8 +42,8 @@ class openflow(packet_base.PacketBase): @classmethod def parser(cls, buf): - from ryu.ofproto import ofproto_parser - from ryu.ofproto import ofproto_protocol + from os_ken.ofproto import ofproto_parser + from os_ken.ofproto import ofproto_protocol (version, msg_type, msg_len, xid) = ofproto_parser.header(buf) @@ -79,7 +79,7 @@ class OFPUnparseableMsg(stringify.StringifyMixin): ============== ====================================================== Attribute Description ============== ====================================================== - datapath A ryu.ofproto.ofproto_protocol.ProtocolDesc instance + datapath A os_ken.ofproto.ofproto_protocol.ProtocolDesc instance for this message or None if OpenFlow protocol version is unsupported version. version OpenFlow protocol version @@ -92,7 +92,7 @@ class OFPUnparseableMsg(stringify.StringifyMixin): .. Note:: "datapath" attribute is different from - ryu.controller.controller.Datapath. + os_ken.controller.controller.Datapath. So you can not use "datapath" attribute to send OpenFlow messages. For example, "datapath" attribute does not have send_msg method. """ diff --git a/os_ken/lib/packet/ospf.py b/os_ken/lib/packet/ospf.py index 5c156c03..af60e440 100644 --- a/os_ken/lib/packet/ospf.py +++ b/os_ken/lib/packet/ospf.py @@ -23,12 +23,12 @@ import struct import six -from ryu.lib import addrconv -from ryu.lib.packet import packet_base -from ryu.lib.packet import packet_utils -from ryu.lib.packet import stream_parser -from ryu.lib.stringify import StringifyMixin -from ryu.lib import type_desc +from os_ken.lib import addrconv +from os_ken.lib.packet import packet_base +from os_ken.lib.packet import packet_utils +from os_ken.lib.packet import stream_parser +from os_ken.lib.stringify import StringifyMixin +from os_ken.lib import type_desc LOG = logging.getLogger(__name__) diff --git a/os_ken/lib/packet/packet.py b/os_ken/lib/packet/packet.py index 2db641b7..27897e7c 100644 --- a/os_ken/lib/packet/packet.py +++ b/os_ken/lib/packet/packet.py @@ -22,12 +22,12 @@ import six from . import packet_base from . import ethernet -from ryu import utils -from ryu.lib.stringify import StringifyMixin +from os_ken import utils +from os_ken.lib.stringify import StringifyMixin # Packet class dictionary -mod = inspect.getmembers(utils.import_module("ryu.lib.packet"), +mod = inspect.getmembers(utils.import_module("os_ken.lib.packet"), lambda cls: (inspect.ismodule(cls))) cls_list = [] for _, m in mod: diff --git a/os_ken/lib/packet/packet_base.py b/os_ken/lib/packet/packet_base.py index f08330b9..cea966ab 100644 --- a/os_ken/lib/packet/packet_base.py +++ b/os_ken/lib/packet/packet_base.py @@ -15,7 +15,7 @@ import abc import six -from ryu.lib import stringify +from os_ken.lib import stringify @six.add_metaclass(abc.ABCMeta) diff --git a/os_ken/lib/packet/packet_utils.py b/os_ken/lib/packet/packet_utils.py index 30259e31..5f2f3c22 100644 --- a/os_ken/lib/packet/packet_utils.py +++ b/os_ken/lib/packet/packet_utils.py @@ -17,7 +17,7 @@ import array import six import socket import struct -from ryu.lib import addrconv +from os_ken.lib import addrconv def carry_around_add(a, b): diff --git a/os_ken/lib/packet/pbb.py b/os_ken/lib/packet/pbb.py index e240be6a..d82c485d 100644 --- a/os_ken/lib/packet/pbb.py +++ b/os_ken/lib/packet/pbb.py @@ -14,7 +14,7 @@ # limitations under the License. import struct -from ryu.lib.packet import packet_base +from os_ken.lib.packet import packet_base class itag(packet_base.PacketBase): @@ -52,7 +52,7 @@ class itag(packet_base.PacketBase): uca = data >> 27 & 1 sid = data & 0x00ffffff # circular import: ethernet -> vlan -> pbb - from ryu.lib.packet import ethernet + from os_ken.lib.packet import ethernet return (cls(pcp, dei, uca, sid), ethernet.ethernet, buf[cls._MIN_LEN:]) diff --git a/os_ken/lib/packet/sctp.py b/os_ken/lib/packet/sctp.py index 7c041f1f..9eca8968 100644 --- a/os_ken/lib/packet/sctp.py +++ b/os_ken/lib/packet/sctp.py @@ -17,9 +17,9 @@ import abc import six import struct -from ryu.lib import addrconv -from ryu.lib import stringify -from ryu.lib.packet import packet_base +from os_ken.lib import addrconv +from os_ken.lib import stringify +from os_ken.lib.packet import packet_base # Chunk Types TYPE_DATA = 0 @@ -83,7 +83,7 @@ class sctp(packet_base.PacketBase): vtag Verification Tag csum Checksum (0 means automatically-calculate when encoding) - chunks a list of derived classes of ryu.lib.packet.sctp.chunk. + chunks a list of derived classes of os_ken.lib.packet.sctp.chunk. ============== ===================================================== """ @@ -387,7 +387,7 @@ class chunk_data(chunk): This class is used with the following. - - ryu.lib.packet.sctp.sctp + - os_ken.lib.packet.sctp.sctp An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -469,7 +469,7 @@ class chunk_init(chunk_init_base): This class is used with the following. - - ryu.lib.packet.sctp.sctp + - os_ken.lib.packet.sctp.sctp An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -490,7 +490,7 @@ class chunk_init(chunk_init_base): i_tsn Transmission Sequence Number that the sender will use. params Optional/Variable-Length Parameters. - a list of derived classes of ryu.lib.packet.sctp.param. + a list of derived classes of os_ken.lib.packet.sctp.param. ============== ===================================================== """ @@ -521,7 +521,7 @@ class chunk_init_ack(chunk_init_base): This class is used with the following. - - ryu.lib.packet.sctp.sctp + - os_ken.lib.packet.sctp.sctp An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -542,7 +542,7 @@ class chunk_init_ack(chunk_init_base): i_tsn Transmission Sequence Number that the sender will use. params Optional/Variable-Length Parameters. - a list of derived classes of ryu.lib.packet.sctp.param. + a list of derived classes of os_ken.lib.packet.sctp.param. ============== ===================================================== """ @@ -573,7 +573,7 @@ class chunk_sack(chunk): This class is used with the following. - - ryu.lib.packet.sctp.sctp + - os_ken.lib.packet.sctp.sctp An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -670,7 +670,7 @@ class chunk_heartbeat(chunk_heartbeat_base): This class is used with the following. - - ryu.lib.packet.sctp.sctp + - os_ken.lib.packet.sctp.sctp An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -684,7 +684,7 @@ class chunk_heartbeat(chunk_heartbeat_base): flags set to '0'. this field will be ignored. length length of this chunk containing this header. (0 means automatically-calculate when encoding) - info ryu.lib.packet.sctp.param_heartbeat. + info os_ken.lib.packet.sctp.param_heartbeat. ============== ===================================================== """ @@ -715,7 +715,7 @@ class chunk_heartbeat_ack(chunk_heartbeat_base): This class is used with the following. - - ryu.lib.packet.sctp.sctp + - os_ken.lib.packet.sctp.sctp An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -729,7 +729,7 @@ class chunk_heartbeat_ack(chunk_heartbeat_base): flags set to '0'. this field will be ignored. length length of this chunk containing this header. (0 means automatically-calculate when encoding) - info ryu.lib.packet.sctp.param_heartbeat. + info os_ken.lib.packet.sctp.param_heartbeat. ============== ===================================================== """ @@ -759,7 +759,7 @@ class chunk_abort(chunk): This class is used with the following. - - ryu.lib.packet.sctp.sctp + - os_ken.lib.packet.sctp.sctp An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -774,7 +774,7 @@ class chunk_abort(chunk): the Verification tag is copy of the sender. length length of this chunk containing this header. (0 means automatically-calculate when encoding) - causes a list of derived classes of ryu.lib.packet.sctp.causes. + causes a list of derived classes of os_ken.lib.packet.sctp.causes. ============== ===================================================== """ @@ -838,7 +838,7 @@ class chunk_shutdown(chunk): This class is used with the following. - - ryu.lib.packet.sctp.sctp + - os_ken.lib.packet.sctp.sctp An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -893,7 +893,7 @@ class chunk_shutdown_ack(chunk_ack_base): This class is used with the following. - - ryu.lib.packet.sctp.sctp + - os_ken.lib.packet.sctp.sctp An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -922,7 +922,7 @@ class chunk_error(chunk): This class is used with the following. - - ryu.lib.packet.sctp.sctp + - os_ken.lib.packet.sctp.sctp An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -936,7 +936,7 @@ class chunk_error(chunk): flags set to '0'. this field will be ignored. length length of this chunk containing this header. (0 means automatically-calculate when encoding) - causes a list of derived classes of ryu.lib.packet.sctp.causes. + causes a list of derived classes of os_ken.lib.packet.sctp.causes. ============== ===================================================== """ @@ -996,7 +996,7 @@ class chunk_cookie_echo(chunk): This class is used with the following. - - ryu.lib.packet.sctp.sctp + - os_ken.lib.packet.sctp.sctp An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -1059,7 +1059,7 @@ class chunk_cookie_ack(chunk_ack_base): This class is used with the following. - - ryu.lib.packet.sctp.sctp + - os_ken.lib.packet.sctp.sctp An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -1088,7 +1088,7 @@ class chunk_ecn_echo(chunk_ecn_base): This class is used with the following. - - ryu.lib.packet.sctp.sctp + - os_ken.lib.packet.sctp.sctp An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -1118,7 +1118,7 @@ class chunk_cwr(chunk_ecn_base): This class is used with the following. - - ryu.lib.packet.sctp.sctp + - os_ken.lib.packet.sctp.sctp An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -1149,7 +1149,7 @@ class chunk_shutdown_complete(chunk): This class is used with the following. - - ryu.lib.packet.sctp.sctp + - os_ken.lib.packet.sctp.sctp An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -1271,8 +1271,8 @@ class cause_invalid_stream_id(cause_with_value): This class is used with the following. - - ryu.lib.packet.sctp.chunk_abort - - ryu.lib.packet.sctp.chunk_error + - os_ken.lib.packet.sctp.chunk_abort + - os_ken.lib.packet.sctp.chunk_error An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -1320,8 +1320,8 @@ class cause_missing_param(cause): This class is used with the following. - - ryu.lib.packet.sctp.chunk_abort - - ryu.lib.packet.sctp.chunk_error + - os_ken.lib.packet.sctp.chunk_abort + - os_ken.lib.packet.sctp.chunk_error An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -1392,8 +1392,8 @@ class cause_stale_cookie(cause_with_value): This class is used with the following. - - ryu.lib.packet.sctp.chunk_abort - - ryu.lib.packet.sctp.chunk_error + - os_ken.lib.packet.sctp.chunk_abort + - os_ken.lib.packet.sctp.chunk_error An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -1423,8 +1423,8 @@ class cause_out_of_resource(cause): This class is used with the following. - - ryu.lib.packet.sctp.chunk_abort - - ryu.lib.packet.sctp.chunk_error + - os_ken.lib.packet.sctp.chunk_abort + - os_ken.lib.packet.sctp.chunk_error An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -1458,8 +1458,8 @@ class cause_unresolvable_addr(cause_with_value): This class is used with the following. - - ryu.lib.packet.sctp.chunk_abort - - ryu.lib.packet.sctp.chunk_error + - os_ken.lib.packet.sctp.chunk_abort + - os_ken.lib.packet.sctp.chunk_error An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -1472,11 +1472,11 @@ class cause_unresolvable_addr(cause_with_value): ============== ===================================================== value Unresolvable Address. one of follows: - ryu.lib.packet.sctp.param_host_addr, + os_ken.lib.packet.sctp.param_host_addr, - ryu.lib.packet.sctp.param_ipv4, or + os_ken.lib.packet.sctp.param_ipv4, or - ryu.lib.packet.sctp.param_ipv6. + os_ken.lib.packet.sctp.param_ipv6. length length of this cause containing this header. (0 means automatically-calculate when encoding) ============== ===================================================== @@ -1525,8 +1525,8 @@ class cause_unrecognized_chunk(cause_with_value): This class is used with the following. - - ryu.lib.packet.sctp.chunk_abort - - ryu.lib.packet.sctp.chunk_error + - os_ken.lib.packet.sctp.chunk_abort + - os_ken.lib.packet.sctp.chunk_error An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -1556,8 +1556,8 @@ class cause_invalid_param(cause): This class is used with the following. - - ryu.lib.packet.sctp.chunk_abort - - ryu.lib.packet.sctp.chunk_error + - os_ken.lib.packet.sctp.chunk_abort + - os_ken.lib.packet.sctp.chunk_error An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -1591,8 +1591,8 @@ class cause_unrecognized_param(cause_with_value): This class is used with the following. - - ryu.lib.packet.sctp.chunk_abort - - ryu.lib.packet.sctp.chunk_error + - os_ken.lib.packet.sctp.chunk_abort + - os_ken.lib.packet.sctp.chunk_error An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -1622,8 +1622,8 @@ class cause_no_userdata(cause_with_value): This class is used with the following. - - ryu.lib.packet.sctp.chunk_abort - - ryu.lib.packet.sctp.chunk_error + - os_ken.lib.packet.sctp.chunk_abort + - os_ken.lib.packet.sctp.chunk_error An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -1655,8 +1655,8 @@ class cause_cookie_while_shutdown(cause): This class is used with the following. - - ryu.lib.packet.sctp.chunk_abort - - ryu.lib.packet.sctp.chunk_error + - os_ken.lib.packet.sctp.chunk_abort + - os_ken.lib.packet.sctp.chunk_error An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -1691,8 +1691,8 @@ class cause_restart_with_new_addr(cause_with_value): This class is used with the following. - - ryu.lib.packet.sctp.chunk_abort - - ryu.lib.packet.sctp.chunk_error + - os_ken.lib.packet.sctp.chunk_abort + - os_ken.lib.packet.sctp.chunk_error An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -1766,8 +1766,8 @@ class cause_user_initiated_abort(cause_with_value): This class is used with the following. - - ryu.lib.packet.sctp.chunk_abort - - ryu.lib.packet.sctp.chunk_error + - os_ken.lib.packet.sctp.chunk_abort + - os_ken.lib.packet.sctp.chunk_error An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -1797,8 +1797,8 @@ class cause_protocol_violation(cause_with_value): This class is used with the following. - - ryu.lib.packet.sctp.chunk_abort - - ryu.lib.packet.sctp.chunk_error + - os_ken.lib.packet.sctp.chunk_abort + - os_ken.lib.packet.sctp.chunk_error An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -1877,8 +1877,8 @@ class param_heartbeat(param): This class is used with the following. - - ryu.lib.packet.sctp.chunk_heartbeat - - ryu.lib.packet.sctp.chunk_heartbeat_ack + - os_ken.lib.packet.sctp.chunk_heartbeat + - os_ken.lib.packet.sctp.chunk_heartbeat_ack An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -1907,7 +1907,7 @@ class param_state_cookie(param): This class is used with the following. - - ryu.lib.packet.sctp.chunk_init_ack + - os_ken.lib.packet.sctp.chunk_init_ack An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -1936,7 +1936,7 @@ class param_unrecognized_param(param): This class is used with the following. - - ryu.lib.packet.sctp.chunk_init_ack + - os_ken.lib.packet.sctp.chunk_init_ack An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -1965,7 +1965,7 @@ class param_cookie_preserve(param): This class is used with the following. - - ryu.lib.packet.sctp.chunk_init + - os_ken.lib.packet.sctp.chunk_init An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -2013,8 +2013,8 @@ class param_ecn(param): This class is used with the following. - - ryu.lib.packet.sctp.chunk_init - - ryu.lib.packet.sctp.chunk_init_ack + - os_ken.lib.packet.sctp.chunk_init + - os_ken.lib.packet.sctp.chunk_init_ack An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -2051,8 +2051,8 @@ class param_host_addr(param): This class is used with the following. - - ryu.lib.packet.sctp.chunk_init - - ryu.lib.packet.sctp.chunk_init_ack + - os_ken.lib.packet.sctp.chunk_init + - os_ken.lib.packet.sctp.chunk_init_ack An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -2081,7 +2081,7 @@ class param_supported_addr(param): This class is used with the following. - - ryu.lib.packet.sctp.chunk_init + - os_ken.lib.packet.sctp.chunk_init An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -2147,8 +2147,8 @@ class param_ipv4(param): This class is used with the following. - - ryu.lib.packet.sctp.chunk_init - - ryu.lib.packet.sctp.chunk_init_ack + - os_ken.lib.packet.sctp.chunk_init + - os_ken.lib.packet.sctp.chunk_init_ack An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. @@ -2204,8 +2204,8 @@ class param_ipv6(param): This class is used with the following. - - ryu.lib.packet.sctp.chunk_init - - ryu.lib.packet.sctp.chunk_init_ack + - os_ken.lib.packet.sctp.chunk_init + - os_ken.lib.packet.sctp.chunk_init_ack An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. diff --git a/os_ken/lib/packet/slow.py b/os_ken/lib/packet/slow.py index 1ca76af7..9092ca67 100644 --- a/os_ken/lib/packet/slow.py +++ b/os_ken/lib/packet/slow.py @@ -15,7 +15,7 @@ import struct from . import packet_base -from ryu.lib import addrconv +from os_ken.lib import addrconv # Slow Protocol Multicast destination SLOW_PROTOCOL_MULTICAST = '01:80:c2:00:00:02' diff --git a/os_ken/lib/packet/tcp.py b/os_ken/lib/packet/tcp.py index 4b7dfe2e..ad025e07 100644 --- a/os_ken/lib/packet/tcp.py +++ b/os_ken/lib/packet/tcp.py @@ -18,7 +18,7 @@ import logging import six -from ryu.lib import stringify +from os_ken.lib import stringify from . import packet_base from . import packet_utils from . import bgp @@ -114,7 +114,7 @@ class tcp(packet_base.PacketBase): @staticmethod def get_payload_type(src_port, dst_port): - from ryu.ofproto.ofproto_common import OFP_TCP_PORT, OFP_SSL_PORT_OLD + from os_ken.ofproto.ofproto_common import OFP_TCP_PORT, OFP_SSL_PORT_OLD if bgp.TCP_SERVER_PORT in [src_port, dst_port]: return bgp.BGPMessage elif(src_port in [OFP_TCP_PORT, OFP_SSL_PORT_OLD] or diff --git a/os_ken/lib/packet/vrrp.py b/os_ken/lib/packet/vrrp.py index 857e1ac0..7fcb1a6d 100644 --- a/os_ken/lib/packet/vrrp.py +++ b/os_ken/lib/packet/vrrp.py @@ -68,16 +68,16 @@ VRRP packet parser/serializer import struct -from ryu.lib.packet import ethernet -from ryu.lib.packet import ether_types as ether -from ryu.lib.packet import in_proto as inet -from ryu.lib.packet import ipv4 -from ryu.lib.packet import ipv6 -from ryu.lib.packet import packet -from ryu.lib.packet import packet_base -from ryu.lib.packet import packet_utils -from ryu.lib.packet import vlan -from ryu.lib import addrconv +from os_ken.lib.packet import ethernet +from os_ken.lib.packet import ether_types as ether +from os_ken.lib.packet import in_proto as inet +from os_ken.lib.packet import ipv4 +from os_ken.lib.packet import ipv6 +from os_ken.lib.packet import packet +from os_ken.lib.packet import packet_base +from os_ken.lib.packet import packet_utils +from os_ken.lib.packet import vlan +from os_ken.lib import addrconv # IPv4 @@ -184,7 +184,7 @@ class vrrp(packet_base.PacketBase): """The base class for VRRPv2 (RFC 3768) and VRRPv3 (RFC 5798) header encoder/decoder classes. - Unlike other ryu.lib.packet.packet_base.PacketBase derived classes, + Unlike other os_ken.lib.packet.packet_base.PacketBase derived classes, This class should not be directly instantiated by user. An instance has the following attributes at least. @@ -327,7 +327,7 @@ class vrrp(packet_base.PacketBase): def create_packet(self, primary_ip_address, vlan_id=None): """Prepare a VRRP packet. - Returns a newly created ryu.lib.packet.packet.Packet object + Returns a newly created os_ken.lib.packet.packet.Packet object with appropriate protocol header objects added by add_protocol(). It's caller's responsibility to serialize(). The serialized packet would looks like the ones described in @@ -414,7 +414,7 @@ class vrrp(packet_base.PacketBase): class vrrpv2(vrrp): """VRRPv2 (RFC 3768) header encoder/decoder class. - Unlike other ryu.lib.packet.packet_base.PacketBase derived classes, + Unlike other os_ken.lib.packet.packet_base.PacketBase derived classes, *create* method should be used to instantiate an object of this class. """ @@ -434,10 +434,10 @@ class vrrpv2(vrrp): @staticmethod def create(type_, vrid, priority, max_adver_int, ip_addresses): - """Unlike other ryu.lib.packet.packet_base.PacketBase derived classes, + """Unlike other os_ken.lib.packet.packet_base.PacketBase derived classes, this method should be used to instantiate an object of this class. - This method's arguments are same as ryu.lib.packet.vrrp.vrrp object's + This method's arguments are same as os_ken.lib.packet.vrrp.vrrp object's attributes of the same name. (except that *type_* corresponds to *type* attribute.) """ @@ -524,7 +524,7 @@ class vrrpv2(vrrp): class vrrpv3(vrrp): """VRRPv3 (RFC 5798) header encoder/decoder class. - Unlike other ryu.lib.packet.packet_base.PacketBase derived classes, + Unlike other os_ken.lib.packet.packet_base.PacketBase derived classes, *create* method should be used to instantiate an object of this class. """ @@ -550,10 +550,10 @@ class vrrpv3(vrrp): @staticmethod def create(type_, vrid, priority, max_adver_int, ip_addresses): - """Unlike other ryu.lib.packet.packet_base.PacketBase derived classes, + """Unlike other os_ken.lib.packet.packet_base.PacketBase derived classes, this method should be used to instantiate an object of this class. - This method's arguments are same as ryu.lib.packet.vrrp.vrrp object's + This method's arguments are same as os_ken.lib.packet.vrrp.vrrp object's attributes of the same name. (except that *type_* corresponds to *type* attribute.) """ diff --git a/os_ken/lib/packet/vxlan.py b/os_ken/lib/packet/vxlan.py index 5a6e0131..4d5f5db2 100644 --- a/os_ken/lib/packet/vxlan.py +++ b/os_ken/lib/packet/vxlan.py @@ -19,7 +19,7 @@ import logging import six from . import packet_base -from ryu.lib import type_desc +from os_ken.lib import type_desc LOG = logging.getLogger(__name__) @@ -65,7 +65,7 @@ class vxlan(packet_base.PacketBase): assert (1 << 3) == (flags_reserved >> 24) # Note: To avoid cyclic import, import ethernet module here - from ryu.lib.packet import ethernet + from os_ken.lib.packet import ethernet return cls(vni_rserved >> 8), ethernet.ethernet, buf[cls._MIN_LEN:] def serialize(self, payload, prev): diff --git a/os_ken/lib/packet/zebra.py b/os_ken/lib/packet/zebra.py index be9ffa36..294ccbd1 100644 --- a/os_ken/lib/packet/zebra.py +++ b/os_ken/lib/packet/zebra.py @@ -28,12 +28,12 @@ from distutils.version import LooseVersion import netaddr import six -from ryu import flags as cfg_flags # For loading 'zapi' option definition -from ryu.cfg import CONF -from ryu.lib import addrconv -from ryu.lib import ip -from ryu.lib import stringify -from ryu.lib import type_desc +from os_ken import flags as cfg_flags # For loading 'zapi' option definition +from os_ken.cfg import CONF +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 . import packet_base from . import bgp from . import safi as packet_safi @@ -988,7 +988,7 @@ class ZebraMessage(packet_base.PacketBase): :: - >>> from ryu.lib.packet import zebra + >>> from os_ken.lib.packet import zebra >>> zebra.ZebraMessage(body=zebra.ZebraHello()) ZebraMessage(body=ZebraHello(route_type=14),command=23, length=None,version=3,vrf_id=0) diff --git a/os_ken/lib/pcaplib.py b/os_ken/lib/pcaplib.py index 8b7400bf..69dc0bcc 100644 --- a/os_ken/lib/pcaplib.py +++ b/os_ken/lib/pcaplib.py @@ -203,8 +203,8 @@ class Reader(object): Example of usage:: - from ryu.lib import pcaplib - from ryu.lib.packet import packet + from os_ken.lib import pcaplib + from os_ken.lib.packet import packet frame_count = 0 # iterate pcaplib.Reader that yields (timestamp, packet_data) @@ -261,7 +261,7 @@ class Writer(object): Example of usage:: ... - from ryu.lib import pcaplib + from os_ken.lib import pcaplib class SimpleSwitch13(app_manager.RyuApp): diff --git a/os_ken/lib/snortlib.py b/os_ken/lib/snortlib.py index a8c1363e..0c38498c 100644 --- a/os_ken/lib/snortlib.py +++ b/os_ken/lib/snortlib.py @@ -18,9 +18,9 @@ import os import logging import six -from ryu.lib import hub, alert -from ryu.base import app_manager -from ryu.controller import event +from os_ken.lib import hub, alert +from os_ken.base import app_manager +from os_ken.controller import event BUFSIZE = alert.AlertPkt._ALERTPKT_SIZE diff --git a/os_ken/lib/sockaddr.py b/os_ken/lib/sockaddr.py index 460f2159..44371cfa 100644 --- a/os_ken/lib/sockaddr.py +++ b/os_ken/lib/sockaddr.py @@ -18,7 +18,7 @@ import platform import socket import struct -from ryu.lib import addrconv +from os_ken.lib import addrconv system = platform.system() diff --git a/os_ken/lib/sockopt.py b/os_ken/lib/sockopt.py index c3e9d1ad..f72e93d2 100644 --- a/os_ken/lib/sockopt.py +++ b/os_ken/lib/sockopt.py @@ -18,7 +18,7 @@ import platform import socket import struct -from ryu.lib import sockaddr +from os_ken.lib import sockaddr TCP_MD5SIG_LINUX = 0x0e diff --git a/os_ken/lib/stplib.py b/os_ken/lib/stplib.py index 97752f10..b90afd45 100644 --- a/os_ken/lib/stplib.py +++ b/os_ken/lib/stplib.py @@ -17,23 +17,23 @@ import datetime import logging -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 -from ryu.exception import RyuException -from ryu.exception import OFPUnknownVersion -from ryu.lib import hub -from ryu.lib import mac -from ryu.lib.dpid import dpid_to_str -from ryu.lib.packet import bpdu -from ryu.lib.packet import ethernet -from ryu.lib.packet import llc -from ryu.lib.packet import packet -from ryu.ofproto import ofproto_v1_0 -from ryu.ofproto import ofproto_v1_2 -from ryu.ofproto import ofproto_v1_3 +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 +from os_ken.exception import RyuException +from os_ken.exception import OFPUnknownVersion +from os_ken.lib import hub +from os_ken.lib import mac +from os_ken.lib.dpid import dpid_to_str +from os_ken.lib.packet import bpdu +from os_ken.lib.packet import ethernet +from os_ken.lib.packet import llc +from os_ken.lib.packet import packet +from os_ken.ofproto import ofproto_v1_0 +from os_ken.ofproto import ofproto_v1_2 +from os_ken.ofproto import ofproto_v1_3 MAX_PORT_NO = 0xfff diff --git a/os_ken/lib/type_desc.py b/os_ken/lib/type_desc.py index 415fb574..d453dd35 100644 --- a/os_ken/lib/type_desc.py +++ b/os_ken/lib/type_desc.py @@ -18,7 +18,7 @@ import base64 import six -from ryu.lib import addrconv +from os_ken.lib import addrconv class TypeDescr(object): diff --git a/os_ken/lib/xflow/sflow.py b/os_ken/lib/xflow/sflow.py index b022b410..44d16726 100644 --- a/os_ken/lib/xflow/sflow.py +++ b/os_ken/lib/xflow/sflow.py @@ -21,7 +21,7 @@ SFLOW_V3 = 0x00000003 SFLOW_V4 = 0x00000004 SFLOW_V5 = 0x00000005 -LOG = logging.getLogger('ryu.lib.xflow.sflow') +LOG = logging.getLogger('os_ken.lib.xflow.sflow') class sFlow(object):