Committed by
Gerrit Code Review
[ONOS-3474] Add the implementation of method
programL3InPortClassifierRules which assemble the L3 Classifier table rules sended from internal port. Change-Id: I16a3eb9007351183b8f7786f2b74142c0b1883a3
Showing
1 changed file
with
20 additions
and
7 deletions
| ... | @@ -144,13 +144,26 @@ public class ClassifierServiceImpl implements ClassifierService { | ... | @@ -144,13 +144,26 @@ public class ClassifierServiceImpl implements ClassifierService { |
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | @Override | 146 | @Override |
| 147 | - public void programL3InPortClassifierRules(DeviceId deviceId, | 147 | + public void programL3InPortClassifierRules(DeviceId deviceId, PortNumber inPort, |
| 148 | - PortNumber inPort, | 148 | + MacAddress srcMac, MacAddress dstMac, |
| 149 | - MacAddress srcMac, | 149 | + SegmentationId actionVni, |
| 150 | - MacAddress dstVmGwMac, | 150 | + Objective.Operation type) { |
| 151 | - SegmentationId l3Vni, | 151 | + TrafficSelector selector = DefaultTrafficSelector.builder() |
| 152 | - Operation type) { | 152 | + .matchInPort(inPort).matchEthSrc(srcMac).matchEthDst(dstMac) |
| 153 | - // TODO Auto-generated method stub | 153 | + .build(); |
| 154 | + TrafficTreatment treatment = DefaultTrafficTreatment.builder() | ||
| 155 | + .setTunnelId(Long.parseLong(actionVni.segmentationId())).build(); | ||
| 156 | + ForwardingObjective.Builder objective = DefaultForwardingObjective | ||
| 157 | + .builder().withTreatment(treatment).withSelector(selector) | ||
| 158 | + .fromApp(appId).withFlag(Flag.SPECIFIC) | ||
| 159 | + .withPriority(L3_CLAFFIFIER_PRIORITY); | ||
| 160 | + if (type.equals(Objective.Operation.ADD)) { | ||
| 161 | + log.debug("L3InternalClassifierRules-->ADD"); | ||
| 162 | + flowObjectiveService.forward(deviceId, objective.add()); | ||
| 163 | + } else { | ||
| 164 | + log.debug("L3InternalClassifierRules-->REMOVE"); | ||
| 165 | + flowObjectiveService.forward(deviceId, objective.remove()); | ||
| 166 | + } | ||
| 154 | } | 167 | } |
| 155 | 168 | ||
| 156 | @Override | 169 | @Override | ... | ... |
-
Please register or login to post a comment