17 using namespace boost::asio::ip;
31 boost::system::error_code ec;
46 if (local_endpoint != new_endpoint) {
48 "Cannot change already bound " << local_endpoint <<
49 " to " << new_endpoint);
55 LOG(DEBUG,
"Starting Bgp Server at " <<
session_ip_ <<
":" << port);
59 "Cannot bind to bgp/tcp server ip:port " <<
145 if (instance && !instance->
deleted()) {
164 boost::system::error_code ec;
165 socket->open(boost::asio::ip::tcp::v4(), ec);
168 "Failed to open bgp socket, error: " << ec.message());
175 socket->bind(localaddr, ec);
179 ", error: " << ec.message());
245 "Remote end-point not found");
bool ProcessWriteReady(TcpSessionPtr tcp_session)
virtual bool ProcessSession() const
void set_read_on_connect(bool read)
WorkQueue< BgpSession * > session_queue_
boost::asio::ip::tcp::endpoint Endpoint
WorkQueue< TcpSessionPtr > write_ready_queue_
bool IsQueueEmpty() const
virtual BgpPeer * PeerLookup(std::string name) const
virtual void DeleteSession(TcpSession *session)
The TaskScheduler keeps track of what tasks are currently schedulable. When a task is enqueued it is ...
void WorkQueueExitCallback(bool done)
PeerManager * peer_manager()
void Shutdown(bool delete_entries=true)
bool AcceptSession(BgpSession *session)
boost::asio::ip::tcp::socket Socket
boost::asio::ip::address IpAddress
BgpGlobalSystemConfig * global_config()
virtual TcpSession * CreateSession()
RoutingInstanceMgr * routing_instance_mgr()
RoutingInstance * GetDefaultRoutingInstance()
BgpPeer * FindPeer(const std::string &name)
virtual TcpSession * CreateSession()
Endpoint LocalEndpoint() const
bool IsCloseInProgress() const
BgpPeer * FindPeer(Endpoint remote)
static const std::string kDefaultBgpSessionIp
void SetExitCallback(TaskExitCallback on_exit)
virtual bool AcceptSession(TcpSession *session)
virtual bool Initialize(unsigned short port)
size_t GetSessionQueueSize() const
#define CHECK_CONCURRENCY(...)
bool PrefixLimitIdleTimerRunning() const
#define BGP_LOG_WARNING_STR(obj, flags, arg)
boost::asio::ip::address_v4 Ip4Address
uint16_t bgpaas_port_start() const
virtual ~BgpSessionManager()
void set_disable(bool disabled)
IpAddress AddressFromString(const std::string &ip_address_str, boost::system::error_code *ec)
uint16_t bgpaas_port_end() const
BgpSessionManager(EventManager *evm, BgpServer *server)
#define BGP_LOG_FLAG_TRACE
bool ProcessSession(BgpSession *session)
virtual TcpSession * AllocSession(Socket *socket)
static BgpAsServicePortIndexPair DecodeBgpaasServicePort(const uint32_t sport, const uint16_t port_range_start, const uint16_t port_range_end)
Endpoint remote_endpoint() const
#define LOG(_Level, _Msg)
virtual bool Initialize(unsigned short port)
void SendNotification(int code, int subcode, const std::string &data=std::string())
virtual Socket * socket() const
bool Enqueue(QueueEntryT entry)
boost::asio::ip::tcp::endpoint Endpoint
bool socket_open_failure() const
void SetSessionQueueDisable(bool disabled)
LifetimeActor * deleter()
void EnqueueWriteReady(BgpSession *session)
boost::intrusive_ptr< TcpSession > TcpSessionPtr
virtual boost::system::error_code SetSocketOptions()