type DNSSelector;
type DNSActionWrapper;
type DNSResponseActionWrapper;
- fn registerProtobufLogger(config: &ProtobufLoggerConfiguration);
- fn registerDnstapLogger(config: &DnstapLoggerConfiguration);
- fn registerOtlpLogger(config: &OtlpLoggerConfiguration);
- fn registerKVSObjects(config: &KeyValueStoresConfiguration);
- fn registerMMDBObjects(config: &Vec<MmdbConfiguration>);
- fn registerNMGObjects(nmgs: &Vec<NetmaskGroupConfiguration>);
- fn registerTimedIPSetObjects(sets: &Vec<TimedIpSetConfiguration>);
+ fn registerProtobufLogger(config: &ProtobufLoggerConfiguration) -> Result<()>;
+ fn registerDnstapLogger(config: &DnstapLoggerConfiguration) -> Result<()>;
+ fn registerOtlpLogger(config: &OtlpLoggerConfiguration) -> Result<()>;
+ fn registerKVSObjects(config: &KeyValueStoresConfiguration) -> Result<()>;
+ fn registerMMDBObjects(config: &Vec<MmdbConfiguration>) -> Result<()>;
+ fn registerNMGObjects(nmgs: &Vec<NetmaskGroupConfiguration>) -> Result<()>;
+ fn registerTimedIPSetObjects(sets: &Vec<TimedIpSetConfiguration>) -> Result<()>;
}
}
fn register_remote_loggers(
config: &dnsdistsettings::RemoteLoggingConfiguration,
-) {
+) -> Result<(), cxx::Exception> {
for logger in &config.protobuf_loggers {
- dnsdistsettings::registerProtobufLogger(logger);
+ dnsdistsettings::registerProtobufLogger(logger)?;
}
for logger in &config.dnstap_loggers {
- dnsdistsettings::registerDnstapLogger(logger);
+ dnsdistsettings::registerDnstapLogger(logger)?;
}
for logger in &config.otlp_loggers {
- dnsdistsettings::registerOtlpLogger(logger);
+ dnsdistsettings::registerOtlpLogger(logger)?;
}
+ Ok(())
}
fn get_global_configuration_from_serde(
..Default::default()
};
// this needs to be done before the rules so that they can refer to the loggers
- register_remote_loggers(&config.remote_logging);
+ register_remote_loggers(&config.remote_logging)?;
// this needs to be done before the KVS so they can refer to the DBs
- dnsdistsettings::registerMMDBObjects(&config.mmdbs);
+ dnsdistsettings::registerMMDBObjects(&config.mmdbs)?;
// this needs to be done before the rules so that they can refer to the KVS objects
- dnsdistsettings::registerKVSObjects(&config.key_value_stores);
+ dnsdistsettings::registerKVSObjects(&config.key_value_stores)?;
// this needs to be done before the rules so that they can refer to the NMG objects
- dnsdistsettings::registerNMGObjects(&config.netmask_groups);
+ dnsdistsettings::registerNMGObjects(&config.netmask_groups)?;
// this needs to be done before the rules so that they can refer to the TimeIPSet objects
- dnsdistsettings::registerTimedIPSetObjects(&config.timed_ip_sets);
+ dnsdistsettings::registerTimedIPSetObjects(&config.timed_ip_sets)?;
// this needs to be done BEFORE the rules so that they can refer to the selectors
// by name
config.selectors = get_selectors_from_serde(&serde.selectors)?;