OpenSDN source code
Sandesh Class Referenceabstract

#include <sandesh.h>

Inheritance diagram for Sandesh:
Collaboration diagram for Sandesh:

Classes

struct  SandeshRole
 

Public Types

typedef WorkQueue< SandeshRequest * > SandeshRxQueue
 
typedef WorkQueue< SandeshElementSandeshQueue
 
typedef WorkQueue< boost::shared_ptr< contrail::sandesh::transport::TMemoryBuffer > > SandeshBufferQueue
 
typedef boost::asio::ip::tcp::endpoint Endpoint
 
typedef boost::function< void(Sandesh *)> SandeshCallback
 
typedef boost::tuple< size_t, SandeshLevel::type, bool, bool > QueueWaterMarkInfo
 
typedef std::map< std::string, std::map< std::string, std::string > > DerivedStats
 

Public Member Functions

virtual size_t GetSize () const =0
 
virtual void Release ()
 
virtual void Log () const =0
 
virtual void ForcedLog () const =0
 
virtual std::string ToString () const =0
 
virtual std::string ModuleName () const =0
 
virtual int32_t Read (boost::shared_ptr< contrail::sandesh::protocol::TProtocol > iprot)=0
 
virtual int32_t Write (boost::shared_ptr< contrail::sandesh::protocol::TProtocol > oprot) const =0
 
virtual const uint32_t seqnum ()
 
virtual const int32_t versionsig () const =0
 
virtual const char * Name () const
 
bool Enqueue (SandeshQueue *queue)
 
virtual int32_t WriteBinary (u_int8_t *buf, u_int32_t buf_len, int *error)
 
virtual int32_t ReadBinary (u_int8_t *buf, u_int32_t buf_len, int *error)
 
virtual int32_t WriteBinaryToFile (const std::string &path, int *error)
 
virtual int32_t ReadBinaryFromFile (const std::string &path, int *error)
 
bool IsLoggingAllowed () const
 
time_t timestamp () const
 
void set_context (std::string context)
 
std::string context () const
 
void set_scope (std::string scope)
 
std::string scope () const
 
SandeshType::type type () const
 
void set_hints (int32_t hints)
 
int32_t hints () const
 
void set_level (SandeshLevel::type level)
 
SandeshLevel::type level () const
 
void set_category (std::string category)
 
std::string category () const
 

Static Public Member Functions

static bool InitGenerator (const std::string &module, const std::string &source, const std::string &node_type, const std::string &instance_id, EventManager *evm, unsigned short http_port, const std::vector< std::string > &collectors, SandeshContext *client_context=NULL, DerivedStats ds=DerivedStats(), const SandeshConfig &config=SandeshConfig())
 
static bool InitGenerator (const std::string &module, const std::string &source, const std::string &node_type, const std::string &instance_id, EventManager *evm, unsigned short http_port, SandeshContext *client_context=NULL, DerivedStats ds=DerivedStats(), const SandeshConfig &config=SandeshConfig())
 
static void RecordPort (const std::string &name, const std::string &module, unsigned short port)
 
static bool InitCollector (const std::string &module, const std::string &source, const std::string &node_type, const std::string &instance_id, EventManager *evm, const std::string &collector_ip, int collector_port, unsigned short http_port, SandeshContext *client_context=NULL, const SandeshConfig &config=SandeshConfig())
 
static bool InitGeneratorTest (const std::string &module, const std::string &source, const std::string &node_type, const std::string &instance_id, EventManager *evm, unsigned short http_port, SandeshContext *client_context=NULL, const SandeshConfig &config=SandeshConfig())
 
static bool ConnectToCollector (const std::string &collector_ip, int collector_port, bool periodicuve=false)
 
static void ReConfigCollectors (const std::vector< std::string > &collector_list)
 
static void Uninit ()
 
static void SetDscpValue (uint8_t value)
 
static void DisableFlowCollection (bool disable)
 
static bool IsFlowCollectionDisabled ()
 
static void DisableSendingAllMessages (bool disable)
 
static bool IsSendingAllMessagesDisabled ()
 
static void DisableSendingObjectLogs (bool disable)
 
static bool IsSendingObjectLogsDisabled ()
 
static bool IsSendingSystemLogsDisabled ()
 
static void DisableSendingFlows (bool disable)
 
static bool IsSendingFlowsDisabled ()
 
static void set_send_rate_limit (int rate_limit)
 
static uint32_t get_send_rate_limit ()
 
static void SetLoggingParams (bool enable_local_log, std::string category, std::string level, bool enable_trace_print=false, bool enable_flow_log=false, bool enable_session_syslog=false)
 
static void SetLoggingParams (bool enable_local_log, std::string category, SandeshLevel::type level, bool enable_trace_print=false, bool enable_flow_log=false)
 
static void SetLoggingLevel (std::string level)
 
static void SetLoggingLevel (SandeshLevel::type level)
 
static SandeshLevel::type LoggingLevel ()
 
static SandeshLevel::type LoggingUtLevel ()
 
static bool IsLocalLoggingEnabled ()
 
static void SetLocalLogging (bool enable)
 
static bool IsFlowLoggingEnabled ()
 
static bool IsSloSyslogEnabled ()
 
static void SetFlowLogging (bool enable)
 
static void SetSessionSyslogging (bool enable_session_syslog)
 
static bool IsTracePrintEnabled ()
 
static void SetTracePrint (bool enable)
 
static void SetLoggingCategory (std::string category)
 
static std::string LoggingCategory ()
 
static void SetSendQueue (bool enable)
 
static bool IsSendQueueEnabled ()
 
