~ubuntu-branches/ubuntu/vivid/samba/vivid

« back to all changes in this revision

Viewing changes to source3/librpc/gen_ndr/ndr_dfs_c.c

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2011-12-21 13:18:04 UTC
  • mfrom: (0.39.21 sid)
  • Revision ID: package-import@ubuntu.com-20111221131804-xtlr39wx6njehxxr
Tags: 2:3.6.1-3ubuntu1
* Merge from Debian testing.  Remaining changes:
  + debian/patches/VERSION.patch:
    - set SAMBA_VERSION_SUFFIX to Ubuntu.
  + debian/patches/error-trans.fix-276472:
    - Add the translation of Unix Error code -ENOTSUP to NT Error Code
    - NT_STATUS_NOT_SUPPORTED to prevent the Permission denied error.
  + debian/smb.conf:
    - add "(Samba, Ubuntu)" to server string.
    - comment out the default [homes] share, and add a comment about
      "valid users = %S" to show users how to restrict access to
      \\server\username to only username.
    - Set 'usershare allow guests', so that usershare admins are 
      allowed to create public shares in addition to authenticated
      ones.
    - add map to guest = Bad user, maps bad username to guest access.
  + debian/samba-common.config:
    - Do not change priority to high if dhclient3 is installed.
    - Use priority medium instead of high for the workgroup question.
  + debian/control:
    - Don't build against or suggest ctdb.
    - Add dependency on samba-common-bin to samba.
  + Add ufw integration:
    - Created debian/samba.ufw.profile
    - debian/rules, debian/samba.dirs, debian/samba.files: install
      profile
    - debian/control: have samba suggest ufw
  + Add apport hook:
    - Created debian/source_samba.py.
    - debian/rules, debian/samba.dirs, debian/samba-common-bin.files: install
  + Switch to upstart:
    - Add debian/samba.{nmbd,smbd}.upstart.
  + debian/samba.logrotate, debian/samba-common.dhcp, debian/samba.if-up:
    - Make them upstart compatible
  + debian/samba.postinst: 
    - Avoid scary pdbedit warnings on first import.
  + debian/samba-common.postinst: Add more informative error message for
    the case where smb.conf was manually deleted
  + debian/patches/fix-debuglevel-name-conflict.patch: don't use 'debug_level'
    as a global variable name in an NSS module 
  + Dropped:
    - debian/patches/error-trans.fix-276472
    - debian/patches/fix-debuglevel-name-conflict.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 "librpc/gen_ndr/ndr_dfs.h"
 
7
#include "librpc/gen_ndr/ndr_dfs_c.h"
 
8
 
 
9
/* netdfs - client functions generated by pidl */
 
10
 
 
11
struct dcerpc_dfs_GetManagerVersion_r_state {
 
12
        TALLOC_CTX *out_mem_ctx;
 
13
};
 
14
 
 
15
static void dcerpc_dfs_GetManagerVersion_r_done(struct tevent_req *subreq);
 
16
 
 
17
struct tevent_req *dcerpc_dfs_GetManagerVersion_r_send(TALLOC_CTX *mem_ctx,
 
18
        struct tevent_context *ev,
 
19
        struct dcerpc_binding_handle *h,
 
20
        struct dfs_GetManagerVersion *r)
 
21
{
 
22
        struct tevent_req *req;
 
23
        struct dcerpc_dfs_GetManagerVersion_r_state *state;
 
24
        struct tevent_req *subreq;
 
25
 
 
26
        req = tevent_req_create(mem_ctx, &state,
 
27
                                struct dcerpc_dfs_GetManagerVersion_r_state);
 
28
        if (req == NULL) {
 
29
                return NULL;
 
30
        }
 
31
 
 
32
        state->out_mem_ctx = talloc_new(state);
 
33
        if (tevent_req_nomem(state->out_mem_ctx, req)) {
 
34
                return tevent_req_post(req, ev);
 
35
        }
 
36
 
 
37
        subreq = dcerpc_binding_handle_call_send(state, ev, h,
 
38
                        NULL, &ndr_table_netdfs,
 
39
                        NDR_DFS_GETMANAGERVERSION, state->out_mem_ctx, r);
 
40
        if (tevent_req_nomem(subreq, req)) {
 
41
                return tevent_req_post(req, ev);
 
42
        }
 
43
        tevent_req_set_callback(subreq, dcerpc_dfs_GetManagerVersion_r_done, req);
 
44
 
 
45
        return req;
 
46
}
 
47
 
 
48
static void dcerpc_dfs_GetManagerVersion_r_done(struct tevent_req *subreq)
 
49
{
 
50
        struct tevent_req *req =
 
51
                tevent_req_callback_data(subreq,
 
52
                struct tevent_req);
 
53
        NTSTATUS status;
 
54
 
 
55
        status = dcerpc_binding_handle_call_recv(subreq);
 
56
        if (!NT_STATUS_IS_OK(status)) {
 
57
                tevent_req_nterror(req, status);
 
58
                return;
 
59
        }
 
60
 
 
61
        tevent_req_done(req);
 
62
}
 
63
 
 
64
NTSTATUS dcerpc_dfs_GetManagerVersion_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
 
65
{
 
66
        struct dcerpc_dfs_GetManagerVersion_r_state *state =
 
67
                tevent_req_data(req,
 
68
                struct dcerpc_dfs_GetManagerVersion_r_state);
 
69
        NTSTATUS status;
 
70
 
 
71
        if (tevent_req_is_nterror(req, &status)) {
 
72
                tevent_req_received(req);
 
73
                return status;
 
74
        }
 
75
 
 
76
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
77
 
 
78
        tevent_req_received(req);
 
79
        return NT_STATUS_OK;
 
80
}
 
81
 
 
82
NTSTATUS dcerpc_dfs_GetManagerVersion_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_GetManagerVersion *r)
 
83
{
 
84
        NTSTATUS status;
 
85
 
 
86
        status = dcerpc_binding_handle_call(h,
 
87
                        NULL, &ndr_table_netdfs,
 
88
                        NDR_DFS_GETMANAGERVERSION, mem_ctx, r);
 
89
 
 
90
        return status;
 
91
}
 
92
 
 
93
struct dcerpc_dfs_GetManagerVersion_state {
 
94
        struct dfs_GetManagerVersion orig;
 
95
        struct dfs_GetManagerVersion tmp;
 
96
        TALLOC_CTX *out_mem_ctx;
 
97
};
 
98
 
 
99
static void dcerpc_dfs_GetManagerVersion_done(struct tevent_req *subreq);
 
100
 
 
101
struct tevent_req *dcerpc_dfs_GetManagerVersion_send(TALLOC_CTX *mem_ctx,
 
102
                                                     struct tevent_context *ev,
 
103
                                                     struct dcerpc_binding_handle *h,
 
104
                                                     enum dfs_ManagerVersion *_version /* [out] [ref] */)
 
105
{
 
106
        struct tevent_req *req;
 
107
        struct dcerpc_dfs_GetManagerVersion_state *state;
 
108
        struct tevent_req *subreq;
 
109
 
 
110
        req = tevent_req_create(mem_ctx, &state,
 
111
                                struct dcerpc_dfs_GetManagerVersion_state);
 
112
        if (req == NULL) {
 
113
                return NULL;
 
114
        }
 
115
        state->out_mem_ctx = NULL;
 
116
 
 
117
        /* In parameters */
 
118
 
 
119
        /* Out parameters */
 
120
        state->orig.out.version = _version;
 
121
 
 
122
        state->out_mem_ctx = talloc_named_const(state, 0,
 
123
                             "dcerpc_dfs_GetManagerVersion_out_memory");
 
124
        if (tevent_req_nomem(state->out_mem_ctx, req)) {
 
125
                return tevent_req_post(req, ev);
 
126
        }
 
127
 
 
128
        /* make a temporary copy, that we pass to the dispatch function */
 
129
        state->tmp = state->orig;
 
130
 
 
131
        subreq = dcerpc_dfs_GetManagerVersion_r_send(state, ev, h, &state->tmp);
 
132
        if (tevent_req_nomem(subreq, req)) {
 
133
                return tevent_req_post(req, ev);
 
134
        }
 
135
        tevent_req_set_callback(subreq, dcerpc_dfs_GetManagerVersion_done, req);
 
136
        return req;
 
137
}
 
138
 
 
139
static void dcerpc_dfs_GetManagerVersion_done(struct tevent_req *subreq)
 
140
{
 
141
        struct tevent_req *req = tevent_req_callback_data(
 
142
                subreq, struct tevent_req);
 
143
        struct dcerpc_dfs_GetManagerVersion_state *state = tevent_req_data(
 
144
                req, struct dcerpc_dfs_GetManagerVersion_state);
 
145
        NTSTATUS status;
 
146
        TALLOC_CTX *mem_ctx;
 
147
 
 
148
        if (state->out_mem_ctx) {
 
149
                mem_ctx = state->out_mem_ctx;
 
150
        } else {
 
151
                mem_ctx = state;
 
152
        }
 
153
 
 
154
        status = dcerpc_dfs_GetManagerVersion_r_recv(subreq, mem_ctx);
 
155
        TALLOC_FREE(subreq);
 
156
        if (!NT_STATUS_IS_OK(status)) {
 
157
                tevent_req_nterror(req, status);
 
158
                return;
 
159
        }
 
160
 
 
161
        /* Copy out parameters */
 
162
        *state->orig.out.version = *state->tmp.out.version;
 
163
 
 
164
        /* Reset temporary structure */
 
165
        ZERO_STRUCT(state->tmp);
 
166
 
 
167
        tevent_req_done(req);
 
168
}
 
169
 
 
170
NTSTATUS dcerpc_dfs_GetManagerVersion_recv(struct tevent_req *req,
 
171
                                           TALLOC_CTX *mem_ctx)
 
172
{
 
173
        struct dcerpc_dfs_GetManagerVersion_state *state = tevent_req_data(
 
174
                req, struct dcerpc_dfs_GetManagerVersion_state);
 
175
        NTSTATUS status;
 
176
 
 
177
        if (tevent_req_is_nterror(req, &status)) {
 
178
                tevent_req_received(req);
 
179
                return status;
 
180
        }
 
181
 
 
182
        /* Steal possible out parameters to the callers context */
 
183
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
184
 
 
185
        tevent_req_received(req);
 
186
        return NT_STATUS_OK;
 
187
}
 
188
 
 
189
NTSTATUS dcerpc_dfs_GetManagerVersion(struct dcerpc_binding_handle *h,
 
190
                                      TALLOC_CTX *mem_ctx,
 
191
                                      enum dfs_ManagerVersion *_version /* [out] [ref] */)
 
192
{
 
193
        struct dfs_GetManagerVersion r;
 
194
        NTSTATUS status;
 
195
 
 
196
        /* In parameters */
 
197
 
 
198
        status = dcerpc_dfs_GetManagerVersion_r(h, mem_ctx, &r);
 
199
        if (!NT_STATUS_IS_OK(status)) {
 
200
                return status;
 
201
        }
 
202
 
 
203
        /* Return variables */
 
204
        *_version = *r.out.version;
 
205
 
 
206
        /* Return result */
 
207
 
 
208
        return NT_STATUS_OK;
 
209
}
 
210
 
 
211
struct dcerpc_dfs_Add_r_state {
 
212
        TALLOC_CTX *out_mem_ctx;
 
213
};
 
214
 
 
215
static void dcerpc_dfs_Add_r_done(struct tevent_req *subreq);
 
216
 
 
217
struct tevent_req *dcerpc_dfs_Add_r_send(TALLOC_CTX *mem_ctx,
 
218
        struct tevent_context *ev,
 
219
        struct dcerpc_binding_handle *h,
 
220
        struct dfs_Add *r)
 
221
{
 
222
        struct tevent_req *req;
 
223
        struct dcerpc_dfs_Add_r_state *state;
 
224
        struct tevent_req *subreq;
 
225
 
 
226
        req = tevent_req_create(mem_ctx, &state,
 
227
                                struct dcerpc_dfs_Add_r_state);
 
228
        if (req == NULL) {
 
229
                return NULL;
 
230
        }
 
231
 
 
232
        state->out_mem_ctx = NULL;
 
233
 
 
234
        subreq = dcerpc_binding_handle_call_send(state, ev, h,
 
235
                        NULL, &ndr_table_netdfs,
 
236
                        NDR_DFS_ADD, state, r);
 
237
        if (tevent_req_nomem(subreq, req)) {
 
238
                return tevent_req_post(req, ev);
 
239
        }
 
240
        tevent_req_set_callback(subreq, dcerpc_dfs_Add_r_done, req);
 
241
 
 
242
        return req;
 
243
}
 
244
 
 
245
static void dcerpc_dfs_Add_r_done(struct tevent_req *subreq)
 
246
{
 
247
        struct tevent_req *req =
 
248
                tevent_req_callback_data(subreq,
 
249
                struct tevent_req);
 
250
        NTSTATUS status;
 
251
 
 
252
        status = dcerpc_binding_handle_call_recv(subreq);
 
253
        if (!NT_STATUS_IS_OK(status)) {
 
254
                tevent_req_nterror(req, status);
 
255
                return;
 
256
        }
 
257
 
 
258
        tevent_req_done(req);
 
259
}
 
260
 
 
261
NTSTATUS dcerpc_dfs_Add_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
 
262
{
 
263
        struct dcerpc_dfs_Add_r_state *state =
 
264
                tevent_req_data(req,
 
265
                struct dcerpc_dfs_Add_r_state);
 
266
        NTSTATUS status;
 
267
 
 
268
        if (tevent_req_is_nterror(req, &status)) {
 
269
                tevent_req_received(req);
 
270
                return status;
 
271
        }
 
272
 
 
273
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
274
 
 
275
        tevent_req_received(req);
 
276
        return NT_STATUS_OK;
 
277
}
 
278
 
 
279
NTSTATUS dcerpc_dfs_Add_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_Add *r)
 
280
{
 
281
        NTSTATUS status;
 
282
 
 
283
        status = dcerpc_binding_handle_call(h,
 
284
                        NULL, &ndr_table_netdfs,
 
285
                        NDR_DFS_ADD, mem_ctx, r);
 
286
 
 
287
        return status;
 
288
}
 
289
 
 
290
struct dcerpc_dfs_Add_state {
 
291
        struct dfs_Add orig;
 
292
        struct dfs_Add tmp;
 
293
        TALLOC_CTX *out_mem_ctx;
 
294
};
 
295
 
 
296
static void dcerpc_dfs_Add_done(struct tevent_req *subreq);
 
297
 
 
298
struct tevent_req *dcerpc_dfs_Add_send(TALLOC_CTX *mem_ctx,
 
299
                                       struct tevent_context *ev,
 
300
                                       struct dcerpc_binding_handle *h,
 
301
                                       const char *_path /* [in] [ref,charset(UTF16)] */,
 
302
                                       const char *_server /* [in] [ref,charset(UTF16)] */,
 
303
                                       const char *_share /* [in] [unique,charset(UTF16)] */,
 
304
                                       const char *_comment /* [in] [unique,charset(UTF16)] */,
 
305
                                       uint32_t _flags /* [in]  */)
 
306
{
 
307
        struct tevent_req *req;
 
308
        struct dcerpc_dfs_Add_state *state;
 
309
        struct tevent_req *subreq;
 
310
 
 
311
        req = tevent_req_create(mem_ctx, &state,
 
312
                                struct dcerpc_dfs_Add_state);
 
313
        if (req == NULL) {
 
314
                return NULL;
 
315
        }
 
316
        state->out_mem_ctx = NULL;
 
317
 
 
318
        /* In parameters */
 
319
        state->orig.in.path = _path;
 
320
        state->orig.in.server = _server;
 
321
        state->orig.in.share = _share;
 
322
        state->orig.in.comment = _comment;
 
323
        state->orig.in.flags = _flags;
 
324
 
 
325
        /* Out parameters */
 
326
 
 
327
        /* Result */
 
328
        ZERO_STRUCT(state->orig.out.result);
 
329
 
 
330
        /* make a temporary copy, that we pass to the dispatch function */
 
331
        state->tmp = state->orig;
 
332
 
 
333
        subreq = dcerpc_dfs_Add_r_send(state, ev, h, &state->tmp);
 
334
        if (tevent_req_nomem(subreq, req)) {
 
335
                return tevent_req_post(req, ev);
 
336
        }
 
337
        tevent_req_set_callback(subreq, dcerpc_dfs_Add_done, req);
 
338
        return req;
 
339
}
 
340
 
 
341
static void dcerpc_dfs_Add_done(struct tevent_req *subreq)
 
342
{
 
343
        struct tevent_req *req = tevent_req_callback_data(
 
344
                subreq, struct tevent_req);
 
345
        struct dcerpc_dfs_Add_state *state = tevent_req_data(
 
346
                req, struct dcerpc_dfs_Add_state);
 
347
        NTSTATUS status;
 
348
        TALLOC_CTX *mem_ctx;
 
349
 
 
350
        if (state->out_mem_ctx) {
 
351
                mem_ctx = state->out_mem_ctx;
 
352
        } else {
 
353
                mem_ctx = state;
 
354
        }
 
355
 
 
356
        status = dcerpc_dfs_Add_r_recv(subreq, mem_ctx);
 
357
        TALLOC_FREE(subreq);
 
358
        if (!NT_STATUS_IS_OK(status)) {
 
359
                tevent_req_nterror(req, status);
 
360
                return;
 
361
        }
 
362
 
 
363
        /* Copy out parameters */
 
364
 
 
365
        /* Copy result */
 
366
        state->orig.out.result = state->tmp.out.result;
 
367
 
 
368
        /* Reset temporary structure */
 
369
        ZERO_STRUCT(state->tmp);
 
370
 
 
371
        tevent_req_done(req);
 
372
}
 
373
 
 
374
NTSTATUS dcerpc_dfs_Add_recv(struct tevent_req *req,
 
375
                             TALLOC_CTX *mem_ctx,
 
376
                             WERROR *result)
 
377
{
 
378
        struct dcerpc_dfs_Add_state *state = tevent_req_data(
 
379
                req, struct dcerpc_dfs_Add_state);
 
380
        NTSTATUS status;
 
381
 
 
382
        if (tevent_req_is_nterror(req, &status)) {
 
383
                tevent_req_received(req);
 
384
                return status;
 
385
        }
 
386
 
 
387
        /* Steal possible out parameters to the callers context */
 
388
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
389
 
 
390
        /* Return result */
 
391
        *result = state->orig.out.result;
 
392
 
 
393
        tevent_req_received(req);
 
394
        return NT_STATUS_OK;
 
395
}
 
396
 
 
397
NTSTATUS dcerpc_dfs_Add(struct dcerpc_binding_handle *h,
 
398
                        TALLOC_CTX *mem_ctx,
 
399
                        const char *_path /* [in] [ref,charset(UTF16)] */,
 
400
                        const char *_server /* [in] [ref,charset(UTF16)] */,
 
401
                        const char *_share /* [in] [unique,charset(UTF16)] */,
 
402
                        const char *_comment /* [in] [unique,charset(UTF16)] */,
 
403
                        uint32_t _flags /* [in]  */,
 
404
                        WERROR *result)
 
405
{
 
406
        struct dfs_Add r;
 
407
        NTSTATUS status;
 
408
 
 
409
        /* In parameters */
 
410
        r.in.path = _path;
 
411
        r.in.server = _server;
 
412
        r.in.share = _share;
 
413
        r.in.comment = _comment;
 
414
        r.in.flags = _flags;
 
415
 
 
416
        status = dcerpc_dfs_Add_r(h, mem_ctx, &r);
 
417
        if (!NT_STATUS_IS_OK(status)) {
 
418
                return status;
 
419
        }
 
420
 
 
421
        /* Return variables */
 
422
 
 
423
        /* Return result */
 
424
        *result = r.out.result;
 
425
 
 
426
        return NT_STATUS_OK;
 
427
}
 
