use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.ospf.topology.rev131021.ospf.node.attributes.ospf.node.attributes.router.type.AbrBuilder in project bgpcep by opendaylight.
the class ProtocolUtil method ospfNodeAttributes.
private static org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.ospf.topology.rev131021.IgpNodeAttributes1 ospfNodeAttributes(final NodeIdentifier node, final NodeAttributes na) {
final org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.ospf.topology.rev131021.ospf.node.attributes.ospf.node.attributes.TedBuilder tb = new org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.ospf.topology.rev131021.ospf.node.attributes.ospf.node.attributes.TedBuilder();
final OspfNodeAttributesBuilder ab = new OspfNodeAttributesBuilder();
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 OspfPseudonodeCase) {
final OspfPseudonode pn = ((OspfPseudonodeCase) ri).getOspfPseudonode();
ab.setRouterType(new PseudonodeBuilder().setPseudonode(Boolean.TRUE).build());
ab.setDrInterfaceId(pn.getLanInterface().getValue());
} else if (ri instanceof OspfNodeCase && na.getNodeFlags() != null) {
// TODO: what should we do with in.getOspfRouterId()?
final NodeFlagBits nf = na.getNodeFlags();
if (nf.isAbr() != null) {
ab.setRouterType(new AbrBuilder().setAbr(nf.isAbr()).build());
} else if (nf.isExternal() != null) {
ab.setRouterType(new InternalBuilder().setInternal(!nf.isExternal()).build());
}
}
}
ab.setTed(tb.build());
return new org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.ospf.topology.rev131021.IgpNodeAttributes1Builder().setOspfNodeAttributes(ab.build()).build();
}
Aggregations