static bool IsConnectToCollectorEnabled ()
 
static SandeshLevel::type SendingLevel ()
 
static int32_t ReceiveBinaryMsgOne (u_int8_t *buf, u_int32_t buf_len, int *error, SandeshContext *client_context)
 
static int32_t ReceiveBinaryMsg (u_int8_t *buf, u_int32_t buf_len, int *error, SandeshContext *client_context)
 
static bool SendReady (SandeshConnection *sconn=NULL)
 
static void UpdateRxMsgStats (const std::string &msg_name, uint64_t bytes)
 
static void UpdateRxMsgFailStats (const std::string &msg_name, uint64_t bytes, SandeshRxDropReason::type dreason)
 
static void UpdateTxMsgStats (const std::string &msg_name, uint64_t bytes)
 
static void UpdateTxMsgFailStats (const std::string &msg_name, uint64_t bytes, SandeshTxDropReason::type dreason)
 
static void GetMsgStats (std::vector< SandeshMessageTypeStats > *mtype_stats, SandeshMessageStats *magg_stats)
 
static void GetMsgStats (boost::ptr_map< std::string, SandeshMessageTypeStats > *mtype_stats, SandeshMessageStats *magg_stats)
 
static const char * SandeshRoleToString (SandeshRole::type role)
 
static bool IsLoggingDroppedAllowed (SandeshType::type)
 
static void set_source (std::string &source)
 
static std::string source ()
 
static void set_module (std::string &module)
 
static std::string module ()
 
static void set_instance_id (std::string &instance_id)
 
static std::string instance_id ()
 
static void set_node_type (std::string &node_type)
 
static std::string node_type ()
 
static SandeshRole::type role ()
 
static int http_port ()
 
static SandeshRxQueuerecv_queue ()
 
static SandeshContextclient_context ()
 
static void set_client_context (SandeshContext *context)
 
static SandeshContextmodule_context (const std::string &module_name)
 
static void set_module_context (const std::string &module_name, SandeshContext *context)
 
static void set_response_callback (SandeshCallback response_cb)
 
static SandeshCallback response_callback ()
 
static SandeshClientclient ()
 
static SandeshConfigconfig ()
 
static const char * LevelToString (SandeshLevel::type level)
 
static SandeshLevel::type StringToLevel (std::string level)
 
static log4cplus::Logger & logger ()
 
static log4cplus::Logger & slo_logger ()
 
static log4cplus::Logger & sampled_logger ()
 
static void set_logger_appender (const std::string &file_name, long max_file_size, int max_backup_index, const std::string &syslog_facility, const std::vector< std::string > &destn, const std::string &ident, bool is_sampled_logger)
 
static void set_send_to_collector_flags (const std::vector< std::string > &sampled_destination, const std::vector< std::string > &slo_destination)
 
static bool is_send_slo_to_collector_enabled ()
 
static bool is_send_sampled_to_collector_enabled ()
 
static bool is_send_slo_to_logger_enabled ()
 
static bool is_send_sampled_to_logger_enabled ()
 

Protected Member Functions

void set_timestamp (time_t timestamp)
 
void set_type (SandeshType::type type)
 
void set_name (const char *name)
 
 Sandesh (SandeshType::type type, const std::string &name, uint32_t seqno)
 
 Sandesh (SandeshType::type type, const std::string &name, uint32_t seqno, bool no_time_stamp)
 
virtual ~Sandesh ()
 
virtual bool Dispatch (SandeshConnection *sconn=NULL)
 
virtual bool SendEnqueue ()
 

Static Protected Member Functions

static bool HandleTest (SandeshLevel::type level, const std::string &category)
 
static bool IsUnitTest ()
 
static bool IsLevelUT (SandeshLevel::type level)
 
static bool IsLevelCategoryLoggingAllowed (SandeshType::type type, SandeshLevel::type level, const std::string &category)
 

Static Protected Attributes

static SandeshCallback response_callback_ = 0
 
static SandeshClientclient_ = NULL
 

Private Types

typedef std::map< std::string, SandeshContext * > ModuleContextMap
 

Static Private Member Functions

static void InitReceive (int recv_task_inst=-1)
 
static void InitClient (EventManager *evm, Endpoint server, const SandeshConfig &config, bool periodicuve)
 
static bool InitClient (EventManager *evm, const std::vector< std::string > &collectors, const SandeshConfig &config)
 
static bool ProcessRecv (SandeshRequest *)
 
static bool Initialize (SandeshRole::type role, const std::string &module, const std::string &source, const std::string &node_type, const std::string &instance_id, EventManager *evm, unsigned short http_port, SandeshContext *client_context=NULL, const SandeshConfig &config=SandeshConfig())
 

Private Attributes

const uint32_t seqnum_
 
std::string context_
 
time_t timestamp_
 
std::string scope_
 
SandeshType::type type_
 
int32_t hints_
 
SandeshLevel::type level_
 
std::string category_
 
std::string name_
 

Static Private Attributes

static SandeshRole::type role_ = SandeshRole::Invalid
 
static std::string module_
 
static std::string source_
 
static std::string node_type_
 
static std::string instance_id_
 
static int http_port_ = 0
 
static std::unique_ptr< SandeshRxQueuerecv_queue_
 
static int recv_task_id_ = -1
 
static SandeshContextclient_context_ = NULL
 
static ModuleContextMap module_context_
 
static bool enable_local_log_ = false
 
static bool enable_flow_log_ = false
 
static bool enable_session_syslog_ = false
 
static SandeshLevel::type logging_level_ = SandeshLevel::INVALID
 
