summaryrefslogtreecommitdiffstats
path: root/v3po/v3po2vpp/src/main/java/io
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2018-07-03 12:44:55 +0200
committerMarek Gradzki <mgradzki@cisco.com>2018-07-04 10:57:08 +0000
commitb6ead1d5525b5b1500729959acbce905bbcbf04a (patch)
treec951b431c5d2ddaf4f6965e54560645b3dd6d63d /v3po/v3po2vpp/src/main/java/io
parent0461747b7d4e2c395a04501cddfa492c4f75ef7c (diff)
HC2VPP-275: use ip-address-no-zone in v3po YANG model
The inet:ip-address type was used in HC models due to ODL bug: https://bugs.opendaylight.org/show_bug.cgi?id=6413 which was fixed long time ago... Change-Id: Icaa8ac1269c730243afba53bc663f39f7c90f36c Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src/main/java/io')
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/GreCustomizer.java16
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanCustomizer.java16
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizer.java16
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/GreCustomizer.java10
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanCustomizer.java10
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanGpeCustomizer.java10
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2/ArpTerminationTableEntryCustomizer.java4
7 files changed, 41 insertions, 41 deletions
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/GreCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/GreCustomizer.java
index 75df9a1b4..2f6d4a51c 100644
--- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/GreCustomizer.java
+++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/GreCustomizer.java
@@ -30,7 +30,7 @@ import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import java.net.InetAddress;
import java.util.concurrent.CompletionStage;
import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfaceType;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev180703.GreTunnel;
@@ -118,21 +118,21 @@ public class GreCustomizer extends AbstractInterfaceTypeCustomizer<Gre> implemen
}
private boolean isIpv6(final Gre gre) {
- if (gre.getSrc().getIpv4Address() == null) {
- checkArgument(gre.getDst().getIpv4Address() == null, "Inconsistent ip addresses: %s, %s", gre.getSrc(),
+ if (gre.getSrc().getIpv4AddressNoZone() == null) {
+ checkArgument(gre.getDst().getIpv4AddressNoZone() == null, "Inconsistent ip addresses: %s, %s", gre.getSrc(),
gre.getDst());
return true;
} else {
- checkArgument(gre.getDst().getIpv6Address() == null, "Inconsistent ip addresses: %s, %s", gre.getSrc(),
+ checkArgument(gre.getDst().getIpv6AddressNoZone() == null, "Inconsistent ip addresses: %s, %s", gre.getSrc(),
gre.getDst());
return false;
}
}
- private String getAddressString(final IpAddress addr) {
- return addr.getIpv4Address() == null
- ? addr.getIpv6Address().getValue()
- : addr.getIpv4Address().getValue();
+ private String getAddressString(final IpAddressNoZone addr) {
+ return addr.getIpv4AddressNoZone() == null
+ ? addr.getIpv6AddressNoZone().getValue()
+ : addr.getIpv4AddressNoZone().getValue();
}
private void deleteGreTunnel(final InstanceIdentifier<Gre> id, final String swIfName, final Gre gre,
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanCustomizer.java
index 98b5250e7..b0387d1b6 100644
--- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanCustomizer.java
+++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanCustomizer.java
@@ -31,7 +31,7 @@ import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import java.net.InetAddress;
import java.util.concurrent.CompletionStage;
import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfaceType;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev180703.L2Input;
@@ -134,21 +134,21 @@ public class VxlanCustomizer extends AbstractInterfaceTypeCustomizer<Vxlan> impl
}
private boolean isIpv6(final Vxlan vxlan) {
- if (vxlan.getSrc().getIpv4Address() == null) {
- checkArgument(vxlan.getDst().getIpv4Address() == null, "Inconsistent ip addresses: %s, %s", vxlan.getSrc(),
+ if (vxlan.getSrc().getIpv4AddressNoZone() == null) {
+ checkArgument(vxlan.getDst().getIpv4AddressNoZone() == null, "Inconsistent ip addresses: %s, %s", vxlan.getSrc(),
vxlan.getDst());
return true;
} else {
- checkArgument(vxlan.getDst().getIpv6Address() == null, "Inconsistent ip addresses: %s, %s", vxlan.getSrc(),
+ checkArgument(vxlan.getDst().getIpv6AddressNoZone() == null, "Inconsistent ip addresses: %s, %s", vxlan.getSrc(),
vxlan.getDst());
return false;
}
}
- private String getAddressString(final IpAddress addr) {
- return addr.getIpv4Address() == null
- ? addr.getIpv6Address().getValue()
- : addr.getIpv4Address().getValue();
+ private String getAddressString(final IpAddressNoZone addr) {
+ return addr.getIpv4AddressNoZone() == null
+ ? addr.getIpv6AddressNoZone().getValue()
+ : addr.getIpv4AddressNoZone().getValue();
}
private void deleteVxlanTunnel(final InstanceIdentifier<Vxlan> id, final String swIfName, final Vxlan vxlan,
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizer.java
index fb9b50abc..ac21c4dbd 100644
--- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizer.java
+++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizer.java
@@ -31,7 +31,7 @@ import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import java.net.InetAddress;
import java.util.concurrent.CompletionStage;
import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfaceType;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev180703.VxlanGpeTunnel;
@@ -118,23 +118,23 @@ public class VxlanGpeCustomizer extends AbstractInterfaceTypeCustomizer<VxlanGpe
}
private boolean isIpv6(final VxlanGpe vxlanGpe) {
- if (vxlanGpe.getLocal().getIpv4Address() == null) {
- checkArgument(vxlanGpe.getRemote().getIpv4Address() == null, "Inconsistent ip addresses: %s, %s",
+ if (vxlanGpe.getLocal().getIpv4AddressNoZone() == null) {
+ checkArgument(vxlanGpe.getRemote().getIpv4AddressNoZone() == null, "Inconsistent ip addresses: %s, %s",
vxlanGpe.getLocal(),
vxlanGpe.getRemote());
return true;
} else {
- checkArgument(vxlanGpe.getRemote().getIpv6Address() == null, "Inconsistent ip addresses: %s, %s",
+ checkArgument(vxlanGpe.getRemote().getIpv6AddressNoZone() == null, "Inconsistent ip addresses: %s, %s",
vxlanGpe.getLocal(),
vxlanGpe.getRemote());
return false;
}
}
- private String getAddressString(final IpAddress addr) {
- return addr.getIpv4Address() == null
- ? addr.getIpv6Address().getValue()
- : addr.getIpv4Address().getValue();
+ private String getAddressString(final IpAddressNoZone addr) {
+ return addr.getIpv4AddressNoZone() == null
+ ? addr.getIpv6AddressNoZone().getValue()
+ : addr.getIpv4AddressNoZone().getValue();
}
private void deleteVxlanGpeTunnel(final InstanceIdentifier<VxlanGpe> id, final String swIfName,
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/GreCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/GreCustomizer.java
index 9da185b3f..737b4c5db 100644
--- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/GreCustomizer.java
+++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/GreCustomizer.java
@@ -34,7 +34,7 @@ import io.fd.vpp.jvpp.core.dto.GreTunnelDump;
import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import java.util.concurrent.CompletionStage;
import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev180703.GreTunnel;
@@ -113,11 +113,11 @@ public class GreCustomizer extends FutureJVppCustomizer
final GreTunnelDetails swInterfaceGreDetails = reply.greTunnelDetails.get(0);
if (swInterfaceGreDetails.isIpv6 == 1) {
- builder.setDst(new IpAddress(arrayToIpv6AddressNoZone(swInterfaceGreDetails.dstAddress)));
- builder.setSrc(new IpAddress(arrayToIpv6AddressNoZone(swInterfaceGreDetails.srcAddress)));
+ builder.setDst(new IpAddressNoZone(arrayToIpv6AddressNoZone(swInterfaceGreDetails.dstAddress)));
+ builder.setSrc(new IpAddressNoZone(arrayToIpv6AddressNoZone(swInterfaceGreDetails.srcAddress)));
} else {
- builder.setDst(new IpAddress(arrayToIpv4AddressNoZone(swInterfaceGreDetails.dstAddress)));
- builder.setSrc(new IpAddress(arrayToIpv4AddressNoZone(swInterfaceGreDetails.srcAddress)));
+ builder.setDst(new IpAddressNoZone(arrayToIpv4AddressNoZone(swInterfaceGreDetails.dstAddress)));
+ builder.setSrc(new IpAddressNoZone(arrayToIpv4AddressNoZone(swInterfaceGreDetails.srcAddress)));
}
builder.setOuterFibId((long) swInterfaceGreDetails.outerFibId);
LOG.debug("Gre tunnel: {}, id: {} attributes read as: {}", key.getName(), index, builder);
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanCustomizer.java
index 38497a122..22448ac41 100644
--- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanCustomizer.java
+++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanCustomizer.java
@@ -36,7 +36,7 @@ import io.fd.vpp.jvpp.core.dto.VxlanTunnelDump;
import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import java.util.concurrent.CompletionStage;
import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev180703.L2Input;
@@ -119,11 +119,11 @@ public class VxlanCustomizer extends FutureJVppCustomizer
final VxlanTunnelDetails swInterfaceVxlanDetails = reply.vxlanTunnelDetails.get(0);
if (swInterfaceVxlanDetails.isIpv6 == 1) {
- builder.setDst(new IpAddress(arrayToIpv6AddressNoZone(swInterfaceVxlanDetails.dstAddress)));
- builder.setSrc(new IpAddress(arrayToIpv6AddressNoZone(swInterfaceVxlanDetails.srcAddress)));
+ builder.setDst(new IpAddressNoZone(arrayToIpv6AddressNoZone(swInterfaceVxlanDetails.dstAddress)));
+ builder.setSrc(new IpAddressNoZone(arrayToIpv6AddressNoZone(swInterfaceVxlanDetails.srcAddress)));
} else {
- builder.setDst(new IpAddress(arrayToIpv4AddressNoZone(swInterfaceVxlanDetails.dstAddress)));
- builder.setSrc(new IpAddress(arrayToIpv4AddressNoZone(swInterfaceVxlanDetails.srcAddress)));
+ builder.setDst(new IpAddressNoZone(arrayToIpv4AddressNoZone(swInterfaceVxlanDetails.dstAddress)));
+ builder.setSrc(new IpAddressNoZone(arrayToIpv4AddressNoZone(swInterfaceVxlanDetails.srcAddress)));
}
builder.setEncapVrfId(new VniReference(UnsignedInts.toLong(swInterfaceVxlanDetails.encapVrfId)));
builder.setVni(new VxlanVni(UnsignedInts.toLong(swInterfaceVxlanDetails.vni)));
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanGpeCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanGpeCustomizer.java
index 3bdfc87b3..448087fa2 100644
--- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanGpeCustomizer.java
+++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanGpeCustomizer.java
@@ -35,7 +35,7 @@ import io.fd.vpp.jvpp.core.dto.VxlanGpeTunnelDump;
import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import java.util.concurrent.CompletionStage;
import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev180703.VppInterfaceAugmentation;
@@ -118,11 +118,11 @@ public class VxlanGpeCustomizer extends FutureJVppCustomizer
final VxlanGpeTunnelDetails swInterfaceVxlanGpeDetails = reply.vxlanGpeTunnelDetails.get(0);
if (swInterfaceVxlanGpeDetails.isIpv6 == 1) {
- builder.setRemote(new IpAddress(arrayToIpv6AddressNoZone(swInterfaceVxlanGpeDetails.remote)));
- builder.setLocal(new IpAddress(arrayToIpv6AddressNoZone(swInterfaceVxlanGpeDetails.local)));
+ builder.setRemote(new IpAddressNoZone(arrayToIpv6AddressNoZone(swInterfaceVxlanGpeDetails.remote)));
+ builder.setLocal(new IpAddressNoZone(arrayToIpv6AddressNoZone(swInterfaceVxlanGpeDetails.local)));
} else {
- builder.setRemote(new IpAddress(arrayToIpv4AddressNoZone(swInterfaceVxlanGpeDetails.remote)));
- builder.setLocal(new IpAddress(arrayToIpv4AddressNoZone(swInterfaceVxlanGpeDetails.local)));
+ builder.setRemote(new IpAddressNoZone(arrayToIpv4AddressNoZone(swInterfaceVxlanGpeDetails.remote)));
+ builder.setLocal(new IpAddressNoZone(arrayToIpv4AddressNoZone(swInterfaceVxlanGpeDetails.local)));
}
builder.setVni(new VxlanGpeVni((long) swInterfaceVxlanGpeDetails.vni));
builder.setNextProtocol(VxlanGpeNextProtocol.forValue(swInterfaceVxlanGpeDetails.protocol));
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2/ArpTerminationTableEntryCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2/ArpTerminationTableEntryCustomizer.java
index 4dc31335b..930fe3ec9 100644
--- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2/ArpTerminationTableEntryCustomizer.java
+++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2/ArpTerminationTableEntryCustomizer.java
@@ -30,7 +30,7 @@ import io.fd.vpp.jvpp.core.dto.BdIpMacAddDelReply;
import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import java.util.concurrent.CompletionStage;
import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev180703.bridge.domain.attributes.arp.termination.table.ArpTerminationTableEntry;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev180703.bridge.domain.attributes.arp.termination.table.ArpTerminationTableEntryKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev180703.bridge.domains.BridgeDomain;
@@ -96,7 +96,7 @@ public class ArpTerminationTableEntryCustomizer extends FutureJVppCustomizer
request.isAdd = booleanToByte(isAdd);
request.macAddress = parseMac(entry.getPhysAddress().getValue());
- final IpAddress ipAddress = entry.getIpAddress();
+ final IpAddressNoZone ipAddress = entry.getIpAddress();
request.ipAddress = ipAddressToArray(ipAddress);
request.isIpv6 = booleanToByte(isIpv6(ipAddress));