428
 
 
429
struct dcerpc_dfs_Remove_r_state {
 
430
        TALLOC_CTX *out_mem_ctx;
 
431
};
 
432
 
 
433
static void dcerpc_dfs_Remove_r_done(struct tevent_req *subreq);
 
434
 
 
435
struct tevent_req *dcerpc_dfs_Remove_r_send(TALLOC_CTX *mem_ctx,
 
436
        struct tevent_context *ev,
 
437
        struct dcerpc_binding_handle *h,
 
438
        struct dfs_Remove *r)
 
439
{
 
440
        struct tevent_req *req;
 
441
        struct dcerpc_dfs_Remove_r_state *state;
 
442
        struct tevent_req *subreq;
 
443
 
 
444
        req = tevent_req_create(mem_ctx, &state,
 
445
                                struct dcerpc_dfs_Remove_r_state);
 
446
        if (req == NULL) {
 
447
                return NULL;
 
448
        }
 
449
 
 
450
        state->out_mem_ctx = NULL;
 
451
 
 
452
        subreq = dcerpc_binding_handle_call_send(state, ev, h,
 
453
                        NULL, &ndr_table_netdfs,
 
454
                        NDR_DFS_REMOVE, state, r);
 
455
        if (tevent_req_nomem(subreq, req)) {
 
456
                return tevent_req_post(req, ev);
 
457
        }
 
458
        tevent_req_set_callback(subreq, dcerpc_dfs_Remove_r_done, req);
 
459
 
 
460
        return req;
 
461
}
 
462
 
 
463
static void dcerpc_dfs_Remove_r_done(struct tevent_req *subreq)
 
464
{
 
465
        struct tevent_req *req =
 
466
                tevent_req_callback_data(subreq,
 
467
                struct tevent_req);
 
468
        NTSTATUS status;
 
469
 
 
470
        status = dcerpc_binding_handle_call_recv(subreq);
 
471
        if (!NT_STATUS_IS_OK(status)) {
 
472
                tevent_req_nterror(req, status);
 
473
                return;
 
474
        }
 
475
 
 
476
        tevent_req_done(req);
 
477
}
 
478
 
 
479
NTSTATUS dcerpc_dfs_Remove_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
 
480
{
 
481
        struct dcerpc_dfs_Remove_r_state *state =
 
482
                tevent_req_data(req,
 
483
                struct dcerpc_dfs_Remove_r_state);
 
484
        NTSTATUS status;
 
485
 
 
486
        if (tevent_req_is_nterror(req, &status)) {
 
487
                tevent_req_received(req);
 
488
                return status;
 
489
        }
 
490
 
 
491
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
492
 
 
493
        tevent_req_received(req);
 
494
        return NT_STATUS_OK;
 
495
}
 
496
 
 
497
NTSTATUS dcerpc_dfs_Remove_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_Remove *r)
 
498
{
 
499
        NTSTATUS status;
 
500
 
 
501
        status = dcerpc_binding_handle_call(h,
 
502
                        NULL, &ndr_table_netdfs,
 
503
                        NDR_DFS_REMOVE, mem_ctx, r);
 
504
 
 
505
        return status;
 
506
}
 
507
 
 
508
struct dcerpc_dfs_Remove_state {
 
509
        struct dfs_Remove orig;
 
510
        struct dfs_Remove tmp;
 
511
        TALLOC_CTX *out_mem_ctx;
 
512
};
 
513
 
 
514
static void dcerpc_dfs_Remove_done(struct tevent_req *subreq);
 
515
 
 
516
struct tevent_req *dcerpc_dfs_Remove_send(TALLOC_CTX *mem_ctx,
 
517
                                          struct tevent_context *ev,
 
518
                                          struct dcerpc_binding_handle *h,
 
519
                                          const char *_dfs_entry_path /* [in] [ref,charset(UTF16)] */,
 
520
                                          const char *_servername /* [in] [unique,charset(UTF16)] */,
 
521
                                          const char *_sharename /* [in] [unique,charset(UTF16)] */)
 
522
{
 
523
        struct tevent_req *req;
 
524
        struct dcerpc_dfs_Remove_state *state;
 
525
        struct tevent_req *subreq;
 
526
 
 
527
        req = tevent_req_create(mem_ctx, &state,
 
528
                                struct dcerpc_dfs_Remove_state);
 
529
        if (req == NULL) {
 
530
                return NULL;
 
531
        }
 
532
        state->out_mem_ctx = NULL;
 
533
 
 
534
        /* In parameters */
 
535
        state->orig.in.dfs_entry_path = _dfs_entry_path;
 
536
        state->orig.in.servername = _servername;
 
537
        state->orig.in.sharename = _sharename;
 
538
 
 
539
        /* Out parameters */
 
540
 
 
541
        /* Result */
 
542
        ZERO_STRUCT(state->orig.out.result);
 
543
 
 
544
        /* make a temporary copy, that we pass to the dispatch function */
 
545
        state->tmp = state->orig;
 
546
 
 
547
        subreq = dcerpc_dfs_Remove_r_send(state, ev, h, &state->tmp);
 
548
        if (tevent_req_nomem(subreq, req)) {
 
549
                return tevent_req_post(req, ev);
 
550
        }
 
551
        tevent_req_set_callback(subreq, dcerpc_dfs_Remove_done, req);
 
552
        return req;
 
553
}
 
554
 
 
555
static void dcerpc_dfs_Remove_done(struct tevent_req *subreq)
 
556
{
 
557
        struct tevent_req *req = tevent_req_callback_data(
 
558
                subreq, struct tevent_req);
 
559
        struct dcerpc_dfs_Remove_state *state = tevent_req_data(
 
560
                req, struct dcerpc_dfs_Remove_state);
 
561
        NTSTATUS status;
 
562
        TALLOC_CTX *mem_ctx;
 
563
 
 
564
        if (state->out_mem_ctx) {
 
565
                mem_ctx = state->out_mem_ctx;
 
566
        } else {
 
567
                mem_ctx = state;
 
568
        }
 
569
 
 
570
        status = dcerpc_dfs_Remove_r_recv(subreq, mem_ctx);
 
571
        TALLOC_FREE(subreq);
 
572
        if (!NT_STATUS_IS_OK(status)) {
 
573
                tevent_req_nterror(req, status);
 
574
                return;
 
575
        }
 
576
 
 
577
        /* Copy out parameters */
 
578
 
 
579
        /* Copy result */
 
580
        state->orig.out.result = state->tmp.out.result;
 
581
 
 
582
        /* Reset temporary structure */
 
583
        ZERO_STRUCT(state->tmp);
 
584
 
 
585
        tevent_req_done(req);
 
586
}
 
587
 
 
588
NTSTATUS dcerpc_dfs_Remove_recv(struct tevent_req *req,
 
589
                                TALLOC_CTX *mem_ctx,
 
590
                                WERROR *result)
 
591
{
 
592
        struct dcerpc_dfs_Remove_state *state = tevent_req_data(
 
593
                req, struct dcerpc_dfs_Remove_state);
 
594
        NTSTATUS status;
 
595
 
 
596
        if (tevent_req_is_nterror(req, &status)) {
 
597
                tevent_req_received(req);
 
598
                return status;
 
599
        }
 
600
 
 
601
        /* Steal possible out parameters to the callers context */
 
602
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
603
 
 
604
        /* Return result */
 
605
        *result = state->orig.out.result;
 
606
 
 
607
        tevent_req_received(req);
 
608
        return NT_STATUS_OK;
 
609
}
 
610
 
 
611
NTSTATUS dcerpc_dfs_Remove(struct dcerpc_binding_handle *h,
 
612
                           TALLOC_CTX *mem_ctx,
 
613
                           const char *_dfs_entry_path /* [in] [ref,charset(UTF16)] */,
 
614
                           const char *_servername /* [in] [unique,charset(UTF16)] */,
 
615
                           const char *_sharename /* [in] [unique,charset(UTF16)] */,
 
616
                           WERROR *result)
 
617
{
 
618
        struct dfs_Remove r;
 
619
        NTSTATUS status;
 
620
 
 
621
        /* In parameters */
 
622
        r.in.dfs_entry_path = _dfs_entry_path;
 
623
        r.in.servername = _servername;
 
624
        r.in.sharename = _sharename;
 
625
 
 
626
        status = dcerpc_dfs_Remove_r(h, mem_ctx, &r);
 
627
        if (!NT_STATUS_IS_OK(status)) {
 
628
                return status;
 
629
        }
 
630
 
 
631
        /* Return variables */
 
632
 
 
633
        /* Return result */
 
634
        *result = r.out.result;
 
635
 
 
636
        return NT_STATUS_OK;
 
637
}
 
638
 
 
639
struct dcerpc_dfs_SetInfo_r_state {
 
640
        TALLOC_CTX *out_mem_ctx;
 
641
};
 
642
 
 
643
static void dcerpc_dfs_SetInfo_r_done(struct tevent_req *subreq);
 
644
 
 
645
struct tevent_req *dcerpc_dfs_SetInfo_r_send(TALLOC_CTX *mem_ctx,
 
646
        struct tevent_context *ev,
 
647
        struct dcerpc_binding_handle *h,
 
648
        struct dfs_SetInfo *r)
 
649
{
 
650
        struct tevent_req *req;
 
651
        struct dcerpc_dfs_SetInfo_r_state *state;
 
652
        struct tevent_req *subreq;
 
653
 
 
654
        req = tevent_req_create(mem_ctx, &state,
 
655
                                struct dcerpc_dfs_SetInfo_r_state);
 
656
        if (req == NULL) {
 
657
                return NULL;
 
658
        }
 
659
 
 
660
        state->out_mem_ctx = NULL;
 
661
 
 
662
        subreq = dcerpc_binding_handle_call_send(state, ev, h,
 
663
                        NULL, &ndr_table_netdfs,
 
664
                        NDR_DFS_SETINFO, state, r);
 
665
        if (tevent_req_nomem(subreq, req)) {
 
666
                return tevent_req_post(req, ev);
 
667
        }
 
668
        tevent_req_set_callback(subreq, dcerpc_dfs_SetInfo_r_done, req);
 
669
 
 
670
        return req;
 
671
}
 
672
 
 
673
static void dcerpc_dfs_SetInfo_r_done(struct tevent_req *subreq)
 
674
{
 
675
        struct tevent_req *req =
 
676
                tevent_req_callback_data(subreq,
 
677
                struct tevent_req);
 
678
        NTSTATUS status;
 
679
 
 
680
        status = dcerpc_binding_handle_call_recv(subreq);
 
681
        if (!NT_STATUS_IS_OK(status)) {
 
682
                tevent_req_nterror(req, status);
 
683
                return;
 
684
        }
 
685
 
 
686
        tevent_req_done(req);
 
687
}
 
688
 
 
689
NTSTATUS dcerpc_dfs_SetInfo_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
 
690
{
 
691
        struct dcerpc_dfs_SetInfo_r_state *state =
 
692
                tevent_req_data(req,
 
693
                struct dcerpc_dfs_SetInfo_r_state);
 
694
        NTSTATUS status;
 
695
 
 
696
        if (tevent_req_is_nterror(req, &status)) {
 
697
                tevent_req_received(req);
 
698
                return status;
 
699
        }
 
700
 
 
701
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
702
 
 
703
        tevent_req_received(req);
 
704
        return NT_STATUS_OK;
 
705
}
 
706
 
 
707
NTSTATUS dcerpc_dfs_SetInfo_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_SetInfo *r)
 
708
{
 
709
        NTSTATUS status;
 
710
 
 
711
        status = dcerpc_binding_handle_call(h,
 
712
                        NULL, &ndr_table_netdfs,
 
713
                        NDR_DFS_SETINFO, mem_ctx, r);
 
714
 
 
715
        return status;
 
716
}
 
717
 
 
718
struct dcerpc_dfs_SetInfo_state {
 
719
        struct dfs_SetInfo orig;
 
720
        struct dfs_SetInfo tmp;
 
721
        TALLOC_CTX *out_mem_ctx;
 
722
};
 
723
 
 
724
static void dcerpc_dfs_SetInfo_done(struct tevent_req *subreq);
 
725
 
 
726
struct tevent_req *dcerpc_dfs_SetInfo_send(TALLOC_CTX *mem_ctx,
 
727
                                           struct tevent_context *ev,
 
728
                                           struct dcerpc_binding_handle *h,
 
729
                                           const char *_dfs_entry_path /* [in] [charset(UTF16)] */,
 
730
                                           const char *_servername /* [in] [unique,charset(UTF16)] */,
 
731
                                           const char *_sharename /* [in] [unique,charset(UTF16)] */,
 
732
                                           uint32_t _level /* [in]  */,
 
733
                                           union dfs_Info *_info /* [in] [ref,switch_is(level)] */)
 
734
{
 
735
        struct tevent_req *req;
 
736
        struct dcerpc_dfs_SetInfo_state *state;
 
737
        struct tevent_req *subreq;
 
738
 
 
739
        req = tevent_req_create(mem_ctx, &state,
 
740
                                struct dcerpc_dfs_SetInfo_state);
 
741
        if (req == NULL) {
 
742
                return NULL;
 
743
        }
 
744
        state->out_mem_ctx = NULL;
 
745
 
 
746
        /* In parameters */
 
747
        state->orig.in.dfs_entry_path = _dfs_entry_path;
 
748
        state->orig.in.servername = _servername;
 
749
        state->orig.in.sharename = _sharename;
 
750
        state->orig.in.level = _level;
 
751
        state->orig.in.info = _info;
 
752
 
 
753
        /* Out parameters */
 
754
 
 
755
        /* Result */
 
756
        ZERO_STRUCT(state->orig.out.result);
 
757
 
 
758
        /* make a temporary copy, that we pass to the dispatch function */
 
759
        state->tmp = state->orig;
 
760
 
 
761
        subreq = dcerpc_dfs_SetInfo_r_send(state, ev, h, &state->tmp);
 
762
        if (tevent_req_nomem(subreq, req)) {
 
763
                return tevent_req_post(req, ev);
 
764
        }
 
765
        tevent_req_set_callback(subreq, dcerpc_dfs_SetInfo_done, req);
 
766
        return req;
 
767
}
 
768
 
 
769
static void dcerpc_dfs_SetInfo_done(struct tevent_req *subreq)
 
770
{
 
771
        struct tevent_req *req = tevent_req_callback_data(
 
772
                subreq, struct tevent_req);
 
773
        struct dcerpc_dfs_SetInfo_state *state = tevent_req_data(
 
774
                req, struct dcerpc_dfs_SetInfo_state);
 
775
        NTSTATUS status;
 
776
        TALLOC_CTX *mem_ctx;
 
777
 
 
778
        if (state->out_mem_ctx) {
 
779
                mem_ctx = state->out_mem_ctx;
 
780
        } else {
 
781
                mem_ctx = state;
 
782
        }
 
783
 
 
784
        status = dcerpc_dfs_SetInfo_r_recv(subreq, mem_ctx);
 
785
        TALLOC_FREE(subreq);
 
786
        if (!NT_STATUS_IS_OK(status)) {
 
787
                tevent_req_nterror(req, status);
 
788
                return;
 
789
        }
 
790
 
 
791
        /* Copy out parameters */
 
792
 
 
793
        /* Copy result */
 
794
        state->orig.out.result = state->tmp.out.result;
 
795
 
 
796
        /* Reset temporary structure */
 
797
        ZERO_STRUCT(state->tmp);
 
798
 
 
799
        tevent_req_done(req);
 
800
}
 
801
 
 
802
NTSTATUS dcerpc_dfs_SetInfo_recv(struct tevent_req *req,
 
803
                                 TALLOC_CTX *mem_ctx,
 
804
                                 WERROR *result)
 
805
{
 
806
        struct dcerpc_dfs_SetInfo_state *state = tevent_req_data(
 
807
                req, struct dcerpc_dfs_SetInfo_state);
 
808
        NTSTATUS status;
 
809
 
 
810
        if (tevent_req_is_nterror(req, &status)) {
 
811
                tevent_req_received(req);
 
812
                return status;
 
813
        }
 
814
 
 
815
        /* Steal possible out parameters to the callers context */
 
816
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
817
 
 
818
        /* Return result */
 
819
        *result = state->orig.out.result;
 
820
 
 
821
        tevent_req_received(req);
 
822
        return NT_STATUS_OK;
 
823
}
 
824
 
 
825
NTSTATUS dcerpc_dfs_SetInfo(struct dcerpc_binding_handle *h,
 
826
                            TALLOC_CTX *mem_ctx,
 
827
                            const char *_dfs_entry_path /* [in] [charset(UTF16)] */,
 
828
                            const char *_servername /* [in] [unique,charset(UTF16)] */,
 
829
                            const char *_sharename /* [in] [unique,charset(UTF16)] */,
 
830
                            uint32_t _level /* [in]  */,
 
831
                            union dfs_Info *_info /* [in] [ref,switch_is(level)] */,
 
832
                            WERROR *result)
 
833
{
 
834
        struct dfs_SetInfo r;
 
835
        NTSTATUS status;
 
836
 
 
837
        /* In parameters */
 
838
        r.in.dfs_entry_path = _dfs_entry_path;
 
839
        r.in.servername = _servername;
 
840
        r.in.sharename = _sharename;
 
841
        r.in.level = _level;
 
842
        r.in.info = _info;
 
843
 
 
844
        status = dcerpc_dfs_SetInfo_r(h, mem_ctx, &r);
 
845
        if (!NT_STATUS_IS_OK(status)) {
 
846
                return status;
 
847
        }
 
848
 
 
849
        /* Return variables */
 
850
 
 
851
        /* Return result */
 
852
        *result = r.out.result;
 
853
 
 
854
        return NT_STATUS_OK;
 
855
}
 
856
 
 
857
struct dcerpc_dfs_GetInfo_r_state {
 
858
        TALLOC_CTX *out_mem_ctx;
 
859
};
 
860
 
 
861
static void dcerpc_dfs_GetInfo_r_done(struct tevent_req *subreq);
 
862
 
 
863
struct tevent_req *dcerpc_dfs_GetInfo_r_send(TALLOC_CTX *mem_ctx,
 
864
        struct tevent_context *ev,
 
865
        struct dcerpc_binding_handle *h,
 
866
        struct dfs_GetInfo *r)
 
867
{
 
868
        struct tevent_req *req;
 
869
        struct dcerpc_dfs_GetInfo_r_state *state;
 
870
        struct tevent_req *subreq;
 
871
 
 
872
        req = tevent_req_create(mem_ctx, &state,
 
873
                                struct dcerpc_dfs_GetInfo_r_state);
 
874
        if (req == NULL) {
 
875
                return NULL;
 
876
        }
 
877
 
 
878
        state->out_mem_ctx = talloc_new(state);
 
879
        if (tevent_req_nomem(state->out_mem_ctx, req)) {
 
880
                return tevent_req_post(req, ev);
 
881
        }
 
882
 
 
883
        subreq = dcerpc_binding_handle_call_send(state, ev, h,
 
884
                        NULL, &ndr_table_netdfs,
 
885
                        NDR_DFS_GETINFO, state->out_mem_ctx, r);
 
886
        if (tevent_req_nomem(subreq, req)) {
 
887
                return tevent_req_post(req, ev);
 
888
        }
 
889
        tevent_req_set_callback(subreq, dcerpc_dfs_GetInfo_r_done, req);
 
890
 
 
891
        return req;
 
892
}
 
893
 
 
894
static void dcerpc_dfs_GetInfo_r_done(struct tevent_req *subreq)
 
895
{
 
896
        struct tevent_req *req =
 
897
                tevent_req_callback_data(subreq,
 
898
                struct tevent_req);
 
899
        NTSTATUS status;
 
900
 
 
901
        status = dcerpc_binding_handle_call_recv(subreq);
 
902
        if (!NT_STATUS_IS_OK(status)) {
 
903
                tevent_req_nterror(req, status);
 
904
                return;
 
905
        }
 
906
 
 
907
        tevent_req_done(req);
 
908
}
 
