alshabib
Committed by Gerrit Code Review

decoupling extension types from of protocol

numbers renaming extension instruction to
extension treatment

Change-Id: Ie949d6235c2a5a984f7c7867262f8336721f1ee7
Showing 17 changed files with 95 additions and 92 deletions
...@@ -18,14 +18,14 @@ package org.onosproject.net.behaviour; ...@@ -18,14 +18,14 @@ package org.onosproject.net.behaviour;
18 18
19 import com.google.common.annotations.Beta; 19 import com.google.common.annotations.Beta;
20 import org.onosproject.net.driver.HandlerBehaviour; 20 import org.onosproject.net.driver.HandlerBehaviour;
21 -import org.onosproject.net.flow.instructions.ExtensionInstruction; 21 +import org.onosproject.net.flow.instructions.ExtensionTreatment;
22 -import org.onosproject.net.flow.instructions.ExtensionType; 22 +import org.onosproject.net.flow.instructions.ExtensionTreatmentType;
23 23
24 /** 24 /**
25 * Provides access to the extension implemented by this driver. 25 * Provides access to the extension implemented by this driver.
26 */ 26 */
27 @Beta 27 @Beta
28 -public interface ExtensionResolver extends HandlerBehaviour { 28 +public interface ExtensionTreatmentResolver extends HandlerBehaviour {
29 29
30 /** 30 /**
31 * Gets an extension instruction instance of the specified type, if supported 31 * Gets an extension instruction instance of the specified type, if supported
...@@ -36,5 +36,5 @@ public interface ExtensionResolver extends HandlerBehaviour { ...@@ -36,5 +36,5 @@ public interface ExtensionResolver extends HandlerBehaviour {
36 * @throws UnsupportedOperationException if the extension type is not 36 * @throws UnsupportedOperationException if the extension type is not
37 * supported by this driver 37 * supported by this driver
38 */ 38 */
39 - ExtensionInstruction getExtensionInstruction(ExtensionType type); 39 + ExtensionTreatment getExtensionInstruction(ExtensionTreatmentType type);
40 } 40 }
......
...@@ -30,7 +30,7 @@ import org.onosproject.core.GroupId; ...@@ -30,7 +30,7 @@ import org.onosproject.core.GroupId;
30 import org.onosproject.net.DeviceId; 30 import org.onosproject.net.DeviceId;
31 import org.onosproject.net.IndexedLambda; 31 import org.onosproject.net.IndexedLambda;
32 import org.onosproject.net.PortNumber; 32 import org.onosproject.net.PortNumber;
33 -import org.onosproject.net.flow.instructions.ExtensionInstruction; 33 +import org.onosproject.net.flow.instructions.ExtensionTreatment;
34 import org.onosproject.net.flow.instructions.Instruction; 34 import org.onosproject.net.flow.instructions.Instruction;
35 import org.onosproject.net.flow.instructions.Instructions; 35 import org.onosproject.net.flow.instructions.Instructions;
36 import org.onosproject.net.meter.MeterId; 36 import org.onosproject.net.meter.MeterId;
...@@ -489,7 +489,7 @@ public final class DefaultTrafficTreatment implements TrafficTreatment { ...@@ -489,7 +489,7 @@ public final class DefaultTrafficTreatment implements TrafficTreatment {
489 } 489 }
490 490
491 @Override 491 @Override
492 - public TrafficTreatment.Builder extension(ExtensionInstruction extension, 492 + public TrafficTreatment.Builder extension(ExtensionTreatment extension,
493 DeviceId deviceId) { 493 DeviceId deviceId) {
494 return add(Instructions.extension(extension, deviceId)); 494 return add(Instructions.extension(extension, deviceId));
495 } 495 }
......
...@@ -26,7 +26,7 @@ import org.onlab.packet.VlanId; ...@@ -26,7 +26,7 @@ import org.onlab.packet.VlanId;
26 import org.onosproject.core.GroupId; 26 import org.onosproject.core.GroupId;
27 import org.onosproject.net.DeviceId; 27 import org.onosproject.net.DeviceId;
28 import org.onosproject.net.PortNumber; 28 import org.onosproject.net.PortNumber;
29 -import org.onosproject.net.flow.instructions.ExtensionInstruction; 29 +import org.onosproject.net.flow.instructions.ExtensionTreatment;
30 import org.onosproject.net.flow.instructions.Instruction; 30 import org.onosproject.net.flow.instructions.Instruction;
31 import org.onosproject.net.flow.instructions.Instructions; 31 import org.onosproject.net.flow.instructions.Instructions;
32 import org.onosproject.net.meter.MeterId; 32 import org.onosproject.net.meter.MeterId;
...@@ -430,7 +430,7 @@ public interface TrafficTreatment { ...@@ -430,7 +430,7 @@ public interface TrafficTreatment {
430 * @param deviceId device ID 430 * @param deviceId device ID
431 * @return a treatment builder 431 * @return a treatment builder
432 */ 432 */
433 - Builder extension(ExtensionInstruction extension, DeviceId deviceId); 433 + Builder extension(ExtensionTreatment extension, DeviceId deviceId);
434 434
435 /** 435 /**
436 * Builds an immutable traffic treatment descriptor. 436 * Builds an immutable traffic treatment descriptor.
......
...@@ -23,7 +23,7 @@ import java.util.List; ...@@ -23,7 +23,7 @@ import java.util.List;
23 /** 23 /**
24 * Abstract implementation of the set/get property methods of ExtensionInstruction. 24 * Abstract implementation of the set/get property methods of ExtensionInstruction.
25 */ 25 */
26 -public abstract class AbstractExtensionInstruction implements ExtensionInstruction { 26 +public abstract class AbstractExtensionTreatment implements ExtensionTreatment {
27 27
28 private static final String INVALID_KEY = "Invalid property key: "; 28 private static final String INVALID_KEY = "Invalid property key: ";
29 private static final String INVALID_TYPE = "Given type does not match field type: "; 29 private static final String INVALID_TYPE = "Given type does not match field type: ";
......
...@@ -21,14 +21,14 @@ import java.util.List; ...@@ -21,14 +21,14 @@ import java.util.List;
21 /** 21 /**
22 * An extensible instruction type. 22 * An extensible instruction type.
23 */ 23 */
24 -public interface ExtensionInstruction { 24 +public interface ExtensionTreatment {
25 25
26 /** 26 /**
27 * Gets the type of the extension instruction. 27 * Gets the type of the extension instruction.
28 * 28 *
29 * @return type 29 * @return type
30 */ 30 */
31 - ExtensionType type(); 31 + ExtensionTreatmentType type();
32 32
33 /** 33 /**
34 * Sets a property on the extension instruction. 34 * Sets a property on the extension instruction.
......
...@@ -25,25 +25,26 @@ import java.util.Objects; ...@@ -25,25 +25,26 @@ import java.util.Objects;
25 * Type of extension instructions. 25 * Type of extension instructions.
26 */ 26 */
27 @Beta 27 @Beta
28 -public final class ExtensionType { 28 +public final class ExtensionTreatmentType {
29 29
30 /** 30 /**
31 * A list of well-known named extension instruction type codes. 31 * A list of well-known named extension instruction type codes.
32 + * These numbers have no impact on the actual OF type id.
32 */ 33 */
33 - public enum ExtensionTypes { 34 + public enum ExtensionTreatmentTypes {
34 // TODO fix type numbers to include experimenter id 35 // TODO fix type numbers to include experimenter id
35 - NICIRA_SET_TUNNEL_DST(31), 36 + NICIRA_SET_TUNNEL_DST(0),
36 - NICIRA_RESUBMIT(32); 37 + NICIRA_RESUBMIT(1);
37 38
38 - private ExtensionType type; 39 + private ExtensionTreatmentType type;
39 40
40 /** 41 /**
41 * Creates a new named extension instruction type. 42 * Creates a new named extension instruction type.
42 * 43 *
43 * @param type type code 44 * @param type type code
44 */ 45 */
45 - ExtensionTypes(int type) { 46 + ExtensionTreatmentTypes(int type) {
46 - this.type = new ExtensionType(type); 47 + this.type = new ExtensionTreatmentType(type);
47 } 48 }
48 49
49 /** 50 /**
...@@ -51,7 +52,7 @@ public final class ExtensionType { ...@@ -51,7 +52,7 @@ public final class ExtensionType {
51 * 52 *
52 * @return extension type object 53 * @return extension type object
53 */ 54 */
54 - public ExtensionType type() { 55 + public ExtensionTreatmentType type() {
55 return type; 56 return type;
56 } 57 }
57 } 58 }
...@@ -63,7 +64,7 @@ public final class ExtensionType { ...@@ -63,7 +64,7 @@ public final class ExtensionType {
63 * 64 *
64 * @param type type code 65 * @param type type code
65 */ 66 */
66 - public ExtensionType(int type) { 67 + public ExtensionTreatmentType(int type) {
67 this.type = type; 68 this.type = type;
68 } 69 }
69 70
...@@ -77,8 +78,8 @@ public final class ExtensionType { ...@@ -77,8 +78,8 @@ public final class ExtensionType {
77 if (this == obj) { 78 if (this == obj) {
78 return true; 79 return true;
79 } 80 }
80 - if (obj instanceof ExtensionType) { 81 + if (obj instanceof ExtensionTreatmentType) {
81 - final ExtensionType that = (ExtensionType) obj; 82 + final ExtensionTreatmentType that = (ExtensionTreatmentType) obj;
82 return this.type == that.type; 83 return this.type == that.type;
83 } 84 }
84 return false; 85 return false;
...@@ -86,7 +87,7 @@ public final class ExtensionType { ...@@ -86,7 +87,7 @@ public final class ExtensionType {
86 87
87 @Override 88 @Override
88 public String toString() { 89 public String toString() {
89 - return MoreObjects.toStringHelper(ExtensionType.class) 90 + return MoreObjects.toStringHelper(ExtensionTreatmentType.class)
90 .add("type", type) 91 .add("type", type)
91 .toString(); 92 .toString();
92 } 93 }
......
...@@ -489,7 +489,7 @@ public final class Instructions { ...@@ -489,7 +489,7 @@ public final class Instructions {
489 * @param deviceId device ID 489 * @param deviceId device ID
490 * @return extension instruction 490 * @return extension instruction
491 */ 491 */
492 - public static ExtensionInstructionWrapper extension(ExtensionInstruction extension, 492 + public static ExtensionInstructionWrapper extension(ExtensionTreatment extension,
493 DeviceId deviceId) { 493 DeviceId deviceId) {
494 checkNotNull(extension, "Extension instruction cannot be null"); 494 checkNotNull(extension, "Extension instruction cannot be null");
495 checkNotNull(deviceId, "Device ID cannot be null"); 495 checkNotNull(deviceId, "Device ID cannot be null");
...@@ -858,16 +858,16 @@ public final class Instructions { ...@@ -858,16 +858,16 @@ public final class Instructions {
858 * Extension instruction. 858 * Extension instruction.
859 */ 859 */
860 public static class ExtensionInstructionWrapper implements Instruction { 860 public static class ExtensionInstructionWrapper implements Instruction {
861 - private final ExtensionInstruction extensionInstruction; 861 + private final ExtensionTreatment extensionTreatment;
862 private final DeviceId deviceId; 862 private final DeviceId deviceId;
863 863
864 - ExtensionInstructionWrapper(ExtensionInstruction extension, DeviceId deviceId) { 864 + ExtensionInstructionWrapper(ExtensionTreatment extension, DeviceId deviceId) {
865 - extensionInstruction = extension; 865 + extensionTreatment = extension;
866 this.deviceId = deviceId; 866 this.deviceId = deviceId;
867 } 867 }
868 868
869 - public ExtensionInstruction extensionInstruction() { 869 + public ExtensionTreatment extensionInstruction() {
870 - return extensionInstruction; 870 + return extensionTreatment;
871 } 871 }
872 872
873 public DeviceId deviceId() { 873 public DeviceId deviceId() {
...@@ -882,14 +882,14 @@ public final class Instructions { ...@@ -882,14 +882,14 @@ public final class Instructions {
882 @Override 882 @Override
883 public String toString() { 883 public String toString() {
884 return toStringHelper(type().toString()) 884 return toStringHelper(type().toString())
885 - .add("extension", extensionInstruction) 885 + .add("extension", extensionTreatment)
886 .add("deviceId", deviceId) 886 .add("deviceId", deviceId)
887 .toString(); 887 .toString();
888 } 888 }
889 889
890 @Override 890 @Override
891 public int hashCode() { 891 public int hashCode() {
892 - return Objects.hash(type().ordinal(), extensionInstruction, deviceId); 892 + return Objects.hash(type().ordinal(), extensionTreatment, deviceId);
893 } 893 }
894 894
895 @Override 895 @Override
...@@ -899,7 +899,7 @@ public final class Instructions { ...@@ -899,7 +899,7 @@ public final class Instructions {
899 } 899 }
900 if (obj instanceof ExtensionInstructionWrapper) { 900 if (obj instanceof ExtensionInstructionWrapper) {
901 ExtensionInstructionWrapper that = (ExtensionInstructionWrapper) obj; 901 ExtensionInstructionWrapper that = (ExtensionInstructionWrapper) obj;
902 - return Objects.equals(extensionInstruction, that.extensionInstruction) 902 + return Objects.equals(extensionTreatment, that.extensionTreatment)
903 && Objects.equals(deviceId, that.deviceId); 903 && Objects.equals(deviceId, that.deviceId);
904 904
905 } 905 }
......
...@@ -22,13 +22,13 @@ import com.esotericsoftware.kryo.io.Input; ...@@ -22,13 +22,13 @@ import com.esotericsoftware.kryo.io.Input;
22 import com.esotericsoftware.kryo.io.Output; 22 import com.esotericsoftware.kryo.io.Output;
23 import org.onlab.osgi.DefaultServiceDirectory; 23 import org.onlab.osgi.DefaultServiceDirectory;
24 import org.onosproject.net.DeviceId; 24 import org.onosproject.net.DeviceId;
25 -import org.onosproject.net.behaviour.ExtensionResolver; 25 +import org.onosproject.net.behaviour.ExtensionTreatmentResolver;
26 import org.onosproject.net.driver.DefaultDriverData; 26 import org.onosproject.net.driver.DefaultDriverData;
27 import org.onosproject.net.driver.DefaultDriverHandler; 27 import org.onosproject.net.driver.DefaultDriverHandler;
28 import org.onosproject.net.driver.DriverHandler; 28 import org.onosproject.net.driver.DriverHandler;
29 import org.onosproject.net.driver.DriverService; 29 import org.onosproject.net.driver.DriverService;
30 -import org.onosproject.net.flow.instructions.ExtensionInstruction; 30 +import org.onosproject.net.flow.instructions.ExtensionTreatment;
31 -import org.onosproject.net.flow.instructions.ExtensionType; 31 +import org.onosproject.net.flow.instructions.ExtensionTreatmentType;
32 import org.onosproject.net.flow.instructions.Instructions; 32 import org.onosproject.net.flow.instructions.Instructions;
33 33
34 /** 34 /**
...@@ -53,16 +53,16 @@ public class ExtensionInstructionSerializer extends ...@@ -53,16 +53,16 @@ public class ExtensionInstructionSerializer extends
53 @Override 53 @Override
54 public Instructions.ExtensionInstructionWrapper read(Kryo kryo, Input input, 54 public Instructions.ExtensionInstructionWrapper read(Kryo kryo, Input input,
55 Class<Instructions.ExtensionInstructionWrapper> type) { 55 Class<Instructions.ExtensionInstructionWrapper> type) {
56 - ExtensionType exType = (ExtensionType) kryo.readClassAndObject(input); 56 + ExtensionTreatmentType exType = (ExtensionTreatmentType) kryo.readClassAndObject(input);
57 DeviceId deviceId = (DeviceId) kryo.readClassAndObject(input); 57 DeviceId deviceId = (DeviceId) kryo.readClassAndObject(input);
58 58
59 DriverService driverService = DefaultServiceDirectory.getService(DriverService.class); 59 DriverService driverService = DefaultServiceDirectory.getService(DriverService.class);
60 DriverHandler handler = new DefaultDriverHandler( 60 DriverHandler handler = new DefaultDriverHandler(
61 new DefaultDriverData(driverService.getDriver(deviceId), deviceId)); 61 new DefaultDriverData(driverService.getDriver(deviceId), deviceId));
62 62
63 - ExtensionResolver resolver = handler.behaviour(ExtensionResolver.class); 63 + ExtensionTreatmentResolver resolver = handler.behaviour(ExtensionTreatmentResolver.class);
64 64
65 - ExtensionInstruction instruction = resolver.getExtensionInstruction(exType); 65 + ExtensionTreatment instruction = resolver.getExtensionInstruction(exType);
66 66
67 byte[] bytes = (byte[]) kryo.readClassAndObject(input); 67 byte[] bytes = (byte[]) kryo.readClassAndObject(input);
68 68
......
...@@ -129,7 +129,7 @@ import org.onosproject.net.flow.criteria.TunnelIdCriterion; ...@@ -129,7 +129,7 @@ import org.onosproject.net.flow.criteria.TunnelIdCriterion;
129 import org.onosproject.net.flow.criteria.UdpPortCriterion; 129 import org.onosproject.net.flow.criteria.UdpPortCriterion;
130 import org.onosproject.net.flow.criteria.VlanIdCriterion; 130 import org.onosproject.net.flow.criteria.VlanIdCriterion;
131 import org.onosproject.net.flow.criteria.VlanPcpCriterion; 131 import org.onosproject.net.flow.criteria.VlanPcpCriterion;
132 -import org.onosproject.net.flow.instructions.ExtensionType; 132 +import org.onosproject.net.flow.instructions.ExtensionTreatmentType;
133 import org.onosproject.net.flow.instructions.Instructions; 133 import org.onosproject.net.flow.instructions.Instructions;
134 import org.onosproject.net.flow.instructions.L0ModificationInstruction; 134 import org.onosproject.net.flow.instructions.L0ModificationInstruction;
135 import org.onosproject.net.flow.instructions.L1ModificationInstruction; 135 import org.onosproject.net.flow.instructions.L1ModificationInstruction;
...@@ -455,7 +455,7 @@ public final class KryoNamespaces { ...@@ -455,7 +455,7 @@ public final class KryoNamespaces {
455 .register(new DefaultOutboundPacketSerializer(), DefaultOutboundPacket.class) 455 .register(new DefaultOutboundPacketSerializer(), DefaultOutboundPacket.class)
456 .register(new AnnotationsSerializer(), DefaultAnnotations.class) 456 .register(new AnnotationsSerializer(), DefaultAnnotations.class)
457 .register(new ExtensionInstructionSerializer(), Instructions.ExtensionInstructionWrapper.class) 457 .register(new ExtensionInstructionSerializer(), Instructions.ExtensionInstructionWrapper.class)
458 - .register(ExtensionType.class) 458 + .register(ExtensionTreatmentType.class)
459 .register(Versioned.class) 459 .register(Versioned.class)
460 .register(MapEvent.class) 460 .register(MapEvent.class)
461 .register(MapEvent.Type.class) 461 .register(MapEvent.Type.class)
......
...@@ -17,11 +17,11 @@ ...@@ -17,11 +17,11 @@
17 package org.onosproject.driver.extensions; 17 package org.onosproject.driver.extensions;
18 18
19 import org.onlab.packet.Ip4Address; 19 import org.onlab.packet.Ip4Address;
20 -import org.onosproject.net.behaviour.ExtensionResolver; 20 +import org.onosproject.net.behaviour.ExtensionTreatmentResolver;
21 import org.onosproject.net.driver.AbstractHandlerBehaviour; 21 import org.onosproject.net.driver.AbstractHandlerBehaviour;
22 -import org.onosproject.net.flow.instructions.ExtensionInstruction; 22 +import org.onosproject.net.flow.instructions.ExtensionTreatment;
23 -import org.onosproject.net.flow.instructions.ExtensionType; 23 +import org.onosproject.net.flow.instructions.ExtensionTreatmentType;
24 -import org.onosproject.openflow.controller.ExtensionInterpreter; 24 +import org.onosproject.openflow.controller.ExtensionTreatmentInterpreter;
25 import org.projectfloodlight.openflow.protocol.OFActionType; 25 import org.projectfloodlight.openflow.protocol.OFActionType;
26 import org.projectfloodlight.openflow.protocol.OFFactory; 26 import org.projectfloodlight.openflow.protocol.OFFactory;
27 import org.projectfloodlight.openflow.protocol.action.OFAction; 27 import org.projectfloodlight.openflow.protocol.action.OFAction;
...@@ -33,36 +33,38 @@ import org.projectfloodlight.openflow.types.IPv4Address; ...@@ -33,36 +33,38 @@ import org.projectfloodlight.openflow.types.IPv4Address;
33 /** 33 /**
34 * Interpreter for Nicira OpenFlow extensions. 34 * Interpreter for Nicira OpenFlow extensions.
35 */ 35 */
36 -public class NiciraExtensionInterpreter extends AbstractHandlerBehaviour 36 +public class NiciraExtensionTreatmentInterpreter extends AbstractHandlerBehaviour
37 - implements ExtensionInterpreter, ExtensionResolver { 37 + implements ExtensionTreatmentInterpreter, ExtensionTreatmentResolver {
38 38
39 @Override 39 @Override
40 - public boolean supported(ExtensionType extensionType) { 40 + public boolean supported(ExtensionTreatmentType extensionTreatmentType) {
41 - if (extensionType.equals(ExtensionType.ExtensionTypes.NICIRA_SET_TUNNEL_DST.type())) { 41 + if (extensionTreatmentType.equals(
42 + ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_TUNNEL_DST.type())) {
42 return true; 43 return true;
43 } 44 }
44 - if (extensionType.equals(ExtensionType.ExtensionTypes.NICIRA_RESUBMIT.type())) { 45 + if (extensionTreatmentType.equals(
46 + ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_RESUBMIT.type())) {
45 return true; 47 return true;
46 } 48 }
47 return false; 49 return false;
48 } 50 }
49 51
50 @Override 52 @Override
51 - public OFAction mapInstruction(OFFactory factory, ExtensionInstruction extensionInstruction) { 53 + public OFAction mapInstruction(OFFactory factory, ExtensionTreatment extensionTreatment) {
52 - ExtensionType type = extensionInstruction.type(); 54 + ExtensionTreatmentType type = extensionTreatment.type();
53 - if (type.equals(ExtensionType.ExtensionTypes.NICIRA_SET_TUNNEL_DST.type())) { 55 + if (type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_TUNNEL_DST.type())) {
54 - NiciraSetTunnelDst tunnelDst = (NiciraSetTunnelDst) extensionInstruction; 56 + NiciraSetTunnelDst tunnelDst = (NiciraSetTunnelDst) extensionTreatment;
55 return factory.actions().setField(factory.oxms().tunnelIpv4Dst( 57 return factory.actions().setField(factory.oxms().tunnelIpv4Dst(
56 IPv4Address.of(tunnelDst.tunnelDst().toInt()))); 58 IPv4Address.of(tunnelDst.tunnelDst().toInt())));
57 } 59 }
58 - if (type.equals(ExtensionType.ExtensionTypes.NICIRA_RESUBMIT.type())) { 60 + if (type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_RESUBMIT.type())) {
59 // TODO this will be implemented later 61 // TODO this will be implemented later
60 } 62 }
61 return null; 63 return null;
62 } 64 }
63 65
64 @Override 66 @Override
65 - public ExtensionInstruction mapAction(OFAction action) { 67 + public ExtensionTreatment mapAction(OFAction action) {
66 if (action.getType().equals(OFActionType.SET_FIELD)) { 68 if (action.getType().equals(OFActionType.SET_FIELD)) {
67 OFActionSetField setFieldAction = (OFActionSetField) action; 69 OFActionSetField setFieldAction = (OFActionSetField) action;
68 OFOxm<?> oxm = setFieldAction.getField(); 70 OFOxm<?> oxm = setFieldAction.getField();
...@@ -79,11 +81,11 @@ public class NiciraExtensionInterpreter extends AbstractHandlerBehaviour ...@@ -79,11 +81,11 @@ public class NiciraExtensionInterpreter extends AbstractHandlerBehaviour
79 } 81 }
80 82
81 @Override 83 @Override
82 - public ExtensionInstruction getExtensionInstruction(ExtensionType type) { 84 + public ExtensionTreatment getExtensionInstruction(ExtensionTreatmentType type) {
83 - if (type.equals(ExtensionType.ExtensionTypes.NICIRA_SET_TUNNEL_DST.type())) { 85 + if (type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_TUNNEL_DST.type())) {
84 return new NiciraSetTunnelDst(); 86 return new NiciraSetTunnelDst();
85 } 87 }
86 - if (type.equals(ExtensionType.ExtensionTypes.NICIRA_RESUBMIT.type())) { 88 + if (type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_RESUBMIT.type())) {
87 return new NiciraResubmit(); 89 return new NiciraResubmit();
88 } 90 }
89 throw new UnsupportedOperationException( 91 throw new UnsupportedOperationException(
......
...@@ -19,8 +19,8 @@ package org.onosproject.driver.extensions; ...@@ -19,8 +19,8 @@ package org.onosproject.driver.extensions;
19 import com.google.common.base.MoreObjects; 19 import com.google.common.base.MoreObjects;
20 import org.onlab.util.KryoNamespace; 20 import org.onlab.util.KryoNamespace;
21 import org.onosproject.net.PortNumber; 21 import org.onosproject.net.PortNumber;
22 -import org.onosproject.net.flow.instructions.AbstractExtensionInstruction; 22 +import org.onosproject.net.flow.instructions.AbstractExtensionTreatment;
23 -import org.onosproject.net.flow.instructions.ExtensionType; 23 +import org.onosproject.net.flow.instructions.ExtensionTreatmentType;
24 import org.onosproject.store.serializers.PortNumberSerializer; 24 import org.onosproject.store.serializers.PortNumberSerializer;
25 25
26 import java.util.Objects; 26 import java.util.Objects;
...@@ -30,7 +30,7 @@ import static com.google.common.base.Preconditions.checkNotNull; ...@@ -30,7 +30,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
30 /** 30 /**
31 * Nicira resubmit extension instruction. 31 * Nicira resubmit extension instruction.
32 */ 32 */
33 -public class NiciraResubmit extends AbstractExtensionInstruction { 33 +public class NiciraResubmit extends AbstractExtensionTreatment {
34 34
35 private PortNumber inPort; 35 private PortNumber inPort;
36 36
...@@ -66,8 +66,8 @@ public class NiciraResubmit extends AbstractExtensionInstruction { ...@@ -66,8 +66,8 @@ public class NiciraResubmit extends AbstractExtensionInstruction {
66 } 66 }
67 67
68 @Override 68 @Override
69 - public ExtensionType type() { 69 + public ExtensionTreatmentType type() {
70 - return ExtensionType.ExtensionTypes.NICIRA_RESUBMIT.type(); 70 + return ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_RESUBMIT.type();
71 } 71 }
72 72
73 @Override 73 @Override
......
...@@ -19,8 +19,8 @@ package org.onosproject.driver.extensions; ...@@ -19,8 +19,8 @@ package org.onosproject.driver.extensions;
19 import com.google.common.base.MoreObjects; 19 import com.google.common.base.MoreObjects;
20 import org.onlab.packet.Ip4Address; 20 import org.onlab.packet.Ip4Address;
21 import org.onlab.util.KryoNamespace; 21 import org.onlab.util.KryoNamespace;
22 -import org.onosproject.net.flow.instructions.AbstractExtensionInstruction; 22 +import org.onosproject.net.flow.instructions.AbstractExtensionTreatment;
23 -import org.onosproject.net.flow.instructions.ExtensionType; 23 +import org.onosproject.net.flow.instructions.ExtensionTreatmentType;
24 import org.onosproject.store.serializers.Ip4AddressSerializer; 24 import org.onosproject.store.serializers.Ip4AddressSerializer;
25 25
26 import java.util.Objects; 26 import java.util.Objects;
...@@ -30,7 +30,7 @@ import static com.google.common.base.Preconditions.checkNotNull; ...@@ -30,7 +30,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
30 /** 30 /**
31 * Nicira set tunnel destination extension instruction. 31 * Nicira set tunnel destination extension instruction.
32 */ 32 */
33 -public class NiciraSetTunnelDst extends AbstractExtensionInstruction { 33 +public class NiciraSetTunnelDst extends AbstractExtensionTreatment {
34 34
35 private Ip4Address tunnelDst; 35 private Ip4Address tunnelDst;
36 36
...@@ -67,8 +67,8 @@ public class NiciraSetTunnelDst extends AbstractExtensionInstruction { ...@@ -67,8 +67,8 @@ public class NiciraSetTunnelDst extends AbstractExtensionInstruction {
67 } 67 }
68 68
69 @Override 69 @Override
70 - public ExtensionType type() { 70 + public ExtensionTreatmentType type() {
71 - return ExtensionType.ExtensionTypes.NICIRA_SET_TUNNEL_DST.type(); 71 + return ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_TUNNEL_DST.type();
72 } 72 }
73 73
74 @Override 74 @Override
......
...@@ -32,10 +32,10 @@ ...@@ -32,10 +32,10 @@
32 impl="org.onosproject.driver.handshaker.NiciraSwitchHandshaker"/> 32 impl="org.onosproject.driver.handshaker.NiciraSwitchHandshaker"/>
33 <behaviour api="org.onosproject.net.behaviour.ControllerConfig" 33 <behaviour api="org.onosproject.net.behaviour.ControllerConfig"
34 impl="org.onosproject.driver.ovsdb.OvsdbControllerConfig"/> 34 impl="org.onosproject.driver.ovsdb.OvsdbControllerConfig"/>
35 - <behaviour api="org.onosproject.openflow.controller.ExtensionInterpreter" 35 + <behaviour api="org.onosproject.openflow.controller.ExtensionTreatmentInterpreter"
36 - impl="org.onosproject.driver.extensions.NiciraExtensionInterpreter" /> 36 + impl="org.onosproject.driver.extensions.NiciraExtensionTreatmentInterpreter" />
37 - <behaviour api="org.onosproject.net.behaviour.ExtensionResolver" 37 + <behaviour api="org.onosproject.net.behaviour.ExtensionTreatmentResolver"
38 - impl="org.onosproject.driver.extensions.NiciraExtensionInterpreter" /> 38 + impl="org.onosproject.driver.extensions.NiciraExtensionTreatmentInterpreter" />
39 </driver> 39 </driver>
40 <!--This driver is for simulated NETCONF devices through of-config tool on top og OVSDB--> 40 <!--This driver is for simulated NETCONF devices through of-config tool on top og OVSDB-->
41 <driver name="ovs-netconf" extends="default" 41 <driver name="ovs-netconf" extends="default"
......
...@@ -18,8 +18,8 @@ package org.onosproject.openflow.controller; ...@@ -18,8 +18,8 @@ package org.onosproject.openflow.controller;
18 18
19 import com.google.common.annotations.Beta; 19 import com.google.common.annotations.Beta;
20 import org.onosproject.net.driver.HandlerBehaviour; 20 import org.onosproject.net.driver.HandlerBehaviour;
21 -import org.onosproject.net.flow.instructions.ExtensionInstruction; 21 +import org.onosproject.net.flow.instructions.ExtensionTreatment;
22 -import org.onosproject.net.flow.instructions.ExtensionType; 22 +import org.onosproject.net.flow.instructions.ExtensionTreatmentType;
23 import org.projectfloodlight.openflow.protocol.OFFactory; 23 import org.projectfloodlight.openflow.protocol.OFFactory;
24 import org.projectfloodlight.openflow.protocol.action.OFAction; 24 import org.projectfloodlight.openflow.protocol.action.OFAction;
25 25
...@@ -27,25 +27,25 @@ import org.projectfloodlight.openflow.protocol.action.OFAction; ...@@ -27,25 +27,25 @@ import org.projectfloodlight.openflow.protocol.action.OFAction;
27 * Interprets extension instructions and converts them to/from OpenFlow objects. 27 * Interprets extension instructions and converts them to/from OpenFlow objects.
28 */ 28 */
29 @Beta 29 @Beta
30 -public interface ExtensionInterpreter extends HandlerBehaviour { 30 +public interface ExtensionTreatmentInterpreter extends HandlerBehaviour {
31 31
32 /** 32 /**
33 * Returns true if the given extension instruction is supported by this 33 * Returns true if the given extension instruction is supported by this
34 * driver. 34 * driver.
35 * 35 *
36 - * @param extensionType extension instruction type 36 + * @param extensionTreatmentType extension instruction type
37 * @return true if the instruction is supported, otherwise false 37 * @return true if the instruction is supported, otherwise false
38 */ 38 */
39 - boolean supported(ExtensionType extensionType); 39 + boolean supported(ExtensionTreatmentType extensionTreatmentType);
40 40
41 /** 41 /**
42 * Maps an extension instruction to an OpenFlow action. 42 * Maps an extension instruction to an OpenFlow action.
43 * 43 *
44 * @param factory OpenFlow factory 44 * @param factory OpenFlow factory
45 - * @param extensionInstruction extension instruction 45 + * @param extensionTreatment extension instruction
46 * @return OpenFlow action 46 * @return OpenFlow action
47 */ 47 */
48 - OFAction mapInstruction(OFFactory factory, ExtensionInstruction extensionInstruction); 48 + OFAction mapInstruction(OFFactory factory, ExtensionTreatment extensionTreatment);
49 49
50 /** 50 /**
51 * Maps an OpenFlow action to an extension instruction. 51 * Maps an OpenFlow action to an extension instruction.
...@@ -53,6 +53,6 @@ public interface ExtensionInterpreter extends HandlerBehaviour { ...@@ -53,6 +53,6 @@ public interface ExtensionInterpreter extends HandlerBehaviour {
53 * @param action OpenFlow action 53 * @param action OpenFlow action
54 * @return extension instruction 54 * @return extension instruction
55 */ 55 */
56 - ExtensionInstruction mapAction(OFAction action); 56 + ExtensionTreatment mapAction(OFAction action);
57 57
58 } 58 }
......
...@@ -44,7 +44,7 @@ import org.onosproject.net.flow.TrafficSelector; ...@@ -44,7 +44,7 @@ import org.onosproject.net.flow.TrafficSelector;
44 import org.onosproject.net.flow.TrafficTreatment; 44 import org.onosproject.net.flow.TrafficTreatment;
45 import org.onosproject.net.flow.instructions.Instructions; 45 import org.onosproject.net.flow.instructions.Instructions;
46 import org.onosproject.openflow.controller.Dpid; 46 import org.onosproject.openflow.controller.Dpid;
47 -import org.onosproject.openflow.controller.ExtensionInterpreter; 47 +import org.onosproject.openflow.controller.ExtensionTreatmentInterpreter;
48 import org.projectfloodlight.openflow.protocol.OFFlowMod; 48 import org.projectfloodlight.openflow.protocol.OFFlowMod;
49 import org.projectfloodlight.openflow.protocol.OFFlowRemoved; 49 import org.projectfloodlight.openflow.protocol.OFFlowRemoved;
50 import org.projectfloodlight.openflow.protocol.OFFlowStatsEntry; 50 import org.projectfloodlight.openflow.protocol.OFFlowStatsEntry;
...@@ -449,7 +449,7 @@ public class FlowEntryBuilder { ...@@ -449,7 +449,7 @@ public class FlowEntryBuilder {
449 break; 449 break;
450 case TUNNEL_IPV4_DST: 450 case TUNNEL_IPV4_DST:
451 DriverHandler driver = getDriver(dpid); 451 DriverHandler driver = getDriver(dpid);
452 - ExtensionInterpreter interpreter = driver.behaviour(ExtensionInterpreter.class); 452 + ExtensionTreatmentInterpreter interpreter = driver.behaviour(ExtensionTreatmentInterpreter.class);
453 if (interpreter != null) { 453 if (interpreter != null) {
454 builder.extension(interpreter.mapAction(action), DeviceId.deviceId(Dpid.uri(dpid))); 454 builder.extension(interpreter.mapAction(action), DeviceId.deviceId(Dpid.uri(dpid)));
455 } 455 }
......
...@@ -27,7 +27,7 @@ import org.onosproject.net.driver.Driver; ...@@ -27,7 +27,7 @@ import org.onosproject.net.driver.Driver;
27 import org.onosproject.net.driver.DriverService; 27 import org.onosproject.net.driver.DriverService;
28 import org.onosproject.net.flow.FlowRule; 28 import org.onosproject.net.flow.FlowRule;
29 import org.onosproject.net.flow.TrafficTreatment; 29 import org.onosproject.net.flow.TrafficTreatment;
30 -import org.onosproject.net.flow.instructions.ExtensionInstruction; 30 +import org.onosproject.net.flow.instructions.ExtensionTreatment;
31 import org.onosproject.net.flow.instructions.Instruction; 31 import org.onosproject.net.flow.instructions.Instruction;
32 import org.onosproject.net.flow.instructions.Instructions; 32 import org.onosproject.net.flow.instructions.Instructions;
33 import org.onosproject.net.flow.instructions.Instructions.GroupInstruction; 33 import org.onosproject.net.flow.instructions.Instructions.GroupInstruction;
...@@ -49,7 +49,7 @@ import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModIPInst ...@@ -49,7 +49,7 @@ import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModIPInst
49 import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModIPv6FlowLabelInstruction; 49 import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModIPv6FlowLabelInstruction;
50 import org.onosproject.net.flow.instructions.L4ModificationInstruction; 50 import org.onosproject.net.flow.instructions.L4ModificationInstruction;
51 import org.onosproject.net.flow.instructions.L4ModificationInstruction.ModTransportPortInstruction; 51 import org.onosproject.net.flow.instructions.L4ModificationInstruction.ModTransportPortInstruction;
52 -import org.onosproject.openflow.controller.ExtensionInterpreter; 52 +import org.onosproject.openflow.controller.ExtensionTreatmentInterpreter;
53 import org.projectfloodlight.openflow.protocol.OFFactory; 53 import org.projectfloodlight.openflow.protocol.OFFactory;
54 import org.projectfloodlight.openflow.protocol.OFFlowAdd; 54 import org.projectfloodlight.openflow.protocol.OFFlowAdd;
55 import org.projectfloodlight.openflow.protocol.OFFlowDelete; 55 import org.projectfloodlight.openflow.protocol.OFFlowDelete;
...@@ -482,16 +482,16 @@ public class FlowModBuilderVer13 extends FlowModBuilder { ...@@ -482,16 +482,16 @@ public class FlowModBuilderVer13 extends FlowModBuilder {
482 return null; 482 return null;
483 } 483 }
484 484
485 - private OFAction buildExtensionAction(ExtensionInstruction i) { 485 + private OFAction buildExtensionAction(ExtensionTreatment i) {
486 if (!driverService.isPresent()) { 486 if (!driverService.isPresent()) {
487 log.error("No driver service present"); 487 log.error("No driver service present");
488 return null; 488 return null;
489 } 489 }
490 Driver driver = driverService.get().getDriver(deviceId); 490 Driver driver = driverService.get().getDriver(deviceId);
491 - if (driver.hasBehaviour(ExtensionInterpreter.class)) { 491 + if (driver.hasBehaviour(ExtensionTreatmentInterpreter.class)) {
492 DefaultDriverHandler handler = 492 DefaultDriverHandler handler =
493 new DefaultDriverHandler(new DefaultDriverData(driver, deviceId)); 493 new DefaultDriverHandler(new DefaultDriverData(driver, deviceId));
494 - ExtensionInterpreter interpreter = handler.behaviour(ExtensionInterpreter.class); 494 + ExtensionTreatmentInterpreter interpreter = handler.behaviour(ExtensionTreatmentInterpreter.class);
495 return interpreter.mapInstruction(factory(), i); 495 return interpreter.mapInstruction(factory(), i);
496 } 496 }
497 497
......
...@@ -33,7 +33,7 @@ import org.onosproject.net.driver.DefaultDriverHandler; ...@@ -33,7 +33,7 @@ import org.onosproject.net.driver.DefaultDriverHandler;
33 import org.onosproject.net.driver.Driver; 33 import org.onosproject.net.driver.Driver;
34 import org.onosproject.net.driver.DriverService; 34 import org.onosproject.net.driver.DriverService;
35 import org.onosproject.net.flow.TrafficTreatment; 35 import org.onosproject.net.flow.TrafficTreatment;
36 -import org.onosproject.net.flow.instructions.ExtensionInstruction; 36 +import org.onosproject.net.flow.instructions.ExtensionTreatment;
37 import org.onosproject.net.flow.instructions.Instruction; 37 import org.onosproject.net.flow.instructions.Instruction;
38 import org.onosproject.net.flow.instructions.Instructions; 38 import org.onosproject.net.flow.instructions.Instructions;
39 import org.onosproject.net.flow.instructions.L0ModificationInstruction; 39 import org.onosproject.net.flow.instructions.L0ModificationInstruction;
...@@ -42,7 +42,7 @@ import org.onosproject.net.flow.instructions.L3ModificationInstruction; ...@@ -42,7 +42,7 @@ import org.onosproject.net.flow.instructions.L3ModificationInstruction;
42 import org.onosproject.net.group.GroupBucket; 42 import org.onosproject.net.group.GroupBucket;
43 import org.onosproject.net.group.GroupBuckets; 43 import org.onosproject.net.group.GroupBuckets;
44 import org.onosproject.net.group.GroupDescription; 44 import org.onosproject.net.group.GroupDescription;
45 -import org.onosproject.openflow.controller.ExtensionInterpreter; 45 +import org.onosproject.openflow.controller.ExtensionTreatmentInterpreter;
46 import org.projectfloodlight.openflow.protocol.OFBucket; 46 import org.projectfloodlight.openflow.protocol.OFBucket;
47 import org.projectfloodlight.openflow.protocol.OFFactory; 47 import org.projectfloodlight.openflow.protocol.OFFactory;
48 import org.projectfloodlight.openflow.protocol.OFGroupAdd; 48 import org.projectfloodlight.openflow.protocol.OFGroupAdd;
...@@ -424,16 +424,16 @@ public final class GroupModBuilder { ...@@ -424,16 +424,16 @@ public final class GroupModBuilder {
424 return null; 424 return null;
425 } 425 }
426 426
427 - private OFAction buildExtensionAction(ExtensionInstruction i, DeviceId deviceId) { 427 + private OFAction buildExtensionAction(ExtensionTreatment i, DeviceId deviceId) {
428 if (!driverService.isPresent()) { 428 if (!driverService.isPresent()) {
429 log.error("No driver service present"); 429 log.error("No driver service present");
430 return null; 430 return null;
431 } 431 }
432 Driver driver = driverService.get().getDriver(deviceId); 432 Driver driver = driverService.get().getDriver(deviceId);
433 - if (driver.hasBehaviour(ExtensionInterpreter.class)) { 433 + if (driver.hasBehaviour(ExtensionTreatmentInterpreter.class)) {
434 DefaultDriverHandler handler = 434 DefaultDriverHandler handler =
435 new DefaultDriverHandler(new DefaultDriverData(driver, deviceId)); 435 new DefaultDriverHandler(new DefaultDriverData(driver, deviceId));
436 - ExtensionInterpreter interpreter = handler.behaviour(ExtensionInterpreter.class); 436 + ExtensionTreatmentInterpreter interpreter = handler.behaviour(ExtensionTreatmentInterpreter.class);
437 return interpreter.mapInstruction(factory, i); 437 return interpreter.mapInstruction(factory, i);
438 } 438 }
439 439
......