Implement some of the missing IPv6 flowmod treatments
Work toward ONOS-509
The following treatments are added/implemented:
- IPV6_SRC
- IPV6_DST
- IPV6_FLABEL
Also:
- Renamed L3ModificationInstruction.L3SubType.IP_SRC and IP_DST
to IPV4_SRC and IPV4_DST (for naming consistency).
- Few minor fixes in related code: Javadocs, comments, log messages,
and IP address usage.
Change-Id: I551056f767a37e7cb6ae7d79f4a3929183500b57
diff --git a/web/api/src/main/java/org/onosproject/codec/impl/InstructionCodec.java b/web/api/src/main/java/org/onosproject/codec/impl/InstructionCodec.java
index 913fc8b..3957beb 100644
--- a/web/api/src/main/java/org/onosproject/codec/impl/InstructionCodec.java
+++ b/web/api/src/main/java/org/onosproject/codec/impl/InstructionCodec.java
@@ -117,13 +117,22 @@
private void encodeL3(ObjectNode result, L3ModificationInstruction instruction) {
result.put("subtype", instruction.subtype().name());
switch (instruction.subtype()) {
- case IP_SRC:
- case IP_DST:
+ case IPV4_SRC:
+ case IPV4_DST:
+ case IPV6_SRC:
+ case IPV6_DST:
final L3ModificationInstruction.ModIPInstruction modIPInstruction =
(L3ModificationInstruction.ModIPInstruction) instruction;
result.put("ip", modIPInstruction.ip().toString());
break;
+ case IPV6_FLABEL:
+ final L3ModificationInstruction.ModIPv6FlowLabelInstruction
+ modFlowLabelInstruction =
+ (L3ModificationInstruction.ModIPv6FlowLabelInstruction) instruction;
+ result.put("flowLabel", modFlowLabelInstruction.flowLabel());
+ break;
+
default:
log.info("Cannot convert L3 subtype of {}", instruction.subtype());
break;