diff options
Diffstat (limited to 'framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions')
15 files changed, 0 insertions, 1531 deletions
diff --git a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/DefaultMoveExtensionTreatment.java b/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/DefaultMoveExtensionTreatment.java deleted file mode 100644 index 140a8167..00000000 --- a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/DefaultMoveExtensionTreatment.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.onosproject.driver.extensions; - -import java.util.Map; -import java.util.Objects; - -import org.onlab.util.KryoNamespace; -import org.onosproject.net.flow.AbstractExtension; -import org.onosproject.net.flow.instructions.ExtensionTreatmentType; - -import com.google.common.base.MoreObjects; -import com.google.common.collect.Maps; - -/** - * Default implementation of Move treatment. - */ -public class DefaultMoveExtensionTreatment extends AbstractExtension - implements MoveExtensionTreatment { - - private int srcOfs; - private int dstOfs; - private int nBits; - private int src; - private int dst; - private ExtensionTreatmentType type; - - private final KryoNamespace appKryo = new KryoNamespace.Builder() - .register(byte[].class).register(Integer.class).register(Map.class) - .build(); - - /** - * Creates a new move Treatment. - * - * @param srcOfs source offset - * @param dstOfs destination offset - * @param nBits nbits - * @param src source - * @param dst destination - * @param type extension treatment type - */ - public DefaultMoveExtensionTreatment(int srcOfs, int dstOfs, int nBits, - int src, int dst, ExtensionTreatmentType type) { - this.srcOfs = srcOfs; - this.dstOfs = dstOfs; - this.nBits = nBits; - this.src = src; - this.dst = dst; - this.type = type; - } - - @Override - public ExtensionTreatmentType type() { - return type; - } - - @Override - public byte[] serialize() { - Map<String, Integer> values = Maps.newHashMap(); - values.put("srcOfs", srcOfs); - values.put("dstOfs", dstOfs); - values.put("nBits", nBits); - values.put("src", src); - values.put("dst", dst); - values.put("type", ExtensionTreatmentType.ExtensionTreatmentTypes.valueOf(type.toString()).ordinal()); - return appKryo.serialize(values); - } - - @Override - public void deserialize(byte[] data) { - Map<String, Integer> values = appKryo.deserialize(data); - srcOfs = values.get("srcOfs"); - dstOfs = values.get("dstOfs"); - nBits = values.get("nBits"); - src = values.get("src"); - dst = values.get("dst"); - type = new ExtensionTreatmentType(values.get("type").intValue()); - } - - @Override - public int srcOffset() { - return srcOfs; - } - - @Override - public int dstOffset() { - return dstOfs; - } - - @Override - public int src() { - return src; - } - - @Override - public int dst() { - return dst; - } - - @Override - public int nBits() { - return nBits; - } - - @Override - public int hashCode() { - return Objects.hash(srcOfs, dstOfs, src, dst, nBits); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof DefaultMoveExtensionTreatment) { - DefaultMoveExtensionTreatment that = (DefaultMoveExtensionTreatment) obj; - return Objects.equals(srcOfs, that.srcOfs) - && Objects.equals(dstOfs, that.dstOfs) - && Objects.equals(src, that.src) - && Objects.equals(dst, that.dst) - && Objects.equals(nBits, that.nBits); - - } - return false; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(getClass()).add("srcOfs", srcOfs) - .add("dstOfs", dstOfs).add("nBits", nBits).add("src", src) - .add("dst", dst).toString(); - } -} diff --git a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/MoveExtensionTreatment.java b/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/MoveExtensionTreatment.java deleted file mode 100644 index b67e1bed..00000000 --- a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/MoveExtensionTreatment.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.onosproject.driver.extensions; - -import org.onosproject.net.flow.instructions.ExtensionTreatment; - -/** - * The abstraction of Move Treatment. - */ -public interface MoveExtensionTreatment extends ExtensionTreatment { - - /** - * Returns SRC_OFS field of move extension action. - * - * @return SRC_OFS - */ - int srcOffset(); - - /** - * Returns DST_OFS field of move extension action. - * - * @return DST_OFS - */ - int dstOffset(); - - /** - * Returns SRC field of move extension action. - * - * @return SRC - */ - int src(); - - /** - * Returns DST field of move extension action. - * - * @return DST - */ - int dst(); - - /** - * Returns N_BITS field of move extension action. - * - * @return N_BITS - */ - int nBits(); -} diff --git a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraExtensionSelectorInterpreter.java b/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraExtensionSelectorInterpreter.java deleted file mode 100644 index 9f302991..00000000 --- a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraExtensionSelectorInterpreter.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.onosproject.driver.extensions; - -import org.onosproject.net.behaviour.ExtensionSelectorResolver; -import org.onosproject.net.driver.AbstractHandlerBehaviour; -import org.onosproject.net.flow.criteria.ExtensionSelector; -import org.onosproject.net.flow.criteria.ExtensionSelectorType; -import org.onosproject.openflow.controller.ExtensionSelectorInterpreter; -import org.projectfloodlight.openflow.protocol.OFFactory; -import org.projectfloodlight.openflow.protocol.oxm.OFOxm; - -/** - * Interpreter for Nicira OpenFlow selector extensions. - */ -public class NiciraExtensionSelectorInterpreter - extends AbstractHandlerBehaviour - implements ExtensionSelectorInterpreter, ExtensionSelectorResolver { - - @Override - public boolean supported(ExtensionSelectorType extensionSelectorType) { - if (extensionSelectorType.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_SPI.type())) { - return true; - } - if (extensionSelectorType.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_SI.type())) { - return true; - } - if (extensionSelectorType.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_CH1.type())) { - return true; - } - if (extensionSelectorType.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_CH2.type())) { - return true; - } - if (extensionSelectorType.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_CH3.type())) { - return true; - } - if (extensionSelectorType.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_CH4.type())) { - return true; - } - return false; - } - - @Override - public OFOxm<?> mapSelector(OFFactory factory, ExtensionSelector extensionSelector) { - ExtensionSelectorType type = extensionSelector.type(); - if (type.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_SPI.type())) { - // TODO - } - if (type.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_SI.type())) { - // TODO - } - if (type.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_CH1.type())) { - // TODO - } - if (type.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_CH2.type())) { - // TODO - } - if (type.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_CH3.type())) { - // TODO - } - if (type.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_CH4.type())) { - // TODO - } - return null; - } - - @Override - public ExtensionSelector mapOxm(OFOxm<?> oxm) { - return null; - } - - @Override - public ExtensionSelector getExtensionSelector(ExtensionSelectorType type) { - if (type.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_SPI.type())) { - return new NiciraMatchNshSpi(); - } - if (type.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_SI.type())) { - return new NiciraMatchNshSi(); - } - if (type.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_CH1.type()) - || type.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_CH2.type()) - || type.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_CH3.type()) - || type.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_CH4.type())) { - return new NiciraMatchNshContextHeader(type); - } - return null; - } -} diff --git a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraExtensionTreatmentInterpreter.java b/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraExtensionTreatmentInterpreter.java deleted file mode 100644 index 5e374d9b..00000000 --- a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraExtensionTreatmentInterpreter.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.onosproject.driver.extensions; - -import org.onlab.packet.Ip4Address; -import org.onosproject.net.behaviour.ExtensionTreatmentResolver; -import org.onosproject.net.driver.AbstractHandlerBehaviour; -import org.onosproject.net.flow.instructions.ExtensionTreatment; -import org.onosproject.net.flow.instructions.ExtensionTreatmentType; -import org.onosproject.openflow.controller.ExtensionTreatmentInterpreter; -import org.projectfloodlight.openflow.protocol.OFActionType; -import org.projectfloodlight.openflow.protocol.OFFactory; -import org.projectfloodlight.openflow.protocol.action.OFAction; -import org.projectfloodlight.openflow.protocol.action.OFActionSetField; -import org.projectfloodlight.openflow.protocol.oxm.OFOxm; -import org.projectfloodlight.openflow.protocol.oxm.OFOxmTunnelIpv4Dst; -import org.projectfloodlight.openflow.types.IPv4Address; - -/** - * Interpreter for Nicira OpenFlow treatment extensions. - */ -public class NiciraExtensionTreatmentInterpreter extends AbstractHandlerBehaviour - implements ExtensionTreatmentInterpreter, ExtensionTreatmentResolver { - - @Override - public boolean supported(ExtensionTreatmentType extensionTreatmentType) { - if (extensionTreatmentType.equals( - ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_TUNNEL_DST.type())) { - return true; - } - if (extensionTreatmentType.equals( - ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_RESUBMIT.type())) { - return true; - } - if (extensionTreatmentType.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_NSH_SPI.type())) { - return true; - } - if (extensionTreatmentType.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_NSH_SI.type())) { - return true; - } - if (extensionTreatmentType.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_NSH_CH1.type())) { - return true; - } - if (extensionTreatmentType.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_NSH_CH2.type())) { - return true; - } - if (extensionTreatmentType.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_NSH_CH3.type())) { - return true; - } - if (extensionTreatmentType.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_NSH_CH4.type())) { - return true; - } - if (extensionTreatmentType.equals( - ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_RESUBMIT_TABLE.type())) { - return true; - } - if (extensionTreatmentType.equals( - ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_MOV_ARP_SHA_TO_THA.type())) { - return true; - } - if (extensionTreatmentType.equals( - ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_MOV_ARP_SPA_TO_TPA.type())) { - return true; - } - if (extensionTreatmentType.equals( - ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_MOV_ETH_SRC_TO_DST.type())) { - return true; - } - if (extensionTreatmentType.equals( - ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_MOV_IP_SRC_TO_DST.type())) { - return true; - } - return false; - } - - @Override - public OFAction mapInstruction(OFFactory factory, ExtensionTreatment extensionTreatment) { - ExtensionTreatmentType type = extensionTreatment.type(); - if (type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_TUNNEL_DST.type())) { - NiciraSetTunnelDst tunnelDst = (NiciraSetTunnelDst) extensionTreatment; - return factory.actions().setField(factory.oxms().tunnelIpv4Dst( - IPv4Address.of(tunnelDst.tunnelDst().toInt()))); - } - if (type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_RESUBMIT.type())) { - // TODO this will be implemented later - } - if (type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_NSH_SPI.type())) { - // TODO this will be implemented later - } - if (type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_RESUBMIT_TABLE.type())) { - // TODO this will be implemented later - } - if (type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_NSH_SI.type())) { - // TODO this will be implemented later - } - if (type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_NSH_CH1.type())) { - // TODO this will be implemented later - } - if (type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_NSH_CH2.type())) { - // TODO this will be implemented later - } - if (type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_NSH_CH3.type())) { - // TODO this will be implemented later - } - if (type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_NSH_CH4.type())) { - // TODO this will be implemented later - } - if (type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_MOV_ETH_SRC_TO_DST.type()) - || type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_MOV_ARP_SPA_TO_TPA.type()) - || type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_MOV_ETH_SRC_TO_DST.type()) - || type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_MOV_IP_SRC_TO_DST.type())) { - // TODO this will be implemented later - } - return null; - } - - @Override - public ExtensionTreatment mapAction(OFAction action) { - if (action.getType().equals(OFActionType.SET_FIELD)) { - OFActionSetField setFieldAction = (OFActionSetField) action; - OFOxm<?> oxm = setFieldAction.getField(); - switch (oxm.getMatchField().id) { - case TUNNEL_IPV4_DST: - OFOxmTunnelIpv4Dst tunnelIpv4Dst = (OFOxmTunnelIpv4Dst) oxm; - return new NiciraSetTunnelDst(Ip4Address.valueOf(tunnelIpv4Dst.getValue().getInt())); - default: - throw new UnsupportedOperationException( - "Driver does not support extension type " + oxm.getMatchField().id); - } - } - return null; - } - - @Override - public ExtensionTreatment getExtensionInstruction(ExtensionTreatmentType type) { - if (type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_TUNNEL_DST.type())) { - return new NiciraSetTunnelDst(); - } - if (type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_RESUBMIT.type())) { - return new NiciraResubmit(); - } - if (type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_RESUBMIT_TABLE.type())) { - return new NiciraResubmitTable(); - } - if (type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_NSH_SPI.type())) { - return new NiciraSetNshSpi(); - } - if (type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_NSH_SI.type())) { - return new NiciraSetNshSi(); - } - if (type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_NSH_CH1.type()) - || type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_NSH_CH2.type()) - || type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_NSH_CH3.type()) - || type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_NSH_CH4.type())) { - return new NiciraSetNshContextHeader(type); - } - if (type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_MOV_ARP_SHA_TO_THA.type())) { - return NiciraMoveTreatmentFactory.createNiciraMovArpShaToTha(); - } - if (type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_MOV_ARP_SPA_TO_TPA.type())) { - return NiciraMoveTreatmentFactory.createNiciraMovArpSpaToTpa(); - } - if (type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_MOV_ETH_SRC_TO_DST.type())) { - return NiciraMoveTreatmentFactory.createNiciraMovEthSrcToDst(); - } - if (type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_MOV_IP_SRC_TO_DST.type())) { - return NiciraMoveTreatmentFactory.createNiciraMovIpSrcToDst(); - } - throw new UnsupportedOperationException( - "Driver does not support extension type " + type.toString()); - } -} diff --git a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraMatchNshContextHeader.java b/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraMatchNshContextHeader.java deleted file mode 100644 index 5f37247f..00000000 --- a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraMatchNshContextHeader.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.onosproject.driver.extensions; - -import static com.google.common.base.MoreObjects.toStringHelper; - -import java.util.Objects; - -import org.onlab.util.KryoNamespace; -import org.onosproject.net.NshContextHeader; -import org.onosproject.net.flow.AbstractExtension; -import org.onosproject.net.flow.criteria.ExtensionSelector; -import org.onosproject.net.flow.criteria.ExtensionSelectorType; -/** - * Implementation of Nsh context header criterion. - */ -public final class NiciraMatchNshContextHeader extends AbstractExtension implements ExtensionSelector { - private NshContextHeader nshContextHeader; - private ExtensionSelectorType type; - - private final KryoNamespace appKryo = new KryoNamespace.Builder().build(); - - /** - * Constructor to create Nsh context header. - * - * @param type extension selector type - */ - public NiciraMatchNshContextHeader(ExtensionSelectorType type) { - this.nshContextHeader = null; - this.type = type; - } - - /** - * Gets the nsh context header to match. - * - * @return the nsh context header to match - */ - public NshContextHeader nshContextHeader() { - return nshContextHeader; - } - - @Override - public byte[] serialize() { - return appKryo.serialize(nshContextHeader.nshContextHeader()); - } - - @Override - public void deserialize(byte[] data) { - nshContextHeader = nshContextHeader.of(appKryo.deserialize(data)); - - } - - @Override - public ExtensionSelectorType type() { - return type; - } - - @Override - public String toString() { - return toStringHelper(type().toString()) - .add("nshContextHeader", nshContextHeader.toString()) - .toString(); - } - - @Override - public int hashCode() { - return Objects.hash(type(), nshContextHeader); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof NiciraMatchNshContextHeader) { - NiciraMatchNshContextHeader that = (NiciraMatchNshContextHeader) obj; - return Objects.equals(nshContextHeader, that.nshContextHeader) && - Objects.equals(this.type(), that.type()); - } - return false; - } -} diff --git a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraMatchNshSi.java b/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraMatchNshSi.java deleted file mode 100644 index c98a584a..00000000 --- a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraMatchNshSi.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.onosproject.driver.extensions; - -import static com.google.common.base.MoreObjects.toStringHelper; - -import java.util.Objects; - -import org.onlab.util.KryoNamespace; -import org.onosproject.net.NshServiceIndex; -import org.onosproject.net.flow.AbstractExtension; -import org.onosproject.net.flow.criteria.ExtensionSelector; -import org.onosproject.net.flow.criteria.ExtensionSelectorType; -/** - * Implementation of NSH Service Index(SI). - */ -public final class NiciraMatchNshSi extends AbstractExtension implements ExtensionSelector { - - private NshServiceIndex nshSi; - - private final KryoNamespace appKryo = new KryoNamespace.Builder().build(); - - /** - * Default constructor. - * - */ - public NiciraMatchNshSi() { - this.nshSi = null; - } - - /** - * Gets the nsh service index to match. - * - * @return the si to match - */ - public NshServiceIndex nshSi() { - return nshSi; - } - - @Override - public byte[] serialize() { - return appKryo.serialize(nshSi.serviceIndex()); - } - - @Override - public void deserialize(byte[] data) { - nshSi = NshServiceIndex.of(appKryo.deserialize(data)); - } - - @Override - public ExtensionSelectorType type() { - return ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_SI.type(); - } - - @Override - public String toString() { - return toStringHelper(type().toString()) - .add("nshSi", nshSi.toString()) - .toString(); - } - - @Override - public int hashCode() { - return Objects.hash(type(), nshSi); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof NiciraMatchNshSi) { - NiciraMatchNshSi that = (NiciraMatchNshSi) obj; - return Objects.equals(nshSi, that.nshSi); - } - return false; - } -} diff --git a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraMatchNshSpi.java b/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraMatchNshSpi.java deleted file mode 100644 index 42bb78d4..00000000 --- a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraMatchNshSpi.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.onosproject.driver.extensions; - -import static com.google.common.base.MoreObjects.toStringHelper; - -import java.util.Objects; - -import org.onlab.util.KryoNamespace; -import org.onosproject.net.NshServicePathId; -import org.onosproject.net.flow.AbstractExtension; -import org.onosproject.net.flow.criteria.ExtensionSelector; -import org.onosproject.net.flow.criteria.ExtensionSelectorType; - -/** - * Implementation of NSH Service Path Id selector. - */ -public final class NiciraMatchNshSpi extends AbstractExtension implements ExtensionSelector { - private NshServicePathId nshSpi; - - private final KryoNamespace appKryo = new KryoNamespace.Builder().build(); - - /** - * Default constructor. - */ - public NiciraMatchNshSpi() { - this.nshSpi = null; - } - - /** - * Gets the network service path id to match. - * - * @return the nshSpi to match - */ - public NshServicePathId nshSpi() { - return nshSpi; - } - - @Override - public ExtensionSelectorType type() { - return ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_SPI.type(); - } - - @Override - public byte[] serialize() { - return appKryo.serialize(nshSpi); - } - - @Override - public void deserialize(byte[] data) { - nshSpi = NshServicePathId.of(appKryo.deserialize(data)); - } - - @Override - public String toString() { - return toStringHelper(type().toString()) - .add("nshSpi", nshSpi.toString()) - .toString(); - } - - @Override - public int hashCode() { - return Objects.hash(type(), nshSpi); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof NiciraMatchNshSpi) { - NiciraMatchNshSpi that = (NiciraMatchNshSpi) obj; - return Objects.equals(nshSpi, that.nshSpi) && - Objects.equals(this.type(), that.type()); - } - return false; - } -} diff --git a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraMoveTreatmentFactory.java b/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraMoveTreatmentFactory.java deleted file mode 100644 index ac42a3b2..00000000 --- a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraMoveTreatmentFactory.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.onosproject.driver.extensions; - -import org.onosproject.net.flow.instructions.ExtensionTreatment; -import org.onosproject.net.flow.instructions.ExtensionTreatmentType; - -/** - * The factory of move treatment. - */ -public final class NiciraMoveTreatmentFactory { - - /** - * Public constructor is prohibited. - */ - private NiciraMoveTreatmentFactory() { - - } - - /** - * Creates a move treatment that move arp sha to tha. - * - * @return ExtensionTreatment - */ - public static ExtensionTreatment createNiciraMovArpShaToTha() { - int srcOfs = 0; - int dstOfs = 0; - int nBits = 48; - int srcSha = 0x00012206; - int dstTha = 0x00012406; - return new DefaultMoveExtensionTreatment(srcOfs, dstOfs, nBits, srcSha, - dstTha, - ExtensionTreatmentType.ExtensionTreatmentTypes - .NICIRA_MOV_ARP_SHA_TO_THA.type()); - } - - /** - * Creates a move treatment that move arp spa to tpa. - * - * @return ExtensionTreatment - */ - public static ExtensionTreatment createNiciraMovArpSpaToTpa() { - int srcOfs = 0; - int dstOfs = 0; - int nBits = 32; - int srcSpa = 0x00002004; - int dstTpa = 0x00002204; - return new DefaultMoveExtensionTreatment(srcOfs, dstOfs, nBits, srcSpa, - dstTpa, - ExtensionTreatmentType.ExtensionTreatmentTypes - .NICIRA_MOV_ARP_SPA_TO_TPA.type()); - } - - /** - * Creates a move treatment that move eth src to dst. - * - * @return ExtensionTreatment - */ - public static ExtensionTreatment createNiciraMovEthSrcToDst() { - int srcOfs = 0; - int dstOfs = 0; - int nBits = 48; - int srcEth = 0x00000406; - int dstEth = 0x00000206; - return new DefaultMoveExtensionTreatment(srcOfs, dstOfs, nBits, srcEth, - dstEth, - ExtensionTreatmentType.ExtensionTreatmentTypes - .NICIRA_MOV_ETH_SRC_TO_DST.type()); - } - - /** - * Creates a move treatment that move ip src to dst. - * - * @return ExtensionTreatment - */ - public static ExtensionTreatment createNiciraMovIpSrcToDst() { - int srcOfs = 0; - int dstOfs = 0; - int nBits = 32; - int srcIp = 0x00000e04; - int dstIp = 0x00001006; - return new DefaultMoveExtensionTreatment(srcOfs, dstOfs, nBits, srcIp, - dstIp, - ExtensionTreatmentType.ExtensionTreatmentTypes - .NICIRA_MOV_IP_SRC_TO_DST.type()); - } -} diff --git a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraResubmit.java b/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraResubmit.java deleted file mode 100644 index b85af4f2..00000000 --- a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraResubmit.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.onosproject.driver.extensions; - -import com.google.common.base.MoreObjects; -import org.onlab.util.KryoNamespace; -import org.onosproject.net.PortNumber; -import org.onosproject.net.flow.AbstractExtension; -import org.onosproject.net.flow.instructions.ExtensionTreatment; -import org.onosproject.net.flow.instructions.ExtensionTreatmentType; -import org.onosproject.store.serializers.PortNumberSerializer; - -import java.util.Objects; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Nicira resubmit extension instruction. - */ -public class NiciraResubmit extends AbstractExtension implements ExtensionTreatment { - - private PortNumber inPort; - - private final KryoNamespace appKryo = new KryoNamespace.Builder() - .register(new PortNumberSerializer(), PortNumber.class) - .register(byte[].class) - .build(); - - /** - * Creates a new resubmit instruction. - */ - NiciraResubmit() { - inPort = null; - } - - /** - * Creates a new resubmit instruction with a particular inPort. - * - * @param inPort in port number - */ - public NiciraResubmit(PortNumber inPort) { - checkNotNull(inPort); - this.inPort = inPort; - } - - /** - * Gets the inPort. - * - * @return inPort - */ - public PortNumber inPort() { - return inPort; - } - - @Override - public ExtensionTreatmentType type() { - return ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_RESUBMIT.type(); - } - - @Override - public void deserialize(byte[] data) { - inPort = appKryo.deserialize(data); - } - - @Override - public byte[] serialize() { - return appKryo.serialize(inPort); - } - - @Override - public int hashCode() { - return Objects.hash(inPort); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof NiciraResubmit) { - NiciraResubmit that = (NiciraResubmit) obj; - return Objects.equals(inPort, that.inPort); - - } - return false; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(getClass()) - .add("inPort", inPort) - .toString(); - } -} diff --git a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraResubmitTable.java b/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraResubmitTable.java deleted file mode 100644 index 4743d217..00000000 --- a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraResubmitTable.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.onosproject.driver.extensions; - -import com.google.common.base.MoreObjects; - -import org.onlab.util.KryoNamespace; -import org.onosproject.net.PortNumber; -import org.onosproject.net.flow.AbstractExtension; -import org.onosproject.net.flow.instructions.ExtensionTreatment; -import org.onosproject.net.flow.instructions.ExtensionTreatmentType; -import org.onosproject.store.serializers.PortNumberSerializer; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Nicira resubmit-table extension instruction. - */ -public class NiciraResubmitTable extends AbstractExtension implements - ExtensionTreatment { - - //the list of the in port number(PortNumber) and the table(short) - private List<Object> inPortAndTable = new ArrayList<Object>(); - - private final KryoNamespace appKryo = new KryoNamespace.Builder() - .register(ArrayList.class) - .register(new PortNumberSerializer(), PortNumber.class) - .register(short.class) - .register(byte[].class) - .build(); - - /** - * Creates a new resubmit-table instruction. - */ - NiciraResubmitTable() { - inPortAndTable = null; - } - - /** - * Creates a new resubmit-table instruction with a particular inPort and table. - * - * @param inPortAndTable the list of in port number and table - */ - public NiciraResubmitTable(List<Object> inPortAndTable) { - checkNotNull(inPortAndTable); - this.inPortAndTable = inPortAndTable; - } - - /** - * Gets the inPortAndTable. - * - * @return inPortAndTable - */ - public List<Object> inPortAndTable() { - return inPortAndTable; - } - - @Override - public ExtensionTreatmentType type() { - return ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_RESUBMIT_TABLE.type(); - } - - @Override - public void deserialize(byte[] data) { - inPortAndTable = appKryo.deserialize(data); - } - - @Override - public byte[] serialize() { - return appKryo.serialize(inPortAndTable); - } - - @Override - public int hashCode() { - return Objects.hash(inPortAndTable); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof NiciraResubmitTable) { - NiciraResubmitTable that = (NiciraResubmitTable) obj; - return Objects.equals(inPortAndTable, that.inPortAndTable); - - } - return false; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(getClass()) - .add("inPortAndTable", inPortAndTable).toString(); - } -} diff --git a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraSetNshContextHeader.java b/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraSetNshContextHeader.java deleted file mode 100644 index c8267984..00000000 --- a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraSetNshContextHeader.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.onosproject.driver.extensions; - -import com.google.common.base.MoreObjects; -import org.onlab.util.KryoNamespace; -import org.onosproject.net.flow.AbstractExtension; -import org.onosproject.net.flow.instructions.ExtensionTreatment; -import org.onosproject.net.flow.instructions.ExtensionTreatmentType; - -import java.util.Objects; - -/** - * Nicira set NSH Context header extension instruction. - */ -public class NiciraSetNshContextHeader extends AbstractExtension implements - ExtensionTreatment { - - private int nshCh; - private ExtensionTreatmentType type; - - private final KryoNamespace appKryo = new KryoNamespace.Builder().build(); - - /** - * Creates a new set nsh context header instruction. - * - * @param type extension treatment type - */ - NiciraSetNshContextHeader(ExtensionTreatmentType type) { - this.nshCh = 0; - this.type = type; - } - - /** - * Creates a new set nsh context header instruction. - * - * @param nshCh nsh context header - * @param type extension treatment type - */ - NiciraSetNshContextHeader(int nshCh, ExtensionTreatmentType type) { - this.nshCh = nshCh; - this.type = type; - } - - /** - * Gets the nsh context header. - * - * @return nsh context header - */ - public int nshCh() { - return nshCh; - } - - @Override - public ExtensionTreatmentType type() { - return type; - } - - @Override - public void deserialize(byte[] data) { - nshCh = appKryo.deserialize(data); - } - - @Override - public byte[] serialize() { - return appKryo.serialize(nshCh); - } - - @Override - public int hashCode() { - return Objects.hash(nshCh, type); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof NiciraSetNshContextHeader) { - NiciraSetNshContextHeader that = (NiciraSetNshContextHeader) obj; - return Objects.equals(nshCh, that.nshCh) && Objects.equals(type, that.type); - - } - return false; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(getClass()) - .add("nshCh", nshCh) - .add("type", type) - .toString(); - } -} diff --git a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraSetNshSi.java b/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraSetNshSi.java deleted file mode 100644 index 1480508e..00000000 --- a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraSetNshSi.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.onosproject.driver.extensions; - -import com.google.common.base.MoreObjects; -import org.onlab.util.KryoNamespace; -import org.onosproject.net.flow.AbstractExtension; -import org.onosproject.net.flow.instructions.ExtensionTreatment; -import org.onosproject.net.flow.instructions.ExtensionTreatmentType; - -import java.util.Objects; - -/** - * Nicira set NSH SI extension instruction. - */ -public class NiciraSetNshSi extends AbstractExtension implements - ExtensionTreatment { - - private byte nshSi; - - private final KryoNamespace appKryo = new KryoNamespace.Builder().build(); - - /** - * Creates a new set nsh si instruction. - */ - NiciraSetNshSi() { - nshSi = 0; - } - - /** - * Creates a new set nsh si instruction with given si. - * - * @param nshSi nsh service index - */ - NiciraSetNshSi(byte nshSi) { - this.nshSi = nshSi; - } - - /** - * Gets the nsh service index. - * - * @return nsh service index - */ - public byte nshSi() { - return nshSi; - } - - @Override - public ExtensionTreatmentType type() { - return ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_NSH_SI.type(); - } - - @Override - public void deserialize(byte[] data) { - nshSi = appKryo.deserialize(data); - } - - @Override - public byte[] serialize() { - return appKryo.serialize(nshSi); - } - - @Override - public int hashCode() { - return Objects.hash(nshSi); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof NiciraSetNshSi) { - NiciraSetNshSi that = (NiciraSetNshSi) obj; - return Objects.equals(nshSi, that.nshSi); - - } - return false; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(getClass()) - .add("nshSi", nshSi) - .toString(); - } -} diff --git a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraSetNshSpi.java b/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraSetNshSpi.java deleted file mode 100644 index 1a47173e..00000000 --- a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraSetNshSpi.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.onosproject.driver.extensions; - -import com.google.common.base.MoreObjects; -import org.onlab.util.KryoNamespace; -import org.onosproject.net.flow.AbstractExtension; -import org.onosproject.net.flow.instructions.ExtensionTreatment; -import org.onosproject.net.flow.instructions.ExtensionTreatmentType; - -import java.util.Objects; - -/** - * Nicira set NSH SPI extension instruction. - */ -public class NiciraSetNshSpi extends AbstractExtension implements - ExtensionTreatment { - - private int nshSpi; - - private final KryoNamespace appKryo = new KryoNamespace.Builder().build(); - - /** - * Creates a new set nsh spi instruction. - */ - NiciraSetNshSpi() { - nshSpi = 0; - } - - /** - * Creates a new set nsh spi instruction with given spi. - * - * @param nshSpi nsh service path index - */ - NiciraSetNshSpi(int nshSpi) { - this.nshSpi = nshSpi; - } - - /** - * Gets the nsh service path index. - * - * @return nsh service path index - */ - public int nshSpi() { - return nshSpi; - } - - @Override - public ExtensionTreatmentType type() { - return ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_NSH_SPI.type(); - } - - @Override - public void deserialize(byte[] data) { - nshSpi = appKryo.deserialize(data); - } - - @Override - public byte[] serialize() { - return appKryo.serialize(nshSpi); - } - - @Override - public int hashCode() { - return Objects.hash(nshSpi); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof NiciraSetNshSpi) { - NiciraSetNshSpi that = (NiciraSetNshSpi) obj; - return Objects.equals(nshSpi, that.nshSpi); - - } - return false; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(getClass()) - .add("nshSpi", nshSpi) - .toString(); - } -} diff --git a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraSetTunnelDst.java b/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraSetTunnelDst.java deleted file mode 100644 index e28a1e24..00000000 --- a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/NiciraSetTunnelDst.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.onosproject.driver.extensions; - -import com.google.common.base.MoreObjects; -import org.onlab.packet.Ip4Address; -import org.onlab.util.KryoNamespace; -import org.onosproject.net.flow.AbstractExtension; -import org.onosproject.net.flow.instructions.ExtensionTreatment; -import org.onosproject.net.flow.instructions.ExtensionTreatmentType; -import org.onosproject.store.serializers.Ip4AddressSerializer; - -import java.util.Objects; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Nicira set tunnel destination extension instruction. - */ -public class NiciraSetTunnelDst extends AbstractExtension implements - ExtensionTreatment { - - private Ip4Address tunnelDst; - - private final KryoNamespace appKryo = new KryoNamespace.Builder() - .register(new Ip4AddressSerializer(), Ip4Address.class) - .register(byte[].class) - .build(); - - /** - * Creates a new set tunnel destination instruction. - */ - NiciraSetTunnelDst() { - tunnelDst = null; - } - - /** - * Creates a new set tunnel destination instruction with a particular IPv4 - * address. - * - * @param tunnelDst tunnel destination IPv4 address - */ - NiciraSetTunnelDst(Ip4Address tunnelDst) { - checkNotNull(tunnelDst); - this.tunnelDst = tunnelDst; - } - - /** - * Gets the tunnel destination IPv4 address. - * - * @return tunnel destination IPv4 address - */ - public Ip4Address tunnelDst() { - return tunnelDst; - } - - @Override - public ExtensionTreatmentType type() { - return ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_TUNNEL_DST.type(); - } - - @Override - public void deserialize(byte[] data) { - tunnelDst = appKryo.deserialize(data); - } - - @Override - public byte[] serialize() { - return appKryo.serialize(tunnelDst); - } - - @Override - public int hashCode() { - return Objects.hash(tunnelDst); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof NiciraSetTunnelDst) { - NiciraSetTunnelDst that = (NiciraSetTunnelDst) obj; - return Objects.equals(tunnelDst, that.tunnelDst); - - } - return false; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(getClass()) - .add("tunnelDst", tunnelDst) - .toString(); - } -} diff --git a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/package-info.java b/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/package-info.java deleted file mode 100644 index d9d2460d..00000000 --- a/framework/src/onos/drivers/src/main/java/org/onosproject/driver/extensions/package-info.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Processing of Nicira extensions. - */ -package org.onosproject.driver.extensions; |