static SandeshLevel::type logging_ut_level_
 
static std::string logging_category_
 
static bool enable_trace_print_ = false
 
static bool connect_to_collector_ = false
 
static EventManagerevent_manager_ = NULL
 
static bool send_queue_enabled_ = true
 
static SandeshMessageStatistics msg_stats_
 
static tbb::mutex stats_mutex_
 
static log4cplus::Logger logger_
 
static log4cplus::Logger slo_logger_
 
static log4cplus::Logger sampled_logger_
 
static bool disable_flow_collection_ = false
 
static SandeshConfig config_
 
static bool disable_sending_all_ = false
 
static bool disable_sending_object_logs_ = false
 
static bool disable_sending_flows_ = false
 
static tbb::atomic< uint32_t > sandesh_send_ratelimit_
 
static bool slo_to_collector_ = false
 
static bool sampled_to_collector_ = false
 
static bool slo_to_logger_ = false
 
static bool sampled_to_logger_ = false
 

Friends

class SandeshTracePerfTest
 

Detailed Description

Definition at line 130 of file cpp/sandesh.h.

Member Typedef Documentation

◆ DerivedStats

typedef std::map<std::string, std::map<std::string,std::string> > Sandesh::DerivedStats

Definition at line 148 of file cpp/sandesh.h.

◆ Endpoint

typedef boost::asio::ip::tcp::endpoint Sandesh::Endpoint

Definition at line 137 of file cpp/sandesh.h.

◆ ModuleContextMap

typedef std::map<std::string, SandeshContext *> Sandesh::ModuleContextMap
private

Definition at line 388 of file cpp/sandesh.h.

◆ QueueWaterMarkInfo

typedef boost::tuple<size_t, SandeshLevel::type, bool, bool> Sandesh::QueueWaterMarkInfo

Definition at line 147 of file cpp/sandesh.h.

◆ SandeshBufferQueue

Definition at line 136 of file cpp/sandesh.h.

◆ SandeshCallback

typedef boost::function<void (Sandesh *)> Sandesh::SandeshCallback

Definition at line 138 of file cpp/sandesh.h.

◆ SandeshQueue

Definition at line 133 of file cpp/sandesh.h.

◆ SandeshRxQueue

Definition at line 132 of file cpp/sandesh.h.

Constructor & Destructor Documentation

◆ Sandesh() [1/2]

Sandesh::Sandesh ( SandeshType::type  type,
const std::string &  name,
uint32_t  seqno 
)
inlineprotected

Definition at line 346 of file cpp/sandesh.h.

◆ Sandesh() [2/2]

Sandesh::Sandesh ( SandeshType::type  type,
const std::string &  name,
uint32_t  seqno,
bool  no_time_stamp 
)
inlineprotected

Definition at line 357 of file cpp/sandesh.h.

Here is the call graph for this function:

◆ ~Sandesh()

virtual Sandesh::~Sandesh ( )
inlineprotectedvirtual

Definition at line 368 of file cpp/sandesh.h.

Member Function Documentation

◆ category()

std::string Sandesh::category ( ) const
inline

Definition at line 320 of file cpp/sandesh.h.

◆ client()

static SandeshClient* Sandesh::client ( )
inlinestatic

Definition at line 306 of file cpp/sandesh.h.

◆ client_context()

static SandeshContext* Sandesh::client_context ( )
inlinestatic

Definition at line 299 of file cpp/sandesh.h.

◆ config()

static SandeshConfig& Sandesh::config ( )
inlinestatic

Definition at line 307 of file cpp/sandesh.h.

◆ ConnectToCollector()

bool Sandesh::ConnectToCollector ( const std::string &  collector_ip,
int  collector_port,
bool  periodicuve = false 
)
static

Definition at line 212 of file sandesh.cc.

Here is the call graph for this function:

◆ context()

std::string Sandesh::context ( ) const
inline

Definition at line 311 of file cpp/sandesh.h.

◆ DisableFlowCollection()

void Sandesh::DisableFlowCollection ( bool  disable)
static

Definition at line 484 of file sandesh.cc.

◆ DisableSendingAllMessages()

void Sandesh::DisableSendingAllMessages ( bool  disable)
static

Definition at line 492 of file sandesh.cc.

◆ DisableSendingFlows()

void Sandesh::DisableSendingFlows ( bool  disable)
static

Definition at line 516 of file sandesh.cc.

◆ DisableSendingObjectLogs()

void Sandesh::DisableSendingObjectLogs ( bool  disable)
static

Definition at line 504 of file sandesh.cc.

◆ Dispatch()

bool Sandesh::Dispatch ( SandeshConnection sconn = NULL)
protectedvirtual

Reimplemented in SandeshUVE, SandeshTrace, and SandeshResponse.

Definition at line 727 of file sandesh.cc.

Here is the call graph for this function:

◆ Enqueue()

bool Sandesh::Enqueue ( SandeshQueue queue)

Definition at line 544 of file sandesh.cc.

Here is the call graph for this function:

◆ ForcedLog()

virtual void Sandesh::ForcedLog ( ) const
pure virtual

◆ get_send_rate_limit()

uint32_t Sandesh::get_send_rate_limit ( )
static

Definition at line 540 of file sandesh.cc.

◆ GetMsgStats() [1/2]

void Sandesh::GetMsgStats ( boost::ptr_map< std::string, SandeshMessageTypeStats > *  mtype_stats,
SandeshMessageStats *  magg_stats 
)
static

Definition at line 903 of file sandesh.cc.

◆ GetMsgStats() [2/2]