909
 
 
910
NTSTATUS dcerpc_dfs_GetInfo_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
 
911
{
 
912
        struct dcerpc_dfs_GetInfo_r_state *state =
 
913
                tevent_req_data(req,
 
914
                struct dcerpc_dfs_GetInfo_r_state);
 
915
        NTSTATUS status;
 
916
 
 
917
        if (tevent_req_is_nterror(req, &status)) {
 
918
                tevent_req_received(req);
 
919
                return status;
 
920
        }
 
921
 
 
922
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
923
 
 
924
        tevent_req_received(req);
 
925
        return NT_STATUS_OK;
 
926
}
 
927
 
 
928
NTSTATUS dcerpc_dfs_GetInfo_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_GetInfo *r)
 
929
{
 
930
        NTSTATUS status;
 
931
 
 
932
        status = dcerpc_binding_handle_call(h,
 
933
                        NULL, &ndr_table_netdfs,
 
934
                        NDR_DFS_GETINFO, mem_ctx, r);
 
935
 
 
936
        return status;
 
937
}
 
938
 
 
939
struct dcerpc_dfs_GetInfo_state {
 
940
        struct dfs_GetInfo orig;
 
941
        struct dfs_GetInfo tmp;
 
942
        TALLOC_CTX *out_mem_ctx;
 
943
};
 
944
 
 
945
static void dcerpc_dfs_GetInfo_done(struct tevent_req *subreq);
 
946
 
 
947
struct tevent_req *dcerpc_dfs_GetInfo_send(TALLOC_CTX *mem_ctx,
 
948
                                           struct tevent_context *ev,
 
949
                                           struct dcerpc_binding_handle *h,
 
950
                                           const char *_dfs_entry_path /* [in] [charset(UTF16)] */,
 
951
                                           const char *_servername /* [in] [unique,charset(UTF16)] */,
 
952
                                           const char *_sharename /* [in] [unique,charset(UTF16)] */,
 
953
                                           uint32_t _level /* [in]  */,
 
954
                                           union dfs_Info *_info /* [out] [ref,switch_is(level)] */)
 
955
{
 
956
        struct tevent_req *req;
 
957
        struct dcerpc_dfs_GetInfo_state *state;
 
958
        struct tevent_req *subreq;
 
959
 
 
960
        req = tevent_req_create(mem_ctx, &state,
 
961
                                struct dcerpc_dfs_GetInfo_state);
 
962
        if (req == NULL) {
 
963
                return NULL;
 
964
        }
 
965
        state->out_mem_ctx = NULL;
 
966
 
 
967
        /* In parameters */
 
968
        state->orig.in.dfs_entry_path = _dfs_entry_path;
 
969
        state->orig.in.servername = _servername;
 
970
        state->orig.in.sharename = _sharename;
 
971
        state->orig.in.level = _level;
 
972
 
 
973
        /* Out parameters */
 
974
        state->orig.out.info = _info;
 
975
 
 
976
        /* Result */
 
977
        ZERO_STRUCT(state->orig.out.result);
 
978
 
 
979
        state->out_mem_ctx = talloc_named_const(state, 0,
 
980
                             "dcerpc_dfs_GetInfo_out_memory");
 
981
        if (tevent_req_nomem(state->out_mem_ctx, req)) {
 
982
                return tevent_req_post(req, ev);
 
983
        }
 
984
 
 
985
        /* make a temporary copy, that we pass to the dispatch function */
 
986
        state->tmp = state->orig;
 
987
 
 
988
        subreq = dcerpc_dfs_GetInfo_r_send(state, ev, h, &state->tmp);
 
989
        if (tevent_req_nomem(subreq, req)) {
 
990
                return tevent_req_post(req, ev);
 
991
        }
 
992
        tevent_req_set_callback(subreq, dcerpc_dfs_GetInfo_done, req);
 
993
        return req;
 
994
}
 
995
 
 
996
static void dcerpc_dfs_GetInfo_done(struct tevent_req *subreq)
 
997
{
 
998
        struct tevent_req *req = tevent_req_callback_data(
 
999
                subreq, struct tevent_req);
 
1000
        struct dcerpc_dfs_GetInfo_state *state = tevent_req_data(
 
1001
                req, struct dcerpc_dfs_GetInfo_state);
 
1002
        NTSTATUS status;
 
1003
        TALLOC_CTX *mem_ctx;
 
1004
 
 
1005
        if (state->out_mem_ctx) {
 
1006
                mem_ctx = state->out_mem_ctx;
 
1007
        } else {
 
1008
                mem_ctx = state;
 
1009
        }
 
1010
 
 
1011
        status = dcerpc_dfs_GetInfo_r_recv(subreq, mem_ctx);
 
1012
        TALLOC_FREE(subreq);
 
1013
        if (!NT_STATUS_IS_OK(status)) {
 
1014
                tevent_req_nterror(req, status);
 
1015
                return;
 
1016
        }
 
1017
 
 
1018
        /* Copy out parameters */
 
1019
        *state->orig.out.info = *state->tmp.out.info;
 
1020
 
 
1021
        /* Copy result */
 
1022
        state->orig.out.result = state->tmp.out.result;
 
1023
 
 
1024
        /* Reset temporary structure */
 
1025
        ZERO_STRUCT(state->tmp);
 
1026
 
 
1027
        tevent_req_done(req);
 
1028
}
 
1029
 
 
1030
NTSTATUS dcerpc_dfs_GetInfo_recv(struct tevent_req *req,
 
1031
                                 TALLOC_CTX *mem_ctx,
 
1032
                                 WERROR *result)
 
1033
{
 
1034
        struct dcerpc_dfs_GetInfo_state *state = tevent_req_data(
 
1035
                req, struct dcerpc_dfs_GetInfo_state);
 
1036
        NTSTATUS status;
 
1037
 
 
1038
        if (tevent_req_is_nterror(req, &status)) {
 
1039
                tevent_req_received(req);
 
1040
                return status;
 
1041
        }
 
1042
 
 
1043
        /* Steal possible out parameters to the callers context */
 
1044
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
1045
 
 
1046
        /* Return result */
 
1047
        *result = state->orig.out.result;
 
1048
 
 
1049
        tevent_req_received(req);
 
1050
        return NT_STATUS_OK;
 
1051
}
 
1052
 
 
1053
NTSTATUS dcerpc_dfs_GetInfo(struct dcerpc_binding_handle *h,
 
1054
                            TALLOC_CTX *mem_ctx,
 
1055
                            const char *_dfs_entry_path /* [in] [charset(UTF16)] */,
 
1056
                            const char *_servername /* [in] [unique,charset(UTF16)] */,
 
1057
                            const char *_sharename /* [in] [unique,charset(UTF16)] */,
 
1058
                            uint32_t _level /* [in]  */,
 
1059
                            union dfs_Info *_info /* [out] [ref,switch_is(level)] */,
 
1060
                            WERROR *result)
 
1061
{
 
1062
        struct dfs_GetInfo r;
 
1063
        NTSTATUS status;
 
1064
 
 
1065
        /* In parameters */
 
1066
        r.in.dfs_entry_path = _dfs_entry_path;
 
1067
        r.in.servername = _servername;
 
1068
        r.in.sharename = _sharename;
 
1069
        r.in.level = _level;
 
1070
 
 
1071
        status = dcerpc_dfs_GetInfo_r(h, mem_ctx, &r);
 
1072
        if (!NT_STATUS_IS_OK(status)) {
 
1073
                return status;
 
1074
        }
 
1075
 
 
1076
        /* Return variables */
 
1077
        *_info = *r.out.info;
 
1078
 
 
1079
        /* Return result */
 
1080
        *result = r.out.result;
 
1081
 
 
1082
        return NT_STATUS_OK;
 
1083
}
 
1084
 
 
1085
struct dcerpc_dfs_Enum_r_state {
 
1086
        TALLOC_CTX *out_mem_ctx;
 
1087
};
 
1088
 
 
1089
static void dcerpc_dfs_Enum_r_done(struct tevent_req *subreq);
 
1090
 
 
1091
struct tevent_req *dcerpc_dfs_Enum_r_send(TALLOC_CTX *mem_ctx,
 
1092
        struct tevent_context *ev,
 
1093
        struct dcerpc_binding_handle *h,
 
1094
        struct dfs_Enum *r)
 
1095
{
 
1096
        struct tevent_req *req;
 
1097
        struct dcerpc_dfs_Enum_r_state *state;
 
1098
        struct tevent_req *subreq;
 
1099
 
 
1100
        req = tevent_req_create(mem_ctx, &state,
 
1101
                                struct dcerpc_dfs_Enum_r_state);
 
1102
        if (req == NULL) {
 
1103
                return NULL;
 
1104
        }
 
1105
 
 
1106
        state->out_mem_ctx = talloc_new(state);
 
1107
        if (tevent_req_nomem(state->out_mem_ctx, req)) {
 
1108
                return tevent_req_post(req, ev);
 
1109
        }
 
1110
 
 
1111
        subreq = dcerpc_binding_handle_call_send(state, ev, h,
 
1112
                        NULL, &ndr_table_netdfs,
 
1113
                        NDR_DFS_ENUM, state->out_mem_ctx, r);
 
1114
        if (tevent_req_nomem(subreq, req)) {
 
1115
                return tevent_req_post(req, ev);
 
1116
        }
 
1117
        tevent_req_set_callback(subreq, dcerpc_dfs_Enum_r_done, req);
 
1118
 
 
1119
        return req;
 
1120
}
 
1121
 
 
1122
static void dcerpc_dfs_Enum_r_done(struct tevent_req *subreq)
 
1123
{
 
1124
        struct tevent_req *req =
 
1125
                tevent_req_callback_data(subreq,
 
1126
                struct tevent_req);
 
1127
        NTSTATUS status;
 
1128
 
 
1129
        status = dcerpc_binding_handle_call_recv(subreq);
 
1130
        if (!NT_STATUS_IS_OK(status)) {
 
1131
                tevent_req_nterror(req, status);
 
1132
                return;
 
1133
        }
 
1134
 
 
1135
        tevent_req_done(req);
 
1136
}
 
1137
 
 
1138
NTSTATUS dcerpc_dfs_Enum_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
 
1139
{
 
1140
        struct dcerpc_dfs_Enum_r_state *state =
 
1141
                tevent_req_data(req,
 
1142
                struct dcerpc_dfs_Enum_r_state);
 
1143
        NTSTATUS status;
 
1144
 
 
1145
        if (tevent_req_is_nterror(req, &status)) {
 
1146
                tevent_req_received(req);
 
1147
                return status;
 
1148
        }
 
1149
 
 
1150
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
1151
 
 
1152
        tevent_req_received(req);
 
1153
        return NT_STATUS_OK;
 
1154
}
 
1155
 
 
1156
NTSTATUS dcerpc_dfs_Enum_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_Enum *r)
 
1157
{
 
1158
        NTSTATUS status;
 
1159
 
 
1160
        status = dcerpc_binding_handle_call(h,
 
1161
                        NULL, &ndr_table_netdfs,
 
1162
                        NDR_DFS_ENUM, mem_ctx, r);
 
1163
 
 
1164
        return status;
 
1165
}
 
1166
 
 
1167
struct dcerpc_dfs_Enum_state {
 
1168
        struct dfs_Enum orig;
 
1169
        struct dfs_Enum tmp;
 
1170
        TALLOC_CTX *out_mem_ctx;
 
1171
};
 
1172
 
 
1173
static void dcerpc_dfs_Enum_done(struct tevent_req *subreq);
 
1174
 
 
1175
struct tevent_req *dcerpc_dfs_Enum_send(TALLOC_CTX *mem_ctx,
 
1176
                                        struct tevent_context *ev,
 
1177
                                        struct dcerpc_binding_handle *h,
 
1178
                                        uint32_t _level /* [in]  */,
 
1179
                                        uint32_t _bufsize /* [in]  */,
 
1180
                                        struct dfs_EnumStruct *_info /* [in,out] [unique] */,
 
1181
                                        uint32_t *_total /* [in,out] [unique] */)
 
1182
{
 
1183
        struct tevent_req *req;
 
1184
        struct dcerpc_dfs_Enum_state *state;
 
1185
        struct tevent_req *subreq;
 
1186
 
 
1187
        req = tevent_req_create(mem_ctx, &state,
 
1188
                                struct dcerpc_dfs_Enum_state);
 
1189
        if (req == NULL) {
 
1190
                return NULL;
 
1191
        }
 
1192
        state->out_mem_ctx = NULL;
 
1193
 
 
1194
        /* In parameters */
 
1195
        state->orig.in.level = _level;
 
1196
        state->orig.in.bufsize = _bufsize;
 
1197
        state->orig.in.info = _info;
 
1198
        state->orig.in.total = _total;
 
1199
 
 
1200
        /* Out parameters */
 
1201
        state->orig.out.info = _info;
 
1202
        state->orig.out.total = _total;
 
1203
 
 
1204
        /* Result */
 
1205
        ZERO_STRUCT(state->orig.out.result);
 
1206
 
 
1207
        state->out_mem_ctx = talloc_named_const(state, 0,
 
1208
                             "dcerpc_dfs_Enum_out_memory");
 
1209
        if (tevent_req_nomem(state->out_mem_ctx, req)) {
 
1210
                return tevent_req_post(req, ev);
 
1211
        }
 
1212
 
 
1213
        /* make a temporary copy, that we pass to the dispatch function */
 
1214
        state->tmp = state->orig;
 
1215
 
 
1216
        subreq = dcerpc_dfs_Enum_r_send(state, ev, h, &state->tmp);
 
1217
        if (tevent_req_nomem(subreq, req)) {
 
1218
                return tevent_req_post(req, ev);
 
1219
        }
 
1220
        tevent_req_set_callback(subreq, dcerpc_dfs_Enum_done, req);
 
1221
        return req;
 
1222
}
 
1223
 
 
1224
static void dcerpc_dfs_Enum_done(struct tevent_req *subreq)
 
1225
{
 
1226
        struct tevent_req *req = tevent_req_callback_data(
 
1227
                subreq, struct tevent_req);
 
1228
        struct dcerpc_dfs_Enum_state *state = tevent_req_data(
 
1229
                req, struct dcerpc_dfs_Enum_state);
 
1230
        NTSTATUS status;
 
1231
        TALLOC_CTX *mem_ctx;
 
1232
 
 
1233
        if (state->out_mem_ctx) {
 
1234
                mem_ctx = state->out_mem_ctx;
 
1235
        } else {
 
1236
                mem_ctx = state;
 
1237
        }
 
1238
 
 
1239
        status = dcerpc_dfs_Enum_r_recv(subreq, mem_ctx);
 
1240
        TALLOC_FREE(subreq);
 
1241
        if (!NT_STATUS_IS_OK(status)) {
 
1242
                tevent_req_nterror(req, status);
 
1243
                return;
 
1244
        }
 
1245
 
 
1246
        /* Copy out parameters */
 
1247
        if (state->orig.out.info && state->tmp.out.info) {
 
1248
                *state->orig.out.info = *state->tmp.out.info;
 
1249
        }
 
1250
        if (state->orig.out.total && state->tmp.out.total) {
 
1251
                *state->orig.out.total = *state->tmp.out.total;
 
1252
        }
 
1253
 
 
1254
        /* Copy result */
 
1255
        state->orig.out.result = state->tmp.out.result;
 
1256
 
 
1257
        /* Reset temporary structure */
 
1258
        ZERO_STRUCT(state->tmp);
 
1259
 
 
1260
        tevent_req_done(req);
 
1261
}
 
1262
 
 
1263
NTSTATUS dcerpc_dfs_Enum_recv(struct tevent_req *req,
 
1264
                              TALLOC_CTX *mem_ctx,
 
1265
                              WERROR *result)
 
1266
{
 
1267
        struct dcerpc_dfs_Enum_state *state = tevent_req_data(
 
1268
                req, struct dcerpc_dfs_Enum_state);
 
1269
        NTSTATUS status;
 
1270
 
 
1271
        if (tevent_req_is_nterror(req, &status)) {
 
1272
                tevent_req_received(req);
 
1273
                return status;
 
1274
        }
 
1275
 
 
1276
        /* Steal possible out parameters to the callers context */
 
1277
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
1278
 
 
1279
        /* Return result */
 
1280
        *result = state->orig.out.result;
 
1281
 
 
1282
        tevent_req_received(req);
 
1283
        return NT_STATUS_OK;
 
1284
}
 
1285
 
 
1286
NTSTATUS dcerpc_dfs_Enum(struct dcerpc_binding_handle *h,
 
1287
                         TALLOC_CTX *mem_ctx,
 
1288
                         uint32_t _level /* [in]  */,
 
1289
                         uint32_t _bufsize /* [in]  */,
 
1290
                         struct dfs_EnumStruct *_info /* [in,out] [unique] */,
 
1291
                         uint32_t *_total /* [in,out] [unique] */,
 
1292
                         WERROR *result)
 
1293
{
 
1294
        struct dfs_Enum r;
 
1295
        NTSTATUS status;
 
1296
 
 
1297
        /* In parameters */
 
1298
        r.in.level = _level;
 
1299
        r.in.bufsize = _bufsize;
 
1300
        r.in.info = _info;
 
1301
        r.in.total = _total;
 
1302
 
 
1303
        status = dcerpc_dfs_Enum_r(h, mem_ctx, &r);
 
1304
        if (!NT_STATUS_IS_OK(status)) {
 
1305
                return status;
 
1306
        }
 
1307
 
 
1308
        /* Return variables */
 
1309
        if (_info && r.out.info) {
 
1310
                *_info = *r.out.info;
 
1311
        }
 
1312
        if (_total && r.out.total) {
 
1313
                *_total = *r.out.total;
 
1314
        }
 
1315
 
 
1316
        /* Return result */
 
1317
        *result = r.out.result;
 
1318
 
 
1319
        return NT_STATUS_OK;
 
1320
}
 
1321
 
 
1322
struct dcerpc_dfs_AddFtRoot_r_state {
 
1323
        TALLOC_CTX *out_mem_ctx;
 
1324
};
 
1325
 
 
1326
static void dcerpc_dfs_AddFtRoot_r_done(struct tevent_req *subreq);
 
1327
 
 
1328
struct tevent_req *dcerpc_dfs_AddFtRoot_r_send(TALLOC_CTX *mem_ctx,
 
1329
        struct tevent_context *ev,
 
1330
        struct dcerpc_binding_handle *h,
 
1331
        struct dfs_AddFtRoot *r)
 
1332
{
 
1333
        struct tevent_req *req;
 
1334
        struct dcerpc_dfs_AddFtRoot_r_state *state;
 
1335
        struct tevent_req *subreq;
 
1336
 
 
1337
        req = tevent_req_create(mem_ctx, &state,
 
1338
                                struct dcerpc_dfs_AddFtRoot_r_state);
 
1339
        if (req == NULL) {
 
1340
                return NULL;
 
1341
        }
 
1342
 
 
1343
        state->out_mem_ctx = talloc_new(state);
 
1344
        if (tevent_req_nomem(state->out_mem_ctx, req)) {
 
1345
                return tevent_req_post(req, ev);
 
1346
        }
 
1347
 
 
1348
        subreq = dcerpc_binding_handle_call_send(state, ev, h,
 
1349
                        NULL, &ndr_table_netdfs,
 
1350
                        NDR_DFS_ADDFTROOT, state->out_mem_ctx, r);
 
1351
        if (tevent_req_nomem(subreq, req)) {
 
1352
                return tevent_req_post(req, ev);
 
1353
        }
 
1354
        tevent_req_set_callback(subreq, dcerpc_dfs_AddFtRoot_r_done, req);
 
1355
 
 
1356
        return req;
 
1357
}
 
