CORD-810 Remove VLAN extension selector from OFDPA 3
Change-Id: I973c5c3cb468998782e3b79ca1105a3f57dc265f
diff --git a/drivers/default/src/main/java/org/onosproject/driver/extensions/Ofdpa3ExtensionSelectorInterpreter.java b/drivers/default/src/main/java/org/onosproject/driver/extensions/Ofdpa3ExtensionSelectorInterpreter.java
index 388d0e6..e86dee9 100644
--- a/drivers/default/src/main/java/org/onosproject/driver/extensions/Ofdpa3ExtensionSelectorInterpreter.java
+++ b/drivers/default/src/main/java/org/onosproject/driver/extensions/Ofdpa3ExtensionSelectorInterpreter.java
@@ -28,14 +28,8 @@
import org.projectfloodlight.openflow.protocol.oxm.OFOxm;
import org.projectfloodlight.openflow.protocol.oxm.OFOxmOfdpaMplsL2Port;
import org.projectfloodlight.openflow.protocol.oxm.OFOxmOfdpaOvid;
-import org.projectfloodlight.openflow.protocol.oxm.OFOxmVlanVid;
-import org.projectfloodlight.openflow.protocol.oxm.OFOxmVlanVidMasked;
-import org.projectfloodlight.openflow.types.OFVlanVidMatch;
import org.projectfloodlight.openflow.types.U16;
import org.projectfloodlight.openflow.types.U32;
-import org.projectfloodlight.openflow.types.VlanVid;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
* Interpreter for OFDPA3 OpenFlow selector extensions.
@@ -43,13 +37,9 @@
public class Ofdpa3ExtensionSelectorInterpreter extends AbstractHandlerBehaviour
implements ExtensionSelectorInterpreter, ExtensionSelectorResolver {
- private final Logger log = LoggerFactory.getLogger(getClass());
-
@Override
public boolean supported(ExtensionSelectorType extensionSelectorType) {
- if (extensionSelectorType.equals(ExtensionSelectorTypes.OFDPA_MATCH_VLAN_VID.type())) {
- return true;
- } else if (extensionSelectorType.equals(ExtensionSelectorTypes.OFDPA_MATCH_OVID.type())) {
+ if (extensionSelectorType.equals(ExtensionSelectorTypes.OFDPA_MATCH_OVID.type())) {
return true;
} else if (extensionSelectorType.equals(ExtensionSelectorTypes.OFDPA_MATCH_MPLS_L2_PORT.type())) {
return true;
@@ -60,20 +50,7 @@
@Override
public OFOxm<?> mapSelector(OFFactory factory, ExtensionSelector extensionSelector) {
ExtensionSelectorType type = extensionSelector.type();
- if (type.equals(ExtensionSelectorType.ExtensionSelectorTypes.OFDPA_MATCH_VLAN_VID.type())) {
- VlanId vlanId = ((OfdpaMatchVlanVid) extensionSelector).vlanId();
- // Special VLAN 0x0000/0x1FFF required by OFDPA
- if (vlanId.equals(VlanId.NONE)) {
- OFVlanVidMatch vid = OFVlanVidMatch.ofRawVid((short) 0x0000);
- OFVlanVidMatch mask = OFVlanVidMatch.ofRawVid((short) 0x1FFF);
- return factory.oxms().vlanVidMasked(vid, mask);
- // Normal case
- } else if (vlanId.equals(VlanId.ANY)) {
- return factory.oxms().vlanVidMasked(OFVlanVidMatch.PRESENT, OFVlanVidMatch.PRESENT);
- } else {
- return factory.oxms().vlanVid(OFVlanVidMatch.ofVlanVid(VlanVid.ofVlan(vlanId.toShort())));
- }
- } else if (type.equals(ExtensionSelectorTypes.OFDPA_MATCH_OVID.type())) {
+ if (type.equals(ExtensionSelectorTypes.OFDPA_MATCH_OVID.type())) {
VlanId vlanId = ((Ofdpa3MatchOvid) extensionSelector).vlanId();
if (vlanId.equals(VlanId.NONE)) {
throw new UnsupportedOperationException(
@@ -105,32 +82,7 @@
@Override
public ExtensionSelector mapOxm(OFOxm<?> oxm) {
-
- if (oxm.getMatchField().equals(MatchField.VLAN_VID)) {
- VlanId vlanId;
- if (oxm.isMasked()) {
- OFVlanVidMatch vid = ((OFOxmVlanVidMasked) oxm).getValue();
- OFVlanVidMatch mask = ((OFOxmVlanVidMasked) oxm).getMask();
-
- if (vid.equals(OFVlanVidMatch.ofRawVid((short) 0))) {
- vlanId = VlanId.NONE;
- } else if (vid.equals(OFVlanVidMatch.PRESENT) &&
- mask.equals(OFVlanVidMatch.PRESENT)) {
- vlanId = VlanId.ANY;
- } else {
- vlanId = VlanId.vlanId(vid.getVlan());
- }
- } else {
- OFVlanVidMatch vid = ((OFOxmVlanVid) oxm).getValue();
-
- if (!vid.isPresentBitSet()) {
- vlanId = VlanId.NONE;
- } else {
- vlanId = VlanId.vlanId(vid.getVlan());
- }
- }
- return new OfdpaMatchVlanVid(vlanId);
- } else if (oxm.getMatchField().equals(MatchField.OFDPA_OVID)) {
+ if (oxm.getMatchField().equals(MatchField.OFDPA_OVID)) {
VlanId vlanId;
if (oxm.isMasked()) {
throw new UnsupportedOperationException(
@@ -171,9 +123,7 @@
@Override
public ExtensionSelector getExtensionSelector(ExtensionSelectorType type) {
- if (type.equals(ExtensionSelectorType.ExtensionSelectorTypes.OFDPA_MATCH_VLAN_VID.type())) {
- return new OfdpaMatchVlanVid();
- } else if (type.equals(ExtensionSelectorTypes.OFDPA_MATCH_OVID.type())) {
+ if (type.equals(ExtensionSelectorTypes.OFDPA_MATCH_OVID.type())) {
return new Ofdpa3MatchOvid();
} else if (type.equals(ExtensionSelectorTypes.OFDPA_MATCH_MPLS_L2_PORT.type())) {
return new Ofdpa3MatchMplsL2Port();