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
9 package org.opendaylight.protocol.bgp.rib.impl;
11 import io.netty.channel.Channel;
12 import io.netty.util.Timer;
13 import io.netty.util.concurrent.Promise;
15 import org.opendaylight.protocol.bgp.rib.impl.AbstractBGPSessionNegotiator;
16 import org.opendaylight.protocol.bgp.rib.impl.BGPSessionImpl;
17 import org.opendaylight.protocol.bgp.rib.impl.spi.BGPPeerRegistry;
18 import org.opendaylight.protocol.bgp.rib.impl.spi.BGPSessionPreferences;
19 import org.opendaylight.protocol.bgp.rib.impl.spi.BGPSessionValidator;
20 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.Open;
24 * Server negotiator. Validates established connections using BGPServerSessionValidator
26 public final class BGPServerSessionNegotiator extends AbstractBGPSessionNegotiator {
28 public BGPServerSessionNegotiator(final Timer timer,
29 final Promise<BGPSessionImpl> promise, final Channel channel,
30 final BGPPeerRegistry registry,
31 final BGPSessionValidator sessionValidator) {
32 super(timer, promise, channel, registry, sessionValidator);
35 protected Ipv4Address getSourceId(final Open openMsg,
36 final BGPSessionPreferences preferences) {
37 return preferences.getBgpId();
40 protected Ipv4Address getDestinationId(final Open openMsg,
41 final BGPSessionPreferences preferences) {
42 return openMsg.getBgpIdentifier();