use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.node.identifier.c.router.identifier.isis.pseudonode._case.IsisPseudonode 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());
ByteBufWriteUtil.writeUnsignedByte(isis.getPsn(), body);
} else if (tlv instanceof OspfNodeCase) {
ByteBufWriteUtil.writeUnsignedInt(((OspfNodeCase) tlv).getOspfNode().getOspfRouterId(), body);
} else if (tlv instanceof OspfPseudonodeCase) {
final OspfPseudonode node = ((OspfPseudonodeCase) tlv).getOspfPseudonode();
ByteBufWriteUtil.writeUnsignedInt(node.getOspfRouterId(), body);
ByteBufWriteUtil.writeUnsignedInt(node.getLanInterface().getValue(), body);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.node.identifier.c.router.identifier.isis.pseudonode._case.IsisPseudonode 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