bgp: fix wrong path

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
ISHIDA Wataru 2014-03-30 09:39:47 +00:00 committed by FUJITA Tomonori
parent e1e89ce57f
commit f5543f9e20
13 changed files with 16 additions and 16 deletions

View File

@ -99,7 +99,7 @@ class CoreService(Factory, Activity):
)
# Register Flexinet peer sink
from ryu.services.protocols.bgp.speaker.net_ctrl import NET_CONTROLLER
from ryu.services.protocols.bgp.net_ctrl import NET_CONTROLLER
self.register_flexinet_sink(NET_CONTROLLER)
@ -202,7 +202,7 @@ class CoreService(Factory, Activity):
vrf_stats_timer.start(vrf_conf.stats_time)
def _run(self, *args, **kwargs):
from ryu.services.protocols.bgp.speaker.processor import BgpProcessor
from ryu.services.protocols.bgp.processor import BgpProcessor
# Initialize bgp processor.
self._bgp_processor = BgpProcessor(self)
# Start BgpProcessor in a separate thread.

View File

@ -37,7 +37,7 @@ class _CoreManager(Activity):
self._common_conf = kwargs.pop('common_conf')
self._neighbors_conf = NeighborsConf()
self._vrfs_conf = VrfsConf()
from ryu.services.protocols.bgp.speaker.core import CoreService
from ryu.services.protocols.bgp.core import CoreService
self._core_service = CoreService(self._common_conf,
self._neighbors_conf,
self._vrfs_conf)

View File

@ -416,7 +416,7 @@ class TableCoreManager(object):
Returns assigned VPN label.
"""
from ryu.services.protocols.bgp.speaker.core import BgpCoreError
from ryu.services.protocols.bgp.core import BgpCoreError
assert route_dist and prefix and next_hop
if route_family not in (VRF_RF_IPV4, VRF_RF_IPV6):
@ -451,7 +451,7 @@ class TableCoreManager(object):
Returns assigned VPN label.
"""
from ryu.services.protocols.bgp.speaker.core import BgpCoreError
from ryu.services.protocols.bgp.core import BgpCoreError
# Validate given
if route_family not in (VRF_RF_IPV4, VRF_RF_IPV6):
raise BgpCoreError(desc='Unsupported route family %s' %

View File

@ -429,7 +429,7 @@ class Destination(object):
Parameter:
- `peer`: (Peer) peer to send withdraw to
"""
from ryu.services.protocols.bgp.speaker.peer import Peer
from ryu.services.protocols.bgp.peer import Peer
if not isinstance(peer, Peer):
raise TypeError('Currently we only support sending withdrawal'
' to instance of peer')

View File

@ -55,5 +55,5 @@ class Vpnv4Path(VpnPath):
def __init__(self, *args, **kwargs):
super(Vpnv4Path, self).__init__(*args, **kwargs)
from ryu.services.protocols.bgp.speaker.info_base.vrf4 import Vrf4Path
from ryu.services.protocols.bgp.info_base.vrf4 import Vrf4Path
self.VRF_PATH_CLASS = Vrf4Path

View File

@ -55,5 +55,5 @@ class Vpnv6Path(VpnPath):
def __init__(self, *args, **kwargs):
super(Vpnv6Path, self).__init__(*args, **kwargs)
from ryu.services.protocols.bgp.speaker.info_base.vrf6 import Vrf6Path
from ryu.services.protocols.bgp.info_base.vrf6 import Vrf6Path
self.VRF_PATH_CLASS = Vrf6Path

View File

@ -93,8 +93,8 @@ class FlexinetOutgoingRoute(object):
'next_sink_out_route', 'prev_sink_out_route', '_route_disc')
def __init__(self, path, route_disc):
from ryu.services.protocols.bgp.speaker.info_base.vrf4 import Vrf4Path
from ryu.services.protocols.bgp.speaker.info_base.vrf6 import Vrf6Path
from ryu.services.protocols.bgp.info_base.vrf4 import Vrf4Path
from ryu.services.protocols.bgp.info_base.vrf6 import Vrf6Path
assert path.route_family in (Vrf4Path.ROUTE_FAMILY,
Vrf6Path.ROUTE_FAMILY)

View File

@ -201,7 +201,7 @@ class RpcSession(Activity):
# graceful manner. Discuss this with other component developers.
# TODO(PH): We should try not to sent routes from bgp peer that is not
# in established state.
from ryu.services.protocols.bgp.speaker.model import \
from ryu.services.protocols.bgp.model import \
FlexinetOutgoingRoute
while True:
# sink iter is Sink instance and next is blocking so this isn't

View File

@ -26,7 +26,7 @@ class Rib(RibBase):
def action(self, params):
if len(params) != 1 or params[0] not in self.supported_families:
return WrongParamResp()
from ryu.services.protocols.bgp.speaker.operator.internal_api \
from ryu.services.protocols.bgp.operator.internal_api \
import WrongParamError
try:
return CommandsResponse(

View File

@ -33,7 +33,7 @@ class Routes(Command, RouteFormatterMixin):
if vrf_rf not in ('ipv4', 'ipv6'):
return WrongParamResp('route-family not one of (ipv4, ipv6)')
from ryu.services.protocols.bgp.speaker.operator.internal_api import \
from ryu.services.protocols.bgp.operator.internal_api import \
WrongParamError
try:

View File

@ -190,7 +190,7 @@ class NeighborConf(ConfWithId, ConfWithStats):
self._settings[CAP_RTC] = \
compute_optional_conf(CAP_RTC, DEFAULT_CAP_RTC, **kwargs)
# Default RTC_AS is local (router) AS.
from ryu.services.protocols.bgp.speaker.core_manager import \
from ryu.services.protocols.bgp.core_manager import \
CORE_MANAGER
default_rt_as = CORE_MANAGER.common_conf.local_as
self._settings[RTC_AS] = \

View File

@ -151,7 +151,7 @@ class BgpProtocol(Protocol, Activity):
Should only be called after protocol has reached OpenConfirm state.
"""
from ryu.services.protocols.bgp.speaker.utils.bgp import from_inet_ptoi
from ryu.services.protocols.bgp.utils.bgp import from_inet_ptoi
if not self.state == BGP_FSM_OPEN_CONFIRM:
raise BgpProtocolException(desc='Can access remote router id only'

View File

@ -74,7 +74,7 @@ class RouteTargetManager(object):
self._add_rt_nlri_for_as(rtc_as, route_target, is_withdraw)
def _add_rt_nlri_for_as(self, rtc_as, route_target, is_withdraw=False):
from ryu.services.protocols.bgp.speaker.core import EXPECTED_ORIGIN
from ryu.services.protocols.bgp.core import EXPECTED_ORIGIN
rt_nlri = RtNlri(rtc_as, route_target)
# Create a dictionary for path-attrs.
pattrs = OrderedDict()