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"
32 NTSTATUS
dns_server_process_update(struct dns_server
*dns
,
34 struct dns_name_packet
*in
,
35 struct dns_res_rec
**prereqs
, uint16_t *prereq_count
,
36 struct dns_res_rec
**updates
, uint16_t *update_count
,
37 struct dns_res_rec
**additional
, uint16_t *arcount
)
39 struct dns_name_question
*zone
;
41 const struct dns_server_zone
*z
;
42 size_t host_part_len
= 0;
44 if (in
->qdcount
!= 1) {
45 return NT_STATUS_INVALID_PARAMETER
;
50 if (zone
->question_type
!= DNS_QTYPE_SOA
) {
51 return NT_STATUS_INVALID_PARAMETER
;
54 DEBUG(0, ("Got a dns update request.\n"));
56 for (z
= dns
->zones
; z
!= NULL
; z
= z
->next
) {
59 match
= dns_name_match(z
->name
, zone
->name
, &host_part_len
);
66 return NT_STATUS_FOOBAR
;
69 if (host_part_len
!= 0) {
70 return NT_STATUS_NOT_IMPLEMENTED
;
73 return NT_STATUS_NOT_IMPLEMENTED
;