commit | e264bef448024155b2eaac60792d22d7d436b97e | [log] [tgz] |
---|---|---|
author | chengfan <chengfannature@gmail.com> | Mon Sep 28 08:38:19 2015 +0800 |
committer | Gerrit Code Review <gerrit@onlab.us> | Mon Sep 28 20:47:23 2015 +0000 |
tree | b0dbd09c032d6a5d9ff408c1131482596d5094a1 | |
parent | 87e50d976e38e5e45c15f039fdc649f8c4907437 [diff] |
ONOS-3010 implement flow with meter Change-Id: Ib629b74441480c6902a492ed3ddd21adb452af87
diff --git a/core/api/src/main/java/org/onosproject/net/flow/DefaultTrafficTreatment.java b/core/api/src/main/java/org/onosproject/net/flow/DefaultTrafficTreatment.java index facb338..bf650c0 100644 --- a/core/api/src/main/java/org/onosproject/net/flow/DefaultTrafficTreatment.java +++ b/core/api/src/main/java/org/onosproject/net/flow/DefaultTrafficTreatment.java
@@ -250,6 +250,7 @@ break; case METER: meter = (Instructions.MeterInstruction) instruction; + break; default: throw new IllegalArgumentException("Unknown instruction type: " + instruction.type());
diff --git a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java index 8918d33..0a53a2d 100644 --- a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java +++ b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java
@@ -123,6 +123,9 @@ if (treatment.writeMetadata() != null) { instructions.add(buildMetadata(treatment.writeMetadata())); } + if (treatment.metered() != null) { + instructions.add(buildMeter(treatment.metered())); + } long cookie = flowRule().id().value();