Line data Source code
1 : /* client functions auto-generated by pidl */
2 :
3 : #include "includes.h"
4 : #include <tevent.h>
5 : #include "lib/util/tevent_ntstatus.h"
6 : #include "bin/default/librpc/gen_ndr/ndr_dnsserver.h"
7 : #include "bin/default/librpc/gen_ndr/ndr_dnsserver_c.h"
8 :
9 : /* dnsserver - client functions generated by pidl */
10 :
11 : struct dcerpc_DnssrvOperation_r_state {
12 : TALLOC_CTX *out_mem_ctx;
13 : };
14 :
15 : static void dcerpc_DnssrvOperation_r_done(struct tevent_req *subreq);
16 :
17 0 : struct tevent_req *dcerpc_DnssrvOperation_r_send(TALLOC_CTX *mem_ctx,
18 : struct tevent_context *ev,
19 : struct dcerpc_binding_handle *h,
20 : struct DnssrvOperation *r)
21 : {
22 0 : struct tevent_req *req;
23 0 : struct dcerpc_DnssrvOperation_r_state *state;
24 0 : struct tevent_req *subreq;
25 :
26 0 : req = tevent_req_create(mem_ctx, &state,
27 : struct dcerpc_DnssrvOperation_r_state);
28 0 : if (req == NULL) {
29 0 : return NULL;
30 : }
31 :
32 0 : state->out_mem_ctx = NULL;
33 :
34 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
35 : NULL, &ndr_table_dnsserver,
36 : NDR_DNSSRVOPERATION, state, r);
37 0 : if (tevent_req_nomem(subreq, req)) {
38 0 : return tevent_req_post(req, ev);
39 : }
40 0 : tevent_req_set_callback(subreq, dcerpc_DnssrvOperation_r_done, req);
41 :
42 0 : return req;
43 : }
44 :
45 0 : static void dcerpc_DnssrvOperation_r_done(struct tevent_req *subreq)
46 : {
47 0 : struct tevent_req *req =
48 0 : tevent_req_callback_data(subreq,
49 : struct tevent_req);
50 0 : NTSTATUS status;
51 :
52 0 : status = dcerpc_binding_handle_call_recv(subreq);
53 0 : TALLOC_FREE(subreq);
54 0 : if (tevent_req_nterror(req, status)) {
55 0 : return;
56 : }
57 :
58 0 : tevent_req_done(req);
59 : }
60 :
61 0 : NTSTATUS dcerpc_DnssrvOperation_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
62 : {
63 0 : struct dcerpc_DnssrvOperation_r_state *state =
64 0 : tevent_req_data(req,
65 : struct dcerpc_DnssrvOperation_r_state);
66 0 : NTSTATUS status;
67 :
68 0 : if (tevent_req_is_nterror(req, &status)) {
69 0 : tevent_req_received(req);
70 0 : return status;
71 : }
72 :
73 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
74 :
75 0 : tevent_req_received(req);
76 0 : return NT_STATUS_OK;
77 : }
78 :
79 3 : NTSTATUS dcerpc_DnssrvOperation_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct DnssrvOperation *r)
80 : {
81 0 : NTSTATUS status;
82 :
83 3 : status = dcerpc_binding_handle_call(h,
84 : NULL, &ndr_table_dnsserver,
85 : NDR_DNSSRVOPERATION, mem_ctx, r);
86 :
87 3 : return status;
88 : }
89 :
90 : struct dcerpc_DnssrvOperation_state {
91 : struct DnssrvOperation orig;
92 : struct DnssrvOperation tmp;
93 : TALLOC_CTX *out_mem_ctx;
94 : };
95 :
96 : static void dcerpc_DnssrvOperation_done(struct tevent_req *subreq);
97 :
98 0 : struct tevent_req *dcerpc_DnssrvOperation_send(TALLOC_CTX *mem_ctx,
99 : struct tevent_context *ev,
100 : struct dcerpc_binding_handle *h,
101 : const char *_pwszServerName /* [in] [charset(UTF16),unique] */,
102 : const char *_pszZone /* [in] [charset(UTF8),unique] */,
103 : uint32_t _dwContext /* [in] */,
104 : const char *_pszOperation /* [in] [charset(UTF8),unique] */,
105 : enum DNS_RPC_TYPEID _dwTypeId /* [in] */,
106 : union DNSSRV_RPC_UNION _pData /* [in] [switch_is(dwTypeId)] */)
107 : {
108 0 : struct tevent_req *req;
109 0 : struct dcerpc_DnssrvOperation_state *state;
110 0 : struct tevent_req *subreq;
111 :
112 0 : req = tevent_req_create(mem_ctx, &state,
113 : struct dcerpc_DnssrvOperation_state);
114 0 : if (req == NULL) {
115 0 : return NULL;
116 : }
117 0 : state->out_mem_ctx = NULL;
118 :
119 : /* In parameters */
120 0 : state->orig.in.pwszServerName = _pwszServerName;
121 0 : state->orig.in.pszZone = _pszZone;
122 0 : state->orig.in.dwContext = _dwContext;
123 0 : state->orig.in.pszOperation = _pszOperation;
124 0 : state->orig.in.dwTypeId = _dwTypeId;
125 0 : state->orig.in.pData = _pData;
126 :
127 : /* Out parameters */
128 :
129 : /* Result */
130 0 : NDR_ZERO_STRUCT(state->orig.out.result);
131 :
132 : /* make a temporary copy, that we pass to the dispatch function */
133 0 : state->tmp = state->orig;
134 :
135 0 : subreq = dcerpc_DnssrvOperation_r_send(state, ev, h, &state->tmp);
136 0 : if (tevent_req_nomem(subreq, req)) {
137 0 : return tevent_req_post(req, ev);
138 : }
139 0 : tevent_req_set_callback(subreq, dcerpc_DnssrvOperation_done, req);
140 0 : return req;
141 : }
142 :
143 0 : static void dcerpc_DnssrvOperation_done(struct tevent_req *subreq)
144 : {
145 0 : struct tevent_req *req = tevent_req_callback_data(
146 : subreq, struct tevent_req);
147 0 : struct dcerpc_DnssrvOperation_state *state = tevent_req_data(
148 : req, struct dcerpc_DnssrvOperation_state);
149 0 : NTSTATUS status;
150 0 : TALLOC_CTX *mem_ctx;
151 :
152 0 : if (state->out_mem_ctx) {
153 0 : mem_ctx = state->out_mem_ctx;
154 : } else {
155 0 : mem_ctx = state;
156 : }
157 :
158 0 : status = dcerpc_DnssrvOperation_r_recv(subreq, mem_ctx);
159 0 : TALLOC_FREE(subreq);
160 0 : if (tevent_req_nterror(req, status)) {
161 0 : return;
162 : }
163 :
164 : /* Copy out parameters */
165 :
166 : /* Copy result */
167 0 : state->orig.out.result = state->tmp.out.result;
168 :
169 : /* Reset temporary structure */
170 0 : NDR_ZERO_STRUCT(state->tmp);
171 :
172 0 : tevent_req_done(req);
173 : }
174 :
175 0 : NTSTATUS dcerpc_DnssrvOperation_recv(struct tevent_req *req,
176 : TALLOC_CTX *mem_ctx,
177 : WERROR *result)
178 : {
179 0 : struct dcerpc_DnssrvOperation_state *state = tevent_req_data(
180 : req, struct dcerpc_DnssrvOperation_state);
181 0 : NTSTATUS status;
182 :
183 0 : if (tevent_req_is_nterror(req, &status)) {
184 0 : tevent_req_received(req);
185 0 : return status;
186 : }
187 :
188 : /* Steal possible out parameters to the callers context */
189 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
190 :
191 : /* Return result */
192 0 : *result = state->orig.out.result;
193 :
194 0 : tevent_req_received(req);
195 0 : return NT_STATUS_OK;
196 : }
197 :
198 0 : NTSTATUS dcerpc_DnssrvOperation(struct dcerpc_binding_handle *h,
199 : TALLOC_CTX *mem_ctx,
200 : const char *_pwszServerName /* [in] [charset(UTF16),unique] */,
201 : const char *_pszZone /* [in] [charset(UTF8),unique] */,
202 : uint32_t _dwContext /* [in] */,
203 : const char *_pszOperation /* [in] [charset(UTF8),unique] */,
204 : enum DNS_RPC_TYPEID _dwTypeId /* [in] */,
205 : union DNSSRV_RPC_UNION _pData /* [in] [switch_is(dwTypeId)] */,
206 : WERROR *result)
207 : {
208 0 : struct DnssrvOperation r;
209 0 : NTSTATUS status;
210 :
211 : /* In parameters */
212 0 : r.in.pwszServerName = _pwszServerName;
213 0 : r.in.pszZone = _pszZone;
214 0 : r.in.dwContext = _dwContext;
215 0 : r.in.pszOperation = _pszOperation;
216 0 : r.in.dwTypeId = _dwTypeId;
217 0 : r.in.pData = _pData;
218 :
219 : /* Out parameters */
220 :
221 : /* Result */
222 0 : NDR_ZERO_STRUCT(r.out.result);
223 :
224 0 : status = dcerpc_DnssrvOperation_r(h, mem_ctx, &r);
225 0 : if (!NT_STATUS_IS_OK(status)) {
226 0 : return status;
227 : }
228 :
229 : /* Return variables */
230 :
231 : /* Return result */
232 0 : *result = r.out.result;
233 :
234 0 : return NT_STATUS_OK;
235 : }
236 :
237 : struct dcerpc_DnssrvQuery_r_state {
238 : TALLOC_CTX *out_mem_ctx;
239 : };
240 :
241 : static void dcerpc_DnssrvQuery_r_done(struct tevent_req *subreq);
242 :
243 0 : struct tevent_req *dcerpc_DnssrvQuery_r_send(TALLOC_CTX *mem_ctx,
244 : struct tevent_context *ev,
245 : struct dcerpc_binding_handle *h,
246 : struct DnssrvQuery *r)
247 : {
248 0 : struct tevent_req *req;
249 0 : struct dcerpc_DnssrvQuery_r_state *state;
250 0 : struct tevent_req *subreq;
251 :
252 0 : req = tevent_req_create(mem_ctx, &state,
253 : struct dcerpc_DnssrvQuery_r_state);
254 0 : if (req == NULL) {
255 0 : return NULL;
256 : }
257 :
258 0 : state->out_mem_ctx = talloc_new(state);
259 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
260 0 : return tevent_req_post(req, ev);
261 : }
262 :
263 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
264 : NULL, &ndr_table_dnsserver,
265 0 : NDR_DNSSRVQUERY, state->out_mem_ctx, r);
266 0 : if (tevent_req_nomem(subreq, req)) {
267 0 : return tevent_req_post(req, ev);
268 : }
269 0 : tevent_req_set_callback(subreq, dcerpc_DnssrvQuery_r_done, req);
270 :
271 0 : return req;
272 : }
273 :
274 0 : static void dcerpc_DnssrvQuery_r_done(struct tevent_req *subreq)
275 : {
276 0 : struct tevent_req *req =
277 0 : tevent_req_callback_data(subreq,
278 : struct tevent_req);
279 0 : NTSTATUS status;
280 :
281 0 : status = dcerpc_binding_handle_call_recv(subreq);
282 0 : TALLOC_FREE(subreq);
283 0 : if (tevent_req_nterror(req, status)) {
284 0 : return;
285 : }
286 :
287 0 : tevent_req_done(req);
288 : }
289 :
290 0 : NTSTATUS dcerpc_DnssrvQuery_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
291 : {
292 0 : struct dcerpc_DnssrvQuery_r_state *state =
293 0 : tevent_req_data(req,
294 : struct dcerpc_DnssrvQuery_r_state);
295 0 : NTSTATUS status;
296 :
297 0 : if (tevent_req_is_nterror(req, &status)) {
298 0 : tevent_req_received(req);
299 0 : return status;
300 : }
301 :
302 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
303 :
304 0 : tevent_req_received(req);
305 0 : return NT_STATUS_OK;
306 : }
307 :
308 0 : NTSTATUS dcerpc_DnssrvQuery_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct DnssrvQuery *r)
309 : {
310 0 : NTSTATUS status;
311 :
312 0 : status = dcerpc_binding_handle_call(h,
313 : NULL, &ndr_table_dnsserver,
314 : NDR_DNSSRVQUERY, mem_ctx, r);
315 :
316 0 : return status;
317 : }
318 :
319 : struct dcerpc_DnssrvQuery_state {
320 : struct DnssrvQuery orig;
321 : struct DnssrvQuery tmp;
322 : TALLOC_CTX *out_mem_ctx;
323 : };
324 :
325 : static void dcerpc_DnssrvQuery_done(struct tevent_req *subreq);
326 :
327 0 : struct tevent_req *dcerpc_DnssrvQuery_send(TALLOC_CTX *mem_ctx,
328 : struct tevent_context *ev,
329 : struct dcerpc_binding_handle *h,
330 : const char *_pwszServerName /* [in] [charset(UTF16),unique] */,
331 : const char *_pszZone /* [in] [charset(UTF8),unique] */,
332 : const char *_pszOperation /* [in] [charset(UTF8),unique] */,
333 : enum DNS_RPC_TYPEID *_pdwTypeId /* [out] [ref] */,
334 : union DNSSRV_RPC_UNION *_ppData /* [out] [ref,switch_is(*pdwTypeId)] */)
335 : {
336 0 : struct tevent_req *req;
337 0 : struct dcerpc_DnssrvQuery_state *state;
338 0 : struct tevent_req *subreq;
339 :
340 0 : req = tevent_req_create(mem_ctx, &state,
341 : struct dcerpc_DnssrvQuery_state);
342 0 : if (req == NULL) {
343 0 : return NULL;
344 : }
345 0 : state->out_mem_ctx = NULL;
346 :
347 : /* In parameters */
348 0 : state->orig.in.pwszServerName = _pwszServerName;
349 0 : state->orig.in.pszZone = _pszZone;
350 0 : state->orig.in.pszOperation = _pszOperation;
351 :
352 : /* Out parameters */
353 0 : state->orig.out.pdwTypeId = _pdwTypeId;
354 0 : state->orig.out.ppData = _ppData;
355 :
356 : /* Result */
357 0 : NDR_ZERO_STRUCT(state->orig.out.result);
358 :
359 0 : state->out_mem_ctx = talloc_named_const(state, 0,
360 : "dcerpc_DnssrvQuery_out_memory");
361 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
362 0 : return tevent_req_post(req, ev);
363 : }
364 :
365 : /* make a temporary copy, that we pass to the dispatch function */
366 0 : state->tmp = state->orig;
367 :
368 0 : subreq = dcerpc_DnssrvQuery_r_send(state, ev, h, &state->tmp);
369 0 : if (tevent_req_nomem(subreq, req)) {
370 0 : return tevent_req_post(req, ev);
371 : }
372 0 : tevent_req_set_callback(subreq, dcerpc_DnssrvQuery_done, req);
373 0 : return req;
374 : }
375 :
376 0 : static void dcerpc_DnssrvQuery_done(struct tevent_req *subreq)
377 : {
378 0 : struct tevent_req *req = tevent_req_callback_data(
379 : subreq, struct tevent_req);
380 0 : struct dcerpc_DnssrvQuery_state *state = tevent_req_data(
381 : req, struct dcerpc_DnssrvQuery_state);
382 0 : NTSTATUS status;
383 0 : TALLOC_CTX *mem_ctx;
384 :
385 0 : if (state->out_mem_ctx) {
386 0 : mem_ctx = state->out_mem_ctx;
387 : } else {
388 0 : mem_ctx = state;
389 : }
390 :
391 0 : status = dcerpc_DnssrvQuery_r_recv(subreq, mem_ctx);
392 0 : TALLOC_FREE(subreq);
393 0 : if (tevent_req_nterror(req, status)) {
394 0 : return;
395 : }
396 :
397 : /* Copy out parameters */
398 0 : *state->orig.out.pdwTypeId = *state->tmp.out.pdwTypeId;
399 0 : *state->orig.out.ppData = *state->tmp.out.ppData;
400 :
401 : /* Copy result */
402 0 : state->orig.out.result = state->tmp.out.result;
403 :
404 : /* Reset temporary structure */
405 0 : NDR_ZERO_STRUCT(state->tmp);
406 :
407 0 : tevent_req_done(req);
408 : }
409 :
410 0 : NTSTATUS dcerpc_DnssrvQuery_recv(struct tevent_req *req,
411 : TALLOC_CTX *mem_ctx,
412 : WERROR *result)
413 : {
414 0 : struct dcerpc_DnssrvQuery_state *state = tevent_req_data(
415 : req, struct dcerpc_DnssrvQuery_state);
416 0 : NTSTATUS status;
417 :
418 0 : if (tevent_req_is_nterror(req, &status)) {
419 0 : tevent_req_received(req);
420 0 : return status;
421 : }
422 :
423 : /* Steal possible out parameters to the callers context */
424 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
425 :
426 : /* Return result */
427 0 : *result = state->orig.out.result;
428 :
429 0 : tevent_req_received(req);
430 0 : return NT_STATUS_OK;
431 : }
432 :
433 0 : NTSTATUS dcerpc_DnssrvQuery(struct dcerpc_binding_handle *h,
434 : TALLOC_CTX *mem_ctx,
435 : const char *_pwszServerName /* [in] [charset(UTF16),unique] */,
436 : const char *_pszZone /* [in] [charset(UTF8),unique] */,
437 : const char *_pszOperation /* [in] [charset(UTF8),unique] */,
438 : enum DNS_RPC_TYPEID *_pdwTypeId /* [out] [ref] */,
439 : union DNSSRV_RPC_UNION *_ppData /* [out] [ref,switch_is(*pdwTypeId)] */,
440 : WERROR *result)
441 : {
442 0 : struct DnssrvQuery r;
443 0 : NTSTATUS status;
444 :
445 : /* In parameters */
446 0 : r.in.pwszServerName = _pwszServerName;
447 0 : r.in.pszZone = _pszZone;
448 0 : r.in.pszOperation = _pszOperation;
449 :
450 : /* Out parameters */
451 0 : r.out.pdwTypeId = _pdwTypeId;
452 0 : r.out.ppData = _ppData;
453 :
454 : /* Result */
455 0 : NDR_ZERO_STRUCT(r.out.result);
456 :
457 0 : status = dcerpc_DnssrvQuery_r(h, mem_ctx, &r);
458 0 : if (!NT_STATUS_IS_OK(status)) {
459 0 : return status;
460 : }
461 :
462 : /* Return variables */
463 0 : *_pdwTypeId = *r.out.pdwTypeId;
464 0 : *_ppData = *r.out.ppData;
465 :
466 : /* Return result */
467 0 : *result = r.out.result;
468 :
469 0 : return NT_STATUS_OK;
470 : }
471 :
472 : struct dcerpc_DnssrvComplexOperation_r_state {
473 : TALLOC_CTX *out_mem_ctx;
474 : };
475 :
476 : static void dcerpc_DnssrvComplexOperation_r_done(struct tevent_req *subreq);
477 :
478 0 : struct tevent_req *dcerpc_DnssrvComplexOperation_r_send(TALLOC_CTX *mem_ctx,
479 : struct tevent_context *ev,
480 : struct dcerpc_binding_handle *h,
481 : struct DnssrvComplexOperation *r)
482 : {
483 0 : struct tevent_req *req;
484 0 : struct dcerpc_DnssrvComplexOperation_r_state *state;
485 0 : struct tevent_req *subreq;
486 :
487 0 : req = tevent_req_create(mem_ctx, &state,
488 : struct dcerpc_DnssrvComplexOperation_r_state);
489 0 : if (req == NULL) {
490 0 : return NULL;
491 : }
492 :
493 0 : state->out_mem_ctx = talloc_new(state);
494 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
495 0 : return tevent_req_post(req, ev);
496 : }
497 :
498 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
499 : NULL, &ndr_table_dnsserver,
500 0 : NDR_DNSSRVCOMPLEXOPERATION, state->out_mem_ctx, r);
501 0 : if (tevent_req_nomem(subreq, req)) {
502 0 : return tevent_req_post(req, ev);
503 : }
504 0 : tevent_req_set_callback(subreq, dcerpc_DnssrvComplexOperation_r_done, req);
505 :
506 0 : return req;
507 : }
508 :
509 0 : static void dcerpc_DnssrvComplexOperation_r_done(struct tevent_req *subreq)
510 : {
511 0 : struct tevent_req *req =
512 0 : tevent_req_callback_data(subreq,
513 : struct tevent_req);
514 0 : NTSTATUS status;
515 :
516 0 : status = dcerpc_binding_handle_call_recv(subreq);
517 0 : TALLOC_FREE(subreq);
518 0 : if (tevent_req_nterror(req, status)) {
519 0 : return;
520 : }
521 :
522 0 : tevent_req_done(req);
523 : }
524 :
525 0 : NTSTATUS dcerpc_DnssrvComplexOperation_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
526 : {
527 0 : struct dcerpc_DnssrvComplexOperation_r_state *state =
528 0 : tevent_req_data(req,
529 : struct dcerpc_DnssrvComplexOperation_r_state);
530 0 : NTSTATUS status;
531 :
532 0 : if (tevent_req_is_nterror(req, &status)) {
533 0 : tevent_req_received(req);
534 0 : return status;
535 : }
536 :
537 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
538 :
539 0 : tevent_req_received(req);
540 0 : return NT_STATUS_OK;
541 : }
542 :
543 0 : NTSTATUS dcerpc_DnssrvComplexOperation_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct DnssrvComplexOperation *r)
544 : {
545 0 : NTSTATUS status;
546 :
547 0 : status = dcerpc_binding_handle_call(h,
548 : NULL, &ndr_table_dnsserver,
549 : NDR_DNSSRVCOMPLEXOPERATION, mem_ctx, r);
550 :
551 0 : return status;
552 : }
553 :
554 : struct dcerpc_DnssrvComplexOperation_state {
555 : struct DnssrvComplexOperation orig;
556 : struct DnssrvComplexOperation tmp;
557 : TALLOC_CTX *out_mem_ctx;
558 : };
559 :
560 : static void dcerpc_DnssrvComplexOperation_done(struct tevent_req *subreq);
561 :
562 0 : struct tevent_req *dcerpc_DnssrvComplexOperation_send(TALLOC_CTX *mem_ctx,
563 : struct tevent_context *ev,
564 : struct dcerpc_binding_handle *h,
565 : const char *_pwszServerName /* [in] [charset(UTF16),unique] */,
566 : const char *_pszZone /* [in] [charset(UTF8),unique] */,
567 : const char *_pszOperation /* [in] [charset(UTF8),unique] */,
568 : enum DNS_RPC_TYPEID _dwTypeIn /* [in] */,
569 : union DNSSRV_RPC_UNION _pDataIn /* [in] [switch_is(dwTypeIn)] */,
570 : enum DNS_RPC_TYPEID *_pdwTypeOut /* [out] [ref] */,
571 : union DNSSRV_RPC_UNION *_ppDataOut /* [out] [ref,switch_is(*pdwTypeOut)] */)
572 : {
573 0 : struct tevent_req *req;
574 0 : struct dcerpc_DnssrvComplexOperation_state *state;
575 0 : struct tevent_req *subreq;
576 :
577 0 : req = tevent_req_create(mem_ctx, &state,
578 : struct dcerpc_DnssrvComplexOperation_state);
579 0 : if (req == NULL) {
580 0 : return NULL;
581 : }
582 0 : state->out_mem_ctx = NULL;
583 :
584 : /* In parameters */
585 0 : state->orig.in.pwszServerName = _pwszServerName;
586 0 : state->orig.in.pszZone = _pszZone;
587 0 : state->orig.in.pszOperation = _pszOperation;
588 0 : state->orig.in.dwTypeIn = _dwTypeIn;
589 0 : state->orig.in.pDataIn = _pDataIn;
590 :
591 : /* Out parameters */
592 0 : state->orig.out.pdwTypeOut = _pdwTypeOut;
593 0 : state->orig.out.ppDataOut = _ppDataOut;
594 :
595 : /* Result */
596 0 : NDR_ZERO_STRUCT(state->orig.out.result);
597 :
598 0 : state->out_mem_ctx = talloc_named_const(state, 0,
599 : "dcerpc_DnssrvComplexOperation_out_memory");
600 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
601 0 : return tevent_req_post(req, ev);
602 : }
603 :
604 : /* make a temporary copy, that we pass to the dispatch function */
605 0 : state->tmp = state->orig;
606 :
607 0 : subreq = dcerpc_DnssrvComplexOperation_r_send(state, ev, h, &state->tmp);
608 0 : if (tevent_req_nomem(subreq, req)) {
609 0 : return tevent_req_post(req, ev);
610 : }
611 0 : tevent_req_set_callback(subreq, dcerpc_DnssrvComplexOperation_done, req);
612 0 : return req;
613 : }
614 :
615 0 : static void dcerpc_DnssrvComplexOperation_done(struct tevent_req *subreq)
616 : {
617 0 : struct tevent_req *req = tevent_req_callback_data(
618 : subreq, struct tevent_req);
619 0 : struct dcerpc_DnssrvComplexOperation_state *state = tevent_req_data(
620 : req, struct dcerpc_DnssrvComplexOperation_state);
621 0 : NTSTATUS status;
622 0 : TALLOC_CTX *mem_ctx;
623 :
624 0 : if (state->out_mem_ctx) {
625 0 : mem_ctx = state->out_mem_ctx;
626 : } else {
627 0 : mem_ctx = state;
628 : }
629 :
630 0 : status = dcerpc_DnssrvComplexOperation_r_recv(subreq, mem_ctx);
631 0 : TALLOC_FREE(subreq);
632 0 : if (tevent_req_nterror(req, status)) {
633 0 : return;
634 : }
635 :
636 : /* Copy out parameters */
637 0 : *state->orig.out.pdwTypeOut = *state->tmp.out.pdwTypeOut;
638 0 : *state->orig.out.ppDataOut = *state->tmp.out.ppDataOut;
639 :
640 : /* Copy result */
641 0 : state->orig.out.result = state->tmp.out.result;
642 :
643 : /* Reset temporary structure */
644 0 : NDR_ZERO_STRUCT(state->tmp);
645 :
646 0 : tevent_req_done(req);
647 : }
648 :
649 0 : NTSTATUS dcerpc_DnssrvComplexOperation_recv(struct tevent_req *req,
650 : TALLOC_CTX *mem_ctx,
651 : WERROR *result)
652 : {
653 0 : struct dcerpc_DnssrvComplexOperation_state *state = tevent_req_data(
654 : req, struct dcerpc_DnssrvComplexOperation_state);
655 0 : NTSTATUS status;
656 :
657 0 : if (tevent_req_is_nterror(req, &status)) {
658 0 : tevent_req_received(req);
659 0 : return status;
660 : }
661 :
662 : /* Steal possible out parameters to the callers context */
663 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
664 :
665 : /* Return result */
666 0 : *result = state->orig.out.result;
667 :
668 0 : tevent_req_received(req);
669 0 : return NT_STATUS_OK;
670 : }
671 :
672 0 : NTSTATUS dcerpc_DnssrvComplexOperation(struct dcerpc_binding_handle *h,
673 : TALLOC_CTX *mem_ctx,
674 : const char *_pwszServerName /* [in] [charset(UTF16),unique] */,
675 : const char *_pszZone /* [in] [charset(UTF8),unique] */,
676 : const char *_pszOperation /* [in] [charset(UTF8),unique] */,
677 : enum DNS_RPC_TYPEID _dwTypeIn /* [in] */,
678 : union DNSSRV_RPC_UNION _pDataIn /* [in] [switch_is(dwTypeIn)] */,
679 : enum DNS_RPC_TYPEID *_pdwTypeOut /* [out] [ref] */,
680 : union DNSSRV_RPC_UNION *_ppDataOut /* [out] [ref,switch_is(*pdwTypeOut)] */,
681 : WERROR *result)
682 : {
683 0 : struct DnssrvComplexOperation r;
684 0 : NTSTATUS status;
685 :
686 : /* In parameters */
687 0 : r.in.pwszServerName = _pwszServerName;
688 0 : r.in.pszZone = _pszZone;
689 0 : r.in.pszOperation = _pszOperation;
690 0 : r.in.dwTypeIn = _dwTypeIn;
691 0 : r.in.pDataIn = _pDataIn;
692 :
693 : /* Out parameters */
694 0 : r.out.pdwTypeOut = _pdwTypeOut;
695 0 : r.out.ppDataOut = _ppDataOut;
696 :
697 : /* Result */
698 0 : NDR_ZERO_STRUCT(r.out.result);
699 :
700 0 : status = dcerpc_DnssrvComplexOperation_r(h, mem_ctx, &r);
701 0 : if (!NT_STATUS_IS_OK(status)) {
702 0 : return status;
703 : }
704 :
705 : /* Return variables */
706 0 : *_pdwTypeOut = *r.out.pdwTypeOut;
707 0 : *_ppDataOut = *r.out.ppDataOut;
708 :
709 : /* Return result */
710 0 : *result = r.out.result;
711 :
712 0 : return NT_STATUS_OK;
713 : }
714 :
715 : struct dcerpc_DnssrvEnumRecords_r_state {
716 : TALLOC_CTX *out_mem_ctx;
717 : };
718 :
719 : static void dcerpc_DnssrvEnumRecords_r_done(struct tevent_req *subreq);
720 :
721 0 : struct tevent_req *dcerpc_DnssrvEnumRecords_r_send(TALLOC_CTX *mem_ctx,
722 : struct tevent_context *ev,
723 : struct dcerpc_binding_handle *h,
724 : struct DnssrvEnumRecords *r)
725 : {
726 0 : struct tevent_req *req;
727 0 : struct dcerpc_DnssrvEnumRecords_r_state *state;
728 0 : struct tevent_req *subreq;
729 :
730 0 : req = tevent_req_create(mem_ctx, &state,
731 : struct dcerpc_DnssrvEnumRecords_r_state);
732 0 : if (req == NULL) {
733 0 : return NULL;
734 : }
735 :
736 0 : state->out_mem_ctx = talloc_new(state);
737 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
738 0 : return tevent_req_post(req, ev);
739 : }
740 :
741 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
742 : NULL, &ndr_table_dnsserver,
743 0 : NDR_DNSSRVENUMRECORDS, state->out_mem_ctx, r);
744 0 : if (tevent_req_nomem(subreq, req)) {
745 0 : return tevent_req_post(req, ev);
746 : }
747 0 : tevent_req_set_callback(subreq, dcerpc_DnssrvEnumRecords_r_done, req);
748 :
749 0 : return req;
750 : }
751 :
752 0 : static void dcerpc_DnssrvEnumRecords_r_done(struct tevent_req *subreq)
753 : {
754 0 : struct tevent_req *req =
755 0 : tevent_req_callback_data(subreq,
756 : struct tevent_req);
757 0 : NTSTATUS status;
758 :
759 0 : status = dcerpc_binding_handle_call_recv(subreq);
760 0 : TALLOC_FREE(subreq);
761 0 : if (tevent_req_nterror(req, status)) {
762 0 : return;
763 : }
764 :
765 0 : tevent_req_done(req);
766 : }
767 :
768 0 : NTSTATUS dcerpc_DnssrvEnumRecords_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
769 : {
770 0 : struct dcerpc_DnssrvEnumRecords_r_state *state =
771 0 : tevent_req_data(req,
772 : struct dcerpc_DnssrvEnumRecords_r_state);
773 0 : NTSTATUS status;
774 :
775 0 : if (tevent_req_is_nterror(req, &status)) {
776 0 : tevent_req_received(req);
777 0 : return status;
778 : }
779 :
780 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
781 :
782 0 : tevent_req_received(req);
783 0 : return NT_STATUS_OK;
784 : }
785 :
786 0 : NTSTATUS dcerpc_DnssrvEnumRecords_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct DnssrvEnumRecords *r)
787 : {
788 0 : NTSTATUS status;
789 :
790 0 : status = dcerpc_binding_handle_call(h,
791 : NULL, &ndr_table_dnsserver,
792 : NDR_DNSSRVENUMRECORDS, mem_ctx, r);
793 :
794 0 : return status;
795 : }
796 :
797 : struct dcerpc_DnssrvEnumRecords_state {
798 : struct DnssrvEnumRecords orig;
799 : struct DnssrvEnumRecords tmp;
800 : TALLOC_CTX *out_mem_ctx;
801 : };
802 :
803 : static void dcerpc_DnssrvEnumRecords_done(struct tevent_req *subreq);
804 :
805 0 : struct tevent_req *dcerpc_DnssrvEnumRecords_send(TALLOC_CTX *mem_ctx,
806 : struct tevent_context *ev,
807 : struct dcerpc_binding_handle *h,
808 : const char *_pwszServerName /* [in] [charset(UTF16),unique] */,
809 : const char *_pszZone /* [in] [charset(UTF8),unique] */,
810 : const char *_pszNodeName /* [in] [charset(UTF8),unique] */,
811 : const char *_pszStartChild /* [in] [charset(UTF8),unique] */,
812 : enum dns_record_type _wRecordType /* [in] */,
813 : uint32_t _fSelectFlag /* [in] */,
814 : const char *_pszFilterStart /* [in] [charset(UTF8),unique] */,
815 : const char *_pszFilterStop /* [in] [charset(UTF8),unique] */,
816 : uint32_t *_pdwBufferLength /* [out] [ref] */,
817 : struct DNS_RPC_RECORDS_ARRAY **_pBuffer /* [out] [ref,subcontext(4),subcontext_size(*pdwBufferLength)] */)
818 : {
819 0 : struct tevent_req *req;
820 0 : struct dcerpc_DnssrvEnumRecords_state *state;
821 0 : struct tevent_req *subreq;
822 :
823 0 : req = tevent_req_create(mem_ctx, &state,
824 : struct dcerpc_DnssrvEnumRecords_state);
825 0 : if (req == NULL) {
826 0 : return NULL;
827 : }
828 0 : state->out_mem_ctx = NULL;
829 :
830 : /* In parameters */
831 0 : state->orig.in.pwszServerName = _pwszServerName;
832 0 : state->orig.in.pszZone = _pszZone;
833 0 : state->orig.in.pszNodeName = _pszNodeName;
834 0 : state->orig.in.pszStartChild = _pszStartChild;
835 0 : state->orig.in.wRecordType = _wRecordType;
836 0 : state->orig.in.fSelectFlag = _fSelectFlag;
837 0 : state->orig.in.pszFilterStart = _pszFilterStart;
838 0 : state->orig.in.pszFilterStop = _pszFilterStop;
839 :
840 : /* Out parameters */
841 0 : state->orig.out.pdwBufferLength = _pdwBufferLength;
842 0 : state->orig.out.pBuffer = _pBuffer;
843 :
844 : /* Result */
845 0 : NDR_ZERO_STRUCT(state->orig.out.result);
846 :
847 0 : state->out_mem_ctx = talloc_named_const(state, 0,
848 : "dcerpc_DnssrvEnumRecords_out_memory");
849 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
850 0 : return tevent_req_post(req, ev);
851 : }
852 :
853 : /* make a temporary copy, that we pass to the dispatch function */
854 0 : state->tmp = state->orig;
855 :
856 0 : subreq = dcerpc_DnssrvEnumRecords_r_send(state, ev, h, &state->tmp);
857 0 : if (tevent_req_nomem(subreq, req)) {
858 0 : return tevent_req_post(req, ev);
859 : }
860 0 : tevent_req_set_callback(subreq, dcerpc_DnssrvEnumRecords_done, req);
861 0 : return req;
862 : }
863 :
864 0 : static void dcerpc_DnssrvEnumRecords_done(struct tevent_req *subreq)
865 : {
866 0 : struct tevent_req *req = tevent_req_callback_data(
867 : subreq, struct tevent_req);
868 0 : struct dcerpc_DnssrvEnumRecords_state *state = tevent_req_data(
869 : req, struct dcerpc_DnssrvEnumRecords_state);
870 0 : NTSTATUS status;
871 0 : TALLOC_CTX *mem_ctx;
872 :
873 0 : if (state->out_mem_ctx) {
874 0 : mem_ctx = state->out_mem_ctx;
875 : } else {
876 0 : mem_ctx = state;
877 : }
878 :
879 0 : status = dcerpc_DnssrvEnumRecords_r_recv(subreq, mem_ctx);
880 0 : TALLOC_FREE(subreq);
881 0 : if (tevent_req_nterror(req, status)) {
882 0 : return;
883 : }
884 :
885 : /* Copy out parameters */
886 0 : *state->orig.out.pdwBufferLength = *state->tmp.out.pdwBufferLength;
887 0 : *state->orig.out.pBuffer = *state->tmp.out.pBuffer;
888 :
889 : /* Copy result */
890 0 : state->orig.out.result = state->tmp.out.result;
891 :
892 : /* Reset temporary structure */
893 0 : NDR_ZERO_STRUCT(state->tmp);
894 :
895 0 : tevent_req_done(req);
896 : }
897 :
898 0 : NTSTATUS dcerpc_DnssrvEnumRecords_recv(struct tevent_req *req,
899 : TALLOC_CTX *mem_ctx,
900 : WERROR *result)
901 : {
902 0 : struct dcerpc_DnssrvEnumRecords_state *state = tevent_req_data(
903 : req, struct dcerpc_DnssrvEnumRecords_state);
904 0 : NTSTATUS status;
905 :
906 0 : if (tevent_req_is_nterror(req, &status)) {
907 0 : tevent_req_received(req);
908 0 : return status;
909 : }
910 :
911 : /* Steal possible out parameters to the callers context */
912 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
913 :
914 : /* Return result */
915 0 : *result = state->orig.out.result;
916 :
917 0 : tevent_req_received(req);
918 0 : return NT_STATUS_OK;
919 : }
920 :
921 0 : NTSTATUS dcerpc_DnssrvEnumRecords(struct dcerpc_binding_handle *h,
922 : TALLOC_CTX *mem_ctx,
923 : const char *_pwszServerName /* [in] [charset(UTF16),unique] */,
924 : const char *_pszZone /* [in] [charset(UTF8),unique] */,
925 : const char *_pszNodeName /* [in] [charset(UTF8),unique] */,
926 : const char *_pszStartChild /* [in] [charset(UTF8),unique] */,
927 : enum dns_record_type _wRecordType /* [in] */,
928 : uint32_t _fSelectFlag /* [in] */,
929 : const char *_pszFilterStart /* [in] [charset(UTF8),unique] */,
930 : const char *_pszFilterStop /* [in] [charset(UTF8),unique] */,
931 : uint32_t *_pdwBufferLength /* [out] [ref] */,
932 : struct DNS_RPC_RECORDS_ARRAY **_pBuffer /* [out] [ref,subcontext(4),subcontext_size(*pdwBufferLength)] */,
933 : WERROR *result)
934 : {
935 0 : struct DnssrvEnumRecords r;
936 0 : NTSTATUS status;
937 :
938 : /* In parameters */
939 0 : r.in.pwszServerName = _pwszServerName;
940 0 : r.in.pszZone = _pszZone;
941 0 : r.in.pszNodeName = _pszNodeName;
942 0 : r.in.pszStartChild = _pszStartChild;
943 0 : r.in.wRecordType = _wRecordType;
944 0 : r.in.fSelectFlag = _fSelectFlag;
945 0 : r.in.pszFilterStart = _pszFilterStart;
946 0 : r.in.pszFilterStop = _pszFilterStop;
947 :
948 : /* Out parameters */
949 0 : r.out.pdwBufferLength = _pdwBufferLength;
950 0 : r.out.pBuffer = _pBuffer;
951 :
952 : /* Result */
953 0 : NDR_ZERO_STRUCT(r.out.result);
954 :
955 0 : status = dcerpc_DnssrvEnumRecords_r(h, mem_ctx, &r);
956 0 : if (!NT_STATUS_IS_OK(status)) {
957 0 : return status;
958 : }
959 :
960 : /* Return variables */
961 0 : *_pdwBufferLength = *r.out.pdwBufferLength;
962 0 : *_pBuffer = *r.out.pBuffer;
963 :
964 : /* Return result */
965 0 : *result = r.out.result;
966 :
967 0 : return NT_STATUS_OK;
968 : }
969 :
970 : struct dcerpc_DnssrvUpdateRecord_r_state {
971 : TALLOC_CTX *out_mem_ctx;
972 : };
973 :
974 : static void dcerpc_DnssrvUpdateRecord_r_done(struct tevent_req *subreq);
975 :
976 0 : struct tevent_req *dcerpc_DnssrvUpdateRecord_r_send(TALLOC_CTX *mem_ctx,
977 : struct tevent_context *ev,
978 : struct dcerpc_binding_handle *h,
979 : struct DnssrvUpdateRecord *r)
980 : {
981 0 : struct tevent_req *req;
982 0 : struct dcerpc_DnssrvUpdateRecord_r_state *state;
983 0 : struct tevent_req *subreq;
984 :
985 0 : req = tevent_req_create(mem_ctx, &state,
986 : struct dcerpc_DnssrvUpdateRecord_r_state);
987 0 : if (req == NULL) {
988 0 : return NULL;
989 : }
990 :
991 0 : state->out_mem_ctx = NULL;
992 :
993 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
994 : NULL, &ndr_table_dnsserver,
995 : NDR_DNSSRVUPDATERECORD, state, r);
996 0 : if (tevent_req_nomem(subreq, req)) {
997 0 : return tevent_req_post(req, ev);
998 : }
999 0 : tevent_req_set_callback(subreq, dcerpc_DnssrvUpdateRecord_r_done, req);
1000 :
1001 0 : return req;
1002 : }
1003 :
1004 0 : static void dcerpc_DnssrvUpdateRecord_r_done(struct tevent_req *subreq)
1005 : {
1006 0 : struct tevent_req *req =
1007 0 : tevent_req_callback_data(subreq,
1008 : struct tevent_req);
1009 0 : NTSTATUS status;
1010 :
1011 0 : status = dcerpc_binding_handle_call_recv(subreq);
1012 0 : TALLOC_FREE(subreq);
1013 0 : if (tevent_req_nterror(req, status)) {
1014 0 : return;
1015 : }
1016 :
1017 0 : tevent_req_done(req);
1018 : }
1019 :
1020 0 : NTSTATUS dcerpc_DnssrvUpdateRecord_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1021 : {
1022 0 : struct dcerpc_DnssrvUpdateRecord_r_state *state =
1023 0 : tevent_req_data(req,
1024 : struct dcerpc_DnssrvUpdateRecord_r_state);
1025 0 : NTSTATUS status;
1026 :
1027 0 : if (tevent_req_is_nterror(req, &status)) {
1028 0 : tevent_req_received(req);
1029 0 : return status;
1030 : }
1031 :
1032 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
1033 :
1034 0 : tevent_req_received(req);
1035 0 : return NT_STATUS_OK;
1036 : }
1037 :
1038 0 : NTSTATUS dcerpc_DnssrvUpdateRecord_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct DnssrvUpdateRecord *r)
1039 : {
1040 0 : NTSTATUS status;
1041 :
1042 0 : status = dcerpc_binding_handle_call(h,
1043 : NULL, &ndr_table_dnsserver,
1044 : NDR_DNSSRVUPDATERECORD, mem_ctx, r);
1045 :
1046 0 : return status;
1047 : }
1048 :
1049 : struct dcerpc_DnssrvUpdateRecord_state {
1050 : struct DnssrvUpdateRecord orig;
1051 : struct DnssrvUpdateRecord tmp;
1052 : TALLOC_CTX *out_mem_ctx;
1053 : };
1054 :
1055 : static void dcerpc_DnssrvUpdateRecord_done(struct tevent_req *subreq);
1056 :
1057 0 : struct tevent_req *dcerpc_DnssrvUpdateRecord_send(TALLOC_CTX *mem_ctx,
1058 : struct tevent_context *ev,
1059 : struct dcerpc_binding_handle *h,
1060 : const char *_pwszServerName /* [in] [charset(UTF16),unique] */,
1061 : const char *_pszZone /* [in] [charset(UTF8),unique] */,
1062 : const char *_pszNodeName /* [in] [charset(UTF8),unique] */,
1063 : struct DNS_RPC_RECORD_BUF *_pAddRecord /* [in] [unique] */,
1064 : struct DNS_RPC_RECORD_BUF *_pDeleteRecord /* [in] [unique] */)
1065 : {
1066 0 : struct tevent_req *req;
1067 0 : struct dcerpc_DnssrvUpdateRecord_state *state;
1068 0 : struct tevent_req *subreq;
1069 :
1070 0 : req = tevent_req_create(mem_ctx, &state,
1071 : struct dcerpc_DnssrvUpdateRecord_state);
1072 0 : if (req == NULL) {
1073 0 : return NULL;
1074 : }
1075 0 : state->out_mem_ctx = NULL;
1076 :
1077 : /* In parameters */
1078 0 : state->orig.in.pwszServerName = _pwszServerName;
1079 0 : state->orig.in.pszZone = _pszZone;
1080 0 : state->orig.in.pszNodeName = _pszNodeName;
1081 0 : state->orig.in.pAddRecord = _pAddRecord;
1082 0 : state->orig.in.pDeleteRecord = _pDeleteRecord;
1083 :
1084 : /* Out parameters */
1085 :
1086 : /* Result */
1087 0 : NDR_ZERO_STRUCT(state->orig.out.result);
1088 :
1089 : /* make a temporary copy, that we pass to the dispatch function */
1090 0 : state->tmp = state->orig;
1091 :
1092 0 : subreq = dcerpc_DnssrvUpdateRecord_r_send(state, ev, h, &state->tmp);
1093 0 : if (tevent_req_nomem(subreq, req)) {
1094 0 : return tevent_req_post(req, ev);
1095 : }
1096 0 : tevent_req_set_callback(subreq, dcerpc_DnssrvUpdateRecord_done, req);
1097 0 : return req;
1098 : }
1099 :
1100 0 : static void dcerpc_DnssrvUpdateRecord_done(struct tevent_req *subreq)
1101 : {
1102 0 : struct tevent_req *req = tevent_req_callback_data(
1103 : subreq, struct tevent_req);
1104 0 : struct dcerpc_DnssrvUpdateRecord_state *state = tevent_req_data(
1105 : req, struct dcerpc_DnssrvUpdateRecord_state);
1106 0 : NTSTATUS status;
1107 0 : TALLOC_CTX *mem_ctx;
1108 :
1109 0 : if (state->out_mem_ctx) {
1110 0 : mem_ctx = state->out_mem_ctx;
1111 : } else {
1112 0 : mem_ctx = state;
1113 : }
1114 :
1115 0 : status = dcerpc_DnssrvUpdateRecord_r_recv(subreq, mem_ctx);
1116 0 : TALLOC_FREE(subreq);
1117 0 : if (tevent_req_nterror(req, status)) {
1118 0 : return;
1119 : }
1120 :
1121 : /* Copy out parameters */
1122 :
1123 : /* Copy result */
1124 0 : state->orig.out.result = state->tmp.out.result;
1125 :
1126 : /* Reset temporary structure */
1127 0 : NDR_ZERO_STRUCT(state->tmp);
1128 :
1129 0 : tevent_req_done(req);
1130 : }
1131 :
1132 0 : NTSTATUS dcerpc_DnssrvUpdateRecord_recv(struct tevent_req *req,
1133 : TALLOC_CTX *mem_ctx,
1134 : WERROR *result)
1135 : {
1136 0 : struct dcerpc_DnssrvUpdateRecord_state *state = tevent_req_data(
1137 : req, struct dcerpc_DnssrvUpdateRecord_state);
1138 0 : NTSTATUS status;
1139 :
1140 0 : if (tevent_req_is_nterror(req, &status)) {
1141 0 : tevent_req_received(req);
1142 0 : return status;
1143 : }
1144 :
1145 : /* Steal possible out parameters to the callers context */
1146 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
1147 :
1148 : /* Return result */
1149 0 : *result = state->orig.out.result;
1150 :
1151 0 : tevent_req_received(req);
1152 0 : return NT_STATUS_OK;
1153 : }
1154 :
1155 0 : NTSTATUS dcerpc_DnssrvUpdateRecord(struct dcerpc_binding_handle *h,
1156 : TALLOC_CTX *mem_ctx,
1157 : const char *_pwszServerName /* [in] [charset(UTF16),unique] */,
1158 : const char *_pszZone /* [in] [charset(UTF8),unique] */,
1159 : const char *_pszNodeName /* [in] [charset(UTF8),unique] */,
1160 : struct DNS_RPC_RECORD_BUF *_pAddRecord /* [in] [unique] */,
1161 : struct DNS_RPC_RECORD_BUF *_pDeleteRecord /* [in] [unique] */,
1162 : WERROR *result)
1163 : {
1164 0 : struct DnssrvUpdateRecord r;
1165 0 : NTSTATUS status;
1166 :
1167 : /* In parameters */
1168 0 : r.in.pwszServerName = _pwszServerName;
1169 0 : r.in.pszZone = _pszZone;
1170 0 : r.in.pszNodeName = _pszNodeName;
1171 0 : r.in.pAddRecord = _pAddRecord;
1172 0 : r.in.pDeleteRecord = _pDeleteRecord;
1173 :
1174 : /* Out parameters */
1175 :
1176 : /* Result */
1177 0 : NDR_ZERO_STRUCT(r.out.result);
1178 :
1179 0 : status = dcerpc_DnssrvUpdateRecord_r(h, mem_ctx, &r);
1180 0 : if (!NT_STATUS_IS_OK(status)) {
1181 0 : return status;
1182 : }
1183 :
1184 : /* Return variables */
1185 :
1186 : /* Return result */
1187 0 : *result = r.out.result;
1188 :
1189 0 : return NT_STATUS_OK;
1190 : }
1191 :
1192 : struct dcerpc_DnssrvOperation2_r_state {
1193 : TALLOC_CTX *out_mem_ctx;
1194 : };
1195 :
1196 : static void dcerpc_DnssrvOperation2_r_done(struct tevent_req *subreq);
1197 :
1198 0 : struct tevent_req *dcerpc_DnssrvOperation2_r_send(TALLOC_CTX *mem_ctx,
1199 : struct tevent_context *ev,
1200 : struct dcerpc_binding_handle *h,
1201 : struct DnssrvOperation2 *r)
1202 : {
1203 0 : struct tevent_req *req;
1204 0 : struct dcerpc_DnssrvOperation2_r_state *state;
1205 0 : struct tevent_req *subreq;
1206 :
1207 0 : req = tevent_req_create(mem_ctx, &state,
1208 : struct dcerpc_DnssrvOperation2_r_state);
1209 0 : if (req == NULL) {
1210 0 : return NULL;
1211 : }
1212 :
1213 0 : state->out_mem_ctx = NULL;
1214 :
1215 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
1216 : NULL, &ndr_table_dnsserver,
1217 : NDR_DNSSRVOPERATION2, state, r);
1218 0 : if (tevent_req_nomem(subreq, req)) {
1219 0 : return tevent_req_post(req, ev);
1220 : }
1221 0 : tevent_req_set_callback(subreq, dcerpc_DnssrvOperation2_r_done, req);
1222 :
1223 0 : return req;
1224 : }
1225 :
1226 0 : static void dcerpc_DnssrvOperation2_r_done(struct tevent_req *subreq)
1227 : {
1228 0 : struct tevent_req *req =
1229 0 : tevent_req_callback_data(subreq,
1230 : struct tevent_req);
1231 0 : NTSTATUS status;
1232 :
1233 0 : status = dcerpc_binding_handle_call_recv(subreq);
1234 0 : TALLOC_FREE(subreq);
1235 0 : if (tevent_req_nterror(req, status)) {
1236 0 : return;
1237 : }
1238 :
1239 0 : tevent_req_done(req);
1240 : }
1241 :
1242 0 : NTSTATUS dcerpc_DnssrvOperation2_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1243 : {
1244 0 : struct dcerpc_DnssrvOperation2_r_state *state =
1245 0 : tevent_req_data(req,
1246 : struct dcerpc_DnssrvOperation2_r_state);
1247 0 : NTSTATUS status;
1248 :
1249 0 : if (tevent_req_is_nterror(req, &status)) {
1250 0 : tevent_req_received(req);
1251 0 : return status;
1252 : }
1253 :
1254 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
1255 :
1256 0 : tevent_req_received(req);
1257 0 : return NT_STATUS_OK;
1258 : }
1259 :
1260 1652 : NTSTATUS dcerpc_DnssrvOperation2_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct DnssrvOperation2 *r)
1261 : {
1262 0 : NTSTATUS status;
1263 :
1264 1652 : status = dcerpc_binding_handle_call(h,
1265 : NULL, &ndr_table_dnsserver,
1266 : NDR_DNSSRVOPERATION2, mem_ctx, r);
1267 :
1268 1652 : return status;
1269 : }
1270 :
1271 : struct dcerpc_DnssrvOperation2_state {
1272 : struct DnssrvOperation2 orig;
1273 : struct DnssrvOperation2 tmp;
1274 : TALLOC_CTX *out_mem_ctx;
1275 : };
1276 :
1277 : static void dcerpc_DnssrvOperation2_done(struct tevent_req *subreq);
1278 :
1279 0 : struct tevent_req *dcerpc_DnssrvOperation2_send(TALLOC_CTX *mem_ctx,
1280 : struct tevent_context *ev,
1281 : struct dcerpc_binding_handle *h,
1282 : enum DNS_RPC_CLIENT_VERSION _dwClientVersion /* [in] */,
1283 : uint32_t _dwSettingFlags /* [in] */,
1284 : const char *_pwszServerName /* [in] [charset(UTF16),unique] */,
1285 : const char *_pszZone /* [in] [charset(UTF8),unique] */,
1286 : uint32_t _dwContext /* [in] */,
1287 : const char *_pszOperation /* [in] [charset(UTF8),unique] */,
1288 : enum DNS_RPC_TYPEID _dwTypeId /* [in] */,
1289 : union DNSSRV_RPC_UNION _pData /* [in] [switch_is(dwTypeId)] */)
1290 : {
1291 0 : struct tevent_req *req;
1292 0 : struct dcerpc_DnssrvOperation2_state *state;
1293 0 : struct tevent_req *subreq;
1294 :
1295 0 : req = tevent_req_create(mem_ctx, &state,
1296 : struct dcerpc_DnssrvOperation2_state);
1297 0 : if (req == NULL) {
1298 0 : return NULL;
1299 : }
1300 0 : state->out_mem_ctx = NULL;
1301 :
1302 : /* In parameters */
1303 0 : state->orig.in.dwClientVersion = _dwClientVersion;
1304 0 : state->orig.in.dwSettingFlags = _dwSettingFlags;
1305 0 : state->orig.in.pwszServerName = _pwszServerName;
1306 0 : state->orig.in.pszZone = _pszZone;
1307 0 : state->orig.in.dwContext = _dwContext;
1308 0 : state->orig.in.pszOperation = _pszOperation;
1309 0 : state->orig.in.dwTypeId = _dwTypeId;
1310 0 : state->orig.in.pData = _pData;
1311 :
1312 : /* Out parameters */
1313 :
1314 : /* Result */
1315 0 : NDR_ZERO_STRUCT(state->orig.out.result);
1316 :
1317 : /* make a temporary copy, that we pass to the dispatch function */
1318 0 : state->tmp = state->orig;
1319 :
1320 0 : subreq = dcerpc_DnssrvOperation2_r_send(state, ev, h, &state->tmp);
1321 0 : if (tevent_req_nomem(subreq, req)) {
1322 0 : return tevent_req_post(req, ev);
1323 : }
1324 0 : tevent_req_set_callback(subreq, dcerpc_DnssrvOperation2_done, req);
1325 0 : return req;
1326 : }
1327 :
1328 0 : static void dcerpc_DnssrvOperation2_done(struct tevent_req *subreq)
1329 : {
1330 0 : struct tevent_req *req = tevent_req_callback_data(
1331 : subreq, struct tevent_req);
1332 0 : struct dcerpc_DnssrvOperation2_state *state = tevent_req_data(
1333 : req, struct dcerpc_DnssrvOperation2_state);
1334 0 : NTSTATUS status;
1335 0 : TALLOC_CTX *mem_ctx;
1336 :
1337 0 : if (state->out_mem_ctx) {
1338 0 : mem_ctx = state->out_mem_ctx;
1339 : } else {
1340 0 : mem_ctx = state;
1341 : }
1342 :
1343 0 : status = dcerpc_DnssrvOperation2_r_recv(subreq, mem_ctx);
1344 0 : TALLOC_FREE(subreq);
1345 0 : if (tevent_req_nterror(req, status)) {
1346 0 : return;
1347 : }
1348 :
1349 : /* Copy out parameters */
1350 :
1351 : /* Copy result */
1352 0 : state->orig.out.result = state->tmp.out.result;
1353 :
1354 : /* Reset temporary structure */
1355 0 : NDR_ZERO_STRUCT(state->tmp);
1356 :
1357 0 : tevent_req_done(req);
1358 : }
1359 :
1360 0 : NTSTATUS dcerpc_DnssrvOperation2_recv(struct tevent_req *req,
1361 : TALLOC_CTX *mem_ctx,
1362 : WERROR *result)
1363 : {
1364 0 : struct dcerpc_DnssrvOperation2_state *state = tevent_req_data(
1365 : req, struct dcerpc_DnssrvOperation2_state);
1366 0 : NTSTATUS status;
1367 :
1368 0 : if (tevent_req_is_nterror(req, &status)) {
1369 0 : tevent_req_received(req);
1370 0 : return status;
1371 : }
1372 :
1373 : /* Steal possible out parameters to the callers context */
1374 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
1375 :
1376 : /* Return result */
1377 0 : *result = state->orig.out.result;
1378 :
1379 0 : tevent_req_received(req);
1380 0 : return NT_STATUS_OK;
1381 : }
1382 :
1383 0 : NTSTATUS dcerpc_DnssrvOperation2(struct dcerpc_binding_handle *h,
1384 : TALLOC_CTX *mem_ctx,
1385 : enum DNS_RPC_CLIENT_VERSION _dwClientVersion /* [in] */,
1386 : uint32_t _dwSettingFlags /* [in] */,
1387 : const char *_pwszServerName /* [in] [charset(UTF16),unique] */,
1388 : const char *_pszZone /* [in] [charset(UTF8),unique] */,
1389 : uint32_t _dwContext /* [in] */,
1390 : const char *_pszOperation /* [in] [charset(UTF8),unique] */,
1391 : enum DNS_RPC_TYPEID _dwTypeId /* [in] */,
1392 : union DNSSRV_RPC_UNION _pData /* [in] [switch_is(dwTypeId)] */,
1393 : WERROR *result)
1394 : {
1395 0 : struct DnssrvOperation2 r;
1396 0 : NTSTATUS status;
1397 :
1398 : /* In parameters */
1399 0 : r.in.dwClientVersion = _dwClientVersion;
1400 0 : r.in.dwSettingFlags = _dwSettingFlags;
1401 0 : r.in.pwszServerName = _pwszServerName;
1402 0 : r.in.pszZone = _pszZone;
1403 0 : r.in.dwContext = _dwContext;
1404 0 : r.in.pszOperation = _pszOperation;
1405 0 : r.in.dwTypeId = _dwTypeId;
1406 0 : r.in.pData = _pData;
1407 :
1408 : /* Out parameters */
1409 :
1410 : /* Result */
1411 0 : NDR_ZERO_STRUCT(r.out.result);
1412 :
1413 0 : status = dcerpc_DnssrvOperation2_r(h, mem_ctx, &r);
1414 0 : if (!NT_STATUS_IS_OK(status)) {
1415 0 : return status;
1416 : }
1417 :
1418 : /* Return variables */
1419 :
1420 : /* Return result */
1421 0 : *result = r.out.result;
1422 :
1423 0 : return NT_STATUS_OK;
1424 : }
1425 :
1426 : struct dcerpc_DnssrvQuery2_r_state {
1427 : TALLOC_CTX *out_mem_ctx;
1428 : };
1429 :
1430 : static void dcerpc_DnssrvQuery2_r_done(struct tevent_req *subreq);
1431 :
1432 0 : struct tevent_req *dcerpc_DnssrvQuery2_r_send(TALLOC_CTX *mem_ctx,
1433 : struct tevent_context *ev,
1434 : struct dcerpc_binding_handle *h,
1435 : struct DnssrvQuery2 *r)
1436 : {
1437 0 : struct tevent_req *req;
1438 0 : struct dcerpc_DnssrvQuery2_r_state *state;
1439 0 : struct tevent_req *subreq;
1440 :
1441 0 : req = tevent_req_create(mem_ctx, &state,
1442 : struct dcerpc_DnssrvQuery2_r_state);
1443 0 : if (req == NULL) {
1444 0 : return NULL;
1445 : }
1446 :
1447 0 : state->out_mem_ctx = talloc_new(state);
1448 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
1449 0 : return tevent_req_post(req, ev);
1450 : }
1451 :
1452 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
1453 : NULL, &ndr_table_dnsserver,
1454 0 : NDR_DNSSRVQUERY2, state->out_mem_ctx, r);
1455 0 : if (tevent_req_nomem(subreq, req)) {
1456 0 : return tevent_req_post(req, ev);
1457 : }
1458 0 : tevent_req_set_callback(subreq, dcerpc_DnssrvQuery2_r_done, req);
1459 :
1460 0 : return req;
1461 : }
1462 :
1463 0 : static void dcerpc_DnssrvQuery2_r_done(struct tevent_req *subreq)
1464 : {
1465 0 : struct tevent_req *req =
1466 0 : tevent_req_callback_data(subreq,
1467 : struct tevent_req);
1468 0 : NTSTATUS status;
1469 :
1470 0 : status = dcerpc_binding_handle_call_recv(subreq);
1471 0 : TALLOC_FREE(subreq);
1472 0 : if (tevent_req_nterror(req, status)) {
1473 0 : return;
1474 : }
1475 :
1476 0 : tevent_req_done(req);
1477 : }
1478 :
1479 0 : NTSTATUS dcerpc_DnssrvQuery2_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1480 : {
1481 0 : struct dcerpc_DnssrvQuery2_r_state *state =
1482 0 : tevent_req_data(req,
1483 : struct dcerpc_DnssrvQuery2_r_state);
1484 0 : NTSTATUS status;
1485 :
1486 0 : if (tevent_req_is_nterror(req, &status)) {
1487 0 : tevent_req_received(req);
1488 0 : return status;
1489 : }
1490 :
1491 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
1492 :
1493 0 : tevent_req_received(req);
1494 0 : return NT_STATUS_OK;
1495 : }
1496 :
1497 29 : NTSTATUS dcerpc_DnssrvQuery2_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct DnssrvQuery2 *r)
1498 : {
1499 0 : NTSTATUS status;
1500 :
1501 29 : status = dcerpc_binding_handle_call(h,
1502 : NULL, &ndr_table_dnsserver,
1503 : NDR_DNSSRVQUERY2, mem_ctx, r);
1504 :
1505 29 : return status;
1506 : }
1507 :
1508 : struct dcerpc_DnssrvQuery2_state {
1509 : struct DnssrvQuery2 orig;
1510 : struct DnssrvQuery2 tmp;
1511 : TALLOC_CTX *out_mem_ctx;
1512 : };
1513 :
1514 : static void dcerpc_DnssrvQuery2_done(struct tevent_req *subreq);
1515 :
1516 0 : struct tevent_req *dcerpc_DnssrvQuery2_send(TALLOC_CTX *mem_ctx,
1517 : struct tevent_context *ev,
1518 : struct dcerpc_binding_handle *h,
1519 : enum DNS_RPC_CLIENT_VERSION _dwClientVersion /* [in] */,
1520 : uint32_t _dwSettingFlags /* [in] */,
1521 : const char *_pwszServerName /* [in] [charset(UTF16),unique] */,
1522 : const char *_pszZone /* [in] [charset(UTF8),unique] */,
1523 : const char *_pszOperation /* [in] [charset(UTF8),unique] */,
1524 : enum DNS_RPC_TYPEID *_pdwTypeId /* [out] [ref] */,
1525 : union DNSSRV_RPC_UNION *_ppData /* [out] [ref,switch_is(*pdwTypeId)] */)
1526 : {
1527 0 : struct tevent_req *req;
1528 0 : struct dcerpc_DnssrvQuery2_state *state;
1529 0 : struct tevent_req *subreq;
1530 :
1531 0 : req = tevent_req_create(mem_ctx, &state,
1532 : struct dcerpc_DnssrvQuery2_state);
1533 0 : if (req == NULL) {
1534 0 : return NULL;
1535 : }
1536 0 : state->out_mem_ctx = NULL;
1537 :
1538 : /* In parameters */
1539 0 : state->orig.in.dwClientVersion = _dwClientVersion;
1540 0 : state->orig.in.dwSettingFlags = _dwSettingFlags;
1541 0 : state->orig.in.pwszServerName = _pwszServerName;
1542 0 : state->orig.in.pszZone = _pszZone;
1543 0 : state->orig.in.pszOperation = _pszOperation;
1544 :
1545 : /* Out parameters */
1546 0 : state->orig.out.pdwTypeId = _pdwTypeId;
1547 0 : state->orig.out.ppData = _ppData;
1548 :
1549 : /* Result */
1550 0 : NDR_ZERO_STRUCT(state->orig.out.result);
1551 :
1552 0 : state->out_mem_ctx = talloc_named_const(state, 0,
1553 : "dcerpc_DnssrvQuery2_out_memory");
1554 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
1555 0 : return tevent_req_post(req, ev);
1556 : }
1557 :
1558 : /* make a temporary copy, that we pass to the dispatch function */
1559 0 : state->tmp = state->orig;
1560 :
1561 0 : subreq = dcerpc_DnssrvQuery2_r_send(state, ev, h, &state->tmp);
1562 0 : if (tevent_req_nomem(subreq, req)) {
1563 0 : return tevent_req_post(req, ev);
1564 : }
1565 0 : tevent_req_set_callback(subreq, dcerpc_DnssrvQuery2_done, req);
1566 0 : return req;
1567 : }
1568 :
1569 0 : static void dcerpc_DnssrvQuery2_done(struct tevent_req *subreq)
1570 : {
1571 0 : struct tevent_req *req = tevent_req_callback_data(
1572 : subreq, struct tevent_req);
1573 0 : struct dcerpc_DnssrvQuery2_state *state = tevent_req_data(
1574 : req, struct dcerpc_DnssrvQuery2_state);
1575 0 : NTSTATUS status;
1576 0 : TALLOC_CTX *mem_ctx;
1577 :
1578 0 : if (state->out_mem_ctx) {
1579 0 : mem_ctx = state->out_mem_ctx;
1580 : } else {
1581 0 : mem_ctx = state;
1582 : }
1583 :
1584 0 : status = dcerpc_DnssrvQuery2_r_recv(subreq, mem_ctx);
1585 0 : TALLOC_FREE(subreq);
1586 0 : if (tevent_req_nterror(req, status)) {
1587 0 : return;
1588 : }
1589 :
1590 : /* Copy out parameters */
1591 0 : *state->orig.out.pdwTypeId = *state->tmp.out.pdwTypeId;
1592 0 : *state->orig.out.ppData = *state->tmp.out.ppData;
1593 :
1594 : /* Copy result */
1595 0 : state->orig.out.result = state->tmp.out.result;
1596 :
1597 : /* Reset temporary structure */
1598 0 : NDR_ZERO_STRUCT(state->tmp);
1599 :
1600 0 : tevent_req_done(req);
1601 : }
1602 :
1603 0 : NTSTATUS dcerpc_DnssrvQuery2_recv(struct tevent_req *req,
1604 : TALLOC_CTX *mem_ctx,
1605 : WERROR *result)
1606 : {
1607 0 : struct dcerpc_DnssrvQuery2_state *state = tevent_req_data(
1608 : req, struct dcerpc_DnssrvQuery2_state);
1609 0 : NTSTATUS status;
1610 :
1611 0 : if (tevent_req_is_nterror(req, &status)) {
1612 0 : tevent_req_received(req);
1613 0 : return status;
1614 : }
1615 :
1616 : /* Steal possible out parameters to the callers context */
1617 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
1618 :
1619 : /* Return result */
1620 0 : *result = state->orig.out.result;
1621 :
1622 0 : tevent_req_received(req);
1623 0 : return NT_STATUS_OK;
1624 : }
1625 :
1626 0 : NTSTATUS dcerpc_DnssrvQuery2(struct dcerpc_binding_handle *h,
1627 : TALLOC_CTX *mem_ctx,
1628 : enum DNS_RPC_CLIENT_VERSION _dwClientVersion /* [in] */,
1629 : uint32_t _dwSettingFlags /* [in] */,
1630 : const char *_pwszServerName /* [in] [charset(UTF16),unique] */,
1631 : const char *_pszZone /* [in] [charset(UTF8),unique] */,
1632 : const char *_pszOperation /* [in] [charset(UTF8),unique] */,
1633 : enum DNS_RPC_TYPEID *_pdwTypeId /* [out] [ref] */,
1634 : union DNSSRV_RPC_UNION *_ppData /* [out] [ref,switch_is(*pdwTypeId)] */,
1635 : WERROR *result)
1636 : {
1637 0 : struct DnssrvQuery2 r;
1638 0 : NTSTATUS status;
1639 :
1640 : /* In parameters */
1641 0 : r.in.dwClientVersion = _dwClientVersion;
1642 0 : r.in.dwSettingFlags = _dwSettingFlags;
1643 0 : r.in.pwszServerName = _pwszServerName;
1644 0 : r.in.pszZone = _pszZone;
1645 0 : r.in.pszOperation = _pszOperation;
1646 :
1647 : /* Out parameters */
1648 0 : r.out.pdwTypeId = _pdwTypeId;
1649 0 : r.out.ppData = _ppData;
1650 :
1651 : /* Result */
1652 0 : NDR_ZERO_STRUCT(r.out.result);
1653 :
1654 0 : status = dcerpc_DnssrvQuery2_r(h, mem_ctx, &r);
1655 0 : if (!NT_STATUS_IS_OK(status)) {
1656 0 : return status;
1657 : }
1658 :
1659 : /* Return variables */
1660 0 : *_pdwTypeId = *r.out.pdwTypeId;
1661 0 : *_ppData = *r.out.ppData;
1662 :
1663 : /* Return result */
1664 0 : *result = r.out.result;
1665 :
1666 0 : return NT_STATUS_OK;
1667 : }
1668 :
1669 : struct dcerpc_DnssrvComplexOperation2_r_state {
1670 : TALLOC_CTX *out_mem_ctx;
1671 : };
1672 :
1673 : static void dcerpc_DnssrvComplexOperation2_r_done(struct tevent_req *subreq);
1674 :
1675 0 : struct tevent_req *dcerpc_DnssrvComplexOperation2_r_send(TALLOC_CTX *mem_ctx,
1676 : struct tevent_context *ev,
1677 : struct dcerpc_binding_handle *h,
1678 : struct DnssrvComplexOperation2 *r)
1679 : {
1680 0 : struct tevent_req *req;
1681 0 : struct dcerpc_DnssrvComplexOperation2_r_state *state;
1682 0 : struct tevent_req *subreq;
1683 :
1684 0 : req = tevent_req_create(mem_ctx, &state,
1685 : struct dcerpc_DnssrvComplexOperation2_r_state);
1686 0 : if (req == NULL) {
1687 0 : return NULL;
1688 : }
1689 :
1690 0 : state->out_mem_ctx = talloc_new(state);
1691 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
1692 0 : return tevent_req_post(req, ev);
1693 : }
1694 :
1695 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
1696 : NULL, &ndr_table_dnsserver,
1697 0 : NDR_DNSSRVCOMPLEXOPERATION2, state->out_mem_ctx, r);
1698 0 : if (tevent_req_nomem(subreq, req)) {
1699 0 : return tevent_req_post(req, ev);
1700 : }
1701 0 : tevent_req_set_callback(subreq, dcerpc_DnssrvComplexOperation2_r_done, req);
1702 :
1703 0 : return req;
1704 : }
1705 :
1706 0 : static void dcerpc_DnssrvComplexOperation2_r_done(struct tevent_req *subreq)
1707 : {
1708 0 : struct tevent_req *req =
1709 0 : tevent_req_callback_data(subreq,
1710 : struct tevent_req);
1711 0 : NTSTATUS status;
1712 :
1713 0 : status = dcerpc_binding_handle_call_recv(subreq);
1714 0 : TALLOC_FREE(subreq);
1715 0 : if (tevent_req_nterror(req, status)) {
1716 0 : return;
1717 : }
1718 :
1719 0 : tevent_req_done(req);
1720 : }
1721 :
1722 0 : NTSTATUS dcerpc_DnssrvComplexOperation2_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1723 : {
1724 0 : struct dcerpc_DnssrvComplexOperation2_r_state *state =
1725 0 : tevent_req_data(req,
1726 : struct dcerpc_DnssrvComplexOperation2_r_state);
1727 0 : NTSTATUS status;
1728 :
1729 0 : if (tevent_req_is_nterror(req, &status)) {
1730 0 : tevent_req_received(req);
1731 0 : return status;
1732 : }
1733 :
1734 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
1735 :
1736 0 : tevent_req_received(req);
1737 0 : return NT_STATUS_OK;
1738 : }
1739 :
1740 20 : NTSTATUS dcerpc_DnssrvComplexOperation2_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct DnssrvComplexOperation2 *r)
1741 : {
1742 0 : NTSTATUS status;
1743 :
1744 20 : status = dcerpc_binding_handle_call(h,
1745 : NULL, &ndr_table_dnsserver,
1746 : NDR_DNSSRVCOMPLEXOPERATION2, mem_ctx, r);
1747 :
1748 20 : return status;
1749 : }
1750 :
1751 : struct dcerpc_DnssrvComplexOperation2_state {
1752 : struct DnssrvComplexOperation2 orig;
1753 : struct DnssrvComplexOperation2 tmp;
1754 : TALLOC_CTX *out_mem_ctx;
1755 : };
1756 :
1757 : static void dcerpc_DnssrvComplexOperation2_done(struct tevent_req *subreq);
1758 :
1759 0 : struct tevent_req *dcerpc_DnssrvComplexOperation2_send(TALLOC_CTX *mem_ctx,
1760 : struct tevent_context *ev,
1761 : struct dcerpc_binding_handle *h,
1762 : enum DNS_RPC_CLIENT_VERSION _dwClientVersion /* [in] */,
1763 : uint32_t _dwSettingFlags /* [in] */,
1764 : const char *_pwszServerName /* [in] [charset(UTF16),unique] */,
1765 : const char *_pszZone /* [in] [charset(UTF8),unique] */,
1766 : const char *_pszOperation /* [in] [charset(UTF8),unique] */,
1767 : enum DNS_RPC_TYPEID _dwTypeIn /* [in] */,
1768 : union DNSSRV_RPC_UNION _pDataIn /* [in] [switch_is(dwTypeIn)] */,
1769 : enum DNS_RPC_TYPEID *_pdwTypeOut /* [out] [ref] */,
1770 : union DNSSRV_RPC_UNION *_ppDataOut /* [out] [ref,switch_is(*pdwTypeOut)] */)
1771 : {
1772 0 : struct tevent_req *req;
1773 0 : struct dcerpc_DnssrvComplexOperation2_state *state;
1774 0 : struct tevent_req *subreq;
1775 :
1776 0 : req = tevent_req_create(mem_ctx, &state,
1777 : struct dcerpc_DnssrvComplexOperation2_state);
1778 0 : if (req == NULL) {
1779 0 : return NULL;
1780 : }
1781 0 : state->out_mem_ctx = NULL;
1782 :
1783 : /* In parameters */
1784 0 : state->orig.in.dwClientVersion = _dwClientVersion;
1785 0 : state->orig.in.dwSettingFlags = _dwSettingFlags;
1786 0 : state->orig.in.pwszServerName = _pwszServerName;
1787 0 : state->orig.in.pszZone = _pszZone;
1788 0 : state->orig.in.pszOperation = _pszOperation;
1789 0 : state->orig.in.dwTypeIn = _dwTypeIn;
1790 0 : state->orig.in.pDataIn = _pDataIn;
1791 :
1792 : /* Out parameters */
1793 0 : state->orig.out.pdwTypeOut = _pdwTypeOut;
1794 0 : state->orig.out.ppDataOut = _ppDataOut;
1795 :
1796 : /* Result */
1797 0 : NDR_ZERO_STRUCT(state->orig.out.result);
1798 :
1799 0 : state->out_mem_ctx = talloc_named_const(state, 0,
1800 : "dcerpc_DnssrvComplexOperation2_out_memory");
1801 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
1802 0 : return tevent_req_post(req, ev);
1803 : }
1804 :
1805 : /* make a temporary copy, that we pass to the dispatch function */
1806 0 : state->tmp = state->orig;
1807 :
1808 0 : subreq = dcerpc_DnssrvComplexOperation2_r_send(state, ev, h, &state->tmp);
1809 0 : if (tevent_req_nomem(subreq, req)) {
1810 0 : return tevent_req_post(req, ev);
1811 : }
1812 0 : tevent_req_set_callback(subreq, dcerpc_DnssrvComplexOperation2_done, req);
1813 0 : return req;
1814 : }
1815 :
1816 0 : static void dcerpc_DnssrvComplexOperation2_done(struct tevent_req *subreq)
1817 : {
1818 0 : struct tevent_req *req = tevent_req_callback_data(
1819 : subreq, struct tevent_req);
1820 0 : struct dcerpc_DnssrvComplexOperation2_state *state = tevent_req_data(
1821 : req, struct dcerpc_DnssrvComplexOperation2_state);
1822 0 : NTSTATUS status;
1823 0 : TALLOC_CTX *mem_ctx;
1824 :
1825 0 : if (state->out_mem_ctx) {
1826 0 : mem_ctx = state->out_mem_ctx;
1827 : } else {
1828 0 : mem_ctx = state;
1829 : }
1830 :
1831 0 : status = dcerpc_DnssrvComplexOperation2_r_recv(subreq, mem_ctx);
1832 0 : TALLOC_FREE(subreq);
1833 0 : if (tevent_req_nterror(req, status)) {
1834 0 : return;
1835 : }
1836 :
1837 : /* Copy out parameters */
1838 0 : *state->orig.out.pdwTypeOut = *state->tmp.out.pdwTypeOut;
1839 0 : *state->orig.out.ppDataOut = *state->tmp.out.ppDataOut;
1840 :
1841 : /* Copy result */
1842 0 : state->orig.out.result = state->tmp.out.result;
1843 :
1844 : /* Reset temporary structure */
1845 0 : NDR_ZERO_STRUCT(state->tmp);
1846 :
1847 0 : tevent_req_done(req);
1848 : }
1849 :
1850 0 : NTSTATUS dcerpc_DnssrvComplexOperation2_recv(struct tevent_req *req,
1851 : TALLOC_CTX *mem_ctx,
1852 : WERROR *result)
1853 : {
1854 0 : struct dcerpc_DnssrvComplexOperation2_state *state = tevent_req_data(
1855 : req, struct dcerpc_DnssrvComplexOperation2_state);
1856 0 : NTSTATUS status;
1857 :
1858 0 : if (tevent_req_is_nterror(req, &status)) {
1859 0 : tevent_req_received(req);
1860 0 : return status;
1861 : }
1862 :
1863 : /* Steal possible out parameters to the callers context */
1864 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
1865 :
1866 : /* Return result */
1867 0 : *result = state->orig.out.result;
1868 :
1869 0 : tevent_req_received(req);
1870 0 : return NT_STATUS_OK;
1871 : }
1872 :
1873 0 : NTSTATUS dcerpc_DnssrvComplexOperation2(struct dcerpc_binding_handle *h,
1874 : TALLOC_CTX *mem_ctx,
1875 : enum DNS_RPC_CLIENT_VERSION _dwClientVersion /* [in] */,
1876 : uint32_t _dwSettingFlags /* [in] */,
1877 : const char *_pwszServerName /* [in] [charset(UTF16),unique] */,
1878 : const char *_pszZone /* [in] [charset(UTF8),unique] */,
1879 : const char *_pszOperation /* [in] [charset(UTF8),unique] */,
1880 : enum DNS_RPC_TYPEID _dwTypeIn /* [in] */,
1881 : union DNSSRV_RPC_UNION _pDataIn /* [in] [switch_is(dwTypeIn)] */,
1882 : enum DNS_RPC_TYPEID *_pdwTypeOut /* [out] [ref] */,
1883 : union DNSSRV_RPC_UNION *_ppDataOut /* [out] [ref,switch_is(*pdwTypeOut)] */,
1884 : WERROR *result)
1885 : {
1886 0 : struct DnssrvComplexOperation2 r;
1887 0 : NTSTATUS status;
1888 :
1889 : /* In parameters */
1890 0 : r.in.dwClientVersion = _dwClientVersion;
1891 0 : r.in.dwSettingFlags = _dwSettingFlags;
1892 0 : r.in.pwszServerName = _pwszServerName;
1893 0 : r.in.pszZone = _pszZone;
1894 0 : r.in.pszOperation = _pszOperation;
1895 0 : r.in.dwTypeIn = _dwTypeIn;
1896 0 : r.in.pDataIn = _pDataIn;
1897 :
1898 : /* Out parameters */
1899 0 : r.out.pdwTypeOut = _pdwTypeOut;
1900 0 : r.out.ppDataOut = _ppDataOut;
1901 :
1902 : /* Result */
1903 0 : NDR_ZERO_STRUCT(r.out.result);
1904 :
1905 0 : status = dcerpc_DnssrvComplexOperation2_r(h, mem_ctx, &r);
1906 0 : if (!NT_STATUS_IS_OK(status)) {
1907 0 : return status;
1908 : }
1909 :
1910 : /* Return variables */
1911 0 : *_pdwTypeOut = *r.out.pdwTypeOut;
1912 0 : *_ppDataOut = *r.out.ppDataOut;
1913 :
1914 : /* Return result */
1915 0 : *result = r.out.result;
1916 :
1917 0 : return NT_STATUS_OK;
1918 : }
1919 :
1920 : struct dcerpc_DnssrvEnumRecords2_r_state {
1921 : TALLOC_CTX *out_mem_ctx;
1922 : };
1923 :
1924 : static void dcerpc_DnssrvEnumRecords2_r_done(struct tevent_req *subreq);
1925 :
1926 0 : struct tevent_req *dcerpc_DnssrvEnumRecords2_r_send(TALLOC_CTX *mem_ctx,
1927 : struct tevent_context *ev,
1928 : struct dcerpc_binding_handle *h,
1929 : struct DnssrvEnumRecords2 *r)
1930 : {
1931 0 : struct tevent_req *req;
1932 0 : struct dcerpc_DnssrvEnumRecords2_r_state *state;
1933 0 : struct tevent_req *subreq;
1934 :
1935 0 : req = tevent_req_create(mem_ctx, &state,
1936 : struct dcerpc_DnssrvEnumRecords2_r_state);
1937 0 : if (req == NULL) {
1938 0 : return NULL;
1939 : }
1940 :
1941 0 : state->out_mem_ctx = talloc_new(state);
1942 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
1943 0 : return tevent_req_post(req, ev);
1944 : }
1945 :
1946 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
1947 : NULL, &ndr_table_dnsserver,
1948 0 : NDR_DNSSRVENUMRECORDS2, state->out_mem_ctx, r);
1949 0 : if (tevent_req_nomem(subreq, req)) {
1950 0 : return tevent_req_post(req, ev);
1951 : }
1952 0 : tevent_req_set_callback(subreq, dcerpc_DnssrvEnumRecords2_r_done, req);
1953 :
1954 0 : return req;
1955 : }
1956 :
1957 0 : static void dcerpc_DnssrvEnumRecords2_r_done(struct tevent_req *subreq)
1958 : {
1959 0 : struct tevent_req *req =
1960 0 : tevent_req_callback_data(subreq,
1961 : struct tevent_req);
1962 0 : NTSTATUS status;
1963 :
1964 0 : status = dcerpc_binding_handle_call_recv(subreq);
1965 0 : TALLOC_FREE(subreq);
1966 0 : if (tevent_req_nterror(req, status)) {
1967 0 : return;
1968 : }
1969 :
1970 0 : tevent_req_done(req);
1971 : }
1972 :
1973 0 : NTSTATUS dcerpc_DnssrvEnumRecords2_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1974 : {
1975 0 : struct dcerpc_DnssrvEnumRecords2_r_state *state =
1976 0 : tevent_req_data(req,
1977 : struct dcerpc_DnssrvEnumRecords2_r_state);
1978 0 : NTSTATUS status;
1979 :
1980 0 : if (tevent_req_is_nterror(req, &status)) {
1981 0 : tevent_req_received(req);
1982 0 : return status;
1983 : }
1984 :
1985 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
1986 :
1987 0 : tevent_req_received(req);
1988 0 : return NT_STATUS_OK;
1989 : }
1990 :
1991 1262 : NTSTATUS dcerpc_DnssrvEnumRecords2_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct DnssrvEnumRecords2 *r)
1992 : {
1993 0 : NTSTATUS status;
1994 :
1995 1262 : status = dcerpc_binding_handle_call(h,
1996 : NULL, &ndr_table_dnsserver,
1997 : NDR_DNSSRVENUMRECORDS2, mem_ctx, r);
1998 :
1999 1262 : return status;
2000 : }
2001 :
2002 : struct dcerpc_DnssrvEnumRecords2_state {
2003 : struct DnssrvEnumRecords2 orig;
2004 : struct DnssrvEnumRecords2 tmp;
2005 : TALLOC_CTX *out_mem_ctx;
2006 : };
2007 :
2008 : static void dcerpc_DnssrvEnumRecords2_done(struct tevent_req *subreq);
2009 :
2010 0 : struct tevent_req *dcerpc_DnssrvEnumRecords2_send(TALLOC_CTX *mem_ctx,
2011 : struct tevent_context *ev,
2012 : struct dcerpc_binding_handle *h,
2013 : enum DNS_RPC_CLIENT_VERSION _dwClientVersion /* [in] */,
2014 : uint32_t _dwSettingFlags /* [in] */,
2015 : const char *_pwszServerName /* [in] [charset(UTF16),unique] */,
2016 : const char *_pszZone /* [in] [charset(UTF8),unique] */,
2017 : const char *_pszNodeName /* [in] [charset(UTF8),unique] */,
2018 : const char *_pszStartChild /* [in] [charset(UTF8),unique] */,
2019 : enum dns_record_type _wRecordType /* [in] */,
2020 : uint32_t _fSelectFlag /* [in] */,
2021 : const char *_pszFilterStart /* [in] [charset(UTF8),unique] */,
2022 : const char *_pszFilterStop /* [in] [charset(UTF8),unique] */,
2023 : uint32_t *_pdwBufferLength /* [out] [ref] */,
2024 : struct DNS_RPC_RECORDS_ARRAY **_pBuffer /* [out] [ref,subcontext(4),subcontext_size(*pdwBufferLength)] */)
2025 : {
2026 0 : struct tevent_req *req;
2027 0 : struct dcerpc_DnssrvEnumRecords2_state *state;
2028 0 : struct tevent_req *subreq;
2029 :
2030 0 : req = tevent_req_create(mem_ctx, &state,
2031 : struct dcerpc_DnssrvEnumRecords2_state);
2032 0 : if (req == NULL) {
2033 0 : return NULL;
2034 : }
2035 0 : state->out_mem_ctx = NULL;
2036 :
2037 : /* In parameters */
2038 0 : state->orig.in.dwClientVersion = _dwClientVersion;
2039 0 : state->orig.in.dwSettingFlags = _dwSettingFlags;
2040 0 : state->orig.in.pwszServerName = _pwszServerName;
2041 0 : state->orig.in.pszZone = _pszZone;
2042 0 : state->orig.in.pszNodeName = _pszNodeName;
2043 0 : state->orig.in.pszStartChild = _pszStartChild;
2044 0 : state->orig.in.wRecordType = _wRecordType;
2045 0 : state->orig.in.fSelectFlag = _fSelectFlag;
2046 0 : state->orig.in.pszFilterStart = _pszFilterStart;
2047 0 : state->orig.in.pszFilterStop = _pszFilterStop;
2048 :
2049 : /* Out parameters */
2050 0 : state->orig.out.pdwBufferLength = _pdwBufferLength;
2051 0 : state->orig.out.pBuffer = _pBuffer;
2052 :
2053 : /* Result */
2054 0 : NDR_ZERO_STRUCT(state->orig.out.result);
2055 :
2056 0 : state->out_mem_ctx = talloc_named_const(state, 0,
2057 : "dcerpc_DnssrvEnumRecords2_out_memory");
2058 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
2059 0 : return tevent_req_post(req, ev);
2060 : }
2061 :
2062 : /* make a temporary copy, that we pass to the dispatch function */
2063 0 : state->tmp = state->orig;
2064 :
2065 0 : subreq = dcerpc_DnssrvEnumRecords2_r_send(state, ev, h, &state->tmp);
2066 0 : if (tevent_req_nomem(subreq, req)) {
2067 0 : return tevent_req_post(req, ev);
2068 : }
2069 0 : tevent_req_set_callback(subreq, dcerpc_DnssrvEnumRecords2_done, req);
2070 0 : return req;
2071 : }
2072 :
2073 0 : static void dcerpc_DnssrvEnumRecords2_done(struct tevent_req *subreq)
2074 : {
2075 0 : struct tevent_req *req = tevent_req_callback_data(
2076 : subreq, struct tevent_req);
2077 0 : struct dcerpc_DnssrvEnumRecords2_state *state = tevent_req_data(
2078 : req, struct dcerpc_DnssrvEnumRecords2_state);
2079 0 : NTSTATUS status;
2080 0 : TALLOC_CTX *mem_ctx;
2081 :
2082 0 : if (state->out_mem_ctx) {
2083 0 : mem_ctx = state->out_mem_ctx;
2084 : } else {
2085 0 : mem_ctx = state;
2086 : }
2087 :
2088 0 : status = dcerpc_DnssrvEnumRecords2_r_recv(subreq, mem_ctx);
2089 0 : TALLOC_FREE(subreq);
2090 0 : if (tevent_req_nterror(req, status)) {
2091 0 : return;
2092 : }
2093 :
2094 : /* Copy out parameters */
2095 0 : *state->orig.out.pdwBufferLength = *state->tmp.out.pdwBufferLength;
2096 0 : *state->orig.out.pBuffer = *state->tmp.out.pBuffer;
2097 :
2098 : /* Copy result */
2099 0 : state->orig.out.result = state->tmp.out.result;
2100 :
2101 : /* Reset temporary structure */
2102 0 : NDR_ZERO_STRUCT(state->tmp);
2103 :
2104 0 : tevent_req_done(req);
2105 : }
2106 :
2107 0 : NTSTATUS dcerpc_DnssrvEnumRecords2_recv(struct tevent_req *req,
2108 : TALLOC_CTX *mem_ctx,
2109 : WERROR *result)
2110 : {
2111 0 : struct dcerpc_DnssrvEnumRecords2_state *state = tevent_req_data(
2112 : req, struct dcerpc_DnssrvEnumRecords2_state);
2113 0 : NTSTATUS status;
2114 :
2115 0 : if (tevent_req_is_nterror(req, &status)) {
2116 0 : tevent_req_received(req);
2117 0 : return status;
2118 : }
2119 :
2120 : /* Steal possible out parameters to the callers context */
2121 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
2122 :
2123 : /* Return result */
2124 0 : *result = state->orig.out.result;
2125 :
2126 0 : tevent_req_received(req);
2127 0 : return NT_STATUS_OK;
2128 : }
2129 :
2130 0 : NTSTATUS dcerpc_DnssrvEnumRecords2(struct dcerpc_binding_handle *h,
2131 : TALLOC_CTX *mem_ctx,
2132 : enum DNS_RPC_CLIENT_VERSION _dwClientVersion /* [in] */,
2133 : uint32_t _dwSettingFlags /* [in] */,
2134 : const char *_pwszServerName /* [in] [charset(UTF16),unique] */,
2135 : const char *_pszZone /* [in] [charset(UTF8),unique] */,
2136 : const char *_pszNodeName /* [in] [charset(UTF8),unique] */,
2137 : const char *_pszStartChild /* [in] [charset(UTF8),unique] */,
2138 : enum dns_record_type _wRecordType /* [in] */,
2139 : uint32_t _fSelectFlag /* [in] */,
2140 : const char *_pszFilterStart /* [in] [charset(UTF8),unique] */,
2141 : const char *_pszFilterStop /* [in] [charset(UTF8),unique] */,
2142 : uint32_t *_pdwBufferLength /* [out] [ref] */,
2143 : struct DNS_RPC_RECORDS_ARRAY **_pBuffer /* [out] [ref,subcontext(4),subcontext_size(*pdwBufferLength)] */,
2144 : WERROR *result)
2145 : {
2146 0 : struct DnssrvEnumRecords2 r;
2147 0 : NTSTATUS status;
2148 :
2149 : /* In parameters */
2150 0 : r.in.dwClientVersion = _dwClientVersion;
2151 0 : r.in.dwSettingFlags = _dwSettingFlags;
2152 0 : r.in.pwszServerName = _pwszServerName;
2153 0 : r.in.pszZone = _pszZone;
2154 0 : r.in.pszNodeName = _pszNodeName;
2155 0 : r.in.pszStartChild = _pszStartChild;
2156 0 : r.in.wRecordType = _wRecordType;
2157 0 : r.in.fSelectFlag = _fSelectFlag;
2158 0 : r.in.pszFilterStart = _pszFilterStart;
2159 0 : r.in.pszFilterStop = _pszFilterStop;
2160 :
2161 : /* Out parameters */
2162 0 : r.out.pdwBufferLength = _pdwBufferLength;
2163 0 : r.out.pBuffer = _pBuffer;
2164 :
2165 : /* Result */
2166 0 : NDR_ZERO_STRUCT(r.out.result);
2167 :
2168 0 : status = dcerpc_DnssrvEnumRecords2_r(h, mem_ctx, &r);
2169 0 : if (!NT_STATUS_IS_OK(status)) {
2170 0 : return status;
2171 : }
2172 :
2173 : /* Return variables */
2174 0 : *_pdwBufferLength = *r.out.pdwBufferLength;
2175 0 : *_pBuffer = *r.out.pBuffer;
2176 :
2177 : /* Return result */
2178 0 : *result = r.out.result;
2179 :
2180 0 : return NT_STATUS_OK;
2181 : }
2182 :
2183 : struct dcerpc_DnssrvUpdateRecord2_r_state {
2184 : TALLOC_CTX *out_mem_ctx;
2185 : };
2186 :
2187 : static void dcerpc_DnssrvUpdateRecord2_r_done(struct tevent_req *subreq);
2188 :
2189 0 : struct tevent_req *dcerpc_DnssrvUpdateRecord2_r_send(TALLOC_CTX *mem_ctx,
2190 : struct tevent_context *ev,
2191 : struct dcerpc_binding_handle *h,
2192 : struct DnssrvUpdateRecord2 *r)
2193 : {
2194 0 : struct tevent_req *req;
2195 0 : struct dcerpc_DnssrvUpdateRecord2_r_state *state;
2196 0 : struct tevent_req *subreq;
2197 :
2198 0 : req = tevent_req_create(mem_ctx, &state,
2199 : struct dcerpc_DnssrvUpdateRecord2_r_state);
2200 0 : if (req == NULL) {
2201 0 : return NULL;
2202 : }
2203 :
2204 0 : state->out_mem_ctx = NULL;
2205 :
2206 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
2207 : NULL, &ndr_table_dnsserver,
2208 : NDR_DNSSRVUPDATERECORD2, state, r);
2209 0 : if (tevent_req_nomem(subreq, req)) {
2210 0 : return tevent_req_post(req, ev);
2211 : }
2212 0 : tevent_req_set_callback(subreq, dcerpc_DnssrvUpdateRecord2_r_done, req);
2213 :
2214 0 : return req;
2215 : }
2216 :
2217 0 : static void dcerpc_DnssrvUpdateRecord2_r_done(struct tevent_req *subreq)
2218 : {
2219 0 : struct tevent_req *req =
2220 0 : tevent_req_callback_data(subreq,
2221 : struct tevent_req);
2222 0 : NTSTATUS status;
2223 :
2224 0 : status = dcerpc_binding_handle_call_recv(subreq);
2225 0 : TALLOC_FREE(subreq);
2226 0 : if (tevent_req_nterror(req, status)) {
2227 0 : return;
2228 : }
2229 :
2230 0 : tevent_req_done(req);
2231 : }
2232 :
2233 0 : NTSTATUS dcerpc_DnssrvUpdateRecord2_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2234 : {
2235 0 : struct dcerpc_DnssrvUpdateRecord2_r_state *state =
2236 0 : tevent_req_data(req,
2237 : struct dcerpc_DnssrvUpdateRecord2_r_state);
2238 0 : NTSTATUS status;
2239 :
2240 0 : if (tevent_req_is_nterror(req, &status)) {
2241 0 : tevent_req_received(req);
2242 0 : return status;
2243 : }
2244 :
2245 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
2246 :
2247 0 : tevent_req_received(req);
2248 0 : return NT_STATUS_OK;
2249 : }
2250 :
2251 4083 : NTSTATUS dcerpc_DnssrvUpdateRecord2_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct DnssrvUpdateRecord2 *r)
2252 : {
2253 0 : NTSTATUS status;
2254 :
2255 4083 : status = dcerpc_binding_handle_call(h,
2256 : NULL, &ndr_table_dnsserver,
2257 : NDR_DNSSRVUPDATERECORD2, mem_ctx, r);
2258 :
2259 4083 : return status;
2260 : }
2261 :
2262 : struct dcerpc_DnssrvUpdateRecord2_state {
2263 : struct DnssrvUpdateRecord2 orig;
2264 : struct DnssrvUpdateRecord2 tmp;
2265 : TALLOC_CTX *out_mem_ctx;
2266 : };
2267 :
2268 : static void dcerpc_DnssrvUpdateRecord2_done(struct tevent_req *subreq);
2269 :
2270 0 : struct tevent_req *dcerpc_DnssrvUpdateRecord2_send(TALLOC_CTX *mem_ctx,
2271 : struct tevent_context *ev,
2272 : struct dcerpc_binding_handle *h,
2273 : enum DNS_RPC_CLIENT_VERSION _dwClientVersion /* [in] */,
2274 : uint32_t _dwSettingFlags /* [in] */,
2275 : const char *_pwszServerName /* [in] [charset(UTF16),unique] */,
2276 : const char *_pszZone /* [in] [charset(UTF8),unique] */,
2277 : const char *_pszNodeName /* [in] [charset(UTF8),ref] */,
2278 : struct DNS_RPC_RECORD_BUF *_pAddRecord /* [in] [unique] */,
2279 : struct DNS_RPC_RECORD_BUF *_pDeleteRecord /* [in] [unique] */)
2280 : {
2281 0 : struct tevent_req *req;
2282 0 : struct dcerpc_DnssrvUpdateRecord2_state *state;
2283 0 : struct tevent_req *subreq;
2284 :
2285 0 : req = tevent_req_create(mem_ctx, &state,
2286 : struct dcerpc_DnssrvUpdateRecord2_state);
2287 0 : if (req == NULL) {
2288 0 : return NULL;
2289 : }
2290 0 : state->out_mem_ctx = NULL;
2291 :
2292 : /* In parameters */
2293 0 : state->orig.in.dwClientVersion = _dwClientVersion;
2294 0 : state->orig.in.dwSettingFlags = _dwSettingFlags;
2295 0 : state->orig.in.pwszServerName = _pwszServerName;
2296 0 : state->orig.in.pszZone = _pszZone;
2297 0 : state->orig.in.pszNodeName = _pszNodeName;
2298 0 : state->orig.in.pAddRecord = _pAddRecord;
2299 0 : state->orig.in.pDeleteRecord = _pDeleteRecord;
2300 :
2301 : /* Out parameters */
2302 :
2303 : /* Result */
2304 0 : NDR_ZERO_STRUCT(state->orig.out.result);
2305 :
2306 : /* make a temporary copy, that we pass to the dispatch function */
2307 0 : state->tmp = state->orig;
2308 :
2309 0 : subreq = dcerpc_DnssrvUpdateRecord2_r_send(state, ev, h, &state->tmp);
2310 0 : if (tevent_req_nomem(subreq, req)) {
2311 0 : return tevent_req_post(req, ev);
2312 : }
2313 0 : tevent_req_set_callback(subreq, dcerpc_DnssrvUpdateRecord2_done, req);
2314 0 : return req;
2315 : }
2316 :
2317 0 : static void dcerpc_DnssrvUpdateRecord2_done(struct tevent_req *subreq)
2318 : {
2319 0 : struct tevent_req *req = tevent_req_callback_data(
2320 : subreq, struct tevent_req);
2321 0 : struct dcerpc_DnssrvUpdateRecord2_state *state = tevent_req_data(
2322 : req, struct dcerpc_DnssrvUpdateRecord2_state);
2323 0 : NTSTATUS status;
2324 0 : TALLOC_CTX *mem_ctx;
2325 :
2326 0 : if (state->out_mem_ctx) {
2327 0 : mem_ctx = state->out_mem_ctx;
2328 : } else {
2329 0 : mem_ctx = state;
2330 : }
2331 :
2332 0 : status = dcerpc_DnssrvUpdateRecord2_r_recv(subreq, mem_ctx);
2333 0 : TALLOC_FREE(subreq);
2334 0 : if (tevent_req_nterror(req, status)) {
2335 0 : return;
2336 : }
2337 :
2338 : /* Copy out parameters */
2339 :
2340 : /* Copy result */
2341 0 : state->orig.out.result = state->tmp.out.result;
2342 :
2343 : /* Reset temporary structure */
2344 0 : NDR_ZERO_STRUCT(state->tmp);
2345 :
2346 0 : tevent_req_done(req);
2347 : }
2348 :
2349 0 : NTSTATUS dcerpc_DnssrvUpdateRecord2_recv(struct tevent_req *req,
2350 : TALLOC_CTX *mem_ctx,
2351 : WERROR *result)
2352 : {
2353 0 : struct dcerpc_DnssrvUpdateRecord2_state *state = tevent_req_data(
2354 : req, struct dcerpc_DnssrvUpdateRecord2_state);
2355 0 : NTSTATUS status;
2356 :
2357 0 : if (tevent_req_is_nterror(req, &status)) {
2358 0 : tevent_req_received(req);
2359 0 : return status;
2360 : }
2361 :
2362 : /* Steal possible out parameters to the callers context */
2363 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
2364 :
2365 : /* Return result */
2366 0 : *result = state->orig.out.result;
2367 :
2368 0 : tevent_req_received(req);
2369 0 : return NT_STATUS_OK;
2370 : }
2371 :
2372 0 : NTSTATUS dcerpc_DnssrvUpdateRecord2(struct dcerpc_binding_handle *h,
2373 : TALLOC_CTX *mem_ctx,
2374 : enum DNS_RPC_CLIENT_VERSION _dwClientVersion /* [in] */,
2375 : uint32_t _dwSettingFlags /* [in] */,
2376 : const char *_pwszServerName /* [in] [charset(UTF16),unique] */,
2377 : const char *_pszZone /* [in] [charset(UTF8),unique] */,
2378 : const char *_pszNodeName /* [in] [charset(UTF8),ref] */,
2379 : struct DNS_RPC_RECORD_BUF *_pAddRecord /* [in] [unique] */,
2380 : struct DNS_RPC_RECORD_BUF *_pDeleteRecord /* [in] [unique] */,
2381 : WERROR *result)
2382 : {
2383 0 : struct DnssrvUpdateRecord2 r;
2384 0 : NTSTATUS status;
2385 :
2386 : /* In parameters */
2387 0 : r.in.dwClientVersion = _dwClientVersion;
2388 0 : r.in.dwSettingFlags = _dwSettingFlags;
2389 0 : r.in.pwszServerName = _pwszServerName;
2390 0 : r.in.pszZone = _pszZone;
2391 0 : r.in.pszNodeName = _pszNodeName;
2392 0 : r.in.pAddRecord = _pAddRecord;
2393 0 : r.in.pDeleteRecord = _pDeleteRecord;
2394 :
2395 : /* Out parameters */
2396 :
2397 : /* Result */
2398 0 : NDR_ZERO_STRUCT(r.out.result);
2399 :
2400 0 : status = dcerpc_DnssrvUpdateRecord2_r(h, mem_ctx, &r);
2401 0 : if (!NT_STATUS_IS_OK(status)) {
2402 0 : return status;
2403 : }
2404 :
2405 : /* Return variables */
2406 :
2407 : /* Return result */
2408 0 : *result = r.out.result;
2409 :
2410 0 : return NT_STATUS_OK;
2411 : }
2412 :
|