2 * Copyright (c) 2013 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.spi;
10 import io.netty.channel.ChannelInboundHandler;
12 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
13 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.BgpTableType;
17 * BGP Session represents the finite state machine in BGP, including timers and its purpose is to create a BGP
18 * connection between BGP speakers. Session is automatically started, when TCP connection is created, but can be stopped
19 * manually via close method of the {@link java.io.Closeable} interface.
21 * If the session is up, it has to redirect messages to/from user. Handles also malformed messages and unknown requests.
23 public interface BGPSession extends AutoCloseable, ChannelInboundHandler {
25 * Return the list of tables which the peer has advertised to support.
27 * @return Set of tables which it supports.
29 Set<BgpTableType> getAdvertisedTableTypes();
32 * Return the BGP router ID advertised by the peer.
34 * @return Peer's BGP Router ID.
36 Ipv4Address getBgpId();
39 * Return the AS number which the peer advertises.
41 * @return Peer's AS Number
43 AsNumber getAsNumber();