summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2017-03-03 08:20:02 +0100
committerMarek Gradzki <mgradzki@cisco.com>2017-03-03 08:22:45 +0100
commitaa2919c2bd6dcad22212a1bd123988e09daf1e38 (patch)
tree5de90a8555975978a3a45ce12320081c77372482
parent04e2552072b7d209d6c35a37e0aa48f2c1fc4b47 (diff)
Remove vrfId cfg from Ipv4NeighbourCustomizer
Follows vpp change: https://gerrit.fd.io/r/#/c/5522/ Change-Id: I881ffab2f7a417020334605426e2c9fdd3a4b028 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/ip/v4/Ipv4NeighbourCustomizer.java25
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/ip/v6/Ipv6NeighbourCustomizer.java23
2 files changed, 3 insertions, 45 deletions
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/ip/v4/Ipv4NeighbourCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/ip/v4/Ipv4NeighbourCustomizer.java
index aedd44286..b758a7c14 100644
--- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/ip/v4/Ipv4NeighbourCustomizer.java
+++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/ip/v4/Ipv4NeighbourCustomizer.java
@@ -16,7 +16,6 @@
package io.fd.hc2vpp.v3po.interfaces.ip.v4;
-import com.google.common.base.Optional;
import io.fd.hc2vpp.common.translate.util.AddressTranslator;
import io.fd.hc2vpp.common.translate.util.ByteDataTranslator;
import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
@@ -33,8 +32,6 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces._interface.Ipv4;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces._interface.ipv4.Neighbor;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces._interface.ipv4.NeighborKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev161214.RoutingBaseAttributes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev161214.VppInterfaceAugmentation;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -70,9 +67,6 @@ public class Ipv4NeighbourCustomizer extends FutureJVppCustomizer
request.macAddress = parseMac(data.getLinkLayerAddress().getValue());
request.swIfIndex = interfaceContext
.getIndex(id.firstKeyOf(Interface.class).getName(), writeContext.getMappingContext());
-
- bindVrfIfSpecified(writeContext, id, request);
-
return request;
}, getFutureJVpp());
LOG.debug("Neighbour {} successfully written", id);
@@ -99,27 +93,8 @@ public class Ipv4NeighbourCustomizer extends FutureJVppCustomizer
request.macAddress = parseMac(data.getLinkLayerAddress().getValue());
request.swIfIndex = interfaceContext
.getIndex(id.firstKeyOf(Interface.class).getName(), writeContext.getMappingContext());
-
- bindVrfIfSpecified(writeContext, id, request);
-
return request;
}, getFutureJVpp());
LOG.debug("Neighbour {} successfully deleted", id);
}
-
- private void bindVrfIfSpecified(final WriteContext writeContext,
- final InstanceIdentifier<Neighbor> id,
- IpNeighborAddDel request) {
- final Optional<Interface> optIface = writeContext.readBefore(id.firstIdentifierOf(Interface.class));
-
- // if routing set, reads vrf-id
- // uses java.util.Optional(its internal behaviour suites this use better than guava one)
- if (optIface.isPresent()) {
- java.util.Optional.of(optIface.get())
- .map(iface -> iface.getAugmentation(VppInterfaceAugmentation.class))
- .map(VppInterfaceAugmentation::getRouting)
- .map(RoutingBaseAttributes::getIpv4VrfId)
- .ifPresent(vrf -> request.vrfId = vrf.byteValue());
- }
- }
} \ No newline at end of file
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/ip/v6/Ipv6NeighbourCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/ip/v6/Ipv6NeighbourCustomizer.java
index b6948b508..2d94e653b 100644
--- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/ip/v6/Ipv6NeighbourCustomizer.java
+++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/ip/v6/Ipv6NeighbourCustomizer.java
@@ -20,7 +20,6 @@ import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
-import com.google.common.base.Optional;
import io.fd.hc2vpp.common.translate.util.AddressTranslator;
import io.fd.hc2vpp.common.translate.util.ByteDataTranslator;
import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
@@ -36,8 +35,6 @@ import javax.annotation.Nonnull;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces._interface.ipv6.Neighbor;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces._interface.ipv6.NeighborKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev161214.RoutingBaseAttributes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev161214.VppInterfaceAugmentation;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -70,8 +67,7 @@ public class Ipv6NeighbourCustomizer extends FutureJVppCustomizer
"Mapping does not contains mapping for provider interface name ".concat(interfaceName));
LOG.debug("Parent interface index found");
- addDelNeighbourAndReply(id, true,
- interfaceContext.getIndex(interfaceName, mappingContext), dataAfter, writeContext);
+ addDelNeighbourAndReply(id, true, interfaceContext.getIndex(interfaceName, mappingContext), dataAfter);
LOG.debug("Neighbour successfully written");
}
@@ -99,13 +95,12 @@ public class Ipv6NeighbourCustomizer extends FutureJVppCustomizer
LOG.debug("Parent interface[{}] index found", interfaceName);
- addDelNeighbourAndReply(id, false,
- interfaceContext.getIndex(interfaceName, mappingContext), dataBefore, writeContext);
+ addDelNeighbourAndReply(id, false, interfaceContext.getIndex(interfaceName, mappingContext), dataBefore);
LOG.debug("Neighbour {} successfully deleted", id);
}
private void addDelNeighbourAndReply(InstanceIdentifier<Neighbor> id, boolean add, int parentInterfaceIndex,
- Neighbor data, WriteContext writeContext) throws WriteFailedException {
+ Neighbor data) throws WriteFailedException {
IpNeighborAddDel request = new IpNeighborAddDel();
@@ -115,18 +110,6 @@ public class Ipv6NeighbourCustomizer extends FutureJVppCustomizer
request.dstAddress = ipv6AddressNoZoneToArray(data.getIp());
request.macAddress = parseMac(data.getLinkLayerAddress().getValue());
request.swIfIndex = parentInterfaceIndex;
-
- final Optional<Interface> optIface = writeContext.readBefore(id.firstIdentifierOf(Interface.class));
-
- // if routing set, reads vrf-id
- // uses java.util.Optional(its internal behaviour suites this use better than guava one)
- if (optIface.isPresent()) {
- java.util.Optional.of(optIface.get())
- .map(iface -> iface.getAugmentation(VppInterfaceAugmentation.class))
- .map(VppInterfaceAugmentation::getRouting)
- .map(RoutingBaseAttributes::getIpv6VrfId)
- .ifPresent(vrf -> request.vrfId = vrf.byteValue());
- }
getReplyForWrite(getFutureJVpp().ipNeighborAddDel(request).toCompletableFuture(), id);
}
}