Search in sources :

Example 71 with Ipv6

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.lsp.identifiers.tlv.lsp.identifiers.address.family.ipv6._case.Ipv6 in project bgpcep by opendaylight.

the class PMSITunnelAttributeHandlerTestUtil method buildMldpP2mpLspIpv6Attribute.

static Attributes buildMldpP2mpLspIpv6Attribute() {
    final PmsiTunnelBuilder pmsiTunnelBuilder = new PmsiTunnelBuilder();
    pmsiTunnelBuilder.setLeafInformationRequired(true);
    pmsiTunnelBuilder.setMplsLabel(MPLS_LABEL);
    pmsiTunnelBuilder.setTunnelIdentifier(buildMldpP2mpLsp(IPV6, Ipv6AddressFamily.class, createOpaqueList()));
    return buildAttribute(pmsiTunnelBuilder);
}
Also used : Ipv6AddressFamily(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.Ipv6AddressFamily) PmsiTunnelBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev200120.pmsi.tunnel.PmsiTunnelBuilder)

Example 72 with Ipv6

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.lsp.identifiers.tlv.lsp.identifiers.address.family.ipv6._case.Ipv6 in project bgpcep by opendaylight.

the class BGPParserTest method testEORIpv6.

/*
     * End of Rib for Ipv6 consists of empty MP_UNREACH_NLRI, with AFI 2 and SAFI 1
     *
     * ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff <- marker
     * 00 1d <- length (29) - including header
     * 02 <- message type
     * 00 00 <- withdrawn routes length
     * 00 06 <- total path attribute length
     * 80 <- attribute flags
     * 0f <- attribute type (15 - MP_UNREACH_NLRI)
     * 03 <- attribute length
     * 00 02 <- value (AFI 2: IPv6)
     * 01 <- value (SAFI 1)
     */
@Test
public void testEORIpv6() throws Exception {
    final byte[] body = ByteArray.cutBytes(INPUT_BYTES.get(6), MessageUtil.COMMON_HEADER_LENGTH);
    final int messageLength = ByteArray.bytesToInt(ByteArray.subByte(INPUT_BYTES.get(6), MessageUtil.MARKER_LENGTH, LENGTH_FIELD_LENGTH));
    final Update message = BGPParserTest.updateParser.parseMessageBody(Unpooled.copiedBuffer(body), messageLength, null);
    final Class<? extends AddressFamily> afi = message.getAttributes().augmentation(AttributesUnreach.class).getMpUnreachNlri().getAfi();
    final Class<? extends SubsequentAddressFamily> safi = message.getAttributes().augmentation(AttributesUnreach.class).getMpUnreachNlri().getSafi();
    assertEquals(Ipv6AddressFamily.class, afi);
    assertEquals(UnicastSubsequentAddressFamily.class, safi);
    final ByteBuf buffer = Unpooled.buffer();
    BGPParserTest.updateParser.serializeMessage(message, buffer);
    assertArrayEquals(INPUT_BYTES.get(6), ByteArray.readAllBytes(buffer));
}
Also used : Update(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.Update) ByteBuf(io.netty.buffer.ByteBuf) PeerSpecificParserConstraint(org.opendaylight.protocol.bgp.parser.spi.PeerSpecificParserConstraint) Test(org.junit.Test)

Example 73 with Ipv6

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.lsp.identifiers.tlv.lsp.identifiers.address.family.ipv6._case.Ipv6 in project bgpcep by opendaylight.

the class LlGracefulCapabilityHandlerTest method testLongLivedGracefulCapabilityHandler.

