llmx-rtaco 0.0.1
RTNL-only netlink control-plane library for Linux (C++23).
Loading...
Searching...
No Matches
nl_neighbor_dump_task.hxx
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <expected>
5#include <memory_resource>
6#include <optional>
7#include <system_error>
8
11
12struct nlmsghdr;
13
14namespace llmx {
15namespace rtaco {
16
17class SocketGuard;
18
24class NeighborDumpTask : public NeighborTask<NeighborDumpTask, NeighborEventList> {
26
27public:
35 NeighborDumpTask(SocketGuard& socket_guard, std::pmr::memory_resource* pmr,
36 uint16_t ifindex, uint32_t sequence) noexcept;
37
39 void prepare_request();
40
46 auto process_message(const nlmsghdr& header)
47 -> std::optional<std::expected<NeighborEventList, std::error_code>>;
48
49private:
50 auto handle_done() -> std::expected<NeighborEventList, std::error_code>;
51
52 auto handle_error(const nlmsghdr& header)
53 -> std::expected<NeighborEventList, std::error_code>;
54
55 auto dispatch_neighbor(const nlmsghdr& header)
56 -> std::optional<std::expected<NeighborEventList, std::error_code>>;
57};
58
59} // namespace rtaco
60} // namespace llmx
auto handle_error(const nlmsghdr &header) -> std::expected< NeighborEventList, std::error_code >
Definition nl_neighbor_dump_task.cxx:54
NeighborDumpTask(SocketGuard &socket_guard, std::pmr::memory_resource *pmr, uint16_t ifindex, uint32_t sequence) noexcept
Construct a NeighborDumpTask.
Definition nl_neighbor_dump_task.cxx:23
auto process_message(const nlmsghdr &header) -> std::optional< std::expected< NeighborEventList, std::error_code > >
Process a received neighbor-related netlink message.
Definition nl_neighbor_dump_task.cxx:35
auto dispatch_neighbor(const nlmsghdr &header) -> std::optional< std::expected< NeighborEventList, std::error_code > >
Definition nl_neighbor_dump_task.cxx:67
NeighborEventList learned_
Definition nl_neighbor_dump_task.hxx:25
auto handle_done() -> std::expected< NeighborEventList, std::error_code >
Definition nl_neighbor_dump_task.cxx:49
void prepare_request()
Prepare the netlink request to dump neighbor entries.
Definition nl_neighbor_dump_task.cxx:28
Base task type for neighbor-related netlink operations.
Definition nl_neighbor_task.hxx:29
auto ifindex() const noexcept -> uint16_t
Definition nl_request_task.hxx:93
auto sequence() const noexcept -> uint32_t
Definition nl_request_task.hxx:89
Thread-safe guard owning a labeled Socket.
Definition nl_socket_guard.hxx:25
Definition nl_common.hxx:21
std::pmr::vector< NeighborEvent > NeighborEventList
Definition nl_neighbor_event.hxx:88
Definition nl_common.hxx:20