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);
}
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;
}
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);
}
Aggregations