summaryrefslogtreecommitdiff
path: root/source4/dns_server/dns_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/dns_server/dns_utils.c')
-rw-r--r--source4/dns_server/dns_utils.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source4/dns_server/dns_utils.c b/source4/dns_server/dns_utils.c
index e03a409751..21c7f5a680 100644
--- a/source4/dns_server/dns_utils.c
+++ b/source4/dns_server/dns_utils.c
@@ -378,3 +378,24 @@ WERROR dns_name2dn(struct dns_server *dns,
*_dn = dn;
return WERR_OK;
}
+
+WERROR dns_generate_options(struct dns_server *dns,
+ TALLOC_CTX *mem_ctx,
+ struct dns_res_rec **options)
+{
+ struct dns_res_rec *o;
+
+ o = talloc_zero(mem_ctx, struct dns_res_rec);
+ if (o == NULL) {
+ return WERR_NOMEM;
+ }
+ o->name = '\0';
+ o->rr_type = DNS_QTYPE_OPT;
+ /* This is ugly, but RFC2671 wants the payload size in this field */
+ o->rr_class = (enum dns_qclass) dns->max_payload;
+ o->ttl = 0;
+ o->length = 0;
+
+ *options = o;
+ return WERR_OK;
+}