OpenSDN source code
|
#include <sandesh.h>
Classes | |
struct | SandeshRole |
Public Types | |
typedef WorkQueue < SandeshRequest * > | SandeshRxQueue |
typedef WorkQueue< SandeshElement > | SandeshQueue |
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 SandeshRxQueue * | recv_queue () |
static SandeshContext * | client_context () |
static void | set_client_context (SandeshContext *context) |
static SandeshContext * | module_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 SandeshClient * | client () |
static SandeshConfig & | config () |
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 SandeshClient * | client_ = 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_ |
Friends | |
class | SandeshTracePerfTest |
Definition at line 130 of file p/sandesh.h.
typedef std::map<std::string, std::map<std::string,std::string> > Sandesh::DerivedStats |
Definition at line 148 of file p/sandesh.h.
typedef boost::asio::ip::tcp::endpoint Sandesh::Endpoint |
Definition at line 137 of file p/sandesh.h.
|
private |
Definition at line 388 of file p/sandesh.h.
typedef boost::tuple<size_t, SandeshLevel::type, bool, bool> Sandesh::QueueWaterMarkInfo |
Definition at line 147 of file p/sandesh.h.
typedef WorkQueue< boost::shared_ptr<contrail::sandesh::transport::TMemoryBuffer> > Sandesh::SandeshBufferQueue |
Definition at line 136 of file p/sandesh.h.
typedef boost::function<void (Sandesh *)> Sandesh::SandeshCallback |
Definition at line 138 of file p/sandesh.h.
typedef WorkQueue<SandeshElement> Sandesh::SandeshQueue |
Definition at line 133 of file p/sandesh.h.
typedef WorkQueue<SandeshRequest *> Sandesh::SandeshRxQueue |
Definition at line 132 of file p/sandesh.h.
|
inlineprotected |
Definition at line 346 of file p/sandesh.h.
|
inlineprotected |
|
inlineprotectedvirtual |
Definition at line 368 of file p/sandesh.h.
|
inline |
Definition at line 320 of file p/sandesh.h.
|
inlinestatic |
Definition at line 306 of file p/sandesh.h.
|
inlinestatic |
Definition at line 299 of file p/sandesh.h.
|
inlinestatic |
Definition at line 307 of file p/sandesh.h.
|
static |
|
inline |
Definition at line 311 of file p/sandesh.h.
|
static |
Definition at line 484 of file sandesh.cc.
|
static |
Definition at line 492 of file sandesh.cc.
|
static |
Definition at line 516 of file sandesh.cc.
|
static |
Definition at line 504 of file sandesh.cc.
|
protectedvirtual |
Reimplemented in SandeshUVE, SandeshTrace, and SandeshResponse.
Definition at line 727 of file sandesh.cc.
bool Sandesh::Enqueue | ( | SandeshQueue * | queue | ) |
|
pure virtual |
|
static |
Definition at line 540 of file sandesh.cc.
|
static |
Definition at line 896 of file sandesh.cc.
|
static |
Definition at line 903 of file sandesh.cc.
|
pure virtual |
|
staticprotected |
Definition at line 966 of file sandesh.cc.
|
inline |
Definition at line 316 of file p/sandesh.h.
|
inlinestatic |
Definition at line 297 of file p/sandesh.h.
|
staticprivate |
Definition at line 123 of file sandesh.cc.
|
staticprivate |
|
static |
Definition at line 292 of file sandesh.cc.
|
static |
|
static |
|
static |
Definition at line 310 of file sandesh.cc.
|
staticprivate |
|
staticprivate |
|
inlinestatic |
Definition at line 293 of file p/sandesh.h.
|
inlinestatic |
Definition at line 337 of file p/sandesh.h.
|
inlinestatic |
Definition at line 339 of file p/sandesh.h.
|
inlinestatic |
Definition at line 336 of file p/sandesh.h.
|
inlinestatic |
Definition at line 338 of file p/sandesh.h.
|
inlinestatic |
Definition at line 242 of file p/sandesh.h.
|
inlinestatic |
Definition at line 199 of file p/sandesh.h.
|
inlinestatic |
Definition at line 225 of file p/sandesh.h.
|
staticprotected |
Definition at line 821 of file sandesh.cc.
|
staticprotected |
Definition at line 816 of file sandesh.cc.
|
inlinestatic |
Definition at line 223 of file p/sandesh.h.
bool Sandesh::IsLoggingAllowed | ( | ) | const |
Definition at line 835 of file sandesh.cc.
|
static |
Definition at line 844 of file sandesh.cc.
|
static |
Definition at line 500 of file sandesh.cc.
|
static |
Definition at line 524 of file sandesh.cc.
|
static |
Definition at line 512 of file sandesh.cc.
|
static |
Definition at line 528 of file sandesh.cc.
|
inlinestatic |
Definition at line 239 of file p/sandesh.h.
|
inlinestatic |
Definition at line 226 of file p/sandesh.h.
|
inlinestatic |
Definition at line 229 of file p/sandesh.h.
|
inlinestaticprotected |
Definition at line 375 of file p/sandesh.h.
|
inline |
Definition at line 318 of file p/sandesh.h.
|
static |
Definition at line 852 of file sandesh.cc.
|
pure virtual |
|
inlinestatic |
Definition at line 323 of file p/sandesh.h.
|
inlinestatic |
Definition at line 232 of file p/sandesh.h.
|
inlinestatic |
Definition at line 221 of file p/sandesh.h.
|
inlinestatic |
Definition at line 222 of file p/sandesh.h.
|
inlinestatic |
Definition at line 291 of file p/sandesh.h.
|
static |
Definition at line 949 of file sandesh.cc.
|
pure virtual |
|
inlinevirtual |
Definition at line 277 of file p/sandesh.h.
|
inlinestatic |
Definition at line 295 of file p/sandesh.h.
|
staticprivate |
|
pure virtual |
|
virtual |
Definition at line 590 of file sandesh.cc.
|
virtual |
Definition at line 625 of file sandesh.cc.
|
static |
Definition at line 684 of file sandesh.cc.
|
static |
|
static |
Definition at line 230 of file sandesh.cc.
|
static |
Definition at line 191 of file sandesh.cc.
|
inlinestatic |
Definition at line 298 of file p/sandesh.h.
|
inlinevirtual |
Reimplemented in SandeshRequest.
Definition at line 266 of file p/sandesh.h.
|
inlinestatic |
Definition at line 305 of file p/sandesh.h.
|
inlinestatic |
Definition at line 296 of file p/sandesh.h.
|
inlinestatic |
Definition at line 325 of file p/sandesh.h.
|
static |
Definition at line 100 of file sandesh.cc.
|
inline |
Definition at line 313 of file p/sandesh.h.
|
protectedvirtual |
|
static |
|
static |
|
inlinevirtual |
Reimplemented in SandeshTrace.
Definition at line 275 of file p/sandesh.h.
|
inline |
|
inlinestatic |
|
inline |
|
inline |
|
inlinestatic |
|
inline |
|
static |
|
inlinestatic |
|
static |
Definition at line 957 of file sandesh.cc.
|
inlineprotected |
Definition at line 344 of file p/sandesh.h.
|
inlinestatic |
|
inlinestatic |
Definition at line 304 of file p/sandesh.h.
|
inline |
|
static |
Definition at line 532 of file sandesh.cc.
|
static |
Definition at line 1056 of file sandesh.cc.
|
inlinestatic |
|
inlineprotected |
|
inlineprotected |
|
static |
|
static |
Definition at line 465 of file sandesh.cc.
|
static |
Definition at line 447 of file sandesh.cc.
|
static |
Definition at line 438 of file sandesh.cc.
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 910 of file sandesh.cc.
|
static |
Definition at line 474 of file sandesh.cc.
|
static |
Definition at line 456 of file sandesh.cc.
|
inlinestatic |
Definition at line 324 of file p/sandesh.h.
|
inlinestatic |
Definition at line 289 of file p/sandesh.h.
|
static |
Definition at line 861 of file sandesh.cc.
|
inline |
Definition at line 309 of file p/sandesh.h.
|
pure virtual |
|
inline |
Definition at line 314 of file p/sandesh.h.
|
static |
|
static |
Definition at line 878 of file sandesh.cc.
|
static |
Definition at line 872 of file sandesh.cc.
|
static |
Definition at line 890 of file sandesh.cc.
|
static |
Definition at line 884 of file sandesh.cc.
|
pure virtual |
|
pure virtual |
|
virtual |
Definition at line 571 of file sandesh.cc.
|
virtual |
Definition at line 608 of file sandesh.cc.
|
friend |
Definition at line 386 of file p/sandesh.h.
|
private |
Definition at line 444 of file p/sandesh.h.
|
staticprotected |
Definition at line 379 of file p/sandesh.h.
|
staticprivate |
Definition at line 414 of file p/sandesh.h.
|
staticprivate |
Definition at line 432 of file p/sandesh.h.
|
staticprivate |
Definition at line 423 of file p/sandesh.h.
|
private |
Definition at line 438 of file p/sandesh.h.
|
staticprivate |
Definition at line 431 of file p/sandesh.h.
|
staticprivate |
Definition at line 433 of file p/sandesh.h.
|
staticprivate |
Definition at line 435 of file p/sandesh.h.
|
staticprivate |
Definition at line 434 of file p/sandesh.h.
|
staticprivate |
Definition at line 417 of file p/sandesh.h.
|
staticprivate |
Definition at line 416 of file p/sandesh.h.
|
staticprivate |
Definition at line 418 of file p/sandesh.h.
|
staticprivate |
Definition at line 422 of file p/sandesh.h.
|
staticprivate |
Definition at line 424 of file p/sandesh.h.
|
private |
Definition at line 442 of file p/sandesh.h.
|
staticprivate |
Definition at line 411 of file p/sandesh.h.
|
staticprivate |
Definition at line 410 of file p/sandesh.h.
|
private |
Definition at line 443 of file p/sandesh.h.
|
staticprivate |
Definition at line 428 of file p/sandesh.h.
|
staticprivate |
Definition at line 421 of file p/sandesh.h.
|
staticprivate |
Definition at line 419 of file p/sandesh.h.
|
staticprivate |
Definition at line 420 of file p/sandesh.h.
|
staticprivate |
Definition at line 407 of file p/sandesh.h.
|
staticprivate |
Definition at line 415 of file p/sandesh.h.
|
staticprivate |
Definition at line 426 of file p/sandesh.h.
|
private |
Definition at line 445 of file p/sandesh.h.
|
staticprivate |
Definition at line 409 of file p/sandesh.h.
|
staticprivate |
Definition at line 412 of file p/sandesh.h.
|
staticprivate |
Definition at line 413 of file p/sandesh.h.
|
staticprotected |
Definition at line 378 of file p/sandesh.h.
|
staticprivate |
Definition at line 406 of file p/sandesh.h.
|
staticprivate |
Definition at line 430 of file p/sandesh.h.
|
staticprivate |
Definition at line 448 of file p/sandesh.h.
|
staticprivate |
Definition at line 450 of file p/sandesh.h.
|
staticprivate |
Definition at line 446 of file p/sandesh.h.
|
private |
Definition at line 440 of file p/sandesh.h.
|
staticprivate |
Definition at line 425 of file p/sandesh.h.
|
private |
Definition at line 437 of file p/sandesh.h.
|
staticprivate |
Definition at line 429 of file p/sandesh.h.
|
staticprivate |
Definition at line 447 of file p/sandesh.h.
|
staticprivate |
Definition at line 449 of file p/sandesh.h.
|
staticprivate |
Definition at line 408 of file p/sandesh.h.
|
staticprivate |
Definition at line 427 of file p/sandesh.h.
|
private |
Definition at line 439 of file p/sandesh.h.
|
private |
Definition at line 441 of file p/sandesh.h.