use of org.opendaylight.protocol.bgp.rib.impl.spi.BGPDispatcher in project bgpcep by opendaylight.
the class BGPTestTool method start.
void start(final Arguments arguments) {
final BGPDispatcher dispatcher = initializeActivator();
final ArrayList<OptionalCapabilities> optCap = Lists.newArrayList(createMPCapability(Ipv4AddressFamily.class, UnicastSubsequentAddressFamily.class), createMPCapability(LinkstateAddressFamily.class, LinkstateSubsequentAddressFamily.class), createAs4BytesMPCapability(arguments.getAs()));
if (arguments.getMultiPathSupport()) {
optCap.add(createAddPathCapability());
}
final BgpParameters bgpParameters = createBgpParameters(optCap);
final InetSocketAddress localAddress = arguments.getLocalAddresses();
final int port = localAddress.getPort();
InetAddress address = localAddress.getAddress();
int numberOfSpeakers = arguments.getSpeakerCount();
do {
final BGPSessionListener sessionListener = new TestingListener(arguments.getNumberOfPrefixes(), arguments.getExtendedCommunities(), arguments.getMultiPathSupport());
this.listeners.put(address.getHostAddress(), sessionListener);
createPeer(dispatcher, arguments, new InetSocketAddress(address, port), sessionListener, bgpParameters);
numberOfSpeakers--;
address = InetAddresses.increment(address);
} while (numberOfSpeakers > 0);
}
Aggregations