4#include <condition_variable>
10#include <asiolink/io_address.h>
11#include <dhcp/hwaddr.h>
12#include <dhcpsrv/lease.h>
13#include <log/logger.h>
41 using lease4_t = std::tuple<mac_addr_t, ip4_addr_t, subnet_id_t, std::chrono::seconds>;
78 void worker_send_lease_to_redis(
const lease4_t& lease);
79 void worker_send_lease_to_arpwatch(
const lease4_t& lease);
82 std::unique_ptr<std::thread> worker;
83 volatile bool worker_keep_running{
false};
85 std::condition_variable worker_notify_cv;
86 std::mutex lease_queue_mtx;
87 std::queue<lease4_t> lease_queue;
92 isc::log::Logger logger{
"arpwatch-exporter.Exporter"};
An adapter to the RPC interface of ARPwatch.
A wrapper for the hiredis C interface with multi-client support.
Main lease-to-Redis/ARPwatch exporter.
static constexpr double REDIS_EXPIRE_FACT
isc::dhcp::HWAddr mac_addr_t
static constexpr std::chrono::seconds REDIS_RECONNECT_WAIT
std::tuple< mac_addr_t, ip4_addr_t, subnet_id_t, std::chrono::seconds > lease4_t
static constexpr std::chrono::milliseconds LEASE_QUEUE_FLUSH_WAIT
Exporter(Exporter &&)=delete
Exporter & operator=(Exporter &&)=delete
isc::dhcp::SubnetID subnet_id_t
Exporter & operator=(const Exporter &)=delete
static constexpr std::chrono::seconds DEFAULT_VALID_LFT
void push_lease(const mac_addr_t &mac, const ip4_addr_t &ip4, subnet_id_t subnet_id=0, std::chrono::seconds valid_lft=DEFAULT_VALID_LFT)
isc::asiolink::IOAddress ip4_addr_t
Exporter(const Exporter &)=delete
Exporter(HiredisAdapter &redis_adapter, ArpwatchRPC &arpwatch_rpc)
std::unique_ptr< ArpwatchRPC > arpwatch_rpc