summaryrefslogtreecommitdiffstats
path: root/dnsdist-dnsparser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dnsdist-dnsparser.cc')
-rw-r--r--dnsdist-dnsparser.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/dnsdist-dnsparser.cc b/dnsdist-dnsparser.cc
index a15f2d5..bfe0be3 100644
--- a/dnsdist-dnsparser.cc
+++ b/dnsdist-dnsparser.cc
@@ -214,4 +214,23 @@ namespace PacketMangling
return true;
}
}
+
+void setResponseHeadersFromConfig(dnsheader& dnsheader, const ResponseConfig& config)
+{
+ if (config.setAA) {
+ dnsheader.aa = *config.setAA;
+ }
+ if (config.setAD) {
+ dnsheader.ad = *config.setAD;
+ }
+ else {
+ dnsheader.ad = false;
+ }
+ if (config.setRA) {
+ dnsheader.ra = *config.setRA;
+ }
+ else {
+ dnsheader.ra = dnsheader.rd; // for good measure
+ }
+}
}