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

#include <ksync_sock.h>

Inheritance diagram for KSyncSockNetlink:
Collaboration diagram for KSyncSockNetlink:

Public Member Functions

 KSyncSockNetlink (boost::asio::io_context &ios, int protocol)
 
virtual ~KSyncSockNetlink ()
 
virtual uint32_t GetSeqno (char *data)
 
virtual bool IsMoreData (char *data)
 
virtual bool BulkDecoder (char *data, KSyncBulkSandeshContext *ctxt)
 
virtual bool Decoder (char *data, AgentSandeshContext *ctxt)
 
virtual bool Validate (char *data)
 
virtual void AsyncReceive (boost::asio::mutable_buffers_1, HandlerCb)
 
virtual void AsyncSendTo (KSyncBufferList *iovec, uint32_t seq_no, HandlerCb cb)
 
virtual std::size_t SendTo (KSyncBufferList *iovec, uint32_t seq_no)
 
virtual void Receive (boost::asio::mutable_buffers_1)
 
- Public Member Functions inherited from KSyncSock
 KSyncSock ()
 
virtual ~KSyncSock ()
 
void SendAsync (KSyncEntry *entry, int msg_len, char *msg, KSyncEntry::KSyncEvent event)
 
std::size_t BlockingSend (char *msg, int msg_len)
 
bool BlockingRecv ()
 
void GenericSend (IoContext *ctx)
 
uint32_t AllocSeqNo (IoContext::Type type)
 
uint32_t AllocSeqNo (IoContext::Type type, uint32_t instance)
 
KSyncReceiveQueueGetReceiveQueue (IoContext::Type type, uint32_t instance)
 
KSyncReceiveQueueGetReceiveQueue (uint32_t seqno)
 
KSyncBulkMsgContextLocateBulkContext (uint32_t seqno, IoContext::Type io_context_type, uint32_t work_queue_index)
 
int SendBulkMessage (KSyncBulkMsgContext *bulk_context, uint32_t seqno)
 
bool TryAddToBulk (KSyncBulkMsgContext *bulk_context, IoContext *ioc)
 
void OnEmptyQueue (bool done)
 
int tx_count () const
 
const KSyncTxQueuesend_queue () const
 
const KSyncReceiveQueueget_receive_work_queue (uint16_t index) const
 
KSyncReceiveQueueAllocQueue (KSyncBulkSandeshContext ctxt[], uint32_t task_id, uint32_t instance, const char *name)
 
uint32_t WaitTreeSize () const
 
void SetSeqno (uint32_t seq)
 
void SetMeasureQueueDelay (bool val)
 
void reset_use_wait_tree ()
 
void set_process_data_inline ()
 
void EnqueueRxProcessData (KSyncEntry *entry, KSyncEntry::KSyncEvent event)
 

Static Public Member Functions

static void NetlinkDecoder (char *data, SandeshContext *ctxt)
 
static void NetlinkBulkDecoder (char *data, SandeshContext *ctxt, bool more)
 
static void Init (boost::asio::io_context &ios, int protocol, bool use_work_queue, const std::string &cpu_pin_policy)
 
- Static Public Member Functions inherited from KSyncSock
static void Start (bool read_inline)
 
static void Shutdown ()
 
static KSyncSockGet (DBTablePartBase *partition)
 
static KSyncSockGet (int partition_id)
 
static uint32_t GetPid ()
 
static int GetNetlinkFamilyId ()
 
static void SetNetlinkFamilyId (int id)
 
static AgentSandeshContextGetAgentSandeshContext (uint32_t type)
 
static void SetAgentSandeshContext (AgentSandeshContext *ctx, uint32_t idx)
 

Private Attributes

boost::asio::netlink::raw::socket sock_
 

Additional Inherited Members

- Public Types inherited from KSyncSock
typedef std::map< uint32_t,
KSyncBulkMsgContext
WaitTree
 
typedef std::pair< uint32_t,
KSyncBulkMsgContext
WaitTreePair
 
typedef boost::function< void(const
boost::system::error_code
&, size_t)> 
HandlerCb
 
typedef WorkQueue< KSyncRxDataKSyncReceiveQueue
 
typedef WorkQueue
< KSyncRxQueueData
KSyncRxWorkQueue
 
- Static Public Attributes inherited from KSyncSock
static const int kRxWorkQueueCount = 2
 
static const int kMsgGrowSize = 16
 
static const unsigned kBufLen = (4*1024)
 
static const unsigned kMaxBulkMsgCount = 16
 
static const unsigned kMaxBulkMsgSize = (4*1024)
 
static const unsigned kInvalidBulkSeqNo = 0xFFFFFFFF
 
- Protected Member Functions inherited from KSyncSock
bool ValidateAndEnqueue (char *data, KSyncBulkMsgContext *context)
 
KSyncBulkSandeshContextGetBulkSandeshContext (uint32_t seqno)
 
void ProcessDataInline (char *data)
 
- Static Protected Member Functions inherited from KSyncSock
static void Init (bool use_work_queue, const std::string &cpu_pin_policy)
 
static void SetSockTableEntry (KSyncSock *sock)
 
- Protected Attributes inherited from KSyncSock
tbb::mutex mutex_
 
nl_client * nl_client_
 
WaitTree wait_tree_
 
KSyncTxQueue send_queue_
 
KSyncReceiveQueueuve_rx_queue [kRxWorkQueueCount]
 
KSyncReceiveQueueksync_rx_queue [kRxWorkQueueCount]
 
uint32_t max_bulk_msg_count_
 
uint32_t max_bulk_buf_size_
 
uint32_t bulk_seq_no_
 
uint32_t bulk_buf_size_
 
uint32_t bulk_msg_count_
 
uint32_t bmca_prod_
 
uint32_t bmca_cons_
 
KSyncBulkMsgContextbulk_mctx_arr_ [KSYNC_BMC_ARR_SIZE]
 

Detailed Description

Definition at line 518 of file ksync_sock.h.

Constructor & Destructor Documentation

KSyncSockNetlink::KSyncSockNetlink ( boost::asio::io_context &  ios,
int  protocol 
)

Definition at line 648 of file ksync_sock.cc.

KSyncSockNetlink::~KSyncSockNetlink ( )
virtual

Definition at line 665 of file ksync_sock.cc.

Member Function Documentation

void KSyncSockNetlink::AsyncReceive ( boost::asio::mutable_buffers_1  ,
HandlerCb   
)
virtual

Implements KSyncSock.

Definition at line 745 of file ksync_sock.cc.

void KSyncSockNetlink::AsyncSendTo ( KSyncBufferList iovec,
uint32_t  seq_no,
HandlerCb  cb 
)
virtual

Implements KSyncSock.

Definition at line 687 of file ksync_sock.cc.

Here is the call graph for this function:

bool KSyncSockNetlink::BulkDecoder ( char *  data,
KSyncBulkSandeshContext ctxt 
)
virtual

Implements KSyncSock.

Definition at line 736 of file ksync_sock.cc.

Here is the call graph for this function:

bool KSyncSockNetlink::Decoder ( char *  data,
AgentSandeshContext ctxt 
)
virtual

Implements KSyncSock.

Definition at line 719 of file ksync_sock.cc.

Here is the call graph for this function:

uint32_t KSyncSockNetlink::GetSeqno ( char *  data)
virtual

Implements KSyncSock.

Definition at line 674 of file ksync_sock.cc.

Here is the call graph for this function:

void KSyncSockNetlink::Init ( boost::asio::io_context &  ios,
int  protocol,
bool  use_work_queue,
const std::string &  cpu_pin_policy 
)
static

Definition at line 668 of file ksync_sock.cc.

Here is the call graph for this function:

bool KSyncSockNetlink::IsMoreData ( char *  data)
virtual

Implements KSyncSock.

Definition at line 678 of file ksync_sock.cc.

Here is the call graph for this function:

void KSyncSockNetlink::NetlinkBulkDecoder ( char *  data,
SandeshContext ctxt,
bool  more 
)
static

Definition at line 725 of file ksync_sock.cc.

Here is the call graph for this function:

void KSyncSockNetlink::NetlinkDecoder ( char *  data,
SandeshContext ctxt 
)
static

Definition at line 711 of file ksync_sock.cc.

Here is the call graph for this function:

void KSyncSockNetlink::Receive ( boost::asio::mutable_buffers_1  )
virtual

Implements KSyncSock.

Definition at line 749 of file ksync_sock.cc.

size_t KSyncSockNetlink::SendTo ( KSyncBufferList iovec,
uint32_t  seq_no 
)
virtual

Implements KSyncSock.

Definition at line 699 of file ksync_sock.cc.

Here is the call graph for this function:

bool KSyncSockNetlink::Validate ( char *  data)
virtual

Implements KSyncSock.

Definition at line 682 of file ksync_sock.cc.

Here is the call graph for this function:

Member Data Documentation

boost::asio::netlink::raw::socket KSyncSockNetlink::sock_
private

Definition at line 539 of file ksync_sock.h.


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