void Sandesh::GetMsgStats ( std::vector< SandeshMessageTypeStats > *  mtype_stats,
SandeshMessageStats *  magg_stats 
)
static

Definition at line 896 of file sandesh.cc.

◆ GetSize()

virtual size_t Sandesh::GetSize ( ) const
pure virtual

◆ HandleTest()

bool Sandesh::HandleTest ( SandeshLevel::type  level,
const std::string &  category 
)
staticprotected

Definition at line 966 of file sandesh.cc.

◆ hints()

int32_t Sandesh::hints ( ) const
inline

Definition at line 316 of file cpp/sandesh.h.

◆ http_port()

static int Sandesh::http_port ( )
inlinestatic

Definition at line 297 of file cpp/sandesh.h.

◆ InitClient() [1/2]

bool Sandesh::InitClient ( EventManager evm,
const std::vector< std::string > &  collectors,
const SandeshConfig config 
)
staticprivate

Definition at line 236 of file sandesh.cc.

Here is the call graph for this function:

◆ InitClient() [2/2]

void Sandesh::InitClient ( EventManager evm,
Endpoint  server,
const SandeshConfig config,
bool  periodicuve 
)
staticprivate

Definition at line 123 of file sandesh.cc.

◆ InitCollector()

bool Sandesh::InitCollector ( const std::string &  module,
const std::string &  source,
const std::string &  node_type,
const std::string &  instance_id,
EventManager evm,
const std::string &  collector_ip,
int  collector_port,
unsigned short  http_port,
SandeshContext client_context = NULL,
const SandeshConfig config = SandeshConfig() 
)
static

Definition at line 292 of file sandesh.cc.

◆ InitGenerator() [1/2]

bool Sandesh::InitGenerator ( const std::string &  module,
const std::string &  source,
const std::string &  node_type,
const std::string &  instance_id,
EventManager evm,
unsigned short  http_port,
const std::vector< std::string > &  collectors,
SandeshContext client_context = NULL,
DerivedStats  ds = DerivedStats(),
const SandeshConfig config = SandeshConfig() 
)
static

Definition at line 271 of file sandesh.cc.

Here is the call graph for this function:

◆ InitGenerator() [2/2]

bool Sandesh::InitGenerator ( const std::string &  module,
const std::string &  source,
const std::string &  node_type,
const std::string &  instance_id,
EventManager evm,
unsigned short  http_port,
SandeshContext client_context = NULL,
DerivedStats  ds = DerivedStats(),
const SandeshConfig config = SandeshConfig() 
)
static

Definition at line 257 of file sandesh.cc.

Here is the call graph for this function:

◆ InitGeneratorTest()

bool Sandesh::InitGeneratorTest ( const std::string &  module,
const std::string &  source,
const std::string &  node_type,
const std::string &  instance_id,
EventManager evm,
unsigned short  http_port,
SandeshContext client_context = NULL,
const SandeshConfig config = SandeshConfig() 
)
static

Definition at line 310 of file sandesh.cc.

◆ Initialize()

bool Sandesh::Initialize ( SandeshRole::type  role,
const std::string &  module,
const std::string &  source,
const std::string &  node_type,
const std::string &  instance_id,
EventManager evm,
unsigned short  http_port,
SandeshContext client_context = NULL,
const SandeshConfig config = SandeshConfig() 
)
staticprivate

Definition at line 144 of file sandesh.cc.

Here is the call graph for this function:

◆ InitReceive()

void Sandesh::InitReceive ( int  recv_task_inst = -1)
staticprivate

Definition at line 115 of file sandesh.cc.

Here is the call graph for this function:

◆ instance_id()

static std::string Sandesh::instance_id ( )
inlinestatic

Definition at line 293 of file cpp/sandesh.h.

◆ is_send_sampled_to_collector_enabled()

static bool Sandesh::is_send_sampled_to_collector_enabled ( )
inlinestatic

Definition at line 337 of file cpp/sandesh.h.

◆ is_send_sampled_to_logger_enabled()

static bool Sandesh::is_send_sampled_to_logger_enabled ( )
inlinestatic

Definition at line 339 of file cpp/sandesh.h.

◆ is_send_slo_to_collector_enabled()

static bool Sandesh::is_send_slo_to_collector_enabled ( )
inlinestatic

Definition at line 336 of file cpp/sandesh.h.

◆ is_send_slo_to_logger_enabled()

static bool Sandesh::is_send_slo_to_logger_enabled ( )
inlinestatic

Definition at line 338 of file cpp/sandesh.h.

◆ IsConnectToCollectorEnabled()

static bool Sandesh::IsConnectToCollectorEnabled ( )
inlinestatic

Definition at line 242 of file cpp/sandesh.h.

◆ IsFlowCollectionDisabled()

static bool Sandesh::IsFlowCollectionDisabled ( )
inlinestatic

Definition at line 199 of file cpp/sandesh.h.

◆ IsFlowLoggingEnabled()

static bool Sandesh::IsFlowLoggingEnabled ( )
inlinestatic

Definition at line 225 of file cpp/sandesh.h.

◆ IsLevelCategoryLoggingAllowed()

bool Sandesh::IsLevelCategoryLoggingAllowed ( SandeshType::type  type,
SandeshLevel::type  level,
const std::string &  category 
)
staticprotected

Definition at line 821 of file sandesh.cc.

◆ IsLevelUT()

bool Sandesh::IsLevelUT ( SandeshLevel::type  level)
staticprotected

Definition at line 816 of file sandesh.cc.

◆ IsLocalLoggingEnabled()

