Search in sources :

Example 6 with Attributes

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes in project bgpcep by opendaylight.

the class PMSITunnelAttributeHandlerTest method testPimSMTree.

@Test
public void testPimSMTree() throws Exception {
    final Attributes attributes = buildPimSMTreeAttribute();
    final ByteBuf actual = Unpooled.buffer();
    this.handler.serializeAttribute(attributes, actual);
    assertArrayEquals(PIM_SM_TREE_EXPECTED, ByteArray.readAllBytes(actual));
    final Attributes expected = buildPimSMTreeAttribute();
    final Attributes actualAttr = this.handler.parseAttributes(Unpooled.wrappedBuffer(PIM_SM_TREE_EXPECTED), null);
    assertEquals(expected, actualAttr);
}
Also used : Attributes(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes) ByteBuf(io.netty.buffer.ByteBuf) Test(org.junit.Test)

Example 7 with Attributes

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes in project bgpcep by opendaylight.

the class PMSITunnelAttributeHandlerTestUtil method buildIngressReplicationAttribute.

static Attributes buildIngressReplicationAttribute() {
    final PmsiTunnelBuilder pmsiTunnelBuilder = getPmsiTunnelBuilder();
    pmsiTunnelBuilder.setTunnelIdentifier(new IngressReplicationBuilder().setIngressReplication(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev160812.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.ingress.replication.IngressReplicationBuilder().setReceivingEndpointAddress(IP_ADDRESS).build()).build());
    return buildAttribute(pmsiTunnelBuilder);
}
Also used : IngressReplicationBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev160812.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.IngressReplicationBuilder) Collections(java.util.Collections) PmsiTunnelBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev160812.pmsi.tunnel.PmsiTunnelBuilder)

Example 8 with Attributes

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes in project bgpcep by opendaylight.

the class PMSITunnelAttributeHandlerTestUtil method buildMLDpMp2mPLspAttribute.

static Attributes buildMLDpMp2mPLspAttribute() {
    final PmsiTunnelBuilder pmsiTunnelBuilder = getPmsiTunnelBuilder();
    pmsiTunnelBuilder.setTunnelIdentifier(new MldpMp2mpLspBuilder().setMldpMp2mpLsp(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev160812.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.mldp.mp2mp.lsp.MldpMp2mpLspBuilder().setOpaque(OPAQUE_TEST).setOpaqueType(OpaqueUtil.GENERIC_LSP_IDENTIFIER).build()).build());
    return buildAttribute(pmsiTunnelBuilder);
}
Also used : Collections(java.util.Collections) PmsiTunnelBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev160812.pmsi.tunnel.PmsiTunnelBuilder) MldpMp2mpLspBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev160812.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.MldpMp2mpLspBuilder)

Example 9 with Attributes

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes in project bgpcep by opendaylight.

the class PMSITunnelAttributeHandlerTestUtil method buildMldpp2MPLspL2vpnAttribute.

static Attributes buildMldpp2MPLspL2vpnAttribute() {
    final PmsiTunnelBuilder pmsiTunnelBuilder = getPmsiTunnelBuilder();
    pmsiTunnelBuilder.setTunnelIdentifier(buildMldpP2mpLsp(IP_ADDRESS, L2vpnAddressFamily.class, createOpaqueList()));
    return buildAttribute(pmsiTunnelBuilder);
}
Also used : L2vpnAddressFamily(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.L2vpnAddressFamily) PmsiTunnelBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev160812.pmsi.tunnel.PmsiTunnelBuilder)

Example 10 with Attributes

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes in project bgpcep by opendaylight.

the class BGPParserTest method testGetUpdateMessage5.

/*
     * Tests withdrawn routes.
     *
     * ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff <- marker
     * 00 1c <- length (28) - including header
     * 02 <- message type
     * 00 05 <- withdrawn routes length (5)
     * 1e ac 10 00 04 <- route (172.16.0.4)
     * 00 00 <- total path attribute length
     */
@Test
public void testGetUpdateMessage5() throws Exception {
    final byte[] body = ByteArray.cutBytes(inputBytes.get(4), MessageUtil.COMMON_HEADER_LENGTH);
    final int messageLength = ByteArray.bytesToInt(ByteArray.subByte(inputBytes.get(4), MessageUtil.MARKER_LENGTH, LENGTH_FIELD_LENGTH));
    final Update message = BGPParserTest.updateParser.parseMessageBody(Unpooled.copiedBuffer(body), messageLength);
    // attributes
    final List<WithdrawnRoutes> withdrawnRoutes = Lists.newArrayList(new WithdrawnRoutesBuilder().setPrefix(new Ipv4Prefix("172.16.0.4/30")).build());
    // check API message
    final Update expectedMessage = new UpdateBuilder().setWithdrawnRoutes(withdrawnRoutes).build();
    assertEquals(expectedMessage.getWithdrawnRoutes(), message.getWithdrawnRoutes());
    final ByteBuf buffer = Unpooled.buffer();
    BGPParserTest.updateParser.serializeMessage(message, buffer);
    assertArrayEquals(inputBytes.get(4), ByteArray.readAllBytes(buffer));
}
Also used : WithdrawnRoutesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.update.message.WithdrawnRoutesBuilder) UpdateBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.UpdateBuilder) WithdrawnRoutes(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.update.message.WithdrawnRoutes) Update(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.Update) ByteBuf(io.netty.buffer.ByteBuf) Ipv4Prefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix) PeerSpecificParserConstraint(org.opendaylight.protocol.bgp.parser.spi.PeerSpecificParserConstraint) Test(org.junit.Test)

Aggregations

Attributes (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes)75 Test (org.junit.Test)62 ByteBuf (io.netty.buffer.ByteBuf)50 AttributesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.AttributesBuilder)40 Update (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.Update)34 Attributes1 (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.Attributes1)26 AbstractRIBSupportTest (org.opendaylight.protocol.bgp.rib.spi.AbstractRIBSupportTest)24 Attributes2 (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.Attributes2)24 ArrayList (java.util.ArrayList)19 Ipv4Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address)13 UpdateBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.UpdateBuilder)13 OriginBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.attributes.OriginBuilder)11 Ipv4NextHopCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.next.hop.c.next.hop.Ipv4NextHopCaseBuilder)11 Ipv4NextHopBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.next.hop.c.next.hop.ipv4.next.hop._case.Ipv4NextHopBuilder)11 Collections (java.util.Collections)10 AsPathBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.attributes.AsPathBuilder)10 MultiExitDiscBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.attributes.MultiExitDiscBuilder)10 Attributes1Builder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.Attributes1Builder)9 PmsiTunnelBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev160812.pmsi.tunnel.PmsiTunnelBuilder)9 AsNumber (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber)8