OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BgpSessionManager Class Reference

#include <bgp_session_manager.h>

Inheritance diagram for BgpSessionManager:
Collaboration diagram for BgpSessionManager:

Public Member Functions

 BgpSessionManager (EventManager *evm, BgpServer *server)
 
virtual ~BgpSessionManager ()
 
virtual TcpSessionCreateSession ()
 
virtual bool Initialize (unsigned short port)
 
virtual bool Initialize (unsigned short port, const IpAddress &ip)
 
void Shutdown ()
 
void Terminate ()
 
bool MayDelete () const
 
void EnqueueWriteReady (BgpSession *session)
 
BgpServerserver ()
 
- Public Member Functions inherited from TcpServer
 TcpServer (EventManager *evm)
 
virtual ~TcpServer ()
 
virtual bool Initialize (unsigned short port, const IpAddress &host_ip, int intf_id=-1)
 
bool InitializeInternal (boost::asio::ip::tcp::endpoint localaddr)
 
const std::string ToString () const
 
void SetAcceptor ()
 
void ResetAcceptor ()
 
void Shutdown ()
 
void ClearSessions ()
 
void UpdateSessionsDscp (uint8_t dscp)
 
virtual void DeleteSession (TcpSession *session)
 
virtual void Connect (TcpSession *session, Endpoint remote)
 
virtual bool DisableSandeshLogMessages () const
 
int GetPort () const
 
const io::SocketStatsGetSocketStats () const
 
size_t GetSessionCount () const
 
EventManagerevent_manager ()
 
bool HasSessionReadAvailable () const
 
bool HasSessions () const
 
TcpSessionGetSession (Endpoint remote)
 
void WaitForEmpty ()
 
void GetRxSocketStats (SocketIOStats *socket_stats) const
 
void GetTxSocketStats (SocketIOStats *socket_stats) const
 
void GetRxSocketStats (SocketIOStats &socket_stats) const
 
void GetTxSocketStats (SocketIOStats &socket_stats) const
 
int SetMd5SocketOption (NativeSocketType fd, uint32_t peer_ip, const std::string &md5_password)
 
int SetListenSocketMd5Option (uint32_t peer_ip, const std::string &md5_password)
 
int SetDscpSocketOption (NativeSocketType fd, uint8_t value)
 
uint8_t GetDscpValue (NativeSocketType fd) const
 
int SetListenSocketDscp (uint8_t value)
 
int SetSocketOptions (const SandeshConfig &sandesh_config)
 
int SetKeepAliveSocketOption (int fd, const SandeshConfig &sandesh_config)
 

Protected Member Functions

virtual TcpSessionAllocSession (Socket *socket)
 
virtual bool AcceptSession (TcpSession *session)
 
- Protected Member Functions inherited from TcpServer
virtual TcpSessionAllocSession (bool server_session)
 
virtual Socketaccept_socket () const
 
virtual void set_accept_socket ()
 
void set_socket_open_failure (bool flag)
 
bool socket_open_failure () const
 
Endpoint LocalEndpoint () const
 
virtual void AcceptHandlerComplete (TcpSessionPtr session)
 
virtual void ConnectHandlerComplete (TcpSessionPtr session)
 

Private Member Functions

BgpPeerFindPeer (Endpoint remote)
 
bool ProcessSession (BgpSession *session)
 
bool ProcessWriteReady (TcpSessionPtr tcp_session)
 
void WorkQueueExitCallback (bool done)
 
size_t GetSessionQueueSize () const
 
void SetSessionQueueDisable (bool disabled)
 
 DISALLOW_COPY_AND_ASSIGN (BgpSessionManager)
 

Private Attributes

BgpServerserver_
 
WorkQueue< BgpSession * > session_queue_
 
WorkQueue< TcpSessionPtrwrite_ready_queue_
 
IpAddress session_ip_
 

Friends

class BgpServerUnitTest
 

Additional Inherited Members

- Public Types inherited from TcpServer
typedef
boost::asio::ip::tcp::endpoint 
Endpoint
 
typedef
boost::asio::ip::tcp::socket 
Socket
 
typedef
boost::asio::ip::tcp::socket::native_handle_type 
NativeSocketType
 
