llmx-rtaco 0.0.1
RTNL-only netlink control-plane library for Linux (C++23).
Loading...
Searching...
No Matches
nl_neighbor_flush_task.hxx
Go to the documentation of this file.
1#pragma once
2
3#include <stdint.h>
4#include <array>
5#include <expected>
6#include <optional>
7#include <span>
8#include <system_error>
9
11
12struct nlmsghdr;
13
14namespace llmx {
15namespace rtaco {
16
17class SocketGuard;
18
24class NeighborFlushTask : public NeighborTask<NeighborFlushTask, void> {
25 std::array<uint8_t, 16> address_;
26
27public:
35 NeighborFlushTask(SocketGuard& socket_guard, uint16_t ifindex, uint32_t sequence,
36 std::span<uint8_t, 16> address);
37
39 void prepare_request();
40
46 auto process_message(const nlmsghdr& header)
47 -> std::optional<std::expected<void, std::error_code>>;
48
49private:
50 auto handle_error(const nlmsghdr& header) -> std::expected<void, std::error_code>;
51};
52
53} // namespace rtaco
54} // namespace llmx
auto process_message(const nlmsghdr &header) -> std::optional< std::expected< void, std::error_code > >
Process a response message for the flush operation.
Definition nl_neighbor_flush_task.cxx:30
auto handle_error(const nlmsghdr &header) -> std::expected< void, std::error_code >
Definition nl_neighbor_flush_task.cxx:43
NeighborFlushTask(SocketGuard &socket_guard, uint16_t ifindex, uint32_t sequence, std::span< uint8_t, 16 > address)
Construct a NeighborFlushTask to remove a neighbor entry.
Definition nl_neighbor_flush_task.cxx:18
std::array< uint8_t, 16 > address_
Definition nl_neighbor_flush_task.hxx:25
void prepare_request()
Prepare the netlink request to flush the neighbor entry.
Definition nl_neighbor_flush_task.cxx:26
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
Definition nl_common.hxx:20