diff options
author | Jan Srnicek <jsrnicek@cisco.com> | 2017-03-14 08:53:19 +0100 |
---|---|---|
committer | Marek Gradzki <mgradzki@cisco.com> | 2017-03-14 13:16:14 +0000 |
commit | b54f6dc31761d4a2f9d951fc551b11d9047eac56 (patch) | |
tree | 6e1fd8bad42d854b4b56b14e19d8d579c3533e47 | |
parent | 7cd72b1af72e6069b20de2a959ec4caa0210b5c4 (diff) |
HC2VPP-30 - Lisp control plane impl
Add new nodes
- rloc-probe/ing
- map-server/s
- map-request-mode
- petr-cfg use
Also adds new nodes to local-mapping
- key
- key type
Change-Id: Ia50767a8fcbba4cd954ef94f7a08369ac01436a0
Signed-off-by: Jan Srnicek <jsrnicek@cisco.com>
33 files changed, 2850 insertions, 536 deletions
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/LispModule.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/LispModule.java index 90ca83343..5e674f52b 100644 --- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/LispModule.java +++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/LispModule.java @@ -35,10 +35,12 @@ import io.fd.hc2vpp.lisp.translate.read.factory.EidTableReaderFactory; import io.fd.hc2vpp.lisp.translate.read.factory.LispStateReaderFactory; import io.fd.hc2vpp.lisp.translate.read.factory.LocatorSetReaderFactory; import io.fd.hc2vpp.lisp.translate.read.factory.MapResolverReaderFactory; +import io.fd.hc2vpp.lisp.translate.read.factory.MapServerReaderFactory; import io.fd.hc2vpp.lisp.translate.write.factory.EidTableWriterFactory; import io.fd.hc2vpp.lisp.translate.write.factory.LispWriterFactory; import io.fd.hc2vpp.lisp.translate.write.factory.LocatorSetWriterFactory; import io.fd.hc2vpp.lisp.translate.write.factory.MapResolverWriterFactory; +import io.fd.hc2vpp.lisp.translate.write.factory.MapServerWriterFactory; import io.fd.honeycomb.translate.read.ReaderFactory; import io.fd.honeycomb.translate.write.WriterFactory; import net.jmob.guice.conf.core.ConfigurationModule; @@ -81,6 +83,7 @@ public class LispModule extends AbstractModule { readerFactoryBinder.addBinding().to(EidTableReaderFactory.class); readerFactoryBinder.addBinding().to(LocatorSetReaderFactory.class); readerFactoryBinder.addBinding().to(MapResolverReaderFactory.class); + readerFactoryBinder.addBinding().to(MapServerReaderFactory.class); LOG.info("Reader factories binded"); LOG.info("Binding writer factories"); @@ -89,6 +92,7 @@ public class LispModule extends AbstractModule { writerFactoryBinder.addBinding().to(EidTableWriterFactory.class); writerFactoryBinder.addBinding().to(LocatorSetWriterFactory.class); writerFactoryBinder.addBinding().to(MapResolverWriterFactory.class); + writerFactoryBinder.addBinding().to(MapServerWriterFactory.class); LOG.info("Writer factories binded"); final Multibinder<ReaderFactory> readerBinder = Multibinder.newSetBinder(binder(), ReaderFactory.class); diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/AbstractLispInfraFactoryBase.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/AbstractLispInfraFactoryBase.java index eeda656bc..022ea19ed 100644 --- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/AbstractLispInfraFactoryBase.java +++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/AbstractLispInfraFactoryBase.java @@ -27,11 +27,16 @@ import com.google.inject.name.Named; import io.fd.hc2vpp.common.translate.util.NamingContext; import io.fd.hc2vpp.lisp.context.util.AdjacenciesMappingContext; import io.fd.hc2vpp.lisp.context.util.EidMappingContext; +import io.fd.honeycomb.translate.impl.write.GenericWriter; +import io.fd.honeycomb.translate.spi.write.WriterCustomizer; import io.fd.vpp.jvpp.core.future.FutureJVppCore; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.Lisp; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.LispState; +import org.opendaylight.yangtools.yang.binding.DataObject; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import javax.annotation.Nonnull; + /** * Basic attributes for lisp writer factories @@ -68,4 +73,10 @@ public abstract class AbstractLispInfraFactoryBase { @Inject @Named(ADJACENCIES_IDENTIFICATION_CONTEXT) protected AdjacenciesMappingContext adjacenciesMappingContext; + + @Nonnull + protected <D extends DataObject> GenericWriter<D> writer(@Nonnull final InstanceIdentifier<D> type, + @Nonnull final WriterCustomizer<D> customizer) { + return new GenericWriter<>(type, customizer); + } } diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/LocalMappingCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/LocalMappingCustomizer.java index 44f5f2dd2..69df09c80 100755 --- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/LocalMappingCustomizer.java +++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/LocalMappingCustomizer.java @@ -35,6 +35,7 @@ import io.fd.vpp.jvpp.core.dto.LispEidTableDetailsReplyDump; import io.fd.vpp.jvpp.core.future.FutureJVppCore; import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.eid.mapping.context.rev160801.contexts.eid.mapping.context.mappings.mapping.Eid; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.Address; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.HmacKeyType; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.MappingId; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.dp.subtable.grouping.LocalMappings; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.dp.subtable.grouping.LocalMappingsBuilder; @@ -42,6 +43,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.dp.subtable.grouping.local.mappings.LocalMappingBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.dp.subtable.grouping.local.mappings.LocalMappingKey; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.eid.table.grouping.eid.table.VniTable; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.hmac.key.grouping.HmacKeyBuilder; import org.opendaylight.yangtools.concepts.Builder; import org.opendaylight.yangtools.yang.binding.DataObject; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; @@ -133,6 +135,16 @@ public class LocalMappingCustomizer builder.setLocatorSet(locatorSetContext.getName(details.locatorSetIndex, ctx.getMappingContext())); builder.setKey(new LocalMappingKey(new MappingId(id.firstKeyOf(LocalMapping.class).getId()))); builder.setEid(getArrayAsEidLocal(valueOf(details.eidType), details.eid, details.vni)); + + if (details.key != null) { + builder.setHmacKey( + new HmacKeyBuilder() + .setKey(toString(details.key)) + .setKeyType(HmacKeyType.forValue(details.keyId)) + .build()); + } else { + builder.setHmacKey(new HmacKeyBuilder().setKeyType(HmacKeyType.NoKey).build()); + } } private Address getAddressFromDumpDetail(final LispEidTableDetails detail) { diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/MapRegisterCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/MapRegisterCustomizer.java new file mode 100644 index 000000000..e94bb92f0 --- /dev/null +++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/MapRegisterCustomizer.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * + * 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 io.fd.hc2vpp.lisp.translate.read; + +import io.fd.hc2vpp.common.translate.util.ByteDataTranslator; +import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer; +import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer; +import io.fd.hc2vpp.lisp.translate.read.init.LispInitPathsMapper; +import io.fd.honeycomb.translate.read.ReadContext; +import io.fd.honeycomb.translate.read.ReadFailedException; +import io.fd.honeycomb.translate.spi.read.Initialized; +import io.fd.honeycomb.translate.spi.read.InitializingReaderCustomizer; +import io.fd.vpp.jvpp.core.dto.ShowLispMapRegisterState; +import io.fd.vpp.jvpp.core.dto.ShowLispMapRegisterStateReply; +import io.fd.vpp.jvpp.core.future.FutureJVppCore; +import javax.annotation.Nonnull; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.Lisp; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.lisp.feature.data.grouping.LispFeatureData; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.lisp.feature.data.grouping.LispFeatureDataBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.register.grouping.MapRegister; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.register.grouping.MapRegisterBuilder; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +public class MapRegisterCustomizer extends FutureJVppCustomizer + implements InitializingReaderCustomizer<MapRegister, MapRegisterBuilder>, ByteDataTranslator, + JvppReplyConsumer, LispInitPathsMapper { + + public MapRegisterCustomizer(@Nonnull FutureJVppCore futureJVppCore) { + super(futureJVppCore); + } + + @Nonnull + @Override + public MapRegisterBuilder getBuilder(@Nonnull InstanceIdentifier<MapRegister> instanceIdentifier) { + return new MapRegisterBuilder(); + } + + @Override + public void readCurrentAttributes(@Nonnull InstanceIdentifier<MapRegister> instanceIdentifier, + @Nonnull MapRegisterBuilder mapRegisterBuilder, + @Nonnull ReadContext readContext) throws ReadFailedException { + final ShowLispMapRegisterStateReply read = getReplyForRead(getFutureJVpp() + .showLispMapRegisterState(new ShowLispMapRegisterState()).toCompletableFuture(), instanceIdentifier); + + if (read != null) { + mapRegisterBuilder.setEnabled(byteToBoolean(read.isEnabled)); + } + } + + @Override + public void merge(@Nonnull Builder<? extends DataObject> builder, @Nonnull MapRegister mapRegister) { + LispFeatureDataBuilder.class.cast(builder).setMapRegister(mapRegister); + } + + @Nonnull + @Override + public Initialized<? extends DataObject> init(@Nonnull final InstanceIdentifier<MapRegister> instanceIdentifier, + @Nonnull final MapRegister mapRegister, + @Nonnull final ReadContext readContext) { + return Initialized.create(lispFeaturesBasePath().child(MapRegister.class), mapRegister); + } +} diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/MapRequestModeCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/MapRequestModeCustomizer.java new file mode 100644 index 000000000..9de5b5c68 --- /dev/null +++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/MapRequestModeCustomizer.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * + * 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 io.fd.hc2vpp.lisp.translate.read; + +import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer; +import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer; +import io.fd.hc2vpp.lisp.translate.read.init.LispInitPathsMapper; +import io.fd.honeycomb.translate.read.ReadContext; +import io.fd.honeycomb.translate.read.ReadFailedException; +import io.fd.honeycomb.translate.spi.read.Initialized; +import io.fd.honeycomb.translate.spi.read.InitializingReaderCustomizer; +import io.fd.vpp.jvpp.core.dto.ShowLispMapRequestMode; +import io.fd.vpp.jvpp.core.dto.ShowLispMapRequestModeReply; +import io.fd.vpp.jvpp.core.future.FutureJVppCore; +import javax.annotation.Nonnull; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.lisp.feature.data.grouping.LispFeatureDataBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.request.mode.grouping.MapRequestMode; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.request.mode.grouping.MapRequestModeBuilder; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +public class MapRequestModeCustomizer extends FutureJVppCustomizer + implements InitializingReaderCustomizer<MapRequestMode, MapRequestModeBuilder>, + JvppReplyConsumer, LispInitPathsMapper { + + public MapRequestModeCustomizer(@Nonnull FutureJVppCore futureJVppCore) { + super(futureJVppCore); + } + + @Nonnull + @Override + public MapRequestModeBuilder getBuilder(@Nonnull InstanceIdentifier<MapRequestMode> instanceIdentifier) { + return new MapRequestModeBuilder(); + } + + @Override + public void readCurrentAttributes(@Nonnull InstanceIdentifier<MapRequestMode> instanceIdentifier, + @Nonnull MapRequestModeBuilder mapRequestModeBuilder, + @Nonnull ReadContext readContext) throws ReadFailedException { + final ShowLispMapRequestModeReply reply = getReplyForRead( + getFutureJVpp().showLispMapRequestMode(new ShowLispMapRequestMode()).toCompletableFuture(), + instanceIdentifier); + + if (reply != null) { + mapRequestModeBuilder.setMode( + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.MapRequestMode + .forValue(reply.mode)); + } + } + + @Override + public void merge(@Nonnull Builder<? extends DataObject> builder, + @Nonnull MapRequestMode mapRequestMode) { + LispFeatureDataBuilder.class.cast(builder).setMapRequestMode(mapRequestMode); + } + + @Nonnull + @Override + public Initialized<? extends DataObject> init(@Nonnull InstanceIdentifier<MapRequestMode> instanceIdentifier, + @Nonnull MapRequestMode mapRequestMode, + @Nonnull ReadContext readContext) { + return Initialized.create(lispFeaturesBasePath().child(MapRequestMode.class), mapRequestMode); + } +} diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/MapServerCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/MapServerCustomizer.java new file mode 100644 index 000000000..8e53f265d --- /dev/null +++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/MapServerCustomizer.java @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * + * 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 io.fd.hc2vpp.lisp.translate.read; + +import static io.fd.honeycomb.translate.util.read.cache.EntityDumpExecutor.NO_PARAMS; + +import com.google.common.base.Optional; +import io.fd.hc2vpp.common.translate.util.AddressTranslator; +import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer; +import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer; +import io.fd.honeycomb.translate.read.ReadContext; +import io.fd.honeycomb.translate.read.ReadFailedException; +import io.fd.honeycomb.translate.spi.read.Initialized; +import io.fd.honeycomb.translate.spi.read.InitializingListReaderCustomizer; +import io.fd.honeycomb.translate.util.RWUtils; +import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager; +import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager.DumpCacheManagerBuilder; +import io.fd.vpp.jvpp.core.dto.LispMapServerDetails; +import io.fd.vpp.jvpp.core.dto.LispMapServerDetailsReplyDump; +import io.fd.vpp.jvpp.core.dto.LispMapServerDump; +import io.fd.vpp.jvpp.core.future.FutureJVppCore; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +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.IpAddress; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.Lisp; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.lisp.feature.data.grouping.LispFeatureData; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.servers.grouping.MapServers; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.servers.grouping.MapServersBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.servers.grouping.map.servers.MapServer; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.servers.grouping.map.servers.MapServerBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.servers.grouping.map.servers.MapServerKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +public class MapServerCustomizer extends FutureJVppCustomizer + implements InitializingListReaderCustomizer<MapServer, MapServerKey, MapServerBuilder>, JvppReplyConsumer, + AddressTranslator { + + private final DumpCacheManager<LispMapServerDetailsReplyDump, Void> dumpManager; + + public MapServerCustomizer(@Nonnull FutureJVppCore futureJVppCore) { + super(futureJVppCore); + dumpManager = new DumpCacheManagerBuilder<LispMapServerDetailsReplyDump, Void>() + .acceptOnly(LispMapServerDetailsReplyDump.class) + .withExecutor((instanceIdentifier, aVoid) -> + getReplyForRead(getFutureJVpp() + .lispMapServerDump(new LispMapServerDump()).toCompletableFuture(), instanceIdentifier)) + .build(); + } + + @Nonnull + @Override + public Initialized<? extends DataObject> init(@Nonnull InstanceIdentifier<MapServer> instanceIdentifier, + @Nonnull MapServer mapServer, + @Nonnull ReadContext readContext) { + final InstanceIdentifier<MapServer> configId = InstanceIdentifier.create(Lisp.class) + .child(LispFeatureData.class) + .child(MapServers.class) + .child(MapServer.class, instanceIdentifier.firstKeyOf(MapServer.class)); + + return Initialized.create(configId, mapServer); + } + + @Nonnull + @Override + public List<MapServerKey> getAllIds(@Nonnull InstanceIdentifier<MapServer> instanceIdentifier, + @Nonnull ReadContext readContext) throws ReadFailedException { + + final Optional<LispMapServerDetailsReplyDump> dump = + dumpManager.getDump(instanceIdentifier, readContext.getModificationCache(), NO_PARAMS); + + if (dump.isPresent() && dump.get().lispMapServerDetails != null) { + return dump.get().lispMapServerDetails.stream() + .map(detail -> arrayToIpAddress(byteToBoolean(detail.isIpv6), detail.ipAddress)) + .map(MapServerKey::new) + .collect(Collectors.toList()); + } + + return Collections.emptyList(); + } + + @Override + public void merge(@Nonnull Builder<? extends DataObject> builder, @Nonnull List<MapServer> list) { + MapServersBuilder.class.cast(builder).setMapServer(list); + } + + @Nonnull + @Override + public MapServerBuilder getBuilder(@Nonnull InstanceIdentifier<MapServer> instanceIdentifier) { + return new MapServerBuilder(); + } + + @Override + public void readCurrentAttributes(@Nonnull InstanceIdentifier<MapServer> instanceIdentifier, + @Nonnull MapServerBuilder mapServerBuilder, @Nonnull ReadContext readContext) + throws ReadFailedException { + final Optional<LispMapServerDetailsReplyDump> dump = + dumpManager.getDump(instanceIdentifier, readContext.getModificationCache(), NO_PARAMS); + + if (dump.isPresent() && dump.get().lispMapServerDetails != null) { + final IpAddress currentAddress = instanceIdentifier.firstKeyOf(MapServer.class).getIpAddress(); + + final LispMapServerDetails currentDetail = dump.get().lispMapServerDetails.stream() + .filter(detail -> Arrays.equals(currentAddress.getValue(), + arrayToIpAddress(byteToBoolean(detail.isIpv6), detail.ipAddress).getValue())) + .collect(RWUtils.singleItemCollector()); + + mapServerBuilder + .setIpAddress(arrayToIpAddress(byteToBoolean(currentDetail.isIpv6), currentDetail.ipAddress)); + + } + } +} diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/PetrCfgCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/PetrCfgCustomizer.java new file mode 100644 index 000000000..0e27a0ee8 --- /dev/null +++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/PetrCfgCustomizer.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * + * 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 io.fd.hc2vpp.lisp.translate.read; + +import io.fd.hc2vpp.common.translate.util.AddressTranslator; +import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer; +import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer; +import io.fd.hc2vpp.lisp.translate.read.init.LispInitPathsMapper; +import io.fd.honeycomb.translate.read.ReadContext; +import io.fd.honeycomb.translate.read.ReadFailedException; +import io.fd.honeycomb.translate.spi.read.Initialized; +import io.fd.honeycomb.translate.spi.read.InitializingReaderCustomizer; +import io.fd.vpp.jvpp.core.dto.ShowLispUsePetr; +import io.fd.vpp.jvpp.core.dto.ShowLispUsePetrReply; +import io.fd.vpp.jvpp.core.future.FutureJVppCore; +import javax.annotation.Nonnull; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.lisp.feature.data.grouping.LispFeatureDataBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.use.petr.cfg.grouping.PetrCfg; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.use.petr.cfg.grouping.PetrCfgBuilder; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +public class PetrCfgCustomizer extends FutureJVppCustomizer + implements InitializingReaderCustomizer<PetrCfg, PetrCfgBuilder>, JvppReplyConsumer, + AddressTranslator, LispInitPathsMapper { + + public PetrCfgCustomizer(@Nonnull FutureJVppCore futureJVppCore) { + super(futureJVppCore); + } + + @Nonnull + @Override + public Initialized<? extends DataObject> init(@Nonnull InstanceIdentifier<PetrCfg> instanceIdentifier, + @Nonnull PetrCfg petrCfg, + @Nonnull ReadContext readContext) { + return Initialized.create(lispFeaturesBasePath().child(PetrCfg.class), petrCfg); + } + + @Nonnull + @Override + public PetrCfgBuilder getBuilder(@Nonnull InstanceIdentifier<PetrCfg> instanceIdentifier) { + return new PetrCfgBuilder(); + } + + @Override + public void readCurrentAttributes(@Nonnull InstanceIdentifier<PetrCfg> instanceIdentifier, + @Nonnull PetrCfgBuilder petrCfgBuilder, + @Nonnull ReadContext readContext) throws ReadFailedException { + final ShowLispUsePetrReply read = getReplyForRead(getFutureJVpp().showLispUsePetr(new ShowLispUsePetr()) + .toCompletableFuture(), instanceIdentifier); + + if (read != null && read.status != 0) { + // TODO - https://jira.fd.io/browse/VPP-660 - returns address back in bad form + petrCfgBuilder.setPetrAddress(arrayToIpAddress(!byteToBoolean(read.isIp4), read.address)); + } + } + + @Override + public void merge(@Nonnull Builder<? extends DataObject> builder, @Nonnull PetrCfg petrCfg) { + LispFeatureDataBuilder.class.cast(builder).setPetrCfg(petrCfg); + } +} diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/RlocProbeCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/RlocProbeCustomizer.java new file mode 100644 index 000000000..bd0070141 --- /dev/null +++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/RlocProbeCustomizer.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * + * 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 io.fd.hc2vpp.lisp.translate.read; + +import io.fd.hc2vpp.common.translate.util.ByteDataTranslator; +import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer; +import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer; +import io.fd.hc2vpp.lisp.translate.read.init.LispInitPathsMapper; +import io.fd.honeycomb.translate.read.ReadContext; +import io.fd.honeycomb.translate.read.ReadFailedException; +import io.fd.honeycomb.translate.spi.read.Initialized; +import io.fd.honeycomb.translate.spi.read.InitializingReaderCustomizer; +import io.fd.vpp.jvpp.core.dto.ShowLispRlocProbeState; +import io.fd.vpp.jvpp.core.dto.ShowLispRlocProbeStateReply; +import io.fd.vpp.jvpp.core.future.FutureJVppCore; +import javax.annotation.Nonnull; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.lisp.feature.data.grouping.LispFeatureDataBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.rloc.probing.grouping.RlocProbe; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.rloc.probing.grouping.RlocProbeBuilder; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +public class RlocProbeCustomizer extends FutureJVppCustomizer + implements InitializingReaderCustomizer<RlocProbe, RlocProbeBuilder>, JvppReplyConsumer, ByteDataTranslator, + LispInitPathsMapper { + + public RlocProbeCustomizer(@Nonnull FutureJVppCore futureJVppCore) { + super(futureJVppCore); + } + + @Nonnull + @Override + public RlocProbeBuilder getBuilder(@Nonnull InstanceIdentifier<RlocProbe> instanceIdentifier) { + return new RlocProbeBuilder(); + } + + @Override + public void readCurrentAttributes(@Nonnull InstanceIdentifier<RlocProbe> instanceIdentifier, + @Nonnull RlocProbeBuilder rlocProbeBuilder, + @Nonnull ReadContext readContext) throws ReadFailedException { + final ShowLispRlocProbeStateReply read = getReplyForRead(getFutureJVpp() + .showLispRlocProbeState(new ShowLispRlocProbeState()).toCompletableFuture(), instanceIdentifier); + + if (read != null) { + rlocProbeBuilder.setEnabled(byteToBoolean(read.isEnabled)); + } + } + + @Override + public void merge(@Nonnull Builder<? extends DataObject> builder, @Nonnull RlocProbe rlocProbe) { + LispFeatureDataBuilder.class.cast(builder).setRlocProbe(rlocProbe); + } + + @Nonnull + @Override + public Initialized<? extends DataObject> init(@Nonnull InstanceIdentifier<RlocProbe> instanceIdentifier, + @Nonnull RlocProbe rlocProbe, + @Nonnull ReadContext readContext) { + return Initialized.create(lispFeaturesBasePath().child(RlocProbe.class), rlocProbe); + } +} diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/factory/LispStateReaderFactory.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/factory/LispStateReaderFactory.java index 345fe46ad..b7bd37588 100755 --- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/factory/LispStateReaderFactory.java +++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/factory/LispStateReaderFactory.java @@ -18,18 +18,25 @@ package io.fd.hc2vpp.lisp.translate.read.factory; import io.fd.hc2vpp.lisp.translate.AbstractLispInfraFactoryBase; import io.fd.hc2vpp.lisp.translate.read.LispStateCustomizer; +import io.fd.hc2vpp.lisp.translate.read.MapRegisterCustomizer; +import io.fd.hc2vpp.lisp.translate.read.MapRequestModeCustomizer; +import io.fd.hc2vpp.lisp.translate.read.PetrCfgCustomizer; import io.fd.hc2vpp.lisp.translate.read.PitrCfgCustomizer; +import io.fd.hc2vpp.lisp.translate.read.RlocProbeCustomizer; import io.fd.honeycomb.translate.impl.read.GenericInitReader; import io.fd.honeycomb.translate.read.ReaderFactory; import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder; +import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.LispState; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.lisp.feature.data.grouping.LispFeatureData; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.lisp.feature.data.grouping.LispFeatureDataBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.register.grouping.MapRegister; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.request.mode.grouping.MapRequestMode; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.pitr.cfg.grouping.PitrCfg; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.rloc.probing.grouping.RlocProbe; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.use.petr.cfg.grouping.PetrCfg; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -import javax.annotation.Nonnull; - /** * Initialize readers for {@link LispState} @@ -37,6 +44,8 @@ import javax.annotation.Nonnull; public class LispStateReaderFactory extends AbstractLispInfraFactoryBase implements ReaderFactory { private static final InstanceIdentifier<LispState> lispStateId = InstanceIdentifier.create(LispState.class); + static final InstanceIdentifier<LispFeatureData> + LISP_FEATURE_ID = lispStateId.child(LispFeatureData.class); @Override public void init(@Nonnull final ModifiableReaderRegistryBuilder registry) { @@ -44,7 +53,19 @@ public class LispStateReaderFactory extends AbstractLispInfraFactoryBase impleme registry.add(new GenericInitReader<>(lispStateId, new LispStateCustomizer(vppApi))); registry.addStructuralReader(lispStateId.child(LispFeatureData.class), LispFeatureDataBuilder.class); - registry.add(new GenericInitReader<>(lispStateId.child(LispFeatureData.class).child(PitrCfg.class), + registry.add(new GenericInitReader<>(LISP_FEATURE_ID.child(PitrCfg.class), new PitrCfgCustomizer(vppApi))); + + registry.add(new GenericInitReader<>(LISP_FEATURE_ID.child(RlocProbe.class), + new RlocProbeCustomizer(vppApi))); + + registry.add(new GenericInitReader<>(LISP_FEATURE_ID.child(PetrCfg.class), + new PetrCfgCustomizer(vppApi))); + + registry.add(new GenericInitReader<>(LISP_FEATURE_ID.child(MapRegister.class), + new MapRegisterCustomizer(vppApi))); + + registry.add(new GenericInitReader<>(LISP_FEATURE_ID.child(MapRequestMode.class), + new MapRequestModeCustomizer(vppApi))); } } diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/factory/MapServerReaderFactory.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/factory/MapServerReaderFactory.java new file mode 100644 index 000000000..1af8f939f --- /dev/null +++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/factory/MapServerReaderFactory.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * + * 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 io.fd.hc2vpp.lisp.translate.read.factory; + + +import static io.fd.hc2vpp.lisp.translate.read.factory.LispStateReaderFactory.LISP_FEATURE_ID; + +import io.fd.hc2vpp.lisp.translate.AbstractLispInfraFactoryBase; +import io.fd.hc2vpp.lisp.translate.read.MapServerCustomizer; +import io.fd.honeycomb.translate.impl.read.GenericInitListReader; +import io.fd.honeycomb.translate.read.ReaderFactory; +import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder; +import javax.annotation.Nonnull; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.servers.grouping.MapServers; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.servers.grouping.MapServersBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.servers.grouping.map.servers.MapServer; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +public class MapServerReaderFactory extends AbstractLispInfraFactoryBase implements ReaderFactory { + + private static final InstanceIdentifier<MapServers> MAP_SERVERS_ID = LISP_FEATURE_ID.child(MapServers.class); + + @Override + public void init(@Nonnull final ModifiableReaderRegistryBuilder registry) { + registry.addStructuralReader(MAP_SERVERS_ID, MapServersBuilder.class); + registry.add(new GenericInitListReader<>(MAP_SERVERS_ID.child(MapServer.class), + new MapServerCustomizer(vppApi))); + } +} diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/LocalMappingCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/LocalMappingCustomizer.java index e2943c670..494afd3cb 100755 --- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/LocalMappingCustomizer.java +++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/LocalMappingCustomizer.java @@ -22,26 +22,28 @@ import static io.fd.hc2vpp.lisp.translate.read.dump.executor.params.MappingsDump import static io.fd.hc2vpp.lisp.translate.read.dump.executor.params.MappingsDumpParams.EidType.IPV6; import static java.nio.charset.StandardCharsets.UTF_8; +import io.fd.hc2vpp.common.translate.util.ByteDataTranslator; +import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer; +import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer; import io.fd.hc2vpp.lisp.context.util.EidMappingContext; import io.fd.hc2vpp.lisp.translate.read.trait.MappingProducer; import io.fd.hc2vpp.lisp.translate.util.EidTranslator; import io.fd.honeycomb.translate.spi.write.ListWriterCustomizer; -import io.fd.hc2vpp.common.translate.util.ByteDataTranslator; -import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer; -import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer; import io.fd.honeycomb.translate.write.WriteContext; import io.fd.honeycomb.translate.write.WriteFailedException; +import io.fd.vpp.jvpp.VppBaseCallException; +import io.fd.vpp.jvpp.core.dto.LispAddDelLocalEid; +import io.fd.vpp.jvpp.core.future.FutureJVppCore; import java.io.UnsupportedEncodingException; +import java.nio.charset.StandardCharsets; import java.util.concurrent.TimeoutException; import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.MappingId; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.dp.subtable.grouping.local.mappings.LocalMapping; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.dp.subtable.grouping.local.mappings.LocalMappingKey; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.eid.table.grouping.eid.table.VniTable; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.hmac.key.grouping.HmacKey; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -import io.fd.vpp.jvpp.VppBaseCallException; -import io.fd.vpp.jvpp.core.dto.LispAddDelLocalEid; -import io.fd.vpp.jvpp.core.future.FutureJVppCore; /** @@ -129,6 +131,14 @@ public class LocalMappingCustomizer extends FutureJVppCustomizer request.prefixLen = (byte) 128; } + final HmacKey hmacKey = data.getHmacKey(); + if (hmacKey != null) { + request.key = checkNotNull(hmacKey.getKey(), "HMAC key not specified") + .getBytes(StandardCharsets.UTF_8); + request.keyId = (byte) checkNotNull(hmacKey.getKeyType(), + "HMAC key type not specified").getIntValue(); + } + getReply(getFutureJVpp().lispAddDelLocalEid(request).toCompletableFuture()); } diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/MapRegisterCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/MapRegisterCustomizer.java new file mode 100644 index 000000000..1dac298a3 --- /dev/null +++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/MapRegisterCustomizer.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * + * 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 io.fd.hc2vpp.lisp.translate.write; + +import io.fd.hc2vpp.common.translate.util.ByteDataTranslator; +import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer; +import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer; +import io.fd.honeycomb.translate.spi.write.WriterCustomizer; +import io.fd.honeycomb.translate.write.WriteContext; +import io.fd.honeycomb.translate.write.WriteFailedException; +import io.fd.vpp.jvpp.core.dto.LispMapRegisterEnableDisable; +import io.fd.vpp.jvpp.core.future.FutureJVppCore; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.register.grouping.MapRegister; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +import javax.annotation.Nonnull; + +public class MapRegisterCustomizer extends FutureJVppCustomizer + implements WriterCustomizer<MapRegister>, ByteDataTranslator, JvppReplyConsumer { + + public MapRegisterCustomizer(@Nonnull FutureJVppCore futureJVppCore) { + super(futureJVppCore); + } + + @Override + public void writeCurrentAttributes(@Nonnull InstanceIdentifier<MapRegister> instanceIdentifier, + @Nonnull MapRegister mapRegister, + @Nonnull WriteContext writeContext) throws WriteFailedException { + enableDisableMapRegister(mapRegister.isEnabled(), instanceIdentifier); + } + + @Override + public void updateCurrentAttributes(@Nonnull InstanceIdentifier<MapRegister> instanceIdentifier, + @Nonnull MapRegister mapRegisterBefore, + @Nonnull MapRegister mapRegisterAfter, @Nonnull + WriteContext writeContext) throws WriteFailedException { + enableDisableMapRegister(mapRegisterAfter.isEnabled(), instanceIdentifier); + } + + @Override + public void deleteCurrentAttributes(@Nonnull InstanceIdentifier<MapRegister> instanceIdentifier, + @Nonnull MapRegister mapRegister, + @Nonnull WriteContext writeContext) throws WriteFailedException { + enableDisableMapRegister(false, instanceIdentifier); + } + + private void enableDisableMapRegister(final boolean enable, @Nonnull final InstanceIdentifier<MapRegister> id) throws WriteFailedException { + LispMapRegisterEnableDisable request = new LispMapRegisterEnableDisable(); + request.isEnabled = booleanToByte(enable); + getReplyForWrite(getFutureJVpp().lispMapRegisterEnableDisable(request).toCompletableFuture(), id); + } +} diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/MapRequestModeCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/MapRequestModeCustomizer.java new file mode 100644 index 000000000..0e069504d --- /dev/null +++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/MapRequestModeCustomizer.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * + * 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 io.fd.hc2vpp.lisp.translate.write; + +import static com.google.common.base.Preconditions.checkNotNull; + +import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer; +import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer; +import io.fd.honeycomb.translate.spi.write.WriterCustomizer; +import io.fd.honeycomb.translate.write.WriteContext; +import io.fd.honeycomb.translate.write.WriteFailedException; +import io.fd.vpp.jvpp.core.dto.LispMapRequestMode; +import io.fd.vpp.jvpp.core.dto.LispMapRequestModeReply; +import io.fd.vpp.jvpp.core.future.FutureJVppCore; +import java.util.concurrent.CompletableFuture; +import javax.annotation.Nonnull; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.request.mode.grouping.MapRequestMode; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class MapRequestModeCustomizer extends FutureJVppCustomizer + implements WriterCustomizer<MapRequestMode>, JvppReplyConsumer { + + private static final Logger LOG = LoggerFactory.getLogger(MapRequestModeCustomizer.class); + + public MapRequestModeCustomizer(@Nonnull FutureJVppCore futureJVppCore) { + super(futureJVppCore); + } + + @Override + public void writeCurrentAttributes(@Nonnull InstanceIdentifier<MapRequestMode> instanceIdentifier, + @Nonnull MapRequestMode mapRequestMode, + @Nonnull WriteContext writeContext) throws WriteFailedException { + getReplyForWrite(mapRequestModeRequestFuture(mapRequestMode), instanceIdentifier); + } + + @Override + public void updateCurrentAttributes(@Nonnull InstanceIdentifier<MapRequestMode> instanceIdentifier, + @Nonnull MapRequestMode mapRequestModeBefore, + @Nonnull MapRequestMode mapRequestModeAfter, @Nonnull WriteContext writeContext) + throws WriteFailedException { + getReplyForUpdate(mapRequestModeRequestFuture(mapRequestModeAfter), instanceIdentifier, + mapRequestModeBefore, mapRequestModeAfter); + } + + @Override + public void deleteCurrentAttributes(@Nonnull InstanceIdentifier<MapRequestMode> instanceIdentifier, + @Nonnull MapRequestMode mapRequestMode, + @Nonnull WriteContext writeContext) throws WriteFailedException { + //TODO - after HC2VPP-115 - change to throw UnsupportedOperationException + LOG.error("Map request mode cannot be deleted, ignoring"); + } + + private CompletableFuture<LispMapRequestModeReply> mapRequestModeRequestFuture( + @Nonnull final MapRequestMode mapRequestMode) { + LispMapRequestMode request = new LispMapRequestMode(); + request.mode = (byte) checkNotNull(mapRequestMode.getMode(), + "Mode not specified").getIntValue(); + return getFutureJVpp().lispMapRequestMode(request).toCompletableFuture(); + } +} diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/MapServerCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/MapServerCustomizer.java new file mode 100644 index 000000000..9697e16bc --- /dev/null +++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/MapServerCustomizer.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * + * 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 io.fd.hc2vpp.lisp.translate.write; + +import io.fd.hc2vpp.common.translate.util.AddressTranslator; +import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer; +import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer; +import io.fd.honeycomb.translate.spi.write.ListWriterCustomizer; +import io.fd.honeycomb.translate.write.WriteContext; +import io.fd.honeycomb.translate.write.WriteFailedException; +import io.fd.vpp.jvpp.core.dto.LispAddDelMapServer; +import io.fd.vpp.jvpp.core.future.FutureJVppCore; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.servers.grouping.map.servers.MapServer; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.servers.grouping.map.servers.MapServerKey; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +import javax.annotation.Nonnull; + +public class MapServerCustomizer extends FutureJVppCustomizer + implements ListWriterCustomizer<MapServer, MapServerKey>, AddressTranslator, + JvppReplyConsumer { + + public MapServerCustomizer(@Nonnull FutureJVppCore futureJVppCore) { + super(futureJVppCore); + } + + @Override + public void writeCurrentAttributes(@Nonnull InstanceIdentifier<MapServer> instanceIdentifier, + @Nonnull MapServer mapServer, + @Nonnull WriteContext writeContext) throws WriteFailedException { + addDelMapServer(true, instanceIdentifier, mapServer); + } + + @Override + public void updateCurrentAttributes(@Nonnull InstanceIdentifier<MapServer> instanceIdentifier, + @Nonnull MapServer mapServerBefore, + @Nonnull MapServer mapServerAfter, + @Nonnull WriteContext writeContext) throws WriteFailedException { + throw new WriteFailedException.UpdateFailedException(instanceIdentifier, mapServerBefore, mapServerAfter, + new UnsupportedOperationException("Not supported")); + } + + @Override + public void deleteCurrentAttributes(@Nonnull InstanceIdentifier<MapServer> instanceIdentifier, @Nonnull MapServer mapServer, @Nonnull WriteContext writeContext) throws WriteFailedException { + addDelMapServer(false, instanceIdentifier, mapServer); + } + + private void addDelMapServer(final boolean add, + @Nonnull final InstanceIdentifier<MapServer> id, + @Nonnull final MapServer data) throws WriteFailedException { + LispAddDelMapServer request = new LispAddDelMapServer(); + + final IpAddress ipAddress = data.getIpAddress(); + + request.isAdd = booleanToByte(add); + request.isIpv6 = booleanToByte(isIpv6(ipAddress)); + request.ipAddress = ipAddressToArray(ipAddress); + + getReplyForWrite(getFutureJVpp().lispAddDelMapServer(request).toCompletableFuture(), id); + } +} diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/PetrCfgCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/PetrCfgCustomizer.java new file mode 100644 index 000000000..d3a381490 --- /dev/null +++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/PetrCfgCustomizer.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * + * 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 io.fd.hc2vpp.lisp.translate.write; + +import io.fd.hc2vpp.common.translate.util.AddressTranslator; +import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer; +import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer; +import io.fd.honeycomb.translate.spi.write.WriterCustomizer; +import io.fd.honeycomb.translate.write.WriteContext; +import io.fd.honeycomb.translate.write.WriteFailedException; +import io.fd.vpp.jvpp.core.dto.LispUsePetr; +import io.fd.vpp.jvpp.core.future.FutureJVppCore; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; + +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.use.petr.cfg.grouping.PetrCfg; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +import javax.annotation.Nonnull; + +import static com.google.common.base.Preconditions.checkNotNull; + +public class PetrCfgCustomizer extends FutureJVppCustomizer + implements WriterCustomizer<PetrCfg>, AddressTranslator, JvppReplyConsumer { + + public PetrCfgCustomizer(@Nonnull FutureJVppCore futureJVppCore) { + super(futureJVppCore); + } + + @Override + public void writeCurrentAttributes(@Nonnull InstanceIdentifier<PetrCfg> instanceIdentifier, + @Nonnull PetrCfg petrCfg, + @Nonnull WriteContext writeContext) throws WriteFailedException { + enablePetrCfg(instanceIdentifier, petrCfg); + } + + @Override + public void updateCurrentAttributes(@Nonnull InstanceIdentifier<PetrCfg> instanceIdentifier, + @Nonnull PetrCfg petrCfgBefore, + @Nonnull PetrCfg petrCfgAfter, + @Nonnull WriteContext writeContext) throws WriteFailedException { + if (petrCfgAfter.getPetrAddress() != null) { + enablePetrCfg(instanceIdentifier, petrCfgAfter); + } else { + disablePetrCfg(instanceIdentifier); + } + } + + @Override + public void deleteCurrentAttributes(@Nonnull InstanceIdentifier<PetrCfg> instanceIdentifier, @Nonnull PetrCfg petrCfg, @Nonnull WriteContext writeContext) throws WriteFailedException { + disablePetrCfg(instanceIdentifier); + } + + private void enablePetrCfg(@Nonnull final InstanceIdentifier<PetrCfg> id, @Nonnull final PetrCfg data) throws WriteFailedException { + LispUsePetr request = new LispUsePetr(); + + final IpAddress petrAddress = checkNotNull(data.getPetrAddress(), "PETR address not defined"); + request.isAdd = 1; + request.address = ipAddressToArray(petrAddress); + request.isIp4 = booleanToByte(!isIpv6(petrAddress)); + getReplyForWrite(getFutureJVpp().lispUsePetr(request).toCompletableFuture(), id); + } + + private void disablePetrCfg(@Nonnull final InstanceIdentifier<PetrCfg> id) throws WriteFailedException { + LispUsePetr request = new LispUsePetr(); + request.isAdd = 0; + getReplyForDelete(getFutureJVpp().lispUsePetr(request).toCompletableFuture(), id); + } +} diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/RlocProbeCustomizer.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/RlocProbeCustomizer.java new file mode 100644 index 000000000..b240d1d2e --- /dev/null +++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/RlocProbeCustomizer.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * + * 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 io.fd.hc2vpp.lisp.translate.write; + +import io.fd.hc2vpp.common.translate.util.ByteDataTranslator; +import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer; +import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer; +import io.fd.honeycomb.translate.spi.write.WriterCustomizer; +import io.fd.honeycomb.translate.write.WriteContext; +import io.fd.honeycomb.translate.write.WriteFailedException; +import io.fd.vpp.jvpp.core.dto.LispRlocProbeEnableDisable; +import io.fd.vpp.jvpp.core.future.FutureJVppCore; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.rloc.probing.grouping.RlocProbe; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +import javax.annotation.Nonnull; + +public class RlocProbeCustomizer extends FutureJVppCustomizer + implements WriterCustomizer<RlocProbe>, ByteDataTranslator, JvppReplyConsumer { + + public RlocProbeCustomizer(@Nonnull FutureJVppCore futureJVppCore) { + super(futureJVppCore); + } + + @Override + public void writeCurrentAttributes(@Nonnull InstanceIdentifier<RlocProbe> instanceIdentifier, + @Nonnull RlocProbe rlocProbe, + @Nonnull WriteContext writeContext) throws WriteFailedException { + enableDisableRlocProbe(rlocProbe.isEnabled(), instanceIdentifier); + } + + @Override + public void updateCurrentAttributes(@Nonnull InstanceIdentifier<RlocProbe> instanceIdentifier, + @Nonnull RlocProbe rlocProbeBefore, + @Nonnull RlocProbe rlocProbeAfter, + @Nonnull WriteContext writeContext) throws WriteFailedException { + enableDisableRlocProbe(rlocProbeAfter.isEnabled(), instanceIdentifier); + } + + @Override + public void deleteCurrentAttributes(@Nonnull InstanceIdentifier<RlocProbe> instanceIdentifier, + @Nonnull RlocProbe rlocProbe, + @Nonnull WriteContext writeContext) throws WriteFailedException { + enableDisableRlocProbe(false, instanceIdentifier); + } + + private void enableDisableRlocProbe(final boolean enable, @Nonnull final InstanceIdentifier<RlocProbe> id) throws WriteFailedException { + LispRlocProbeEnableDisable request = new LispRlocProbeEnableDisable(); + + request.isEnabled = booleanToByte(enable); + + getReplyForWrite(getFutureJVpp().lispRlocProbeEnableDisable(request).toCompletableFuture(), id); + } +} diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/factory/LispWriterFactory.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/factory/LispWriterFactory.java index b2ce44e82..ed7d2122a 100755 --- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/factory/LispWriterFactory.java +++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/factory/LispWriterFactory.java @@ -21,14 +21,22 @@ import static io.fd.hc2vpp.lisp.translate.write.factory.LocatorSetWriterFactory. import io.fd.hc2vpp.lisp.translate.AbstractLispInfraFactoryBase; import io.fd.hc2vpp.lisp.translate.write.LispCustomizer; +import io.fd.hc2vpp.lisp.translate.write.MapRegisterCustomizer; +import io.fd.hc2vpp.lisp.translate.write.MapRequestModeCustomizer; +import io.fd.hc2vpp.lisp.translate.write.PetrCfgCustomizer; import io.fd.hc2vpp.lisp.translate.write.PitrCfgCustomizer; +import io.fd.hc2vpp.lisp.translate.write.RlocProbeCustomizer; import io.fd.honeycomb.translate.impl.write.GenericWriter; import io.fd.honeycomb.translate.write.WriterFactory; import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder; import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.Lisp; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.lisp.feature.data.grouping.LispFeatureData; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.register.grouping.MapRegister; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.request.mode.grouping.MapRequestMode; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.pitr.cfg.grouping.PitrCfg; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.rloc.probing.grouping.RlocProbe; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.use.petr.cfg.grouping.PetrCfg; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; @@ -36,13 +44,27 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; * Initialize writers for {@link Lisp} */ public final class LispWriterFactory extends AbstractLispInfraFactoryBase implements WriterFactory { - private final InstanceIdentifier<Lisp> lispInstanceIdentifier = InstanceIdentifier.create(Lisp.class); + private static final InstanceIdentifier<Lisp> LISP_INSTANCE_IDENTIFIER = InstanceIdentifier.create(Lisp.class); + private static final InstanceIdentifier<LispFeatureData> LISP_FEATURE_IDENTIFIER = + LISP_INSTANCE_IDENTIFIER.child(LispFeatureData.class); @Override public void init(@Nonnull final ModifiableWriterRegistryBuilder registry) { - registry.add(new GenericWriter<>(lispInstanceIdentifier, new LispCustomizer(vppApi))); + registry.add(new GenericWriter<>(LISP_INSTANCE_IDENTIFIER, new LispCustomizer(vppApi))); - registry.addAfter(new GenericWriter<>(lispInstanceIdentifier.child(LispFeatureData.class).child(PitrCfg.class), - new PitrCfgCustomizer(vppApi)),LOCATOR_SET_ID); + registry.addAfter(writer(LISP_FEATURE_IDENTIFIER.child(PitrCfg.class), + new PitrCfgCustomizer(vppApi)), LOCATOR_SET_ID); + + registry.add(writer(LISP_FEATURE_IDENTIFIER.child(MapRegister.class), + new MapRegisterCustomizer(vppApi))); + + registry.add(writer(LISP_FEATURE_IDENTIFIER.child(MapRequestMode.class), + new MapRequestModeCustomizer(vppApi))); + + registry.add(writer(LISP_FEATURE_IDENTIFIER.child(PetrCfg.class), + new PetrCfgCustomizer(vppApi))); + + registry.add(writer(LISP_FEATURE_IDENTIFIER.child(RlocProbe.class), + new RlocProbeCustomizer(vppApi))); } } diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/factory/MapServerWriterFactory.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/factory/MapServerWriterFactory.java new file mode 100644 index 000000000..fc0cc4d10 --- /dev/null +++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/factory/MapServerWriterFactory.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * + * 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 io.fd.hc2vpp.lisp.translate.write.factory; + +import io.fd.hc2vpp.lisp.translate.AbstractLispInfraFactoryBase; +import io.fd.hc2vpp.lisp.translate.write.MapServerCustomizer; +import io.fd.honeycomb.translate.impl.write.GenericListWriter; +import io.fd.honeycomb.translate.write.WriterFactory; +import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder; +import javax.annotation.Nonnull; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.lisp.feature.data.grouping.LispFeatureData; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.servers.grouping.MapServers; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.servers.grouping.map.servers.MapServer; + +public class MapServerWriterFactory extends AbstractLispInfraFactoryBase implements WriterFactory { + + @Override + public void init(@Nonnull ModifiableWriterRegistryBuilder registry) { + registry.add(new GenericListWriter<>( + LISP_CONFIG_IDENTIFIER.child(LispFeatureData.class).child(MapServers.class).child(MapServer.class), + new MapServerCustomizer(vppApi))); + } +} diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LispInitTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LispInitTest.java new file mode 100644 index 000000000..0d2a4b645 --- /dev/null +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LispInitTest.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * + * 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 io.fd.hc2vpp.lisp.translate.read; + +import com.google.common.collect.ImmutableSet; +import io.fd.honeycomb.test.tools.annotations.InjectablesProcessor; +import io.fd.honeycomb.test.tools.annotations.SchemaContextProvider; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.Lisp; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.LispState; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.lisp.feature.data.grouping.LispFeatureData; +import org.opendaylight.yangtools.sal.binding.generator.impl.ModuleInfoBackedContext; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +public interface LispInitTest extends InjectablesProcessor { + + InstanceIdentifier<LispFeatureData> LISP_FTR_IID = InstanceIdentifier.create(Lisp.class) + .child(LispFeatureData.class); + + InstanceIdentifier<LispFeatureData> LISP_STATE_FTR_IID = InstanceIdentifier.create(LispState.class) + .child(LispFeatureData.class); + + @SchemaContextProvider + default ModuleInfoBackedContext schemaContext() { + return provideSchemaContextFor(ImmutableSet.of($YangModuleInfoImpl.getInstance(), + org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.$YangModuleInfoImpl + .getInstance())); + } +} diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LocalMappingCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LocalMappingCustomizerTest.java index 812ba6eb6..43ec43bec 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LocalMappingCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LocalMappingCustomizerTest.java @@ -23,12 +23,16 @@ import static org.mockito.Matchers.any; import static org.mockito.Mockito.when; import com.google.common.collect.ImmutableList; +import io.fd.hc2vpp.common.test.read.ListReaderCustomizerTest; +import io.fd.hc2vpp.common.translate.util.NamingContext; import io.fd.hc2vpp.lisp.context.util.EidMappingContext; import io.fd.hc2vpp.lisp.translate.util.EidTranslator; import io.fd.honeycomb.translate.MappingContext; +import io.fd.honeycomb.translate.read.ReadFailedException; import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; -import io.fd.hc2vpp.common.translate.util.NamingContext; -import io.fd.hc2vpp.common.test.read.ListReaderCustomizerTest; +import io.fd.vpp.jvpp.core.dto.LispEidTableDetails; +import io.fd.vpp.jvpp.core.dto.LispEidTableDetailsReplyDump; +import java.nio.charset.StandardCharsets; import java.util.List; import org.junit.Test; import org.mockito.Mock; @@ -36,6 +40,7 @@ import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.eid.mapping import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4Builder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.HmacKeyType; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.MappingId; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.dp.subtable.grouping.LocalMappings; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.dp.subtable.grouping.LocalMappingsBuilder; @@ -46,11 +51,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.eid.table.grouping.EidTable; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.eid.table.grouping.eid.table.VniTable; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.eid.table.grouping.eid.table.VniTableKey; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.eid.table.grouping.eid.table.vni.table.BridgeDomainSubtable; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.eid.table.grouping.eid.table.vni.table.VrfSubtable; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.hmac.key.grouping.HmacKey; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -import io.fd.vpp.jvpp.core.dto.LispEidTableDetails; -import io.fd.vpp.jvpp.core.dto.LispEidTableDetailsReplyDump; public class LocalMappingCustomizerTest extends ListReaderCustomizerTest<LocalMapping, LocalMappingKey, LocalMappingBuilder> implements EidTranslator { @@ -82,7 +85,6 @@ public class LocalMappingCustomizerTest extends .child(LocalMappings.class) .child(LocalMapping.class, new LocalMappingKey(new MappingId("local-mapping"))); - defineDumpData(); defineMappings(); } @@ -99,6 +101,26 @@ public class LocalMappingCustomizerTest extends detail.locatorSetIndex = 1; detail.ttl = 7; detail.vni = 12; + detail.key = "abcdefgh".getBytes(StandardCharsets.UTF_8); + detail.keyId = 1; + + replyDump.lispEidTableDetails = ImmutableList.of(detail); + when(api.lispEidTableDump(any())).thenReturn(future(replyDump)); + } + + private void defineDumpDataNoHmacKey() { + LispEidTableDetailsReplyDump replyDump = new LispEidTableDetailsReplyDump(); + LispEidTableDetails detail = new LispEidTableDetails(); + detail.action = 0; + detail.authoritative = 1; + detail.context = 4; + detail.eid = new byte[]{-64, -88, 2, 1}; + detail.eidPrefixLen = 32; + detail.eidType = (byte) IPV4.getValue(); + detail.isLocal = 1; + detail.locatorSetIndex = 1; + detail.ttl = 7; + detail.vni = 12; replyDump.lispEidTableDetails = ImmutableList.of(detail); when(api.lispEidTableDump(any())).thenReturn(future(replyDump)); @@ -117,7 +139,23 @@ public class LocalMappingCustomizerTest extends } @Test + public void readCurrentAttributesNoHmacKey() throws ReadFailedException { + defineDumpDataNoHmacKey(); + + LocalMappingBuilder builder = new LocalMappingBuilder(); + getCustomizer().readCurrentAttributes(validIdentifier, builder, ctx); + + final LocalMapping mapping = builder.build(); + + assertNotNull(mapping); + assertEquals(true, compareAddresses(EID_ADDRESS, mapping.getEid().getAddress())); + assertEquals("loc-set", mapping.getLocatorSet()); + assertEquals(HmacKeyType.NoKey, mapping.getHmacKey().getKeyType()); + } + + @Test public void readCurrentAttributes() throws Exception { + defineDumpData(); LocalMappingBuilder builder = new LocalMappingBuilder(); getCustomizer().readCurrentAttributes(validIdentifier, builder, ctx); @@ -126,10 +164,15 @@ public class LocalMappingCustomizerTest extends assertNotNull(mapping); assertEquals(true, compareAddresses(EID_ADDRESS, mapping.getEid().getAddress())); assertEquals("loc-set", mapping.getLocatorSet()); + + final HmacKey hmacKey = mapping.getHmacKey(); + assertEquals("abcdefgh", hmacKey.getKey()); + assertEquals(HmacKeyType.Sha196Key, hmacKey.getKeyType()); } @Test public void getAllIds() throws Exception { + defineDumpData(); final List<LocalMappingKey> keys = getCustomizer().getAllIds(emptyIdentifier, ctx); assertEquals(1, keys.size()); diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LocatorSetCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LocatorSetCustomizerTest.java index 744c57590..b6773d2b2 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LocatorSetCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LocatorSetCustomizerTest.java @@ -54,7 +54,7 @@ import static org.mockito.Mockito.when; @RunWith(HoneycombTestRunner.class) public class LocatorSetCustomizerTest extends InitializingListReaderCustomizerTest<LocatorSet, LocatorSetKey, LocatorSetBuilder> - implements InjectablesProcessor { + implements LispInitTest { private static final String LOC_1_PATH = "/lisp:lisp-state" + "/lisp:lisp-feature-data" + @@ -107,11 +107,6 @@ public class LocatorSetCustomizerTest assertEquals("loc-set", keys.get(0).getName()); } - @SchemaContextProvider - public ModuleInfoBackedContext schemaContext() { - return provideSchemaContextFor(ImmutableSet.of($YangModuleInfoImpl.getInstance())); - } - @Test public void testInit(@InjectTestData(resourcePath = "/locator-set.json", id = LOC_1_PATH) LocatorSet locatorSet) { final LocatorSetKey loc1Key = new LocatorSetKey("loc1"); diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/MapRegisterCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/MapRegisterCustomizerTest.java new file mode 100644 index 000000000..9dc1913c5 --- /dev/null +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/MapRegisterCustomizerTest.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * + * 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 io.fd.hc2vpp.lisp.translate.read; + +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; + +import io.fd.hc2vpp.common.test.read.InitializingReaderCustomizerTest; +import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; +import io.fd.vpp.jvpp.core.dto.ShowLispMapRegisterStateReply; +import org.junit.Before; +import org.junit.Test; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.lisp.feature.data.grouping.LispFeatureDataBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.register.grouping.MapRegister; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.register.grouping.MapRegisterBuilder; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +public class MapRegisterCustomizerTest extends InitializingReaderCustomizerTest implements LispInitTest { + private static final InstanceIdentifier<MapRegister> STATE_IID = LISP_STATE_FTR_IID.child(MapRegister.class); + private static final InstanceIdentifier<MapRegister> CONFIG_IID = LISP_FTR_IID.child(MapRegister.class); + + public MapRegisterCustomizerTest() { + super(MapRegister.class, LispFeatureDataBuilder.class); + } + + @Override + @Before + public void setUp() throws Exception { + final ShowLispMapRegisterStateReply reply = new ShowLispMapRegisterStateReply(); + reply.isEnabled = 1; + when(api.showLispMapRegisterState(any())).thenReturn(future(reply)); + } + + @Test + public void testReadCurrentAttributes() throws Exception { + final MapRegisterBuilder builder = new MapRegisterBuilder(); + customizer.readCurrentAttributes(CONFIG_IID, builder, ctx); + assertTrue(builder.isEnabled()); + } + + @Test + public void testInit() { + final MapRegister data = new MapRegisterBuilder().setEnabled(true).build(); + invokeInitTest(STATE_IID, data, CONFIG_IID, data); + } + + @Override + protected ReaderCustomizer initCustomizer() { + return new MapRegisterCustomizer(api); + } +}
\ No newline at end of file diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/MapRequestModeCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/MapRequestModeCustomizerTest.java new file mode 100644 index 000000000..85e6231f0 --- /dev/null +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/MapRequestModeCustomizerTest.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * + * 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 io.fd.hc2vpp.lisp.translate.read; + +import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; +import static org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.MapRequestMode.DestinationOnly; + +import io.fd.hc2vpp.common.test.read.InitializingReaderCustomizerTest; +import io.fd.honeycomb.test.tools.HoneycombTestRunner; +import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; +import io.fd.vpp.jvpp.core.dto.ShowLispMapRequestModeReply; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.lisp.feature.data.grouping.LispFeatureDataBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.request.mode.grouping.MapRequestMode; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.request.mode.grouping.MapRequestModeBuilder; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +public class MapRequestModeCustomizerTest extends InitializingReaderCustomizerTest implements LispInitTest { + private static final InstanceIdentifier<MapRequestMode> STATE_IID = LISP_STATE_FTR_IID.child(MapRequestMode.class); + private static final InstanceIdentifier<MapRequestMode> CONFIG_IID = LISP_FTR_IID.child(MapRequestMode.class); + + public MapRequestModeCustomizerTest() { + super(MapRequestMode.class, LispFeatureDataBuilder.class); + } + + @Override + @Before + public void setUp() throws Exception { + final ShowLispMapRequestModeReply reply = new ShowLispMapRequestModeReply(); + reply.mode = ((byte) DestinationOnly.getIntValue()); + when(api.showLispMapRequestMode(any())).thenReturn(future(reply)); + } + + @Test + public void testReadCurrentAttributes() throws Exception { + final MapRequestModeBuilder builder = new MapRequestModeBuilder(); + customizer.readCurrentAttributes(CONFIG_IID, builder, ctx); + assertEquals(DestinationOnly, builder.getMode()); + } + + @Test + public void testInit() { + final MapRequestMode data = new MapRequestModeBuilder().setMode(DestinationOnly).build(); + invokeInitTest(STATE_IID, data, CONFIG_IID, data); + } + + @Override + protected ReaderCustomizer initCustomizer() { + return new MapRequestModeCustomizer(api); + } +}
\ No newline at end of file diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/MapServerCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/MapServerCustomizerTest.java new file mode 100644 index 000000000..1af22931e --- /dev/null +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/MapServerCustomizerTest.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * + * 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 io.fd.hc2vpp.lisp.translate.read; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.containsInAnyOrder; +import static org.hamcrest.Matchers.hasSize; +import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; + +import io.fd.hc2vpp.common.test.read.InitializingListReaderCustomizerTest; +import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; +import io.fd.vpp.jvpp.core.dto.LispMapServerDetails; +import io.fd.vpp.jvpp.core.dto.LispMapServerDetailsReplyDump; +import io.fd.vpp.jvpp.core.dto.LispMapServerDump; +import java.util.Arrays; +import java.util.List; +import org.junit.Before; +import org.junit.Test; +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.Ipv4Address; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6AddressNoZone; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.servers.grouping.MapServers; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.servers.grouping.MapServersBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.servers.grouping.map.servers.MapServer; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.servers.grouping.map.servers.MapServerBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.servers.grouping.map.servers.MapServerKey; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +public class MapServerCustomizerTest + extends InitializingListReaderCustomizerTest<MapServer, MapServerKey, MapServerBuilder> + implements LispInitTest { + + private static final MapServerKey + SERVER_KEY = new MapServerKey(new IpAddress(new Ipv4Address("192.168.2.1"))); + private static final InstanceIdentifier<MapServer> STATE_IID = LISP_STATE_FTR_IID.child(MapServers.class) + .child(MapServer.class, SERVER_KEY); + private static final InstanceIdentifier<MapServer> CONFIG_IID = LISP_FTR_IID.child(MapServers.class) + .child(MapServer.class, SERVER_KEY); + + public MapServerCustomizerTest() { + super(MapServer.class, MapServersBuilder.class); + } + + @Override + @Before + public void setUp() throws Exception { + final LispMapServerDetailsReplyDump reply = new LispMapServerDetailsReplyDump(); + LispMapServerDetails server1 = new LispMapServerDetails(); + //192.168.2.2 + server1.ipAddress = new byte[]{-64, -88, 2, 1}; + server1.isIpv6 = 0; + + LispMapServerDetails server2 = new LispMapServerDetails(); + //192.168.2.2 + server2.ipAddress = new byte[]{-64, -88, 2, 2}; + server2.isIpv6 = 0; + + LispMapServerDetails server3 = new LispMapServerDetails(); + //2001:0db8:0a0b:12f0:0000:0000:0000:0001 + server3.ipAddress = new byte[]{32, 1, 13, -72, 10, 11, 18, -16, 0, 0, 0, 0, 0, 0, 0, 1}; + server3.isIpv6 = 1; + + reply.lispMapServerDetails = Arrays.asList(server1, server2, server3); + when(api.lispMapServerDump(any(LispMapServerDump.class))).thenReturn(future(reply)); + } + + @Test + public void testGetAllIds() throws Exception { + final List<MapServerKey> allIds = getCustomizer().getAllIds(STATE_IID, ctx); + assertThat(allIds, hasSize(3)); + assertThat(allIds, containsInAnyOrder( + new MapServerKey(new IpAddress(new Ipv4AddressNoZone("192.168.2.1"))), + new MapServerKey(new IpAddress(new Ipv4AddressNoZone("192.168.2.2"))), + new MapServerKey(new IpAddress(new Ipv6AddressNoZone("2001:db8:a0b:12f0::1"))))); + } + + @Test + public void testReadCurrentAttributes() throws Exception { + final MapServerBuilder builder = new MapServerBuilder(); + getCustomizer().readCurrentAttributes(STATE_IID, builder, ctx); + assertEquals("192.168.2.1", builder.getIpAddress().getIpv4Address().getValue()); + } + + @Test + public void testInit() { + final MapServer data = new MapServerBuilder().setIpAddress( + new IpAddress(new Ipv4Address("192.168.2.1"))).build(); + invokeInitTest(STATE_IID, data, CONFIG_IID, data); + } + + @Override + protected ReaderCustomizer<MapServer, MapServerBuilder> initCustomizer() { + return new MapServerCustomizer(api); + } +}
\ No newline at end of file diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/PetrCfgCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/PetrCfgCustomizerTest.java new file mode 100644 index 000000000..107523292 --- /dev/null +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/PetrCfgCustomizerTest.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * + * 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 io.fd.hc2vpp.lisp.translate.read; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; + +import io.fd.hc2vpp.common.test.read.InitializingReaderCustomizerTest; +import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; +import io.fd.vpp.jvpp.core.dto.ShowLispUsePetrReply; +import org.junit.Test; +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.Ipv4Address; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.lisp.feature.data.grouping.LispFeatureDataBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.use.petr.cfg.grouping.PetrCfg; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.use.petr.cfg.grouping.PetrCfgBuilder; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +public class PetrCfgCustomizerTest extends InitializingReaderCustomizerTest implements LispInitTest { + private static final InstanceIdentifier<PetrCfg> STATE_IID = LISP_STATE_FTR_IID.child(PetrCfg.class); + private static final InstanceIdentifier<PetrCfg> CONFIG_IID = LISP_FTR_IID.child(PetrCfg.class); + + public PetrCfgCustomizerTest() { + super(PetrCfg.class, LispFeatureDataBuilder.class); + } + + private void mockEnabledReply() { + final ShowLispUsePetrReply reply = new ShowLispUsePetrReply(); + reply.address = new byte[]{-64, -88, 2, 1}; + reply.status = 1; + reply.isIp4 = 1; + when(api.showLispUsePetr(any())).thenReturn(future(reply)); + } + + private void mockDisabledReply() { + final ShowLispUsePetrReply reply = new ShowLispUsePetrReply(); + reply.status = 0; + when(api.showLispUsePetr(any())).thenReturn(future(reply)); + } + + @Test + public void readCurrentAttributesEnabled() throws Exception { + mockEnabledReply(); + final PetrCfgBuilder builder = new PetrCfgBuilder(); + getCustomizer().readCurrentAttributes(STATE_IID, builder, ctx); + assertEquals("192.168.2.1", builder.getPetrAddress().getIpv4Address().getValue()); + } + + @Test + public void readCurrentAttributesDisabled() throws Exception { + mockDisabledReply(); + final PetrCfgBuilder builder = new PetrCfgBuilder(); + getCustomizer().readCurrentAttributes(STATE_IID, builder, ctx); + assertNull(builder.getPetrAddress()); + } + + @Test + public void testInit() { + final PetrCfg data = new PetrCfgBuilder().setPetrAddress( + new IpAddress(new Ipv4Address("192.168.2.1"))).build(); + invokeInitTest(STATE_IID, data, CONFIG_IID, data); + } + + @Override + protected ReaderCustomizer initCustomizer() { + return new PetrCfgCustomizer(api); + } +}
\ No newline at end of file diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/RlocProbeCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/RlocProbeCustomizerTest.java new file mode 100644 index 000000000..f5d235358 --- /dev/null +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/RlocProbeCustomizerTest.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * + * 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 io.fd.hc2vpp.lisp.translate.read; + +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; + +import io.fd.hc2vpp.common.test.read.InitializingReaderCustomizerTest; +import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; +import io.fd.vpp.jvpp.core.dto.ShowLispRlocProbeStateReply; +import org.junit.Before; +import org.junit.Test; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.lisp.feature.data.grouping.LispFeatureDataBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.rloc.probing.grouping.RlocProbe; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.rloc.probing.grouping.RlocProbeBuilder; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +public class RlocProbeCustomizerTest extends InitializingReaderCustomizerTest implements LispInitTest { + private static final InstanceIdentifier<RlocProbe> STATE_IID = LISP_STATE_FTR_IID.child(RlocProbe.class); + private static final InstanceIdentifier<RlocProbe> CONFIG_IID = LISP_FTR_IID.child(RlocProbe.class); + + public RlocProbeCustomizerTest() { + super(RlocProbe.class, LispFeatureDataBuilder.class); + } + + @Override + @Before + public void setUp() throws Exception { + final ShowLispRlocProbeStateReply reply = new ShowLispRlocProbeStateReply(); + reply.isEnabled = 1; + when(api.showLispRlocProbeState(any())).thenReturn(future(reply)); + } + + @Test + public void testInit() { + final RlocProbe data = new RlocProbeBuilder().setEnabled(true).build(); + invokeInitTest(STATE_IID, data, CONFIG_IID, data); + } + + @Test + public void testReadCurrentAttributes() throws Exception { + final RlocProbeBuilder builder = new RlocProbeBuilder(); + getCustomizer().readCurrentAttributes(CONFIG_IID, builder, ctx); + assertTrue(builder.isEnabled()); + } + + + @Override + protected ReaderCustomizer initCustomizer() { + return new RlocProbeCustomizer(api); + } +}
\ No newline at end of file diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/LocalMappingCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/LocalMappingCustomizerTest.java index 6f4a623ed..8855f0564 100755 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/LocalMappingCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/LocalMappingCustomizerTest.java @@ -18,6 +18,7 @@ package io.fd.hc2vpp.lisp.translate.write; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import static org.mockito.Matchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.mock; @@ -32,6 +33,8 @@ import io.fd.hc2vpp.lisp.context.util.EidMappingContext; import io.fd.honeycomb.translate.write.WriteFailedException; import io.fd.vpp.jvpp.core.dto.LispAddDelLocalEid; import io.fd.vpp.jvpp.core.dto.LispAddDelLocalEidReply; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; import java.util.concurrent.ExecutionException; import org.junit.Test; import org.mockito.ArgumentCaptor; @@ -40,6 +43,7 @@ import org.mockito.Mock; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.Ipv4Afi; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4Builder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.HmacKeyType; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.Lisp; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.MappingId; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.dp.subtable.grouping.LocalMappings; @@ -52,6 +56,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.eid.table.grouping.eid.table.VniTable; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.eid.table.grouping.eid.table.VniTableKey; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.eid.table.grouping.eid.table.vni.table.VrfSubtable; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.hmac.key.grouping.HmacKeyBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.lisp.feature.data.grouping.LispFeatureData; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; @@ -64,6 +69,7 @@ public class LocalMappingCustomizerTest extends WriterCustomizerTest implements private InstanceIdentifier<LocalMapping> id; private LocalMapping mapping; + private LocalMapping mappingWithHmacKey; private LocalMappingCustomizer customizer; @Override @@ -82,6 +88,13 @@ public class LocalMappingCustomizerTest extends WriterCustomizerTest implements .setLocatorSet("Locator") .build(); + mappingWithHmacKey = new LocalMappingBuilder(mapping) + .setHmacKey(new HmacKeyBuilder() + .setKey("abcd") + .setKeyType(HmacKeyType.Sha256128Key) + .build()) + .build(); + id = InstanceIdentifier.builder(Lisp.class) .child(LispFeatureData.class) .child(EidTable.class) @@ -138,6 +151,25 @@ public class LocalMappingCustomizerTest extends WriterCustomizerTest implements assertEquals("Locator", toString(request.locatorSetName)); } + @Test + public void testWriteCurrentAttributesWithHmacKey() throws WriteFailedException { + customizer.writeCurrentAttributes(id, mappingWithHmacKey, writeContext); + + verify(api, times(1)).lispAddDelLocalEid(mappingCaptor.capture()); + + LispAddDelLocalEid request = mappingCaptor.getValue(); + + assertNotNull(request); + assertEquals("Locator", new String(request.locatorSetName)); + assertEquals("192.168.2.1", arrayToIpv4AddressNoZone(request.eid).getValue()); + assertEquals(0, request.eidType); + assertEquals(1, request.isAdd); + assertEquals(25, request.vni); + assertEquals("Locator", toString(request.locatorSetName)); + assertTrue(Arrays.equals("abcd".getBytes(StandardCharsets.UTF_8), request.key)); + assertEquals(HmacKeyType.Sha256128Key.getIntValue(), request.keyId); + } + @Test(expected = UnsupportedOperationException.class) public void testUpdateCurrentAttributes() throws WriteFailedException { customizer.updateCurrentAttributes(null, null, null, writeContext); @@ -160,4 +192,24 @@ public class LocalMappingCustomizerTest extends WriterCustomizerTest implements assertEquals(25, request.vni); assertEquals("Locator", toString(request.locatorSetName)); } + + @Test + public void testDeleteCurrentAttributesWithHmacKey() throws WriteFailedException, InterruptedException, ExecutionException { + when(eidMappingContext.containsEid(any(), eq(mappingContext))).thenReturn(true); + customizer.deleteCurrentAttributes(id, mappingWithHmacKey, writeContext); + + verify(api, times(1)).lispAddDelLocalEid(mappingCaptor.capture()); + + LispAddDelLocalEid request = mappingCaptor.getValue(); + + assertNotNull(request); + assertEquals("Locator", new String(request.locatorSetName)); + assertEquals("192.168.2.1", arrayToIpv4AddressNoZone(request.eid).getValue()); + assertEquals(0, request.eidType); + assertEquals(0, request.isAdd); + assertEquals(25, request.vni); + assertEquals("Locator", toString(request.locatorSetName)); + assertTrue(Arrays.equals("abcd".getBytes(StandardCharsets.UTF_8), request.key)); + assertEquals(HmacKeyType.Sha256128Key.getIntValue(), request.keyId); + } } diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapRegisterCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapRegisterCustomizerTest.java new file mode 100644 index 000000000..0eb5d1148 --- /dev/null +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapRegisterCustomizerTest.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * + * 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 io.fd.hc2vpp.lisp.translate.write; + +import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import io.fd.hc2vpp.common.test.write.WriterCustomizerTest; +import io.fd.hc2vpp.common.translate.util.ByteDataTranslator; +import io.fd.vpp.jvpp.core.dto.LispMapRegisterEnableDisable; +import io.fd.vpp.jvpp.core.dto.LispMapRegisterEnableDisableReply; +import org.junit.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.register.grouping.MapRegister; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.register.grouping.MapRegisterBuilder; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +public class MapRegisterCustomizerTest extends WriterCustomizerTest implements ByteDataTranslator { + + private static final InstanceIdentifier<MapRegister> ID = InstanceIdentifier.create(MapRegister.class); + private MapRegisterCustomizer customizer; + private MapRegister enabledRegister; + private MapRegister disabledRegister; + + @Captor + private ArgumentCaptor<LispMapRegisterEnableDisable> requestCaptor; + + @Override + protected void setUpTest() throws Exception { + customizer = new MapRegisterCustomizer(api); + + enabledRegister = new MapRegisterBuilder() + .setEnabled(true) + .build(); + + disabledRegister = new MapRegisterBuilder() + .setEnabled(false) + .build(); + + when(api.lispMapRegisterEnableDisable(any(LispMapRegisterEnableDisable.class))) + .thenReturn(future(new LispMapRegisterEnableDisableReply())); + } + + @Test + public void writeCurrentAttributes() throws Exception { + customizer.writeCurrentAttributes(ID, enabledRegister, writeContext); + verifyRequest(true); + } + + @Test + public void updateCurrentAttributesToDisabled() throws Exception { + customizer.updateCurrentAttributes(ID, enabledRegister, disabledRegister, writeContext); + verifyRequest(false); + } + + @Test + public void updateCurrentAttributesToEnabled() throws Exception { + customizer.updateCurrentAttributes(ID, disabledRegister, enabledRegister, writeContext); + verifyRequest(true); + } + + @Test + public void deleteCurrentAttributes() throws Exception { + customizer.deleteCurrentAttributes(ID, disabledRegister, writeContext); + verifyRequest(false); + } + + private void verifyRequest(final boolean enabled) { + verify(api, times(1)).lispMapRegisterEnableDisable(requestCaptor.capture()); + + final LispMapRegisterEnableDisable request = requestCaptor.getValue(); + assertEquals(booleanToByte(enabled), request.isEnabled); + } +}
\ No newline at end of file diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapRequestModeCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapRequestModeCustomizerTest.java new file mode 100644 index 000000000..d66097ad2 --- /dev/null +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapRequestModeCustomizerTest.java @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * + * 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 io.fd.hc2vpp.lisp.translate.write; + +import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import static org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.MapRequestMode.DestinationOnly; +import static org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.MapRequestMode.SourceDestination; + +import io.fd.hc2vpp.common.test.write.WriterCustomizerTest; +import io.fd.vpp.jvpp.core.dto.LispMapRequestMode; +import io.fd.vpp.jvpp.core.dto.LispMapRequestModeReply; +import org.junit.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.request.mode.grouping.MapRequestMode; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.request.mode.grouping.MapRequestModeBuilder; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +public class MapRequestModeCustomizerTest extends WriterCustomizerTest { + + private static final InstanceIdentifier<MapRequestMode> ID = InstanceIdentifier.create(MapRequestMode.class); + private MapRequestModeCustomizer customizer; + private MapRequestMode sourceDestinationMode; + private MapRequestMode destinationOnlyMode; + + @Captor + private ArgumentCaptor<LispMapRequestMode> requestCaptor; + + @Override + protected void setUpTest() throws Exception { + customizer = new MapRequestModeCustomizer(api); + sourceDestinationMode = new MapRequestModeBuilder() + .setMode(SourceDestination) + .build(); + destinationOnlyMode = new MapRequestModeBuilder() + .setMode(DestinationOnly) + .build(); + when(api.lispMapRequestMode(any(LispMapRequestMode.class))).thenReturn(future(new LispMapRequestModeReply())); + } + + @Test + public void writeCurrentAttributes() throws Exception { + customizer.writeCurrentAttributes(ID, sourceDestinationMode, writeContext); + verifyModeRequest(SourceDestination); + } + + @Test + public void updateCurrentAttributes() throws Exception { + customizer.updateCurrentAttributes(ID, sourceDestinationMode, destinationOnlyMode, writeContext); + verifyModeRequest(DestinationOnly); + } + + @Test + public void deleteCurrentAttributes() throws Exception { + verify(api, times(0)).lispMapRequestMode(any()); + } + + private void verifyModeRequest( + final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.MapRequestMode mode) { + verify(api, times(1)).lispMapRequestMode(requestCaptor.capture()); + + final LispMapRequestMode request = requestCaptor.getValue(); + assertEquals(mode.getIntValue(), request.mode); + } +}
\ No newline at end of file diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapServerCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapServerCustomizerTest.java new file mode 100644 index 000000000..b69a44e68 --- /dev/null +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapServerCustomizerTest.java @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * + * 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 io.fd.hc2vpp.lisp.translate.write; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import io.fd.hc2vpp.common.test.write.WriterCustomizerTest; +import io.fd.hc2vpp.common.translate.util.ByteDataTranslator; +import io.fd.honeycomb.translate.write.WriteFailedException; +import io.fd.vpp.jvpp.core.dto.LispAddDelMapServer; +import io.fd.vpp.jvpp.core.dto.LispAddDelMapServerReply; +import java.util.Arrays; +import org.junit.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +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.Ipv4Address; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.servers.grouping.MapServers; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.servers.grouping.map.servers.MapServer; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.servers.grouping.map.servers.MapServerBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.map.servers.grouping.map.servers.MapServerKey; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +public class MapServerCustomizerTest extends WriterCustomizerTest implements ByteDataTranslator { + + private static final MapServerKey MAP_SERVER_KEY = new MapServerKey( + new IpAddress(new Ipv4Address("192.168.2.1"))); + private static final InstanceIdentifier<MapServer> ID = InstanceIdentifier.create(MapServers.class) + .child(MapServer.class, MAP_SERVER_KEY); + + private MapServerCustomizer customizer; + private MapServer data; + + @Captor + private ArgumentCaptor<LispAddDelMapServer> requestCaptor; + + @Override + protected void setUpTest() throws Exception { + customizer = new MapServerCustomizer(api); + data = new MapServerBuilder() + .setIpAddress(MAP_SERVER_KEY.getIpAddress()) + .build(); + when(api.lispAddDelMapServer(any())).thenReturn(future(new LispAddDelMapServerReply())); + } + + @Test + public void writeCurrentAttributes() throws Exception { + customizer.writeCurrentAttributes(ID, data, writeContext); + verifyRequest(true); + } + + + @Test + public void updateCurrentAttributes() throws Exception { + try { + customizer.updateCurrentAttributes(ID, data, data, writeContext); + } catch (WriteFailedException e) { + assertTrue(e instanceof WriteFailedException.UpdateFailedException); + assertTrue(e.getCause() instanceof UnsupportedOperationException); + verify(api, times(0)).lispAddDelMapServer(any()); + } + } + + @Test + public void deleteCurrentAttributes() throws Exception { + customizer.deleteCurrentAttributes(ID, data, writeContext); + verifyRequest(false); + } + + private void verifyRequest(final boolean add) { + verify(api, times(1)).lispAddDelMapServer(requestCaptor.capture()); + + final LispAddDelMapServer request = requestCaptor.getValue(); + + assertEquals(booleanToByte(add), request.isAdd); + assertEquals(0, request.isIpv6); + assertTrue(Arrays.equals(new byte[]{-64, -88, 2, 1}, request.ipAddress)); + } +}
\ No newline at end of file diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/PetrCfgCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/PetrCfgCustomizerTest.java new file mode 100644 index 000000000..bd7475bb1 --- /dev/null +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/PetrCfgCustomizerTest.java @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * + * 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 io.fd.hc2vpp.lisp.translate.write; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import io.fd.hc2vpp.common.test.write.WriterCustomizerTest; +import io.fd.vpp.jvpp.core.dto.LispUsePetr; +import io.fd.vpp.jvpp.core.dto.LispUsePetrReply; +import java.util.Arrays; +import org.junit.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +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.Ipv4Address; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.use.petr.cfg.grouping.PetrCfg; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.use.petr.cfg.grouping.PetrCfgBuilder; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +public class PetrCfgCustomizerTest extends WriterCustomizerTest { + + private static final InstanceIdentifier<PetrCfg> ID = InstanceIdentifier.create(PetrCfg.class); + + private PetrCfgCustomizer customizer; + private PetrCfg enabledCfg; + private PetrCfg disabledCfg; + + @Captor + private ArgumentCaptor<LispUsePetr> requestCaptor; + + @Override + public void setUpTest() throws Exception { + customizer = new PetrCfgCustomizer(api); + enabledCfg = new PetrCfgBuilder().setPetrAddress(new IpAddress(new Ipv4Address("192.168.2.1"))).build(); + disabledCfg = new PetrCfgBuilder().build(); + when(api.lispUsePetr(any(LispUsePetr.class))).thenReturn(future(new LispUsePetrReply())); + } + + @Test + public void testWriteCurrentAttributes() throws Exception { + customizer.writeCurrentAttributes(ID, enabledCfg, writeContext); + verifyEnabledInvoked(); + } + + @Test + public void testUpdateCurrentAttributesToEnabled() throws Exception { + customizer.updateCurrentAttributes(ID, disabledCfg, enabledCfg, writeContext); + verifyEnabledInvoked(); + } + + @Test + public void testUpdateCurrentAttributesToDisabled() throws Exception { + customizer.updateCurrentAttributes(ID, enabledCfg, disabledCfg, writeContext); + verifyDisabledInvoked(); + } + + @Test + public void testDeleteCurrentAttributes() throws Exception { + customizer.deleteCurrentAttributes(ID, disabledCfg, writeContext); + verifyDisabledInvoked(); + } + + private void verifyEnabledInvoked() { + verify(api, times(1)).lispUsePetr(requestCaptor.capture()); + + final LispUsePetr cfg = requestCaptor.getValue(); + assertEquals(1, cfg.isIp4); + assertTrue(Arrays.equals(new byte[]{-64, -88, 2, 1}, cfg.address)); + assertEquals(1, cfg.isAdd); + } + + private void verifyDisabledInvoked() { + verify(api, times(1)).lispUsePetr(requestCaptor.capture()); + + final LispUsePetr cfg = requestCaptor.getValue(); + assertNull(cfg.address); + assertEquals(0, cfg.isAdd); + } +}
\ No newline at end of file diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/RlocProbeCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/RlocProbeCustomizerTest.java new file mode 100644 index 000000000..829853e66 --- /dev/null +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/RlocProbeCustomizerTest.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * + * 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 io.fd.hc2vpp.lisp.translate.write; + +import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import io.fd.hc2vpp.common.test.write.WriterCustomizerTest; +import io.fd.hc2vpp.common.translate.util.ByteDataTranslator; +import io.fd.vpp.jvpp.core.dto.LispRlocProbeEnableDisable; +import io.fd.vpp.jvpp.core.dto.LispRlocProbeEnableDisableReply; +import org.junit.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.rloc.probing.grouping.RlocProbe; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.rloc.probing.grouping.RlocProbeBuilder; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +public class RlocProbeCustomizerTest extends WriterCustomizerTest implements ByteDataTranslator { + + private static final InstanceIdentifier<RlocProbe> ID = InstanceIdentifier.create(RlocProbe.class); + private RlocProbeCustomizer customizer; + private RlocProbe enabledProbe; + private RlocProbe disabledProbe; + + @Captor + private ArgumentCaptor<LispRlocProbeEnableDisable> requestCaptor; + + @Override + protected void setUpTest() throws Exception { + customizer = new RlocProbeCustomizer(api); + enabledProbe = rlocProbe(true); + disabledProbe = rlocProbe(false); + when(api.lispRlocProbeEnableDisable(any(LispRlocProbeEnableDisable.class))) + .thenReturn(future(new LispRlocProbeEnableDisableReply())); + } + + @Test + public void testWriteCurrentAttributes() throws Exception { + customizer.writeCurrentAttributes(ID, enabledProbe, writeContext); + verifyRequest(true); + } + + @Test + public void testUpdateCurrentAttributesToDisabled() throws Exception { + customizer.updateCurrentAttributes(ID, enabledProbe, disabledProbe, writeContext); + verifyRequest(false); + } + + @Test + public void testUpdateCurrentAttributesToEnabled() throws Exception { + customizer.updateCurrentAttributes(ID, disabledProbe, enabledProbe, writeContext); + verifyRequest(true); + } + + @Test + public void testDeleteCurrentAttributes() throws Exception { + customizer.deleteCurrentAttributes(ID, disabledProbe, writeContext); + verifyRequest(false); + } + + private static RlocProbe rlocProbe(final boolean enabled) { + return new RlocProbeBuilder().setEnabled(enabled).build(); + } + + private void verifyRequest(final boolean enabled) { + verify(api, times(1)).lispRlocProbeEnableDisable(requestCaptor.capture()); + final LispRlocProbeEnableDisable request = requestCaptor.getValue(); + assertEquals(booleanToByte(enabled), request.isEnabled); + } +}
\ No newline at end of file diff --git a/lisp/lisp_postman_collection.json b/lisp/lisp_postman_collection.json index 98c8c6511..336ee1594 100644 --- a/lisp/lisp_postman_collection.json +++ b/lisp/lisp_postman_collection.json @@ -1,179 +1,235 @@ { - "id": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "name": "Lisp Postman Collection L2", + "id": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "name": "Lisp Postman Collection L2 copy", "description": "", "order": [ - "41e942ed-eea2-5c77-8e2d-c0adead79741", - "27153df9-e0d5-1d23-4eb5-62d412ed181b", - "706257fe-47ce-c0ca-ccd5-0e5cfdb1becb", - "b269cb03-c0fc-aa68-c730-b126274dde78", - "0025c271-1d7c-4fe7-6f98-803c6db92d19", - "fa912ebd-2381-1892-2b27-c01780ba1b9c", - "60d70464-6b98-fa69-f405-631c0c525be5", - "e6f90d4d-a68e-ab51-5b63-93e3c6f99bc1", - "f65b7beb-a746-dc7d-d27d-3b39fa95ea56", - "1b0fd1f1-17f3-8de6-acf7-d9cd7f2c0b70", - "d3dde4b1-56df-b489-53d9-a3edee6c4bd3", - "70ab7906-c783-ae9f-487e-28505dace49c", - "07e6f197-3b13-095e-9525-176167e3b5a4", - "1d57c0aa-a7bd-cb15-27c3-2f56c608d0ca", - "a98dcdc1-a383-4355-6174-d2618a790ebd", - "9efbb933-5389-bee4-8e2f-a82fcdc1151d", - "41798cf0-8fa1-ab54-815c-4ae37024aaf0", - "121017cd-63f8-231d-5676-f8e2d4f2961f", - "22132e1d-44aa-e5e5-8787-f82cfdac424f", - "4f3d5d14-e397-5dca-bcf3-c64585fab175", - "b5e76988-aee4-19d1-3781-8ab7784af1ab", - "b5e65290-0729-7089-ca3a-7de7454f58fa", - "107a0853-c530-eb1a-0a3c-bcc382f1bc60", - "577ba8a1-67b5-571f-903a-f44908c0d656", - "591d677e-7f6e-aed1-3097-7a913378f943", - "e67f634f-81b6-4bb4-a013-6516e7585804", - "b546cbd7-b598-b419-4dab-b747ea444f23", - "d75a1d9c-51cb-7e8a-a1cb-8ae77b42fdec", - "daf43527-613d-af9e-71f0-8e81f31ea832", - "2eb7f81a-9ebb-12f2-64ff-304fc204169a", - "799ee5a8-5ca6-b09a-da84-ebe7ee7dc34b", - "97ff7203-2730-c03f-8582-6fb89857dc72", - "39cdad3e-55e7-c091-835a-7b8956ad528b", - "9ed49bf2-8146-b344-be60-916d788357d5", - "1b24f085-9c39-896b-2644-575ae3c2747a", - "63ada212-fd75-3897-8df4-94530d9ec162", - "bc81a430-c93c-d9ca-8427-1c4f4a73fcf9", - "8dfbeb8c-f27c-48df-9022-cc34489eb0c3", - "0f796bd9-87c8-0004-a3e7-25555d648b7e", - "7d27fd46-87c3-4012-61f2-8b48a6d424aa", - "383d2f9b-54f7-c924-dff9-b2bd96b08573", - "ca05036e-787a-5e8b-bbfd-9b6fce61a893", - "f0fc317e-801b-89bf-5821-317f5c835d97", - "5e529c91-698a-9186-50e4-ee2b718825f8", - "bf3ad99c-0fa6-a566-742a-92a9a8404b8c", - "583ae0f4-cce5-4084-098d-e85e9dcd1d2e", - "25674e1b-4a81-6723-fa5d-e4e014b1f1d7" + "c99e6e24-5d9c-040a-68f3-5a0dbed98cc1", + "da8d61ce-1f0d-8ab8-e1de-50d094a266e2", + "e5b786a5-cab9-9fd7-4a23-20840e00098a", + "b1c9fcf9-89bf-86c5-a350-60535b748ee9", + "0ce07f8f-0e45-ea05-4c62-76d7076a444f", + "c0611a78-1410-52b6-a886-ca84e4dacb8e", + "14239ebd-752b-e2f6-ba5f-4fdb79819b92", + "3fe6bbb8-eca4-8b49-9092-1300aeac51e0", + "4b606776-aa33-ff85-9784-f76d2e457dea", + "385ab15d-6e4e-9fe9-9f4a-244a64f90c21", + "61af7f4c-6071-e881-cfbc-548abab4ba9f", + "7beac5a7-38d0-dd68-2e65-352418c285fd", + "44c349c4-c0ca-f5d9-53e1-8bf92eca5c73", + "b19d4109-d47a-c368-a7d4-1e5baad88d6d", + "4ceea4ca-a442-edc1-30d4-4e28e1d15ac3", + "3c3d5346-fd09-0c1b-31dc-5e549c1a4adb", + "bad5a024-ed9f-93d6-da06-1686d675dc50", + "32cdac07-fe1b-ae10-1e3d-9c5e64c8fbe7", + "7eaaefcc-784b-897f-dde1-0d47741dfe56", + "2506fe37-668b-7d0b-a76e-a592263dee65", + "1e18c440-3841-2cdd-9a88-cd4bde729a17", + "a517428f-a35e-5e75-5e5b-7f560d42332b", + "d106d7bf-ff65-6c13-397d-7cb765c71124", + "8f3ede8b-aab7-ac3b-3041-9cdb7bc0e6ec", + "eef057eb-f4a5-4903-1e31-06082511d677", + "0b807adc-2277-db3f-8e3e-c6b74888018d", + "5462a723-5b0c-34f0-1359-5e53a77e3a52", + "cd18d003-6bc9-cfff-46e8-7dffcd1f8497", + "1493eeb4-7306-9770-a2ed-4a59763240d1", + "523f68fe-ee0f-8e28-2a8a-87f6a459e03b", + "7a748095-2530-5bbd-7e5d-6d1cbd225c65", + "749351c9-3d31-cd54-500f-a628c7e134cd", + "54de6ea7-94a6-e8f2-1ed5-c209d8e3c25f", + "49cc1e34-af2a-0ccc-3beb-dab09c4a7869", + "fceee914-148f-c74e-3ad5-c2dbb988edf2", + "ad739651-3137-a535-5066-28a313cf7aa2", + "d01b27de-fef9-a333-3075-f431412a56d8", + "0ce2444e-3779-c247-6f0a-e9aabc7536eb", + "e6c236d4-96f6-b999-5e4e-9e8c93be6090", + "f18a7c8a-1c04-18b8-75d8-e2d8d08c3ef0", + "70790149-793f-242a-ebb8-032188d5bce5", + "32abc7d1-bdcf-26f3-c726-a385b3b86ec5", + "11cf57b3-d985-6dc2-805a-8d408679b35b", + "f6c1d4a8-9e5a-bac2-7476-c5ded4a545cc", + "c52b0be2-67d4-642b-fd7b-43598f2c4e3f", + "5ac994f5-18e3-5101-23c1-32995dae6ec9", + "f8d1b8a6-7a79-8be1-dbf3-fc02c5688df4", + "c50bc4c0-1a64-7130-4b8b-e1f12f55d4d7", + "65167fb8-0d64-d13e-27ad-0f7d3e8c7fe4", + "2ab426c2-1c94-fe0b-08a4-c2579f6fea3d", + "459bacc9-b049-b78f-5d50-7f2a0f8a182e", + "d547003e-cb16-6971-a5f9-66c400a921a1", + "1a65220c-e906-c56c-9d32-4ee27e30cfbd", + "080a7c73-3ffc-86f9-8d67-fc9a64bd2f46", + "531ac705-5ed0-04bc-fb4b-43e729b7c4e4", + "29c9a114-5552-701b-787d-895a8b03f2a6", + "1a6bbb6d-467d-dba6-0fc9-230cbcd85c47", + "ac4e4f66-fab7-fbbc-ca89-00bafd242361", + "1d0a2f13-a4d5-69da-2960-e368a67e9129", + "a0babf59-f72b-3412-3146-52e6312e063f", + "b1746c42-9991-7992-b8da-80c025981e9d", + "1d1c7d25-94af-2dfa-97ec-33710f47d04d", + "7a314526-67d0-d126-009a-656e6cf99f1e", + "8c8ee757-8bac-5e86-d5d6-3cb8c89ccac5", + "36a847e5-e3b8-ff07-4e88-f5a841fcaca6" ], "folders": [], - "timestamp": 1475131541292, + "timestamp": 0, "owner": "658985", "public": false, "requests": [ { - "id": "0025c271-1d7c-4fe7-6f98-803c6db92d19", + "id": "080a7c73-3ffc-86f9-8d67-fc9a64bd2f46", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/locator-sets/locator-set/loc_1", + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/map-register", "preRequestScript": null, "pathVariables": {}, - "method": "PUT", + "method": "GET", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475138985879, - "name": "Negative Case - Locator set loc_1 as empty", - "description": "Add new locator set\n\nequivalent of \n \n lisp_add_del_locator_set is_add 1 locator_set_name loc_1\n \ncan be verified with \n\n lisp_locator_set_dump\n\nRequests to add empty locator-sets will be rejected", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", + "time": 1489066007652, + "name": "Map register config", + "description": "", + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", "responses": [], - "rawModeData": "{ \n \"locator-set\":{ \n \"name\":\"loc_1\"\n }\n}" + "rawModeData": "{\n\t\"map-register\":{\n\t\t\"enabled\":true\t\n\t}\n}" }, { - "id": "07e6f197-3b13-095e-9525-176167e3b5a4", + "folder": null, + "id": "0b807adc-2277-db3f-8e3e-c6b74888018d", + "name": "Get local mapping loc_map_1 Operational", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "Get details about local mapping\n\nequivalent of\n \n lisp_eid_table_dump eid_set 1 prefix_length 32 vni 12 eid_type 0 eid 192.168.2.1 filter 1", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/vrf-subtable", - "preRequestScript": null, - "pathVariables": {}, "method": "GET", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/eid-table/vni-table/12/vrf-subtable/local-mappings/local-mapping/loc_map_1", + "preRequestScript": null, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"local-mapping\":{\r\n \"id\":\"loc_map_1\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:mac-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"mac\":\"00:11:22:00:11:22\"\r\n },\r\n \"locator-set\":\"loc_1\"\r\n }\r\n}" + }, + { + "folder": null, + "id": "0ce07f8f-0e45-ea05-4c62-76d7076a444f", + "name": "Negative Case - Locator set loc_1 as empty", + "dataMode": "raw", "data": [], + "descriptionFormat": null, + "description": "Add new locator set\n\nequivalent of \n \n lisp_add_del_locator_set is_add 1 locator_set_name loc_1\n \ncan be verified with \n\n lisp_locator_set_dump\n\nRequests to add empty locator-sets will be rejected", + "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", + "method": "PUT", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/locator-sets/locator-set/loc_1", + "preRequestScript": null, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{ \n \"locator-set\":{ \n \"name\":\"loc_1\"\n }\n}" + }, + { + "folder": null, + "id": "0ce2444e-3779-c247-6f0a-e9aabc7536eb", + "name": "Get remote positive mapping - Operational - Vrf", "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "can be verified with\n\n lisp_eid_table_dump eid_set 1 prefix_len 32 vni 12 eid_type 0 eid 192.168.2.1 filter 2", + "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", + "method": "GET", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/eid-table/vni-table/12/vrf-subtable/remote-mappings/remote-mapping/remote_map_3", + "preRequestScript": null, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475134410953, - "name": "Get Vrf Subtable 10 Config", - "description": "", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\r\n \"vni-table\":{\r\n \"virtual-network-identifier\":\"12\",\r\n \"vrf-subtable\":{\r\n \t\"table-id\":10\r\n }\r\n }\r\n}" + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"remote-mapping\":{\r\n \"id\":\"remote_map_1\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.1\"\r\n },\r\n \r\n \"negative-mapping\":{\r\n \"map-reply-action\":\"no-action\"\r\n }\r\n \r\n }\r\n}" }, { - "id": "0f796bd9-87c8-0004-a3e7-25555d648b7e", + "folder": null, + "id": "11cf57b3-d985-6dc2-805a-8d408679b35b", + "name": "Get adjacency - Config", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "Add new adjacency\nThere must be existing local/remote mappings to specified eid's\n\nequivalent of \n\n lisp_add_del_adjacency is_add 1 vni 12 eid_type 0 deid 192.168.2.1 seid 192.168.2.3 deid_len 32 seid_len 32\n\nright now no dump variant is existing in api", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", + "method": "GET", + "pathVariables": {}, "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/vrf-subtable/remote-mappings/remote-mapping/remote_map_1/adjacencies/adjacency/adj_1", "preRequestScript": null, - "pathVariables": {}, - "method": "PUT", - "data": [], - "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1478093498704, - "name": "Add adjacency", - "description": "Add new adjacency\nThere must be existing local/remote mappings to specified eid's\n\nequivalent of \n\n lisp_add_del_adjacency is_add 1 vni 12 eid_type 0 deid 192.168.2.1 seid 192.168.2.3 deid_len 32 seid_len 32\n\nright now no dump variant is existing in api", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", "rawModeData": "{\r\n \"adjacency\":{\r\n \"id\":\"adj_1\",\r\n \"local-eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.1\"\r\n },\r\n \"remote-eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.5\"\r\n }\r\n }\r\n}" }, { - "id": "107a0853-c530-eb1a-0a3c-bcc382f1bc60", + "folder": null, + "id": "14239ebd-752b-e2f6-ba5f-4fdb79819b92", + "name": "Add Locator set loc_1 with locator for local0 copy", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "Add new locator set\n\nequivalent of \n \n lisp_add_del_locator_set is_add 1 locator_set_name loc_1\n \ncan be verified with \n\n lisp_locator_set_dump\n\nRequests to add empty locator-sets will be rejected", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/eid-table/vni-table/12/vrf-subtable/local-mappings/local-mapping/loc_map_1", - "preRequestScript": null, + "method": "DELETE", "pathVariables": {}, - "method": "GET", - "data": [], - "dataMode": "raw", + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/locator-sets/locator-set/loc_1", + "preRequestScript": null, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475137494203, - "name": "Get local mapping loc_map_1 Operational", - "description": "Get details about local mapping\n\nequivalent of\n \n lisp_eid_table_dump eid_set 1 prefix_length 32 vni 12 eid_type 0 eid 192.168.2.1 filter 1", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\r\n \"local-mapping\":{\r\n \"id\":\"loc_map_1\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:mac-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"mac\":\"00:11:22:00:11:22\"\r\n },\r\n \"locator-set\":\"loc_1\"\r\n }\r\n}" + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{ \n \"locator-set\":{ \n \"name\":\"loc_1\",\n \"interface\":{ \n \"interface-ref\":\"local0\",\n \"priority\":\"2\",\n \"weight\":\"3\"\n }\n }\n}" }, { - "id": "121017cd-63f8-231d-5676-f8e2d4f2961f", + "folder": null, + "id": "1493eeb4-7306-9770-a2ed-4a59763240d1", + "name": "Add local mapping loc_map_2 Operational", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "Adds new local mapping\n\nequivalent of \n\n lisp_add_del_local_eid is_add 1 eid_type 0 eid 192.168.2.1 prefix_len 32 vni 12 locator_set_name loc_1\n \ncan be verified with\n\n lisp_eid_table_dump eid_set 1 prefix_length 32 vni 12 eid_type 0 eid 192.168.2.1 filter 1\n \n", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/eid-table/vni-table/12/bridge-domain-subtable", - "preRequestScript": null, - "pathVariables": {}, "method": "GET", - "data": [], - "dataMode": "raw", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/vrf-subtable/local-mappings/local-mapping/loc_map_1", + "preRequestScript": null, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475134503510, - "name": "Get Bridge Domain Subtable 10 Operational", - "description": "", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\r\n \"vni-table\":{\r\n \"virtual-network-identifier\":\"12\",\r\n \"vrf-subtable\":{\r\n \t\"table-id\":10\r\n }\r\n }\r\n}" + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"local-mapping\":{\r\n \"id\":\"loc_map_1\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.1\"\r\n },\r\n \"locator-set\":\"loc_1\"\r\n }\r\n}" }, { - "id": "1b0fd1f1-17f3-8de6-acf7-d9cd7f2c0b70", + "id": "1a65220c-e906-c56c-9d32-4ee27e30cfbd", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/locator-sets/locator-set/loc_1/interface/GigabitEthernet0%2F8%2F0", + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/map-register", "preRequestScript": null, "pathVariables": {}, - "method": "GET", + "method": "PUT", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475133840119, - "name": "Get Locator for GigabitEthernet0/8/0", - "description": "Reads data of specified locator\n\nequivalent of\n\n lisp_locator_dump locator_set_index INDEX", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", + "time": 1489065869736, + "name": "Enable map-register", + "description": "", + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", "responses": [], - "rawModeData": "{\r\n \"locator-set\":{\r\n \"name\":\"loc_1\"\r\n }\r\n}" + "rawModeData": "{\n\t\"map-register\":{\n\t\t\"enabled\":true\t\n\t}\n}" }, { - "id": "1b24f085-9c39-896b-2644-575ae3c2747a", + "id": "1a6bbb6d-467d-dba6-0fc9-230cbcd85c47", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/eid-table/vni-table/12/vrf-subtable/remote-mappings/remote-mapping/remote_map_3", + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/rloc-probe", "preRequestScript": null, "pathVariables": {}, "method": "GET", @@ -182,74 +238,93 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475219335615, - "name": "Get remote positive mapping - Operational - Vrf", - "description": "can be verified with\n\n lisp_eid_table_dump eid_set 1 prefix_len 32 vni 12 eid_type 0 eid 192.168.2.1 filter 2", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", + "time": 1489125008882, + "name": "Get rloc probe config", + "description": "", + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", "responses": [], - "rawModeData": "{\r\n \"remote-mapping\":{\r\n \"id\":\"remote_map_1\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.1\"\r\n },\r\n \r\n \"negative-mapping\":{\r\n \"map-reply-action\":\"no-action\"\r\n }\r\n \r\n }\r\n}" + "rawModeData": "{\n\t\"rloc-probe\":{\n\t\t\"enabled\":true\t\n\t}\n}" }, { - "id": "1d57c0aa-a7bd-cb15-27c3-2f56c608d0ca", + "id": "1d0a2f13-a4d5-69da-2960-e368a67e9129", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/eid-table/vni-table/12/vrf-subtable", + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/map-request-mode", "preRequestScript": null, "pathVariables": {}, - "method": "GET", + "method": "PUT", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475134928876, - "name": "Get Vrf Subtable 10 Operational", + "time": 1489125138809, + "name": "Put Map request mode", "description": "", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", "responses": [], - "rawModeData": "{\r\n \"vni-table\":{\r\n \"virtual-network-identifier\":\"12\",\r\n \"vrf-subtable\":{\r\n \t\"table-id\":10\r\n }\r\n }\r\n}" + "rawModeData": "{\n\t\"map-request-mode\":{\n\t\t\"mode\":\"source-destination\"\t\n\t}\n}" }, { - "id": "22132e1d-44aa-e5e5-8787-f82cfdac424f", + "id": "1d1c7d25-94af-2dfa-97ec-33710f47d04d", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12", + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/map-servers", "preRequestScript": null, "pathVariables": {}, - "method": "GET", + "method": "PUT", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475136614423, - "name": "Get VNI Table 12 Config", + "time": 1489392003255, + "name": "Put map servers", "description": "", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", "responses": [], - "rawModeData": "{\r\n \"vni-table\":{\r\n \"virtual-network-identifier\":\"12\"\r\n }\r\n}" + "rawModeData": "{\n\t\"map-servers\":{\n\t\t\"map-server\":\n\t\t[\n\t\t\t{\n\t\t\t\t\"ip-address\":\"192.168.2.1\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"ip-address\":\"192.168.2.5\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"ip-address\":\"2001:db8:a0b:12f0::1\"\n\t\t\t}\n\t\t]\n\t}\n}" }, { - "id": "25674e1b-4a81-6723-fa5d-e4e014b1f1d7", + "folder": null, + "id": "1e18c440-3841-2cdd-9a88-cd4bde729a17", + "name": "Get Bridge Domain Subtable 10 Operational", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/config/lisp:lisp", - "preRequestScript": null, + "method": "GET", "pathVariables": {}, - "method": "DELETE", - "data": [], - "dataMode": "raw", + "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/eid-table/vni-table/12/bridge-domain-subtable", + "preRequestScript": null, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474459135535, - "name": "Delete Lisp", + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"vni-table\":{\r\n \"virtual-network-identifier\":\"12\",\r\n \"vrf-subtable\":{\r\n \"table-id\":10\r\n }\r\n }\r\n}" + }, + { + "folder": null, + "id": "2506fe37-668b-7d0b-a76e-a592263dee65", + "name": "Get Bridge Domain Subtable 10 Config", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, "description": "", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\r\n \"lisp\":{\r\n \"enable\":\"true\",\r\n \"eid-table\": {\r\n \"vni-table\": [\r\n {\r\n \"virtual-network-identifier\": 0,\r\n \"remote-mappings\": {},\r\n \"table-id\": 0,\r\n \"local-mappings\": {},\r\n \"adjacencies\": {}\r\n }\r\n ]\r\n },\r\n \"pitr-cfg\":{\r\n \"locator-set\":\"N/A\"\r\n }\r\n } \r\n}" + "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", + "method": "GET", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/bridge-domain-subtable", + "preRequestScript": null, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"vni-table\":{\r\n \"virtual-network-identifier\":\"12\",\r\n \"vrf-subtable\":{\r\n \"table-id\":10\r\n }\r\n }\r\n}" }, { - "id": "27153df9-e0d5-1d23-4eb5-62d412ed181b", + "id": "29c9a114-5552-701b-787d-895a8b03f2a6", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/config/lisp:lisp", + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/rloc-probe", "preRequestScript": null, "pathVariables": {}, "method": "PUT", @@ -258,17 +333,17 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475133618453, - "name": "Enable Lisp", - "description": "Enables Lisp feature\n\nequivalent of \n\n lisp_enable_disable is_en 1\n\ncan be verified with \n\n show_lisp_status", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", + "time": 1489124966053, + "name": "Enable rloc-probe", + "description": "", + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", "responses": [], - "rawModeData": "{\r\n \"lisp\":{\r\n \"enable\":\"true\"\r\n } \r\n}" + "rawModeData": "{\n\t\"rloc-probe\":{\n\t\t\"enabled\":true\t\n\t}\n}" }, { - "id": "2eb7f81a-9ebb-12f2-64ff-304fc204169a", + "id": "2ab426c2-1c94-fe0b-08a4-c2579f6fea3d", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/bridge-domain-subtable/remote-mappings/remote-mapping/remote_map_2", + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/petr-cfg", "preRequestScript": null, "pathVariables": {}, "method": "PUT", @@ -277,55 +352,149 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475227732347, - "name": "Add remote negative mapping - Bridge Domain", - "description": "Adds new remote mapping with negative mapping\n\nequivalent of \n\n lisp_add_del_remote_mapping is_add 1 vni 12 action 0 eid_type 0 eid 192.168.2.1 eid_len 32\n\ncan be verified with\n\n lisp_eid_table_dump eid_set 1 prefix_len 32 vni 12 eid_type 0 eid 192.168.2.1 filter 2", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\r\n \"remote-mapping\":{\r\n \"id\":\"remote_map_2\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:mac-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"mac\":\"aa:bb:aa:aa:aa:aa\"\r\n },\r\n \"map-reply\":{\r\n \t\"map-reply-action\":\"no-action\"\r\n }\r\n }\r\n}" + "time": 1489392797864, + "name": "Add Petr use", + "description": "", + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\n \"petr-cfg\": {\n \"petr-address\":\"2001:db8:a0b:12f0::2\"\n } \n}" }, { - "id": "383d2f9b-54f7-c924-dff9-b2bd96b08573", + "folder": null, + "id": "32abc7d1-bdcf-26f3-c726-a385b3b86ec5", + "name": "Add adjacency", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "Add new adjacency\nThere must be existing local/remote mappings to specified eid's\n\nequivalent of \n\n lisp_add_del_adjacency is_add 1 vni 12 eid_type 0 deid 192.168.2.1 seid 192.168.2.3 deid_len 32 seid_len 32\n\nright now no dump variant is existing in api", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/eid-table/vni-table/12/vrf-subtable/remote-mappings/remote-mapping/remote_map_1/adjacencies/adjacency/adj_1", - "preRequestScript": null, + "method": "PUT", "pathVariables": {}, - "method": "GET", + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/vrf-subtable/remote-mappings/remote-mapping/remote_map_1/adjacencies/adjacency/adj_1", + "preRequestScript": null, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"adjacency\":{\r\n \"id\":\"adj_1\",\r\n \"local-eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.1\"\r\n },\r\n \"remote-eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.5\"\r\n }\r\n }\r\n}" + }, + { + "folder": null, + "id": "32cdac07-fe1b-ae10-1e3d-9c5e64c8fbe7", + "name": "Delete bridge testBD", + "dataMode": "raw", "data": [], + "descriptionFormat": null, + "description": "Creates bridgfe domain. Corresponds to invoking:\n\nvat# bridge_domain_add_del bd_id [bd_id] learn 0 forward 0 uu-flood 0 flood 1 arp-term 0\n\nTo verify run:\n\nvppctl show bridge-domain [bd_id] detail", + "headers": "Content-Type: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n", + "method": "DELETE", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/config/v3po:vpp/bridge-domains/bridge-domain/testBD", + "preRequestScript": "", + "tests": "", + "currentHelper": "normal", + "helperAttributes": {}, + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"bridge-domain\": [\r\n {\r\n \"name\": \"testBD\",\r\n \"flood\": \"true\",\r\n \"forward\": \"false\",\r\n \"learn\": \"false\",\r\n \"unknown-unicast-flood\": \"false\",\r\n \"arp-termination\": \"false\"\r\n }\r\n ]\r\n}" + }, + { + "folder": null, + "id": "36a847e5-e3b8-ff07-4e88-f5a841fcaca6", + "name": "Delete Lisp", "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "", + "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", + "method": "DELETE", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/config/lisp:lisp", + "preRequestScript": null, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1478093569104, - "name": "Get adjacency - Operational", - "description": "Add new adjacency\nThere must be existing local/remote mappings to specified eid's\n\nequivalent of \n\n lisp_add_del_adjacency is_add 1 vni 12 eid_type 0 deid 192.168.2.1 seid 192.168.2.3 deid_len 32 seid_len 32\n\nright now no dump variant is existing in api", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\r\n \"adjacency\":{\r\n \"id\":\"adj_1\",\r\n \"local-eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.1\"\r\n },\r\n \"remote-eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.5\"\r\n }\r\n }\r\n}" + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"lisp\":{\r\n \"enable\":\"true\",\r\n \"eid-table\": {\r\n \"vni-table\": [\r\n {\r\n \"virtual-network-identifier\": 0,\r\n \"remote-mappings\": {},\r\n \"table-id\": 0,\r\n \"local-mappings\": {},\r\n \"adjacencies\": {}\r\n }\r\n ]\r\n },\r\n \"pitr-cfg\":{\r\n \"locator-set\":\"N/A\"\r\n }\r\n } \r\n}" }, { - "id": "39cdad3e-55e7-c091-835a-7b8956ad528b", + "folder": null, + "id": "385ab15d-6e4e-9fe9-9f4a-244a64f90c21", + "name": "Add Locator for GigabitEthernet0/8/0", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "Add locator under locator-set\n\nequivalent of \n\n lisp_add_del_locator is_add 1 locator_set_name loc_1 sw_if_index INDEX priority 2 weight 3\n\ncan be verified with \n\n lisp_locator_dump locator_set_index INDEX ", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/vrf-subtable/remote-mappings/remote-mapping/remote_map_3", + "method": "PUT", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/locator-sets/locator-set/loc_1/interface/GigabitEthernet0%2F8%2F0", "preRequestScript": null, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"interface\":{\r\n \"interface-ref\":\"GigabitEthernet0/8/0\",\r\n \"priority\":\"2\",\r\n \"weight\":\"3\"\r\n }\r\n}" + }, + { + "folder": null, + "id": "3c3d5346-fd09-0c1b-31dc-5e549c1a4adb", + "name": "Get Vrf Subtable 10 Operational", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "", + "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", + "method": "GET", "pathVariables": {}, - "method": "PUT", + "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/eid-table/vni-table/12/vrf-subtable", + "preRequestScript": null, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"vni-table\":{\r\n \"virtual-network-identifier\":\"12\",\r\n \"vrf-subtable\":{\r\n \"table-id\":10\r\n }\r\n }\r\n}" + }, + { + "folder": null, + "id": "3fe6bbb8-eca4-8b49-9092-1300aeac51e0", + "name": "Get Locator set loc_1 Config", + "dataMode": "raw", "data": [], + "descriptionFormat": null, + "description": "Add new locator set\n\nequivalent of \n \n lisp_add_del_locator_set is_add 1 locator_set_name loc_1\n \ncan be verified with \n\n lisp_locator_set_dump\n\nRequests to add empty locator-sets will be rejected", + "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", + "method": "GET", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/locator-sets/locator-set/loc_1", + "preRequestScript": null, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{ \n \"locator-set\":{ \n \"name\":\"loc_1\",\n \"interface\":{ \n \"interface-ref\":\"local0\",\n \"priority\":\"2\",\n \"weight\":\"3\"\n }\n }\n}" + }, + { + "folder": null, + "id": "44c349c4-c0ca-f5d9-53e1-8bf92eca5c73", + "name": "Add subtable subtree", "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "", + "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", + "method": "PUT", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/vrf-subtable", + "preRequestScript": null, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475219301934, - "name": "Add remote positive mapping - VrfSubtable", - "description": "Adds new remote mapping with positive mapping\n\nequivalent of \n\n lisp_add_del_remote_mapping is_add 1 vni 12 rloc_num NR_OF_LOCATORS rlocs BINARY_DATA eid_type 0 eid 192.168.2.3 eid_len 32\n \nbinary data of remote locators should be in format\n\n [1 byte(ipv4/ipv6), 1 byte(priority), 1 byte(weight), 16 byte(address),...]\n\ncan be verified with\n\n lisp_eid_table_dump eid_set 1 prefix_len 32 vni 12 eid_type 0 eid 192.168.2.3 filter 2", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\r\n \"remote-mapping\":{\r\n \"id\":\"remote_map_3\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.3\"\r\n },\r\n \r\n \"rlocs\":{\r\n \"locator\":{\r\n \"address\":\"192.168.2.2\",\r\n \"priority\":1,\r\n \"weight\":1\r\n }\r\n }\r\n \r\n }\r\n}" + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{ \n \"vrf-subtable\":{ \n \"table-id\":10,\n \"local-mappings\":{ \n \"local-mapping\":{ \n \"id\":\"loc_map_1\",\n \"eid\":{ \n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\n \"virtual-network-id\":\"12\",\n \"ipv4\":\"192.168.2.1\"\n },\n \"locator-set\":\"loc_1\"\n }\n },\n \"remote-mappings\":{ \n \"remote-mapping\":{ \n \"id\":\"remote_map_1\",\n \"eid\":{ \n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\n \"virtual-network-id\":\"12\",\n \"ipv4\":\"192.168.2.5\"\n },\n \"map-reply\":{ \n \"map-reply-action\":\"no-action\"\n }\n }\n }\n }\n}" }, { - "id": "41798cf0-8fa1-ab54-815c-4ae37024aaf0", + "id": "459bacc9-b049-b78f-5d50-7f2a0f8a182e", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/bridge-domain-subtable", + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/petr-cfg", "preRequestScript": null, "pathVariables": {}, "method": "GET", @@ -334,36 +503,92 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475591910686, - "name": "Get Bridge Domain Subtable 10 Config", + "time": 1489065358252, + "name": "Get Petr Config", "description": "", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\r\n \"vni-table\":{\r\n \"virtual-network-identifier\":\"12\",\r\n \"vrf-subtable\":{\r\n \t\"table-id\":10\r\n }\r\n }\r\n}" + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\n \"petr-cfg\": {\n \"petr-address\":\"192.168.2.1\"\n } \n}" }, { - "id": "41e942ed-eea2-5c77-8e2d-c0adead79741", + "folder": null, + "id": "49cc1e34-af2a-0ccc-3beb-dab09c4a7869", + "name": "Get remote negative mapping Config - Bridge Domain", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/operational/eid-mapping-context:contexts", - "preRequestScript": "", + "method": "GET", "pathVariables": {}, + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/bridge-domain-subtable/remote-mappings/remote-mapping/remote_map_2", + "preRequestScript": null, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"remote-mapping\":{\r\n \"id\":\"remote_map_2\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:mac-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"mac\":\"aa:bb:aa:aa:aa:aa\"\r\n },\r\n \"map-reply-action\":\"no-action\"\r\n \r\n }\r\n}" + }, + { + "folder": null, + "id": "4b606776-aa33-ff85-9784-f76d2e457dea", + "name": "Get Locator set loc_1 Operational", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "Reads data of locator set \n\nequivalent of \n \n lisp_locator_set_dump", + "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", "method": "GET", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/locator-sets", + "preRequestScript": null, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"lisp\":{\r\n \"enable\":\"true\"\r\n } \r\n}" + }, + { + "folder": null, + "id": "4ceea4ca-a442-edc1-30d4-4e28e1d15ac3", + "name": "Get Vrf Subtable 10 Config", + "dataMode": "raw", "data": [], + "descriptionFormat": null, + "description": "", + "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", + "method": "GET", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/vrf-subtable", + "preRequestScript": null, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"vni-table\":{\r\n \"virtual-network-identifier\":\"12\",\r\n \"vrf-subtable\":{\r\n \"table-id\":10\r\n }\r\n }\r\n}" + }, + { + "folder": null, + "id": "523f68fe-ee0f-8e28-2a8a-87f6a459e03b", + "name": "Add remote negative mapping - Vrf", "dataMode": "raw", - "tests": "", + "data": [], + "descriptionFormat": null, + "description": "Adds new remote mapping with negative mapping\n\nequivalent of \n\n lisp_add_del_remote_mapping is_add 1 vni 12 action 0 eid_type 0 eid 192.168.2.1 eid_len 32\n\ncan be verified with\n\n lisp_eid_table_dump eid_set 1 prefix_len 32 vni 12 eid_type 0 eid 192.168.2.1 filter 2", + "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", + "method": "PUT", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/vrf-subtable/remote-mappings/remote-mapping/remote_map_1", + "preRequestScript": null, + "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475218811779, - "name": "Eid mapping Context Read", - "description": "", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\r\n \r\n \"interface\": [\r\n {\r\n \"name\": \"testInterface\",\r\n \"description\": \"for testing purposes\",\r\n \"type\": \"iana-if-type:ethernetCsmacd\",\r\n \"enabled\": \"true\",\r\n \"link-up-down-trap-enable\": \"enabled\",\r\n \"ietf-ip:ipv4\": {\r\n \"enabled\": \"true\",\r\n \"mtu\": \"1500\",\r\n \"address\": [\r\n {\r\n \"ip\": \"1.2.3.0\",\r\n \"netmask\": \"255.255.255.0\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n \r\n}" + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"remote-mapping\":{\r\n \"id\":\"remote_map_1\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.5\"\r\n },\r\n \"map-reply\":{\r\n \"map-reply-action\":\"no-action\"\r\n }\r\n \r\n }\r\n}" }, { - "id": "4f3d5d14-e397-5dca-bcf3-c64585fab175", + "id": "531ac705-5ed0-04bc-fb4b-43e729b7c4e4", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/eid-table/vni-table/12", + "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/map-register", "preRequestScript": null, "pathVariables": {}, "method": "GET", @@ -372,93 +597,150 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475136655292, - "name": "Get VNI Table 12 Operational", + "time": 1489066019718, + "name": "Map Register operational", "description": "", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", "responses": [], - "rawModeData": "{\r\n \"vni-table\":{\r\n \"virtual-network-identifier\":\"12\"\r\n }\r\n}" + "rawModeData": "{\n\t\"map-register\":{\n\t\t\"enabled\":true\t\n\t}\n}" }, { - "id": "577ba8a1-67b5-571f-903a-f44908c0d656", + "folder": null, + "id": "5462a723-5b0c-34f0-1359-5e53a77e3a52", + "name": "Add local mapping loc_map_2 - Bridge Domain", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "Adds new local mapping\n\nequivalent of \n\n lisp_add_del_local_eid is_add 1 eid_type 0 eid 192.168.2.1 prefix_len 32 vni 12 locator_set_name loc_1\n \ncan be verified with\n\n lisp_eid_table_dump eid_set 1 prefix_length 32 vni 12 eid_type 0 eid 192.168.2.1 filter 1\n \n", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", + "method": "PUT", + "pathVariables": {}, "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/bridge-domain-subtable/local-mappings/local-mapping/loc_map_2", "preRequestScript": null, - "pathVariables": {}, - "method": "PUT", - "data": [], - "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475148700293, - "name": "Add local mapping loc_map_2 - Bridge Domain", - "description": "Adds new local mapping\n\nequivalent of \n\n lisp_add_del_local_eid is_add 1 eid_type 0 eid 192.168.2.1 prefix_len 32 vni 12 locator_set_name loc_1\n \ncan be verified with\n\n lisp_eid_table_dump eid_set 1 prefix_length 32 vni 12 eid_type 0 eid 192.168.2.1 filter 1\n \n", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", "rawModeData": "{\r\n \"local-mapping\":{\r\n \"id\":\"loc_map_2\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:mac-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"mac\":\"aa:aa:aa:aa:aa:aa\"\r\n },\r\n \"locator-set\":\"loc_1\"\r\n }\r\n}" }, { - "id": "583ae0f4-cce5-4084-098d-e85e9dcd1d2e", + "folder": null, + "id": "54de6ea7-94a6-e8f2-1ed5-c209d8e3c25f", + "name": "Add remote negative mapping - Bridge Domain", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "Adds new remote mapping with negative mapping\n\nequivalent of \n\n lisp_add_del_remote_mapping is_add 1 vni 12 action 0 eid_type 0 eid 192.168.2.1 eid_len 32\n\ncan be verified with\n\n lisp_eid_table_dump eid_set 1 prefix_len 32 vni 12 eid_type 0 eid 192.168.2.1 filter 2", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/pitr-cfg", - "preRequestScript": null, + "method": "PUT", "pathVariables": {}, - "method": "GET", + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/bridge-domain-subtable/remote-mappings/remote-mapping/remote_map_2", + "preRequestScript": null, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"remote-mapping\":{\r\n \"id\":\"remote_map_2\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:mac-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"mac\":\"aa:bb:aa:aa:aa:aa\"\r\n },\r\n \"map-reply\":{\r\n \"map-reply-action\":\"no-action\"\r\n }\r\n }\r\n}" + }, + { + "folder": null, + "id": "5ac994f5-18e3-5101-23c1-32995dae6ec9", + "name": "Get map resolver - Config", + "dataMode": "raw", "data": [], + "descriptionFormat": null, + "description": "Adds new map resolver\n\nequivalent of\n\n lisp_add_del_map_resolver is_add 1 is_ipv6 0 ip_address 192.168.2.1\n\ncan be verified with\n \n lisp_map_resolver_dump", + "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", + "method": "GET", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/state/lisp:lisp/lisp-feature-data/map-resolvers/map-resolver/192.168.2.1", + "preRequestScript": null, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"map-resolver\":{\r\n \"ip-address\":\"192.168.2.1\"\r\n }\r\n}" + }, + { + "folder": null, + "id": "61af7f4c-6071-e881-cfbc-548abab4ba9f", + "name": "Get Locator for GigabitEthernet0/8/0", "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "Reads data of specified locator\n\nequivalent of\n\n lisp_locator_dump locator_set_index INDEX", + "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", + "method": "GET", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/locator-sets/locator-set/loc_1/interface/GigabitEthernet0%2F8%2F0", + "preRequestScript": null, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475225553971, + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"locator-set\":{\r\n \"name\":\"loc_1\"\r\n }\r\n}" + }, + { + "folder": null, + "id": "65167fb8-0d64-d13e-27ad-0f7d3e8c7fe4", "name": "Get Pitr-cfg ", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, "description": "Reads Pitr feature status\n\nequivalent of\n\n show_lisp_pitr", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], + "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", + "method": "GET", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/pitr-cfg", + "preRequestScript": null, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", "rawModeData": "{\n \"pitr-cfg\": {\n \"locator-set\": \"N/A\"\n } \n}" }, { - "id": "591d677e-7f6e-aed1-3097-7a913378f943", + "folder": null, + "id": "70790149-793f-242a-ebb8-032188d5bce5", + "name": "Get remote positive mapping - Operational - Bridge Domain", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "can be verified with\n\n lisp_eid_table_dump eid_set 1 prefix_len 32 vni 12 eid_type 0 eid 192.168.2.1 filter 2", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/bridge-domain-subtable/local-mappings/local-mapping/loc_map_2", - "preRequestScript": null, - "pathVariables": {}, "method": "GET", - "data": [], - "dataMode": "raw", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/eid-table/vni-table/12/bridge-domain-subtable/remote-mappings/remote-mapping/remote_map_4", + "preRequestScript": null, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475150573935, - "name": "Add local mapping loc_map_2 Config", - "description": "Adds new local mapping\n\nequivalent of \n\n lisp_add_del_local_eid is_add 1 eid_type 0 eid 192.168.2.1 prefix_len 32 vni 12 locator_set_name loc_1\n \ncan be verified with\n\n lisp_eid_table_dump eid_set 1 prefix_length 32 vni 12 eid_type 0 eid 192.168.2.1 filter 1\n \n", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\r\n \"local-mapping\":{\r\n \"id\":\"loc_map_1\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.1\"\r\n },\r\n \"locator-set\":\"loc_1\"\r\n }\r\n}" + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"remote-mapping\":{\r\n \"id\":\"remote_map_1\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.1\"\r\n },\r\n \r\n \"negative-mapping\":{\r\n \"map-reply-action\":\"no-action\"\r\n }\r\n \r\n }\r\n}" }, { - "id": "5e529c91-698a-9186-50e4-ee2b718825f8", + "folder": null, + "id": "749351c9-3d31-cd54-500f-a628c7e134cd", + "name": "Get remote negative mapping Operational - Vrf", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "Reads data of remote mapping\n\nequivalent of \n\n lisp_eid_table_dump eid_set 1 prefix_len 32 vni 12 eid_type 0 eid 192.168.2.3 filter 2", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/map-resolvers/map-resolver/192.168.2.1", - "preRequestScript": null, - "pathVariables": {}, "method": "GET", - "data": [], - "dataMode": "raw", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/eid-table/vni-table/12/vrf-subtable/remote-mappings/remote-mapping/remote_map_1", + "preRequestScript": null, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475223688546, - "name": "Get map resolver - Operational", - "description": "Reads data of map resolver\n\nequivalent of \n\n lisp_map_resolver_dump", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\r\n \"map-resolver\":{\r\n \"ip-address\":\"192.168.2.1\"\r\n }\r\n}" + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"remote-mapping\":{\r\n \"id\":\"remote_map_2\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.1\"\r\n },\r\n \r\n \"rlocs\":{\r\n \"locator\":{\r\n \"address\":\"192.168.2.2\",\r\n \"priority\":1,\r\n \"weight\":1\r\n }\r\n }\r\n \r\n }\r\n}" }, { - "id": "60d70464-6b98-fa69-f405-631c0c525be5", + "id": "7a314526-67d0-d126-009a-656e6cf99f1e", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/locator-sets/locator-set/loc_1", + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/map-servers", "preRequestScript": null, "pathVariables": {}, "method": "GET", @@ -467,36 +749,74 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475133885528, - "name": "Get Locator set loc_1 Config", - "description": "Add new locator set\n\nequivalent of \n \n lisp_add_del_locator_set is_add 1 locator_set_name loc_1\n \ncan be verified with \n\n lisp_locator_set_dump\n\nRequests to add empty locator-sets will be rejected", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", + "time": 1489125350941, + "name": "Get map server config", + "description": "", + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", "responses": [], - "rawModeData": "{ \n \"locator-set\":{ \n \"name\":\"loc_1\",\n \"interface\":{ \n \"interface-ref\":\"local0\",\n \"priority\":\"2\",\n \"weight\":\"3\"\n }\n }\n}" + "rawModeData": "{\n\t\"map-servers\":{\n\t\t\"map-server\":\n\t\t[\n\t\t\t{\n\t\t\t\t\"ip-address\":\"192.168.2.1\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"ip-address\":\"192.168.2.5\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"ip-address\":\"2001:0db8:0a0b:12f0:0000:0000:0000:0001\"\n\t\t\t}\n\t\t]\n\t}\n}" }, { - "id": "63ada212-fd75-3897-8df4-94530d9ec162", + "folder": null, + "id": "7a748095-2530-5bbd-7e5d-6d1cbd225c65", + "name": "Get remote negative mapping Config - Vrf", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "Reads data of remote mapping\n\nequivalent of \n\n lisp_eid_table_dump eid_set 1 prefix_len 32 vni 12 eid_type 0 eid 192.168.2.3 filter 2", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/bridge-domain-subtable/remote-mappings/remote-mapping/remote_map_4", - "preRequestScript": null, + "method": "GET", "pathVariables": {}, - "method": "PUT", + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/vrf-subtable/remote-mappings/remote-mapping/remote_map_1", + "preRequestScript": null, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"remote-mapping\":{\r\n \"id\":\"remote_map_2\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.1\"\r\n },\r\n \r\n \"rlocs\":{\r\n \"locator\":{\r\n \"address\":\"192.168.2.2\",\r\n \"priority\":1,\r\n \"weight\":1\r\n }\r\n }\r\n \r\n }\r\n}" + }, + { + "folder": null, + "id": "7beac5a7-38d0-dd68-2e65-352418c285fd", + "name": "Negative Case - Add VNI Table 12", + "dataMode": "raw", "data": [], + "descriptionFormat": null, + "description": "Adding empty vni reference is disallowed/not possible.\nIt can be added only if vrf-subtable/bridge-domain-subtable", + "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", + "method": "PUT", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12", + "preRequestScript": null, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"vni-table\":{\r\n \"virtual-network-identifier\":\"12\"\r\n }\r\n}" + }, + { + "folder": null, + "id": "7eaaefcc-784b-897f-dde1-0d47741dfe56", + "name": "Add Bridge Domain Subtable 10", "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "", + "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", + "method": "PUT", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/bridge-domain-subtable", + "preRequestScript": null, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475222635853, - "name": "Add remote positive mapping - Bridge Domain", - "description": "Adds new remote mapping with positive mapping\n\nequivalent of \n\n lisp_add_del_remote_mapping is_add 1 vni 12 rloc_num NR_OF_LOCATORS rlocs BINARY_DATA eid_type 0 eid 192.168.2.3 eid_len 32\n \nbinary data of remote locators should be in format\n\n [1 byte(ipv4/ipv6), 1 byte(priority), 1 byte(weight), 16 byte(address),...]\n\ncan be verified with\n\n lisp_eid_table_dump eid_set 1 prefix_len 32 vni 12 eid_type 0 eid 192.168.2.3 filter 2", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\r\n \"remote-mapping\":{\r\n \"id\":\"remote_map_4\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:mac-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"mac\":\"aa:bb:cc:aa:bb:cc\"\r\n },\r\n \r\n \"rlocs\":{\r\n \"locator\":{\r\n \"address\":\"192.168.2.3\",\r\n \"priority\":1,\r\n \"weight\":2\r\n }\r\n }\r\n \r\n }\r\n}" + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n\r\n \"bridge-domain-subtable\":{\r\n \"bridge-domain-ref\":\"testBD\"\r\n }\r\n}" }, { - "id": "706257fe-47ce-c0ca-ccd5-0e5cfdb1becb", + "id": "8c8ee757-8bac-5e86-d5d6-3cb8c89ccac5", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/config/lisp:lisp", + "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/map-servers", "preRequestScript": null, "pathVariables": {}, "method": "GET", @@ -505,36 +825,36 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475133788195, - "name": "Get Lisp Config", + "time": 1489125378144, + "name": "Get map server operational", "description": "", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", "responses": [], - "rawModeData": "{\r\n \"lisp\":{\r\n \"enable\":\"true\"\r\n } \r\n}" + "rawModeData": "{\n\t\"map-servers\":{\n\t\t\"map-server\":\n\t\t[\n\t\t\t{\n\t\t\t\t\"ip-address\":\"192.168.2.1\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"ip-address\":\"192.168.2.5\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"ip-address\":\"2001:0db8:0a0b:12f0:0000:0000:0000:0001\"\n\t\t\t}\n\t\t]\n\t}\n}" }, { - "id": "70ab7906-c783-ae9f-487e-28505dace49c", + "folder": null, + "id": "8f3ede8b-aab7-ac3b-3041-9cdb7bc0e6ec", + "name": "Add local mapping loc_map_1 - Vrf ", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "Adds new local mapping\n\nequivalent of \n\n lisp_add_del_local_eid is_add 1 eid_type 0 eid 192.168.2.1 prefix_len 32 vni 12 locator_set_name loc_1\n \ncan be verified with\n\n lisp_eid_table_dump eid_set 1 prefix_length 32 vni 12 eid_type 0 eid 192.168.2.1 filter 1\n \n", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/vrf-subtable", - "preRequestScript": null, - "pathVariables": {}, "method": "PUT", - "data": [], - "dataMode": "raw", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/vrf-subtable/local-mappings/local-mapping/loc_map_1", + "preRequestScript": null, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475137137792, - "name": "Add Vrf Subtable 10", - "description": "", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\r\n \"vrf-subtable\":{\r\n \t\"table-id\":10\r\n }\r\n}" + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{ \n \n \n \"local-mapping\":{ \n \"id\":\"loc_map_1\",\n \"eid\":{ \n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\n \"virtual-network-id\":\"12\",\n \"ipv4\":\"192.168.2.1\"\n },\n \"locator-set\":\"loc_1\"\n }\n\n}" }, { - "id": "799ee5a8-5ca6-b09a-da84-ebe7ee7dc34b", + "id": "a0babf59-f72b-3412-3146-52e6312e063f", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/bridge-domain-subtable/remote-mappings/remote-mapping/remote_map_2", + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/map-request-mode", "preRequestScript": null, "pathVariables": {}, "method": "GET", @@ -543,36 +863,36 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475219098376, - "name": "Get remote negative mapping Config - Bridge Domain", + "time": 1489125169469, + "name": "Get map request config", "description": "", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", "responses": [], - "rawModeData": "{\r\n \"remote-mapping\":{\r\n \"id\":\"remote_map_2\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:mac-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"mac\":\"aa:bb:aa:aa:aa:aa\"\r\n },\r\n \"map-reply-action\":\"no-action\"\r\n \r\n }\r\n}" + "rawModeData": "{\n\t\"map-request-mode\":{\n\t\t\"mode\":\"source-destination\"\t\n\t}\n}" }, { - "id": "7d27fd46-87c3-4012-61f2-8b48a6d424aa", + "folder": null, + "id": "a517428f-a35e-5e75-5e5b-7f560d42332b", + "name": "Get VNI Table 12 Config", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/vrf-subtable/remote-mappings/remote-mapping/remote_map_1/adjacencies/adjacency/adj_1", - "preRequestScript": null, - "pathVariables": {}, "method": "GET", - "data": [], - "dataMode": "raw", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12", + "preRequestScript": null, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1478093588436, - "name": "Get adjacency - Config", - "description": "Add new adjacency\nThere must be existing local/remote mappings to specified eid's\n\nequivalent of \n\n lisp_add_del_adjacency is_add 1 vni 12 eid_type 0 deid 192.168.2.1 seid 192.168.2.3 deid_len 32 seid_len 32\n\nright now no dump variant is existing in api", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\r\n \"adjacency\":{\r\n \"id\":\"adj_1\",\r\n \"local-eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.1\"\r\n },\r\n \"remote-eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.5\"\r\n }\r\n }\r\n}" + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"vni-table\":{\r\n \"virtual-network-identifier\":\"12\"\r\n }\r\n}" }, { - "id": "8dfbeb8c-f27c-48df-9022-cc34489eb0c3", + "id": "ac4e4f66-fab7-fbbc-ca89-00bafd242361", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/eid-table/vni-table/12/bridge-domain-subtable/remote-mappings/remote-mapping/remote_map_4", + "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/rloc-probe", "preRequestScript": null, "pathVariables": {}, "method": "GET", @@ -581,36 +901,36 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475222738545, - "name": "Get remote positive mapping - Operational - Bridge Domain", - "description": "can be verified with\n\n lisp_eid_table_dump eid_set 1 prefix_len 32 vni 12 eid_type 0 eid 192.168.2.1 filter 2", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", + "time": 1489125022692, + "name": "Get rloc probe operational", + "description": "", + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", "responses": [], - "rawModeData": "{\r\n \"remote-mapping\":{\r\n \"id\":\"remote_map_1\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.1\"\r\n },\r\n \r\n \"negative-mapping\":{\r\n \"map-reply-action\":\"no-action\"\r\n }\r\n \r\n }\r\n}" + "rawModeData": "{\n\t\"rloc-probe\":{\n\t\t\"enabled\":true\t\n\t}\n}" }, { - "id": "97ff7203-2730-c03f-8582-6fb89857dc72", + "folder": null, + "id": "ad739651-3137-a535-5066-28a313cf7aa2", + "name": "Add remote positive mapping - VrfSubtable", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "Adds new remote mapping with positive mapping\n\nequivalent of \n\n lisp_add_del_remote_mapping is_add 1 vni 12 rloc_num NR_OF_LOCATORS rlocs BINARY_DATA eid_type 0 eid 192.168.2.3 eid_len 32\n \nbinary data of remote locators should be in format\n\n [1 byte(ipv4/ipv6), 1 byte(priority), 1 byte(weight), 16 byte(address),...]\n\ncan be verified with\n\n lisp_eid_table_dump eid_set 1 prefix_len 32 vni 12 eid_type 0 eid 192.168.2.3 filter 2", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/eid-table/vni-table/12/bridge-domain-subtable/remote-mappings/remote-mapping/remote_map_2", - "preRequestScript": null, + "method": "PUT", "pathVariables": {}, - "method": "GET", - "data": [], - "dataMode": "raw", + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/vrf-subtable/remote-mappings/remote-mapping/remote_map_3", + "preRequestScript": null, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475219116319, - "name": "Get remote negative mapping Operational - Bridge Domain", - "description": "", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\r\n \"remote-mapping\":{\r\n \"id\":\"remote_map_2\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:mac-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"mac\":\"aa:bb:aa:aa:aa:aa\"\r\n },\r\n \"map-reply-action\":\"no-action\"\r\n \r\n }\r\n}" + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"remote-mapping\":{\r\n \"id\":\"remote_map_3\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.3\"\r\n },\r\n \r\n \"rlocs\":{\r\n \"locator\":{\r\n \"address\":\"192.168.2.2\",\r\n \"priority\":1,\r\n \"weight\":1\r\n }\r\n }\r\n \r\n }\r\n}" }, { - "id": "9ed49bf2-8146-b344-be60-916d788357d5", + "id": "b1746c42-9991-7992-b8da-80c025981e9d", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/vrf-subtable/remote-mappings/remote-mapping/remote_map_3", + "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/map-request-mode", "preRequestScript": null, "pathVariables": {}, "method": "GET", @@ -619,190 +939,225 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475219307858, - "name": "Get remote positive mapping - Config - Vrf", - "description": "can be verified with\n\n lisp_eid_table_dump eid_set 1 prefix_len 32 vni 12 eid_type 0 eid 192.168.2.1 filter 2", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", + "time": 1489125180968, + "name": "Get map request operational", + "description": "", + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", "responses": [], - "rawModeData": "{\r\n \"remote-mapping\":{\r\n \"id\":\"remote_map_1\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.1\"\r\n },\r\n \r\n \"negative-mapping\":{\r\n \"map-reply-action\":\"no-action\"\r\n }\r\n \r\n }\r\n}" + "rawModeData": "{\n\t\"map-request-mode\":{\n\t\t\"mode\":\"source-destination\"\t\n\t}\n}" }, { - "id": "9efbb933-5389-bee4-8e2f-a82fcdc1151d", + "folder": null, + "id": "b19d4109-d47a-c368-a7d4-1e5baad88d6d", + "name": "Add Vrf Subtable 10", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/bridge-domain-subtable", - "preRequestScript": null, - "pathVariables": {}, "method": "PUT", - "data": [], + "pathVariables": {}, + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/vrf-subtable", + "preRequestScript": null, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"vrf-subtable\":{\r\n \"table-id\":10\r\n }\r\n}" + }, + { + "folder": null, + "id": "b1c9fcf9-89bf-86c5-a350-60535b748ee9", + "name": "Get Lisp Operational", "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "Reads status of lisp feature\n\nequivalent of \n\n show_lisp_status", + "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", + "method": "GET", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/operational/lisp:lisp-state", + "preRequestScript": null, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475591891745, - "name": "Add Bridge Domain Subtable 10", - "description": "", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\r\n\r\n \"bridge-domain-subtable\":{\r\n \t\"bridge-domain-ref\":\"testBD\"\r\n }\r\n}" + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"lisp\":{\r\n \"enable\":\"true\"\r\n } \r\n}" }, { - "id": "a98dcdc1-a383-4355-6174-d2618a790ebd", + "folder": null, + "id": "bad5a024-ed9f-93d6-da06-1686d675dc50", + "name": "Create bridge testBD", + "dataMode": "raw", + "data": [], + "descriptionFormat": "html", + "description": "Creates bridgfe domain. Corresponds to invoking:\n\nvat# bridge_domain_add_del bd_id [bd_id] learn 0 forward 0 uu-flood 0 flood 1 arp-term 0\n\nTo verify run:\n\nvppctl show bridge-domain [bd_id] detail", "headers": "Content-Type: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n", - "url": "http://localhost:8183/restconf/config/v3po:vpp/bridge-domains/bridge-domain/testBD", + "method": "PUT", "pathVariables": {}, + "url": "http://localhost:8183/restconf/config/v3po:vpp/bridge-domains/bridge-domain/testBD", "preRequestScript": "", - "method": "PUT", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "data": [], - "dataMode": "raw", - "name": "Create bridge testBD", - "description": "Creates bridgfe domain. Corresponds to invoking:\n\nvat# bridge_domain_add_del bd_id [bd_id] learn 0 forward 0 uu-flood 0 flood 1 arp-term 0\n\nTo verify run:\n\nvppctl show bridge-domain [bd_id] detail", - "descriptionFormat": "html", - "time": 1465805138795, - "version": 2, - "responses": [], "tests": "", "currentHelper": "normal", "helperAttributes": {}, + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", "rawModeData": "{\r\n \"bridge-domain\": [\r\n {\r\n \"name\": \"testBD\",\r\n \"flood\": \"true\",\r\n \"forward\": \"false\",\r\n \"learn\": \"false\",\r\n \"unknown-unicast-flood\": \"false\",\r\n \"arp-termination\": \"false\"\r\n }\r\n ]\r\n}" }, { - "id": "b269cb03-c0fc-aa68-c730-b126274dde78", + "folder": null, + "id": "c0611a78-1410-52b6-a886-ca84e4dacb8e", + "name": "Add Locator set loc_1 with locator for local0", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "Add new locator set\n\nequivalent of \n \n lisp_add_del_locator_set is_add 1 locator_set_name loc_1\n \ncan be verified with \n\n lisp_locator_set_dump\n\nRequests to add empty locator-sets will be rejected", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/operational/lisp:lisp-state", - "preRequestScript": null, + "method": "PUT", "pathVariables": {}, - "method": "GET", - "data": [], - "dataMode": "raw", + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/locator-sets/locator-set/loc_1", + "preRequestScript": null, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474450438453, - "name": "Get Lisp Operational", - "description": "Reads status of lisp feature\n\nequivalent of \n\n show_lisp_status", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\r\n \"lisp\":{\r\n \"enable\":\"true\"\r\n } \r\n}" + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{ \n \"locator-set\":{ \n \"name\":\"loc_1\",\n \"interface\":{ \n \"interface-ref\":\"local0\",\n \"priority\":\"2\",\n \"weight\":\"3\"\n }\n }\n}" }, { - "id": "b546cbd7-b598-b419-4dab-b747ea444f23", + "folder": null, + "id": "c50bc4c0-1a64-7130-4b8b-e1f12f55d4d7", + "name": "Add Pitr-cfg", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "Enable Pitr feature \n\nequivalent of \n\n lisp_pitr_set_locator_set is_add 1 ls_name loc_1\n \ncan be verified with\n\n show_lisp_pitr", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/vrf-subtable/remote-mappings/remote-mapping/remote_map_1", - "preRequestScript": null, - "pathVariables": {}, "method": "PUT", - "data": [], - "dataMode": "raw", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/pitr-cfg", + "preRequestScript": null, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475226601650, - "name": "Add remote negative mapping - Vrf", - "description": "Adds new remote mapping with negative mapping\n\nequivalent of \n\n lisp_add_del_remote_mapping is_add 1 vni 12 action 0 eid_type 0 eid 192.168.2.1 eid_len 32\n\ncan be verified with\n\n lisp_eid_table_dump eid_set 1 prefix_len 32 vni 12 eid_type 0 eid 192.168.2.1 filter 2", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\r\n \"remote-mapping\":{\r\n \"id\":\"remote_map_1\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.5\"\r\n },\r\n \"map-reply\":{\r\n \t\"map-reply-action\":\"no-action\"\r\n }\r\n \r\n }\r\n}" + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\n \"pitr-cfg\": {\n \"locator-set\": \"loc_1\"\n } \n}" }, { - "id": "b5e65290-0729-7089-ca3a-7de7454f58fa", + "folder": null, + "id": "c52b0be2-67d4-642b-fd7b-43598f2c4e3f", + "name": "Add map resolver", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "Reads data of map resolver\n\nequivalent of \n\n lisp_map_resolver_dump", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/vrf-subtable/local-mappings/local-mapping/loc_map_1", - "preRequestScript": null, + "method": "PUT", "pathVariables": {}, - "method": "GET", - "data": [], - "dataMode": "raw", + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/map-resolvers/map-resolver/192.168.2.1", + "preRequestScript": null, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475137503248, - "name": "Get local mapping loc_map_1 Config", - "description": "Get details about local mapping\n\nequivalent of\n \n lisp_eid_table_dump eid_set 1 prefix_length 32 vni 12 eid_type 0 eid 192.168.2.1 filter 1", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\r\n \"local-mapping\":{\r\n \"id\":\"loc_map_1\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:mac-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"mac\":\"00:11:22:00:11:22\"\r\n },\r\n \"locator-set\":\"loc_1\"\r\n }\r\n}" + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"map-resolver\":{\r\n \"ip-address\":\"192.168.2.1\"\r\n }\r\n}" }, { - "id": "b5e76988-aee4-19d1-3781-8ab7784af1ab", + "folder": null, + "id": "c99e6e24-5d9c-040a-68f3-5a0dbed98cc1", + "name": "Eid mapping Context Read", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/vrf-subtable/local-mappings/local-mapping/loc_map_1", - "preRequestScript": null, + "method": "GET", "pathVariables": {}, - "method": "PUT", - "data": [], + "url": "http://localhost:8183/restconf/operational/eid-mapping-context:contexts", + "preRequestScript": "", + "tests": "", + "currentHelper": "normal", + "helperAttributes": {}, + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \r\n \"interface\": [\r\n {\r\n \"name\": \"testInterface\",\r\n \"description\": \"for testing purposes\",\r\n \"type\": \"iana-if-type:ethernetCsmacd\",\r\n \"enabled\": \"true\",\r\n \"link-up-down-trap-enable\": \"enabled\",\r\n \"ietf-ip:ipv4\": {\r\n \"enabled\": \"true\",\r\n \"mtu\": \"1500\",\r\n \"address\": [\r\n {\r\n \"ip\": \"1.2.3.0\",\r\n \"netmask\": \"255.255.255.0\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n \r\n}" + }, + { + "folder": null, + "id": "cd18d003-6bc9-cfff-46e8-7dffcd1f8497", + "name": "Add local mapping loc_map_2 Config", "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "Adds new local mapping\n\nequivalent of \n\n lisp_add_del_local_eid is_add 1 eid_type 0 eid 192.168.2.1 prefix_len 32 vni 12 locator_set_name loc_1\n \ncan be verified with\n\n lisp_eid_table_dump eid_set 1 prefix_length 32 vni 12 eid_type 0 eid 192.168.2.1 filter 1\n \n", + "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", + "method": "GET", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/bridge-domain-subtable/local-mappings/local-mapping/loc_map_2", + "preRequestScript": null, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475137444102, - "name": "Add local mapping loc_map_1 - Vrf ", - "description": "Adds new local mapping\n\nequivalent of \n\n lisp_add_del_local_eid is_add 1 eid_type 0 eid 192.168.2.1 prefix_len 32 vni 12 locator_set_name loc_1\n \ncan be verified with\n\n lisp_eid_table_dump eid_set 1 prefix_length 32 vni 12 eid_type 0 eid 192.168.2.1 filter 1\n \n", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", "rawModeData": "{\r\n \"local-mapping\":{\r\n \"id\":\"loc_map_1\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.1\"\r\n },\r\n \"locator-set\":\"loc_1\"\r\n }\r\n}" }, { - "id": "bc81a430-c93c-d9ca-8427-1c4f4a73fcf9", + "folder": null, + "id": "d01b27de-fef9-a333-3075-f431412a56d8", + "name": "Get remote positive mapping - Config - Vrf", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "can be verified with\n\n lisp_eid_table_dump eid_set 1 prefix_len 32 vni 12 eid_type 0 eid 192.168.2.1 filter 2", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/bridge-domain-subtable/remote-mappings/remote-mapping/remote_map_4", - "preRequestScript": null, - "pathVariables": {}, "method": "GET", - "data": [], - "dataMode": "raw", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/vrf-subtable/remote-mappings/remote-mapping/remote_map_3", + "preRequestScript": null, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475222704179, - "name": "Get remote positive mapping - Config - Bridge Domain", - "description": "can be verified with\n\n lisp_eid_table_dump eid_set 1 prefix_len 32 vni 12 eid_type 0 eid 192.168.2.1 filter 2", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", "rawModeData": "{\r\n \"remote-mapping\":{\r\n \"id\":\"remote_map_1\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.1\"\r\n },\r\n \r\n \"negative-mapping\":{\r\n \"map-reply-action\":\"no-action\"\r\n }\r\n \r\n }\r\n}" }, { - "id": "bf3ad99c-0fa6-a566-742a-92a9a8404b8c", + "folder": null, + "id": "d106d7bf-ff65-6c13-397d-7cb765c71124", + "name": "Get VNI Table 12 Operational", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/pitr-cfg", - "preRequestScript": null, + "method": "GET", "pathVariables": {}, - "method": "PUT", - "data": [], - "dataMode": "raw", + "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/eid-table/vni-table/12", + "preRequestScript": null, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475225530771, - "name": "Add Pitr-cfg", - "description": "Enable Pitr feature \n\nequivalent of \n\n lisp_pitr_set_locator_set is_add 1 ls_name loc_1\n \ncan be verified with\n\n show_lisp_pitr", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\n \"pitr-cfg\": {\n \"locator-set\": \"loc_1\"\n } \n}" + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"vni-table\":{\r\n \"virtual-network-identifier\":\"12\"\r\n }\r\n}" }, { - "id": "ca05036e-787a-5e8b-bbfd-9b6fce61a893", + "id": "d547003e-cb16-6971-a5f9-66c400a921a1", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/map-resolvers/map-resolver/192.168.2.1", + "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/petr-cfg", "preRequestScript": null, "pathVariables": {}, - "method": "PUT", + "method": "GET", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475224352204, - "name": "Add map resolver", - "description": "Reads data of map resolver\n\nequivalent of \n\n lisp_map_resolver_dump", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\r\n \"map-resolver\":{\r\n \"ip-address\":\"192.168.2.1\"\r\n }\r\n}" + "time": 1489065349598, + "name": "Get Petr Operational", + "description": "", + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\n \"petr-cfg\": {\n \"petr-address\":\"192.168.2.1\"\n } \n}" }, { - "id": "d3dde4b1-56df-b489-53d9-a3edee6c4bd3", + "id": "da8d61ce-1f0d-8ab8-e1de-50d094a266e2", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12", + "url": "http://localhost:8183/restconf/config/lisp:lisp", "preRequestScript": null, "pathVariables": {}, "method": "PUT", @@ -811,145 +1166,144 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475134063440, - "name": "Negative Case - Add VNI Table 12", - "description": "Adding empty vni reference is disallowed/not possible.\nIt can be added only if vrf-subtable/bridge-domain-subtable", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\r\n \"vni-table\":{\r\n \"virtual-network-identifier\":\"12\"\r\n }\r\n}" + "time": 1489395590834, + "name": "Enable Lisp", + "description": "Enables Lisp feature\n\nequivalent of \n\n lisp_enable_disable is_en 1\n\ncan be verified with \n\n show_lisp_status", + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\n \"lisp\": {\n \"enable\": true,\n \"lisp-feature-data\": {\n \"pitr-cfg\": {\n \"locator-set\": \"N/A\"\n },\n \"rloc-probe\": {\n \"enabled\": false\n },\n \"map-register\": {\n \"enabled\": false\n },\n \"map-request-mode\": {\n \"mode\": \"destination-only\"\n },\n \"eid-table\": {\n \"vni-table\": [\n {\n \"virtual-network-identifier\": 0,\n \"vrf-subtable\": {\n \"table-id\": 0\n }\n }\n ]\n }\n }\n }\n}" }, { - "id": "d75a1d9c-51cb-7e8a-a1cb-8ae77b42fdec", + "folder": null, + "id": "e5b786a5-cab9-9fd7-4a23-20840e00098a", + "name": "Get Lisp Config", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/vrf-subtable/remote-mappings/remote-mapping/remote_map_1", - "preRequestScript": null, - "pathVariables": {}, "method": "GET", - "data": [], - "dataMode": "raw", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/config/lisp:lisp", + "preRequestScript": null, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475150713113, - "name": "Get remote negative mapping Config - Vrf", - "description": "Reads data of remote mapping\n\nequivalent of \n\n lisp_eid_table_dump eid_set 1 prefix_len 32 vni 12 eid_type 0 eid 192.168.2.3 filter 2", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\r\n \"remote-mapping\":{\r\n \"id\":\"remote_map_2\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.1\"\r\n },\r\n \r\n \"rlocs\":{\r\n \"locator\":{\r\n \"address\":\"192.168.2.2\",\r\n \"priority\":1,\r\n \"weight\":1\r\n }\r\n }\r\n \r\n }\r\n}" + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"lisp\":{\r\n \"enable\":\"true\"\r\n } \r\n}" }, { - "id": "daf43527-613d-af9e-71f0-8e81f31ea832", + "folder": null, + "id": "e6c236d4-96f6-b999-5e4e-9e8c93be6090", + "name": "Add remote positive mapping - Bridge Domain", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "Adds new remote mapping with positive mapping\n\nequivalent of \n\n lisp_add_del_remote_mapping is_add 1 vni 12 rloc_num NR_OF_LOCATORS rlocs BINARY_DATA eid_type 0 eid 192.168.2.3 eid_len 32\n \nbinary data of remote locators should be in format\n\n [1 byte(ipv4/ipv6), 1 byte(priority), 1 byte(weight), 16 byte(address),...]\n\ncan be verified with\n\n lisp_eid_table_dump eid_set 1 prefix_len 32 vni 12 eid_type 0 eid 192.168.2.3 filter 2", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/eid-table/vni-table/12/vrf-subtable/remote-mappings/remote-mapping/remote_map_1", - "preRequestScript": null, + "method": "PUT", "pathVariables": {}, - "method": "GET", - "data": [], - "dataMode": "raw", + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/bridge-domain-subtable/remote-mappings/remote-mapping/remote_map_4", + "preRequestScript": null, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475150722513, - "name": "Get remote negative mapping Operational - Vrf", - "description": "Reads data of remote mapping\n\nequivalent of \n\n lisp_eid_table_dump eid_set 1 prefix_len 32 vni 12 eid_type 0 eid 192.168.2.3 filter 2", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\r\n \"remote-mapping\":{\r\n \"id\":\"remote_map_2\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.1\"\r\n },\r\n \r\n \"rlocs\":{\r\n \"locator\":{\r\n \"address\":\"192.168.2.2\",\r\n \"priority\":1,\r\n \"weight\":1\r\n }\r\n }\r\n \r\n }\r\n}" + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"remote-mapping\":{\r\n \"id\":\"remote_map_4\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:mac-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"mac\":\"aa:bb:cc:aa:bb:cc\"\r\n },\r\n \r\n \"rlocs\":{\r\n \"locator\":{\r\n \"address\":\"192.168.2.3\",\r\n \"priority\":1,\r\n \"weight\":2\r\n }\r\n }\r\n \r\n }\r\n}" }, { - "id": "e67f634f-81b6-4bb4-a013-6516e7585804", + "folder": null, + "id": "eef057eb-f4a5-4903-1e31-06082511d677", + "name": "Get local mapping loc_map_1 Config", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "Get details about local mapping\n\nequivalent of\n \n lisp_eid_table_dump eid_set 1 prefix_length 32 vni 12 eid_type 0 eid 192.168.2.1 filter 1", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", + "method": "GET", + "pathVariables": {}, "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/vrf-subtable/local-mappings/local-mapping/loc_map_1", "preRequestScript": null, - "pathVariables": {}, - "method": "GET", - "data": [], - "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475138892237, - "name": "Add local mapping loc_map_2 Operational", - "description": "Adds new local mapping\n\nequivalent of \n\n lisp_add_del_local_eid is_add 1 eid_type 0 eid 192.168.2.1 prefix_len 32 vni 12 locator_set_name loc_1\n \ncan be verified with\n\n lisp_eid_table_dump eid_set 1 prefix_length 32 vni 12 eid_type 0 eid 192.168.2.1 filter 1\n \n", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\r\n \"local-mapping\":{\r\n \"id\":\"loc_map_1\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.1\"\r\n },\r\n \"locator-set\":\"loc_1\"\r\n }\r\n}" + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"local-mapping\":{\r\n \"id\":\"loc_map_1\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:mac-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"mac\":\"00:11:22:00:11:22\"\r\n },\r\n \"locator-set\":\"loc_1\"\r\n }\r\n}" }, { - "id": "e6f90d4d-a68e-ab51-5b63-93e3c6f99bc1", + "folder": null, + "id": "f18a7c8a-1c04-18b8-75d8-e2d8d08c3ef0", + "name": "Get remote positive mapping - Config - Bridge Domain", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "can be verified with\n\n lisp_eid_table_dump eid_set 1 prefix_len 32 vni 12 eid_type 0 eid 192.168.2.1 filter 2", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/locator-sets", - "preRequestScript": null, - "pathVariables": {}, "method": "GET", - "data": [], - "dataMode": "raw", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/eid-table/vni-table/12/bridge-domain-subtable/remote-mappings/remote-mapping/remote_map_4", + "preRequestScript": null, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475133715227, - "name": "Get Locator set loc_1 Operational", - "description": "Reads data of locator set \n\nequivalent of \n \n lisp_locator_set_dump", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\r\n \"lisp\":{\r\n \"enable\":\"true\"\r\n } \r\n}" + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"remote-mapping\":{\r\n \"id\":\"remote_map_1\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.1\"\r\n },\r\n \r\n \"negative-mapping\":{\r\n \"map-reply-action\":\"no-action\"\r\n }\r\n \r\n }\r\n}" }, { - "id": "f0fc317e-801b-89bf-5821-317f5c835d97", + "folder": null, + "id": "f6c1d4a8-9e5a-bac2-7476-c5ded4a545cc", + "name": "Get adjacency - Operational", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "Add new adjacency\nThere must be existing local/remote mappings to specified eid's\n\nequivalent of \n\n lisp_add_del_adjacency is_add 1 vni 12 eid_type 0 deid 192.168.2.1 seid 192.168.2.3 deid_len 32 seid_len 32\n\nright now no dump variant is existing in api", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/state/lisp:lisp/lisp-feature-data/map-resolvers/map-resolver/192.168.2.1", - "preRequestScript": null, - "pathVariables": {}, "method": "GET", - "data": [], - "dataMode": "raw", + "pathVariables": {}, + "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/eid-table/vni-table/12/vrf-subtable/remote-mappings/remote-mapping/remote_map_1/adjacencies/adjacency/adj_1", + "preRequestScript": null, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475224400772, - "name": "Get map resolver - Config", - "description": "Adds new map resolver\n\nequivalent of\n\n lisp_add_del_map_resolver is_add 1 is_ipv6 0 ip_address 192.168.2.1\n\ncan be verified with\n \n lisp_map_resolver_dump", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\r\n \"map-resolver\":{\r\n \"ip-address\":\"192.168.2.1\"\r\n }\r\n}" + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"adjacency\":{\r\n \"id\":\"adj_1\",\r\n \"local-eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.1\"\r\n },\r\n \"remote-eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:ipv4-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"ipv4\":\"192.168.2.5\"\r\n }\r\n }\r\n}" }, { - "id": "f65b7beb-a746-dc7d-d27d-3b39fa95ea56", + "folder": null, + "id": "f8d1b8a6-7a79-8be1-dbf3-fc02c5688df4", + "name": "Get map resolver - Operational", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "Reads data of map resolver\n\nequivalent of \n\n lisp_map_resolver_dump", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/locator-sets/locator-set/loc_1/interface/GigabitEthernet0%2F8%2F0", - "preRequestScript": null, + "method": "GET", "pathVariables": {}, - "method": "PUT", - "data": [], - "dataMode": "raw", + "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/map-resolvers/map-resolver/192.168.2.1", + "preRequestScript": null, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475133834259, - "name": "Add Locator for GigabitEthernet0/8/0", - "description": "Add locator under locator-set\n\nequivalent of \n\n lisp_add_del_locator is_add 1 locator_set_name loc_1 sw_if_index INDEX priority 2 weight 3\n\ncan be verified with \n\n lisp_locator_dump locator_set_index INDEX ", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{\r\n \"interface\":{\r\n \"interface-ref\":\"GigabitEthernet0/8/0\",\r\n \"priority\":\"2\",\r\n \"weight\":\"3\"\r\n }\r\n}" + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"map-resolver\":{\r\n \"ip-address\":\"192.168.2.1\"\r\n }\r\n}" }, { - "id": "fa912ebd-2381-1892-2b27-c01780ba1b9c", + "folder": null, + "id": "fceee914-148f-c74e-3ad5-c2dbb988edf2", + "name": "Get remote negative mapping Operational - Bridge Domain", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", - "url": "http://localhost:8183/restconf/config/lisp:lisp/lisp-feature-data/locator-sets/locator-set/loc_1", - "preRequestScript": null, + "method": "GET", "pathVariables": {}, - "method": "PUT", - "data": [], - "dataMode": "raw", + "url": "http://localhost:8183/restconf/operational/lisp:lisp-state/lisp-feature-data/eid-table/vni-table/12/bridge-domain-subtable/remote-mappings/remote-mapping/remote_map_2", + "preRequestScript": null, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1475133686078, - "name": "Add Locator set loc_1 with locator for local0", - "description": "Add new locator set\n\nequivalent of \n \n lisp_add_del_locator_set is_add 1 locator_set_name loc_1\n \ncan be verified with \n\n lisp_locator_set_dump\n\nRequests to add empty locator-sets will be rejected", - "collectionId": "f81144ce-6874-1a85-4f77-dcead6a67cd3", - "responses": [], - "rawModeData": "{ \n \"locator-set\":{ \n \"name\":\"loc_1\",\n \"interface\":{ \n \"interface-ref\":\"local0\",\n \"priority\":\"2\",\n \"weight\":\"3\"\n }\n }\n}" + "collectionId": "6d0c6545-0c6c-6ba3-0c28-d213ebef7075", + "rawModeData": "{\r\n \"remote-mapping\":{\r\n \"id\":\"remote_map_2\",\r\n \"eid\":{\r\n \"address-type\":\"ietf-lisp-address-types:mac-afi\",\r\n \"virtual-network-id\":\"12\",\r\n \"mac\":\"aa:bb:aa:aa:aa:aa\"\r\n },\r\n \"map-reply-action\":\"no-action\"\r\n \r\n }\r\n}" } ] }
\ No newline at end of file |