Search in sources :

Example 1 with SimpleNlriTypeRegistry

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);
}
Also used : SimpleNlriTypeRegistry(org.opendaylight.protocol.bgp.linkstate.spi.pojo.SimpleNlriTypeRegistry)

Example 2 with SimpleNlriTypeRegistry

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();
}
Also used : LocalNodeDescriptors(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.object.type.link._case.LocalNodeDescriptors) LinkCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.object.type.LinkCaseBuilder) SimpleNlriTypeRegistry(org.opendaylight.protocol.bgp.linkstate.spi.pojo.SimpleNlriTypeRegistry) LinkDescriptors(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.object.type.link._case.LinkDescriptors) RemoteNodeDescriptors(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.object.type.link._case.RemoteNodeDescriptors)

Example 3 with SimpleNlriTypeRegistry

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);
}
Also used : SimpleNlriTypeRegistry(org.opendaylight.protocol.bgp.linkstate.spi.pojo.SimpleNlriTypeRegistry) LinkCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.object.type.LinkCase)

Example 4 with SimpleNlriTypeRegistry

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);
}
Also used : SimpleNlriTypeRegistry(org.opendaylight.protocol.bgp.linkstate.spi.pojo.SimpleNlriTypeRegistry)

Example 5 with SimpleNlriTypeRegistry

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);
}
Also used : SimpleNlriTypeRegistry(org.opendaylight.protocol.bgp.linkstate.spi.pojo.SimpleNlriTypeRegistry)

Aggregations

SimpleNlriTypeRegistry (org.opendaylight.protocol.bgp.linkstate.spi.pojo.SimpleNlriTypeRegistry)8 ArrayList (java.util.ArrayList)1 LinkstateAttributeParser (org.opendaylight.protocol.bgp.linkstate.impl.attribute.LinkstateAttributeParser)1 LinkstateNlriParser (org.opendaylight.protocol.bgp.linkstate.impl.nlri.LinkstateNlriParser)1 NextHopParserSerializer (org.opendaylight.protocol.bgp.parser.spi.NextHopParserSerializer)1 Attributes1 (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.Attributes1)1 LinkstateAddressFamily (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.LinkstateAddressFamily)1 LinkstateSubsequentAddressFamily (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.LinkstateSubsequentAddressFamily)1 LinkCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.object.type.LinkCase)1 LinkCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.object.type.LinkCaseBuilder)1 LinkDescriptors (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.object.type.link._case.LinkDescriptors)1 LocalNodeDescriptors (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.object.type.link._case.LocalNodeDescriptors)1 RemoteNodeDescriptors (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.object.type.link._case.RemoteNodeDescriptors)1 LinkstateRoutes (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.routes.LinkstateRoutes)1 Ipv4NextHopCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.next.hop.c.next.hop.Ipv4NextHopCase)1 Ipv6NextHopCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.next.hop.c.next.hop.Ipv6NextHopCase)1