@Test
public void testLongLivedGracefulCapabilityHandler() throws BGPParsingException, BGPDocumentedException {
    final byte[] capaBytes = { // header
    (byte) 0x47, (byte) 0x0e, // Ipv4 Unicast, afiFlags = false, timer = 10
    (byte) 0x00, (byte) 0x01, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x0a, // Ipv6 Unicast, afiFlags = true, timer = 160
    (byte) 0x00, (byte) 0x02, (byte) 0x01, (byte) 0x80, (byte) 0x00, (byte) 0x00, (byte) 0xa0 };
    final LlGracefulRestartCapability capability = new LlGracefulRestartCapabilityBuilder().setTables(BindingMap.ordered(new TablesBuilder().setAfi(Ipv4AddressFamily.class).setSafi(UnicastSubsequentAddressFamily.class).setAfiFlags(new Tables.AfiFlags(Boolean.FALSE)).setLongLivedStaleTime(TEN).build(), new TablesBuilder().setAfi(Ipv6AddressFamily.class).setSafi(UnicastSubsequentAddressFamily.class).setAfiFlags(new Tables.AfiFlags(Boolean.TRUE)).setLongLivedStaleTime(new Uint24(Uint32.valueOf(160))).build())).build();
    final CParameters cParameters = new CParametersBuilder().addAugmentation(new CParameters1Builder().setLlGracefulRestartCapability(capability).build()).build();
    final ByteBuf buffer = Unpooled.buffer(capaBytes.length);
    this.handler.serializeCapability(cParameters, buffer);
    assertArrayEquals(capaBytes, buffer.array());
    assertEquals(cParameters, this.handler.parseCapability(Unpooled.wrappedBuffer(capaBytes).slice(2, capaBytes.length - 2)));
}
Also used : Ipv6AddressFamily(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.Ipv6AddressFamily) CParametersBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.open.message.bgp.parameters.optional.capabilities.CParametersBuilder) CParameters1Builder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.CParameters1Builder) Ipv4AddressFamily(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.Ipv4AddressFamily) LlGracefulRestartCapability(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.mp.capabilities.LlGracefulRestartCapability) CParameters(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.open.message.bgp.parameters.optional.capabilities.CParameters) Uint24(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.routing.types.rev171204.Uint24) LlGracefulRestartCapabilityBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.mp.capabilities.LlGracefulRestartCapabilityBuilder) ByteBuf(io.netty.buffer.ByteBuf) TablesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.mp.capabilities.ll.graceful.restart.capability.TablesBuilder) Test(org.junit.Test)

Example 74 with Ipv6

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.lsp.identifiers.tlv.lsp.identifiers.address.family.ipv6._case.Ipv6 in project bgpcep by opendaylight.

the class LinkstateGraphBuilder method getEdgeId.

/**
 * Determine the Source Edge Key from the link descriptor.
 * There is several case: IPv4, IPv6 address or Unnumbered Interface.
 *
 * @param linkCase The Link part of the Linkstate route
 *
 * @return Unique key
 */
private static Uint64 getEdgeId(final LinkCase linkCase) {
    Uint64 key = Uint64.ZERO;
    final LinkDescriptors linkDescriptors = linkCase.getLinkDescriptors();
    if (linkDescriptors.getIpv4InterfaceAddress() != null) {
        key = ipv4ToKey(linkDescriptors.getIpv4InterfaceAddress());
    }
    if (linkDescriptors.getIpv6InterfaceAddress() != null) {
        key = ipv6ToKey(linkDescriptors.getIpv6InterfaceAddress());
    }
    if (linkDescriptors.getLinkLocalIdentifier() != null) {
        key = linkDescriptors.getLinkLocalIdentifier().toUint64();
    }
    return key;
}
Also used : LinkDescriptors(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.object.type.link._case.LinkDescriptors) Uint64(org.opendaylight.yangtools.yang.common.Uint64)

Example 75 with Ipv6

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.lsp.identifiers.tlv.lsp.identifiers.address.family.ipv6._case.Ipv6 in project bgpcep by opendaylight.

the class UriBuilder method add.

UriBuilder add(final LinkCase link) {
    addPrefix("local-", link.getLocalNodeDescriptors());
    addPrefix("remote-", link.getRemoteNodeDescriptors());
    final LinkDescriptors ld = link.getLinkDescriptors();
    if (ld.getIpv4InterfaceAddress() != null) {
        add("ipv4-iface", ld.getIpv4InterfaceAddress().getValue());
    }
    if (ld.getIpv4NeighborAddress() != null) {
        add("ipv4-neigh", ld.getIpv4NeighborAddress().getValue());
    }
    if (ld.getIpv6InterfaceAddress() != null) {
        add("ipv6-iface", ld.getIpv6InterfaceAddress().getValue());
    }
    if (ld.getIpv6NeighborAddress() != null) {
        add("ipv6-neigh", ld.getIpv6NeighborAddress().getValue());
    }
    if (ld.getMultiTopologyId() != null) {
        add("mt", ld.getMultiTopologyId().getValue());
    }
    add("local-id", ld.getLinkLocalIdentifier());
    add("remote-id", ld.getLinkRemoteIdentifier());
    return this;
}
Also used : LinkDescriptors(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.object.type.link._case.LinkDescriptors)

Aggregations

Test (org.junit.Test)71 ArrayList (java.util.ArrayList)44 Ipv6Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address)38 ByteBuf (io.netty.buffer.ByteBuf)27 Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)24 Ipv6Prefix (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix)21 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)20 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)19 InetAddress (java.net.InetAddress)17 Uint64 (org.opendaylight.yangtools.yang.common.Uint64)17 MatchEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry)16 MatchEntryBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder)13 List (java.util.List)12 Inet6Address (java.net.Inet6Address)10 UnknownHostException (java.net.UnknownHostException)10 IpPrefix (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix)10 Eid (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid)10 Subnetmap (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.subnetmaps.Subnetmap)10 SimpleAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.SimpleAddress)9 Ipv6AddressNoZone (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6AddressNoZone)8