llmx-rtaco 0.0.1
RTNL-only netlink control-plane library for Linux (C++23).
Loading...
Searching...
No Matches
nl_address_event.hxx
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <string>
5#include <vector>
6
7#include <linux/rtnetlink.h>
8
10
11struct nlmsghdr;
12
13namespace llmx {
14namespace rtaco {
15
17 enum class Type : uint16_t {
19 NEW_ADDRESS = RTM_NEWADDR,
20 DELETE_ADDRESS = RTM_DELADDR,
21 };
22
23 enum class Flags : uint32_t {
24 NONE = 0,
25 SECONDARY = (1u << 0), // 0x001
26 TEMPORARY = SECONDARY, // alias for SECONDARY
27 NODAD = (1u << 1), // 0x002
28 OPTIMISTIC = (1u << 2), // 0x004
29 DADFAILED = (1u << 3), // 0x008
30 HOMEADDRESS = (1u << 4), // 0x010
31 DEPRECATED = (1u << 5), // 0x020
32 TENTATIVE = (1u << 6), // 0x040
33 PERMANENT = (1u << 7), // 0x080
34 MANAGETEMPADDR = (1u << 8), // 0x100
35 NOPREFIXROUTE = (1u << 9), // 0x200
36 MCAUTOJOIN = (1u << 10), // 0x400
37 STABLE_PRIVACY = (1u << 11), // 0x800
38 };
39
41 int index{0};
42 uint8_t prefix_len{0};
43 uint8_t scope{0};
45 uint8_t family{0};
46 std::string address{};
47 std::string label{};
48
57 static auto from_nlmsghdr(const nlmsghdr& header) -> AddressEvent;
58};
59
60using AddressEventList = std::pmr::vector<AddressEvent>;
61
62template<>
63struct enable_bitmask_operators<AddressEvent::Flags> : std::true_type {};
64
65} // namespace rtaco
66} // namespace llmx
Definition nl_common.hxx:21
std::pmr::vector< AddressEvent > AddressEventList
Definition nl_address_event.hxx:60
Definition nl_common.hxx:20
Definition nl_address_event.hxx:16
Type type
Definition nl_address_event.hxx:40
static auto from_nlmsghdr(const nlmsghdr &header) -> AddressEvent
Construct an AddressEvent from a netlink message header.
Definition nl_address_event.cxx:14
Flags
Definition nl_address_event.hxx:23
@ MCAUTOJOIN
Definition nl_address_event.hxx:36
@ NODAD
Definition nl_address_event.hxx:27
@ HOMEADDRESS
Definition nl_address_event.hxx:30
@ SECONDARY
Definition nl_address_event.hxx:25
@ TEMPORARY
Definition nl_address_event.hxx:26
@ PERMANENT
Definition nl_address_event.hxx:33
@ MANAGETEMPADDR
Definition nl_address_event.hxx:34
@ NOPREFIXROUTE
Definition nl_address_event.hxx:35
@ OPTIMISTIC
Definition nl_address_event.hxx:28
@ TENTATIVE
Definition nl_address_event.hxx:32
@ NONE
Definition nl_address_event.hxx:24
@ DADFAILED
Definition nl_address_event.hxx:29
@ STABLE_PRIVACY
Definition nl_address_event.hxx:37
@ DEPRECATED
Definition nl_address_event.hxx:31
Type
Definition nl_address_event.hxx:17
@ NEW_ADDRESS
Definition nl_address_event.hxx:19
@ UNKNOWN
Definition nl_address_event.hxx:18
@ DELETE_ADDRESS
Definition nl_address_event.hxx:20
uint8_t prefix_len
Definition nl_address_event.hxx:42
uint8_t scope
Definition nl_address_event.hxx:43
std::string label
Definition nl_address_event.hxx:47
Flags flags
Definition nl_address_event.hxx:44
uint8_t family
Definition nl_address_event.hxx:45
std::string address
Definition nl_address_event.hxx:46
int index
Definition nl_address_event.hxx:41
Enable bitwise operators for an enum class.
Definition nl_utils.hxx:26