|
llmx-rtaco 0.0.1
RTNL-only netlink control-plane library for Linux (C++23).
|
Task that performs a complete neighbor table dump. More...
#include <nl_neighbor_dump_task.hxx>
Public Member Functions | |
| NeighborDumpTask (SocketGuard &socket_guard, std::pmr::memory_resource *pmr, uint16_t ifindex, uint32_t sequence) noexcept | |
| Construct a NeighborDumpTask. | |
| void | prepare_request () |
| Prepare the netlink request to dump neighbor entries. | |
| auto | process_message (const nlmsghdr &header) -> std::optional< std::expected< NeighborEventList, std::error_code > > |
| Process a received neighbor-related netlink message. | |
| Public Member Functions inherited from llmx::rtaco::NeighborTask< NeighborDumpTask, NeighborEventList > | |
| auto | request_payload () const -> std::span< const uint8_t > |
| Get the serialized request payload for the neighbor request. | |
| Public Member Functions inherited from llmx::rtaco::RequestTask< NeighborDumpTask, NeighborEventList > | |
| RequestTask (SocketGuard &socket_guard, uint16_t ifindex, uint32_t sequence) noexcept | |
| Construct a RequestTask. | |
| virtual | ~RequestTask ()=default |
| Virtual destructor. | |
| auto | async_run () -> boost::asio::awaitable< std::expected< NeighborEventList, std::error_code > > |
| Run the request asynchronously and return the result. | |
Private Member Functions | |
| auto | handle_done () -> std::expected< NeighborEventList, std::error_code > |
| auto | handle_error (const nlmsghdr &header) -> std::expected< NeighborEventList, std::error_code > |
| auto | dispatch_neighbor (const nlmsghdr &header) -> std::optional< std::expected< NeighborEventList, std::error_code > > |
Private Attributes | |
| NeighborEventList | learned_ |
Additional Inherited Members | |
| Protected Member Functions inherited from llmx::rtaco::NeighborTask< NeighborDumpTask, NeighborEventList > | |
| void | build_request (uint16_t msg_type, uint16_t msg_flags, uint16_t ndm_state, uint8_t ndm_flags, std::span< uint8_t, 16 > address) |
| Protected Member Functions inherited from llmx::rtaco::RequestTask< NeighborDumpTask, NeighborEventList > | |
| auto | socket () noexcept -> Socket & |
| auto | sequence () const noexcept -> uint32_t |
| auto | ifindex () const noexcept -> uint16_t |
| Protected Attributes inherited from llmx::rtaco::NeighborTask< NeighborDumpTask, NeighborEventList > | |
| NeighborRequest | request_ |
Task that performs a complete neighbor table dump.
Sends an RTM_GETNEIGH dump request and gathers NeighborEvent entries until the dump completes, returning the accumulated list or an error.
|
noexcept |
Construct a NeighborDumpTask.
| socket_guard | Reference to the socket guard used for netlink I/O. |
| pmr | Memory resource for event list allocations. |
| ifindex | Target interface index (0 = all). |
| sequence | Netlink message sequence number. |
|
private |
|
private |
|
private |
| void llmx::rtaco::NeighborDumpTask::prepare_request | ( | ) |
Prepare the netlink request to dump neighbor entries.
| auto llmx::rtaco::NeighborDumpTask::process_message | ( | const nlmsghdr & | header | ) | -> std::optional< std::expected< NeighborEventList, std::error_code > > |
Process a received neighbor-related netlink message.
| header | Netlink message header. |
|
private |