2 Unix SMB/CIFS implementation.
3 async implementation of commands submitted over IRPC
4 Copyright (C) Volker Lendecke 2009
5 Copyright (C) Guenther Deschner 2009
6 Copyright (C) Andrew Bartlett 2014
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/>.
24 #include "librpc/gen_ndr/ndr_winbind_c.h"
25 #include "source4/lib/messaging/irpc.h"
26 #include "librpc/gen_ndr/ndr_winbind.h"
28 struct wb_irpc_DsrUpdateReadOnlyServerDnsRecords_state
{
29 struct irpc_message
*msg
;
30 struct winbind_DsrUpdateReadOnlyServerDnsRecords
*req
;
33 static void wb_irpc_DsrUpdateReadOnlyServerDnsRecords_callback(struct tevent_req
*subreq
);
35 NTSTATUS
wb_irpc_DsrUpdateReadOnlyServerDnsRecords(struct irpc_message
*msg
,
36 struct winbind_DsrUpdateReadOnlyServerDnsRecords
*req
)
38 struct wb_irpc_DsrUpdateReadOnlyServerDnsRecords_state
*s
;
39 struct tevent_req
*subreq
;
40 struct winbindd_domain
*domain
;
42 DEBUG(5, ("wb_irpc_DsrUpdateReadOnlyServerDnsRecords called\n"));
44 s
= talloc(msg
, struct wb_irpc_DsrUpdateReadOnlyServerDnsRecords_state
);
45 NT_STATUS_HAVE_NO_MEMORY(s
);
50 domain
= find_our_domain();
52 return NT_STATUS_NO_SUCH_DOMAIN
;
55 subreq
= dcerpc_winbind_DsrUpdateReadOnlyServerDnsRecords_send(s
, winbind_event_context(),
56 dom_child_handle(domain
),
61 return NT_STATUS_NO_MEMORY
;
64 tevent_req_set_callback(subreq
,
65 wb_irpc_DsrUpdateReadOnlyServerDnsRecords_callback
,
68 msg
->defer_reply
= true;
72 static void wb_irpc_DsrUpdateReadOnlyServerDnsRecords_callback(struct tevent_req
*subreq
)
74 struct wb_irpc_DsrUpdateReadOnlyServerDnsRecords_state
*s
=
75 tevent_req_callback_data(subreq
,
76 struct wb_irpc_DsrUpdateReadOnlyServerDnsRecords_state
);
77 NTSTATUS status
, result
;
79 DEBUG(5, ("wb_irpc_DsrUpdateReadOnlyServerDnsRecords_callback called\n"));
81 status
= dcerpc_winbind_DsrUpdateReadOnlyServerDnsRecords_recv(subreq
, s
, &result
);
82 any_nt_status_not_ok(status
, result
, &status
);
85 irpc_send_reply(s
->msg
, status
);
88 NTSTATUS
wb_irpc_register(void)
91 status
= IRPC_REGISTER(winbind_imessaging_context(), winbind
, WINBIND_DSRUPDATEREADONLYSERVERDNSRECORDS
,
92 wb_irpc_DsrUpdateReadOnlyServerDnsRecords
, NULL
);