Commit abb9cf1b authored by Pavel Doležal's avatar Pavel Doležal

Merge branch 'develop'

parents 0b452a11 afb41154
......@@ -6,21 +6,19 @@
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
cmake_minimum_required(VERSION 3.9)
project(cdns VERSION 0.2.0 DESCRIPTION "C-DNS format exporter")
cmake_minimum_required(VERSION 3.5)
project(cdns VERSION 0.3.0)
include(GNUInstallDirs)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
find_package(Boost REQUIRED)
find_package(ZLIB REQUIRED)
find_package(LibLZMA REQUIRED)
find_package(CBOR REQUIRED)
find_package(Doxygen)
option(BUILD_TESTS "Set to ON to build tests that use Google Test framework" OFF)
......@@ -32,8 +30,8 @@ add_library(cdns SHARED
${sources}
)
target_link_libraries(cdns CBOR::CBOR ZLIB::ZLIB ${LIBLZMA_LIBRARIES})
target_include_directories(cdns PUBLIC ${LIBLZMA_INCLUDE_DIRS})
target_link_libraries(cdns ${Boost_LIBRARIES} CBOR::CBOR ZLIB::ZLIB ${LIBLZMA_LIBRARIES})
target_include_directories(cdns PUBLIC ${Boost_INCLUDE_DIRS} ${LIBLZMA_INCLUDE_DIRS})
include(CheckCCompilerFlag)
check_c_compiler_flag(-msse4 SSE4_FLAG)
......
......@@ -6,7 +6,8 @@ Library that converts DNS transmission to [C-DNS](https://tools.ietf.org/html/rf
This project has the following dependencies:
* [CMake >= 3.9] (https://cmake.org/)
* [CMake >= 3.5] (https://cmake.org/)
* [Boost] (https://www.boost.org/)
* [libcbor] (https://github.com/PJK/libcbor)
* [zlib] (https://www.zlib.net/)
* [XZ Utils] (https://tukaani.org/xz/)
......
......@@ -760,7 +760,7 @@ CDNS::index_t CDNS::CdnsBlock::add_generic_rrlist(const std::vector<GenericResou
}
bool CDNS::CdnsBlock::add_question_response_record(const GenericQueryResponse& gr,
const std::optional<BlockStatistics>& stats)
const boost::optional<BlockStatistics>& stats)
{
uint32_t qr_hints = m_block_parameters.storage_parameters.storage_hints.query_response_hints;
uint32_t qr_sig_hints = m_block_parameters.storage_parameters.storage_hints.query_response_signature_hints;
......@@ -1051,7 +1051,7 @@ bool CDNS::CdnsBlock::add_question_response_record(const GenericQueryResponse& g
}
bool CDNS::CdnsBlock::add_question_response_record(const QueryResponse& qr,
const std::optional<BlockStatistics>& stats)
const boost::optional<BlockStatistics>& stats)
{
std::size_t fields = !!qr.time_offset + !!qr.client_address_index + !!qr.client_port
+ !!qr.transaction_id + !!qr.qr_signature_index + !!qr.client_hoplimit
......@@ -1075,7 +1075,7 @@ bool CDNS::CdnsBlock::add_question_response_record(const QueryResponse& qr,
}
bool CDNS::CdnsBlock::add_addres_event_count(const GenericAddressEventCount& gaec,
const std::optional<BlockStatistics>& stats)
const boost::optional<BlockStatistics>& stats)
{
// Check if Address Event Counts are buffered in this Block
if (!(m_block_parameters.storage_parameters.storage_hints.other_data_hints & OtherDataHintsMask::address_event_counts))
......@@ -1125,7 +1125,7 @@ bool CDNS::CdnsBlock::add_addres_event_count(const GenericAddressEventCount& gae
}
bool CDNS::CdnsBlock::add_addres_event_count(const AddressEventCount& aec,
const std::optional<BlockStatistics>& stats)
const boost::optional<BlockStatistics>& stats)
{
if (!(m_block_parameters.storage_parameters.storage_hints.other_data_hints & OtherDataHintsMask::address_event_counts))
return false;
......@@ -1143,7 +1143,7 @@ bool CDNS::CdnsBlock::add_addres_event_count(const AddressEventCount& aec,
}
bool CDNS::CdnsBlock::add_malformed_message(const GenericMalformedMessage& gmm,
const std::optional<BlockStatistics>& stats)
const boost::optional<BlockStatistics>& stats)
{
// Check if Malformed messages are buffered in this Block
if (!(m_block_parameters.storage_parameters.storage_hints.other_data_hints & OtherDataHintsMask::malformed_messages))
......@@ -1228,7 +1228,7 @@ bool CDNS::CdnsBlock::add_malformed_message(const GenericMalformedMessage& gmm,
}
bool CDNS::CdnsBlock::add_malformed_message(const MalformedMessage& mm,
const std::optional<BlockStatistics>& stats)
const boost::optional<BlockStatistics>& stats)
{
std::size_t fields = !!mm.time_offset + !!mm.client_address_index + !!mm.client_port
+ !!mm.message_data_index;
......
......@@ -13,7 +13,7 @@
#include <unordered_map>
#include <deque>
#include <vector>
#include <optional>
#include <boost/optional.hpp>
#include "format_specification.h"
#include "block_table.h"
......@@ -164,23 +164,23 @@ namespace CDNS {
*/
std::size_t write(CdnsEncoder& enc);
std::optional<index_t> server_address_index;
std::optional<uint16_t> server_port;
std::optional<QueryResponseTransportFlagsMask> qr_transport_flags;
std::optional<QueryResponseTypeValues> qr_type;
std::optional<QueryResponseFlagsMask> qr_sig_flags;
std::optional<uint8_t> query_opcode;
std::optional<DNSFlagsMask> qr_dns_flags;
std::optional<uint16_t> query_rcode;
std::optional<index_t> query_classtype_index;
std::optional<uint16_t> query_qdcount;
std::optional<uint32_t> query_ancount;
std::optional<uint16_t> query_nscount;
std::optional<uint16_t> query_arcount;
std::optional<uint8_t> query_edns_version;
std::optional<uint16_t> query_udp_size;
std::optional<index_t> query_opt_rdata_index;
std::optional<uint16_t> response_rcode;
boost::optional<index_t> server_address_index;
boost::optional<uint16_t> server_port;
boost::optional<QueryResponseTransportFlagsMask> qr_transport_flags;
boost::optional<QueryResponseTypeValues> qr_type;
boost::optional<QueryResponseFlagsMask> qr_sig_flags;
boost::optional<uint8_t> query_opcode;
boost::optional<DNSFlagsMask> qr_dns_flags;
boost::optional<uint16_t> query_rcode;
boost::optional<index_t> query_classtype_index;
boost::optional<uint16_t> query_qdcount;
boost::optional<uint32_t> query_ancount;
boost::optional<uint16_t> query_nscount;
boost::optional<uint16_t> query_arcount;
boost::optional<uint8_t> query_edns_version;
boost::optional<uint16_t> query_udp_size;
boost::optional<index_t> query_opt_rdata_index;
boost::optional<uint16_t> response_rcode;
};
/**
......@@ -282,8 +282,8 @@ namespace CDNS {
index_t name_index;
index_t classtype_index;
std::optional<uint8_t> ttl;
std::optional<index_t> rdata_index;
boost::optional<uint8_t> ttl;
boost::optional<index_t> rdata_index;
};
/**
......@@ -345,10 +345,10 @@ namespace CDNS {
*/
std::size_t write(CdnsEncoder& enc);
std::optional<index_t> server_address_index;
std::optional<uint16_t> server_port;
std::optional<QueryResponseTransportFlagsMask> mm_transport_flags;
std::optional<std::string> mm_payload;
boost::optional<index_t> server_address_index;
boost::optional<uint16_t> server_port;
boost::optional<QueryResponseTransportFlagsMask> mm_transport_flags;
boost::optional<std::string> mm_payload;
};
/**
......@@ -362,8 +362,8 @@ namespace CDNS {
*/
std::size_t write(CdnsEncoder& enc);
std::optional<index_t> bailiwick_index;
std::optional<ResponseProcessingFlagsMask> processing_flags;
boost::optional<index_t> bailiwick_index;
boost::optional<ResponseProcessingFlagsMask> processing_flags;
};
/**
......@@ -377,10 +377,10 @@ namespace CDNS {
*/
std::size_t write(CdnsEncoder& enc);
std::optional<index_t> question_index;
std::optional<index_t> answer_index;
std::optional<index_t> authority_index;
std::optional<index_t> additional_index;
boost::optional<index_t> question_index;
boost::optional<index_t> answer_index;
boost::optional<index_t> authority_index;
boost::optional<index_t> additional_index;
};
/**
......@@ -396,7 +396,7 @@ namespace CDNS {
std::size_t write(CdnsEncoder& enc);
Timestamp earliest_time;
std::optional<index_t> block_parameters_index;
boost::optional<index_t> block_parameters_index;
};
/**
......@@ -410,12 +410,12 @@ namespace CDNS {
*/
std::size_t write(CdnsEncoder& enc);
std::optional<unsigned> processed_messages;
std::optional<unsigned> qr_data_items;
std::optional<unsigned> unmatched_queries;
std::optional<unsigned> unmatched_responses;
std::optional<unsigned> discarded_opcode;
std::optional<unsigned> malformed_items;
boost::optional<unsigned> processed_messages;
boost::optional<unsigned> qr_data_items;
boost::optional<unsigned> unmatched_queries;
boost::optional<unsigned> unmatched_responses;
boost::optional<unsigned> discarded_opcode;
boost::optional<unsigned> malformed_items;
};
/**
......@@ -431,19 +431,19 @@ namespace CDNS {
*/
std::size_t write(CdnsEncoder& enc, const Timestamp& earliest, const uint64_t& ticks_per_second);
std::optional<Timestamp> time_offset;
std::optional<index_t> client_address_index;
std::optional<uint16_t> client_port;
std::optional<uint16_t> transaction_id;
std::optional<index_t> qr_signature_index;
std::optional<uint8_t> client_hoplimit;
std::optional<int64_t> response_delay;
std::optional<index_t> query_name_index;
std::optional<std::size_t> query_size;
std::optional<std::size_t> response_size;
std::optional<ResponseProcessingData> response_processing_data;
std::optional<QueryResponseExtended> query_extended;
std::optional<QueryResponseExtended> response_extended;
boost::optional<Timestamp> time_offset;
boost::optional<index_t> client_address_index;
boost::optional<uint16_t> client_port;
boost::optional<uint16_t> transaction_id;
boost::optional<index_t> qr_signature_index;
boost::optional<uint8_t> client_hoplimit;
boost::optional<int64_t> response_delay;
boost::optional<index_t> query_name_index;
boost::optional<std::size_t> query_size;
boost::optional<std::size_t> response_size;
boost::optional<ResponseProcessingData> response_processing_data;
boost::optional<QueryResponseExtended> query_extended;
boost::optional<QueryResponseExtended> response_extended;
};
/**
......@@ -504,8 +504,8 @@ namespace CDNS {
std::size_t write(CdnsEncoder& enc);
AddressEventTypeValues ae_type;
std::optional<uint8_t> ae_code;
std::optional<QueryResponseTransportFlagsMask> ae_transport_flags;
boost::optional<uint8_t> ae_code;
boost::optional<QueryResponseTransportFlagsMask> ae_transport_flags;
index_t ae_address_index;
uint64_t ae_count;
};
......@@ -523,10 +523,10 @@ namespace CDNS {
*/
std::size_t write(CdnsEncoder& enc, const Timestamp& earliest, const uint64_t& ticks_per_second);
std::optional<Timestamp> time_offset;
std::optional<index_t> client_address_index;
std::optional<uint16_t> client_port;
std::optional<index_t> message_data_index;
boost::optional<Timestamp> time_offset;
boost::optional<index_t> client_address_index;
boost::optional<uint16_t> client_port;
boost::optional<index_t> message_data_index;
};
/**
......@@ -856,7 +856,7 @@ namespace CDNS {
* @return `true` if the Block is full (DNS record is still inserted), `false` otherwise
*/
bool add_question_response_record(const GenericQueryResponse& qr,
const std::optional<BlockStatistics>& stats = std::nullopt);
const boost::optional<BlockStatistics>& stats = boost::none);
/**
* @brief Add new DNS record to C-DNS block
......@@ -866,7 +866,7 @@ namespace CDNS {
* @return 'true' if the Block is full (DNS record is still inserted), 'false' otherwise
*/
bool add_question_response_record(const QueryResponse& qr,
const std::optional<BlockStatistics>& stats = std::nullopt);
const boost::optional<BlockStatistics>& stats = boost::none);
/**
* @brief Add new Address Event to C-DNS block. Uses generic structure to hold all Address Event's data
......@@ -878,7 +878,7 @@ namespace CDNS {
* @return 'true' if the Block is full (Address Event is still inserted), 'false' otherwise
*/
bool add_addres_event_count(const GenericAddressEventCount& gaec,
const std::optional<BlockStatistics>& stats = std::nullopt);
const boost::optional<BlockStatistics>& stats = boost::none);
/**
* @brief Add new Address Event to C-DNS block
......@@ -888,7 +888,7 @@ namespace CDNS {
* @return 'true' if the Block is full (Address Event is still inserted), 'false' otherwise
*/
bool add_addres_event_count(const AddressEventCount& aec,
const std::optional<BlockStatistics>& stats = std::nullopt);
const boost::optional<BlockStatistics>& stats = boost::none);
/**
* @brief Add new Malformed message to C-DNS block. Uses generic structure to hold all Malformed Message's
......@@ -900,7 +900,7 @@ namespace CDNS {
* @return 'true' if the Block is full (Malformed message is still inserted), 'false' otherwise
*/
bool add_malformed_message(const GenericMalformedMessage& gmm,
const std::optional<BlockStatistics>& stats = std::nullopt);
const boost::optional<BlockStatistics>& stats = boost::none);
/**
* @brief Add new Malformed message to C-DNS block.
......@@ -910,7 +910,7 @@ namespace CDNS {
* @return 'true' if the Block is full (Malformed message is still inserted), 'false' otherwise
*/
bool add_malformed_message(const MalformedMessage& mm,
const std::optional<BlockStatistics>& stats = std::nullopt);
const boost::optional<BlockStatistics>& stats = boost::none);
/**
* @brief Get the overall number of items in Block (QueryResponse + AddressEventCount + MalformedMessage)
......@@ -980,7 +980,7 @@ namespace CDNS {
void clear() {
m_block_preamble.earliest_time = {0, 0};
if (m_block_statistics)
m_block_statistics = std::nullopt;
m_block_statistics = boost::none;
m_ip_address.clear();
m_classtype.clear();
......@@ -1008,7 +1008,7 @@ namespace CDNS {
std::size_t write_blocktables(CdnsEncoder& enc, std::size_t& fields);
BlockPreamble m_block_preamble;
std::optional<BlockStatistics> m_block_statistics;
boost::optional<BlockStatistics> m_block_statistics;
// Block Tables
BlockTable<StringItem> m_ip_address;
......
......@@ -79,7 +79,7 @@ namespace CDNS {
* @throw std::exception if inserting DNS record to the Block fails
* @return Number of uncompressed bytes written if full Block was written to output, 0 otherwise
*/
std::size_t buffer_qr(const GenericQueryResponse& qr, const std::optional<BlockStatistics>& stats = std::nullopt) {
std::size_t buffer_qr(const GenericQueryResponse& qr, const boost::optional<BlockStatistics>& stats = boost::none) {
std::size_t written = 0;
if (m_block.add_question_response_record(qr, stats))
written = write_block();
......@@ -96,7 +96,7 @@ namespace CDNS {
* @throw std::exception if inserting Address Event to the Block fails
* @return Number of uncompressed bytes written if full Block was written to output, 'false' otherwise
*/
std::size_t buffer_aec(const GenericAddressEventCount& aec, const std::optional<BlockStatistics>& stats = std::nullopt) {
std::size_t buffer_aec(const GenericAddressEventCount& aec, const boost::optional<BlockStatistics>& stats = boost::none) {
std::size_t written = 0;
if (m_block.add_addres_event_count(aec, stats))
written = write_block();
......@@ -113,7 +113,7 @@ namespace CDNS {
* @throw std::exception if inserting Malformed message to the Block fails
* @return Number of uncompressed bytes written if full Block was written to output, 0 otherwise
*/
std::size_t buffer_mm(const GenericMalformedMessage& mm, const std::optional<BlockStatistics>& stats = std::nullopt) {
std::size_t buffer_mm(const GenericMalformedMessage& mm, const boost::optional<BlockStatistics>& stats = boost::none) {
std::size_t written = 0;
if (m_block.add_malformed_message(mm, stats))
written = write_block();
......
......@@ -11,7 +11,7 @@
#include <cstdint>
#include <string>
#include <vector>
#include <optional>
#include <boost/optional.hpp>
#include "format_specification.h"
#include "dns.h"
......@@ -109,13 +109,13 @@ namespace CDNS {
StorageHints storage_hints;
std::vector<OpCodes> opcodes;
std::vector<RrTypes> rr_types;
std::optional<StorageFlagsMask> storage_flags;
std::optional<uint8_t> client_address_prefix_ipv4;
std::optional<uint8_t> client_address_prefix_ipv6;
std::optional<uint8_t> server_address_prefix_ipv4;
std::optional<uint8_t> server_address_prefix_ipv6;
std::optional<std::string> sampling_method;
std::optional<std::string> anonymization_method;
boost::optional<StorageFlagsMask> storage_flags;
boost::optional<uint8_t> client_address_prefix_ipv4;
boost::optional<uint8_t> client_address_prefix_ipv6;
boost::optional<uint8_t> server_address_prefix_ipv4;
boost::optional<uint8_t> server_address_prefix_ipv6;
boost::optional<std::string> sampling_method;
boost::optional<std::string> anonymization_method;
};
/**
......@@ -131,16 +131,16 @@ namespace CDNS {
*/
std::size_t write(CdnsEncoder& enc);
std::optional<uint64_t> query_timeout;
std::optional<uint64_t> skew_timeout;
std::optional<uint64_t> snaplen;
std::optional<bool> promisc;
boost::optional<uint64_t> query_timeout;
boost::optional<uint64_t> skew_timeout;
boost::optional<uint64_t> snaplen;
boost::optional<bool> promisc;
std::vector<std::string> interfaces;
std::vector<std::string> server_address;
std::vector<uint16_t> vlan_ids;
std::optional<std::string> filter;
std::optional<std::string> generator_id;
std::optional<std::string> host_id;
boost::optional<std::string> filter;
boost::optional<std::string> generator_id;
boost::optional<std::string> host_id;
};
/**
......@@ -157,7 +157,7 @@ namespace CDNS {
std::size_t write(CdnsEncoder& enc);
StorageParameters storage_parameters;
std::optional<CollectionParameters> collection_parameters;
boost::optional<CollectionParameters> collection_parameters;
};
/**
......@@ -176,7 +176,7 @@ namespace CDNS {
* @param bps Vector of Block parameters to be used in the C-DNS file
* @param private_version Optional private version of C-DNS file standard
*/
FilePreamble(std::vector<BlockParameters>& bps, std::optional<uint8_t> private_version = std::nullopt)
FilePreamble(std::vector<BlockParameters>& bps, boost::optional<uint8_t> private_version = boost::none)
: m_block_parameters(bps) {}
/**
......@@ -219,7 +219,7 @@ namespace CDNS {
uint8_t m_major_format_version = VERSION_MAJOR;
uint8_t m_minor_format_version = VERSION_MINOR;
std::optional<uint8_t> m_private_version;
boost::optional<uint8_t> m_private_version;
std::vector<BlockParameters> m_block_parameters;
};
}
\ No newline at end of file
......@@ -11,7 +11,7 @@
#include <cstdint>
#include <cstddef>
#include <smmintrin.h>
#include <optional>
#include <boost/optional.hpp>
namespace CDNS {
......@@ -72,7 +72,7 @@ namespace CDNS {
* @return Hash value for "data"
*/
template<class T>
std::size_t hash_value(std::optional<T> const& data, uint32_t seed = ~0U) {
std::size_t hash_value(boost::optional<T> const& data, uint32_t seed = ~0U) {
if (data)
return hash_value(&data.value(), sizeof(data.value()), seed);
else
......
......@@ -13,7 +13,7 @@
#include <string>
#include <fstream>
#include <cstdint>
#include <any>
#include <boost/any.hpp>
#include <memory>
#include <type_traits>
#include <sys/types.h>
......@@ -67,7 +67,7 @@ namespace CDNS {
* @brief Rotate the output file (currently opened output is closed)
* @param value Name or other identifier of the new output
*/
virtual void rotate_output(const std::any& value) = 0;
virtual void rotate_output(const boost::any& value) = 0;
protected:
/**
......@@ -90,7 +90,7 @@ namespace CDNS {
template<typename T>
class Writer : public BaseCborOutputWriter {
public:
Writer(const T& value) : BaseCborOutputWriter(), m_value(value) {}
Writer(const T& value, const std::string extension = "") : BaseCborOutputWriter(), m_value(value) {}
Writer(Writer& copy) = delete;
Writer(Writer&& copy) = delete;
......@@ -99,13 +99,13 @@ namespace CDNS {
* @param p Start of the buffer with data
* @param size Size of the data in bytes
*/
void write([[maybe_unused]] const char* p, [[maybe_unused]] std::size_t size) override {}
void write(const char* p, std::size_t size) override {}
/**
* @brief Rotate the output file (currently opened output is closed)
* @param value Name or other identifier of the new output
*/
void rotate_output(const std::any& value) override {}
void rotate_output(const boost::any& value) override {}
protected:
T m_value;
......@@ -151,12 +151,12 @@ namespace CDNS {
* @param value Name of the new output file
* @throw CborOutputException if opening of the output file fails
*/
void rotate_output(const std::any& value) override {
void rotate_output(const boost::any& value) override {
if (value.type() != typeid(std::string))
return;
close();
m_value = std::any_cast<std::string>(value);
m_value = boost::any_cast<std::string>(value);
open();
}
......@@ -198,9 +198,11 @@ namespace CDNS {
/**
* @brief Construct a new Writer<int> object for writing data to output file descriptor
* @param fd File descriptor for the output
* @param extension Extension for the output file's name (NOT USED)
* @throw CborOutputException if the file descriptor isn't valid
*/
Writer(const int& fd) : BaseCborOutputWriter(), m_value(fd) { open(); }
Writer(const int& fd, const std::string extension = "")
: BaseCborOutputWriter(), m_value(fd) { open(); }
/**
* @brief Destroy the Writer object and close the current output file descriptor
......@@ -230,12 +232,12 @@ namespace CDNS {
* @param value File descriptor of the new output
* @throw CborOutputException if checking of the file descriptor fails
*/
void rotate_output(const std::any& value) override {
void rotate_output(const boost::any& value) override {
if (value.type() != typeid(int))
return;
close();
m_value = std::any_cast<int>(value);
m_value = boost::any_cast<int>(value);
open();
}
......@@ -296,7 +298,7 @@ namespace CDNS {
* @param value Name or other identifier of the new output
* @throw CborOutputException if initialization of the new output fails
*/
void rotate_output(const std::any& value) override {
void rotate_output(const boost::any& value) override {
m_writer->rotate_output(value);
}
......@@ -316,11 +318,7 @@ namespace CDNS {
*/
template<typename T>
GzipCborOutputWriter(const T& value) : m_writer(nullptr), m_gzip() {
if constexpr (std::is_same_v<T, std::string>)
m_writer = std::make_unique<Writer<T>>(value, ".gz");
else
m_writer = std::make_unique<Writer<T>>(value);
m_writer = std::make_unique<Writer<T>>(value, ".gz");
open();
}
......@@ -347,7 +345,7 @@ namespace CDNS {
* @param value Name or other identifier of the new output
* @throw CborOutputException if initialization of the new output fails
*/
void rotate_output(const std::any& value) override {
void rotate_output(const boost::any& value) override {
close();
m_writer->rotate_output(value);
open();
......@@ -391,11 +389,7 @@ namespace CDNS {
*/
template<typename T>
XzCborOutputWriter(const T& value) : m_writer(nullptr), m_lzma(LZMA_STREAM_INIT) {
if constexpr (std::is_same_v<T, std::string>)
m_writer = std::make_unique<Writer<T>>(value, ".xz");
else
m_writer = std::make_unique<Writer<T>>(value);
m_writer = std::make_unique<Writer<T>>(value, ".xz");
open();
}
......@@ -422,7 +416,7 @@ namespace CDNS {
* @param value Name or other identifier of the new output
* @throw CborOutputException if initialization of the new output fails
*/
void rotate_output(const std::any& value) override {
void rotate_output(const boost::any& value) override {
close();
m_writer->rotate_output(value);
open();
......
......@@ -22,7 +22,7 @@ namespace CDNS {
EXPECT_FALSE(fp.m_private_version);
ASSERT_EQ(fp.m_block_parameters.size(), 1);
EXPECT_FALSE(fp.m_block_parameters[0].collection_parameters.has_value());
EXPECT_FALSE(fp.m_block_parameters[0].collection_parameters);
// BlockParameters tested in separate test
}
......@@ -43,28 +43,28 @@ namespace CDNS {
// StorageHints tested in separate test
EXPECT_EQ(sp.opcodes, OpCodesDefault);
EXPECT_EQ(sp.rr_types, RrTypesDefault);
EXPECT_FALSE(sp.storage_flags.has_value());
EXPECT_FALSE(sp.client_address_prefix_ipv4.has_value());
EXPECT_FALSE(sp.client_address_prefix_ipv6.has_value());
EXPECT_FALSE(sp.server_address_prefix_ipv4.has_value());
EXPECT_FALSE(sp.server_address_prefix_ipv6.has_value());
EXPECT_FALSE(sp.sampling_method.has_value());
EXPECT_FALSE(sp.anonymization_method.has_value());
EXPECT_FALSE(sp.storage_flags);
EXPECT_FALSE(sp.client_address_prefix_ipv4);
EXPECT_FALSE(sp.client_address_prefix_ipv6);
EXPECT_FALSE(sp.server_address_prefix_ipv4);
EXPECT_FALSE(sp.server_address_prefix_ipv6);
EXPECT_FALSE(sp.sampling_method);
EXPECT_FALSE(sp.anonymization_method);
}