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

#include <nl_neighbor_event.hxx>

Public Types

enum class  Type : uint16_t { UNKNOWN = 0 , NEW_NEIGHBOR = RTM_NEWNEIGH , DELETE_NEIGHBOR = RTM_DELNEIGH }
enum class  State : uint16_t {
  NONE = NUD_NONE , INCOMPLETE = NUD_INCOMPLETE , REACHABLE = NUD_REACHABLE , STALE = NUD_STALE ,
  DELAY = NUD_DELAY , PROBE = NUD_PROBE , FAILED = NUD_FAILED , NOARP = NUD_NOARP ,
  PERMANENT = NUD_PERMANENT
}

Public Member Functions

auto state_to_string () const -> std::string
 Convert the Neighbor state enum to a readable string.

Static Public Member Functions

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

Public Attributes

Type type {Type::UNKNOWN}
int index {0}
uint8_t family {0U}
State state {State::NONE}
uint8_t flags {0U}
uint8_t neighbor_type {0U}
std::string address {}
std::string lladdr {}

Member Enumeration Documentation

◆ State

enum class llmx::rtaco::NeighborEvent::State : uint16_t
strong
Enumerator
NONE 
INCOMPLETE 
REACHABLE 
STALE 
DELAY 
PROBE 
FAILED 
NOARP 
PERMANENT 

◆ Type

enum class llmx::rtaco::NeighborEvent::Type : uint16_t
strong
Enumerator
UNKNOWN 
NEW_NEIGHBOR 
DELETE_NEIGHBOR 

Member Function Documentation

◆ from_nlmsghdr()

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

Parse a NeighborEvent from a netlink message header.

◆ state_to_string()

auto llmx::rtaco::NeighborEvent::state_to_string ( ) const -> std::string
inline

Convert the Neighbor state enum to a readable string.

Returns a '|' separated list of state flags or "NUD_NONE"/"UNKNOWN".

Member Data Documentation

◆ address

std::string llmx::rtaco::NeighborEvent::address {}

◆ family

uint8_t llmx::rtaco::NeighborEvent::family {0U}

◆ flags

uint8_t llmx::rtaco::NeighborEvent::flags {0U}

◆ index

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

◆ lladdr

std::string llmx::rtaco::NeighborEvent::lladdr {}

◆ neighbor_type

uint8_t llmx::rtaco::NeighborEvent::neighbor_type {0U}

◆ state

State llmx::rtaco::NeighborEvent::state {State::NONE}

◆ type

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

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