Search in sources :

Example 1 with AddressFamilyRegistry

use of org.opendaylight.protocol.bgp.parser.spi.AddressFamilyRegistry in project bgpcep by opendaylight.

the class BGPActivator method registerMessageParsers.

private static void registerMessageParsers(final List<AutoCloseable> regs, final BGPExtensionProviderContext context) {
    final BGPOpenMessageParser omp = new BGPOpenMessageParser(context.getParameterRegistry());
    regs.add(context.registerMessageParser(BGPOpenMessageParser.TYPE, omp));
    regs.add(context.registerMessageSerializer(Open.class, omp));
    final BGPUpdateMessageParser ump = new BGPUpdateMessageParser(context.getAttributeRegistry());
    regs.add(context.registerMessageParser(BGPUpdateMessageParser.TYPE, ump));
    regs.add(context.registerMessageSerializer(Update.class, ump));
    final BGPNotificationMessageParser nmp = new BGPNotificationMessageParser();
    regs.add(context.registerMessageParser(BGPNotificationMessageParser.TYPE, nmp));
    regs.add(context.registerMessageSerializer(Notify.class, nmp));
    final BGPKeepAliveMessageParser kamp = new BGPKeepAliveMessageParser();
    regs.add(context.registerMessageParser(BGPKeepAliveMessageParser.TYPE, kamp));
    regs.add(context.registerMessageSerializer(Keepalive.class, kamp));
    final AddressFamilyRegistry afiReg = context.getAddressFamilyRegistry();
    final SubsequentAddressFamilyRegistry safiReg = context.getSubsequentAddressFamilyRegistry();
    final BGPRouteRefreshMessageParser rrmp = new BGPRouteRefreshMessageParser(afiReg, safiReg);
    regs.add(context.registerMessageParser(BGPRouteRefreshMessageParser.TYPE, rrmp));
    regs.add(context.registerMessageSerializer(RouteRefresh.class, rrmp));
}
Also used : BGPOpenMessageParser(org.opendaylight.protocol.bgp.parser.impl.message.BGPOpenMessageParser) BGPNotificationMessageParser(org.opendaylight.protocol.bgp.parser.impl.message.BGPNotificationMessageParser) AddressFamilyRegistry(org.opendaylight.protocol.bgp.parser.spi.AddressFamilyRegistry) SubsequentAddressFamilyRegistry(org.opendaylight.protocol.bgp.parser.spi.SubsequentAddressFamilyRegistry) BGPUpdateMessageParser(org.opendaylight.protocol.bgp.parser.impl.message.BGPUpdateMessageParser) Notify(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.Notify) BGPRouteRefreshMessageParser(org.opendaylight.protocol.bgp.parser.impl.message.BGPRouteRefreshMessageParser) SubsequentAddressFamilyRegistry(org.opendaylight.protocol.bgp.parser.spi.SubsequentAddressFamilyRegistry) BGPKeepAliveMessageParser(org.opendaylight.protocol.bgp.parser.impl.message.BGPKeepAliveMessageParser) RouteRefresh(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.RouteRefresh) Keepalive(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.Keepalive) Update(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.Update) Open(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.Open)

Example 2 with AddressFamilyRegistry

use of org.opendaylight.protocol.bgp.parser.spi.AddressFamilyRegistry in project bgpcep by opendaylight.

the class BGPActivator method registerCapabilityParsers.

