#include <netlink-socket.hpp>
Public Types | |
using | Error = NetworkMonitor::Error |
using | MessageCallback = std::function< void(const NetlinkMessage &)> |
Public Member Functions | |
void | joinGroup (int group) |
void | registerNotificationCallback (MessageCallback cb) |
Protected Member Functions | |
NetlinkSocket (boost::asio::io_service &io) | |
~NetlinkSocket () | |
void | open (int protocol) |
void | registerRequestCallback (uint32_t seq, MessageCallback cb) |
virtual std::string | nlmsgTypeToString (uint16_t type) const |
Protected Attributes | |
shared_ptr< boost::asio::posix::stream_descriptor > | m_sock |
netlink socket descriptor More... | |
uint32_t | m_pid |
port ID of this socket More... | |
uint32_t | m_seqNum |
sequence number of the last netlink request sent to the kernel More... | |
Definition at line 43 of file netlink-socket.hpp.
Definition at line 46 of file netlink-socket.hpp.
using ndn::net::NetlinkSocket::MessageCallback = std::function<void(const NetlinkMessage&)> |
Definition at line 47 of file netlink-socket.hpp.
|
explicitprotected |
Definition at line 47 of file netlink-socket.cpp.
|
protected |
Definition at line 55 of file netlink-socket.cpp.
References m_sock.
void ndn::net::NetlinkSocket::joinGroup | ( | int | group | ) |
Definition at line 113 of file netlink-socket.cpp.
References m_sock, SOL_NETLINK, and ndn::to_string().
Referenced by ndn::net::NetworkMonitorImplNetlink::NetworkMonitorImplNetlink().
void ndn::net::NetlinkSocket::registerNotificationCallback | ( | MessageCallback | cb | ) |
Definition at line 123 of file netlink-socket.cpp.
References registerRequestCallback().
Referenced by ndn::net::NetworkMonitorImplNetlink::NetworkMonitorImplNetlink().
|
protected |
Definition at line 62 of file netlink-socket.cpp.
References m_pid, m_sock, NDN_LOG_DEBUG, NDN_LOG_TRACE, SOL_NETLINK, and ndn::to_string().
Referenced by ndn::net::RtnlSocket::open(), and ndn::net::GenlSocket::open().
|
protected |
Definition at line 129 of file netlink-socket.cpp.
Referenced by registerNotificationCallback(), ndn::net::RtnlSocket::sendDumpRequest(), and ndn::net::GenlSocket::sendRequest().
|
protectedvirtual |
Reimplemented in ndn::net::GenlSocket, and ndn::net::RtnlSocket.
Definition at line 143 of file netlink-socket.cpp.
References NLMSG_STRINGIFY, and ndn::to_string().
Referenced by ndn::net::RtnlSocket::nlmsgTypeToString(), and ndn::net::GenlSocket::nlmsgTypeToString().
|
protected |
netlink socket descriptor
Definition at line 78 of file netlink-socket.hpp.
Referenced by joinGroup(), open(), ndn::net::RtnlSocket::sendDumpRequest(), ndn::net::GenlSocket::sendRequest(), and ~NetlinkSocket().
|
protected |
port ID of this socket
Definition at line 79 of file netlink-socket.hpp.
Referenced by open(), ndn::net::RtnlSocket::sendDumpRequest(), and ndn::net::GenlSocket::sendRequest().
|
protected |
sequence number of the last netlink request sent to the kernel
Definition at line 80 of file netlink-socket.hpp.
Referenced by ndn::net::RtnlSocket::sendDumpRequest(), and ndn::net::GenlSocket::sendRequest().