1358
 
 
1359
static void dcerpc_dfs_AddFtRoot_r_done(struct tevent_req *subreq)
 
1360
{
 
1361
        struct tevent_req *req =
 
1362
                tevent_req_callback_data(subreq,
 
1363
                struct tevent_req);
 
1364
        NTSTATUS status;
 
1365
 
 
1366
        status = dcerpc_binding_handle_call_recv(subreq);
 
1367
        if (!NT_STATUS_IS_OK(status)) {
 
1368
                tevent_req_nterror(req, status);
 
1369
                return;
 
1370
        }
 
1371
 
 
1372
        tevent_req_done(req);
 
1373
}
 
1374
 
 
1375
NTSTATUS dcerpc_dfs_AddFtRoot_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
 
1376
{
 
1377
        struct dcerpc_dfs_AddFtRoot_r_state *state =
 
1378
                tevent_req_data(req,
 
1379
                struct dcerpc_dfs_AddFtRoot_r_state);
 
1380
        NTSTATUS status;
 
1381
 
 
1382
        if (tevent_req_is_nterror(req, &status)) {
 
1383
                tevent_req_received(req);
 
1384
                return status;
 
1385
        }
 
1386
 
 
1387
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
1388
 
 
1389
        tevent_req_received(req);
 
1390
        return NT_STATUS_OK;
 
1391
}
 
1392
 
 
1393
NTSTATUS dcerpc_dfs_AddFtRoot_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_AddFtRoot *r)
 
1394
{
 
1395
        NTSTATUS status;
 
1396
 
 
1397
        status = dcerpc_binding_handle_call(h,
 
1398
                        NULL, &ndr_table_netdfs,
 
1399
                        NDR_DFS_ADDFTROOT, mem_ctx, r);
 
1400
 
 
1401
        return status;
 
1402
}
 
1403
 
 
1404
struct dcerpc_dfs_AddFtRoot_state {
 
1405
        struct dfs_AddFtRoot orig;
 
1406
        struct dfs_AddFtRoot tmp;
 
1407
        TALLOC_CTX *out_mem_ctx;
 
1408
};
 
1409
 
 
1410
static void dcerpc_dfs_AddFtRoot_done(struct tevent_req *subreq);
 
1411
 
 
1412
struct tevent_req *dcerpc_dfs_AddFtRoot_send(TALLOC_CTX *mem_ctx,
 
1413
                                             struct tevent_context *ev,
 
1414
                                             struct dcerpc_binding_handle *h,
 
1415
                                             const char *_servername /* [in] [charset(UTF16)] */,
 
1416
                                             const char *_dns_servername /* [in] [charset(UTF16)] */,
 
1417
                                             const char *_dfsname /* [in] [charset(UTF16)] */,
 
1418
                                             const char *_rootshare /* [in] [charset(UTF16)] */,
 
1419
                                             const char *_comment /* [in] [charset(UTF16)] */,
 
1420
                                             const char *_dfs_config_dn /* [in] [charset(UTF16)] */,
 
1421
                                             uint8_t _unknown1 /* [in]  */,
 
1422
                                             uint32_t _flags /* [in]  */,
 
1423
                                             struct dfs_UnknownStruct **_unknown2 /* [in,out] [unique] */)
 
1424
{
 
1425
        struct tevent_req *req;
 
1426
        struct dcerpc_dfs_AddFtRoot_state *state;
 
1427
        struct tevent_req *subreq;
 
1428
 
 
1429
        req = tevent_req_create(mem_ctx, &state,
 
1430
                                struct dcerpc_dfs_AddFtRoot_state);
 
1431
        if (req == NULL) {
 
1432
                return NULL;
 
1433
        }
 
1434
        state->out_mem_ctx = NULL;
 
1435
 
 
1436
        /* In parameters */
 
1437
        state->orig.in.servername = _servername;
 
1438
        state->orig.in.dns_servername = _dns_servername;
 
1439
        state->orig.in.dfsname = _dfsname;
 
1440
        state->orig.in.rootshare = _rootshare;
 
1441
        state->orig.in.comment = _comment;
 
1442
        state->orig.in.dfs_config_dn = _dfs_config_dn;
 
1443
        state->orig.in.unknown1 = _unknown1;
 
1444
        state->orig.in.flags = _flags;
 
1445
        state->orig.in.unknown2 = _unknown2;
 
1446
 
 
1447
        /* Out parameters */
 
1448
        state->orig.out.unknown2 = _unknown2;
 
1449
 
 
1450
        /* Result */
 
1451
        ZERO_STRUCT(state->orig.out.result);
 
1452
 
 
1453
        state->out_mem_ctx = talloc_named_const(state, 0,
 
1454
                             "dcerpc_dfs_AddFtRoot_out_memory");
 
1455
        if (tevent_req_nomem(state->out_mem_ctx, req)) {
 
1456
                return tevent_req_post(req, ev);
 
1457
        }
 
1458
 
 
1459
        /* make a temporary copy, that we pass to the dispatch function */
 
1460
        state->tmp = state->orig;
 
1461
 
 
1462
        subreq = dcerpc_dfs_AddFtRoot_r_send(state, ev, h, &state->tmp);
 
1463
        if (tevent_req_nomem(subreq, req)) {
 
1464
                return tevent_req_post(req, ev);
 
1465
        }
 
1466
        tevent_req_set_callback(subreq, dcerpc_dfs_AddFtRoot_done, req);
 
1467
        return req;
 
1468
}
 
1469
 
 
1470
static void dcerpc_dfs_AddFtRoot_done(struct tevent_req *subreq)
 
1471
{
 
1472
        struct tevent_req *req = tevent_req_callback_data(
 
1473
                subreq, struct tevent_req);
 
1474
        struct dcerpc_dfs_AddFtRoot_state *state = tevent_req_data(
 
1475
                req, struct dcerpc_dfs_AddFtRoot_state);
 
1476
        NTSTATUS status;
 
1477
        TALLOC_CTX *mem_ctx;
 
1478
 
 
1479
        if (state->out_mem_ctx) {
 
1480
                mem_ctx = state->out_mem_ctx;
 
1481
        } else {
 
1482
                mem_ctx = state;
 
1483
        }
 
1484
 
 
1485
        status = dcerpc_dfs_AddFtRoot_r_recv(subreq, mem_ctx);
 
1486
        TALLOC_FREE(subreq);
 
1487
        if (!NT_STATUS_IS_OK(status)) {
 
1488
                tevent_req_nterror(req, status);
 
1489
                return;
 
1490
        }
 
1491
 
 
1492
        /* Copy out parameters */
 
1493
        if (state->orig.out.unknown2 && state->tmp.out.unknown2) {
 
1494
                *state->orig.out.unknown2 = *state->tmp.out.unknown2;
 
1495
        }
 
1496
 
 
1497
        /* Copy result */
 
1498
        state->orig.out.result = state->tmp.out.result;
 
1499
 
 
1500
        /* Reset temporary structure */
 
1501
        ZERO_STRUCT(state->tmp);
 
1502
 
 
1503
        tevent_req_done(req);
 
1504
}
 
1505
 
 
1506
NTSTATUS dcerpc_dfs_AddFtRoot_recv(struct tevent_req *req,
 
1507
                                   TALLOC_CTX *mem_ctx,
 
1508
                                   WERROR *result)
 
1509
{
 
1510
        struct dcerpc_dfs_AddFtRoot_state *state = tevent_req_data(
 
1511
                req, struct dcerpc_dfs_AddFtRoot_state);
 
1512
        NTSTATUS status;
 
1513
 
 
1514
        if (tevent_req_is_nterror(req, &status)) {
 
1515
                tevent_req_received(req);
 
1516
                return status;
 
1517
        }
 
1518
 
 
1519
        /* Steal possible out parameters to the callers context */
 
1520
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
1521
 
 
1522
        /* Return result */
 
1523
        *result = state->orig.out.result;
 
1524
 
 
1525
        tevent_req_received(req);
 
1526
        return NT_STATUS_OK;
 
1527
}
 
1528
 
 
1529
NTSTATUS dcerpc_dfs_AddFtRoot(struct dcerpc_binding_handle *h,
 
1530
                              TALLOC_CTX *mem_ctx,
 
1531
                              const char *_servername /* [in] [charset(UTF16)] */,
 
1532
                              const char *_dns_servername /* [in] [charset(UTF16)] */,
 
1533
                              const char *_dfsname /* [in] [charset(UTF16)] */,
 
1534
                              const char *_rootshare /* [in] [charset(UTF16)] */,
 
1535
                              const char *_comment /* [in] [charset(UTF16)] */,
 
1536
                              const char *_dfs_config_dn /* [in] [charset(UTF16)] */,
 
1537
                              uint8_t _unknown1 /* [in]  */,
 
1538
                              uint32_t _flags /* [in]  */,
 
1539
                              struct dfs_UnknownStruct **_unknown2 /* [in,out] [unique] */,
 
1540
                              WERROR *result)
 
1541
{
 
1542
        struct dfs_AddFtRoot r;
 
1543
        NTSTATUS status;
 
1544
 
 
1545
        /* In parameters */
 
1546
        r.in.servername = _servername;
 
1547
        r.in.dns_servername = _dns_servername;
 
1548
        r.in.dfsname = _dfsname;
 
1549
        r.in.rootshare = _rootshare;
 
1550
        r.in.comment = _comment;
 
1551
        r.in.dfs_config_dn = _dfs_config_dn;
 
1552
        r.in.unknown1 = _unknown1;
 
1553
        r.in.flags = _flags;
 
1554
        r.in.unknown2 = _unknown2;
 
1555
 
 
1556
        status = dcerpc_dfs_AddFtRoot_r(h, mem_ctx, &r);
 
1557
        if (!NT_STATUS_IS_OK(status)) {
 
1558
                return status;
 
1559
        }
 
1560
 
 
1561
        /* Return variables */
 
1562
        if (_unknown2 && r.out.unknown2) {
 
1563
                *_unknown2 = *r.out.unknown2;
 
1564
        }
 
1565
 
 
1566
        /* Return result */
 
1567
        *result = r.out.result;
 
1568
 
 
1569
        return NT_STATUS_OK;
 
1570
}
 
1571
 
 
1572
struct dcerpc_dfs_RemoveFtRoot_r_state {
 
1573
        TALLOC_CTX *out_mem_ctx;
 
1574
};
 
1575
 
 
1576
static void dcerpc_dfs_RemoveFtRoot_r_done(struct tevent_req *subreq);
 
1577
 
 
1578
struct tevent_req *dcerpc_dfs_RemoveFtRoot_r_send(TALLOC_CTX *mem_ctx,
 
1579
        struct tevent_context *ev,
 
1580
        struct dcerpc_binding_handle *h,
 
1581
        struct dfs_RemoveFtRoot *r)
 
1582
{
 
1583
        struct tevent_req *req;
 
1584
        struct dcerpc_dfs_RemoveFtRoot_r_state *state;
 
1585
        struct tevent_req *subreq;
 
1586
 
 
1587
        req = tevent_req_create(mem_ctx, &state,
 
1588
                                struct dcerpc_dfs_RemoveFtRoot_r_state);
 
1589
        if (req == NULL) {
 
1590
                return NULL;
 
1591
        }
 
1592
 
 
1593
        state->out_mem_ctx = talloc_new(state);
 
1594
        if (tevent_req_nomem(state->out_mem_ctx, req)) {
 
1595
                return tevent_req_post(req, ev);
 
1596
        }
 
1597
 
 
1598
        subreq = dcerpc_binding_handle_call_send(state, ev, h,
 
1599
                        NULL, &ndr_table_netdfs,
 
1600
                        NDR_DFS_REMOVEFTROOT, state->out_mem_ctx, r);
 
1601
        if (tevent_req_nomem(subreq, req)) {
 
1602
                return tevent_req_post(req, ev);
 
1603
        }
 
1604
        tevent_req_set_callback(subreq, dcerpc_dfs_RemoveFtRoot_r_done, req);
 
1605
 
 
1606
        return req;
 
1607
}
 
1608
 
 
1609
static void dcerpc_dfs_RemoveFtRoot_r_done(struct tevent_req *subreq)
 
1610
{
 
1611
        struct tevent_req *req =
 
1612
                tevent_req_callback_data(subreq,
 
1613
                struct tevent_req);
 
1614
        NTSTATUS status;
 
1615
 
 
1616
        status = dcerpc_binding_handle_call_recv(subreq);
 
1617
        if (!NT_STATUS_IS_OK(status)) {
 
1618
                tevent_req_nterror(req, status);
 
1619
                return;
 
1620
        }
 
1621
 
 
1622
        tevent_req_done(req);
 
1623
}
 
1624
 
 
1625
NTSTATUS dcerpc_dfs_RemoveFtRoot_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
 
1626
{
 
1627
        struct dcerpc_dfs_RemoveFtRoot_r_state *state =
 
1628
                tevent_req_data(req,
 
1629
                struct dcerpc_dfs_RemoveFtRoot_r_state);
 
1630
        NTSTATUS status;
 
1631
 
 
1632
        if (tevent_req_is_nterror(req, &status)) {
 
1633
                tevent_req_received(req);
 
1634
                return status;
 
1635
        }
 
1636
 
 
1637
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
1638
 
 
1639
        tevent_req_received(req);
 
1640
        return NT_STATUS_OK;
 
1641
}
 
1642
 
 
1643
NTSTATUS dcerpc_dfs_RemoveFtRoot_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_RemoveFtRoot *r)
 
1644
{
 
1645
        NTSTATUS status;
 
1646
 
 
1647
        status = dcerpc_binding_handle_call(h,
 
1648
                        NULL, &ndr_table_netdfs,
 
1649
                        NDR_DFS_REMOVEFTROOT, mem_ctx, r);
 
1650
 
 
1651
        return status;
 
1652
}
 
1653
 
 
1654
struct dcerpc_dfs_RemoveFtRoot_state {
 
1655
        struct dfs_RemoveFtRoot orig;
 
1656
        struct dfs_RemoveFtRoot tmp;
 
1657
        TALLOC_CTX *out_mem_ctx;
 
1658
};
 
1659
 
 
1660
static void dcerpc_dfs_RemoveFtRoot_done(struct tevent_req *subreq);
 
1661
 
 
1662
struct tevent_req *dcerpc_dfs_RemoveFtRoot_send(TALLOC_CTX *mem_ctx,
 
1663
                                                struct tevent_context *ev,
 
1664
                                                struct dcerpc_binding_handle *h,
 
1665
                                                const char *_servername /* [in] [charset(UTF16)] */,
 
1666
                                                const char *_dns_servername /* [in] [charset(UTF16)] */,
 
1667
                                                const char *_dfsname /* [in] [charset(UTF16)] */,
 
1668
                                                const char *_rootshare /* [in] [charset(UTF16)] */,
 
1669
                                                uint32_t _flags /* [in]  */,
 
1670
                                                struct dfs_UnknownStruct **_unknown /* [in,out] [unique] */)
 
1671
{
 
1672
        struct tevent_req *req;
 
1673
        struct dcerpc_dfs_RemoveFtRoot_state *state;
 
1674
        struct tevent_req *subreq;
 
1675
 
 
1676
        req = tevent_req_create(mem_ctx, &state,
 
1677
                                struct dcerpc_dfs_RemoveFtRoot_state);
 
1678
        if (req == NULL) {
 
1679
                return NULL;
 
1680
        }
 
1681
        state->out_mem_ctx = NULL;
 
1682
 
 
1683
        /* In parameters */
 
1684
        state->orig.in.servername = _servername;
 
1685
        state->orig.in.dns_servername = _dns_servername;
 
1686
        state->orig.in.dfsname = _dfsname;
 
1687
        state->orig.in.rootshare = _rootshare;
 
1688
        state->orig.in.flags = _flags;
 
1689
        state->orig.in.unknown = _unknown;
 
1690
 
 
1691
        /* Out parameters */
 
1692
        state->orig.out.unknown = _unknown;
 
1693
 
 
1694
        /* Result */
 
1695
        ZERO_STRUCT(state->orig.out.result);
 
1696
 
 
1697
        state->out_mem_ctx = talloc_named_const(state, 0,
 
1698
                             "dcerpc_dfs_RemoveFtRoot_out_memory");
 
1699
        if (tevent_req_nomem(state->out_mem_ctx, req)) {
 
1700
                return tevent_req_post(req, ev);
 
1701
        }
 
1702
 
 
1703
        /* make a temporary copy, that we pass to the dispatch function */
 
1704
        state->tmp = state->orig;
 
1705
 
 
1706
        subreq = dcerpc_dfs_RemoveFtRoot_r_send(state, ev, h, &state->tmp);
 
1707
        if (tevent_req_nomem(subreq, req)) {
 
1708
                return tevent_req_post(req, ev);
 
1709
        }
 
1710
        tevent_req_set_callback(subreq, dcerpc_dfs_RemoveFtRoot_done, req);
 
1711
        return req;
 
1712
}
 
1713
 
 
1714
static void dcerpc_dfs_RemoveFtRoot_done(struct tevent_req *subreq)
 
1715
{
 
1716
        struct tevent_req *req = tevent_req_callback_data(
 
1717
                subreq, struct tevent_req);
 
1718
        struct dcerpc_dfs_RemoveFtRoot_state *state = tevent_req_data(
 
1719
                req, struct dcerpc_dfs_RemoveFtRoot_state);
 
1720
        NTSTATUS status;
 
1721
        TALLOC_CTX *mem_ctx;
 
1722
 
 
1723
        if (state->out_mem_ctx) {
 
1724
                mem_ctx = state->out_mem_ctx;
 
1725
        } else {
 
1726
                mem_ctx = state;
 
1727
        }
 
1728
 
 
1729
        status = dcerpc_dfs_RemoveFtRoot_r_recv(subreq, mem_ctx);
 
1730
        TALLOC_FREE(subreq);
 
1731
        if (!NT_STATUS_IS_OK(status)) {
 
1732
                tevent_req_nterror(req, status);
 
1733
                return;
 
1734
        }
 
1735
 
 
1736
        /* Copy out parameters */
 
1737
        if (state->orig.out.unknown && state->tmp.out.unknown) {
 
1738
                *state->orig.out.unknown = *state->tmp.out.unknown;
 
1739
        }
 
1740
 
 
1741
        /* Copy result */
 
1742
        state->orig.out.result = state->tmp.out.result;
 
1743
 
 
1744
        /* Reset temporary structure */
 
1745
        ZERO_STRUCT(state->tmp);
 
1746
 
 
1747
        tevent_req_done(req);
 
1748
}
 
1749
 
 
1750
NTSTATUS dcerpc_dfs_RemoveFtRoot_recv(struct tevent_req *req,
 
1751
                                      TALLOC_CTX *mem_ctx,
 
1752
                                      WERROR *result)
 
1753
{
 
1754
        struct dcerpc_dfs_RemoveFtRoot_state *state = tevent_req_data(
 
1755
                req, struct dcerpc_dfs_RemoveFtRoot_state);
 
1756
        NTSTATUS status;
 
1757
 
 
1758
        if (tevent_req_is_nterror(req, &status)) {
 
1759
                tevent_req_received(req);
 
1760
                return status;
 
1761
        }
 
1762
 
 
1763
        /* Steal possible out parameters to the callers context */
 
1764
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
1765
 
 
1766
        /* Return result */
 
1767
        *result = state->orig.out.result;
 
1768
 
 
1769
        tevent_req_received(req);
 
1770
        return NT_STATUS_OK;
 
1771
}
 
