2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.protocol.bgp.rib.impl;
10 import io.netty.channel.Channel;
11 import io.netty.util.Timer;
12 import io.netty.util.concurrent.Promise;
13 import org.opendaylight.protocol.bgp.rib.impl.AbstractBGPSessionNegotiator;
14 import org.opendaylight.protocol.bgp.rib.impl.BGPSessionImpl;
15 import org.opendaylight.protocol.bgp.rib.impl.spi.BGPPeerRegistry;
16 import org.opendaylight.protocol.bgp.rib.impl.spi.BGPSessionPreferences;
17 import org.opendaylight.protocol.bgp.rib.impl.spi.BGPSessionValidator;
18 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.Open;
22 * Client negotiator. Validates established connections using BGPClientSessionValidator
24 public final class BGPClientSessionNegotiator extends AbstractBGPSessionNegotiator {
26 public BGPClientSessionNegotiator(final Timer timer,
27 final Promise<BGPSessionImpl> promise, final Channel channel,
28 final BGPPeerRegistry registry,
29 final BGPSessionValidator sessionValidator) {
30 super(timer, promise, channel, registry, sessionValidator);
33 protected Ipv4Address getDestinationId(final Open openMsg,
34 final BGPSessionPreferences preferences) {
35 return preferences.getBgpId();
38 protected Ipv4Address getSourceId(final Open openMsg,
39 final BGPSessionPreferences preferences) {
40 return openMsg.getBgpIdentifier();