Supports dpdk config in OpenstackNode.
Change-Id: I332d7643acb56c5fa7460edb6e4c90a2d862706f
diff --git a/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/codec/DpdkConfigCodec.java b/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/codec/DpdkConfigCodec.java
new file mode 100644
index 0000000..3e8156d
--- /dev/null
+++ b/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/codec/DpdkConfigCodec.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * 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.openstacknode.codec;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import org.onosproject.codec.CodecContext;
+import org.onosproject.codec.JsonCodec;
+import org.onosproject.openstacknode.api.DpdkConfig;
+import org.onosproject.openstacknode.api.DpdkInterface;
+import org.onosproject.openstacknode.impl.DefaultDpdkConfig;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.IntStream;
+
+import static org.onlab.util.Tools.nullIsIllegal;
+
+/**
+ * dpdk config codec used for serializing and de-serializing JSON string.
+ */
+public class DpdkConfigCodec extends JsonCodec<DpdkConfig> {
+ private static final String DATA_PATH_TYPE = "datapathType";
+ private static final String SOCKET_DIR = "socketDir";
+ private static final String DPDK_INTFS = "dpdkIntfs";
+
+ private static final String MISSING_MESSAGE = " is required in DpdkInterface";
+
+ @Override
+ public ObjectNode encode(DpdkConfig entity, CodecContext context) {
+ ObjectNode result = context.mapper().createObjectNode()
+ .put(DATA_PATH_TYPE, entity.datapathType().name());
+
+ if (entity.socketDir() != null) {
+ result.put(SOCKET_DIR, entity.socketDir());
+ }
+
+ ArrayNode dpdkIntfs = context.mapper().createArrayNode();
+ entity.dpdkIntfs().forEach(dpdkIntf -> {
+ ObjectNode dpdkIntfJson = context.codec(DpdkInterface.class)
+ .encode(dpdkIntf, context);
+ dpdkIntfs.add(dpdkIntfJson);
+ });
+ result.set(DPDK_INTFS, dpdkIntfs);
+
+ return result;
+ }
+
+ @Override
+ public DpdkConfig decode(ObjectNode json, CodecContext context) {
+ if (json == null || !json.isObject()) {
+ return null;
+ }
+
+ String datapathType = nullIsIllegal(json.get(DATA_PATH_TYPE).asText(),
+ DATA_PATH_TYPE + MISSING_MESSAGE);
+
+ DefaultDpdkConfig.Builder builder = DefaultDpdkConfig.builder()
+ .datapathType(DpdkConfig.DatapathType.valueOf(datapathType.toUpperCase()));
+
+ if (json.get(SOCKET_DIR) != null) {
+ builder.socketDir(json.get(SOCKET_DIR).asText());
+ }
+
+ List<DpdkInterface> dpdkInterfaces = new ArrayList<>();
+ JsonNode dpdkIntfsJson = json.get(DPDK_INTFS);
+
+ if (dpdkIntfsJson != null) {
+ final JsonCodec<DpdkInterface>
+ dpdkIntfCodec = context.codec(DpdkInterface.class);
+
+ IntStream.range(0, dpdkIntfsJson.size()).forEach(i -> {
+ ObjectNode intfJson = get(dpdkIntfsJson, i);
+ dpdkInterfaces.add(dpdkIntfCodec.decode(intfJson, context));
+ });
+ }
+ builder.dpdkIntfs(dpdkInterfaces);
+
+ return builder.build();
+ }
+}
diff --git a/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/codec/DpdkInterfaceCodec.java b/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/codec/DpdkInterfaceCodec.java
new file mode 100644
index 0000000..033bfc0
--- /dev/null
+++ b/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/codec/DpdkInterfaceCodec.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * 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.openstacknode.codec;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import org.onosproject.codec.CodecContext;
+import org.onosproject.codec.JsonCodec;
+import org.onosproject.openstacknode.api.DpdkInterface;
+import org.onosproject.openstacknode.api.DpdkInterface.Type;
+import org.onosproject.openstacknode.impl.DefaultDpdkInterface;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+import static org.onlab.util.Tools.nullIsIllegal;
+
+/**
+ * DPDK interface codec used for serializing and de-serializing JSON string.
+ */
+public class DpdkInterfaceCodec extends JsonCodec<DpdkInterface> {
+ private static final String DEVICE_NAME = "deviceName";
+ private static final String INTF = "intf";
+ private static final String PCI_ADDRESS = "pciAddress";
+ private static final String TYPE = "type";
+ private static final String MTU = "mtu";
+
+ private static final String NOT_NULL_MESSAGE = "dpdk interface cannot be null";
+ private static final String MISSING_MESSAGE = " is required in DpdkInterface";
+
+ @Override
+ public ObjectNode encode(DpdkInterface entity, CodecContext context) {
+ checkNotNull(entity, NOT_NULL_MESSAGE);
+
+ return context.mapper().createObjectNode()
+ .put(DEVICE_NAME, entity.deviceName())
+ .put(INTF, entity.intf())
+ .put(PCI_ADDRESS, entity.pciAddress())
+ .put(TYPE, entity.type().name())
+ .put(MTU, entity.mtu().toString());
+ }
+
+ @Override
+ public DpdkInterface decode(ObjectNode json, CodecContext context) {
+ if (json == null || !json.isObject()) {
+ return null;
+ }
+
+ String deviceName = nullIsIllegal(json.get(DEVICE_NAME).asText(),
+ DEVICE_NAME + MISSING_MESSAGE);
+ String intf = nullIsIllegal(json.get(INTF).asText(),
+ INTF + MISSING_MESSAGE);
+ String pciAddress = nullIsIllegal(json.get(PCI_ADDRESS).asText(),
+ PCI_ADDRESS + MISSING_MESSAGE);
+ String typeString = nullIsIllegal(json.get(TYPE).asText(),
+ TYPE + MISSING_MESSAGE);
+
+ Type type;
+ try {
+ type = Type.valueOf(typeString.toUpperCase());
+ } catch (IllegalArgumentException e) {
+ throw new IllegalArgumentException(TYPE + MISSING_MESSAGE);
+ }
+
+ DpdkInterface.Builder builder = DefaultDpdkInterface.builder()
+ .deviceName(deviceName)
+ .intf(intf)
+ .pciAddress(pciAddress)
+ .type(type);
+
+ JsonNode mtuJson = json.get(MTU);
+
+ if (mtuJson != null) {
+ builder.mtu(Long.parseLong(mtuJson.asText()));
+ }
+
+ return builder.build();
+ }
+}
diff --git a/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/codec/OpenstackNodeCodec.java b/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/codec/OpenstackNodeCodec.java
index 5d16199..ad2f08b 100644
--- a/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/codec/OpenstackNodeCodec.java
+++ b/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/codec/OpenstackNodeCodec.java
@@ -24,6 +24,7 @@
import org.onosproject.net.DeviceId;
import org.onosproject.net.behaviour.ControllerInfo;
import org.onosproject.openstacknode.api.DefaultOpenstackNode;
+import org.onosproject.openstacknode.api.DpdkConfig;
import org.onosproject.openstacknode.api.NodeState;
import org.onosproject.openstacknode.api.OpenstackAuth;
import org.onosproject.openstacknode.api.OpenstackNode;
@@ -61,11 +62,9 @@
private static final String AUTHENTICATION = "authentication";
private static final String END_POINT = "endpoint";
private static final String SSH_AUTH = "sshAuth";
- private static final String DATA_PATH_TYPE = "datapathType";
- private static final String SOCKET_DIR = "socketDir";
+ private static final String DPDK_CONFIG = "dpdkConfig";
private static final String MISSING_MESSAGE = " is required in OpenstackNode";
- private static final String UNSUPPORTED_DATAPATH_TYPE = "Unsupported datapath type";
@Override
public ObjectNode encode(OpenstackNode node, CodecContext context) {
@@ -75,8 +74,7 @@
.put(HOST_NAME, node.hostname())
.put(TYPE, node.type().name())
.put(STATE, node.state().name())
- .put(MANAGEMENT_IP, node.managementIp().toString())
- .put(DATA_PATH_TYPE, node.datapathType().name());
+ .put(MANAGEMENT_IP, node.managementIp().toString());
OpenstackNode.NodeType type = node.type();
@@ -128,8 +126,10 @@
result.set(SSH_AUTH, sshAuthJson);
}
- if (node.socketDir() != null) {
- result.put(SOCKET_DIR, node.socketDir());
+ if (node.dpdkConfig() != null) {
+ ObjectNode dpdkConfigJson = context.codec(DpdkConfig.class)
+ .encode(node.dpdkConfig(), context);
+ result.set(DPDK_CONFIG, dpdkConfigJson);
}
return result;
@@ -175,23 +175,6 @@
nodeBuilder.intgBridge(DeviceId.deviceId(intBridgeJson.asText()));
}
- JsonNode datapathTypeJson = json.get(DATA_PATH_TYPE);
-
- if (datapathTypeJson == null ||
- datapathTypeJson.asText().equals(OpenstackNode.DatapathType.NORMAL.name().toLowerCase())) {
- nodeBuilder.datapathType(OpenstackNode.DatapathType.NORMAL);
- } else if (datapathTypeJson.asText().equals(OpenstackNode.DatapathType.NETDEV.name().toLowerCase())) {
- nodeBuilder.datapathType(OpenstackNode.DatapathType.NETDEV);
- } else {
- throw new IllegalArgumentException(UNSUPPORTED_DATAPATH_TYPE + datapathTypeJson.asText());
- }
-
- JsonNode socketDir = json.get(SOCKET_DIR);
-
- if (socketDir != null) {
- nodeBuilder.socketDir(socketDir.asText());
- }
-
// parse physical interfaces
List<OpenstackPhyInterface> phyIntfs = new ArrayList<>();
JsonNode phyIntfsJson = json.get(PHYSICAL_INTERFACES);
@@ -224,7 +207,7 @@
// parse authentication
JsonNode authJson = json.get(AUTHENTICATION);
- if (json.get(AUTHENTICATION) != null) {
+ if (authJson != null) {
final JsonCodec<OpenstackAuth> authCodec = context.codec(OpenstackAuth.class);
@@ -234,13 +217,21 @@
// parse ssh authentication
JsonNode sshAuthJson = json.get(SSH_AUTH);
- if (json.get(SSH_AUTH) != null) {
+ if (sshAuthJson != null) {
final JsonCodec<OpenstackSshAuth> sshAuthJsonCodec = context.codec(OpenstackSshAuth.class);
OpenstackSshAuth sshAuth = sshAuthJsonCodec.decode((ObjectNode) sshAuthJson.deepCopy(), context);
nodeBuilder.sshAuthInfo(sshAuth);
}
+ JsonNode dpdkConfigJson = json.get(DPDK_CONFIG);
+ if (dpdkConfigJson != null) {
+ final JsonCodec<DpdkConfig> dpdkConfigJsonCodec = context.codec(DpdkConfig.class);
+
+ DpdkConfig dpdkConfig = dpdkConfigJsonCodec.decode((ObjectNode) dpdkConfigJson.deepCopy(), context);
+ nodeBuilder.dpdkConfig(dpdkConfig);
+ }
+
log.trace("node is {}", nodeBuilder.build().toString());
return nodeBuilder.build();
diff --git a/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/impl/DefaultDpdkConfig.java b/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/impl/DefaultDpdkConfig.java
new file mode 100644
index 0000000..afd2d22
--- /dev/null
+++ b/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/impl/DefaultDpdkConfig.java
@@ -0,0 +1,158 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * 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.openstacknode.impl;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.collect.ImmutableList;
+import org.onosproject.openstacknode.api.DpdkConfig;
+import org.onosproject.openstacknode.api.DpdkInterface;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Objects;
+
+import static com.google.common.base.Preconditions.checkArgument;
+
+/**
+ * Implementation of dpdk config.
+ */
+public final class DefaultDpdkConfig implements DpdkConfig {
+
+ private final DatapathType datapathType;
+ private final String socketDir;
+ private final Collection<DpdkInterface> dpdkIntfs;
+
+ private static final String NOT_NULL_MSG = "% cannot be null";
+
+ private DefaultDpdkConfig(DatapathType datapathType,
+ String socketDir,
+ Collection<DpdkInterface> dpdkIntfs) {
+ this.datapathType = datapathType;
+ this.socketDir = socketDir;
+ this.dpdkIntfs = dpdkIntfs;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof DefaultDpdkConfig)) {
+ return false;
+ }
+ DefaultDpdkConfig that = (DefaultDpdkConfig) o;
+ return datapathType == that.datapathType &&
+ Objects.equals(socketDir, that.socketDir) &&
+ Objects.equals(dpdkIntfs, that.dpdkIntfs);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(datapathType,
+ socketDir,
+ dpdkIntfs);
+ }
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper(this)
+ .add("datapathType", datapathType)
+ .add("socketDir", socketDir)
+ .add("dpdkIntfs", dpdkIntfs)
+ .toString();
+ }
+
+ /**
+ * Returns the data path type.
+ *
+ * @return data path type; normal or netdev
+ */
+ @Override
+ public DatapathType datapathType() {
+ return datapathType;
+ }
+
+ /**
+ * Returns socket directory which dpdk port bound to.
+ *
+ * @return socket directory
+ */
+ @Override
+ public String socketDir() {
+ return socketDir;
+ }
+
+ /**
+ * Returns a collection of dpdk interfaces.
+ *
+ * @return dpdk interfaces
+ */
+ @Override
+ public Collection<DpdkInterface> dpdkIntfs() {
+ if (dpdkIntfs == null) {
+ return new ArrayList<>();
+ }
+ return ImmutableList.copyOf(dpdkIntfs);
+ }
+
+ /**
+ * Returns new builder instance.
+ *
+ * @return dpdk config builder instance
+ */
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * Builder of DpdkConfig instance.
+ */
+ public static final class Builder implements DpdkConfig.Builder {
+ private DatapathType datapathType;
+ private String socketDir;
+ private Collection<DpdkInterface> dpdkIntfs;
+
+ private Builder() {
+
+ }
+
+ @Override
+ public DpdkConfig build() {
+ checkArgument(datapathType != null, NOT_NULL_MSG, "datapathType");
+ return new DefaultDpdkConfig(datapathType,
+ socketDir,
+ dpdkIntfs);
+ }
+
+ @Override
+ public Builder datapathType(DatapathType datapathType) {
+ this.datapathType = datapathType;
+ return this;
+ }
+
+ @Override
+ public Builder socketDir(String socketDir) {
+ this.socketDir = socketDir;
+ return this;
+ }
+
+ @Override
+ public Builder dpdkIntfs(Collection<DpdkInterface> dpdkIntfs) {
+ this.dpdkIntfs = dpdkIntfs;
+ return this;
+ }
+ }
+}
diff --git a/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/impl/DefaultDpdkInterface.java b/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/impl/DefaultDpdkInterface.java
new file mode 100644
index 0000000..c442876
--- /dev/null
+++ b/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/impl/DefaultDpdkInterface.java
@@ -0,0 +1,202 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * 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.openstacknode.impl;
+
+import com.google.common.base.MoreObjects;
+import org.onosproject.openstacknode.api.DpdkInterface;
+
+import java.util.Objects;
+
+import static com.google.common.base.Preconditions.checkArgument;
+
+
+/**
+ * Implementation of dpdk interface.
+ */
+public final class DefaultDpdkInterface implements DpdkInterface {
+ private final String deviceName;
+ private final String intf;
+ private final String pciAddress;
+ private final Type type;
+ private final Long mtu;
+ private static final String NOT_NULL_MSG = "% cannot be null";
+
+ private DefaultDpdkInterface(String deviceName,
+ String intf,
+ String pciAddress,
+ Type type,
+ Long mtu) {
+ this.deviceName = deviceName;
+ this.intf = intf;
+ this.pciAddress = pciAddress;
+ this.type = type;
+ this.mtu = mtu;
+ }
+
+ /**
+ * Returns the name of the device where the dpdk interface is.
+ *
+ * @return device name
+ */
+ @Override
+ public String deviceName() {
+ return deviceName;
+ }
+
+ /**
+ * Returns the name of the dpdk interface.
+ *
+ * @return dpdk interface name
+ */
+ @Override
+ public String intf() {
+ return intf;
+ }
+
+ /**
+ * Returns the dpdk device arguments of this dpdk port.
+ * ex) "0000:85:00.1"
+ *
+ * @return pci address
+ */
+ @Override
+ public String pciAddress() {
+ return pciAddress;
+ }
+
+ /**
+ * Returns the dpdk interface type.
+ *
+ * @return type
+ */
+ @Override
+ public Type type() {
+ return type;
+ }
+
+ /**
+ * Returns the mtu size.
+ *
+ * @return mtu
+ */
+ @Override
+ public Long mtu() {
+ return mtu;
+ }
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper(getClass())
+ .add("deviceName", deviceName)
+ .add("intf", intf)
+ .add("pciAddress", pciAddress)
+ .add("type", type)
+ .add("mtu", mtu)
+ .toString();
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(deviceName,
+ intf,
+ pciAddress,
+ type,
+ mtu);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof DefaultDpdkInterface)) {
+ return false;
+ }
+ DefaultDpdkInterface that = (DefaultDpdkInterface) o;
+ return Objects.equals(deviceName, that.deviceName) &&
+ Objects.equals(intf, that.intf) &&
+ Objects.equals(pciAddress, that.pciAddress) &&
+ type == that.type &&
+ Objects.equals(mtu, that.mtu);
+ }
+
+ /**
+ * Returns new builder instance.
+ *
+ * @return dpdk interface builder instance.
+ */
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * Builder of dpdk interface instance.
+ */
+ public static final class Builder implements DpdkInterface.Builder {
+ private String deviceName;
+ private String intf;
+ private String pciAddress;
+ private Type type;
+ private Long mtu = DpdkInterface.DEFAULT_MTU_SIZE;
+
+ private Builder() {
+ }
+
+ @Override
+ public DpdkInterface build() {
+ checkArgument(deviceName != null, NOT_NULL_MSG, "deviceName");
+ checkArgument(intf != null, NOT_NULL_MSG, "intf");
+ checkArgument(pciAddress != null, NOT_NULL_MSG, "pciAddress");
+ checkArgument(type != null, NOT_NULL_MSG, "type");
+
+ return new DefaultDpdkInterface(deviceName,
+ intf,
+ pciAddress,
+ type,
+ mtu);
+ }
+
+ @Override
+ public Builder deviceName(String deviceName) {
+ this.deviceName = deviceName;
+ return this;
+ }
+
+ @Override
+ public Builder intf(String name) {
+ this.intf = name;
+ return this;
+ }
+
+ @Override
+ public Builder pciAddress(String pciAddress) {
+ this.pciAddress = pciAddress;
+ return this;
+ }
+
+ @Override
+ public Builder type(Type type) {
+ this.type = type;
+ return this;
+ }
+
+ @Override
+ public Builder mtu(Long mtu) {
+ this.mtu = mtu;
+ return this;
+ }
+ }
+}
diff --git a/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/impl/DefaultOpenstackNodeHandler.java b/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/impl/DefaultOpenstackNodeHandler.java
index 07d71de..4337355 100644
--- a/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/impl/DefaultOpenstackNodeHandler.java
+++ b/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/impl/DefaultOpenstackNodeHandler.java
@@ -78,11 +78,12 @@
import static org.onosproject.net.flow.instructions.ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_TUNNEL_DST;
import static org.onosproject.openstacknode.api.Constants.DEFAULT_TUNNEL;
import static org.onosproject.openstacknode.api.Constants.INTEGRATION_BRIDGE;
+import static org.onosproject.openstacknode.api.DpdkConfig.DatapathType.NETDEV;
import static org.onosproject.openstacknode.api.NodeState.COMPLETE;
import static org.onosproject.openstacknode.api.NodeState.DEVICE_CREATED;
import static org.onosproject.openstacknode.api.NodeState.INCOMPLETE;
import static org.onosproject.openstacknode.api.NodeState.INIT;
-import static org.onosproject.openstacknode.api.OpenstackNode.DatapathType.NETDEV;
+
import static org.onosproject.openstacknode.api.OpenstackNode.NodeType.CONTROLLER;
import static org.onosproject.openstacknode.api.OpenstackNode.NodeType.GATEWAY;
import static org.onosproject.openstacknode.api.OpenstackNodeService.APP_ID;
diff --git a/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/impl/DistributedOpenstackNodeStore.java b/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/impl/DistributedOpenstackNodeStore.java
index f30611b..368deed 100644
--- a/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/impl/DistributedOpenstackNodeStore.java
+++ b/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/impl/DistributedOpenstackNodeStore.java
@@ -28,6 +28,8 @@
import org.onosproject.net.behaviour.ControllerInfo;
import org.onosproject.openstacknode.api.DefaultOpenstackAuth;
import org.onosproject.openstacknode.api.DefaultOpenstackNode;
+import org.onosproject.openstacknode.api.DpdkConfig;
+import org.onosproject.openstacknode.api.DpdkInterface;
import org.onosproject.openstacknode.api.NodeState;
import org.onosproject.openstacknode.api.OpenstackNode;
import org.onosproject.openstacknode.api.OpenstackNodeEvent;
@@ -83,9 +85,13 @@
.register(DefaultOpenstackNode.class)
.register(OpenstackNode.NodeType.class)
.register(NodeState.class)
- .register(OpenstackNode.DatapathType.class)
+ .register(DpdkConfig.class)
+ .register(DefaultDpdkConfig.class)
+ .register(DpdkConfig.DatapathType.class)
.register(OpenstackPhyInterface.class)
.register(DefaultOpenstackPhyInterface.class)
+ .register(DpdkInterface.class)
+ .register(DefaultDpdkInterface.class)
.register(ControllerInfo.class)
.register(DefaultOpenstackAuth.class)
.register(DefaultOpenstackAuth.Perspective.class)
diff --git a/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/web/OpenstackNodeCodecRegister.java b/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/web/OpenstackNodeCodecRegister.java
index 3c8954c..4361317 100644
--- a/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/web/OpenstackNodeCodecRegister.java
+++ b/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/web/OpenstackNodeCodecRegister.java
@@ -22,10 +22,14 @@
import org.apache.felix.scr.annotations.ReferenceCardinality;
import org.onosproject.codec.CodecService;
import org.onosproject.net.behaviour.ControllerInfo;
+import org.onosproject.openstacknode.api.DpdkConfig;
+import org.onosproject.openstacknode.api.DpdkInterface;
import org.onosproject.openstacknode.api.OpenstackAuth;
import org.onosproject.openstacknode.api.OpenstackNode;
import org.onosproject.openstacknode.api.OpenstackPhyInterface;
import org.onosproject.openstacknode.api.OpenstackSshAuth;
+import org.onosproject.openstacknode.codec.DpdkConfigCodec;
+import org.onosproject.openstacknode.codec.DpdkInterfaceCodec;
import org.onosproject.openstacknode.codec.OpenstackAuthCodec;
import org.onosproject.openstacknode.codec.OpenstackControllerCodec;
import org.onosproject.openstacknode.codec.OpenstackNodeCodec;
@@ -52,6 +56,8 @@
codecService.registerCodec(OpenstackPhyInterface.class, new OpenstackPhyInterfaceCodec());
codecService.registerCodec(ControllerInfo.class, new OpenstackControllerCodec());
codecService.registerCodec(OpenstackSshAuth.class, new OpenstackSshAuthCodec());
+ codecService.registerCodec(DpdkInterface.class, new DpdkInterfaceCodec());
+ codecService.registerCodec(DpdkConfig.class, new DpdkConfigCodec());
log.info("Started");
}
@@ -63,6 +69,8 @@
codecService.unregisterCodec(OpenstackPhyInterface.class);
codecService.unregisterCodec(ControllerInfo.class);
codecService.unregisterCodec(OpenstackSshAuth.class);
+ codecService.unregisterCodec(DpdkConfig.class);
+ codecService.unregisterCodec(DpdkInterface.class);
log.info("Stopped");
}