static bool Sandesh::IsLocalLoggingEnabled ( )
inlinestatic

Definition at line 223 of file cpp/sandesh.h.

◆ IsLoggingAllowed()

bool Sandesh::IsLoggingAllowed ( ) const

Definition at line 835 of file sandesh.cc.

◆ IsLoggingDroppedAllowed()

bool Sandesh::IsLoggingDroppedAllowed ( SandeshType::type  type)
static

Definition at line 844 of file sandesh.cc.

◆ IsSendingAllMessagesDisabled()

bool Sandesh::IsSendingAllMessagesDisabled ( )
static

Definition at line 500 of file sandesh.cc.

◆ IsSendingFlowsDisabled()

bool Sandesh::IsSendingFlowsDisabled ( )
static

Definition at line 524 of file sandesh.cc.

◆ IsSendingObjectLogsDisabled()

bool Sandesh::IsSendingObjectLogsDisabled ( )
static

Definition at line 512 of file sandesh.cc.

◆ IsSendingSystemLogsDisabled()

bool Sandesh::IsSendingSystemLogsDisabled ( )
static

Definition at line 528 of file sandesh.cc.

◆ IsSendQueueEnabled()

static bool Sandesh::IsSendQueueEnabled ( )
inlinestatic

Definition at line 239 of file cpp/sandesh.h.

◆ IsSloSyslogEnabled()

static bool Sandesh::IsSloSyslogEnabled ( )
inlinestatic

Definition at line 226 of file cpp/sandesh.h.

◆ IsTracePrintEnabled()

static bool Sandesh::IsTracePrintEnabled ( )
inlinestatic

Definition at line 229 of file cpp/sandesh.h.

◆ IsUnitTest()

static bool Sandesh::IsUnitTest ( )
inlinestaticprotected

Definition at line 375 of file cpp/sandesh.h.

◆ level()

SandeshLevel::type Sandesh::level ( ) const
inline

Definition at line 318 of file cpp/sandesh.h.

◆ LevelToString()

const char * Sandesh::LevelToString ( SandeshLevel::type  level)
static

Definition at line 852 of file sandesh.cc.

◆ Log()

virtual void Sandesh::Log ( ) const
pure virtual

◆ logger()

static log4cplus::Logger& Sandesh::logger ( )
inlinestatic

Definition at line 323 of file cpp/sandesh.h.

◆ LoggingCategory()

static std::string Sandesh::LoggingCategory ( )
inlinestatic

Definition at line 232 of file cpp/sandesh.h.

◆ LoggingLevel()

static SandeshLevel::type Sandesh::LoggingLevel ( )
inlinestatic

Definition at line 221 of file cpp/sandesh.h.

◆ LoggingUtLevel()

static SandeshLevel::type Sandesh::LoggingUtLevel ( )
inlinestatic

Definition at line 222 of file cpp/sandesh.h.

◆ module()

static std::string Sandesh::module ( )
inlinestatic

Definition at line 291 of file cpp/sandesh.h.

◆ module_context()

SandeshContext * Sandesh::module_context ( const std::string &  module_name)
static

Definition at line 949 of file sandesh.cc.

◆ ModuleName()

virtual std::string Sandesh::ModuleName ( ) const
pure virtual

◆ Name()

virtual const char* Sandesh::Name ( ) const
inlinevirtual

Definition at line 277 of file cpp/sandesh.h.

◆ node_type()

static std::string Sandesh::node_type ( )
inlinestatic

Definition at line 295 of file cpp/sandesh.h.

◆ ProcessRecv()

bool Sandesh::ProcessRecv ( SandeshRequest rsnh)
staticprivate

Definition at line 563 of file sandesh.cc.

Here is the call graph for this function:

◆ Read()

virtual int32_t Sandesh::Read ( boost::shared_ptr< contrail::sandesh::protocol::TProtocol iprot)
pure virtual

◆ ReadBinary()

int32_t Sandesh::ReadBinary ( u_int8_t *  buf,
u_int32_t  buf_len,
int *  error 
)
virtual

Definition at line 590 of file sandesh.cc.

◆ ReadBinaryFromFile()

int32_t Sandesh::ReadBinaryFromFile ( const std::string &  path,
int *  error 
)
virtual

Definition at line 625 of file sandesh.cc.

◆ ReceiveBinaryMsg()

int32_t Sandesh::ReceiveBinaryMsg ( u_int8_t *  buf,
u_int32_t  buf_len,
int *  error,
SandeshContext client_context 
)
static

Definition at line 684 of file sandesh.cc.

◆ ReceiveBinaryMsgOne()

int32_t Sandesh::ReceiveBinaryMsgOne ( u_int8_t *  buf,
u_int32_t  buf_len,
int *  error,
SandeshContext client_context 
)
static

Definition at line 642 of file sandesh.cc.

Here is the call graph for this function:

◆ ReConfigCollectors()

void Sandesh::ReConfigCollectors ( const std::vector< std::string > &  collector_list)
static

Definition at line 230 of file sandesh.cc.

◆ RecordPort()

void Sandesh::RecordPort ( const std::string &  name,
const std::string &  module,
unsigned short  port 
)
static

Definition at line 191 of file sandesh.cc.

◆ recv_queue()

static SandeshRxQueue* Sandesh::recv_queue ( )
inlinestatic

Definition at line 298 of file cpp/sandesh.h.

◆ Release()

virtual void Sandesh::Release ( )
inlinevirtual

Reimplemented in SandeshRequest.

Definition at line 266 of file cpp/sandesh.h.

◆ response_callback()

static SandeshCallback Sandesh::response_callback ( )
inlinestatic

