Search in sources :

Example 6 with SimpleNlriTypeRegistry

use of org.opendaylight.protocol.bgp.linkstate.spi.pojo.SimpleNlriTypeRegistry in project bgpcep by opendaylight.

the class AbstractNodeDescriptorTlvCodec method serializeNodeDescriptor.

protected static void serializeNodeDescriptor(final NodeIdentifier tlv, final ByteBuf body) {
    final SimpleNlriTypeRegistry tlvReg = SimpleNlriTypeRegistry.getInstance();
    tlvReg.serializeTlv(AsNumTlvParser.AS_NUMBER_QNAME, tlv.getAsNumber(), body);
    tlvReg.serializeTlv(DomainIdTlvParser.DOMAIN_ID_QNAME, tlv.getDomainId(), body);
    tlvReg.serializeTlv(AreaIdTlvParser.AREA_ID_QNAME, tlv.getAreaId(), body);
    tlvReg.serializeTlv(CRouterIdentifier.QNAME, tlv.getCRouterIdentifier(), body);
}
Also used : SimpleNlriTypeRegistry(org.opendaylight.protocol.bgp.linkstate.spi.pojo.SimpleNlriTypeRegistry)

Example 7 with SimpleNlriTypeRegistry

use of org.opendaylight.protocol.bgp.linkstate.spi.pojo.SimpleNlriTypeRegistry in project bgpcep by opendaylight.

the class BGPActivator method startImpl.

@Override
protected List<AutoCloseable> startImpl(final BGPExtensionProviderContext context) {
    final List<AutoCloseable> regs = new ArrayList<>();
    final SimpleNlriTypeRegistry nlriTypeReg = SimpleNlriTypeRegistry.getInstance();
    regs.add(context.registerAddressFamily(LinkstateAddressFamily.class, LINKSTATE_AFI));
    regs.add(context.registerSubsequentAddressFamily(LinkstateSubsequentAddressFamily.class, LINKSTATE_SAFI));
    final NextHopParserSerializer linkstateNextHopParser = new NextHopParserSerializer() {
    };
    final LinkstateNlriParser parser = new LinkstateNlriParser();
    regs.add(context.registerNlriParser(LinkstateAddressFamily.class, LinkstateSubsequentAddressFamily.class, parser, linkstateNextHopParser, Ipv4NextHopCase.class, Ipv6NextHopCase.class));
    regs.add(context.registerNlriSerializer(LinkstateRoutes.class, parser));
    regs.add(context.registerAttributeSerializer(Attributes1.class, new LinkstateAttributeParser(this.ianaLinkstateAttributeType, this.rsvpTeObjectRegistry)));
    final LinkstateAttributeParser linkstateAttributeParser = new LinkstateAttributeParser(this.ianaLinkstateAttributeType, this.rsvpTeObjectRegistry);
    regs.add(context.registerAttributeParser(linkstateAttributeParser.getType(), linkstateAttributeParser));
    registerNlriCodecs(regs, nlriTypeReg);
    registerNlriTlvCodecs(regs, nlriTypeReg);
    registerBindingSubTlvs(regs);
    return regs;
}
Also used : LinkstateSubsequentAddressFamily(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.LinkstateSubsequentAddressFamily) SimpleNlriTypeRegistry(org.opendaylight.protocol.bgp.linkstate.spi.pojo.SimpleNlriTypeRegistry) ArrayList(java.util.ArrayList) LinkstateAddressFamily(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.LinkstateAddressFamily) Attributes1(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.Attributes1) Ipv4NextHopCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.next.hop.c.next.hop.Ipv4NextHopCase) Ipv6NextHopCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.next.hop.c.next.hop.Ipv6NextHopCase) LinkstateAttributeParser(org.opendaylight.protocol.bgp.linkstate.impl.attribute.LinkstateAttributeParser) LinkstateRoutes(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.routes.LinkstateRoutes) LinkstateNlriParser(org.opendaylight.protocol.bgp.linkstate.impl.nlri.LinkstateNlriParser) NextHopParserSerializer(org.opendaylight.protocol.bgp.parser.spi.NextHopParserSerializer)

Example 8 with SimpleNlriTypeRegistry

use of org.opendaylight.protocol.bgp.linkstate.spi.pojo.SimpleNlriTypeRegistry in project bgpcep by opendaylight.

the class LocalNodeDescriptorTlvParser method serializeTlvBody.

@Override
public void serializeTlvBody(final LocalNodeDescriptors 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