chengfan
Committed by Gerrit Code Review

ONOS-3010 implement flow with meter

Change-Id: Ib629b74441480c6902a492ed3ddd21adb452af87
...@@ -250,6 +250,7 @@ public final class DefaultTrafficTreatment implements TrafficTreatment { ...@@ -250,6 +250,7 @@ public final class DefaultTrafficTreatment implements TrafficTreatment {
250 break; 250 break;
251 case METER: 251 case METER:
252 meter = (Instructions.MeterInstruction) instruction; 252 meter = (Instructions.MeterInstruction) instruction;
253 + break;
253 default: 254 default:
254 throw new IllegalArgumentException("Unknown instruction type: " + 255 throw new IllegalArgumentException("Unknown instruction type: " +
255 instruction.type()); 256 instruction.type());
......
...@@ -123,6 +123,9 @@ public class FlowModBuilderVer13 extends FlowModBuilder { ...@@ -123,6 +123,9 @@ public class FlowModBuilderVer13 extends FlowModBuilder {
123 if (treatment.writeMetadata() != null) { 123 if (treatment.writeMetadata() != null) {
124 instructions.add(buildMetadata(treatment.writeMetadata())); 124 instructions.add(buildMetadata(treatment.writeMetadata()));
125 } 125 }
126 + if (treatment.metered() != null) {
127 + instructions.add(buildMeter(treatment.metered()));
128 + }
126 129
127 long cookie = flowRule().id().value(); 130 long cookie = flowRule().id().value();
128 131
......