#include "fstrm_logger.hh"
#include "iputils.hh"
#include "remote_logger.hh"
+#include "remote_logger_pool.hh"
#include "xsk.hh"
#include "rust/cxx.h"
dnsdist::configuration::yaml::registerType<RemoteLoggerInterface>(object, config.name);
return;
}
- auto object = std::shared_ptr<RemoteLoggerInterface>(std::make_shared<RemoteLogger>(ComboAddress(std::string(config.address)), config.timeout, config.max_queued_entries * 100, config.reconnect_wait_time, false));
+ std::shared_ptr<RemoteLoggerInterface> object;
+ if (config.connection_count > 1) {
+ std::vector<std::shared_ptr<RemoteLoggerInterface>> loggers;
+ loggers.reserve(config.connection_count);
+ for (uint64_t i = 0; i < config.connection_count; i++) {
+ loggers.push_back(std::make_shared<RemoteLogger>(ComboAddress(std::string(config.address)), config.timeout, config.max_queued_entries * 100, config.reconnect_wait_time, dnsdist::configuration::yaml::s_inClientMode));
+ }
+ object = std::shared_ptr<RemoteLoggerInterface>(std::make_shared<RemoteLoggerPool>(std::move(loggers)));
+ }
+ else {
+ object = std::shared_ptr<RemoteLoggerInterface>(std::make_shared<RemoteLogger>(ComboAddress(std::string(config.address)), config.timeout, config.max_queued_entries * 100, config.reconnect_wait_time, dnsdist::configuration::yaml::s_inClientMode));
+ }
dnsdist::configuration::yaml::registerType<RemoteLoggerInterface>(object, config.name);
#endif
}
options["queueNotifyThreshold"] = config.queue_notify_threshold;
options["reopenInterval"] = config.reopen_interval;
- auto object = std::shared_ptr<RemoteLoggerInterface>(std::make_shared<FrameStreamLogger>(family, std::string(config.address), false, options));
+ std::shared_ptr<RemoteLoggerInterface> object;
+ if (config.connection_count > 1) {
+ std::vector<std::shared_ptr<RemoteLoggerInterface>> loggers;
+ loggers.reserve(config.connection_count);
+ for (uint64_t i = 0; i < config.connection_count; i++) {
+ loggers.push_back(std::make_shared<FrameStreamLogger>(family, std::string(config.address), !dnsdist::configuration::yaml::s_inClientMode, options));
+ }
+ object = std::shared_ptr<RemoteLoggerInterface>(std::make_shared<RemoteLoggerPool>(std::move(loggers)));
+ }
+ else {
+ object = std::shared_ptr<RemoteLoggerInterface>(std::make_shared<FrameStreamLogger>(family, std::string(config.address), !dnsdist::configuration::yaml::s_inClientMode, options));
+ }
dnsdist::configuration::yaml::registerType<RemoteLoggerInterface>(object, config.name);
#endif
}
max_queued_entries: u64,
#[serde(default = "crate::U8::<1>::value", skip_serializing_if = "crate::U8::<1>::is_equal")]
reconnect_wait_time: u8,
+ #[serde(default = "crate::U64::<1>::value", skip_serializing_if = "crate::U64::<1>::is_equal")]
+ connection_count: u64,
}
#[derive(Deserialize, Serialize, Debug, PartialEq)]
queue_notify_threshold: u64,
#[serde(default, skip_serializing_if = "crate::is_default")]
reopen_interval: u64,
+ #[serde(default = "crate::U64::<1>::value", skip_serializing_if = "crate::U64::<1>::is_equal")]
+ connection_count: u64,
}
#[derive(Deserialize, Serialize, Debug, PartialEq)]
type: "u8"
default: 1
description: "Time in seconds between reconnection attempts"
+ - name: "connection_count"
+ type: "u64"
+ default: 1
+ description: "Number of connections to open to the endpoint"
dnstap_logger:
description: "Endpoint to send queries and/or responses data to, using the dnstap format"
type: "u64"
default: 0
description: "The number of queue entries to allocate for each output queue. According to the libfstrm library, the minimum is 2, the maximum is system-dependent and based on IOV_MAX, and the default is 64"
+ - name: "connection_count"
+ type: "u64"
+ default: 1
+ description: "Number of connections to open to the endpoint"
proto_buf_meta:
description: "Meta-data entry to be added to a Protocol Buffer message"
- **output_queue_size**: Unsigned integer ``(0)`` - The number of queue entries to allocate for each output queue. According to the libfstrm library, the minimum is 2, the maximum is system-dependent and based on ``IOV_MAX``, and the default is 64
- **queue_notify_threshold**: Unsigned integer ``(0)`` - The number of outstanding queue entries to allow on an input queue before waking the I/O thread. According to the libfstrm library, the minimum is 1 and the default is 32
- **reopen_interval**: Unsigned integer ``(0)`` - The number of queue entries to allocate for each output queue. According to the libfstrm library, the minimum is 2, the maximum is system-dependent and based on IOV_MAX, and the default is 64
+- **connection_count**: Unsigned integer ``(1)`` - Number of connections to open to the endpoint
.. _yaml-settings-DohTuningConfiguration:
- **timeout**: Unsigned integer ``(2)`` - TCP connect timeout in seconds
- **max_queued_entries**: Unsigned integer ``(100)`` - Queue this many messages before dropping new ones (e.g. when the remote listener closes the connection)
- **reconnect_wait_time**: Unsigned integer ``(1)`` - Time in seconds between reconnection attempts
+- **connection_count**: Unsigned integer ``(1)`` - Number of connections to open to the endpoint
.. _yaml-settings-ProxyProtocolConfiguration: