::rust::String section;
::rust::String fieldname;
::rust::String type_name;
- pdns::rust::settings::rec::Value rustvalue = {false, 0, 0.0, "", {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}};
+ pdns::rust::settings::rec::Value rustvalue = {false, 0, 0.0, "", {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}};
if (pdns::settings::rec::oldKVToBridgeStruct(var, val, section, fieldname, type_name, rustvalue)) {
auto overriding = !mainFile && !incremental && !simpleRustType(type_name);
auto [existing, inserted] = map.emplace(std::pair{std::pair{section, fieldname}, pdns::rust::settings::rec::OldStyle{section, fieldname, var, std::move(type_name), rustvalue, overriding}});
rustvalue.u64_val = 24;
map.emplace(std::pair{std::pair{section, name}, pdns::rust::settings::rec::OldStyle{section, name, name, type, std::move(rustvalue), false}});
};
- def("dnssec", "trustanchors", "Vec<TrustAnchor>");
def("dnssec", "negative_trustanchors", "Vec<NegativeTrustAnchor>");
def("dnssec", "trustanchorfile", "String");
def("dnssec", "trustanchorfile_interval", "u64");
- def("logging", "protobuf_servers", "Vec<ProtobufServer>");
- def("logging", "outgoing_protobuf_servers", "Vec<ProtobufServer>");
+ def("dnssec", "trustanchors", "Vec<TrustAnchor>");
+ def("incoming", "proxymappings", "Vec<ProxyMapping>");
def("logging", "dnstap_framestream_servers", "Vec<DNSTapFrameStreamServer>");
def("logging", "dnstap_nod_framestream_servers", "Vec<DNSTapNODFrameStreamServer>");
def("logging", "opentelemetry_trace_conditions", "Vec<OpenTelemetryTraceCondition>");
- def("recursor", "rpzs", "Vec<RPZ>");
- def("recursor", "sortlists", "Vec<SortList>");
+ def("logging", "outgoing_protobuf_servers", "Vec<ProtobufServer>");
+ def("logging", "protobuf_servers", "Vec<ProtobufServer>");
+ def("recordcache", "keepwarm", "Vec<QNameAndQType>");
def("recordcache", "zonetocaches", "Vec<ZoneToCache>");
def("recursor", "allowed_additional_qtypes", "Vec<AllowedAdditionalQType>");
- def("incoming", "proxymappings", "Vec<ProxyMapping>");
def("recursor", "forwarding_catalog_zones", "Vec<ForwardingCatalogZone>");
- def("webservice", "listen", "Vec<IncomingWSConfig>");
+ def("recursor", "rpzs", "Vec<RPZ>");
+ def("recursor", "sortlists", "Vec<SortList>");
def("recursor", "tls_configurations", "Vec<OutgoingTLSConfiguration>");
+ def("webservice", "listen", "Vec<IncomingWSConfig>");
// End of should be generated XXX
// Convert the map to a vector, as CXX does not have any dictionary like support.
}
impl OutgoingTLSConfiguration {
-
fn to_yaml_map(&self) -> serde_yaml::Value {
let mut map = serde_yaml::Mapping::new();
inserts(&mut map, "name", &self.name);
}
impl QNameAndQType {
+ fn to_yaml_map(&self) -> serde_yaml::Value {
+ let mut map = serde_yaml::Mapping::new();
+ inserts(&mut map, "qname", &self.qname);
+ inserts(&mut map, "qtype", &self.qtype);
+ serde_yaml::Value::Mapping(map)
+ }
+
pub fn validate(&self, field: &str) -> Result<(), ValidationError> {
if self.qname.is_empty() {
let msg = format!("{}: value may not be empty", field);
}
serde_yaml::Value::Sequence(seq)
}
+ "Vec<QNameAndQType>" => {
+ let mut seq = serde_yaml::Sequence::new();
+ for element in &entry.value.vec_qnameandqtype_val {
+ seq.push(element.to_yaml_map());
+ }
+ serde_yaml::Value::Sequence(seq)
+ }
other => serde_yaml::Value::String(
"map_to_yaml_string: Unknown type: ".to_owned() + other,
),