#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::generic::raw_protocol::socket > | 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 90 of file netlink-socket.cpp.
|
protected |
Definition at line 98 of file netlink-socket.cpp.
References m_sock.
void ndn::net::NetlinkSocket::joinGroup | ( | int | group | ) |
Definition at line 178 of file netlink-socket.cpp.
References m_sock, NDN_THROW, and ndn::to_string().
Referenced by ndn::net::NetworkMonitorImplNetlink::NetworkMonitorImplNetlink().
void ndn::net::NetlinkSocket::registerNotificationCallback | ( | MessageCallback | cb | ) |
Definition at line 188 of file netlink-socket.cpp.
References nonstd::optional_lite::std11::move(), and registerRequestCallback().
Referenced by ndn::net::NetworkMonitorImplNetlink::NetworkMonitorImplNetlink().
|
protected |
Definition at line 105 of file netlink-socket.cpp.
References m_pid, m_sock, NDN_LOG_DEBUG, NDN_LOG_TRACE, NDN_THROW, NDN_THROW_ERRNO, websocketpp::transport::asio::socket::error::socket, and ndn::to_string().
Referenced by ndn::net::RtnlSocket::open(), and ndn::net::GenlSocket::open().
|
protected |
Definition at line 194 of file netlink-socket.cpp.
References nonstd::optional_lite::std11::move().
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 208 of file netlink-socket.cpp.
References ndn::net::NetlinkMessage::getNext(), ndn::net::NetlinkMessage::isValid(), m_pid, m_sock, nonstd::optional_lite::std11::move(), NDN_LOG_DEBUG, NDN_LOG_ERROR, NDN_LOG_TRACE, NDN_THROW, NDN_THROW_ERRNO, NLMSG_STRINGIFY, websocketpp::transport::error::operation_aborted, SOL_NETLINK, 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(), nlmsgTypeToString(), 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 nlmsgTypeToString(), 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().