2 Unix SMB/CIFS implementation.
4 DNS server handler for update requests
6 Copyright (C) 2010 Kai Blin <kai@samba.org>
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include "libcli/util/ntstatus.h"
24 #include "librpc/ndr/libndr.h"
25 #include "librpc/gen_ndr/ndr_dns.h"
26 #include "librpc/gen_ndr/ndr_dnsp.h"
28 #include "dsdb/samdb/samdb.h"
29 #include "dsdb/common/util.h"
30 #include "dns_server/dns_server.h"
33 WERROR dns_server_process_update(struct dns_server *dns,
35 struct dns_name_packet *in,
36 const struct dns_res_rec *prereqs, uint16_t prereq_count,
37 struct dns_res_rec **updates, uint16_t *update_count,
38 struct dns_res_rec **additional, uint16_t *arcount)
40 struct dns_name_question *zone;
41 const struct dns_server_zone *z;
42 size_t host_part_len = 0;
45 if (in->qdcount != 1) {
46 return DNS_ERR(FORMAT_ERROR);
51 if (zone->question_type != DNS_QTYPE_SOA) {
52 return DNS_ERR(FORMAT_ERROR);
55 DEBUG(0, ("Got a dns update request.\n"));
57 for (z = dns->zones; z != NULL; z = z->next) {
60 match = dns_name_match(z->name, zone->name, &host_part_len);
67 return DNS_ERR(NOTAUTH);
70 if (host_part_len != 0) {
71 return DNS_ERR(NOT_IMPLEMENTED);
74 return DNS_ERR(NOT_IMPLEMENTED);