1772
 
 
1773
NTSTATUS dcerpc_dfs_RemoveFtRoot(struct dcerpc_binding_handle *h,
 
1774
                                 TALLOC_CTX *mem_ctx,
 
1775
                                 const char *_servername /* [in] [charset(UTF16)] */,
 
1776
                                 const char *_dns_servername /* [in] [charset(UTF16)] */,
 
1777
                                 const char *_dfsname /* [in] [charset(UTF16)] */,
 
1778
                                 const char *_rootshare /* [in] [charset(UTF16)] */,
 
1779
                                 uint32_t _flags /* [in]  */,
 
1780
                                 struct dfs_UnknownStruct **_unknown /* [in,out] [unique] */,
 
1781
                                 WERROR *result)
 
1782
{
 
1783
        struct dfs_RemoveFtRoot r;
 
1784
        NTSTATUS status;
 
1785
 
 
1786
        /* In parameters */
 
1787
        r.in.servername = _servername;
 
1788
        r.in.dns_servername = _dns_servername;
 
1789
        r.in.dfsname = _dfsname;
 
1790
        r.in.rootshare = _rootshare;
 
1791
        r.in.flags = _flags;
 
1792
        r.in.unknown = _unknown;
 
1793
 
 
1794
        status = dcerpc_dfs_RemoveFtRoot_r(h, mem_ctx, &r);
 
1795
        if (!NT_STATUS_IS_OK(status)) {
 
1796
                return status;
 
1797
        }
 
1798
 
 
1799
        /* Return variables */
 
1800
        if (_unknown && r.out.unknown) {
 
1801
                *_unknown = *r.out.unknown;
 
1802
        }
 
1803
 
 
1804
        /* Return result */
 
1805
        *result = r.out.result;
 
1806
 
 
1807
        return NT_STATUS_OK;
 
1808
}
 
1809
 
 
1810
struct dcerpc_dfs_AddStdRoot_r_state {
 
1811
        TALLOC_CTX *out_mem_ctx;
 
1812
};
 
1813
 
 
1814
static void dcerpc_dfs_AddStdRoot_r_done(struct tevent_req *subreq);
 
1815
 
 
1816
struct tevent_req *dcerpc_dfs_AddStdRoot_r_send(TALLOC_CTX *mem_ctx,
 
1817
        struct tevent_context *ev,
 
1818
        struct dcerpc_binding_handle *h,
 
1819
        struct dfs_AddStdRoot *r)
 
1820
{
 
1821
        struct tevent_req *req;
 
1822
        struct dcerpc_dfs_AddStdRoot_r_state *state;
 
1823
        struct tevent_req *subreq;
 
1824
 
 
1825
        req = tevent_req_create(mem_ctx, &state,
 
1826
                                struct dcerpc_dfs_AddStdRoot_r_state);
 
1827
        if (req == NULL) {
 
1828
                return NULL;
 
1829
        }
 
1830
 
 
1831
        state->out_mem_ctx = NULL;
 
1832
 
 
1833
        subreq = dcerpc_binding_handle_call_send(state, ev, h,
 
1834
                        NULL, &ndr_table_netdfs,
 
1835
                        NDR_DFS_ADDSTDROOT, state, r);
 
1836
        if (tevent_req_nomem(subreq, req)) {
 
1837
                return tevent_req_post(req, ev);
 
1838
        }
 
1839
        tevent_req_set_callback(subreq, dcerpc_dfs_AddStdRoot_r_done, req);
 
1840
 
 
1841
        return req;
 
1842
}
 
1843
 
 
1844
static void dcerpc_dfs_AddStdRoot_r_done(struct tevent_req *subreq)
 
1845
{
 
1846
        struct tevent_req *req =
 
1847
                tevent_req_callback_data(subreq,
 
1848
                struct tevent_req);
 
1849
        NTSTATUS status;
 
1850
 
 
1851
        status = dcerpc_binding_handle_call_recv(subreq);
 
1852
        if (!NT_STATUS_IS_OK(status)) {
 
1853
                tevent_req_nterror(req, status);
 
1854
                return;
 
1855
        }
 
1856
 
 
1857
        tevent_req_done(req);
 
1858
}
 
1859
 
 
1860
NTSTATUS dcerpc_dfs_AddStdRoot_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
 
1861
{
 
1862
        struct dcerpc_dfs_AddStdRoot_r_state *state =
 
1863
                tevent_req_data(req,
 
1864
                struct dcerpc_dfs_AddStdRoot_r_state);
 
1865
        NTSTATUS status;
 
1866
 
 
1867
        if (tevent_req_is_nterror(req, &status)) {
 
1868
                tevent_req_received(req);
 
1869
                return status;
 
1870
        }
 
1871
 
 
1872
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
1873
 
 
1874
        tevent_req_received(req);
 
1875
        return NT_STATUS_OK;
 
1876
}
 
1877
 
 
1878
NTSTATUS dcerpc_dfs_AddStdRoot_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_AddStdRoot *r)
 
1879
{
 
1880
        NTSTATUS status;
 
1881
 
 
1882
        status = dcerpc_binding_handle_call(h,
 
1883
                        NULL, &ndr_table_netdfs,
 
1884
                        NDR_DFS_ADDSTDROOT, mem_ctx, r);
 
1885
 
 
1886
        return status;
 
1887
}
 
1888
 
 
1889
struct dcerpc_dfs_AddStdRoot_state {
 
1890
        struct dfs_AddStdRoot orig;
 
1891
        struct dfs_AddStdRoot tmp;
 
1892
        TALLOC_CTX *out_mem_ctx;
 
1893
};
 
1894
 
 
1895
static void dcerpc_dfs_AddStdRoot_done(struct tevent_req *subreq);
 
1896
 
 
1897
struct tevent_req *dcerpc_dfs_AddStdRoot_send(TALLOC_CTX *mem_ctx,
 
1898
                                              struct tevent_context *ev,
 
1899
                                              struct dcerpc_binding_handle *h,
 
1900
                                              const char *_servername /* [in] [charset(UTF16)] */,
 
1901
                                              const char *_rootshare /* [in] [charset(UTF16)] */,
 
1902
                                              const char *_comment /* [in] [charset(UTF16)] */,
 
1903
                                              uint32_t _flags /* [in]  */)
 
1904
{
 
1905
        struct tevent_req *req;
 
1906
        struct dcerpc_dfs_AddStdRoot_state *state;
 
1907
        struct tevent_req *subreq;
 
1908
 
 
1909
        req = tevent_req_create(mem_ctx, &state,
 
1910
                                struct dcerpc_dfs_AddStdRoot_state);
 
1911
        if (req == NULL) {
 
1912
                return NULL;
 
1913
        }
 
1914
        state->out_mem_ctx = NULL;
 
1915
 
 
1916
        /* In parameters */
 
1917
        state->orig.in.servername = _servername;
 
1918
        state->orig.in.rootshare = _rootshare;
 
1919
        state->orig.in.comment = _comment;
 
1920
        state->orig.in.flags = _flags;
 
1921
 
 
1922
        /* Out parameters */
 
1923
 
 
1924
        /* Result */
 
1925
        ZERO_STRUCT(state->orig.out.result);
 
1926
 
 
1927
        /* make a temporary copy, that we pass to the dispatch function */
 
1928
        state->tmp = state->orig;
 
1929
 
 
1930
        subreq = dcerpc_dfs_AddStdRoot_r_send(state, ev, h, &state->tmp);
 
1931
        if (tevent_req_nomem(subreq, req)) {
 
1932
                return tevent_req_post(req, ev);
 
1933
        }
 
1934
        tevent_req_set_callback(subreq, dcerpc_dfs_AddStdRoot_done, req);
 
1935
        return req;
 
1936
}
 
1937
 
 
1938
static void dcerpc_dfs_AddStdRoot_done(struct tevent_req *subreq)
 
1939
{
 
1940
        struct tevent_req *req = tevent_req_callback_data(
 
1941
                subreq, struct tevent_req);
 
1942
        struct dcerpc_dfs_AddStdRoot_state *state = tevent_req_data(
 
1943
                req, struct dcerpc_dfs_AddStdRoot_state);
 
1944
        NTSTATUS status;
 
1945
        TALLOC_CTX *mem_ctx;
 
1946
 
 
1947
        if (state->out_mem_ctx) {
 
1948
                mem_ctx = state->out_mem_ctx;
 
1949
        } else {
 
1950
                mem_ctx = state;
 
1951
        }
 
1952
 
 
1953
        status = dcerpc_dfs_AddStdRoot_r_recv(subreq, mem_ctx);
 
1954
        TALLOC_FREE(subreq);
 
1955
        if (!NT_STATUS_IS_OK(status)) {
 
1956
                tevent_req_nterror(req, status);
 
1957
                return;
 
1958
        }
 
1959
 
 
1960
        /* Copy out parameters */
 
1961
 
 
1962
        /* Copy result */
 
1963
        state->orig.out.result = state->tmp.out.result;
 
1964
 
 
1965
        /* Reset temporary structure */
 
1966
        ZERO_STRUCT(state->tmp);
 
1967
 
 
1968
        tevent_req_done(req);
 
1969
}
 
1970
 
 
1971
NTSTATUS dcerpc_dfs_AddStdRoot_recv(struct tevent_req *req,
 
1972
                                    TALLOC_CTX *mem_ctx,
 
1973
                                    WERROR *result)
 
1974
{
 
1975
        struct dcerpc_dfs_AddStdRoot_state *state = tevent_req_data(
 
1976
                req, struct dcerpc_dfs_AddStdRoot_state);
 
1977
        NTSTATUS status;
 
1978
 
 
1979
        if (tevent_req_is_nterror(req, &status)) {
 
1980
                tevent_req_received(req);
 
1981
                return status;
 
1982
        }
 
1983
 
 
1984
        /* Steal possible out parameters to the callers context */
 
1985
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
1986
 
 
1987
        /* Return result */
 
1988
        *result = state->orig.out.result;
 
1989
 
 
1990
        tevent_req_received(req);
 
1991
        return NT_STATUS_OK;
 
1992
}
 
1993
 
 
1994
NTSTATUS dcerpc_dfs_AddStdRoot(struct dcerpc_binding_handle *h,
 
1995
                               TALLOC_CTX *mem_ctx,
 
1996
                               const char *_servername /* [in] [charset(UTF16)] */,
 
1997
                               const char *_rootshare /* [in] [charset(UTF16)] */,
 
1998
                               const char *_comment /* [in] [charset(UTF16)] */,
 
1999
                               uint32_t _flags /* [in]  */,
 
2000
                               WERROR *result)
 
2001
{
 
2002
        struct dfs_AddStdRoot r;
 
2003
        NTSTATUS status;
 
2004
 
 
2005
        /* In parameters */
 
2006
        r.in.servername = _servername;
 
2007
        r.in.rootshare = _rootshare;
 
2008
        r.in.comment = _comment;
 
2009
        r.in.flags = _flags;
 
2010
 
 
2011
        status = dcerpc_dfs_AddStdRoot_r(h, mem_ctx, &r);
 
2012
        if (!NT_STATUS_IS_OK(status)) {
 
2013
                return status;
 
2014
        }
 
2015
 
 
2016
        /* Return variables */
 
2017
 
 
2018
        /* Return result */
 
2019
        *result = r.out.result;
 
2020
 
 
2021
        return NT_STATUS_OK;
 
2022
}
 
2023
 
 
2024
struct dcerpc_dfs_RemoveStdRoot_r_state {
 
2025
        TALLOC_CTX *out_mem_ctx;
 
2026
};
 
2027
 
 
2028
static void dcerpc_dfs_RemoveStdRoot_r_done(struct tevent_req *subreq);
 
2029
 
 
2030
struct tevent_req *dcerpc_dfs_RemoveStdRoot_r_send(TALLOC_CTX *mem_ctx,
 
2031
        struct tevent_context *ev,
 
2032
        struct dcerpc_binding_handle *h,
 
2033
        struct dfs_RemoveStdRoot *r)
 
2034
{
 
2035
        struct tevent_req *req;
 
2036
        struct dcerpc_dfs_RemoveStdRoot_r_state *state;
 
2037
        struct tevent_req *subreq;
 
2038
 
 
2039
        req = tevent_req_create(mem_ctx, &state,
 
2040
                                struct dcerpc_dfs_RemoveStdRoot_r_state);
 
2041
        if (req == NULL) {
 
2042
                return NULL;
 
2043
        }
 
2044
 
 
2045
        state->out_mem_ctx = NULL;
 
2046
 
 
2047
        subreq = dcerpc_binding_handle_call_send(state, ev, h,
 
2048
                        NULL, &ndr_table_netdfs,
 
2049
                        NDR_DFS_REMOVESTDROOT, state, r);
 
2050
        if (tevent_req_nomem(subreq, req)) {
 
2051
                return tevent_req_post(req, ev);
 
2052
        }
 
2053
        tevent_req_set_callback(subreq, dcerpc_dfs_RemoveStdRoot_r_done, req);
 
2054
 
 
2055
        return req;
 
2056
}
 
2057
 
 
2058
static void dcerpc_dfs_RemoveStdRoot_r_done(struct tevent_req *subreq)
 
2059
{
 
2060
        struct tevent_req *req =
 
2061
                tevent_req_callback_data(subreq,
 
2062
                struct tevent_req);
 
2063
        NTSTATUS status;
 
2064
 
 
2065
        status = dcerpc_binding_handle_call_recv(subreq);
 
2066
        if (!NT_STATUS_IS_OK(status)) {
 
2067
                tevent_req_nterror(req, status);
 
2068
                return;
 
2069
        }
 
2070
 
 
2071
        tevent_req_done(req);
 
2072
}
 
2073
 
 
2074
NTSTATUS dcerpc_dfs_RemoveStdRoot_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
 
2075
{
 
2076
        struct dcerpc_dfs_RemoveStdRoot_r_state *state =
 
2077
                tevent_req_data(req,
 
2078
                struct dcerpc_dfs_RemoveStdRoot_r_state);
 
2079
        NTSTATUS status;
 
2080
 
 
2081
        if (tevent_req_is_nterror(req, &status)) {
 
2082
                tevent_req_received(req);
 
2083
                return status;
 
2084
        }
 
2085
 
 
2086
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
2087
 
 
2088
        tevent_req_received(req);
 
2089
        return NT_STATUS_OK;
 
2090
}
 
2091
 
 
2092
NTSTATUS dcerpc_dfs_RemoveStdRoot_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_RemoveStdRoot *r)
 
2093
{
 
2094
        NTSTATUS status;
 
2095
 
 
2096
        status = dcerpc_binding_handle_call(h,
 
2097
                        NULL, &ndr_table_netdfs,
 
2098
                        NDR_DFS_REMOVESTDROOT, mem_ctx, r);
 
2099
 
 
2100
        return status;
 
2101
}
 
2102
 
 
2103
struct dcerpc_dfs_RemoveStdRoot_state {
 
2104
        struct dfs_RemoveStdRoot orig;
 
2105
        struct dfs_RemoveStdRoot tmp;
 
2106
        TALLOC_CTX *out_mem_ctx;
 
2107
};
 
2108
 
 
2109
static void dcerpc_dfs_RemoveStdRoot_done(struct tevent_req *subreq);
 
2110
 
 
2111
struct tevent_req *dcerpc_dfs_RemoveStdRoot_send(TALLOC_CTX *mem_ctx,
 
2112
                                                 struct tevent_context *ev,
 
2113
                                                 struct dcerpc_binding_handle *h,
 
2114
                                                 const char *_servername /* [in] [charset(UTF16)] */,
 
2115
                                                 const char *_rootshare /* [in] [charset(UTF16)] */,
 
2116
                                                 uint32_t _flags /* [in]  */)
 
2117
{
 
2118
        struct tevent_req *req;
 
2119
        struct dcerpc_dfs_RemoveStdRoot_state *state;
 
2120
        struct tevent_req *subreq;
 
2121
 
 
2122
        req = tevent_req_create(mem_ctx, &state,
 
2123
                                struct dcerpc_dfs_RemoveStdRoot_state);
 
2124
        if (req == NULL) {
 
2125
                return NULL;
 
2126
        }
 
2127
        state->out_mem_ctx = NULL;
 
2128
 
 
2129
        /* In parameters */
 
2130
        state->orig.in.servername = _servername;
 
2131
        state->orig.in.rootshare = _rootshare;
 
2132
        state->orig.in.flags = _flags;
 
2133
 
 
2134
        /* Out parameters */
 
2135
 
 
2136
        /* Result */
 
2137
        ZERO_STRUCT(state->orig.out.result);
 
2138
 
 
2139
        /* make a temporary copy, that we pass to the dispatch function */
 
2140
        state->tmp = state->orig;
 
2141
 
 
2142
        subreq = dcerpc_dfs_RemoveStdRoot_r_send(state, ev, h, &state->tmp);
 
2143
        if (tevent_req_nomem(subreq, req)) {
 
2144
                return tevent_req_post(req, ev);
 
2145
        }
 
2146
        tevent_req_set_callback(subreq, dcerpc_dfs_RemoveStdRoot_done, req);
 
2147
        return req;
 
2148
}
 
2149
 
 
2150
static void dcerpc_dfs_RemoveStdRoot_done(struct tevent_req *subreq)
 
2151
{
 
2152
        struct tevent_req *req = tevent_req_callback_data(
 
2153
                subreq, struct tevent_req);
 
2154
        struct dcerpc_dfs_RemoveStdRoot_state *state = tevent_req_data(
 
2155
                req, struct dcerpc_dfs_RemoveStdRoot_state);
 
2156
        NTSTATUS status;
 
2157
        TALLOC_CTX *mem_ctx;
 
2158
 
 
2159
        if (state->out_mem_ctx) {
 
2160
                mem_ctx = state->out_mem_ctx;
 
2161
        } else {
 
2162
                mem_ctx = state;
 
2163
        }
 
2164
 
 
2165
        status = dcerpc_dfs_RemoveStdRoot_r_recv(subreq, mem_ctx);
 
2166
        TALLOC_FREE(subreq);
 
2167
        if (!NT_STATUS_IS_OK(status)) {
 
2168
                tevent_req_nterror(req, status);
 
2169
                return;
 
2170
        }
 
2171
 
 
2172
        /* Copy out parameters */
 
2173
 
 
2174
        /* Copy result */
 
2175
        state->orig.out.result = state->tmp.out.result;
 
2176
 
 
2177
        /* Reset temporary structure */
 
2178
        ZERO_STRUCT(state->tmp);
 
2179
 
 
2180
        tevent_req_done(req);
 
2181
}
 
2182
 
 
2183
NTSTATUS dcerpc_dfs_RemoveStdRoot_recv(struct tevent_req *req,
 
2184
                                       TALLOC_CTX *mem_ctx,
 
2185
                                       WERROR *result)
 
2186
{
 
2187
        struct dcerpc_dfs_RemoveStdRoot_state *state = tevent_req_data(
 
2188
                req, struct dcerpc_dfs_RemoveStdRoot_state);
 
2189
        NTSTATUS status;
 
2190
 
 
2191
        if (tevent_req_is_nterror(req, &status)) {
 
2192
                tevent_req_received(req);
 
2193
                return status;
 
2194
        }
 
2195
 
 
2196
        /* Steal possible out parameters to the callers context */
 
2197
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
2198
 
 
2199
        /* Return result */
 
2200
        *result = state->orig.out.result;
 
2201
 
 
2202
        tevent_req_received(req);
 
2203
        return NT_STATUS_OK;
 
2204
}
 
2205
 
 
2206
NTSTATUS dcerpc_dfs_RemoveStdRoot(struct dcerpc_binding_handle *h,
 
2207
                                  TALLOC_CTX *mem_ctx,
 
2208
                                  const char *_servername /* [in] [charset(UTF16)] */,
 
2209
                                  const char *_rootshare /* [in] [charset(UTF16)] */,
 
2210
                                  uint32_t _flags /* [in]  */,
 
2211
                                  WERROR *result)
 