Definition at line 305 of file cpp/sandesh.h.

◆ role()

static SandeshRole::type Sandesh::role ( )
inlinestatic

Definition at line 296 of file cpp/sandesh.h.

◆ sampled_logger()

static log4cplus::Logger& Sandesh::sampled_logger ( )
inlinestatic

Definition at line 325 of file cpp/sandesh.h.

◆ SandeshRoleToString()

const char * Sandesh::SandeshRoleToString ( SandeshRole::type  role)
static

Definition at line 100 of file sandesh.cc.

◆ scope()

std::string Sandesh::scope ( ) const
inline

Definition at line 313 of file cpp/sandesh.h.

◆ SendEnqueue()

bool Sandesh::SendEnqueue ( )
protectedvirtual

Definition at line 702 of file sandesh.cc.

Here is the call graph for this function:

◆ SendingLevel()

SandeshLevel::type Sandesh::SendingLevel ( )
static

Definition at line 975 of file sandesh.cc.

Here is the call graph for this function:

◆ SendReady()

static bool Sandesh::SendReady ( SandeshConnection sconn = NULL)
static

◆ seqnum()

virtual const uint32_t Sandesh::seqnum ( )
inlinevirtual

Reimplemented in SandeshTrace.

Definition at line 275 of file cpp/sandesh.h.

◆ set_category()

void Sandesh::set_category ( std::string  category)
inline

Definition at line 319 of file cpp/sandesh.h.

Here is the call graph for this function:

◆ set_client_context()

static void Sandesh::set_client_context ( SandeshContext context)
inlinestatic

Definition at line 300 of file cpp/sandesh.h.

Here is the call graph for this function:

◆ set_context()

void Sandesh::set_context ( std::string  context)
inline

Definition at line 310 of file cpp/sandesh.h.

Here is the call graph for this function:

◆ set_hints()

void Sandesh::set_hints ( int32_t  hints)
inline

Definition at line 315 of file cpp/sandesh.h.

Here is the call graph for this function:

◆ set_instance_id()

static void Sandesh::set_instance_id ( std::string &  instance_id)
inlinestatic

Definition at line 292 of file cpp/sandesh.h.

Here is the call graph for this function:

◆ set_level()

void Sandesh::set_level ( SandeshLevel::type  level)
inline

Definition at line 317 of file cpp/sandesh.h.

Here is the call graph for this function:

◆ set_logger_appender()

void Sandesh::set_logger_appender ( const std::string &  file_name,
long  max_file_size,
int  max_backup_index,
const std::string &  syslog_facility,
const std::vector< std::string > &  destn,
const std::string &  ident,
bool  is_sampled_logger 
)
static

Definition at line 1003 of file sandesh.cc.

Here is the call graph for this function:

◆ set_module()

static void Sandesh::set_module ( std::string &  module)
inlinestatic

Definition at line 290 of file cpp/sandesh.h.

Here is the call graph for this function:

◆ set_module_context()

void Sandesh::set_module_context ( const std::string &  module_name,
SandeshContext context 
)
static

Definition at line 957 of file sandesh.cc.

◆ set_name()

void Sandesh::set_name ( const char *  name)
inlineprotected

Definition at line 344 of file cpp/sandesh.h.

◆ set_node_type()

static void Sandesh::set_node_type ( std::string &  node_type)
inlinestatic

Definition at line 294 of file cpp/sandesh.h.

Here is the call graph for this function:

◆ set_response_callback()

static void Sandesh::set_response_callback ( SandeshCallback  response_cb)
inlinestatic

Definition at line 304 of file cpp/sandesh.h.

◆ set_scope()

void Sandesh::set_scope ( std::string  scope)
inline

Definition at line 312 of file cpp/sandesh.h.

Here is the call graph for this function:

◆ set_send_rate_limit()

void Sandesh::set_send_rate_limit ( int  rate_limit)
static

Definition at line 532 of file sandesh.cc.

◆ set_send_to_collector_flags()

void Sandesh::set_send_to_collector_flags ( const std::vector< std::string > &  sampled_destination,
const std::vector< std::string > &  slo_destination 
)
static

Definition at line 1056 of file sandesh.cc.

◆ set_source()

static void Sandesh::set_source ( std::string &  source)
inlinestatic

Definition at line 288 of file cpp/sandesh.h.

Here is the call graph for this function:

◆ set_timestamp()

void Sandesh::set_timestamp ( time_t  timestamp)
inlineprotected

Definition at line 342 of file cpp/sandesh.h.

Here is the call graph for this function:

◆ set_type()

void Sandesh::set_type ( SandeshType::type  type)
inlineprotected

Definition at line 343 of file cpp/sandesh.h.

Here is the call graph for this function:

◆ SetDscpValue()

void Sandesh::SetDscpValue ( uint8_t  value)
static

Definition at line 334 of file sandesh.cc.

Here is the call graph for this function:

◆ SetFlowLogging()

void Sandesh::SetFlowLogging ( bool  enable)
static

Definition at line 465 of file sandesh.cc.

◆ SetLocalLogging()

void Sandesh::SetLocalLogging ( bool  enable)
static

Definition at line 447 of file sandesh.cc.

◆ SetLoggingCategory()

void Sandesh::SetLoggingCategory ( std::string  category)
static

Definition at line 438 of file sandesh.cc.

◆ SetLoggingLevel() [1/2]

void Sandesh::SetLoggingLevel ( SandeshLevel::type  level)
static

Definition at line 417 of file sandesh.cc.

Here is the call graph for this function:

◆ SetLoggingLevel() [2/2]

