summaryrefslogtreecommitdiff
path: root/source4/dns_server
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-10-01 01:41:29 +0200
committerKai Blin <kai@samba.org>2010-10-23 10:17:06 +0000
commit32a1b71ec8e51a2e9486c174e4b23e3942e14079 (patch)
treea14c6c1391bb1a9ed461424615715e9b36874f14 /source4/dns_server
parent615857d9899906b3505397b22e769538315a27ef (diff)
downloadsamba-32a1b71ec8e51a2e9486c174e4b23e3942e14079.tar.gz
samba-32a1b71ec8e51a2e9486c174e4b23e3942e14079.tar.bz2
samba-32a1b71ec8e51a2e9486c174e4b23e3942e14079.zip
s4 dns: Parse srv and soa records
Signed-off-by: Kai Blin <kai@samba.org>
Diffstat (limited to 'source4/dns_server')
-rw-r--r--source4/dns_server/dns_server.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/source4/dns_server/dns_server.c b/source4/dns_server/dns_server.c
index c53612c07a..94a2cc995e 100644
--- a/source4/dns_server/dns_server.c
+++ b/source4/dns_server/dns_server.c
@@ -275,6 +275,45 @@ static NTSTATUS handle_question(struct dns_server *dns,
ai++;
}
break;
+ case DNS_QTYPE_SRV:
+ for (ri = 0; ri < el->num_values; ri++) {
+ if (recs[ri].wType != question->question_type) {
+ continue;
+ }
+
+ ZERO_STRUCT(ans[ai]);
+ ans[ai].name = question->name;
+ ans[ai].rr_type = DNS_QTYPE_SRV;
+ ans[ai].rr_class = DNS_QCLASS_IP;
+ ans[ai].ttl = recs[ri].dwTtlSeconds;
+ ans[ai].rdata.srv_record.priority = recs[ri].data.srv.wPriority;
+ ans[ai].rdata.srv_record.weight = recs[ri].data.srv.wWeight;
+ ans[ai].rdata.srv_record.port = recs[ri].data.srv.wPort;
+ ans[ai].rdata.srv_record.target = recs[ri].data.srv.nameTarget;
+ ai++;
+ }
+ break;
+ case DNS_QTYPE_SOA:
+ for (ri = 0; ri < el->num_values; ri++) {
+ if (recs[ri].wType != question->question_type) {
+ continue;
+ }
+
+ ZERO_STRUCT(ans[ai]);
+ ans[ai].name = question->name;
+ ans[ai].rr_type = DNS_QTYPE_SOA;
+ ans[ai].rr_class = DNS_QCLASS_IP;
+ ans[ai].ttl = recs[ri].dwTtlSeconds;
+ ans[ai].rdata.soa_record.mname = recs[ri].data.soa.mname;
+ ans[ai].rdata.soa_record.rname = recs[ri].data.soa.rname;
+ ans[ai].rdata.soa_record.serial = recs[ri].data.soa.serial;
+ ans[ai].rdata.soa_record.refresh= recs[ri].data.soa.refresh;
+ ans[ai].rdata.soa_record.retry = recs[ri].data.soa.retry;
+ ans[ai].rdata.soa_record.expire = recs[ri].data.soa.expire;
+ ans[ai].rdata.soa_record.minimum= recs[ri].data.soa.minimum;
+ ai++;
+ }
+ break;
default:
return NT_STATUS_NOT_IMPLEMENTED;
}