Jonathan Hart

Remove "strip vlan" from our API because it is the same as "pop vlan".

"Strip vlan" is OF1.0 terminology, whereas by OF1.3 it is called "pop vlan".

Change-Id: I483526b39bf8ab6f9f96f251a8469e060b688878
......@@ -207,8 +207,6 @@ public final class DefaultTrafficTreatment implements TrafficTreatment {
default:
throw new IllegalArgumentException("Unknown instruction type: " +
instruction.type());
}
return this;
......@@ -249,10 +247,6 @@ public final class DefaultTrafficTreatment implements TrafficTreatment {
return add(Instructions.modVlanPcp(pcp));
}
public Builder stripVlan() {
return add(Instructions.stripVlanId());
}
@Override
public Builder setIpSrc(IpAddress addr) {
return add(Instructions.modL3Src(addr));
......
......@@ -142,12 +142,6 @@ public interface TrafficTreatment {
public Builder setVlanPcp(Byte pcp);
/**
* Strips the vlan tag if there is one.
* @return a treatment builder
*/
public Builder stripVlan();
/**
* Sets the src l3 address.
*
* @param addr an ip
......
......@@ -42,7 +42,6 @@ import static org.onosproject.net.flow.instructions.L2ModificationInstruction.Mo
import static org.onosproject.net.flow.instructions.L2ModificationInstruction.ModVlanPcpInstruction;
import static org.onosproject.net.flow.instructions.L2ModificationInstruction.PopVlanInstruction;
import static org.onosproject.net.flow.instructions.L2ModificationInstruction.PushHeaderInstructions;
import static org.onosproject.net.flow.instructions.L2ModificationInstruction.StripVlanInstruction;
/**
* Factory class for creating various traffic treatment instructions.
......@@ -141,15 +140,6 @@ public final class Instructions {
}
/**
* Strips the VLAN tag if one is present.
*
* @return a L2 modification
*/
public static L2ModificationInstruction stripVlanId() {
return new StripVlanInstruction();
}
/**
* Creates a MPLS label modification.
*
* @param mplsLabel MPLS label to set
......
......@@ -53,11 +53,6 @@ public abstract class L2ModificationInstruction implements Instruction {
VLAN_PCP,
/**
* Strips the vlan.
*/
STRIP_VLAN,
/**
* MPLS Label modification.
*/
MPLS_LABEL,
......@@ -283,38 +278,6 @@ public abstract class L2ModificationInstruction implements Instruction {
}
}
public static final class StripVlanInstruction extends L2ModificationInstruction {
StripVlanInstruction() {}
@Override
public L2SubType subtype() {
return L2SubType.STRIP_VLAN;
}
@Override
public String toString() {
return toStringHelper(subtype().toString())
.toString();
}
@Override
public int hashCode() {
return Objects.hash(type(), subtype());
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj instanceof StripVlanInstruction) {
return true;
}
return false;
}
}
/**
* Represents a VLAN POP modification instruction.
*/
......
......@@ -83,10 +83,8 @@ public class FlowEntryBuilder {
private final Match match;
/*
All actions are contained in an OFInstruction. For OF1.0
the instruction type is apply instruction (immediate set in ONOS speak)
*/
// All actions are contained in an OFInstruction. For OF1.0
// the instruction type is apply instruction (immediate set in ONOS speak)
private final List<OFInstruction> instructions;
private final Dpid dpid;
......@@ -308,15 +306,13 @@ public class FlowEntryBuilder {
OFActionGroup group = (OFActionGroup) act;
builder.group(new DefaultGroupId(group.getGroup().getGroupNumber()));
break;
case STRIP_VLAN:
case POP_VLAN:
builder.popVlan();
break;
case PUSH_VLAN:
builder.pushVlan();
break;
case STRIP_VLAN:
builder.stripVlan();
break;
case SET_TP_DST:
case SET_TP_SRC:
case POP_PBB:
......
......@@ -207,7 +207,7 @@ public class FlowModBuilderVer10 extends FlowModBuilder {
case VLAN_PCP:
ModVlanPcpInstruction vlanPcp = (ModVlanPcpInstruction) l2m;
return factory().actions().setVlanPcp(VlanPcp.of(vlanPcp.vlanPcp()));
case STRIP_VLAN:
case VLAN_POP:
return factory().actions().stripVlan();
default:
log.warn("Unimplemented action type {}.", l2m.subtype());
......
......@@ -334,8 +334,6 @@ public class FlowModBuilderVer13 extends FlowModBuilder {
(PushHeaderInstructions) l2m;
return factory().actions().popMpls(EthType.of(popHeaderInstructions
.ethernetType()));
case STRIP_VLAN:
return factory().actions().popVlan();
case MPLS_LABEL:
ModMplsLabelInstruction mplsLabel =
(ModMplsLabelInstruction) l2m;
......