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
Showing
7 changed files
with
5 additions
and
70 deletions
| ... | @@ -207,8 +207,6 @@ public final class DefaultTrafficTreatment implements TrafficTreatment { | ... | @@ -207,8 +207,6 @@ public final class DefaultTrafficTreatment implements TrafficTreatment { |
| 207 | default: | 207 | default: |
| 208 | throw new IllegalArgumentException("Unknown instruction type: " + | 208 | throw new IllegalArgumentException("Unknown instruction type: " + |
| 209 | instruction.type()); | 209 | instruction.type()); |
| 210 | - | ||
| 211 | - | ||
| 212 | } | 210 | } |
| 213 | 211 | ||
| 214 | return this; | 212 | return this; |
| ... | @@ -249,10 +247,6 @@ public final class DefaultTrafficTreatment implements TrafficTreatment { | ... | @@ -249,10 +247,6 @@ public final class DefaultTrafficTreatment implements TrafficTreatment { |
| 249 | return add(Instructions.modVlanPcp(pcp)); | 247 | return add(Instructions.modVlanPcp(pcp)); |
| 250 | } | 248 | } |
| 251 | 249 | ||
| 252 | - public Builder stripVlan() { | ||
| 253 | - return add(Instructions.stripVlanId()); | ||
| 254 | - } | ||
| 255 | - | ||
| 256 | @Override | 250 | @Override |
| 257 | public Builder setIpSrc(IpAddress addr) { | 251 | public Builder setIpSrc(IpAddress addr) { |
| 258 | return add(Instructions.modL3Src(addr)); | 252 | return add(Instructions.modL3Src(addr)); | ... | ... |
| ... | @@ -142,12 +142,6 @@ public interface TrafficTreatment { | ... | @@ -142,12 +142,6 @@ public interface TrafficTreatment { |
| 142 | public Builder setVlanPcp(Byte pcp); | 142 | public Builder setVlanPcp(Byte pcp); |
| 143 | 143 | ||
| 144 | /** | 144 | /** |
| 145 | - * Strips the vlan tag if there is one. | ||
| 146 | - * @return a treatment builder | ||
| 147 | - */ | ||
| 148 | - public Builder stripVlan(); | ||
| 149 | - | ||
| 150 | - /** | ||
| 151 | * Sets the src l3 address. | 145 | * Sets the src l3 address. |
| 152 | * | 146 | * |
| 153 | * @param addr an ip | 147 | * @param addr an ip | ... | ... |
| ... | @@ -42,7 +42,6 @@ import static org.onosproject.net.flow.instructions.L2ModificationInstruction.Mo | ... | @@ -42,7 +42,6 @@ import static org.onosproject.net.flow.instructions.L2ModificationInstruction.Mo |
| 42 | import static org.onosproject.net.flow.instructions.L2ModificationInstruction.ModVlanPcpInstruction; | 42 | import static org.onosproject.net.flow.instructions.L2ModificationInstruction.ModVlanPcpInstruction; |
| 43 | import static org.onosproject.net.flow.instructions.L2ModificationInstruction.PopVlanInstruction; | 43 | import static org.onosproject.net.flow.instructions.L2ModificationInstruction.PopVlanInstruction; |
| 44 | import static org.onosproject.net.flow.instructions.L2ModificationInstruction.PushHeaderInstructions; | 44 | import static org.onosproject.net.flow.instructions.L2ModificationInstruction.PushHeaderInstructions; |
| 45 | -import static org.onosproject.net.flow.instructions.L2ModificationInstruction.StripVlanInstruction; | ||
| 46 | 45 | ||
| 47 | /** | 46 | /** |
| 48 | * Factory class for creating various traffic treatment instructions. | 47 | * Factory class for creating various traffic treatment instructions. |
| ... | @@ -141,15 +140,6 @@ public final class Instructions { | ... | @@ -141,15 +140,6 @@ public final class Instructions { |
| 141 | } | 140 | } |
| 142 | 141 | ||
| 143 | /** | 142 | /** |
| 144 | - * Strips the VLAN tag if one is present. | ||
| 145 | - * | ||
| 146 | - * @return a L2 modification | ||
| 147 | - */ | ||
| 148 | - public static L2ModificationInstruction stripVlanId() { | ||
| 149 | - return new StripVlanInstruction(); | ||
| 150 | - } | ||
| 151 | - | ||
| 152 | - /** | ||
| 153 | * Creates a MPLS label modification. | 143 | * Creates a MPLS label modification. |
| 154 | * | 144 | * |
| 155 | * @param mplsLabel MPLS label to set | 145 | * @param mplsLabel MPLS label to set | ... | ... |
| ... | @@ -53,11 +53,6 @@ public abstract class L2ModificationInstruction implements Instruction { | ... | @@ -53,11 +53,6 @@ public abstract class L2ModificationInstruction implements Instruction { |
| 53 | VLAN_PCP, | 53 | VLAN_PCP, |
| 54 | 54 | ||
| 55 | /** | 55 | /** |
| 56 | - * Strips the vlan. | ||
| 57 | - */ | ||
| 58 | - STRIP_VLAN, | ||
| 59 | - | ||
| 60 | - /** | ||
| 61 | * MPLS Label modification. | 56 | * MPLS Label modification. |
| 62 | */ | 57 | */ |
| 63 | MPLS_LABEL, | 58 | MPLS_LABEL, |
| ... | @@ -283,38 +278,6 @@ public abstract class L2ModificationInstruction implements Instruction { | ... | @@ -283,38 +278,6 @@ public abstract class L2ModificationInstruction implements Instruction { |
| 283 | } | 278 | } |
| 284 | } | 279 | } |
| 285 | 280 | ||
| 286 | - public static final class StripVlanInstruction extends L2ModificationInstruction { | ||
| 287 | - | ||
| 288 | - StripVlanInstruction() {} | ||
| 289 | - | ||
| 290 | - @Override | ||
| 291 | - public L2SubType subtype() { | ||
| 292 | - return L2SubType.STRIP_VLAN; | ||
| 293 | - } | ||
| 294 | - | ||
| 295 | - @Override | ||
| 296 | - public String toString() { | ||
| 297 | - return toStringHelper(subtype().toString()) | ||
| 298 | - .toString(); | ||
| 299 | - } | ||
| 300 | - | ||
| 301 | - @Override | ||
| 302 | - public int hashCode() { | ||
| 303 | - return Objects.hash(type(), subtype()); | ||
| 304 | - } | ||
| 305 | - | ||
| 306 | - @Override | ||
| 307 | - public boolean equals(Object obj) { | ||
| 308 | - if (this == obj) { | ||
| 309 | - return true; | ||
| 310 | - } | ||
| 311 | - if (obj instanceof StripVlanInstruction) { | ||
| 312 | - return true; | ||
| 313 | - } | ||
| 314 | - return false; | ||
| 315 | - } | ||
| 316 | - } | ||
| 317 | - | ||
| 318 | /** | 281 | /** |
| 319 | * Represents a VLAN POP modification instruction. | 282 | * Represents a VLAN POP modification instruction. |
| 320 | */ | 283 | */ | ... | ... |
| ... | @@ -83,10 +83,8 @@ public class FlowEntryBuilder { | ... | @@ -83,10 +83,8 @@ public class FlowEntryBuilder { |
| 83 | 83 | ||
| 84 | private final Match match; | 84 | private final Match match; |
| 85 | 85 | ||
| 86 | - /* | 86 | + // All actions are contained in an OFInstruction. For OF1.0 |
| 87 | - All actions are contained in an OFInstruction. For OF1.0 | 87 | + // the instruction type is apply instruction (immediate set in ONOS speak) |
| 88 | - the instruction type is apply instruction (immediate set in ONOS speak) | ||
| 89 | - */ | ||
| 90 | private final List<OFInstruction> instructions; | 88 | private final List<OFInstruction> instructions; |
| 91 | 89 | ||
| 92 | private final Dpid dpid; | 90 | private final Dpid dpid; |
| ... | @@ -308,15 +306,13 @@ public class FlowEntryBuilder { | ... | @@ -308,15 +306,13 @@ public class FlowEntryBuilder { |
| 308 | OFActionGroup group = (OFActionGroup) act; | 306 | OFActionGroup group = (OFActionGroup) act; |
| 309 | builder.group(new DefaultGroupId(group.getGroup().getGroupNumber())); | 307 | builder.group(new DefaultGroupId(group.getGroup().getGroupNumber())); |
| 310 | break; | 308 | break; |
| 309 | + case STRIP_VLAN: | ||
| 311 | case POP_VLAN: | 310 | case POP_VLAN: |
| 312 | builder.popVlan(); | 311 | builder.popVlan(); |
| 313 | break; | 312 | break; |
| 314 | case PUSH_VLAN: | 313 | case PUSH_VLAN: |
| 315 | builder.pushVlan(); | 314 | builder.pushVlan(); |
| 316 | break; | 315 | break; |
| 317 | - case STRIP_VLAN: | ||
| 318 | - builder.stripVlan(); | ||
| 319 | - break; | ||
| 320 | case SET_TP_DST: | 316 | case SET_TP_DST: |
| 321 | case SET_TP_SRC: | 317 | case SET_TP_SRC: |
| 322 | case POP_PBB: | 318 | case POP_PBB: | ... | ... |
providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer10.java
| ... | @@ -207,7 +207,7 @@ public class FlowModBuilderVer10 extends FlowModBuilder { | ... | @@ -207,7 +207,7 @@ public class FlowModBuilderVer10 extends FlowModBuilder { |
| 207 | case VLAN_PCP: | 207 | case VLAN_PCP: |
| 208 | ModVlanPcpInstruction vlanPcp = (ModVlanPcpInstruction) l2m; | 208 | ModVlanPcpInstruction vlanPcp = (ModVlanPcpInstruction) l2m; |
| 209 | return factory().actions().setVlanPcp(VlanPcp.of(vlanPcp.vlanPcp())); | 209 | return factory().actions().setVlanPcp(VlanPcp.of(vlanPcp.vlanPcp())); |
| 210 | - case STRIP_VLAN: | 210 | + case VLAN_POP: |
| 211 | return factory().actions().stripVlan(); | 211 | return factory().actions().stripVlan(); |
| 212 | default: | 212 | default: |
| 213 | log.warn("Unimplemented action type {}.", l2m.subtype()); | 213 | log.warn("Unimplemented action type {}.", l2m.subtype()); | ... | ... |
providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java
| ... | @@ -330,12 +330,10 @@ public class FlowModBuilderVer13 extends FlowModBuilder { | ... | @@ -330,12 +330,10 @@ public class FlowModBuilderVer13 extends FlowModBuilder { |
| 330 | return factory().actions().pushMpls(EthType.of(pushHeaderInstructions | 330 | return factory().actions().pushMpls(EthType.of(pushHeaderInstructions |
| 331 | .ethernetType())); | 331 | .ethernetType())); |
| 332 | case MPLS_POP: | 332 | case MPLS_POP: |
| 333 | - PushHeaderInstructions popHeaderInstructions = | 333 | + PushHeaderInstructions popHeaderInstructions = |
| 334 | (PushHeaderInstructions) l2m; | 334 | (PushHeaderInstructions) l2m; |
| 335 | return factory().actions().popMpls(EthType.of(popHeaderInstructions | 335 | return factory().actions().popMpls(EthType.of(popHeaderInstructions |
| 336 | .ethernetType())); | 336 | .ethernetType())); |
| 337 | - case STRIP_VLAN: | ||
| 338 | - return factory().actions().popVlan(); | ||
| 339 | case MPLS_LABEL: | 337 | case MPLS_LABEL: |
| 340 | ModMplsLabelInstruction mplsLabel = | 338 | ModMplsLabelInstruction mplsLabel = |
| 341 | (ModMplsLabelInstruction) l2m; | 339 | (ModMplsLabelInstruction) l2m; | ... | ... |
-
Please register or login to post a comment