llmx-rtaco 0.0.1
RTNL-only netlink control-plane library for Linux (C++23).
Loading...
Searching...
No Matches
llmx::rtaco::LinkEvent Struct Reference

#include <nl_link_event.hxx>

Public Types

enum class  Type : uint16_t { UNKNOWN = 0 , NEW_LINK = RTM_NEWLINK , DELETE_LINK = RTM_DELLINK }
enum class  Flags : uint32_t {
  UNKNOWN = 0 , UP = (1u << 0) , BROADCAST = (1u << 1) , DEBUG = (1u << 2) ,
  LOOPBACK = (1u << 3) , POINTOPOINT = (1u << 4) , NOTRAILERS = (1u << 5) , RUNNING = (1u << 6) ,
  NOARP = (1u << 7) , PROMISC = (1u << 8) , ALLMULTI = (1u << 9) , MASTER = (1u << 10) ,
  SLAVE = (1u << 11) , MULTICAST = (1u << 12) , PORTSEL = (1u << 13) , AUTOMEDIA = (1u << 14) ,
  DYNAMIC = (1u << 15) , LOWER_UP = (1u << 16) , DORMANT = (1u << 17) , ECHO = (1u << 18)
}

Static Public Member Functions

static auto from_nlmsghdr (const nlmsghdr &header) -> LinkEvent
 Parse a LinkEvent from a netlink message header.

Public Attributes

Type type {Type::UNKNOWN}
int index {0}
Flags flags {Flags::UNKNOWN}
uint32_t change {0}
std::string name {}

Member Enumeration Documentation

◆ Flags

enum class llmx::rtaco::LinkEvent::Flags : uint32_t
strong
Enumerator
UNKNOWN 
UP 
BROADCAST 
DEBUG 
LOOPBACK 
POINTOPOINT 
NOTRAILERS 
RUNNING 
NOARP 
PROMISC 
ALLMULTI 
MASTER 
SLAVE 
MULTICAST 
PORTSEL 
AUTOMEDIA 
DYNAMIC 
LOWER_UP 
DORMANT 
ECHO 

◆ Type

enum class llmx::rtaco::LinkEvent::Type : uint16_t
strong
Enumerator
UNKNOWN 
NEW_LINK 
DELETE_LINK 

Member Function Documentation

◆ from_nlmsghdr()

auto llmx::rtaco::LinkEvent::from_nlmsghdr ( const nlmsghdr & header) -> LinkEvent
static

Parse a LinkEvent from a netlink message header.

Extracts link attributes and fills a LinkEvent structure.

Parameters
headerNetlink message header to parse.
Returns
Parsed LinkEvent object.

Member Data Documentation

◆ change

uint32_t llmx::rtaco::LinkEvent::change {0}

◆ flags

Flags llmx::rtaco::LinkEvent::flags {Flags::UNKNOWN}

◆ index

int llmx::rtaco::LinkEvent::index {0}

◆ name

std::string llmx::rtaco::LinkEvent::name {}

◆ type

Type llmx::rtaco::LinkEvent::type {Type::UNKNOWN}

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