summaryrefslogtreecommitdiffstats
path: root/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizer.java
diff options
context:
space:
mode:
authorTibor Král <tibor.kral@pantheon.tech>2019-05-14 12:19:44 +0200
committerMichal Cmarada <mcmarada@cisco.com>2019-05-27 08:25:05 +0200
commit5c416ebacf4baad25de6213661c3cdfff31c0482 (patch)
treed2fe4889f01e4adbdeb50ea83b47aa44102a5f49 /v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizer.java
parent83206cb1b6b0a6a3bbe45d646ed69a5f2b587fed (diff)
HC2VPP-381: Validation support for V3PO module
Change-Id: If288d97dce15bcc6924d4dd65c640a20920f094d Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
Diffstat (limited to 'v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizer.java')
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizer.java24
1 files changed, 7 insertions, 17 deletions
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 d61f50b09..b3629415b 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
@@ -16,8 +16,6 @@
package io.fd.hc2vpp.v3po.interfaces;
-import static com.google.common.base.Preconditions.checkArgument;
-
import io.fd.hc2vpp.common.translate.util.AbstractInterfaceTypeCustomizer;
import io.fd.hc2vpp.common.translate.util.AddressTranslator;
import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer;
@@ -90,8 +88,9 @@ public class VxlanGpeCustomizer extends AbstractInterfaceTypeCustomizer<VxlanGpe
LOG.debug("Setting VxlanGpe tunnel for interface: {}. VxlanGpe: {}", swIfName, vxlanGpe);
final CompletionStage<VxlanGpeAddDelTunnelReply> VxlanGpeAddDelTunnelReplyCompletionStage =
- getFutureJVpp().vxlanGpeAddDelTunnel(getVxlanGpeTunnelRequest((byte) 1 /* is add */, vxlanGpe.getLocal(),
- vxlanGpe.getRemote(), vni, protocol, encapVrfId, decapVrfId, isIpv6));
+ getFutureJVpp()
+ .vxlanGpeAddDelTunnel(getVxlanGpeTunnelRequest((byte) 1 /* is add */, vxlanGpe.getLocal(),
+ vxlanGpe.getRemote(), vni, protocol, encapVrfId, decapVrfId, isIpv6));
final VxlanGpeAddDelTunnelReply reply =
getReplyForCreate(VxlanGpeAddDelTunnelReplyCompletionStage.toCompletableFuture(), id, vxlanGpe);
@@ -115,17 +114,8 @@ public class VxlanGpeCustomizer extends AbstractInterfaceTypeCustomizer<VxlanGpe
}
private boolean isIpv6(final VxlanGpe vxlanGpe) {
- 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().getIpv6AddressNoZone() == null, "Inconsistent ip addresses: %s, %s",
- vxlanGpe.getLocal(),
- vxlanGpe.getRemote());
- return false;
- }
+ return vxlanGpe.getLocal().getIpv4AddressNoZone() == null;
+
}
private void deleteVxlanGpeTunnel(final InstanceIdentifier<VxlanGpe> id, final String swIfName,
@@ -143,8 +133,8 @@ public class VxlanGpeCustomizer extends AbstractInterfaceTypeCustomizer<VxlanGpe
LOG.debug("Deleting VxlanGpe tunnel for interface: {}. VxlanGpe: {}", swIfName, vxlanGpe);
final CompletionStage<VxlanGpeAddDelTunnelReply> VxlanGpeAddDelTunnelReplyCompletionStage =
getFutureJVpp()
- .vxlanGpeAddDelTunnel(getVxlanGpeTunnelRequest((byte) 0 /* is delete */, vxlanGpe.getLocal(),
- vxlanGpe.getRemote(), vni, protocol, encapVrfId, decapVrfId, isIpv6));
+ .vxlanGpeAddDelTunnel(getVxlanGpeTunnelRequest((byte) 0 /* is delete */, vxlanGpe.getLocal(),
+ vxlanGpe.getRemote(), vni, protocol, encapVrfId, decapVrfId, isIpv6));
getReplyForDelete(VxlanGpeAddDelTunnelReplyCompletionStage.toCompletableFuture(), id);
final int index = interfaceNamingContext.getIndex(swIfName, writeContext.getMappingContext());
// Mark this interface as disabled to not include it in operational reads