Saurav Das
Committed by Gerrit Code Review

Minor bug fixes to bgprouter and ofdpadriver

Cleaned up some handshakers that are not needed

Change-Id: I87fc202c39a9b4646d61321cdc488059f39c120b
......@@ -358,7 +358,8 @@ public class BgpRouter {
.addCondition(Criteria.matchVlanId(intf.vlan()));
intf.ipAddresses().stream()
.forEach(ipaddr -> fob.addCondition(
Criteria.matchIPDst(ipaddr.subnetAddress())));
Criteria.matchIPDst(
IpPrefix.valueOf(ipaddr.ipAddress(), 32))));
fob.permit().fromApp(appId);
flowObjectiveService.filter(
deviceId,
......@@ -366,7 +367,7 @@ public class BgpRouter {
@Override
public void onSuccess(Objective objective) {
log.info("Successfully installed interface based "
+ "filtering objcetives for intf {}", intf);
+ "filtering objectives for intf {}", intf);
}
@Override
......
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.driver.handshaker;
public class OFOVSSwitchCorsaTTP extends OFCorsaSwitchDriver {
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.driver.handshaker;
import org.onosproject.openflow.controller.driver.AbstractOpenFlowSwitch;
import org.onosproject.openflow.controller.driver.SwitchDriverSubHandshakeAlreadyStarted;
import org.onosproject.openflow.controller.driver.SwitchDriverSubHandshakeCompleted;
import org.onosproject.openflow.controller.driver.SwitchDriverSubHandshakeNotStarted;
import org.projectfloodlight.openflow.protocol.OFFactory;
import org.projectfloodlight.openflow.protocol.OFMessage;
import java.util.concurrent.atomic.AtomicBoolean;
public class OFSwitchImplSpringOpenTTP extends AbstractOpenFlowSwitch {
private OFFactory factory;
private final AtomicBoolean driverHandshakeComplete = new AtomicBoolean(false);
@Override
public Boolean supportNxRole() {
return false;
}
@Override
public void startDriverHandshake() {
log.debug("Starting driver handshake for sw {}", getStringId());
if (startDriverHandshakeCalled) {
throw new SwitchDriverSubHandshakeAlreadyStarted();
}
startDriverHandshakeCalled = true;
factory = this.factory();
driverHandshakeComplete.set(true);
log.debug("Driver handshake is complete");
}
@Override
public boolean isDriverHandshakeComplete() {
if (!startDriverHandshakeCalled) {
throw new SwitchDriverSubHandshakeNotStarted();
}
return driverHandshakeComplete.get();
}
@Override
public void processDriverHandshakeMessage(OFMessage m) {
if (!startDriverHandshakeCalled) {
throw new SwitchDriverSubHandshakeNotStarted();
}
if (driverHandshakeComplete.get()) {
throw new SwitchDriverSubHandshakeCompleted(m);
}
}
}
......@@ -135,7 +135,7 @@ public class OFDPA1Pipeline extends AbstractHandlerBehaviour implements Pipeline
private GroupService groupService;
private FlowObjectiveStore flowObjectiveStore;
private DeviceId deviceId;
private ApplicationId appId;
private ApplicationId driverId;
private KryoNamespace appKryo = new KryoNamespace.Builder()
.register(GroupKey.class)
......@@ -175,7 +175,7 @@ public class OFDPA1Pipeline extends AbstractHandlerBehaviour implements Pipeline
groupService.addListener(new InnerGroupListener());
appId = coreService.registerApplication(
driverId = coreService.registerApplication(
"org.onosproject.driver.OFDPA1Pipeline");
initializePipeline();
......@@ -307,7 +307,7 @@ public class OFDPA1Pipeline extends AbstractHandlerBehaviour implements Pipeline
.withSelector(selector.build())
.withTreatment(treatment.build())
.withPriority(DEFAULT_PRIORITY)
.fromApp(appId)
.fromApp(applicationId)
.makePermanent()
.forTable(VLAN_TABLE).build();
ops = ops.add(rule);
......@@ -325,7 +325,7 @@ public class OFDPA1Pipeline extends AbstractHandlerBehaviour implements Pipeline
.withSelector(selector.build())
.withTreatment(treatment.build())
.withPriority(DEFAULT_PRIORITY)
.fromApp(appId)
.fromApp(applicationId)
.makePermanent()
.forTable(TMAC_TABLE).build();
ops = ops.add(rule);
......@@ -341,8 +341,8 @@ public class OFDPA1Pipeline extends AbstractHandlerBehaviour implements Pipeline
.forDevice(deviceId)
.withSelector(selector.build())
.withTreatment(treatment.build())
.withPriority(DEFAULT_PRIORITY)
.fromApp(appId)
.withPriority(HIGHEST_PRIORITY)
.fromApp(applicationId)
.makePermanent()
.forTable(ACL_TABLE).build();
ops = ops.add(rule);
......@@ -632,7 +632,7 @@ public class OFDPA1Pipeline extends AbstractHandlerBehaviour implements Pipeline
.withSelector(selector.build())
.withTreatment(treatment.build())
.withPriority(LOWEST_PRIORITY)
.fromApp(appId)
.fromApp(driverId)
.makePermanent()
.forTable(PORT_TABLE).build();
ops = ops.add(tmisse);
......@@ -714,7 +714,7 @@ public class OFDPA1Pipeline extends AbstractHandlerBehaviour implements Pipeline
.withSelector(selector.build())
.withTreatment(treatment.build())
.withPriority(LOWEST_PRIORITY)
.fromApp(appId)
.fromApp(driverId)
.makePermanent()
.forTable(TMAC_TABLE).build();
ops = ops.add(rule); // XXX bug in ofdpa
......@@ -744,7 +744,7 @@ public class OFDPA1Pipeline extends AbstractHandlerBehaviour implements Pipeline
.withSelector(selector.build())
.withTreatment(treatment.build())
.withPriority(LOWEST_PRIORITY)
.fromApp(appId)
.fromApp(driverId)
.makePermanent()
.forTable(UNICAST_ROUTING_TABLE).build();
ops = ops.add(rule);
......
......@@ -21,11 +21,10 @@
<behaviour api="org.onosproject.openflow.controller.driver.OpenFlowSwitchDriver"
impl="org.onosproject.driver.handshaker.DefaultSwitchHandShaker"/>
</driver>
<driver name="ovs-corsa" manufacturer="Corsa" hwVersion="emulation" swVersion="0.0.0">
<driver name="ovs-corsa" extends="default"
manufacturer="Corsa" hwVersion="emulation" swVersion="0.0.0">
<behaviour api="org.onosproject.net.behaviour.Pipeliner"
impl="org.onosproject.driver.pipeline.OVSCorsaPipeline"/>
<behaviour api="org.onosproject.openflow.controller.driver.OpenFlowSwitchDriver"
impl="org.onosproject.driver.handshaker.OFOVSSwitchCorsaTTP"/>
</driver>
<driver name="spring-open-cpqd" extends="default"
manufacturer="Stanford University, Ericsson Research and CPqD Research" hwVersion="OpenFlow 1.3 Reference Userspace Switch" swVersion=".*">
......