using ifaddr_message_container = sys::netlink_container< sys::ifaddr_message_header >Netlink container for interface address messages.
using ifinfo_message_container = sys::netlink_container< sys::ifinfo_message_header >enum ifinfo_attribute: u32unspecified = IFLA_UNSPECinterface_name = IFLA_IFNAMElink_info = IFLA_LINKINFOlink_info_kind = IFLA_INFO_KINDlink_info_data = IFLA_INFO_DATAveth_peer_info = VETH_INFO_PEERnetwork_namespace_fd = IFLA_NET_NS_FDenum ifinfo_message_type: u16new_link = RTM_NEWLINKdelete_link = RTM_DELLINKget_link = RTM_GETLINKset_link = RTM_SETLINKInterface address attributes.
unspecified = IFA_UNSPECaddress = IFA_ADDRESSlocal_address = IFA_LOCALinterface_name = IFA_LABELbroadcast_address = IFA_BROADCASTanycast_address = IFA_ANYCASTaddress_info = IFA_CACHEINFOmulticast_address = IFA_MULTICASTflags = IFA_FLAGSInterface address message types.
get_address = RTM_GETADDRnew_address = RTM_NEWADDRdelete_address = RTM_DELADDRNetlink message types.
noop = NLMSG_NOOPerror = NLMSG_ERRORdone = NLMSG_DONEoverrun = NLMSG_OVERRUNNetlink message flags.
request = NLM_F_REQUESTmultipart = NLM_F_MULTIacknowledge = NLM_F_ACKecho = NLM_F_ECHOdump_inconsistent = NLM_F_DUMP_INTRdump_filtered = NLM_F_DUMP_FILTEREDroot = NLM_F_ROOTall_matching = NLM_F_MATCHatomic = NLM_F_ATOMICdump = NLM_F_DUMPreplace = NLM_F_REPLACEexclude = NLM_F_EXCLcreate = NLM_F_CREATEappend = NLM_F_APPENDusing message_type = ifinfo_messageusing attr_type = ifinfo_message::attr_typeskip(u16 n) -> voidend(attr_type * attr) -> voidbegin(ifinfo_attribute type) -> attr_type *add(ifinfo_attribute type, const std::string & value) -> voidadd(ifinfo_attribute type, const void * data, u16 size) -> voidwrite(socket & sock) -> voidmessage() -> ifinfo_message &header() -> ifinfo_message_header &~ifinfo_request()ifinfo_request()public ifinfomsgusing message_type = ifinfo_message_typeusing attr_type = rtattributes< ifinfo_attribute >attributes(int len) -> iterator_pair< netlink_attribute_iterator< attr_type > >Returns all attributes as traversable container.
end() -> netlink_attribute_iterator< attr_type >Returns iterator to the end of attributes.
begin(int len) -> netlink_attribute_iterator< attr_type >Returns iterator to the first attribute.
routing_attributes() const -> const attr_type *Get route attributes.
routing_attributes() -> attr_type *Get route attributes.
change_mask(u32 rhs) -> voidflags(u8 rhs) -> voidindex(int rhs) -> voidtype(message_type rhs) -> voidfamily(socket_address_family rhs) -> voidchange_mask() const -> u32flags() const -> u8index() const -> inttype() const -> message_typefamily() const -> socket_address_family
Netlink route attributes.
A wrapper around
rtattr system type (see rtnetlink(7)).
public rtattrtype(attributes_type rhs) -> voidtype() const -> attributes_typeAttribute type (see rtnetlink(3)).
length(u16 rhs) -> voidlength() const -> u16Attribute length.
data(const void * ptr, u16 n) -> voidtemplate <class T> data() -> T *Returns the pointer to the beginning of attribute data.
next(int len) -> rtattributes *Returns the next attrubute.
ok(int len) const -> boolReturns true, if the attrubute is valid (see rtnetlink(3).
Netlink interaface address message.
A wrapper around ifaddrmsg system type (see rtnetlink(7)).
public ifaddrmsgusing attr_type = rtattributes< ifaddr_attribute >Route attribute type.
attributes(int len) -> iterator_pair< netlink_attribute_iterator< attr_type > >Returns all attributes as traversable container.
end() -> netlink_attribute_iterator< attr_type >Returns iterator to the end of attributes.
begin(int len) -> netlink_attribute_iterator< attr_type >Returns iterator to the first attribute.
routing_attributes() const -> const attr_type *Get route attributes.
routing_attributes() -> attr_type *Get route attributes.
index(int rhs) -> voidSet address index.
index() const -> intGet address index.
scope() const -> unsigned charGet address scope.
flags() const -> unsigned charGet address flags.
prefix() const -> intGet address prefix.
family(socket_address_family rhs) -> voidSet address family.
family() const -> socket_address_familyGet address family.
public sys::netlink_headertype(message_type rhs) -> voidtype() const -> message_typepayload_length() const -> intmessage() const -> const ifinfo_message *Returns pointer to message payload.
message() -> ifinfo_message *Returns pointer to message payload.
Container for netlink messages.
using iterator = netlink_message_iterator< T >Message iterator type.
using size_type = intMessage length type.
using value_type = TMessage header type.
length() const -> intNetlink message length.
end() -> iteratorReturns the pointer to the end of message sequence.
begin() -> iteratorReturns the pointer to the beginning of message sequence.
read(socket & sock) -> void
Read netlink message sequence from socket sock.
header() -> netlink_header &header() const -> const netlink_header &~netlink_container()netlink_container()
Netlink message header.
A wrapper around nlmsghdr system type (see netlink(7)).
public nlmsghdrtemplate <class T> tail() -> T *template <class T> message() const -> const T *template <class T> message() -> T *template <class T> messages(int len) -> iterator_pair< netlink_message_iterator< T > >Returns all messages as traversable container.
template <class T> end() -> netlink_message_iterator< T >Returns iterator to the end of messages.
template <class T> begin(int len) -> netlink_message_iterator< T >Returns iterator to the first message.
payload_length(int len) const -> intReturns message payload length.
next(int len) -> netlink_header *Returns the next header in multipart message.
ok(u32 len) const -> boolReturns true, if the message is valid (see netlink(3)).
overrun() const -> boolReturns true, if message data was lost due to buffer overrun.
error() const -> boolReturns true, if message is an error.
done() const -> boolReturns true, if message is the last part of multipart message.
noop() const -> boolReturns true, if message type is to be ignored.
port() const -> u32Sender port identifier.
increment_sequence() -> u32Message sequence number.
sequence() const -> u32Message sequence number.
flags(netlink_message_flags rhs) -> voidSet additional flags.
flags(u16 rhs) -> voidSet additional flags.
flags() const -> u16Additional flags.
type() const -> netlink_message_typePayload type.
length(u32 rhs) -> voidSet the length of the message with header.
length() const -> u32Length of message with header.
Netlink interface address message header.
A wrapper around nlmsghdr for ifaddrmsg netlink messages (see rtnetlink(7)).
public sys::netlink_headertype() -> netlink_message_typePayload type.
type(ifaddr_message_type rhs) -> voidSet message type.
payload_length() const -> intReturns message payload length.
message() const -> const ifaddr_message *Returns pointer to message payload.
message() -> ifaddr_message *Returns pointer to message payload.
get_address() const -> boolReturns true, if the message contains address.
delete_address() const -> boolReturns true, if the message contains address that was deleted.
new_address() const -> boolReturns true, if the message contains address that was added.
operator<<(std::ostream & out, const ifaddr_attribute & rhs) -> std::ostream &Print attribute name for debugging.
to_string(ifaddr_attribute rhs) -> const char *Returns attribute name.