NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::net::NetlinkSocket Class Reference

#include <netlink-socket.hpp>

Inheritance diagram for ndn::net::NetlinkSocket:
Collaboration diagram for ndn::net::NetlinkSocket:

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...
 

Detailed Description

Definition at line 43 of file netlink-socket.hpp.

Member Typedef Documentation

◆ Error

◆ MessageCallback

using ndn::net::NetlinkSocket::MessageCallback = std::function<void(const NetlinkMessage&)>

Definition at line 47 of file netlink-socket.hpp.

Constructor & Destructor Documentation

◆ NetlinkSocket()

ndn::net::NetlinkSocket::NetlinkSocket ( boost::asio::io_service &  io)
explicitprotected

Definition at line 47 of file netlink-socket.cpp.

◆ ~NetlinkSocket()

ndn::net::NetlinkSocket::~NetlinkSocket ( )
protected

Definition at line 55 of file netlink-socket.cpp.

References m_sock.

Member Function Documentation

◆ joinGroup()

void ndn::net::NetlinkSocket::joinGroup ( int  group)

◆ registerNotificationCallback()

void ndn::net::NetlinkSocket::registerNotificationCallback ( MessageCallback  cb)

◆ open()

void ndn::net::NetlinkSocket::open ( int  protocol)
protected

◆ registerRequestCallback()

void ndn::net::NetlinkSocket::registerRequestCallback ( uint32_t  seq,
MessageCallback  cb 
)
protected

◆ nlmsgTypeToString()

std::string ndn::net::NetlinkSocket::nlmsgTypeToString ( uint16_t  type) const
protectedvirtual

Member Data Documentation

◆ m_sock

shared_ptr<boost::asio::posix::stream_descriptor> ndn::net::NetlinkSocket::m_sock
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().

◆ m_pid

uint32_t ndn::net::NetlinkSocket::m_pid
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().

◆ m_seqNum

uint32_t ndn::net::NetlinkSocket::m_seqNum
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().


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