2212
{
 
2213
        struct dfs_RemoveStdRoot r;
 
2214
        NTSTATUS status;
 
2215
 
 
2216
        /* In parameters */
 
2217
        r.in.servername = _servername;
 
2218
        r.in.rootshare = _rootshare;
 
2219
        r.in.flags = _flags;
 
2220
 
 
2221
        status = dcerpc_dfs_RemoveStdRoot_r(h, mem_ctx, &r);
 
2222
        if (!NT_STATUS_IS_OK(status)) {
 
2223
                return status;
 
2224
        }
 
2225
 
 
2226
        /* Return variables */
 
2227
 
 
2228
        /* Return result */
 
2229
        *result = r.out.result;
 
2230
 
 
2231
        return NT_STATUS_OK;
 
2232
}
 
2233
 
 
2234
struct dcerpc_dfs_ManagerInitialize_r_state {
 
2235
        TALLOC_CTX *out_mem_ctx;
 
2236
};
 
2237
 
 
2238
static void dcerpc_dfs_ManagerInitialize_r_done(struct tevent_req *subreq);
 
2239
 
 
2240
struct tevent_req *dcerpc_dfs_ManagerInitialize_r_send(TALLOC_CTX *mem_ctx,
 
2241
        struct tevent_context *ev,
 
2242
        struct dcerpc_binding_handle *h,
 
2243
        struct dfs_ManagerInitialize *r)
 
2244
{
 
2245
        struct tevent_req *req;
 
2246
        struct dcerpc_dfs_ManagerInitialize_r_state *state;
 
2247
        struct tevent_req *subreq;
 
2248
 
 
2249
        req = tevent_req_create(mem_ctx, &state,
 
2250
                                struct dcerpc_dfs_ManagerInitialize_r_state);
 
2251
        if (req == NULL) {
 
2252
                return NULL;
 
2253
        }
 
2254
 
 
2255
        state->out_mem_ctx = NULL;
 
2256
 
 
2257
        subreq = dcerpc_binding_handle_call_send(state, ev, h,
 
2258
                        NULL, &ndr_table_netdfs,
 
2259
                        NDR_DFS_MANAGERINITIALIZE, state, r);
 
2260
        if (tevent_req_nomem(subreq, req)) {
 
2261
                return tevent_req_post(req, ev);
 
2262
        }
 
2263
        tevent_req_set_callback(subreq, dcerpc_dfs_ManagerInitialize_r_done, req);
 
2264
 
 
2265
        return req;
 
2266
}
 
2267
 
 
2268
static void dcerpc_dfs_ManagerInitialize_r_done(struct tevent_req *subreq)
 
2269
{
 
2270
        struct tevent_req *req =
 
2271
                tevent_req_callback_data(subreq,
 
2272
                struct tevent_req);
 
2273
        NTSTATUS status;
 
2274
 
 
2275
        status = dcerpc_binding_handle_call_recv(subreq);
 
2276
        if (!NT_STATUS_IS_OK(status)) {
 
2277
                tevent_req_nterror(req, status);
 
2278
                return;
 
2279
        }
 
2280
 
 
2281
        tevent_req_done(req);
 
2282
}
 
2283
 
 
2284
NTSTATUS dcerpc_dfs_ManagerInitialize_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
 
2285
{
 
2286
        struct dcerpc_dfs_ManagerInitialize_r_state *state =
 
2287
                tevent_req_data(req,
 
2288
                struct dcerpc_dfs_ManagerInitialize_r_state);
 
2289
        NTSTATUS status;
 
2290
 
 
2291
        if (tevent_req_is_nterror(req, &status)) {
 
2292
                tevent_req_received(req);
 
2293
                return status;
 
2294
        }
 
2295
 
 
2296
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
2297
 
 
2298
        tevent_req_received(req);
 
2299
        return NT_STATUS_OK;
 
2300
}
 
2301
 
 
2302
NTSTATUS dcerpc_dfs_ManagerInitialize_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_ManagerInitialize *r)
 
2303
{
 
2304
        NTSTATUS status;
 
2305
 
 
2306
        status = dcerpc_binding_handle_call(h,
 
2307
                        NULL, &ndr_table_netdfs,
 
2308
                        NDR_DFS_MANAGERINITIALIZE, mem_ctx, r);
 
2309
 
 
2310
        return status;
 
2311
}
 
2312
 
 
2313
struct dcerpc_dfs_ManagerInitialize_state {
 
2314
        struct dfs_ManagerInitialize orig;
 
2315
        struct dfs_ManagerInitialize tmp;
 
2316
        TALLOC_CTX *out_mem_ctx;
 
2317
};
 
2318
 
 
2319
static void dcerpc_dfs_ManagerInitialize_done(struct tevent_req *subreq);
 
2320
 
 
2321
struct tevent_req *dcerpc_dfs_ManagerInitialize_send(TALLOC_CTX *mem_ctx,
 
2322
                                                     struct tevent_context *ev,
 
2323
                                                     struct dcerpc_binding_handle *h,
 
2324
                                                     const char *_servername /* [in] [ref,charset(UTF16)] */,
 
2325
                                                     uint32_t _flags /* [in]  */)
 
2326
{
 
2327
        struct tevent_req *req;
 
2328
        struct dcerpc_dfs_ManagerInitialize_state *state;
 
2329
        struct tevent_req *subreq;
 
2330
 
 
2331
        req = tevent_req_create(mem_ctx, &state,
 
2332
                                struct dcerpc_dfs_ManagerInitialize_state);
 
2333
        if (req == NULL) {
 
2334
                return NULL;
 
2335
        }
 
2336
        state->out_mem_ctx = NULL;
 
2337
 
 
2338
        /* In parameters */
 
2339
        state->orig.in.servername = _servername;
 
2340
        state->orig.in.flags = _flags;
 
2341
 
 
2342
        /* Out parameters */
 
2343
 
 
2344
        /* Result */
 
2345
        ZERO_STRUCT(state->orig.out.result);
 
2346
 
 
2347
        /* make a temporary copy, that we pass to the dispatch function */
 
2348
        state->tmp = state->orig;
 
2349
 
 
2350
        subreq = dcerpc_dfs_ManagerInitialize_r_send(state, ev, h, &state->tmp);
 
2351
        if (tevent_req_nomem(subreq, req)) {
 
2352
                return tevent_req_post(req, ev);
 
2353
        }
 
2354
        tevent_req_set_callback(subreq, dcerpc_dfs_ManagerInitialize_done, req);
 
2355
        return req;
 
2356
}
 
2357
 
 
2358
static void dcerpc_dfs_ManagerInitialize_done(struct tevent_req *subreq)
 
2359
{
 
2360
        struct tevent_req *req = tevent_req_callback_data(
 
2361
                subreq, struct tevent_req);
 
2362
        struct dcerpc_dfs_ManagerInitialize_state *state = tevent_req_data(
 
2363
                req, struct dcerpc_dfs_ManagerInitialize_state);
 
2364
        NTSTATUS status;
 
2365
        TALLOC_CTX *mem_ctx;
 
2366
 
 
2367
        if (state->out_mem_ctx) {
 
2368
                mem_ctx = state->out_mem_ctx;
 
2369
        } else {
 
2370
                mem_ctx = state;
 
2371
        }
 
2372
 
 
2373
        status = dcerpc_dfs_ManagerInitialize_r_recv(subreq, mem_ctx);
 
2374
        TALLOC_FREE(subreq);
 
2375
        if (!NT_STATUS_IS_OK(status)) {
 
2376
                tevent_req_nterror(req, status);
 
2377
                return;
 
2378
        }
 
2379
 
 
2380
        /* Copy out parameters */
 
2381
 
 
2382
        /* Copy result */
 
2383
        state->orig.out.result = state->tmp.out.result;
 
2384
 
 
2385
        /* Reset temporary structure */
 
2386
        ZERO_STRUCT(state->tmp);
 
2387
 
 
2388
        tevent_req_done(req);
 
2389
}
 
2390
 
 
2391
NTSTATUS dcerpc_dfs_ManagerInitialize_recv(struct tevent_req *req,
 
2392
                                           TALLOC_CTX *mem_ctx,
 
2393
                                           WERROR *result)
 
2394
{
 
2395
        struct dcerpc_dfs_ManagerInitialize_state *state = tevent_req_data(
 
2396
                req, struct dcerpc_dfs_ManagerInitialize_state);
 
2397
        NTSTATUS status;
 
2398
 
 
2399
        if (tevent_req_is_nterror(req, &status)) {
 
2400
                tevent_req_received(req);
 
2401
                return status;
 
2402
        }
 
2403
 
 
2404
        /* Steal possible out parameters to the callers context */
 
2405
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
2406
 
 
2407
        /* Return result */
 
2408
        *result = state->orig.out.result;
 
2409
 
 
2410
        tevent_req_received(req);
 
2411
        return NT_STATUS_OK;
 
2412
}
 
2413
 
 
2414
NTSTATUS dcerpc_dfs_ManagerInitialize(struct dcerpc_binding_handle *h,
 
2415
                                      TALLOC_CTX *mem_ctx,
 
2416
                                      const char *_servername /* [in] [ref,charset(UTF16)] */,
 
2417
                                      uint32_t _flags /* [in]  */,
 
2418
                                      WERROR *result)
 
2419
{
 
2420
        struct dfs_ManagerInitialize r;
 
2421
        NTSTATUS status;
 
2422
 
 
2423
        /* In parameters */
 
2424
        r.in.servername = _servername;
 
2425
        r.in.flags = _flags;
 
2426
 
 
2427
        status = dcerpc_dfs_ManagerInitialize_r(h, mem_ctx, &r);
 
2428
        if (!NT_STATUS_IS_OK(status)) {
 
2429
                return status;
 
2430
        }
 
2431
 
 
2432
        /* Return variables */
 
2433
 
 
2434
        /* Return result */
 
2435
        *result = r.out.result;
 
2436
 
 
2437
        return NT_STATUS_OK;
 
2438
}
 
2439
 
 
2440
struct dcerpc_dfs_AddStdRootForced_r_state {
 
2441
        TALLOC_CTX *out_mem_ctx;
 
2442
};
 
2443
 
 
2444
static void dcerpc_dfs_AddStdRootForced_r_done(struct tevent_req *subreq);
 
2445
 
 
2446
struct tevent_req *dcerpc_dfs_AddStdRootForced_r_send(TALLOC_CTX *mem_ctx,
 
2447
        struct tevent_context *ev,
 
2448
        struct dcerpc_binding_handle *h,
 
2449
        struct dfs_AddStdRootForced *r)
 
2450
{
 
2451
        struct tevent_req *req;
 
2452
        struct dcerpc_dfs_AddStdRootForced_r_state *state;
 
2453
        struct tevent_req *subreq;
 
2454
 
 
2455
        req = tevent_req_create(mem_ctx, &state,
 
2456
                                struct dcerpc_dfs_AddStdRootForced_r_state);
 
2457
        if (req == NULL) {
 
2458
                return NULL;
 
2459
        }
 
2460
 
 
2461
        state->out_mem_ctx = NULL;
 
2462
 
 
2463
        subreq = dcerpc_binding_handle_call_send(state, ev, h,
 
2464
                        NULL, &ndr_table_netdfs,
 
2465
                        NDR_DFS_ADDSTDROOTFORCED, state, r);
 
2466
        if (tevent_req_nomem(subreq, req)) {
 
2467
                return tevent_req_post(req, ev);
 
2468
        }
 
2469
        tevent_req_set_callback(subreq, dcerpc_dfs_AddStdRootForced_r_done, req);
 
2470
 
 
2471
        return req;
 
2472
}
 
2473
 
 
2474
static void dcerpc_dfs_AddStdRootForced_r_done(struct tevent_req *subreq)
 
2475
{
 
2476
        struct tevent_req *req =
 
2477
                tevent_req_callback_data(subreq,
 
2478
                struct tevent_req);
 
2479
        NTSTATUS status;
 
2480
 
 
2481
        status = dcerpc_binding_handle_call_recv(subreq);
 
2482
        if (!NT_STATUS_IS_OK(status)) {
 
2483
                tevent_req_nterror(req, status);
 
2484
                return;
 
2485
        }
 
2486
 
 
2487
        tevent_req_done(req);
 
2488
}
 
2489
 
 
2490
NTSTATUS dcerpc_dfs_AddStdRootForced_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
 
2491
{
 
2492
        struct dcerpc_dfs_AddStdRootForced_r_state *state =
 
2493
                tevent_req_data(req,
 
2494
                struct dcerpc_dfs_AddStdRootForced_r_state);
 
2495
        NTSTATUS status;
 
2496
 
 
2497
        if (tevent_req_is_nterror(req, &status)) {
 
2498
                tevent_req_received(req);
 
2499
                return status;
 
2500
        }
 
2501
 
 
2502
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
2503
 
 
2504
        tevent_req_received(req);
 
2505
        return NT_STATUS_OK;
 
2506
}
 
2507
 
 
2508
NTSTATUS dcerpc_dfs_AddStdRootForced_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_AddStdRootForced *r)
 
2509
{
 
2510
        NTSTATUS status;
 
2511
 
 
2512
        status = dcerpc_binding_handle_call(h,
 
2513
                        NULL, &ndr_table_netdfs,
 
2514
                        NDR_DFS_ADDSTDROOTFORCED, mem_ctx, r);
 
2515
 
 
2516
        return status;
 
2517
}
 
2518
 
 
2519
struct dcerpc_dfs_AddStdRootForced_state {
 
2520
        struct dfs_AddStdRootForced orig;
 
2521
        struct dfs_AddStdRootForced tmp;
 
2522
        TALLOC_CTX *out_mem_ctx;
 
2523
};
 
2524
 
 
2525
static void dcerpc_dfs_AddStdRootForced_done(struct tevent_req *subreq);
 
2526
 
 
2527
struct tevent_req *dcerpc_dfs_AddStdRootForced_send(TALLOC_CTX *mem_ctx,
 
2528
                                                    struct tevent_context *ev,
 
2529
                                                    struct dcerpc_binding_handle *h,
 
2530
                                                    const char *_servername /* [in] [charset(UTF16)] */,
 
2531
                                                    const char *_rootshare /* [in] [charset(UTF16)] */,
 
2532
                                                    const char *_comment /* [in] [charset(UTF16)] */,
 
2533
                                                    const char *_store /* [in] [charset(UTF16)] */)
 
2534
{
 
2535
        struct tevent_req *req;
 
2536
        struct dcerpc_dfs_AddStdRootForced_state *state;
 
2537
        struct tevent_req *subreq;
 
2538
 
 
2539
        req = tevent_req_create(mem_ctx, &state,
 
2540
                                struct dcerpc_dfs_AddStdRootForced_state);
 
2541
        if (req == NULL) {
 
2542
                return NULL;
 
2543
        }
 
2544
        state->out_mem_ctx = NULL;
 
2545
 
 
2546
        /* In parameters */
 
2547
        state->orig.in.servername = _servername;
 
2548
        state->orig.in.rootshare = _rootshare;
 
2549
        state->orig.in.comment = _comment;
 
2550
        state->orig.in.store = _store;
 
2551
 
 
2552
        /* Out parameters */
 
2553
 
 
2554
        /* Result */
 
2555
        ZERO_STRUCT(state->orig.out.result);
 
2556
 
 
2557
        /* make a temporary copy, that we pass to the dispatch function */
 
2558
        state->tmp = state->orig;
 
2559
 
 
2560
        subreq = dcerpc_dfs_AddStdRootForced_r_send(state, ev, h, &state->tmp);
 
2561
        if (tevent_req_nomem(subreq, req)) {
 
2562
                return tevent_req_post(req, ev);
 
2563
        }
 
2564
        tevent_req_set_callback(subreq, dcerpc_dfs_AddStdRootForced_done, req);
 
2565
        return req;
 
2566
}
 
2567
 
 
2568
static void dcerpc_dfs_AddStdRootForced_done(struct tevent_req *subreq)
 
2569
{
 
2570
        struct tevent_req *req = tevent_req_callback_data(
 
2571
                subreq, struct tevent_req);
 
2572
        struct dcerpc_dfs_AddStdRootForced_state *state = tevent_req_data(
 
2573
                req, struct dcerpc_dfs_AddStdRootForced_state);
 
2574
        NTSTATUS status;
 
2575
        TALLOC_CTX *mem_ctx;
 
2576
 
 
2577
        if (state->out_mem_ctx) {
 
2578
                mem_ctx = state->out_mem_ctx;
 
2579
        } else {
 
2580
                mem_ctx = state;
 
2581
        }
 
2582
 
 
2583
        status = dcerpc_dfs_AddStdRootForced_r_recv(subreq, mem_ctx);
 
2584
        TALLOC_FREE(subreq);
 
2585
        if (!NT_STATUS_IS_OK(status)) {
 
2586
                tevent_req_nterror(req, status);
 
2587
                return;
 
2588
        }
 
2589
 
 
2590
        /* Copy out parameters */
 
2591
 
 
2592
        /* Copy result */
 
2593
        state->orig.out.result = state->tmp.out.result;
 
2594
 
 
2595
        /* Reset temporary structure */
 
2596
        ZERO_STRUCT(state->tmp);
 
2597
 
 
2598
        tevent_req_done(req);
 
2599
}
 
2600
 
 
2601
NTSTATUS dcerpc_dfs_AddStdRootForced_recv(struct tevent_req *req,
 
2602
                                          TALLOC_CTX *mem_ctx,
 
2603
                                          WERROR *result)
 
2604
{
 
2605
        struct dcerpc_dfs_AddStdRootForced_state *state = tevent_req_data(
 
2606
                req, struct dcerpc_dfs_AddStdRootForced_state);
 
2607
        NTSTATUS status;
 
2608
 
 
2609
        if (tevent_req_is_nterror(req, &status)) {
 
2610
                tevent_req_received(req);
 
2611
                return status;
 
2612
        }
 
2613
 
 
2614
        /* Steal possible out parameters to the callers context */
 
2615
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
2616
 
 
2617
        /* Return result */
 
2618
        *result = state->orig.out.result;
 
2619
 
 
2620
        tevent_req_received(req);
 
2621
        return NT_STATUS_OK;
 
2622
}
 
2623
 
 
2624
NTSTATUS dcerpc_dfs_AddStdRootForced(struct dcerpc_binding_handle *h,
 
2625
                                     TALLOC_CTX *mem_ctx,
 
2626
                                     const char *_servername /* [in] [charset(UTF16)] */,
 
2627
                                     const char *_rootshare /* [in] [charset(UTF16)] */,
 
2628
                                     const char *_comment /* [in] [charset(UTF16)] */,
 
2629
                                     const char *_store /* [in] [charset(UTF16)] */,
 
2630
                                     WERROR *result)
 
2631
{
 
2632
        struct dfs_AddStdRootForced r;
 
2633
        NTSTATUS status;
 
2634
 
 
2635
        /* In parameters */
 
2636
        r.in.servername = _servername;
 
2637
        r.in.rootshare = _rootshare;
 
2638
        r.in.comment = _comment;
 
2639
        r.in.store = _store;
 
2640
 
 
2641
        status = dcerpc_dfs_AddStdRootForced_r(h, mem_ctx, &r);
 
2642
        if (!NT_STATUS_IS_OK(status)) {
 
2643
                return status;
 
2644
        }
 
2645
 
 
2646
        /* Return variables */
 
2647
 
 
2648
        /* Return result */
 
2649
        *result = r.out.result;
 
2650
 
 
2651
        return NT_STATUS_OK;
 
2652
}
 
2653
 
 
2654
struct dcerpc_dfs_GetDcAddress_r_state {
 
2655
        TALLOC_CTX *out_mem_ctx;
 
2656
};
 
2657
 
 
2658
static void dcerpc_dfs_GetDcAddress_r_done(struct tevent_req *subreq);
 