void Sandesh::SetLoggingLevel ( std::string  level)
static

Definition at line 390 of file sandesh.cc.

Here is the call graph for this function:

◆ SetLoggingParams() [1/2]

void Sandesh::SetLoggingParams ( bool  enable_local_log,
std::string  category,
SandeshLevel::type  level,
bool  enable_trace_print = false,
bool  enable_flow_log = false 
)
static

Definition at line 380 of file sandesh.cc.

Here is the call graph for this function:

◆ SetLoggingParams() [2/2]

void Sandesh::SetLoggingParams ( bool  enable_local_log,
std::string  category,
std::string  level,
bool  enable_trace_print = false,
bool  enable_flow_log = false,
bool  enable_session_syslog = false 
)
static

Definition at line 369 of file sandesh.cc.

Here is the call graph for this function:

◆ SetSendQueue()

void Sandesh::SetSendQueue ( bool  enable)
static

Definition at line 910 of file sandesh.cc.

◆ SetSessionSyslogging()

void Sandesh::SetSessionSyslogging ( bool  enable_session_syslog)
static

Definition at line 474 of file sandesh.cc.

◆ SetTracePrint()

void Sandesh::SetTracePrint ( bool  enable)
static

Definition at line 456 of file sandesh.cc.

◆ slo_logger()

static log4cplus::Logger& Sandesh::slo_logger ( )
inlinestatic

Definition at line 324 of file cpp/sandesh.h.

◆ source()

static std::string Sandesh::source ( )
inlinestatic

Definition at line 289 of file cpp/sandesh.h.

◆ StringToLevel()

SandeshLevel::type Sandesh::StringToLevel ( std::string  level)
static

Definition at line 861 of file sandesh.cc.

◆ timestamp()

time_t Sandesh::timestamp ( ) const
inline

Definition at line 309 of file cpp/sandesh.h.

◆ ToString()

virtual std::string Sandesh::ToString ( ) const
pure virtual

◆ type()

SandeshType::type Sandesh::type ( ) const
inline

Definition at line 314 of file cpp/sandesh.h.

◆ Uninit()

void Sandesh::Uninit ( )
static

Definition at line 341 of file sandesh.cc.

Here is the call graph for this function:

◆ UpdateRxMsgFailStats()

void Sandesh::UpdateRxMsgFailStats ( const std::string &  msg_name,
uint64_t  bytes,
SandeshRxDropReason::type  dreason 
)
static

Definition at line 878 of file sandesh.cc.

◆ UpdateRxMsgStats()

void Sandesh::UpdateRxMsgStats ( const std::string &  msg_name,
uint64_t  bytes 
)
static

Definition at line 872 of file sandesh.cc.

◆ UpdateTxMsgFailStats()

void Sandesh::UpdateTxMsgFailStats ( const std::string &  msg_name,
uint64_t  bytes,
SandeshTxDropReason::type  dreason 
)
static

Definition at line 890 of file sandesh.cc.

◆ UpdateTxMsgStats()

void Sandesh::UpdateTxMsgStats ( const std::string &  msg_name,
uint64_t  bytes 
)
static

Definition at line 884 of file sandesh.cc.

◆ versionsig()

virtual const int32_t Sandesh::versionsig ( ) const
pure virtual

◆ Write()

virtual int32_t Sandesh::Write ( boost::shared_ptr< contrail::sandesh::protocol::TProtocol oprot) const
pure virtual

◆ WriteBinary()

int32_t Sandesh::WriteBinary ( u_int8_t *  buf,
u_int32_t  buf_len,
int *  error 
)
virtual

Definition at line 571 of file sandesh.cc.

◆ WriteBinaryToFile()

int32_t Sandesh::WriteBinaryToFile ( const std::string &  path,
int *  error 
)
virtual

Definition at line 608 of file sandesh.cc.

Friends And Related Function Documentation

◆ SandeshTracePerfTest

friend class SandeshTracePerfTest
friend

Definition at line 386 of file cpp/sandesh.h.

Member Data Documentation

◆ category_

std::string Sandesh::category_
private

Definition at line 444 of file cpp/sandesh.h.

◆ client_

SandeshClient * Sandesh::client_ = NULL
staticprotected

Definition at line 379 of file cpp/sandesh.h.

◆ client_context_

SandeshContext * Sandesh::client_context_ = NULL
staticprivate

Definition at line 414 of file cpp/sandesh.h.

◆ config_

SandeshConfig Sandesh::config_
staticprivate

Definition at line 432 of file cpp/sandesh.h.

◆ connect_to_collector_

bool Sandesh::connect_to_collector_ = false
staticprivate

Definition at line 423 of file cpp/sandesh.h.

◆ context_

std::string Sandesh::context_
private

Definition at line 438 of file cpp/sandesh.h.

◆ disable_flow_collection_

bool Sandesh::disable_flow_collection_ = false
staticprivate

Definition at line 431 of file cpp/sandesh.h.

◆ disable_sending_all_

bool Sandesh::disable_sending_all_ = false
staticprivate

Definition at line 433 of file cpp/sandesh.h.

◆ disable_sending_flows_

bool Sandesh::disable_sending_flows_ = false
staticprivate

Definition at line 435 of file cpp/sandesh.h.

◆ disable_sending_object_logs_

bool Sandesh::disable_sending_object_logs_ = false
staticprivate

Definition at line 434 of file cpp/sandesh.h.

◆ enable_flow_log_

bool Sandesh::enable_flow_log_ = false
staticprivate

Definition at line 417 of file cpp/sandesh.h.

