summaryrefslogtreecommitdiffstats
path: root/dhcp/dhcp-impl/src
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2018-06-29 14:36:59 +0200
committerMarek Gradzki <mgradzki@cisco.com>2018-07-02 09:14:58 +0000
commitc428881044008b3865c8e934dd53240b43c084f1 (patch)
treee837648703bd2350280f2f4c2a6940ad96d3001b /dhcp/dhcp-impl/src
parentae927860249b060ed4f9a8e0f3df8df7ec2e269c (diff)
HC2VPP-348: use vpp-fib-management module instead of FIB table index
Change-Id: Iba1f6d4c556c8ef839eb309b990f32945e6494fb Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'dhcp/dhcp-impl/src')
-rw-r--r--dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/read/DhcpReaderFactory.java12
-rw-r--r--dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/read/DhcpRelayCustomizer.java23
-rw-r--r--dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/write/DhcpRelayCustomizer.java12
-rw-r--r--dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/write/DhcpWriterFactory.java8
-rw-r--r--dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/helpers/SchemaContextTestHelper.java2
-rw-r--r--dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/read/DhcpRelayCustomizerTest.java27
-rw-r--r--dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/write/DhcpRelayCustomizerTest.java19
-rw-r--r--dhcp/dhcp-impl/src/test/resources/relay/ipv4DhcpRelay.json2
-rw-r--r--dhcp/dhcp-impl/src/test/resources/relay/ipv6DhcpRelayAfter.json2
-rw-r--r--dhcp/dhcp-impl/src/test/resources/relay/ipv6DhcpRelayBefore.json2
10 files changed, 56 insertions, 53 deletions
diff --git a/dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/read/DhcpReaderFactory.java b/dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/read/DhcpReaderFactory.java
index 83b737057..f2f02efef 100644
--- a/dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/read/DhcpReaderFactory.java
+++ b/dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/read/DhcpReaderFactory.java
@@ -23,12 +23,12 @@ import io.fd.honeycomb.translate.read.ReaderFactory;
import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder;
import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.Dhcp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.DhcpBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.dhcp.attributes.Relays;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.dhcp.attributes.RelaysBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.dhcp.attributes.relays.Relay;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.relay.attributes.Server;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.Dhcp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.DhcpBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.dhcp.attributes.Relays;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.dhcp.attributes.RelaysBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.dhcp.attributes.relays.Relay;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.relay.attributes.Server;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
/**
diff --git a/dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/read/DhcpRelayCustomizer.java b/dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/read/DhcpRelayCustomizer.java
index e055a2b36..064133453 100644
--- a/dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/read/DhcpRelayCustomizer.java
+++ b/dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/read/DhcpRelayCustomizer.java
@@ -40,13 +40,14 @@ import java.util.concurrent.CompletionStage;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
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.vpp.dhcp.rev180103.Ipv4;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.Ipv6;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.dhcp.attributes.RelaysBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.dhcp.attributes.relays.Relay;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.dhcp.attributes.relays.RelayBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.dhcp.attributes.relays.RelayKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.relay.attributes.ServerBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.dhcp.attributes.RelaysBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.dhcp.attributes.relays.Relay;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.dhcp.attributes.relays.RelayBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.dhcp.attributes.relays.RelayKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.relay.attributes.ServerBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.fib.table.management.rev180521.Ipv4;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.fib.table.management.rev180521.Ipv6;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.fib.table.management.rev180521.VniReference;
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -96,7 +97,7 @@ final class DhcpRelayCustomizer extends FutureJVppCustomizer
return dump.get().dhcpProxyDetails.stream().map(detail -> new RelayKey(detail.isIpv6 == 1
? Ipv6.class
: Ipv4.class,
- UnsignedInts.toLong(detail.rxVrfId))).collect(Collectors.toList());
+ new VniReference(UnsignedInts.toLong(detail.rxVrfId)))).collect(Collectors.toList());
}
@Override
@@ -121,17 +122,17 @@ final class DhcpRelayCustomizer extends FutureJVppCustomizer
final RelayKey key = id.firstKeyOf(Relay.class);
- final byte isIpv6 = (byte) (Ipv6.class == key.getAddressType()
+ final byte isIpv6 = (byte) (Ipv6.class == key.getAddressFamily()
? 1
: 0);
- final int rxVrfId = key.getRxVrfId().intValue();
+ final int rxVrfId = key.getRxVrfId().getValue().intValue();
final java.util.Optional<DhcpProxyDetails> result =
dump.get().dhcpProxyDetails.stream().filter(d -> d.isIpv6 == isIpv6 && d.rxVrfId == rxVrfId).findFirst();
if (result.isPresent()) {
final DhcpProxyDetails detail = result.get();
- builder.setAddressType(key.getAddressType());
+ builder.setAddressFamily(key.getAddressFamily());
builder.setRxVrfId(key.getRxVrfId());
final boolean isIp6 = byteToBoolean(detail.isIpv6);
builder.setGatewayAddress(readAddress(detail.dhcpSrcAddress, isIp6));
diff --git a/dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/write/DhcpRelayCustomizer.java b/dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/write/DhcpRelayCustomizer.java
index a506f72f1..46ab48db1 100644
--- a/dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/write/DhcpRelayCustomizer.java
+++ b/dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/write/DhcpRelayCustomizer.java
@@ -31,10 +31,10 @@ import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import java.util.List;
import javax.annotation.Nonnull;
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.vpp.dhcp.rev180103.Ipv6;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.dhcp.attributes.relays.Relay;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.dhcp.attributes.relays.RelayKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.relay.attributes.Server;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.dhcp.attributes.relays.Relay;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.dhcp.attributes.relays.RelayKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.relay.attributes.Server;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.fib.table.management.rev180521.Ipv6;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -98,8 +98,8 @@ final class DhcpRelayCustomizer extends FutureJVppCustomizer implements ListWrit
final boolean isAdd)
throws WriteFailedException {
final DhcpProxyConfig request = new DhcpProxyConfig();
- request.rxVrfId = relay.getRxVrfId().byteValue();
- final boolean isIpv6 = Ipv6.class == relay.getAddressType();
+ request.rxVrfId = relay.getRxVrfId().getValue().byteValue();
+ final boolean isIpv6 = Ipv6.class == relay.getAddressFamily();
request.isIpv6 = booleanToByte(isIpv6);
request.serverVrfId = server.getVrfId().intValue();
request.isAdd = booleanToByte(isAdd);
diff --git a/dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/write/DhcpWriterFactory.java b/dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/write/DhcpWriterFactory.java
index e69449811..4ee5cbc92 100644
--- a/dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/write/DhcpWriterFactory.java
+++ b/dhcp/dhcp-impl/src/main/java/io/fd/hc2vpp/dhcp/write/DhcpWriterFactory.java
@@ -23,10 +23,10 @@ import io.fd.honeycomb.translate.write.WriterFactory;
import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder;
import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.Dhcp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.dhcp.attributes.Relays;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.dhcp.attributes.relays.Relay;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.relay.attributes.Server;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.Dhcp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.dhcp.attributes.Relays;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.dhcp.attributes.relays.Relay;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.relay.attributes.Server;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
/**
diff --git a/dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/helpers/SchemaContextTestHelper.java b/dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/helpers/SchemaContextTestHelper.java
index bb417eef1..3c1cdadeb 100644
--- a/dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/helpers/SchemaContextTestHelper.java
+++ b/dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/helpers/SchemaContextTestHelper.java
@@ -27,7 +27,7 @@ public interface SchemaContextTestHelper extends InjectablesProcessor {
default ModuleInfoBackedContext getSchemaContext() {
return provideSchemaContextFor(ImmutableSet.of(
// dhcp
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.$YangModuleInfoImpl
+ org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.$YangModuleInfoImpl
.getInstance()
));
}
diff --git a/dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/read/DhcpRelayCustomizerTest.java b/dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/read/DhcpRelayCustomizerTest.java
index 904a2a208..500063d5a 100644
--- a/dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/read/DhcpRelayCustomizerTest.java
+++ b/dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/read/DhcpRelayCustomizerTest.java
@@ -31,24 +31,25 @@ import io.fd.vpp.jvpp.core.dto.DhcpProxyDump;
import io.fd.vpp.jvpp.core.types.DhcpServer;
import java.util.List;
import org.junit.Test;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.Dhcp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.Ipv4;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.Ipv6;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.dhcp.attributes.Relays;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.dhcp.attributes.RelaysBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.dhcp.attributes.relays.Relay;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.dhcp.attributes.relays.RelayBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.dhcp.attributes.relays.RelayKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.relay.attributes.Server;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.Dhcp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.dhcp.attributes.Relays;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.dhcp.attributes.RelaysBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.dhcp.attributes.relays.Relay;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.dhcp.attributes.relays.RelayBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.dhcp.attributes.relays.RelayKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.relay.attributes.Server;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.fib.table.management.rev180521.Ipv4;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.fib.table.management.rev180521.Ipv6;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.fib.table.management.rev180521.VniReference;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
public class DhcpRelayCustomizerTest extends InitializingListReaderCustomizerTest<Relay, RelayKey, RelayBuilder> {
private static InstanceIdentifier<Relays> RELAYS = InstanceIdentifier.create(Dhcp.class).child(Relays.class);
private KeyedInstanceIdentifier<Relay, RelayKey> IP4_IID =
- RELAYS.child(Relay.class, new RelayKey(Ipv4.class, 123L));
+ RELAYS.child(Relay.class, new RelayKey(Ipv4.class, new VniReference(123L)));
private KeyedInstanceIdentifier<Relay, RelayKey> IP6_IID =
- RELAYS.child(Relay.class, new RelayKey(Ipv6.class, 321L));
+ RELAYS.child(Relay.class, new RelayKey(Ipv6.class, new VniReference(321L)));
public DhcpRelayCustomizerTest() {
super(Relay.class, RelaysBuilder.class);
}
@@ -104,7 +105,7 @@ public class DhcpRelayCustomizerTest extends InitializingListReaderCustomizerTes
public void testReadIp4() throws ReadFailedException {
final RelayBuilder builder = new RelayBuilder();
getCustomizer().readCurrentAttributes(IP4_IID, builder, ctx);
- assertEquals(IP4_IID.getKey().getAddressType(), builder.getAddressType());
+ assertEquals(IP4_IID.getKey().getAddressFamily(), builder.getAddressFamily());
assertEquals(IP4_IID.getKey().getRxVrfId(), builder.getRxVrfId());
assertArrayEquals("1.2.3.4".toCharArray(), builder.getGatewayAddress().getValue());
final List<Server> server = builder.getServer();
@@ -119,7 +120,7 @@ public class DhcpRelayCustomizerTest extends InitializingListReaderCustomizerTes
public void testReadIp6() throws ReadFailedException {
final RelayBuilder builder = new RelayBuilder();
getCustomizer().readCurrentAttributes(IP6_IID, builder, ctx);
- assertEquals(IP6_IID.getKey().getAddressType(), builder.getAddressType());
+ assertEquals(IP6_IID.getKey().getAddressFamily(), builder.getAddressFamily());
assertEquals(IP6_IID.getKey().getRxVrfId(), builder.getRxVrfId());
assertEquals(22L, builder.getServer().get(0).getVrfId().longValue());
assertArrayEquals("2001:db8:a0b:12f0::1".toCharArray(), builder.getGatewayAddress().getValue());
diff --git a/dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/write/DhcpRelayCustomizerTest.java b/dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/write/DhcpRelayCustomizerTest.java
index 29ceb43f9..4e4e02f35 100644
--- a/dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/write/DhcpRelayCustomizerTest.java
+++ b/dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/write/DhcpRelayCustomizerTest.java
@@ -29,13 +29,14 @@ import io.fd.vpp.jvpp.core.dto.DhcpProxyConfig;
import io.fd.vpp.jvpp.core.dto.DhcpProxyConfigReply;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.AddressFamily;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.Dhcp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.Ipv4;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.Ipv6;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.dhcp.attributes.Relays;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.dhcp.attributes.relays.Relay;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.dhcp.attributes.relays.RelayKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.Dhcp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.dhcp.attributes.Relays;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.dhcp.attributes.relays.Relay;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.dhcp.attributes.relays.RelayKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.fib.table.management.rev180521.AddressFamilyIdentity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.fib.table.management.rev180521.Ipv4;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.fib.table.management.rev180521.Ipv6;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.fib.table.management.rev180521.VniReference;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@RunWith(HoneycombTestRunner.class)
@@ -106,7 +107,7 @@ public class DhcpRelayCustomizerTest extends WriterCustomizerTest implements Sch
verify(api).dhcpProxyConfig(request);
}
- private InstanceIdentifier<Relay> getId(final long rxVrfId, final Class<? extends AddressFamily> addressType) {
- return RELAYS_IID.child(Relay.class, new RelayKey(addressType, rxVrfId));
+ private InstanceIdentifier<Relay> getId(final long rxVrfId, final Class<? extends AddressFamilyIdentity> addressType) {
+ return RELAYS_IID.child(Relay.class, new RelayKey(addressType, new VniReference(rxVrfId)));
}
} \ No newline at end of file
diff --git a/dhcp/dhcp-impl/src/test/resources/relay/ipv4DhcpRelay.json b/dhcp/dhcp-impl/src/test/resources/relay/ipv4DhcpRelay.json
index 2c7dda289..6d7ca6392 100644
--- a/dhcp/dhcp-impl/src/test/resources/relay/ipv4DhcpRelay.json
+++ b/dhcp/dhcp-impl/src/test/resources/relay/ipv4DhcpRelay.json
@@ -2,7 +2,7 @@
"relays": {
"relay": [
{
- "address-type": "ipv4",
+ "address-family": "vpp-fib-table-management:ipv4",
"rx-vrf-id": 0,
"gateway-address": "5.6.7.8",
"server" : [
diff --git a/dhcp/dhcp-impl/src/test/resources/relay/ipv6DhcpRelayAfter.json b/dhcp/dhcp-impl/src/test/resources/relay/ipv6DhcpRelayAfter.json
index 7c2518b54..c1ebc52ec 100644
--- a/dhcp/dhcp-impl/src/test/resources/relay/ipv6DhcpRelayAfter.json
+++ b/dhcp/dhcp-impl/src/test/resources/relay/ipv6DhcpRelayAfter.json
@@ -2,7 +2,7 @@
"relays": {
"relay": [
{
- "address-type": "ipv6",
+ "address-family": "vpp-fib-table-management:ipv6",
"rx-vrf-id": 1,
"gateway-address": "2001::2",
"server" : [
diff --git a/dhcp/dhcp-impl/src/test/resources/relay/ipv6DhcpRelayBefore.json b/dhcp/dhcp-impl/src/test/resources/relay/ipv6DhcpRelayBefore.json
index 94f7c6558..149a6e83e 100644
--- a/dhcp/dhcp-impl/src/test/resources/relay/ipv6DhcpRelayBefore.json
+++ b/dhcp/dhcp-impl/src/test/resources/relay/ipv6DhcpRelayBefore.json
@@ -2,7 +2,7 @@
"relays": {
"relay": [
{
- "address-type": "ipv6",
+ "address-family": "vpp-fib-table-management:ipv6",
"rx-vrf-id": 1,
"gateway-address": "2001::2",
"server" : [