summaryrefslogtreecommitdiffstats
path: root/framework/src/onos/providers/openflow/flow
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/onos/providers/openflow/flow')
-rw-r--r--framework/src/onos/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowEntryBuilder.java18
-rw-r--r--framework/src/onos/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilder.java20
-rw-r--r--framework/src/onos/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java14
3 files changed, 39 insertions, 13 deletions
diff --git a/framework/src/onos/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowEntryBuilder.java b/framework/src/onos/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowEntryBuilder.java
index 1354240f..d4494f18 100644
--- a/framework/src/onos/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowEntryBuilder.java
+++ b/framework/src/onos/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowEntryBuilder.java
@@ -44,7 +44,7 @@ import org.onosproject.net.flow.TrafficSelector;
import org.onosproject.net.flow.TrafficTreatment;
import org.onosproject.net.flow.instructions.Instructions;
import org.onosproject.openflow.controller.Dpid;
-import org.onosproject.openflow.controller.ExtensionInterpreter;
+import org.onosproject.openflow.controller.ExtensionTreatmentInterpreter;
import org.projectfloodlight.openflow.protocol.OFFlowMod;
import org.projectfloodlight.openflow.protocol.OFFlowRemoved;
import org.projectfloodlight.openflow.protocol.OFFlowStatsEntry;
@@ -449,7 +449,7 @@ public class FlowEntryBuilder {
break;
case TUNNEL_IPV4_DST:
DriverHandler driver = getDriver(dpid);
- ExtensionInterpreter interpreter = driver.behaviour(ExtensionInterpreter.class);
+ ExtensionTreatmentInterpreter interpreter = driver.behaviour(ExtensionTreatmentInterpreter.class);
if (interpreter != null) {
builder.extension(interpreter.mapAction(action), DeviceId.deviceId(Dpid.uri(dpid)));
}
@@ -513,6 +513,7 @@ public class FlowEntryBuilder {
Ip4Prefix ip4Prefix;
Ip6Address ip6Address;
Ip6Prefix ip6Prefix;
+ Ip4Address ip;
TrafficSelector.Builder builder = DefaultTrafficSelector.builder();
for (MatchField<?> field : match.getMatchFields()) {
@@ -707,17 +708,26 @@ public class FlowEntryBuilder {
long tunnelId = match.get(MatchField.TUNNEL_ID).getValue();
builder.matchTunnelId(tunnelId);
break;
+ case ARP_OP:
+ int arpOp = match.get(MatchField.ARP_OP).getOpcode();
+ builder.matchArpOp(arpOp);
+ break;
case ARP_SHA:
mac = MacAddress.valueOf(match.get(MatchField.ARP_SHA).getLong());
builder.matchArpSha(mac);
break;
+ case ARP_SPA:
+ ip = Ip4Address.valueOf(match.get(MatchField.ARP_SPA).getInt());
+ builder.matchArpSpa(ip);
+ break;
case ARP_THA:
mac = MacAddress.valueOf(match.get(MatchField.ARP_THA).getLong());
builder.matchArpTha(mac);
break;
- case ARP_OP:
- case ARP_SPA:
case ARP_TPA:
+ ip = Ip4Address.valueOf(match.get(MatchField.ARP_TPA).getInt());
+ builder.matchArpTpa(ip);
+ break;
case MPLS_TC:
default:
log.warn("Match type {} not yet implemented.", field.id);
diff --git a/framework/src/onos/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilder.java b/framework/src/onos/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilder.java
index c5de72a8..2a8d2010 100644
--- a/framework/src/onos/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilder.java
+++ b/framework/src/onos/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilder.java
@@ -25,6 +25,8 @@ import org.onosproject.net.driver.DriverService;
import org.onosproject.net.flow.FlowRule;
import org.onosproject.net.flow.TrafficSelector;
import org.onosproject.net.flow.criteria.ArpHaCriterion;
+import org.onosproject.net.flow.criteria.ArpOpCriterion;
+import org.onosproject.net.flow.criteria.ArpPaCriterion;
import org.onosproject.net.flow.criteria.Criterion;
import org.onosproject.net.flow.criteria.EthCriterion;
import org.onosproject.net.flow.criteria.EthTypeCriterion;
@@ -58,6 +60,7 @@ import org.projectfloodlight.openflow.protocol.OFFlowDelete;
import org.projectfloodlight.openflow.protocol.OFFlowMod;
import org.projectfloodlight.openflow.protocol.match.Match;
import org.projectfloodlight.openflow.protocol.match.MatchField;
+import org.projectfloodlight.openflow.types.ArpOpcode;
import org.projectfloodlight.openflow.types.CircuitSignalID;
import org.projectfloodlight.openflow.types.EthType;
import org.projectfloodlight.openflow.types.ICMPv4Code;
@@ -180,6 +183,7 @@ public abstract class FlowModBuilder {
SctpPortCriterion sctpPortCriterion;
IPv6NDLinkLayerAddressCriterion llAddressCriterion;
ArpHaCriterion arpHaCriterion;
+ ArpPaCriterion arpPaCriterion;
for (Criterion c : selector.criteria()) {
switch (c.type()) {
@@ -417,19 +421,31 @@ public abstract class FlowModBuilder {
mplsBos.mplsBos() ? OFBooleanValue.TRUE
: OFBooleanValue.FALSE);
break;
+ case ARP_OP:
+ ArpOpCriterion arpOp = (ArpOpCriterion) c;
+ mBuilder.setExact(MatchField.ARP_OP,
+ ArpOpcode.of(arpOp.arpOp()));
+ break;
case ARP_SHA:
arpHaCriterion = (ArpHaCriterion) c;
mBuilder.setExact(MatchField.ARP_SHA,
MacAddress.of(arpHaCriterion.mac().toLong()));
break;
+ case ARP_SPA:
+ arpPaCriterion = (ArpPaCriterion) c;
+ mBuilder.setExact(MatchField.ARP_SPA,
+ IPv4Address.of(arpPaCriterion.ip().toInt()));
+ break;
case ARP_THA:
arpHaCriterion = (ArpHaCriterion) c;
mBuilder.setExact(MatchField.ARP_THA,
MacAddress.of(arpHaCriterion.mac().toLong()));
break;
- case ARP_OP:
- case ARP_SPA:
case ARP_TPA:
+ arpPaCriterion = (ArpPaCriterion) c;
+ mBuilder.setExact(MatchField.ARP_TPA,
+ IPv4Address.of(arpPaCriterion.ip().toInt()));
+ break;
case MPLS_TC:
case PBB_ISID:
default:
diff --git a/framework/src/onos/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java b/framework/src/onos/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java
index e2fc30da..90def432 100644
--- a/framework/src/onos/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java
+++ b/framework/src/onos/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java
@@ -27,7 +27,7 @@ import org.onosproject.net.driver.Driver;
import org.onosproject.net.driver.DriverService;
import org.onosproject.net.flow.FlowRule;
import org.onosproject.net.flow.TrafficTreatment;
-import org.onosproject.net.flow.instructions.ExtensionInstruction;
+import org.onosproject.net.flow.instructions.ExtensionTreatment;
import org.onosproject.net.flow.instructions.Instruction;
import org.onosproject.net.flow.instructions.Instructions;
import org.onosproject.net.flow.instructions.Instructions.GroupInstruction;
@@ -49,7 +49,7 @@ import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModIPInst
import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModIPv6FlowLabelInstruction;
import org.onosproject.net.flow.instructions.L4ModificationInstruction;
import org.onosproject.net.flow.instructions.L4ModificationInstruction.ModTransportPortInstruction;
-import org.onosproject.openflow.controller.ExtensionInterpreter;
+import org.onosproject.openflow.controller.ExtensionTreatmentInterpreter;
import org.projectfloodlight.openflow.protocol.OFFactory;
import org.projectfloodlight.openflow.protocol.OFFlowAdd;
import org.projectfloodlight.openflow.protocol.OFFlowDelete;
@@ -320,7 +320,7 @@ public class FlowModBuilderVer13 extends FlowModBuilder {
}
private OFAction buildModLambdaInstruction(ModLambdaInstruction instruction) {
- return factory().actions().circuit(factory().oxms().ochSigidBasic(
+ return factory().actions().circuit(factory().oxms().expOchSigId(
new CircuitSignalID((byte) 1, (byte) 2, instruction.lambda(), (short) 1)));
}
@@ -329,7 +329,7 @@ public class FlowModBuilderVer13 extends FlowModBuilder {
byte gridType = OpenFlowValueMapper.lookupGridType(signal.gridType());
byte channelSpacing = OpenFlowValueMapper.lookupChannelSpacing(signal.channelSpacing());
- return factory().actions().circuit(factory().oxms().ochSigidBasic(
+ return factory().actions().circuit(factory().oxms().expOchSigId(
new CircuitSignalID(gridType, channelSpacing,
(short) signal.spacingMultiplier(), (short) signal.slotGranularity())
));
@@ -482,16 +482,16 @@ public class FlowModBuilderVer13 extends FlowModBuilder {
return null;
}
- private OFAction buildExtensionAction(ExtensionInstruction i) {
+ private OFAction buildExtensionAction(ExtensionTreatment i) {
if (!driverService.isPresent()) {
log.error("No driver service present");
return null;
}
Driver driver = driverService.get().getDriver(deviceId);
- if (driver.hasBehaviour(ExtensionInterpreter.class)) {
+ if (driver.hasBehaviour(ExtensionTreatmentInterpreter.class)) {
DefaultDriverHandler handler =
new DefaultDriverHandler(new DefaultDriverData(driver, deviceId));
- ExtensionInterpreter interpreter = handler.behaviour(ExtensionInterpreter.class);
+ ExtensionTreatmentInterpreter interpreter = handler.behaviour(ExtensionTreatmentInterpreter.class);
return interpreter.mapInstruction(factory(), i);
}