Committed by
Gerrit Code Review
Minor bug fixes to bgprouter and ofdpadriver
Cleaned up some handshakers that are not needed Change-Id: I87fc202c39a9b4646d61321cdc488059f39c120b
Showing
6 changed files
with
14 additions
and
107 deletions
| ... | @@ -358,7 +358,8 @@ public class BgpRouter { | ... | @@ -358,7 +358,8 @@ public class BgpRouter { |
| 358 | .addCondition(Criteria.matchVlanId(intf.vlan())); | 358 | .addCondition(Criteria.matchVlanId(intf.vlan())); |
| 359 | intf.ipAddresses().stream() | 359 | intf.ipAddresses().stream() |
| 360 | .forEach(ipaddr -> fob.addCondition( | 360 | .forEach(ipaddr -> fob.addCondition( |
| 361 | - Criteria.matchIPDst(ipaddr.subnetAddress()))); | 361 | + Criteria.matchIPDst( |
| 362 | + IpPrefix.valueOf(ipaddr.ipAddress(), 32)))); | ||
| 362 | fob.permit().fromApp(appId); | 363 | fob.permit().fromApp(appId); |
| 363 | flowObjectiveService.filter( | 364 | flowObjectiveService.filter( |
| 364 | deviceId, | 365 | deviceId, |
| ... | @@ -366,7 +367,7 @@ public class BgpRouter { | ... | @@ -366,7 +367,7 @@ public class BgpRouter { |
| 366 | @Override | 367 | @Override |
| 367 | public void onSuccess(Objective objective) { | 368 | public void onSuccess(Objective objective) { |
| 368 | log.info("Successfully installed interface based " | 369 | log.info("Successfully installed interface based " |
| 369 | - + "filtering objcetives for intf {}", intf); | 370 | + + "filtering objectives for intf {}", intf); |
| 370 | } | 371 | } |
| 371 | 372 | ||
| 372 | @Override | 373 | @Override | ... | ... |
| 1 | -/* | ||
| 2 | - * Copyright 2015 Open Networking Laboratory | ||
| 3 | - * | ||
| 4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | - * you may not use this file except in compliance with the License. | ||
| 6 | - * You may obtain a copy of the License at | ||
| 7 | - * | ||
| 8 | - * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | - * | ||
| 10 | - * Unless required by applicable law or agreed to in writing, software | ||
| 11 | - * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | - * See the License for the specific language governing permissions and | ||
| 14 | - * limitations under the License. | ||
| 15 | - */ | ||
| 16 | -package org.onosproject.driver.handshaker; | ||
| 17 | - | ||
| 18 | -public class OFOVSSwitchCorsaTTP extends OFCorsaSwitchDriver { | ||
| 19 | - | ||
| 20 | -} |
This diff is collapsed. Click to expand it.
drivers/src/main/java/org/onosproject/driver/handshaker/OFSwitchImplSpringOpenTTP.java
deleted
100644 → 0
| 1 | -/* | ||
| 2 | - * Copyright 2015 Open Networking Laboratory | ||
| 3 | - * | ||
| 4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | - * you may not use this file except in compliance with the License. | ||
| 6 | - * You may obtain a copy of the License at | ||
| 7 | - * | ||
| 8 | - * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | - * | ||
| 10 | - * Unless required by applicable law or agreed to in writing, software | ||
| 11 | - * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | - * See the License for the specific language governing permissions and | ||
| 14 | - * limitations under the License. | ||
| 15 | - */ | ||
| 16 | -package org.onosproject.driver.handshaker; | ||
| 17 | - | ||
| 18 | -import org.onosproject.openflow.controller.driver.AbstractOpenFlowSwitch; | ||
| 19 | -import org.onosproject.openflow.controller.driver.SwitchDriverSubHandshakeAlreadyStarted; | ||
| 20 | -import org.onosproject.openflow.controller.driver.SwitchDriverSubHandshakeCompleted; | ||
| 21 | -import org.onosproject.openflow.controller.driver.SwitchDriverSubHandshakeNotStarted; | ||
| 22 | -import org.projectfloodlight.openflow.protocol.OFFactory; | ||
| 23 | -import org.projectfloodlight.openflow.protocol.OFMessage; | ||
| 24 | - | ||
| 25 | -import java.util.concurrent.atomic.AtomicBoolean; | ||
| 26 | - | ||
| 27 | -public class OFSwitchImplSpringOpenTTP extends AbstractOpenFlowSwitch { | ||
| 28 | - | ||
| 29 | - private OFFactory factory; | ||
| 30 | - | ||
| 31 | - private final AtomicBoolean driverHandshakeComplete = new AtomicBoolean(false); | ||
| 32 | - | ||
| 33 | - @Override | ||
| 34 | - public Boolean supportNxRole() { | ||
| 35 | - return false; | ||
| 36 | - } | ||
| 37 | - | ||
| 38 | - | ||
| 39 | - @Override | ||
| 40 | - public void startDriverHandshake() { | ||
| 41 | - log.debug("Starting driver handshake for sw {}", getStringId()); | ||
| 42 | - if (startDriverHandshakeCalled) { | ||
| 43 | - throw new SwitchDriverSubHandshakeAlreadyStarted(); | ||
| 44 | - } | ||
| 45 | - startDriverHandshakeCalled = true; | ||
| 46 | - factory = this.factory(); | ||
| 47 | - | ||
| 48 | - driverHandshakeComplete.set(true); | ||
| 49 | - log.debug("Driver handshake is complete"); | ||
| 50 | - | ||
| 51 | - } | ||
| 52 | - | ||
| 53 | - @Override | ||
| 54 | - public boolean isDriverHandshakeComplete() { | ||
| 55 | - if (!startDriverHandshakeCalled) { | ||
| 56 | - throw new SwitchDriverSubHandshakeNotStarted(); | ||
| 57 | - } | ||
| 58 | - return driverHandshakeComplete.get(); | ||
| 59 | - } | ||
| 60 | - | ||
| 61 | - | ||
| 62 | - | ||
| 63 | - @Override | ||
| 64 | - public void processDriverHandshakeMessage(OFMessage m) { | ||
| 65 | - if (!startDriverHandshakeCalled) { | ||
| 66 | - throw new SwitchDriverSubHandshakeNotStarted(); | ||
| 67 | - } | ||
| 68 | - if (driverHandshakeComplete.get()) { | ||
| 69 | - throw new SwitchDriverSubHandshakeCompleted(m); | ||
| 70 | - } | ||
| 71 | - } | ||
| 72 | - | ||
| 73 | -} |
| ... | @@ -135,7 +135,7 @@ public class OFDPA1Pipeline extends AbstractHandlerBehaviour implements Pipeline | ... | @@ -135,7 +135,7 @@ public class OFDPA1Pipeline extends AbstractHandlerBehaviour implements Pipeline |
| 135 | private GroupService groupService; | 135 | private GroupService groupService; |
| 136 | private FlowObjectiveStore flowObjectiveStore; | 136 | private FlowObjectiveStore flowObjectiveStore; |
| 137 | private DeviceId deviceId; | 137 | private DeviceId deviceId; |
| 138 | - private ApplicationId appId; | 138 | + private ApplicationId driverId; |
| 139 | 139 | ||
| 140 | private KryoNamespace appKryo = new KryoNamespace.Builder() | 140 | private KryoNamespace appKryo = new KryoNamespace.Builder() |
| 141 | .register(GroupKey.class) | 141 | .register(GroupKey.class) |
| ... | @@ -175,7 +175,7 @@ public class OFDPA1Pipeline extends AbstractHandlerBehaviour implements Pipeline | ... | @@ -175,7 +175,7 @@ public class OFDPA1Pipeline extends AbstractHandlerBehaviour implements Pipeline |
| 175 | 175 | ||
| 176 | groupService.addListener(new InnerGroupListener()); | 176 | groupService.addListener(new InnerGroupListener()); |
| 177 | 177 | ||
| 178 | - appId = coreService.registerApplication( | 178 | + driverId = coreService.registerApplication( |
| 179 | "org.onosproject.driver.OFDPA1Pipeline"); | 179 | "org.onosproject.driver.OFDPA1Pipeline"); |
| 180 | 180 | ||
| 181 | initializePipeline(); | 181 | initializePipeline(); |
| ... | @@ -307,7 +307,7 @@ public class OFDPA1Pipeline extends AbstractHandlerBehaviour implements Pipeline | ... | @@ -307,7 +307,7 @@ public class OFDPA1Pipeline extends AbstractHandlerBehaviour implements Pipeline |
| 307 | .withSelector(selector.build()) | 307 | .withSelector(selector.build()) |
| 308 | .withTreatment(treatment.build()) | 308 | .withTreatment(treatment.build()) |
| 309 | .withPriority(DEFAULT_PRIORITY) | 309 | .withPriority(DEFAULT_PRIORITY) |
| 310 | - .fromApp(appId) | 310 | + .fromApp(applicationId) |
| 311 | .makePermanent() | 311 | .makePermanent() |
| 312 | .forTable(VLAN_TABLE).build(); | 312 | .forTable(VLAN_TABLE).build(); |
| 313 | ops = ops.add(rule); | 313 | ops = ops.add(rule); |
| ... | @@ -325,7 +325,7 @@ public class OFDPA1Pipeline extends AbstractHandlerBehaviour implements Pipeline | ... | @@ -325,7 +325,7 @@ public class OFDPA1Pipeline extends AbstractHandlerBehaviour implements Pipeline |
| 325 | .withSelector(selector.build()) | 325 | .withSelector(selector.build()) |
| 326 | .withTreatment(treatment.build()) | 326 | .withTreatment(treatment.build()) |
| 327 | .withPriority(DEFAULT_PRIORITY) | 327 | .withPriority(DEFAULT_PRIORITY) |
| 328 | - .fromApp(appId) | 328 | + .fromApp(applicationId) |
| 329 | .makePermanent() | 329 | .makePermanent() |
| 330 | .forTable(TMAC_TABLE).build(); | 330 | .forTable(TMAC_TABLE).build(); |
| 331 | ops = ops.add(rule); | 331 | ops = ops.add(rule); |
| ... | @@ -341,8 +341,8 @@ public class OFDPA1Pipeline extends AbstractHandlerBehaviour implements Pipeline | ... | @@ -341,8 +341,8 @@ public class OFDPA1Pipeline extends AbstractHandlerBehaviour implements Pipeline |
| 341 | .forDevice(deviceId) | 341 | .forDevice(deviceId) |
| 342 | .withSelector(selector.build()) | 342 | .withSelector(selector.build()) |
| 343 | .withTreatment(treatment.build()) | 343 | .withTreatment(treatment.build()) |
| 344 | - .withPriority(DEFAULT_PRIORITY) | 344 | + .withPriority(HIGHEST_PRIORITY) |
| 345 | - .fromApp(appId) | 345 | + .fromApp(applicationId) |
| 346 | .makePermanent() | 346 | .makePermanent() |
| 347 | .forTable(ACL_TABLE).build(); | 347 | .forTable(ACL_TABLE).build(); |
| 348 | ops = ops.add(rule); | 348 | ops = ops.add(rule); |
| ... | @@ -632,7 +632,7 @@ public class OFDPA1Pipeline extends AbstractHandlerBehaviour implements Pipeline | ... | @@ -632,7 +632,7 @@ public class OFDPA1Pipeline extends AbstractHandlerBehaviour implements Pipeline |
| 632 | .withSelector(selector.build()) | 632 | .withSelector(selector.build()) |
| 633 | .withTreatment(treatment.build()) | 633 | .withTreatment(treatment.build()) |
| 634 | .withPriority(LOWEST_PRIORITY) | 634 | .withPriority(LOWEST_PRIORITY) |
| 635 | - .fromApp(appId) | 635 | + .fromApp(driverId) |
| 636 | .makePermanent() | 636 | .makePermanent() |
| 637 | .forTable(PORT_TABLE).build(); | 637 | .forTable(PORT_TABLE).build(); |
| 638 | ops = ops.add(tmisse); | 638 | ops = ops.add(tmisse); |
| ... | @@ -714,7 +714,7 @@ public class OFDPA1Pipeline extends AbstractHandlerBehaviour implements Pipeline | ... | @@ -714,7 +714,7 @@ public class OFDPA1Pipeline extends AbstractHandlerBehaviour implements Pipeline |
| 714 | .withSelector(selector.build()) | 714 | .withSelector(selector.build()) |
| 715 | .withTreatment(treatment.build()) | 715 | .withTreatment(treatment.build()) |
| 716 | .withPriority(LOWEST_PRIORITY) | 716 | .withPriority(LOWEST_PRIORITY) |
| 717 | - .fromApp(appId) | 717 | + .fromApp(driverId) |
| 718 | .makePermanent() | 718 | .makePermanent() |
| 719 | .forTable(TMAC_TABLE).build(); | 719 | .forTable(TMAC_TABLE).build(); |
| 720 | ops = ops.add(rule); // XXX bug in ofdpa | 720 | ops = ops.add(rule); // XXX bug in ofdpa |
| ... | @@ -744,7 +744,7 @@ public class OFDPA1Pipeline extends AbstractHandlerBehaviour implements Pipeline | ... | @@ -744,7 +744,7 @@ public class OFDPA1Pipeline extends AbstractHandlerBehaviour implements Pipeline |
| 744 | .withSelector(selector.build()) | 744 | .withSelector(selector.build()) |
| 745 | .withTreatment(treatment.build()) | 745 | .withTreatment(treatment.build()) |
| 746 | .withPriority(LOWEST_PRIORITY) | 746 | .withPriority(LOWEST_PRIORITY) |
| 747 | - .fromApp(appId) | 747 | + .fromApp(driverId) |
| 748 | .makePermanent() | 748 | .makePermanent() |
| 749 | .forTable(UNICAST_ROUTING_TABLE).build(); | 749 | .forTable(UNICAST_ROUTING_TABLE).build(); |
| 750 | ops = ops.add(rule); | 750 | ops = ops.add(rule); | ... | ... |
| ... | @@ -21,11 +21,10 @@ | ... | @@ -21,11 +21,10 @@ |
| 21 | <behaviour api="org.onosproject.openflow.controller.driver.OpenFlowSwitchDriver" | 21 | <behaviour api="org.onosproject.openflow.controller.driver.OpenFlowSwitchDriver" |
| 22 | impl="org.onosproject.driver.handshaker.DefaultSwitchHandShaker"/> | 22 | impl="org.onosproject.driver.handshaker.DefaultSwitchHandShaker"/> |
| 23 | </driver> | 23 | </driver> |
| 24 | - <driver name="ovs-corsa" manufacturer="Corsa" hwVersion="emulation" swVersion="0.0.0"> | 24 | + <driver name="ovs-corsa" extends="default" |
| 25 | + manufacturer="Corsa" hwVersion="emulation" swVersion="0.0.0"> | ||
| 25 | <behaviour api="org.onosproject.net.behaviour.Pipeliner" | 26 | <behaviour api="org.onosproject.net.behaviour.Pipeliner" |
| 26 | impl="org.onosproject.driver.pipeline.OVSCorsaPipeline"/> | 27 | impl="org.onosproject.driver.pipeline.OVSCorsaPipeline"/> |
| 27 | - <behaviour api="org.onosproject.openflow.controller.driver.OpenFlowSwitchDriver" | ||
| 28 | - impl="org.onosproject.driver.handshaker.OFOVSSwitchCorsaTTP"/> | ||
| 29 | </driver> | 28 | </driver> |
| 30 | <driver name="spring-open-cpqd" extends="default" | 29 | <driver name="spring-open-cpqd" extends="default" |
| 31 | manufacturer="Stanford University, Ericsson Research and CPqD Research" hwVersion="OpenFlow 1.3 Reference Userspace Switch" swVersion=".*"> | 30 | manufacturer="Stanford University, Ericsson Research and CPqD Research" hwVersion="OpenFlow 1.3 Reference Userspace Switch" swVersion=".*"> | ... | ... |
-
Please register or login to post a comment