2659
 
 
2660
struct tevent_req *dcerpc_dfs_GetDcAddress_r_send(TALLOC_CTX *mem_ctx,
 
2661
        struct tevent_context *ev,
 
2662
        struct dcerpc_binding_handle *h,
 
2663
        struct dfs_GetDcAddress *r)
 
2664
{
 
2665
        struct tevent_req *req;
 
2666
        struct dcerpc_dfs_GetDcAddress_r_state *state;
 
2667
        struct tevent_req *subreq;
 
2668
 
 
2669
        req = tevent_req_create(mem_ctx, &state,
 
2670
                                struct dcerpc_dfs_GetDcAddress_r_state);
 
2671
        if (req == NULL) {
 
2672
                return NULL;
 
2673
        }
 
2674
 
 
2675
        state->out_mem_ctx = talloc_new(state);
 
2676
        if (tevent_req_nomem(state->out_mem_ctx, req)) {
 
2677
                return tevent_req_post(req, ev);
 
2678
        }
 
2679
 
 
2680
        subreq = dcerpc_binding_handle_call_send(state, ev, h,
 
2681
                        NULL, &ndr_table_netdfs,
 
2682
                        NDR_DFS_GETDCADDRESS, state->out_mem_ctx, r);
 
2683
        if (tevent_req_nomem(subreq, req)) {
 
2684
                return tevent_req_post(req, ev);
 
2685
        }
 
2686
        tevent_req_set_callback(subreq, dcerpc_dfs_GetDcAddress_r_done, req);
 
2687
 
 
2688
        return req;
 
2689
}
 
2690
 
 
2691
static void dcerpc_dfs_GetDcAddress_r_done(struct tevent_req *subreq)
 
2692
{
 
2693
        struct tevent_req *req =
 
2694
                tevent_req_callback_data(subreq,
 
2695
                struct tevent_req);
 
2696
        NTSTATUS status;
 
2697
 
 
2698
        status = dcerpc_binding_handle_call_recv(subreq);
 
2699
        if (!NT_STATUS_IS_OK(status)) {
 
2700
                tevent_req_nterror(req, status);
 
2701
                return;
 
2702
        }
 
2703
 
 
2704
        tevent_req_done(req);
 
2705
}
 
2706
 
 
2707
NTSTATUS dcerpc_dfs_GetDcAddress_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
 
2708
{
 
2709
        struct dcerpc_dfs_GetDcAddress_r_state *state =
 
2710
                tevent_req_data(req,
 
2711
                struct dcerpc_dfs_GetDcAddress_r_state);
 
2712
        NTSTATUS status;
 
2713
 
 
2714
        if (tevent_req_is_nterror(req, &status)) {
 
2715
                tevent_req_received(req);
 
2716
                return status;
 
2717
        }
 
2718
 
 
2719
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
2720
 
 
2721
        tevent_req_received(req);
 
2722
        return NT_STATUS_OK;
 
2723
}
 
2724
 
 
2725
NTSTATUS dcerpc_dfs_GetDcAddress_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_GetDcAddress *r)
 
2726
{
 
2727
        NTSTATUS status;
 
2728
 
 
2729
        status = dcerpc_binding_handle_call(h,
 
2730
                        NULL, &ndr_table_netdfs,
 
2731
                        NDR_DFS_GETDCADDRESS, mem_ctx, r);
 
2732
 
 
2733
        return status;
 
2734
}
 
2735
 
 
2736
struct dcerpc_dfs_GetDcAddress_state {
 
2737
        struct dfs_GetDcAddress orig;
 
2738
        struct dfs_GetDcAddress tmp;
 
2739
        TALLOC_CTX *out_mem_ctx;
 
2740
};
 
2741
 
 
2742
static void dcerpc_dfs_GetDcAddress_done(struct tevent_req *subreq);
 
2743
 
 
2744
struct tevent_req *dcerpc_dfs_GetDcAddress_send(TALLOC_CTX *mem_ctx,
 
2745
                                                struct tevent_context *ev,
 
2746
                                                struct dcerpc_binding_handle *h,
 
2747
                                                const char *_servername /* [in] [charset(UTF16)] */,
 
2748
                                                const char **_server_fullname /* [in,out] [ref,charset(UTF16)] */,
 
2749
                                                uint8_t *_is_root /* [in,out] [ref] */,
 
2750
                                                uint32_t *_ttl /* [in,out] [ref] */)
 
2751
{
 
2752
        struct tevent_req *req;
 
2753
        struct dcerpc_dfs_GetDcAddress_state *state;
 
2754
        struct tevent_req *subreq;
 
2755
 
 
2756
        req = tevent_req_create(mem_ctx, &state,
 
2757
                                struct dcerpc_dfs_GetDcAddress_state);
 
2758
        if (req == NULL) {
 
2759
                return NULL;
 
2760
        }
 
2761
        state->out_mem_ctx = NULL;
 
2762
 
 
2763
        /* In parameters */
 
2764
        state->orig.in.servername = _servername;
 
2765
        state->orig.in.server_fullname = _server_fullname;
 
2766
        state->orig.in.is_root = _is_root;
 
2767
        state->orig.in.ttl = _ttl;
 
2768
 
 
2769
        /* Out parameters */
 
2770
        state->orig.out.server_fullname = _server_fullname;
 
2771
        state->orig.out.is_root = _is_root;
 
2772
        state->orig.out.ttl = _ttl;
 
2773
 
 
2774
        /* Result */
 
2775
        ZERO_STRUCT(state->orig.out.result);
 
2776
 
 
2777
        state->out_mem_ctx = talloc_named_const(state, 0,
 
2778
                             "dcerpc_dfs_GetDcAddress_out_memory");
 
2779
        if (tevent_req_nomem(state->out_mem_ctx, req)) {
 
2780
                return tevent_req_post(req, ev);
 
2781
        }
 
2782
 
 
2783
        /* make a temporary copy, that we pass to the dispatch function */
 
2784
        state->tmp = state->orig;
 
2785
 
 
2786
        subreq = dcerpc_dfs_GetDcAddress_r_send(state, ev, h, &state->tmp);
 
2787
        if (tevent_req_nomem(subreq, req)) {
 
2788
                return tevent_req_post(req, ev);
 
2789
        }
 
2790
        tevent_req_set_callback(subreq, dcerpc_dfs_GetDcAddress_done, req);
 
2791
        return req;
 
2792
}
 
2793
 
 
2794
static void dcerpc_dfs_GetDcAddress_done(struct tevent_req *subreq)
 
2795
{
 
2796
        struct tevent_req *req = tevent_req_callback_data(
 
2797
                subreq, struct tevent_req);
 
2798
        struct dcerpc_dfs_GetDcAddress_state *state = tevent_req_data(
 
2799
                req, struct dcerpc_dfs_GetDcAddress_state);
 
2800
        NTSTATUS status;
 
2801
        TALLOC_CTX *mem_ctx;
 
2802
 
 
2803
        if (state->out_mem_ctx) {
 
2804
                mem_ctx = state->out_mem_ctx;
 
2805
        } else {
 
2806
                mem_ctx = state;
 
2807
        }
 
2808
 
 
2809
        status = dcerpc_dfs_GetDcAddress_r_recv(subreq, mem_ctx);
 
2810
        TALLOC_FREE(subreq);
 
2811
        if (!NT_STATUS_IS_OK(status)) {
 
2812
                tevent_req_nterror(req, status);
 
2813
                return;
 
2814
        }
 
2815
 
 
2816
        /* Copy out parameters */
 
2817
        *state->orig.out.server_fullname = *state->tmp.out.server_fullname;
 
2818
        *state->orig.out.is_root = *state->tmp.out.is_root;
 
2819
        *state->orig.out.ttl = *state->tmp.out.ttl;
 
2820
 
 
2821
        /* Copy result */
 
2822
        state->orig.out.result = state->tmp.out.result;
 
2823
 
 
2824
        /* Reset temporary structure */
 
2825
        ZERO_STRUCT(state->tmp);
 
2826
 
 
2827
        tevent_req_done(req);
 
2828
}
 
2829
 
 
2830
NTSTATUS dcerpc_dfs_GetDcAddress_recv(struct tevent_req *req,
 
2831
                                      TALLOC_CTX *mem_ctx,
 
2832
                                      WERROR *result)
 
2833
{
 
2834
        struct dcerpc_dfs_GetDcAddress_state *state = tevent_req_data(
 
2835
                req, struct dcerpc_dfs_GetDcAddress_state);
 
2836
        NTSTATUS status;
 
2837
 
 
2838
        if (tevent_req_is_nterror(req, &status)) {
 
2839
                tevent_req_received(req);
 
2840
                return status;
 
2841
        }
 
2842
 
 
2843
        /* Steal possible out parameters to the callers context */
 
2844
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
2845
 
 
2846
        /* Return result */
 
2847
        *result = state->orig.out.result;
 
2848
 
 
2849
        tevent_req_received(req);
 
2850
        return NT_STATUS_OK;
 
2851
}
 
2852
 
 
2853
NTSTATUS dcerpc_dfs_GetDcAddress(struct dcerpc_binding_handle *h,
 
2854
                                 TALLOC_CTX *mem_ctx,
 
2855
                                 const char *_servername /* [in] [charset(UTF16)] */,
 
2856
                                 const char **_server_fullname /* [in,out] [ref,charset(UTF16)] */,
 
2857
                                 uint8_t *_is_root /* [in,out] [ref] */,
 
2858
                                 uint32_t *_ttl /* [in,out] [ref] */,
 
2859
                                 WERROR *result)
 
2860
{
 
2861
        struct dfs_GetDcAddress r;
 
2862
        NTSTATUS status;
 
2863
 
 
2864
        /* In parameters */
 
2865
        r.in.servername = _servername;
 
2866
        r.in.server_fullname = _server_fullname;
 
2867
        r.in.is_root = _is_root;
 
2868
        r.in.ttl = _ttl;
 
2869
 
 
2870
        status = dcerpc_dfs_GetDcAddress_r(h, mem_ctx, &r);
 
2871
        if (!NT_STATUS_IS_OK(status)) {
 
2872
                return status;
 
2873
        }
 
2874
 
 
2875
        /* Return variables */
 
2876
        *_server_fullname = *r.out.server_fullname;
 
2877
        *_is_root = *r.out.is_root;
 
2878
        *_ttl = *r.out.ttl;
 
2879
 
 
2880
        /* Return result */
 
2881
        *result = r.out.result;
 
2882
 
 
2883
        return NT_STATUS_OK;
 
2884
}
 
2885
 
 
2886
struct dcerpc_dfs_SetDcAddress_r_state {
 
2887
        TALLOC_CTX *out_mem_ctx;
 
2888
};
 
2889
 
 
2890
static void dcerpc_dfs_SetDcAddress_r_done(struct tevent_req *subreq);
 
2891
 
 
2892
struct tevent_req *dcerpc_dfs_SetDcAddress_r_send(TALLOC_CTX *mem_ctx,
 
2893
        struct tevent_context *ev,
 
2894
        struct dcerpc_binding_handle *h,
 
2895
        struct dfs_SetDcAddress *r)
 
2896
{
 
2897
        struct tevent_req *req;
 
2898
        struct dcerpc_dfs_SetDcAddress_r_state *state;
 
2899
        struct tevent_req *subreq;
 
2900
 
 
2901
        req = tevent_req_create(mem_ctx, &state,
 
2902
                                struct dcerpc_dfs_SetDcAddress_r_state);
 
2903
        if (req == NULL) {
 
2904
                return NULL;
 
2905
        }
 
2906
 
 
2907
        state->out_mem_ctx = NULL;
 
2908
 
 
2909
        subreq = dcerpc_binding_handle_call_send(state, ev, h,
 
2910
                        NULL, &ndr_table_netdfs,
 
2911
                        NDR_DFS_SETDCADDRESS, state, r);
 
2912
        if (tevent_req_nomem(subreq, req)) {
 
2913
                return tevent_req_post(req, ev);
 
2914
        }
 
2915
        tevent_req_set_callback(subreq, dcerpc_dfs_SetDcAddress_r_done, req);
 
2916
 
 
2917
        return req;
 
2918
}
 
2919
 
 
2920
static void dcerpc_dfs_SetDcAddress_r_done(struct tevent_req *subreq)
 
2921
{
 
2922
        struct tevent_req *req =
 
2923
                tevent_req_callback_data(subreq,
 
2924
                struct tevent_req);
 
2925
        NTSTATUS status;
 
2926
 
 
2927
        status = dcerpc_binding_handle_call_recv(subreq);
 
2928
        if (!NT_STATUS_IS_OK(status)) {
 
2929
                tevent_req_nterror(req, status);
 
2930
                return;
 
2931
        }
 
2932
 
 
2933
        tevent_req_done(req);
 
2934
}
 
2935
 
 
2936
NTSTATUS dcerpc_dfs_SetDcAddress_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
 
2937
{
 
2938
        struct dcerpc_dfs_SetDcAddress_r_state *state =
 
2939
                tevent_req_data(req,
 
2940
                struct dcerpc_dfs_SetDcAddress_r_state);
 
2941
        NTSTATUS status;
 
2942
 
 
2943
        if (tevent_req_is_nterror(req, &status)) {
 
2944
                tevent_req_received(req);
 
2945
                return status;
 
2946
        }
 
2947
 
 
2948
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
2949
 
 
2950
        tevent_req_received(req);
 
2951
        return NT_STATUS_OK;
 
2952
}
 
2953
 
 
2954
NTSTATUS dcerpc_dfs_SetDcAddress_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_SetDcAddress *r)
 
2955
{
 
2956
        NTSTATUS status;
 
2957
 
 
2958
        status = dcerpc_binding_handle_call(h,
 
2959
                        NULL, &ndr_table_netdfs,
 
2960
                        NDR_DFS_SETDCADDRESS, mem_ctx, r);
 
2961
 
 
2962
        return status;
 
2963
}
 
2964
 
 
2965
struct dcerpc_dfs_SetDcAddress_state {
 
2966
        struct dfs_SetDcAddress orig;
 
2967
        struct dfs_SetDcAddress tmp;
 
2968
        TALLOC_CTX *out_mem_ctx;
 
2969
};
 
2970
 
 
2971
static void dcerpc_dfs_SetDcAddress_done(struct tevent_req *subreq);
 
2972
 
 
2973
struct tevent_req *dcerpc_dfs_SetDcAddress_send(TALLOC_CTX *mem_ctx,
 
2974
                                                struct tevent_context *ev,
 
2975
                                                struct dcerpc_binding_handle *h,
 
2976
                                                const char *_servername /* [in] [charset(UTF16)] */,
 
2977
                                                const char *_server_fullname /* [in] [charset(UTF16)] */,
 
2978
                                                uint32_t _flags /* [in]  */,
 
2979
                                                uint32_t _ttl /* [in]  */)
 
2980
{
 
2981
        struct tevent_req *req;
 
2982
        struct dcerpc_dfs_SetDcAddress_state *state;
 
2983
        struct tevent_req *subreq;
 
2984
 
 
2985
        req = tevent_req_create(mem_ctx, &state,
 
2986
                                struct dcerpc_dfs_SetDcAddress_state);
 
2987
        if (req == NULL) {
 
2988
                return NULL;
 
2989
        }
 
2990
        state->out_mem_ctx = NULL;
 
2991
 
 
2992
        /* In parameters */
 
2993
        state->orig.in.servername = _servername;
 
2994
        state->orig.in.server_fullname = _server_fullname;
 
2995
        state->orig.in.flags = _flags;
 
2996
        state->orig.in.ttl = _ttl;
 
2997
 
 
2998
        /* Out parameters */
 
2999
 
 
3000
        /* Result */
 
3001
        ZERO_STRUCT(state->orig.out.result);
 
3002
 
 
3003
        /* make a temporary copy, that we pass to the dispatch function */
 
3004
        state->tmp = state->orig;
 
3005
 
 
3006
        subreq = dcerpc_dfs_SetDcAddress_r_send(state, ev, h, &state->tmp);
 
3007
        if (tevent_req_nomem(subreq, req)) {
 
3008
                return tevent_req_post(req, ev);
 
3009
        }
 
3010
        tevent_req_set_callback(subreq, dcerpc_dfs_SetDcAddress_done, req);
 
3011
        return req;
 
3012
}
 
3013
 
 
3014
static void dcerpc_dfs_SetDcAddress_done(struct tevent_req *subreq)
 
3015
{
 
3016
        struct tevent_req *req = tevent_req_callback_data(
 
3017
                subreq, struct tevent_req);
 
3018
        struct dcerpc_dfs_SetDcAddress_state *state = tevent_req_data(
 
3019
                req, struct dcerpc_dfs_SetDcAddress_state);
 
3020
        NTSTATUS status;
 
3021
        TALLOC_CTX *mem_ctx;
 
3022
 
 
3023
        if (state->out_mem_ctx) {
 
3024
                mem_ctx = state->out_mem_ctx;
 
3025
        } else {
 
3026
                mem_ctx = state;
 
3027
        }
 
3028
 
 
3029
        status = dcerpc_dfs_SetDcAddress_r_recv(subreq, mem_ctx);
 
3030
        TALLOC_FREE(subreq);
 
3031
        if (!NT_STATUS_IS_OK(status)) {
 
3032
                tevent_req_nterror(req, status);
 
3033
                return;
 
3034
        }
 
3035
 
 
3036
        /* Copy out parameters */
 
3037
 
 
3038
        /* Copy result */
 
3039
        state->orig.out.result = state->tmp.out.result;
 
3040
 
 
3041
        /* Reset temporary structure */
 
3042
        ZERO_STRUCT(state->tmp);
 
3043
 
 
3044
        tevent_req_done(req);
 
3045
}
 
3046
 
 
3047
NTSTATUS dcerpc_dfs_SetDcAddress_recv(struct tevent_req *req,
 
3048
                                      TALLOC_CTX *mem_ctx,
 
3049
                                      WERROR *result)
 
3050
{
 
3051
        struct dcerpc_dfs_SetDcAddress_state *state = tevent_req_data(
 
3052
                req, struct dcerpc_dfs_SetDcAddress_state);
 
3053
        NTSTATUS status;
 
3054
 
 
3055
        if (tevent_req_is_nterror(req, &status)) {
 
3056
                tevent_req_received(req);
 
3057
                return status;
 
3058
        }
 
3059
 
 
3060
        /* Steal possible out parameters to the callers context */
 
3061
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
3062
 
 
3063
        /* Return result */
 
3064
        *result = state->orig.out.result;
 
3065
 
 
3066
        tevent_req_received(req);
 
3067
        return NT_STATUS_OK;
 
3068
}
 
3069
 
 
3070
NTSTATUS dcerpc_dfs_SetDcAddress(struct dcerpc_binding_handle *h,
 
3071
                                 TALLOC_CTX *mem_ctx,
 
3072
                                 const char *_servername /* [in] [charset(UTF16)] */,
 
3073
                                 const char *_server_fullname /* [in] [charset(UTF16)] */,
 
3074
                                 uint32_t _flags /* [in]  */,
 
3075
                                 uint32_t _ttl /* [in]  */,
 
3076
                                 WERROR *result)
 
3077
{
 
3078
        struct dfs_SetDcAddress r;
 
3079
        NTSTATUS status;
 
3080
 
 
3081
        /* In parameters */
 
3082
        r.in.servername = _servername;
 
3083
        r.in.server_fullname = _server_fullname;
 
3084
        r.in.flags = _flags;
 
3085
        r.in.ttl = _ttl;
 
3086
 
 
3087
        status = dcerpc_dfs_SetDcAddress_r(h, mem_ctx, &r);
 
3088
        if (!NT_STATUS_IS_OK(status)) {
 
3089
                return status;
 
3090
        }
 
3091
 
 
3092
        /* Return variables */
 
3093
 
 
3094
        /* Return result */
 
3095
        *result = r.out.result;
 
3096
 
 
3097
        return NT_STATUS_OK;
 
3098
}
 