◆ enable_local_log_

bool Sandesh::enable_local_log_ = false
staticprivate

Definition at line 416 of file cpp/sandesh.h.

◆ enable_session_syslog_

bool Sandesh::enable_session_syslog_ = false
staticprivate

Definition at line 418 of file cpp/sandesh.h.

◆ enable_trace_print_

bool Sandesh::enable_trace_print_ = false
staticprivate

Definition at line 422 of file cpp/sandesh.h.

◆ event_manager_

EventManager * Sandesh::event_manager_ = NULL
staticprivate

Definition at line 424 of file cpp/sandesh.h.

◆ hints_

int32_t Sandesh::hints_
private

Definition at line 442 of file cpp/sandesh.h.

◆ http_port_

int Sandesh::http_port_ = 0
staticprivate

Definition at line 411 of file cpp/sandesh.h.

◆ instance_id_

std::string Sandesh::instance_id_
staticprivate

Definition at line 410 of file cpp/sandesh.h.

◆ level_

SandeshLevel::type Sandesh::level_
private

Definition at line 443 of file cpp/sandesh.h.

◆ logger_

log4cplus::Logger Sandesh::logger_
staticprivate
Initial value:
=
log4cplus::Logger::getInstance(LOG4CPLUS_TEXT("SANDESH"))

Definition at line 428 of file cpp/sandesh.h.

◆ logging_category_

std::string Sandesh::logging_category_
staticprivate

Definition at line 421 of file cpp/sandesh.h.

◆ logging_level_

SandeshLevel::type Sandesh::logging_level_ = SandeshLevel::INVALID
staticprivate

Definition at line 419 of file cpp/sandesh.h.

◆ logging_ut_level_

SandeshLevel::type Sandesh::logging_ut_level_
staticprivate
Initial value:
=
getenv("SANDSH_UT_DEBUG") ? SandeshLevel::SYS_DEBUG : SandeshLevel::UT_DEBUG

Definition at line 420 of file cpp/sandesh.h.

◆ module_

std::string Sandesh::module_
staticprivate

Definition at line 407 of file cpp/sandesh.h.

◆ module_context_

Sandesh::ModuleContextMap Sandesh::module_context_
staticprivate

Definition at line 415 of file cpp/sandesh.h.

◆ msg_stats_

SandeshMessageStatistics Sandesh::msg_stats_
staticprivate

Definition at line 426 of file cpp/sandesh.h.

◆ name_

std::string Sandesh::name_
private

Definition at line 445 of file cpp/sandesh.h.

◆ node_type_

std::string Sandesh::node_type_
staticprivate

Definition at line 409 of file cpp/sandesh.h.

◆ recv_queue_

std::unique_ptr< Sandesh::SandeshRxQueue > Sandesh::recv_queue_
staticprivate

Definition at line 412 of file cpp/sandesh.h.

◆ recv_task_id_

int Sandesh::recv_task_id_ = -1
staticprivate

Definition at line 413 of file cpp/sandesh.h.

◆ response_callback_

Sandesh::SandeshCallback Sandesh::response_callback_ = 0
staticprotected

Definition at line 378 of file cpp/sandesh.h.

◆ role_

Sandesh::SandeshRole::type Sandesh::role_ = SandeshRole::Invalid
staticprivate

Definition at line 406 of file cpp/sandesh.h.

◆ sampled_logger_

log4cplus::Logger Sandesh::sampled_logger_
staticprivate
Initial value:
=
log4cplus::Logger::getInstance(LOG4CPLUS_TEXT("SAMPLED_SESSION"))

Definition at line 430 of file cpp/sandesh.h.

◆ sampled_to_collector_

bool Sandesh::sampled_to_collector_ = false
staticprivate

Definition at line 448 of file cpp/sandesh.h.

◆ sampled_to_logger_

bool Sandesh::sampled_to_logger_ = false
staticprivate

Definition at line 450 of file cpp/sandesh.h.

◆ sandesh_send_ratelimit_

tbb::atomic< uint32_t > Sandesh::sandesh_send_ratelimit_
staticprivate

Definition at line 446 of file cpp/sandesh.h.

◆ scope_

std::string Sandesh::scope_
private

Definition at line 440 of file cpp/sandesh.h.

◆ send_queue_enabled_

bool Sandesh::send_queue_enabled_ = true
staticprivate

Definition at line 425 of file cpp/sandesh.h.

◆ seqnum_

const uint32_t Sandesh::seqnum_
private

Definition at line 437 of file cpp/sandesh.h.

◆ slo_logger_

log4cplus::Logger Sandesh::slo_logger_
staticprivate
Initial value:
=
log4cplus::Logger::getInstance(LOG4CPLUS_TEXT("SLO_SESSION"))

Definition at line 429 of file cpp/sandesh.h.

◆ slo_to_collector_

bool Sandesh::slo_to_collector_ = false
staticprivate

Definition at line 447 of file cpp/sandesh.h.

◆ slo_to_logger_

bool Sandesh::slo_to_logger_ = false
staticprivate

Definition at line 449 of file cpp/sandesh.h.

◆ source_

std::string Sandesh::source_
staticprivate

Definition at line 408 of file cpp/sandesh.h.

◆ stats_mutex_

tbb::mutex Sandesh::stats_mutex_
staticprivate

Definition at line 427 of file cpp/sandesh.h.

◆ timestamp_

time_t Sandesh::timestamp_
private

Definition at line 439 of file cpp/sandesh.h.

◆ type_

SandeshType::type Sandesh::type_
private

Definition at line 441 of file cpp/sandesh.h.


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