Search in sources :

Example 6 with CRouterIdentifier

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.node.identifier.CRouterIdentifier in project bgpcep by opendaylight.

the class ProtocolUtil method isisNodeAttributes.

private static org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.isis.topology.rev131021.IgpNodeAttributes1 isisNodeAttributes(final NodeIdentifier node, final NodeAttributes na) {
    final org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.isis.topology.rev131021.isis.node.attributes.isis.node.attributes.TedBuilder tb = new org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.isis.topology.rev131021.isis.node.attributes.isis.node.attributes.TedBuilder();
    final IsisNodeAttributesBuilder ab = new IsisNodeAttributesBuilder();
    if (na != null) {
        if (na.getIpv4RouterId() != null) {
            tb.setTeRouterIdIpv4(na.getIpv4RouterId());
        }
        if (na.getIpv6RouterId() != null) {
            tb.setTeRouterIdIpv6(na.getIpv6RouterId());
        }
        if (na.getTopologyIdentifier() != null) {
            ab.setMultiTopologyId(nodeMultiTopology(na.getTopologyIdentifier()));
        }
    }
    final CRouterIdentifier ri = node.getCRouterIdentifier();
    if (ri instanceof IsisPseudonodeCase) {
        final IsisPseudonode pn = ((IsisPseudonodeCase) ri).getIsisPseudonode();
        final IsoBuilder b = new IsoBuilder();
        final String systemId = UriBuilder.isoId(pn.getIsIsRouterIdentifier().getIsoSystemId());
        b.setIsoSystemId(new IsoSystemId(systemId));
        b.setIsoPseudonodeId(new IsoPseudonodeId(BaseEncoding.base16().encode(new byte[] { pn.getPsn().byteValue() })));
        ab.setIso(b.build());
        if (na != null) {
            ab.setNet(toIsoNetIds(na.getIsisAreaId(), systemId));
        }
    } else if (ri instanceof IsisNodeCase) {
        final IsisNode in = ((IsisNodeCase) ri).getIsisNode();
        final String systemId = UriBuilder.isoId(in.getIsoSystemId());
        ab.setIso(new IsoBuilder().setIsoSystemId(new IsoSystemId(systemId)).build());
        if (na != null) {
            ab.setNet(toIsoNetIds(na.getIsisAreaId(), systemId));
        }
    }
    ab.setTed(tb.build());
    return new org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.isis.topology.rev131021.IgpNodeAttributes1Builder().setIsisNodeAttributes(ab.build()).build();
}
Also used : IsoPseudonodeId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.isis.topology.rev131021.IsoPseudonodeId) IsisNode(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.node.identifier.c.router.identifier.isis.node._case.IsisNode) CRouterIdentifier(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.node.identifier.CRouterIdentifier) IsisNodeCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.node.identifier.c.router.identifier.IsisNodeCase) IsoSystemId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.isis.topology.rev131021.IsoSystemId) IsisNodeAttributesBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.isis.topology.rev131021.isis.node.attributes.IsisNodeAttributesBuilder) IsisPseudonode(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.node.identifier.c.router.identifier.isis.pseudonode._case.IsisPseudonode) OspfPseudonode(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.node.identifier.c.router.identifier.ospf.pseudonode._case.OspfPseudonode) IsoBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.isis.topology.rev131021.isis.node.attributes.isis.node.attributes.IsoBuilder) IsisPseudonodeCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.node.identifier.c.router.identifier.IsisPseudonodeCase) IsisPseudonode(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.node.identifier.c.router.identifier.isis.pseudonode._case.IsisPseudonode)

Aggregations

CRouterIdentifier (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.node.identifier.CRouterIdentifier)4 IsisNodeCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.node.identifier.c.router.identifier.IsisNodeCase)4 OspfNodeCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.node.identifier.c.router.identifier.OspfNodeCase)4 IsisPseudonode (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.node.identifier.c.router.identifier.isis.pseudonode._case.IsisPseudonode)4 OspfPseudonode (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.node.identifier.c.router.identifier.ospf.pseudonode._case.OspfPseudonode)4 IsisPseudonodeCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.node.identifier.c.router.identifier.IsisPseudonodeCase)3 IsisNode (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.node.identifier.c.router.identifier.isis.node._case.IsisNode)3 AsNumber (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber)2 AreaIdentifier (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.AreaIdentifier)2 DomainIdentifier (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.DomainIdentifier)2 OspfPseudonodeCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.node.identifier.c.router.identifier.OspfPseudonodeCase)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 ByteBuf (io.netty.buffer.ByteBuf)1 AreaIdTlvParser (org.opendaylight.protocol.bgp.linkstate.impl.tlvs.AreaIdTlvParser)1 AsNumTlvParser (org.opendaylight.protocol.bgp.linkstate.impl.tlvs.AsNumTlvParser)1 BgpRouterIdTlvParser (org.opendaylight.protocol.bgp.linkstate.impl.tlvs.BgpRouterIdTlvParser)1 DomainIdTlvParser (org.opendaylight.protocol.bgp.linkstate.impl.tlvs.DomainIdTlvParser)1 MemAsNumTlvParser (org.opendaylight.protocol.bgp.linkstate.impl.tlvs.MemAsNumTlvParser)1 AbstractNlriTypeCodec (org.opendaylight.protocol.bgp.linkstate.spi.AbstractNlriTypeCodec)1 SimpleNlriTypeRegistry (org.opendaylight.protocol.bgp.linkstate.spi.pojo.SimpleNlriTypeRegistry)1