private void registerAttributeParsers(final List<AutoCloseable> regs, final BGPExtensionProviderContext context) { final BgpPrefixSidAttributeParser prefixSidAttributeParser = new BgpPrefixSidAttributeParser(context.getBgpPrefixSidTlvRegistry()); regs.add(context.registerAttributeSerializer(BgpPrefixSid.class, prefixSidAttributeParser)); regs.add(context.registerAttributeParser(BgpPrefixSidAttributeParser.TYPE, prefixSidAttributeParser)); regs.add(context.registerAttributeParser(OriginAttributeParser.TYPE, originAttributeParser)); regs.add(context.registerAttributeParser(AigpAttributeParser.TYPE, aigpAttributeParser)); regs.add(context.registerAttributeParser(AsPathAttributeParser.TYPE, asPathAttributeParser)); regs.add(context.registerAttributeParser(NextHopAttributeParser.TYPE, nextHopAttributeParser)); regs.add(context.registerAttributeParser(MultiExitDiscriminatorAttributeParser.TYPE, multiExitDiscriminatorAttributeParser)); regs.add(context.registerAttributeParser(LocalPreferenceAttributeParser.TYPE, localPreferenceAttributeParser)); regs.add(context.registerAttributeParser(AtomicAggregateAttributeParser.TYPE, atomicAggregateAttributeParser)); regs.add(context.registerAttributeParser(AggregatorAttributeParser.TYPE, as4AggregatorAttributeParser)); regs.add(context.registerAttributeParser(CommunitiesAttributeParser.TYPE, communitiesAttributeParser)); regs.add(context.registerAttributeParser(OriginatorIdAttributeParser.TYPE, originatorIdAttributeParser)); regs.add(context.registerAttributeParser(ClusterIdAttributeParser.TYPE, clusterIdAttributeParser)); regs.add(context.registerAttributeParser(MPReachAttributeParser.TYPE, mpReachAttributeParser)); regs.add(context.registerAttributeParser(MPUnreachAttributeParser.TYPE, mpUnreachAttributeParser));
@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; }