Committed by
Gerrit Code Review
Use DELETE_STRICT when deleting flows to avoid collateral damage
Change-Id: Ibb35023b14296752073de44f1953013f0ca8a73a
Showing
2 changed files
with
10 additions
and
12 deletions
... | @@ -22,11 +22,11 @@ import org.onlab.packet.Ip6Prefix; | ... | @@ -22,11 +22,11 @@ import org.onlab.packet.Ip6Prefix; |
22 | import org.onlab.packet.VlanId; | 22 | import org.onlab.packet.VlanId; |
23 | import org.onosproject.net.DeviceId; | 23 | import org.onosproject.net.DeviceId; |
24 | import org.onosproject.net.OchSignal; | 24 | import org.onosproject.net.OchSignal; |
25 | +import org.onosproject.net.OduSignalId; | ||
25 | import org.onosproject.net.driver.DefaultDriverData; | 26 | import org.onosproject.net.driver.DefaultDriverData; |
26 | import org.onosproject.net.driver.DefaultDriverHandler; | 27 | import org.onosproject.net.driver.DefaultDriverHandler; |
27 | import org.onosproject.net.driver.Driver; | 28 | import org.onosproject.net.driver.Driver; |
28 | import org.onosproject.net.driver.DriverService; | 29 | import org.onosproject.net.driver.DriverService; |
29 | -import org.onosproject.net.OduSignalId; | ||
30 | import org.onosproject.net.flow.FlowRule; | 30 | import org.onosproject.net.flow.FlowRule; |
31 | import org.onosproject.net.flow.TrafficSelector; | 31 | import org.onosproject.net.flow.TrafficSelector; |
32 | import org.onosproject.net.flow.criteria.ArpHaCriterion; | 32 | import org.onosproject.net.flow.criteria.ArpHaCriterion; |
... | @@ -65,8 +65,6 @@ import org.onosproject.net.flow.criteria.VlanIdCriterion; | ... | @@ -65,8 +65,6 @@ import org.onosproject.net.flow.criteria.VlanIdCriterion; |
65 | import org.onosproject.net.flow.criteria.VlanPcpCriterion; | 65 | import org.onosproject.net.flow.criteria.VlanPcpCriterion; |
66 | import org.onosproject.openflow.controller.ExtensionSelectorInterpreter; | 66 | import org.onosproject.openflow.controller.ExtensionSelectorInterpreter; |
67 | import org.projectfloodlight.openflow.protocol.OFFactory; | 67 | import org.projectfloodlight.openflow.protocol.OFFactory; |
68 | -import org.projectfloodlight.openflow.protocol.OFFlowAdd; | ||
69 | -import org.projectfloodlight.openflow.protocol.OFFlowDelete; | ||
70 | import org.projectfloodlight.openflow.protocol.OFFlowMod; | 68 | import org.projectfloodlight.openflow.protocol.OFFlowMod; |
71 | import org.projectfloodlight.openflow.protocol.match.Match; | 69 | import org.projectfloodlight.openflow.protocol.match.Match; |
72 | import org.projectfloodlight.openflow.protocol.match.MatchField; | 70 | import org.projectfloodlight.openflow.protocol.match.MatchField; |
... | @@ -88,6 +86,7 @@ import org.projectfloodlight.openflow.types.OFBooleanValue; | ... | @@ -88,6 +86,7 @@ import org.projectfloodlight.openflow.types.OFBooleanValue; |
88 | import org.projectfloodlight.openflow.types.OFMetadata; | 86 | import org.projectfloodlight.openflow.types.OFMetadata; |
89 | import org.projectfloodlight.openflow.types.OFPort; | 87 | import org.projectfloodlight.openflow.types.OFPort; |
90 | import org.projectfloodlight.openflow.types.OFVlanVidMatch; | 88 | import org.projectfloodlight.openflow.types.OFVlanVidMatch; |
89 | +import org.projectfloodlight.openflow.types.OduSignalID; | ||
91 | import org.projectfloodlight.openflow.types.TransportPort; | 90 | import org.projectfloodlight.openflow.types.TransportPort; |
92 | import org.projectfloodlight.openflow.types.U16; | 91 | import org.projectfloodlight.openflow.types.U16; |
93 | import org.projectfloodlight.openflow.types.U32; | 92 | import org.projectfloodlight.openflow.types.U32; |
... | @@ -95,7 +94,6 @@ import org.projectfloodlight.openflow.types.U64; | ... | @@ -95,7 +94,6 @@ import org.projectfloodlight.openflow.types.U64; |
95 | import org.projectfloodlight.openflow.types.U8; | 94 | import org.projectfloodlight.openflow.types.U8; |
96 | import org.projectfloodlight.openflow.types.VlanPcp; | 95 | import org.projectfloodlight.openflow.types.VlanPcp; |
97 | import org.projectfloodlight.openflow.types.VlanVid; | 96 | import org.projectfloodlight.openflow.types.VlanVid; |
98 | -import org.projectfloodlight.openflow.types.OduSignalID; | ||
99 | import org.slf4j.Logger; | 97 | import org.slf4j.Logger; |
100 | 98 | ||
101 | import java.util.Optional; | 99 | import java.util.Optional; |
... | @@ -163,7 +161,7 @@ public abstract class FlowModBuilder { | ... | @@ -163,7 +161,7 @@ public abstract class FlowModBuilder { |
163 | * | 161 | * |
164 | * @return the flow mod | 162 | * @return the flow mod |
165 | */ | 163 | */ |
166 | - public abstract OFFlowAdd buildFlowAdd(); | 164 | + public abstract OFFlowMod buildFlowAdd(); |
167 | 165 | ||
168 | /** | 166 | /** |
169 | * Builds a MODIFY flow mod. | 167 | * Builds a MODIFY flow mod. |
... | @@ -177,7 +175,7 @@ public abstract class FlowModBuilder { | ... | @@ -177,7 +175,7 @@ public abstract class FlowModBuilder { |
177 | * | 175 | * |
178 | * @return the flow mod | 176 | * @return the flow mod |
179 | */ | 177 | */ |
180 | - public abstract OFFlowDelete buildFlowDel(); | 178 | + public abstract OFFlowMod buildFlowDel(); |
181 | 179 | ||
182 | /** | 180 | /** |
183 | * Builds the match for the flow mod. | 181 | * Builds the match for the flow mod. | ... | ... |
providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java
... | @@ -47,17 +47,17 @@ import org.onosproject.net.flow.instructions.L2ModificationInstruction.ModVlanId | ... | @@ -47,17 +47,17 @@ import org.onosproject.net.flow.instructions.L2ModificationInstruction.ModVlanId |
47 | import org.onosproject.net.flow.instructions.L2ModificationInstruction.ModVlanPcpInstruction; | 47 | import org.onosproject.net.flow.instructions.L2ModificationInstruction.ModVlanPcpInstruction; |
48 | import org.onosproject.net.flow.instructions.L2ModificationInstruction.PushHeaderInstructions; | 48 | import org.onosproject.net.flow.instructions.L2ModificationInstruction.PushHeaderInstructions; |
49 | import org.onosproject.net.flow.instructions.L3ModificationInstruction; | 49 | import org.onosproject.net.flow.instructions.L3ModificationInstruction; |
50 | -import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModIPInstruction; | ||
51 | -import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModArpIPInstruction; | ||
52 | import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModArpEthInstruction; | 50 | import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModArpEthInstruction; |
51 | +import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModArpIPInstruction; | ||
53 | import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModArpOpInstruction; | 52 | import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModArpOpInstruction; |
53 | +import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModIPInstruction; | ||
54 | import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModIPv6FlowLabelInstruction; | 54 | import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModIPv6FlowLabelInstruction; |
55 | import org.onosproject.net.flow.instructions.L4ModificationInstruction; | 55 | import org.onosproject.net.flow.instructions.L4ModificationInstruction; |
56 | import org.onosproject.net.flow.instructions.L4ModificationInstruction.ModTransportPortInstruction; | 56 | import org.onosproject.net.flow.instructions.L4ModificationInstruction.ModTransportPortInstruction; |
57 | import org.onosproject.openflow.controller.ExtensionTreatmentInterpreter; | 57 | import org.onosproject.openflow.controller.ExtensionTreatmentInterpreter; |
58 | import org.projectfloodlight.openflow.protocol.OFFactory; | 58 | import org.projectfloodlight.openflow.protocol.OFFactory; |
59 | import org.projectfloodlight.openflow.protocol.OFFlowAdd; | 59 | import org.projectfloodlight.openflow.protocol.OFFlowAdd; |
60 | -import org.projectfloodlight.openflow.protocol.OFFlowDelete; | 60 | +import org.projectfloodlight.openflow.protocol.OFFlowDeleteStrict; |
61 | import org.projectfloodlight.openflow.protocol.OFFlowMod; | 61 | import org.projectfloodlight.openflow.protocol.OFFlowMod; |
62 | import org.projectfloodlight.openflow.protocol.OFFlowModFlags; | 62 | import org.projectfloodlight.openflow.protocol.OFFlowModFlags; |
63 | import org.projectfloodlight.openflow.protocol.action.OFAction; | 63 | import org.projectfloodlight.openflow.protocol.action.OFAction; |
... | @@ -119,7 +119,7 @@ public class FlowModBuilderVer13 extends FlowModBuilder { | ... | @@ -119,7 +119,7 @@ public class FlowModBuilderVer13 extends FlowModBuilder { |
119 | } | 119 | } |
120 | 120 | ||
121 | @Override | 121 | @Override |
122 | - public OFFlowAdd buildFlowAdd() { | 122 | + public OFFlowMod buildFlowAdd() { |
123 | Match match = buildMatch(); | 123 | Match match = buildMatch(); |
124 | List<OFAction> deferredActions = buildActions(treatment.deferred()); | 124 | List<OFAction> deferredActions = buildActions(treatment.deferred()); |
125 | List<OFAction> immediateActions = buildActions(treatment.immediate()); | 125 | List<OFAction> immediateActions = buildActions(treatment.immediate()); |
... | @@ -205,12 +205,12 @@ public class FlowModBuilderVer13 extends FlowModBuilder { | ... | @@ -205,12 +205,12 @@ public class FlowModBuilderVer13 extends FlowModBuilder { |
205 | } | 205 | } |
206 | 206 | ||
207 | @Override | 207 | @Override |
208 | - public OFFlowDelete buildFlowDel() { | 208 | + public OFFlowMod buildFlowDel() { |
209 | Match match = buildMatch(); | 209 | Match match = buildMatch(); |
210 | 210 | ||
211 | long cookie = flowRule().id().value(); | 211 | long cookie = flowRule().id().value(); |
212 | 212 | ||
213 | - OFFlowDelete fm = factory().buildFlowDelete() | 213 | + OFFlowDeleteStrict fm = factory().buildFlowDeleteStrict() |
214 | .setXid(xid) | 214 | .setXid(xid) |
215 | .setCookie(U64.of(cookie)) | 215 | .setCookie(U64.of(cookie)) |
216 | .setBufferId(OFBufferId.NO_BUFFER) | 216 | .setBufferId(OFBufferId.NO_BUFFER) | ... | ... |
-
Please register or login to post a comment