private static void registerCapabilityParsers(final List<AutoCloseable> regs, final BGPExtensionProviderContext context) {
    final AddressFamilyRegistry afiReg = context.getAddressFamilyRegistry();
    final SubsequentAddressFamilyRegistry safiReg = context.getSubsequentAddressFamilyRegistry();
    final MultiProtocolCapabilityHandler multi = new MultiProtocolCapabilityHandler(afiReg, safiReg);
    regs.add(context.registerCapabilityParser(MultiProtocolCapabilityHandler.CODE, multi));
    regs.add(context.registerCapabilitySerializer(MultiprotocolCapability.class, multi));
    final AddPathCapabilityHandler addPath = new AddPathCapabilityHandler(afiReg, safiReg);
    regs.add(context.registerCapabilityParser(AddPathCapabilityHandler.CODE, addPath));
    regs.add(context.registerCapabilitySerializer(AddPathCapability.class, addPath));
    final RouteRefreshCapabilityHandler routeRefresh = new RouteRefreshCapabilityHandler();
    regs.add(context.registerCapabilityParser(RouteRefreshCapabilityHandler.CODE, routeRefresh));
    regs.add(context.registerCapabilitySerializer(RouteRefreshCapability.class, routeRefresh));
    final As4CapabilityHandler as4 = new As4CapabilityHandler();
    regs.add(context.registerCapabilityParser(As4CapabilityHandler.CODE, as4));
    regs.add(context.registerCapabilitySerializer(As4BytesCapability.class, as4));
    final GracefulCapabilityHandler grace = new GracefulCapabilityHandler(afiReg, safiReg);
    regs.add(context.registerCapabilitySerializer(GracefulRestartCapability.class, grace));
    regs.add(context.registerCapabilityParser(GracefulCapabilityHandler.CODE, grace));
    final CapabilityParameterParser cpp = new CapabilityParameterParser(context.getCapabilityRegistry());
    regs.add(context.registerParameterParser(CapabilityParameterParser.TYPE, cpp));
    regs.add(context.registerParameterSerializer(BgpParameters.class, cpp));
    final BgpExtendedMessageCapabilityHandler bgpextmessage = new BgpExtendedMessageCapabilityHandler();
    regs.add(context.registerCapabilityParser(BgpExtendedMessageCapabilityHandler.CODE, bgpextmessage));
    regs.add(context.registerCapabilitySerializer(BgpExtendedMessageCapability.class, bgpextmessage));
}
Also used : AddressFamilyRegistry(org.opendaylight.protocol.bgp.parser.spi.AddressFamilyRegistry) SubsequentAddressFamilyRegistry(org.opendaylight.protocol.bgp.parser.spi.SubsequentAddressFamilyRegistry) RouteRefreshCapability(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.mp.capabilities.RouteRefreshCapability) RouteRefreshCapabilityHandler(org.opendaylight.protocol.bgp.parser.impl.message.open.RouteRefreshCapabilityHandler) AddPathCapabilityHandler(org.opendaylight.protocol.bgp.parser.impl.message.open.AddPathCapabilityHandler) GracefulCapabilityHandler(org.opendaylight.protocol.bgp.parser.impl.message.open.GracefulCapabilityHandler) CapabilityParameterParser(org.opendaylight.protocol.bgp.parser.impl.message.open.CapabilityParameterParser) As4CapabilityHandler(org.opendaylight.protocol.bgp.parser.impl.message.open.As4CapabilityHandler) As4BytesCapability(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.open.message.bgp.parameters.optional.capabilities.c.parameters.As4BytesCapability) BgpParameters(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.open.message.BgpParameters) MultiProtocolCapabilityHandler(org.opendaylight.protocol.bgp.parser.impl.message.open.MultiProtocolCapabilityHandler) BgpExtendedMessageCapabilityHandler(org.opendaylight.protocol.bgp.parser.impl.message.open.BgpExtendedMessageCapabilityHandler) SubsequentAddressFamilyRegistry(org.opendaylight.protocol.bgp.parser.spi.SubsequentAddressFamilyRegistry) MultiprotocolCapability(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.mp.capabilities.MultiprotocolCapability) AddPathCapability(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.mp.capabilities.AddPathCapability) GracefulRestartCapability(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.mp.capabilities.GracefulRestartCapability) BgpExtendedMessageCapability(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.open.message.bgp.parameters.optional.capabilities.c.parameters.BgpExtendedMessageCapability)

Example 3 with AddressFamilyRegistry

use of org.opendaylight.protocol.bgp.parser.spi.AddressFamilyRegistry in project bgpcep by opendaylight.

the class SimpleRegistryTest method testAfiRegistry.

@Test
public void testAfiRegistry() throws Exception {
    final AddressFamilyRegistry afiRegistry = this.ctx.getAddressFamilyRegistry();
    assertEquals(Ipv4AddressFamily.class, afiRegistry.classForFamily(1));
    assertEquals(1, afiRegistry.numberForClass(Ipv4AddressFamily.class).intValue());
}
Also used : AddressFamilyRegistry(org.opendaylight.protocol.bgp.parser.spi.AddressFamilyRegistry) SubsequentAddressFamilyRegistry(org.opendaylight.protocol.bgp.parser.spi.SubsequentAddressFamilyRegistry) Test(org.junit.Test)

Aggregations

AddressFamilyRegistry (org.opendaylight.protocol.bgp.parser.spi.AddressFamilyRegistry)3 SubsequentAddressFamilyRegistry (org.opendaylight.protocol.bgp.parser.spi.SubsequentAddressFamilyRegistry)3 Test (org.junit.Test)1 BGPKeepAliveMessageParser (org.opendaylight.protocol.bgp.parser.impl.message.BGPKeepAliveMessageParser)1 BGPNotificationMessageParser (org.opendaylight.protocol.bgp.parser.impl.message.BGPNotificationMessageParser)1 BGPOpenMessageParser (org.opendaylight.protocol.bgp.parser.impl.message.BGPOpenMessageParser)1 BGPRouteRefreshMessageParser (org.opendaylight.protocol.bgp.parser.impl.message.BGPRouteRefreshMessageParser)1 BGPUpdateMessageParser (org.opendaylight.protocol.bgp.parser.impl.message.BGPUpdateMessageParser)1 AddPathCapabilityHandler (org.opendaylight.protocol.bgp.parser.impl.message.open.AddPathCapabilityHandler)1 As4CapabilityHandler (org.opendaylight.protocol.bgp.parser.impl.message.open.As4CapabilityHandler)1 BgpExtendedMessageCapabilityHandler (org.opendaylight.protocol.bgp.parser.impl.message.open.BgpExtendedMessageCapabilityHandler)1 CapabilityParameterParser (org.opendaylight.protocol.bgp.parser.impl.message.open.CapabilityParameterParser)1 GracefulCapabilityHandler (org.opendaylight.protocol.bgp.parser.impl.message.open.GracefulCapabilityHandler)1 MultiProtocolCapabilityHandler (org.opendaylight.protocol.bgp.parser.impl.message.open.MultiProtocolCapabilityHandler)1 RouteRefreshCapabilityHandler (org.opendaylight.protocol.bgp.parser.impl.message.open.RouteRefreshCapabilityHandler)1 Keepalive (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.Keepalive)1 Notify (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.Notify)1 Open (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.Open)1 Update (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.Update)1 BgpParameters (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.open.message.BgpParameters)1