use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.node.identifier.c.router.identifier.IsisNodeCase in project bgpcep by opendaylight.
the class RouterIdTlvParser method serializeTlvBody.
@Override
public void serializeTlvBody(final CRouterIdentifier tlv, final ByteBuf body) {
if (tlv instanceof IsisNodeCase) {
final IsisNode isis = ((IsisNodeCase) tlv).getIsisNode();
body.writeBytes(isis.getIsoSystemId().getValue());
} else if (tlv instanceof IsisPseudonodeCase) {
final IsisPseudonode isis = ((IsisPseudonodeCase) tlv).getIsisPseudonode();
body.writeBytes(isis.getIsIsRouterIdentifier().getIsoSystemId().getValue());
ByteBufUtils.writeOrZero(body, isis.getPsn());
} else if (tlv instanceof OspfNodeCase) {
ByteBufUtils.writeOrZero(body, ((OspfNodeCase) tlv).getOspfNode().getOspfRouterId());
} else if (tlv instanceof OspfPseudonodeCase) {
final OspfPseudonode node = ((OspfPseudonodeCase) tlv).getOspfPseudonode();
ByteBufUtils.writeOrZero(body, node.getOspfRouterId());
ByteBufUtils.write(body, node.getLanInterface().getValue());
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.node.identifier.c.router.identifier.IsisNodeCase in project bgpcep by opendaylight.
the class LinkstateGraphBuilder method getVertexId.
/**
* Get Vertex in the Graph by the OSPF Router ID or IS-IS-System ID.
*
* @param routerID The Router Identifier entry
*
* @return Vertex in the Connected Graph that corresponds to this Router ID. Vertex is created if not found.
*/
private static Uint64 getVertexId(final CRouterIdentifier routerID) {
Uint64 rid = Uint64.ZERO;
if (routerID instanceof IsisNodeCase) {
final byte[] isoId = ((IsisNodeCase) routerID).getIsisNode().getIsoSystemId().getValue();
final byte[] convert = { 0, 0, isoId[0], isoId[1], isoId[2], isoId[3], isoId[4], isoId[5] };
rid = Uint64.fromLongBits(ByteBuffer.wrap(convert).getLong());
}
if (routerID instanceof OspfNodeCase) {
rid = ((OspfNodeCase) routerID).getOspfNode().getOspfRouterId().toUint64();
}
LOG.debug("Get Vertex Identifier {}", rid);
return rid;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.node.identifier.c.router.identifier.IsisNodeCase in project bgpcep by opendaylight.
the class NodeNlriParser method serializeIsisNode.
private static IsisNodeCase serializeIsisNode(final ContainerNode isis) {
final IsisNodeCaseBuilder builder = new IsisNodeCaseBuilder();
final IsisNodeBuilder isisBuilder = new IsisNodeBuilder();
isisBuilder.setIsoSystemId(new IsoSystemIdentifier((byte[]) isis.getChild(ISO_SYSTEM_NID).get().getValue()));
builder.setIsisNode(isisBuilder.build());
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.node.identifier.c.router.identifier.IsisNodeCase 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();
}
Aggregations