3099
 
 
3100
struct dcerpc_dfs_FlushFtTable_r_state {
 
3101
        TALLOC_CTX *out_mem_ctx;
 
3102
};
 
3103
 
 
3104
static void dcerpc_dfs_FlushFtTable_r_done(struct tevent_req *subreq);
 
3105
 
 
3106
struct tevent_req *dcerpc_dfs_FlushFtTable_r_send(TALLOC_CTX *mem_ctx,
 
3107
        struct tevent_context *ev,
 
3108
        struct dcerpc_binding_handle *h,
 
3109
        struct dfs_FlushFtTable *r)
 
3110
{
 
3111
        struct tevent_req *req;
 
3112
        struct dcerpc_dfs_FlushFtTable_r_state *state;
 
3113
        struct tevent_req *subreq;
 
3114
 
 
3115
        req = tevent_req_create(mem_ctx, &state,
 
3116
                                struct dcerpc_dfs_FlushFtTable_r_state);
 
3117
        if (req == NULL) {
 
3118
                return NULL;
 
3119
        }
 
3120
 
 
3121
        state->out_mem_ctx = NULL;
 
3122
 
 
3123
        subreq = dcerpc_binding_handle_call_send(state, ev, h,
 
3124
                        NULL, &ndr_table_netdfs,
 
3125
                        NDR_DFS_FLUSHFTTABLE, state, r);
 
3126
        if (tevent_req_nomem(subreq, req)) {
 
3127
                return tevent_req_post(req, ev);
 
3128
        }
 
3129
        tevent_req_set_callback(subreq, dcerpc_dfs_FlushFtTable_r_done, req);
 
3130
 
 
3131
        return req;
 
3132
}
 
3133
 
 
3134
static void dcerpc_dfs_FlushFtTable_r_done(struct tevent_req *subreq)
 
3135
{
 
3136
        struct tevent_req *req =
 
3137
                tevent_req_callback_data(subreq,
 
3138
                struct tevent_req);
 
3139
        NTSTATUS status;
 
3140
 
 
3141
        status = dcerpc_binding_handle_call_recv(subreq);
 
3142
        if (!NT_STATUS_IS_OK(status)) {
 
3143
                tevent_req_nterror(req, status);
 
3144
                return;
 
3145
        }
 
3146
 
 
3147
        tevent_req_done(req);
 
3148
}
 
3149
 
 
3150
NTSTATUS dcerpc_dfs_FlushFtTable_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
 
3151
{
 
3152
        struct dcerpc_dfs_FlushFtTable_r_state *state =
 
3153
                tevent_req_data(req,
 
3154
                struct dcerpc_dfs_FlushFtTable_r_state);
 
3155
        NTSTATUS status;
 
3156
 
 
3157
        if (tevent_req_is_nterror(req, &status)) {
 
3158
                tevent_req_received(req);
 
3159
                return status;
 
3160
        }
 
3161
 
 
3162
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
3163
 
 
3164
        tevent_req_received(req);
 
3165
        return NT_STATUS_OK;
 
3166
}
 
3167
 
 
3168
NTSTATUS dcerpc_dfs_FlushFtTable_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_FlushFtTable *r)
 
3169
{
 
3170
        NTSTATUS status;
 
3171
 
 
3172
        status = dcerpc_binding_handle_call(h,
 
3173
                        NULL, &ndr_table_netdfs,
 
3174
                        NDR_DFS_FLUSHFTTABLE, mem_ctx, r);
 
3175
 
 
3176
        return status;
 
3177
}
 
3178
 
 
3179
struct dcerpc_dfs_FlushFtTable_state {
 
3180
        struct dfs_FlushFtTable orig;
 
3181
        struct dfs_FlushFtTable tmp;
 
3182
        TALLOC_CTX *out_mem_ctx;
 
3183
};
 
3184
 
 
3185
static void dcerpc_dfs_FlushFtTable_done(struct tevent_req *subreq);
 
3186
 
 
3187
struct tevent_req *dcerpc_dfs_FlushFtTable_send(TALLOC_CTX *mem_ctx,
 
3188
                                                struct tevent_context *ev,
 
3189
                                                struct dcerpc_binding_handle *h,
 
3190
                                                const char *_servername /* [in] [charset(UTF16)] */,
 
3191
                                                const char *_rootshare /* [in] [charset(UTF16)] */)
 
3192
{
 
3193
        struct tevent_req *req;
 
3194
        struct dcerpc_dfs_FlushFtTable_state *state;
 
3195
        struct tevent_req *subreq;
 
3196
 
 
3197
        req = tevent_req_create(mem_ctx, &state,
 
3198
                                struct dcerpc_dfs_FlushFtTable_state);
 
3199
        if (req == NULL) {
 
3200
                return NULL;
 
3201
        }
 
3202
        state->out_mem_ctx = NULL;
 
3203
 
 
3204
        /* In parameters */
 
3205
        state->orig.in.servername = _servername;
 
3206
        state->orig.in.rootshare = _rootshare;
 
3207
 
 
3208
        /* Out parameters */
 
3209
 
 
3210
        /* Result */
 
3211
        ZERO_STRUCT(state->orig.out.result);
 
3212
 
 
3213
        /* make a temporary copy, that we pass to the dispatch function */
 
3214
        state->tmp = state->orig;
 
3215
 
 
3216
        subreq = dcerpc_dfs_FlushFtTable_r_send(state, ev, h, &state->tmp);
 
3217
        if (tevent_req_nomem(subreq, req)) {
 
3218
                return tevent_req_post(req, ev);
 
3219
        }
 
3220
        tevent_req_set_callback(subreq, dcerpc_dfs_FlushFtTable_done, req);
 
3221
        return req;
 
3222
}
 
3223
 
 
3224
static void dcerpc_dfs_FlushFtTable_done(struct tevent_req *subreq)
 
3225
{
 
3226
        struct tevent_req *req = tevent_req_callback_data(
 
3227
                subreq, struct tevent_req);
 
3228
        struct dcerpc_dfs_FlushFtTable_state *state = tevent_req_data(
 
3229
                req, struct dcerpc_dfs_FlushFtTable_state);
 
3230
        NTSTATUS status;
 
3231
        TALLOC_CTX *mem_ctx;
 
3232
 
 
3233
        if (state->out_mem_ctx) {
 
3234
                mem_ctx = state->out_mem_ctx;
 
3235
        } else {
 
3236
                mem_ctx = state;
 
3237
        }
 
3238
 
 
3239
        status = dcerpc_dfs_FlushFtTable_r_recv(subreq, mem_ctx);
 
3240
        TALLOC_FREE(subreq);
 
3241
        if (!NT_STATUS_IS_OK(status)) {
 
3242
                tevent_req_nterror(req, status);
 
3243
                return;
 
3244
        }
 
3245
 
 
3246
        /* Copy out parameters */
 
3247
 
 
3248
        /* Copy result */
 
3249
        state->orig.out.result = state->tmp.out.result;
 
3250
 
 
3251
        /* Reset temporary structure */
 
3252
        ZERO_STRUCT(state->tmp);
 
3253
 
 
3254
        tevent_req_done(req);
 
3255
}
 
3256
 
 
3257
NTSTATUS dcerpc_dfs_FlushFtTable_recv(struct tevent_req *req,
 
3258
                                      TALLOC_CTX *mem_ctx,
 
3259
                                      WERROR *result)
 
3260
{
 
3261
        struct dcerpc_dfs_FlushFtTable_state *state = tevent_req_data(
 
3262
                req, struct dcerpc_dfs_FlushFtTable_state);
 
3263
        NTSTATUS status;
 
3264
 
 
3265
        if (tevent_req_is_nterror(req, &status)) {
 
3266
                tevent_req_received(req);
 
3267
                return status;
 
3268
        }
 
3269
 
 
3270
        /* Steal possible out parameters to the callers context */
 
3271
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
3272
 
 
3273
        /* Return result */
 
3274
        *result = state->orig.out.result;
 
3275
 
 
3276
        tevent_req_received(req);
 
3277
        return NT_STATUS_OK;
 
3278
}
 
3279
 
 
3280
NTSTATUS dcerpc_dfs_FlushFtTable(struct dcerpc_binding_handle *h,
 
3281
                                 TALLOC_CTX *mem_ctx,
 
3282
                                 const char *_servername /* [in] [charset(UTF16)] */,
 
3283
                                 const char *_rootshare /* [in] [charset(UTF16)] */,
 
3284
                                 WERROR *result)
 
3285
{
 
3286
        struct dfs_FlushFtTable r;
 
3287
        NTSTATUS status;
 
3288
 
 
3289
        /* In parameters */
 
3290
        r.in.servername = _servername;
 
3291
        r.in.rootshare = _rootshare;
 
3292
 
 
3293
        status = dcerpc_dfs_FlushFtTable_r(h, mem_ctx, &r);
 
3294
        if (!NT_STATUS_IS_OK(status)) {
 
3295
                return status;
 
3296
        }
 
3297
 
 
3298
        /* Return variables */
 
3299
 
 
3300
        /* Return result */
 
3301
        *result = r.out.result;
 
3302
 
 
3303
        return NT_STATUS_OK;
 
3304
}
 
3305
 
 
3306
struct dcerpc_dfs_EnumEx_r_state {
 
3307
        TALLOC_CTX *out_mem_ctx;
 
3308
};
 
3309
 
 
3310
static void dcerpc_dfs_EnumEx_r_done(struct tevent_req *subreq);
 
3311
 
 
3312
struct tevent_req *dcerpc_dfs_EnumEx_r_send(TALLOC_CTX *mem_ctx,
 
3313
        struct tevent_context *ev,
 
3314
        struct dcerpc_binding_handle *h,
 
3315
        struct dfs_EnumEx *r)
 
3316
{
 
3317
        struct tevent_req *req;
 
3318
        struct dcerpc_dfs_EnumEx_r_state *state;
 
3319
        struct tevent_req *subreq;
 
3320
 
 
3321
        req = tevent_req_create(mem_ctx, &state,
 
3322
                                struct dcerpc_dfs_EnumEx_r_state);
 
3323
        if (req == NULL) {
 
3324
                return NULL;
 
3325
        }
 
3326
 
 
3327
        state->out_mem_ctx = talloc_new(state);
 
3328
        if (tevent_req_nomem(state->out_mem_ctx, req)) {
 
3329
                return tevent_req_post(req, ev);
 
3330
        }
 
3331
 
 
3332
        subreq = dcerpc_binding_handle_call_send(state, ev, h,
 
3333
                        NULL, &ndr_table_netdfs,
 
3334
                        NDR_DFS_ENUMEX, state->out_mem_ctx, r);
 
3335
        if (tevent_req_nomem(subreq, req)) {
 
3336
                return tevent_req_post(req, ev);
 
3337
        }
 
3338
        tevent_req_set_callback(subreq, dcerpc_dfs_EnumEx_r_done, req);
 
3339
 
 
3340
        return req;
 
3341
}
 
3342
 
 
3343
static void dcerpc_dfs_EnumEx_r_done(struct tevent_req *subreq)
 
3344
{
 
3345
        struct tevent_req *req =
 
3346
                tevent_req_callback_data(subreq,
 
3347
                struct tevent_req);
 
3348
        NTSTATUS status;
 
3349
 
 
3350
        status = dcerpc_binding_handle_call_recv(subreq);
 
3351
        if (!NT_STATUS_IS_OK(status)) {
 
3352
                tevent_req_nterror(req, status);
 
3353
                return;
 
3354
        }
 
3355
 
 
3356
        tevent_req_done(req);
 
3357
}
 
3358
 
 
3359
NTSTATUS dcerpc_dfs_EnumEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
 
3360
{
 
3361
        struct dcerpc_dfs_EnumEx_r_state *state =
 
3362
                tevent_req_data(req,
 
3363
                struct dcerpc_dfs_EnumEx_r_state);
 
3364
        NTSTATUS status;
 
3365
 
 
3366
        if (tevent_req_is_nterror(req, &status)) {
 
3367
                tevent_req_received(req);
 
3368
                return status;
 
3369
        }
 
3370
 
 
3371
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
3372
 
 
3373
        tevent_req_received(req);
 
3374
        return NT_STATUS_OK;
 
3375
}
 
3376
 
 
3377
NTSTATUS dcerpc_dfs_EnumEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct dfs_EnumEx *r)
 
3378
{
 
3379
        NTSTATUS status;
 
3380
 
 
3381
        status = dcerpc_binding_handle_call(h,
 
3382
                        NULL, &ndr_table_netdfs,
 
3383
                        NDR_DFS_ENUMEX, mem_ctx, r);
 
3384
 
 
3385
        return status;
 
3386
}
 
3387
 
 
3388
struct dcerpc_dfs_EnumEx_state {
 
3389
        struct dfs_EnumEx orig;
 
3390
        struct dfs_EnumEx tmp;
 
3391
        TALLOC_CTX *out_mem_ctx;
 
3392
};
 
3393
 
 
3394
static void dcerpc_dfs_EnumEx_done(struct tevent_req *subreq);
 
3395
 
 
3396
struct tevent_req *dcerpc_dfs_EnumEx_send(TALLOC_CTX *mem_ctx,
 
3397
                                          struct tevent_context *ev,
 
3398
                                          struct dcerpc_binding_handle *h,
 
3399
                                          const char *_dfs_name /* [in] [charset(UTF16)] */,
 
3400
                                          uint32_t _level /* [in]  */,
 
3401
                                          uint32_t _bufsize /* [in]  */,
 
3402
                                          struct dfs_EnumStruct *_info /* [in,out] [unique] */,
 
3403
                                          uint32_t *_total /* [in,out] [unique] */)
 
3404
{
 
3405
        struct tevent_req *req;
 
3406
        struct dcerpc_dfs_EnumEx_state *state;
 
3407
        struct tevent_req *subreq;
 
3408
 
 
3409
        req = tevent_req_create(mem_ctx, &state,
 
3410
                                struct dcerpc_dfs_EnumEx_state);
 
3411
        if (req == NULL) {
 
3412
                return NULL;
 
3413
        }
 
3414
        state->out_mem_ctx = NULL;
 
3415
 
 
3416
        /* In parameters */
 
3417
        state->orig.in.dfs_name = _dfs_name;
 
3418
        state->orig.in.level = _level;
 
3419
        state->orig.in.bufsize = _bufsize;
 
3420
        state->orig.in.info = _info;
 
3421
        state->orig.in.total = _total;
 
3422
 
 
3423
        /* Out parameters */
 
3424
        state->orig.out.info = _info;
 
3425
        state->orig.out.total = _total;
 
3426
 
 
3427
        /* Result */
 
3428
        ZERO_STRUCT(state->orig.out.result);
 
3429
 
 
3430
        state->out_mem_ctx = talloc_named_const(state, 0,
 
3431
                             "dcerpc_dfs_EnumEx_out_memory");
 
3432
        if (tevent_req_nomem(state->out_mem_ctx, req)) {
 
3433
                return tevent_req_post(req, ev);
 
3434
        }
 
3435
 
 
3436
        /* make a temporary copy, that we pass to the dispatch function */
 
3437
        state->tmp = state->orig;
 
3438
 
 
3439
        subreq = dcerpc_dfs_EnumEx_r_send(state, ev, h, &state->tmp);
 
3440
        if (tevent_req_nomem(subreq, req)) {
 
3441
                return tevent_req_post(req, ev);
 
3442
        }
 
3443
        tevent_req_set_callback(subreq, dcerpc_dfs_EnumEx_done, req);
 
3444
        return req;
 
3445
}
 
3446
 
 
3447
static void dcerpc_dfs_EnumEx_done(struct tevent_req *subreq)
 
3448
{
 
3449
        struct tevent_req *req = tevent_req_callback_data(
 
3450
                subreq, struct tevent_req);
 
3451
        struct dcerpc_dfs_EnumEx_state *state = tevent_req_data(
 
3452
                req, struct dcerpc_dfs_EnumEx_state);
 
3453
        NTSTATUS status;
 
3454
        TALLOC_CTX *mem_ctx;
 
3455
 
 
3456
        if (state->out_mem_ctx) {
 
3457
                mem_ctx = state->out_mem_ctx;
 
3458
        } else {
 
3459
                mem_ctx = state;
 
3460
        }
 
3461
 
 
3462
        status = dcerpc_dfs_EnumEx_r_recv(subreq, mem_ctx);
 
3463
        TALLOC_FREE(subreq);
 
3464
        if (!NT_STATUS_IS_OK(status)) {
 
3465
                tevent_req_nterror(req, status);
 
3466
                return;
 
3467
        }
 
3468
 
 
3469
        /* Copy out parameters */
 
3470
        if (state->orig.out.info && state->tmp.out.info) {
 
3471
                *state->orig.out.info = *state->tmp.out.info;
 
3472
        }
 
3473
        if (state->orig.out.total && state->tmp.out.total) {
 
3474
                *state->orig.out.total = *state->tmp.out.total;
 
3475
        }
 
3476
 
 
3477
        /* Copy result */
 
3478
        state->orig.out.result = state->tmp.out.result;
 
3479
 
 
3480
        /* Reset temporary structure */
 
3481
        ZERO_STRUCT(state->tmp);
 
3482
 
 
3483
        tevent_req_done(req);
 
3484
}
 
3485
 
 
3486
NTSTATUS dcerpc_dfs_EnumEx_recv(struct tevent_req *req,
 
3487
                                TALLOC_CTX *mem_ctx,
 
3488
                                WERROR *result)
 
3489
{
 
3490
        struct dcerpc_dfs_EnumEx_state *state = tevent_req_data(
 
3491
                req, struct dcerpc_dfs_EnumEx_state);
 
3492
        NTSTATUS status;
 
3493
 
 
3494
        if (tevent_req_is_nterror(req, &status)) {
 
3495
                tevent_req_received(req);
 
3496
                return status;
 
3497
        }
 
3498
 
 
3499
        /* Steal possible out parameters to the callers context */
 
3500
        talloc_steal(mem_ctx, state->out_mem_ctx);
 
3501
 
 
3502
        /* Return result */
 
3503
        *result = state->orig.out.result;
 
3504
 
 
3505
        tevent_req_received(req);
 
3506
        return NT_STATUS_OK;
 
3507
}
 
3508
 
 
3509
NTSTATUS dcerpc_dfs_EnumEx(struct dcerpc_binding_handle *h,
 
3510
                           TALLOC_CTX *mem_ctx,
 
3511
                           const char *_dfs_name /* [in] [charset(UTF16)] */,
 
3512
                           uint32_t _level /* [in]  */,
 
3513
                           uint32_t _bufsize /* [in]  */,
 
3514
                           struct dfs_EnumStruct *_info /* [in,out] [unique] */,
 
3515
                           uint32_t *_total /* [in,out] [unique] */,
 
3516
                           WERROR *result)
 
3517
{
 
3518
        struct dfs_EnumEx r;
 
3519
        NTSTATUS status;
 
3520
 
 
3521
        /* In parameters */
 
3522
        r.in.dfs_name = _dfs_name;
 
3523
        r.in.level = _level;
 
3524
        r.in.bufsize = _bufsize;
 
3525
        r.in.info = _info;
 
3526
        r.in.total = _total;
 
3527
 
 
3528
        status = dcerpc_dfs_EnumEx_r(h, mem_ctx, &r);
 
3529
        if (!NT_STATUS_IS_OK(status)) {
 
3530
                return status;
 
3531
        }
 
3532
 
 
3533
        /* Return variables */
 
3534
        if (_info && r.out.info) {
 
3535
                *_info = *r.out.info;
 
3536
        }
 
3537
        if (_total && r.out.total) {
 
3538
                *_total = *r.out.total;
 
3539
        }
 
3540
 
 
3541
        /* Return result */
 
3542
        *result = r.out.result;
 
3543
 
 
3544
        return NT_STATUS_OK;
 
3545
}
 
3546