use of org.opendaylight.protocol.bgp.linkstate.spi.pojo.SimpleNlriTypeRegistry in project bgpcep by opendaylight.
the class AbstractPrefixNlriParser method serializePrefixDescriptor.
private static void serializePrefixDescriptor(final PrefixDescriptors tlv, final ByteBuf buffer) {
final SimpleNlriTypeRegistry reg = SimpleNlriTypeRegistry.getInstance();
reg.serializeTlv(MultiTopoIdTlvParser.MULTI_TOPOLOGY_ID_QNAME, tlv.getMultiTopologyId(), buffer);
reg.serializeTlv(OspfRouteTlvParser.OSPF_ROUTE_TYPE_QNAME, tlv.getOspfRouteType(), buffer);
reg.serializeTlv(ReachTlvParser.IP_REACHABILITY_QNAME, tlv.getIpReachabilityInformation(), buffer);
}
use of org.opendaylight.protocol.bgp.linkstate.spi.pojo.SimpleNlriTypeRegistry in project bgpcep by opendaylight.
the class LinkNlriParser method parseObjectType.
@Override
protected ObjectType parseObjectType(final ByteBuf buffer) {
final SimpleNlriTypeRegistry reg = SimpleNlriTypeRegistry.getInstance();
final LocalNodeDescriptors localDescriptor = reg.parseTlv(buffer);
final RemoteNodeDescriptors remoteDescriptor = reg.parseTlv(buffer);
final LinkDescriptors linkDescriptor = parseLinkDescriptor(buffer);
return new LinkCaseBuilder().setLinkDescriptors(linkDescriptor).setLocalNodeDescriptors(localDescriptor).setRemoteNodeDescriptors(remoteDescriptor).build();
}
use of org.opendaylight.protocol.bgp.linkstate.spi.pojo.SimpleNlriTypeRegistry in project bgpcep by opendaylight.
the class LinkNlriParser method serializeObjectType.
@Override
protected void serializeObjectType(final ObjectType objectType, final ByteBuf buffer) {
final LinkCase linkNlri = (LinkCase) objectType;
final SimpleNlriTypeRegistry reg = SimpleNlriTypeRegistry.getInstance();
reg.serializeTlv(LocalNodeDescriptors.QNAME, linkNlri.getLocalNodeDescriptors(), buffer);
reg.serializeTlv(RemoteNodeDescriptors.QNAME, linkNlri.getRemoteNodeDescriptors(), buffer);
serializeLinkDescriptor(linkNlri.getLinkDescriptors(), buffer);
}
use of org.opendaylight.protocol.bgp.linkstate.spi.pojo.SimpleNlriTypeRegistry in project bgpcep by opendaylight.
the class LinkNlriParser method serializeLinkDescriptor.
private static void serializeLinkDescriptor(final LinkDescriptors linkDescriptor, final ByteBuf body) {
final SimpleNlriTypeRegistry reg = SimpleNlriTypeRegistry.getInstance();
if (linkDescriptor.getLinkLocalIdentifier() != null && linkDescriptor.getLinkRemoteIdentifier() != null) {
reg.serializeTlv(LinkLrIdentifiers.QNAME, linkDescriptor, body);
}
reg.serializeTlv(Ipv4InterfaceTlvParser.IPV4_IFACE_ADDRESS_QNAME, linkDescriptor.getIpv4InterfaceAddress(), body);
reg.serializeTlv(Ipv4NeighborTlvParser.IPV4_NEIGHBOR_ADDRESS_QNAME, linkDescriptor.getIpv4NeighborAddress(), body);
reg.serializeTlv(Ipv6InterfaceTlvParser.IPV6_IFACE_ADDRESS_QNAME, linkDescriptor.getIpv6InterfaceAddress(), body);
reg.serializeTlv(Ipv6NeighborTlvParser.IPV6_NEIGHBOR_ADDRESS_QNAME, linkDescriptor.getIpv6NeighborAddress(), body);
reg.serializeTlv(MultiTopoIdTlvParser.MULTI_TOPOLOGY_ID_QNAME, linkDescriptor.getMultiTopologyId(), body);
}
use of org.opendaylight.protocol.bgp.linkstate.spi.pojo.SimpleNlriTypeRegistry in project bgpcep by opendaylight.
the class RemoteNodeDescriptorTlvParser method serializeTlvBody.
@Override
public void serializeTlvBody(final RemoteNodeDescriptors tlv, final ByteBuf body) {
serializeNodeDescriptor(tlv, body);
final SimpleNlriTypeRegistry tlvReg = SimpleNlriTypeRegistry.getInstance();
tlvReg.serializeTlv(BgpRouterIdTlvParser.BGP_ROUTER_ID_QNAME, tlv.getBgpRouterId(), body);
tlvReg.serializeTlv(MemAsNumTlvParser.MEMBER_AS_NUMBER_QNAME, tlv.getMemberAsn(), body);
}
Aggregations