- Protected Types inherited from TcpServer
typedef boost::intrusive_ptr
< TcpServer
TcpServerPtr
 
typedef boost::intrusive_ptr
< TcpSession
TcpSessionPtr
 

Detailed Description

Definition at line 20 of file bgp_session_manager.h.

Constructor & Destructor Documentation

BgpSessionManager::BgpSessionManager ( EventManager evm,
BgpServer server 
)

Definition at line 21 of file bgp_session_manager.cc.

Here is the call graph for this function:

BgpSessionManager::~BgpSessionManager ( )
virtual

Definition at line 35 of file bgp_session_manager.cc.

Member Function Documentation

bool BgpSessionManager::AcceptSession ( TcpSession session)
protectedvirtual

Reimplemented from TcpServer.

Definition at line 205 of file bgp_session_manager.cc.

Here is the call graph for this function:

TcpSession * BgpSessionManager::AllocSession ( Socket socket)
protectedvirtual

Implements TcpServer.

Definition at line 191 of file bgp_session_manager.cc.

TcpSession * BgpSessionManager::CreateSession ( )
virtual

Reimplemented from TcpServer.

Definition at line 160 of file bgp_session_manager.cc.

Here is the call graph for this function:

BgpSessionManager::DISALLOW_COPY_AND_ASSIGN ( BgpSessionManager  )
private
void BgpSessionManager::EnqueueWriteReady ( BgpSession session)

Definition at line 119 of file bgp_session_manager.cc.

Here is the call graph for this function:

BgpPeer * BgpSessionManager::FindPeer ( Endpoint  remote)
private

Definition at line 141 of file bgp_session_manager.cc.

Here is the call graph for this function:

size_t BgpSessionManager::GetSessionQueueSize ( ) const
private

Definition at line 292 of file bgp_session_manager.cc.

Here is the call graph for this function:

bool BgpSessionManager::Initialize ( unsigned short  port)
virtual

Reimplemented from TcpServer.

Definition at line 41 of file bgp_session_manager.cc.

Here is the call graph for this function:

bool BgpSessionManager::Initialize ( unsigned short  port,
const IpAddress ip 
)
virtual

Definition at line 68 of file bgp_session_manager.cc.

bool BgpSessionManager::MayDelete ( ) const

Definition at line 106 of file bgp_session_manager.cc.

Here is the call graph for this function:

bool BgpSessionManager::ProcessSession ( BgpSession session)
private

Definition at line 219 of file bgp_session_manager.cc.

Here is the call graph for this function:

bool BgpSessionManager::ProcessWriteReady ( TcpSessionPtr  tcp_session)
private

Definition at line 130 of file bgp_session_manager.cc.

Here is the call graph for this function:

BgpServer* BgpSessionManager::server ( )
inline

Definition at line 34 of file bgp_session_manager.h.

void BgpSessionManager::SetSessionQueueDisable ( bool  disabled)
private

Definition at line 296 of file bgp_session_manager.cc.

Here is the call graph for this function:

void BgpSessionManager::Shutdown ( )

Definition at line 79 of file bgp_session_manager.cc.

Here is the call graph for this function:

void BgpSessionManager::Terminate ( )

Definition at line 95 of file bgp_session_manager.cc.

Here is the call graph for this function:

void BgpSessionManager::WorkQueueExitCallback ( bool  done)
private

Definition at line 288 of file bgp_session_manager.cc.

Here is the call graph for this function:

Friends And Related Function Documentation

friend class BgpServerUnitTest
friend

Definition at line 41 of file bgp_session_manager.h.

Member Data Documentation

BgpServer* BgpSessionManager::server_
private

Definition at line 50 of file bgp_session_manager.h.

IpAddress BgpSessionManager::session_ip_
private

Definition at line 54 of file bgp_session_manager.h.

WorkQueue<BgpSession *> BgpSessionManager::session_queue_
private

Definition at line 51 of file bgp_session_manager.h.

WorkQueue<TcpSessionPtr> BgpSessionManager::write_ready_queue_
private

Definition at line 52 of file bgp_session_manager.h.


The documentation for this class was generated from the following files: