OpenSDN source code
|
#include <ksync_sock.h>
Public Member Functions | |
KSyncSockTcp (EventManager *evm, boost::asio::ip::address ip_addr, int port) | |
virtual | ~KSyncSockTcp () |
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) |
virtual TcpSession * | AllocSession (Socket *socket) |
virtual bool | Run (void) |
bool | ReceiveMsg (const u_int8_t *msg, size_t size) |
void | OnSessionEvent (TcpSession *session, TcpSession::Event event) |
bool | connect_complete () const |
void | AsyncReadStart () |
![]() | |
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) |
KSyncReceiveQueue * | GetReceiveQueue (IoContext::Type type, uint32_t instance) |
KSyncReceiveQueue * | GetReceiveQueue (uint32_t seqno) |
KSyncBulkMsgContext * | LocateBulkContext (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 KSyncTxQueue * | send_queue () const |
const KSyncReceiveQueue * | get_receive_work_queue (uint16_t index) const |
KSyncReceiveQueue * | AllocQueue (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) |
![]() | |
TcpServer (EventManager *evm) | |
virtual | ~TcpServer () |
virtual bool | Initialize (unsigned short port) |
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 TcpSession * | CreateSession () |
virtual void | DeleteSession (TcpSession *session) |
virtual void | Connect (TcpSession *session, Endpoint remote) |
virtual bool | DisableSandeshLogMessages () const |
int | GetPort () const |
const io::SocketStats & | GetSocketStats () const |
size_t | GetSessionCount () const |
EventManager * | event_manager () |
bool | HasSessionReadAvailable () const |
bool | HasSessions () const |
TcpSession * | GetSession (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) |
Static Public Member Functions | |
static void | Init (EventManager *evm, boost::asio::ip::address ip_addr, int port, const std::string &cpu_pin_policy) |
![]() | |
static void | Start (bool read_inline) |
static void | Shutdown () |
static KSyncSock * | Get (DBTablePartBase *partition) |
static KSyncSock * | Get (int partition_id) |
static uint32_t | GetPid () |
static int | GetNetlinkFamilyId () |
static void | SetNetlinkFamilyId (int id) |
static AgentSandeshContext * | GetAgentSandeshContext (uint32_t type) |
static void | SetAgentSandeshContext (AgentSandeshContext *ctx, uint32_t idx) |
Private Attributes | |
EventManager * | evm_ |
TcpSession * | session_ |
boost::asio::ip::tcp::endpoint | server_ep_ |
boost::asio::ip::tcp::socket * | tcp_socket_ |
bool | connect_complete_ |
char * | rx_buff_ |
char * | rx_buff_rem_ |
size_t | remain_ |
Additional Inherited Members | |
![]() | |
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< KSyncRxData > | KSyncReceiveQueue |
typedef WorkQueue < KSyncRxQueueData > | KSyncRxWorkQueue |
![]() | |
typedef boost::asio::ip::tcp::endpoint | Endpoint |
typedef boost::asio::ip::tcp::socket | Socket |
typedef boost::asio::ip::tcp::socket::native_handle_type | NativeSocketType |
![]() | |
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 |
![]() | |
typedef boost::intrusive_ptr < TcpServer > | TcpServerPtr |
typedef boost::intrusive_ptr < TcpSession > | TcpSessionPtr |
![]() | |
bool | ValidateAndEnqueue (char *data, KSyncBulkMsgContext *context) |
KSyncBulkSandeshContext * | GetBulkSandeshContext (uint32_t seqno) |
void | ProcessDataInline (char *data) |
![]() | |
virtual TcpSession * | AllocSession (bool server_session) |
virtual Socket * | accept_socket () const |
virtual void | set_accept_socket () |
virtual bool | AcceptSession (TcpSession *session) |
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) |
![]() | |
static void | Init (bool use_work_queue, const std::string &cpu_pin_policy) |
static void | SetSockTableEntry (KSyncSock *sock) |
![]() | |
tbb::mutex | mutex_ |
nl_client * | nl_client_ |
WaitTree | wait_tree_ |
KSyncTxQueue | send_queue_ |
KSyncReceiveQueue * | uve_rx_queue [kRxWorkQueueCount] |
KSyncReceiveQueue * | ksync_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_ |
KSyncBulkMsgContext * | bulk_mctx_arr_ [KSYNC_BMC_ARR_SIZE] |
Definition at line 633 of file ksync_sock.h.
KSyncSockTcp::KSyncSockTcp | ( | EventManager * | evm, |
boost::asio::ip::address | ip_addr, | ||
int | port | ||
) |
|
inlinevirtual |
Definition at line 637 of file ksync_sock.h.
|
virtual |
Implements TcpServer.
Definition at line 39 of file ksync_sock_tcp.cc.
void KSyncSockTcp::AsyncReadStart | ( | ) |
|
virtual |
Implements KSyncSock.
Definition at line 113 of file ksync_sock_tcp.cc.
|
virtual |
Implements KSyncSock.
Definition at line 89 of file ksync_sock_tcp.cc.
|
virtual |
Implements KSyncSock.
Definition at line 104 of file ksync_sock_tcp.cc.
|
inline |
Definition at line 654 of file ksync_sock.h.
|
virtual |
Implements KSyncSock.
Definition at line 99 of file ksync_sock_tcp.cc.
|
virtual |
Implements KSyncSock.
Definition at line 46 of file ksync_sock_tcp.cc.
|
static |
|
virtual |
Implements KSyncSock.
Definition at line 50 of file ksync_sock_tcp.cc.
void KSyncSockTcp::OnSessionEvent | ( | TcpSession * | session, |
TcpSession::Event | event | ||
) |
|
virtual |
Implements KSyncSock.
Definition at line 118 of file ksync_sock_tcp.cc.
bool KSyncSockTcp::ReceiveMsg | ( | const u_int8_t * | msg, |
size_t | size | ||
) |
|
virtual |
|
virtual |
Implements KSyncSock.
Definition at line 54 of file ksync_sock_tcp.cc.
|
virtual |
Implements KSyncSock.
Definition at line 95 of file ksync_sock_tcp.cc.
|
private |
Definition at line 667 of file ksync_sock.h.
|
private |
Definition at line 663 of file ksync_sock.h.
|
private |
Definition at line 670 of file ksync_sock.h.
|
private |
Definition at line 668 of file ksync_sock.h.
|
private |
Definition at line 669 of file ksync_sock.h.
|
private |
Definition at line 665 of file ksync_sock.h.
|
private |
Definition at line 664 of file ksync_sock.h.
|
private |
Definition at line 666 of file ksync_sock.h.