use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.object.type.link._case.LinkDescriptors in project bgpcep by opendaylight.
the class LinkNlriParser method parseLinkDescriptor.
private static LinkDescriptors parseLinkDescriptor(final ByteBuf buffer) {
final Map<QName, Object> tlvs = SimpleNlriTypeRegistry.getInstance().parseSubTlvs(buffer);
final LinkDescriptorsBuilder builder = new LinkDescriptorsBuilder();
final LinkLrIdentifiers linkIdentifiers = (LinkLrIdentifiers) tlvs.get(LinkLrIdentifiers.QNAME);
if (linkIdentifiers != null) {
builder.setLinkLocalIdentifier(linkIdentifiers.getLinkLocalIdentifier());
builder.setLinkRemoteIdentifier(linkIdentifiers.getLinkRemoteIdentifier());
}
builder.setIpv4InterfaceAddress((Ipv4InterfaceIdentifier) tlvs.get(Ipv4InterfaceTlvParser.IPV4_IFACE_ADDRESS_QNAME));
builder.setIpv4NeighborAddress((Ipv4InterfaceIdentifier) tlvs.get(Ipv4NeighborTlvParser.IPV4_NEIGHBOR_ADDRESS_QNAME));
builder.setIpv6InterfaceAddress((Ipv6InterfaceIdentifier) tlvs.get(Ipv6InterfaceTlvParser.IPV6_IFACE_ADDRESS_QNAME));
builder.setIpv6NeighborAddress((Ipv6InterfaceIdentifier) tlvs.get(Ipv6NeighborTlvParser.IPV6_NEIGHBOR_ADDRESS_QNAME));
builder.setMultiTopologyId((TopologyIdentifier) tlvs.get(MultiTopoIdTlvParser.MULTI_TOPOLOGY_ID_QNAME));
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.object.type.link._case.LinkDescriptors in project bgpcep by opendaylight.
the class LinkNlriParser method serializeLinkDescriptors.
static LinkDescriptors serializeLinkDescriptors(final ContainerNode descriptors) {
final LinkDescriptorsBuilder linkDescBuilder = new LinkDescriptorsBuilder();
if (descriptors.childByArg(LINK_LOCAL_NID) != null && descriptors.childByArg(LINK_REMOTE_NID) != null) {
linkDescBuilder.setLinkLocalIdentifier((Uint32) descriptors.findChildByArg(LINK_LOCAL_NID).get().body());
linkDescBuilder.setLinkRemoteIdentifier((Uint32) descriptors.findChildByArg(LINK_REMOTE_NID).get().body());
}
ifPresentApply(descriptors, IPV4_IFACE_NID, value -> linkDescBuilder.setIpv4InterfaceAddress(new Ipv4InterfaceIdentifier((String) value)));
ifPresentApply(descriptors, IPV6_IFACE_NID, value -> linkDescBuilder.setIpv6InterfaceAddress(new Ipv6InterfaceIdentifier((String) value)));
ifPresentApply(descriptors, IPV4_NEIGHBOR_NID, value -> linkDescBuilder.setIpv4NeighborAddress(new Ipv4InterfaceIdentifier((String) value)));
ifPresentApply(descriptors, IPV6_NEIGHBOR_NID, value -> linkDescBuilder.setIpv6NeighborAddress(new Ipv6InterfaceIdentifier((String) value)));
ifPresentApply(descriptors, TlvUtil.MULTI_TOPOLOGY_NID, value -> linkDescBuilder.setMultiTopologyId(new TopologyIdentifier((Uint16) value)));
return linkDescBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.object.type.link._case.LinkDescriptors in project bgpcep by opendaylight.
the class LinkstateTopologyBuilder method buildLocalTp.
private static TerminationPoint buildLocalTp(final UriBuilder base, final LinkDescriptors linkDescriptors) {
final TpId id = buildLocalTpId(base, linkDescriptors);
final TerminationPointType t = getTpType(linkDescriptors.getIpv4InterfaceAddress(), linkDescriptors.getIpv6InterfaceAddress(), linkDescriptors.getLinkLocalIdentifier());
return buildTp(id, t);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.object.type.link._case.LinkDescriptors in project bgpcep by opendaylight.
the class LinkstateTopologyBuilder method buildRemoteTp.
private static TerminationPoint buildRemoteTp(final UriBuilder base, final LinkDescriptors linkDescriptors) {
final TpId id = buildRemoteTpId(base, linkDescriptors);
final TerminationPointType t = getTpType(linkDescriptors.getIpv4NeighborAddress(), linkDescriptors.getIpv6NeighborAddress(), linkDescriptors.getLinkRemoteIdentifier());
return buildTp(id, t);
}
Aggregations