9#include <boost/asio/awaitable.hpp>
10#include <boost/asio/io_context.hpp>
11#include <boost/asio/strand.hpp>
12#include <boost/asio/steady_timer.hpp>
44 Control(boost::asio::io_context& io)
noexcept;
90 auto probe_neighbor(uint16_t ifindex, std::span<uint8_t, 16> address)
94 auto flush_neighbor(uint16_t ifindex, std::span<uint8_t, 16> address)
98 auto get_neighbor(uint16_t ifindex, std::span<uint8_t, 16> address)
103 -> boost::asio::awaitable<void_result_t>;
107 -> boost::asio::awaitable<void_result_t>;
111 -> boost::asio::awaitable<neighbor_result_t>;
125 -> boost::asio::awaitable<void_result_t>;
128 -> boost::asio::awaitable<void_result_t>;
131 -> boost::asio::awaitable<neighbor_result_t>;
133 boost::asio::io_context&
io_;
134 boost::asio::strand<boost::asio::io_context::executor_type>
strand_;
auto async_dump_routes_impl() -> boost::asio::awaitable< route_list_result_t >
Definition nl_control.cxx:144
std::expected< RouteEventList, std::error_code > route_list_result_t
Definition nl_control.hxx:32
auto dump_neighbors() -> neighbor_list_result
Synchronously dump neighbor entries from the kernel.
Definition nl_control.cxx:64
auto async_dump_neighbors() -> boost::asio::awaitable< neighbor_list_result >
Asynchronously dump neighbors.
Definition nl_control.cxx:92
std::expected< NeighborEventList, std::error_code > neighbor_list_result
Definition nl_control.hxx:36
Control(Control &&)=delete
auto get_neighbor(uint16_t ifindex, std::span< uint8_t, 16 > address) -> neighbor_result_t
Get a neighbor entry synchronously.
Definition nl_control.cxx:126
boost::asio::io_context & io_
Definition nl_control.hxx:133
boost::asio::steady_timer gate_
Definition nl_control.hxx:135
std::expected< LinkEventList, std::error_code > link_list_result_t
Definition nl_control.hxx:34
auto async_dump_addresses_impl() -> boost::asio::awaitable< address_list_result_t >
Definition nl_control.cxx:161
Control(const Control &)=delete
auto async_flush_neighbor(uint16_t ifindex, std::span< uint8_t, 16 > address) -> boost::asio::awaitable< void_result_t >
Asynchronously flush a neighbor.
Definition nl_control.cxx:106
auto async_probe_neighbor_impl(uint16_t ifindex, std::span< uint8_t, 16 > address) -> boost::asio::awaitable< void_result_t >
Definition nl_control.cxx:212
~Control()
Destroy the Control object and release resources.
auto async_get_neighbor(uint16_t ifindex, std::span< uint8_t, 16 > address) -> boost::asio::awaitable< neighbor_result_t >
Asynchronously get a neighbor.
Definition nl_control.cxx:134
Control & operator=(Control &&)=delete
auto acquire_socket_token() -> boost::asio::awaitable< std::error_code >
Definition nl_control.cxx:260
auto async_dump_routes() -> boost::asio::awaitable< route_list_result_t >
Asynchronously dump routes.
Definition nl_control.cxx:74
std::expected< void, std::error_code > void_result_t
Definition nl_control.hxx:37
auto async_probe_neighbor(uint16_t ifindex, std::span< uint8_t, 16 > address) -> boost::asio::awaitable< void_result_t >
Asynchronously probe a neighbor.
Definition nl_control.cxx:120
auto async_get_neighbor_impl(uint16_t ifindex, std::span< uint8_t, 16 > address) -> boost::asio::awaitable< neighbor_result_t >
Definition nl_control.cxx:244
void stop()
Stop ongoing operations and release control resources.
Definition nl_control.cxx:140
Control & operator=(const Control &)=delete
auto dump_routes() -> route_list_result_t
Synchronously dump routes from the kernel.
Definition nl_control.cxx:54
auto dump_addresses() -> address_list_result_t
Synchronously dump addresses from the kernel.
Definition nl_control.cxx:59
boost::asio::strand< boost::asio::io_context::executor_type > strand_
Definition nl_control.hxx:134
auto flush_neighbor(uint16_t ifindex, std::span< uint8_t, 16 > address) -> void_result_t
Flush a neighbour entry (synchronous).
Definition nl_control.cxx:98
auto async_dump_links_impl() -> boost::asio::awaitable< link_list_result_t >
Definition nl_control.cxx:195
std::expected< AddressEventList, std::error_code > address_list_result_t
Definition nl_control.hxx:33
auto probe_neighbor(uint16_t ifindex, std::span< uint8_t, 16 > address) -> void_result_t
Probe a neighbor entry (synchronous).
Definition nl_control.cxx:112
std::expected< NeighborEvent, std::error_code > neighbor_result_t
Definition nl_control.hxx:35
std::atomic_uint32_t sequence_
Definition nl_control.hxx:137
Control(boost::asio::io_context &io) noexcept
Construct a Control instance attached to an io_context.
auto dump_links() -> link_list_result_t
Synchronously dump links from the kernel.
Definition nl_control.cxx:69
auto async_flush_neighbor_impl(uint16_t ifindex, std::span< uint8_t, 16 > address) -> boost::asio::awaitable< void_result_t >
Definition nl_control.cxx:228
auto async_dump_links() -> boost::asio::awaitable< link_list_result_t >
Asynchronously dump links.
Definition nl_control.cxx:86
auto async_dump_neighbors_impl() -> boost::asio::awaitable< neighbor_list_result >
Definition nl_control.cxx:178
SocketGuard socket_guard_
Definition nl_control.hxx:136
auto async_dump_addresses() -> boost::asio::awaitable< address_list_result_t >
Asynchronously dump addresses.
Definition nl_control.cxx:80
Thread-safe guard owning a labeled Socket.
Definition nl_socket_guard.hxx:25
Definition nl_common.hxx:22
Definition nl_common.hxx:21