~zulcss/samba/server-dailies-3.4

« back to all changes in this revision

Viewing changes to librpc/gen_ndr/srv_epmapper.c

  • Committer: Chuck Short
  • Date: 2010-09-28 20:38:39 UTC
  • Revision ID: zulcss@ubuntu.com-20100928203839-pgjulytsi9ue63x1
Initial version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Unix SMB/CIFS implementation.
 
3
 * server auto-generated by pidl. DO NOT MODIFY!
 
4
 */
 
5
 
 
6
#include "includes.h"
 
7
#include "../librpc/gen_ndr/srv_epmapper.h"
 
8
 
 
9
static bool api_epm_Insert(pipes_struct *p)
 
10
{
 
11
        const struct ndr_interface_call *call;
 
12
        struct ndr_pull *pull;
 
13
        struct ndr_push *push;
 
14
        enum ndr_err_code ndr_err;
 
15
        DATA_BLOB blob;
 
16
        struct epm_Insert *r;
 
17
 
 
18
        call = &ndr_table_epmapper.calls[NDR_EPM_INSERT];
 
19
 
 
20
        r = talloc(talloc_tos(), struct epm_Insert);
 
21
        if (r == NULL) {
 
22
                return false;
 
23
        }
 
24
 
 
25
        if (!prs_data_blob(&p->in_data.data, &blob, r)) {
 
26
                talloc_free(r);
 
27
                return false;
 
28
        }
 
29
 
 
30
        pull = ndr_pull_init_blob(&blob, r, NULL);
 
31
        if (pull == NULL) {
 
32
                talloc_free(r);
 
33
                return false;
 
34
        }
 
35
 
 
36
        pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
37
        ndr_err = call->ndr_pull(pull, NDR_IN, r);
 
38
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
39
                talloc_free(r);
 
40
                return false;
 
41
        }
 
42
 
 
43
        if (DEBUGLEVEL >= 10) {
 
44
                NDR_PRINT_IN_DEBUG(epm_Insert, r);
 
45
        }
 
46
 
 
47
        r->out.result = _epm_Insert(p, r);
 
48
 
 
49
        if (p->rng_fault_state) {
 
50
                talloc_free(r);
 
51
                /* Return true here, srv_pipe_hnd.c will take care */
 
52
                return true;
 
53
        }
 
54
 
 
55
        if (DEBUGLEVEL >= 10) {
 
56
                NDR_PRINT_OUT_DEBUG(epm_Insert, r);
 
57
        }
 
58
 
 
59
        push = ndr_push_init_ctx(r, NULL);
 
60
        if (push == NULL) {
 
61
                talloc_free(r);
 
62
                return false;
 
63
        }
 
64
 
 
65
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
66
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
67
                talloc_free(r);
 
68
                return false;
 
69
        }
 
70
 
 
71
        blob = ndr_push_blob(push);
 
72
        if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
 
73
                talloc_free(r);
 
74
                return false;
 
75
        }
 
76
 
 
77
        talloc_free(r);
 
78
 
 
79
        return true;
 
80
}
 
81
 
 
82
static bool api_epm_Delete(pipes_struct *p)
 
83
{
 
84
        const struct ndr_interface_call *call;
 
85
        struct ndr_pull *pull;
 
86
        struct ndr_push *push;
 
87
        enum ndr_err_code ndr_err;
 
88
        DATA_BLOB blob;
 
89
        struct epm_Delete *r;
 
90
 
 
91
        call = &ndr_table_epmapper.calls[NDR_EPM_DELETE];
 
92
 
 
93
        r = talloc(talloc_tos(), struct epm_Delete);
 
94
        if (r == NULL) {
 
95
                return false;
 
96
        }
 
97
 
 
98
        if (!prs_data_blob(&p->in_data.data, &blob, r)) {
 
99
                talloc_free(r);
 
100
                return false;
 
101
        }
 
102
 
 
103
        pull = ndr_pull_init_blob(&blob, r, NULL);
 
104
        if (pull == NULL) {
 
105
                talloc_free(r);
 
106
                return false;
 
107
        }
 
108
 
 
109
        pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
110
        ndr_err = call->ndr_pull(pull, NDR_IN, r);
 
111
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
112
                talloc_free(r);
 
113
                return false;
 
114
        }
 
115
 
 
116
        if (DEBUGLEVEL >= 10) {
 
117
                NDR_PRINT_IN_DEBUG(epm_Delete, r);
 
118
        }
 
119
 
 
120
        r->out.result = _epm_Delete(p, r);
 
121
 
 
122
        if (p->rng_fault_state) {
 
123
                talloc_free(r);
 
124
                /* Return true here, srv_pipe_hnd.c will take care */
 
125
                return true;
 
126
        }
 
127
 
 
128
        if (DEBUGLEVEL >= 10) {
 
129
                NDR_PRINT_OUT_DEBUG(epm_Delete, r);
 
130
        }
 
131
 
 
132
        push = ndr_push_init_ctx(r, NULL);
 
133
        if (push == NULL) {
 
134
                talloc_free(r);
 
135
                return false;
 
136
        }
 
137
 
 
138
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
139
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
140
                talloc_free(r);
 
141
                return false;
 
142
        }
 
143
 
 
144
        blob = ndr_push_blob(push);
 
145
        if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
 
146
                talloc_free(r);
 
147
                return false;
 
148
        }
 
149
 
 
150
        talloc_free(r);
 
151
 
 
152
        return true;
 
153
}
 
154
 
 
155
static bool api_epm_Lookup(pipes_struct *p)
 
156
{
 
157
        const struct ndr_interface_call *call;
 
158
        struct ndr_pull *pull;
 
159
        struct ndr_push *push;
 
160
        enum ndr_err_code ndr_err;
 
161
        DATA_BLOB blob;
 
162
        struct epm_Lookup *r;
 
163
 
 
164
        call = &ndr_table_epmapper.calls[NDR_EPM_LOOKUP];
 
165
 
 
166
        r = talloc(talloc_tos(), struct epm_Lookup);
 
167
        if (r == NULL) {
 
168
                return false;
 
169
        }
 
170
 
 
171
        if (!prs_data_blob(&p->in_data.data, &blob, r)) {
 
172
                talloc_free(r);
 
173
                return false;
 
174
        }
 
175
 
 
176
        pull = ndr_pull_init_blob(&blob, r, NULL);
 
177
        if (pull == NULL) {
 
178
                talloc_free(r);
 
179
                return false;
 
180
        }
 
181
 
 
182
        pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
183
        ndr_err = call->ndr_pull(pull, NDR_IN, r);
 
184
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
185
                talloc_free(r);
 
186
                return false;
 
187
        }
 
188
 
 
189
        if (DEBUGLEVEL >= 10) {
 
190
                NDR_PRINT_IN_DEBUG(epm_Lookup, r);
 
191
        }
 
192
 
 
193
        ZERO_STRUCT(r->out);
 
194
        r->out.entry_handle = r->in.entry_handle;
 
195
        r->out.num_ents = talloc_zero(r, uint32_t);
 
196
        if (r->out.num_ents == NULL) {
 
197
                talloc_free(r);
 
198
                return false;
 
199
        }
 
200
 
 
201
        r->out.entries = talloc_zero_array(r, struct epm_entry_t, r->in.max_ents);
 
202
        if (r->out.entries == NULL) {
 
203
                talloc_free(r);
 
204
                return false;
 
205
        }
 
206
 
 
207
        r->out.result = _epm_Lookup(p, r);
 
208
 
 
209
        if (p->rng_fault_state) {
 
210
                talloc_free(r);
 
211
                /* Return true here, srv_pipe_hnd.c will take care */
 
212
                return true;
 
213
        }
 
214
 
 
215
        if (DEBUGLEVEL >= 10) {
 
216
                NDR_PRINT_OUT_DEBUG(epm_Lookup, r);
 
217
        }
 
218
 
 
219
        push = ndr_push_init_ctx(r, NULL);
 
220
        if (push == NULL) {
 
221
                talloc_free(r);
 
222
                return false;
 
223
        }
 
224
 
 
225
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
226
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
227
                talloc_free(r);
 
228
                return false;
 
229
        }
 
230
 
 
231
        blob = ndr_push_blob(push);
 
232
        if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
 
233
                talloc_free(r);
 
234
                return false;
 
235
        }
 
236
 
 
237
        talloc_free(r);
 
238
 
 
239
        return true;
 
240
}
 
241
 
 
242
static bool api_epm_Map(pipes_struct *p)
 
243
{
 
244
        const struct ndr_interface_call *call;
 
245
        struct ndr_pull *pull;
 
246
        struct ndr_push *push;
 
247
        enum ndr_err_code ndr_err;
 
248
        DATA_BLOB blob;
 
249
        struct epm_Map *r;
 
250
 
 
251
        call = &ndr_table_epmapper.calls[NDR_EPM_MAP];
 
252
 
 
253
        r = talloc(talloc_tos(), struct epm_Map);
 
254
        if (r == NULL) {
 
255
                return false;
 
256
        }
 
257
 
 
258
        if (!prs_data_blob(&p->in_data.data, &blob, r)) {
 
259
                talloc_free(r);
 
260
                return false;
 
261
        }
 
262
 
 
263
        pull = ndr_pull_init_blob(&blob, r, NULL);
 
264
        if (pull == NULL) {
 
265
                talloc_free(r);
 
266
                return false;
 
267
        }
 
268
 
 
269
        pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
270
        ndr_err = call->ndr_pull(pull, NDR_IN, r);
 
271
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
272
                talloc_free(r);
 
273
                return false;
 
274
        }
 
275
 
 
276
        if (DEBUGLEVEL >= 10) {
 
277
                NDR_PRINT_IN_DEBUG(epm_Map, r);
 
278
        }
 
279
 
 
280
        ZERO_STRUCT(r->out);
 
281
        r->out.entry_handle = r->in.entry_handle;
 
282
        r->out.num_towers = talloc_zero(r, uint32_t);
 
283
        if (r->out.num_towers == NULL) {
 
284
                talloc_free(r);
 
285
                return false;
 
286
        }
 
287
 
 
288
        r->out.towers = talloc_zero_array(r, struct epm_twr_p_t, r->in.max_towers);
 
289
        if (r->out.towers == NULL) {
 
290
                talloc_free(r);
 
291
                return false;
 
292
        }
 
293
 
 
294
        r->out.result = _epm_Map(p, r);
 
295
 
 
296
        if (p->rng_fault_state) {
 
297
                talloc_free(r);
 
298
                /* Return true here, srv_pipe_hnd.c will take care */
 
299
                return true;
 
300
        }
 
301
 
 
302
        if (DEBUGLEVEL >= 10) {
 
303
                NDR_PRINT_OUT_DEBUG(epm_Map, r);
 
304
        }
 
305
 
 
306
        push = ndr_push_init_ctx(r, NULL);
 
307
        if (push == NULL) {
 
308
                talloc_free(r);
 
309
                return false;
 
310
        }
 
311
 
 
312
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
313
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
314
                talloc_free(r);
 
315
                return false;
 
316
        }
 
317
 
 
318
        blob = ndr_push_blob(push);
 
319
        if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
 
320
                talloc_free(r);
 
321
                return false;
 
322
        }
 
323
 
 
324
        talloc_free(r);
 
325
 
 
326
        return true;
 
327
}
 
328
 
 
329
static bool api_epm_LookupHandleFree(pipes_struct *p)
 
330
{
 
331
        const struct ndr_interface_call *call;
 
332
        struct ndr_pull *pull;
 
333
        struct ndr_push *push;
 
334
        enum ndr_err_code ndr_err;
 
335
        DATA_BLOB blob;
 
336
        struct epm_LookupHandleFree *r;
 
337
 
 
338
        call = &ndr_table_epmapper.calls[NDR_EPM_LOOKUPHANDLEFREE];
 
339
 
 
340
        r = talloc(talloc_tos(), struct epm_LookupHandleFree);
 
341
        if (r == NULL) {
 
342
                return false;
 
343
        }
 
344
 
 
345
        if (!prs_data_blob(&p->in_data.data, &blob, r)) {
 
346
                talloc_free(r);
 
347
                return false;
 
348
        }
 
349
 
 
350
        pull = ndr_pull_init_blob(&blob, r, NULL);
 
351
        if (pull == NULL) {
 
352
                talloc_free(r);
 
353
                return false;
 
354
        }
 
355
 
 
356
        pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
357
        ndr_err = call->ndr_pull(pull, NDR_IN, r);
 
358
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
359
                talloc_free(r);
 
360
                return false;
 
361
        }
 
362
 
 
363
        if (DEBUGLEVEL >= 10) {
 
364
                NDR_PRINT_IN_DEBUG(epm_LookupHandleFree, r);
 
365
        }
 
366
 
 
367
        ZERO_STRUCT(r->out);
 
368
        r->out.entry_handle = r->in.entry_handle;
 
369
        r->out.result = _epm_LookupHandleFree(p, r);
 
370
 
 
371
        if (p->rng_fault_state) {
 
372
                talloc_free(r);
 
373
                /* Return true here, srv_pipe_hnd.c will take care */
 
374
                return true;
 
375
        }
 
376
 
 
377
        if (DEBUGLEVEL >= 10) {
 
378
                NDR_PRINT_OUT_DEBUG(epm_LookupHandleFree, r);
 
379
        }
 
380
 
 
381
        push = ndr_push_init_ctx(r, NULL);
 
382
        if (push == NULL) {
 
383
                talloc_free(r);
 
384
                return false;
 
385
        }
 
386
 
 
387
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
388
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
389
                talloc_free(r);
 
390
                return false;
 
391
        }
 
392
 
 
393
        blob = ndr_push_blob(push);
 
394
        if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
 
395
                talloc_free(r);
 
396
                return false;
 
397
        }
 
398
 
 
399
        talloc_free(r);
 
400
 
 
401
        return true;
 
402
}
 
403
 
 
404
static bool api_epm_InqObject(pipes_struct *p)
 
405
{
 
406
        const struct ndr_interface_call *call;
 
407
        struct ndr_pull *pull;
 
408
        struct ndr_push *push;
 
409
        enum ndr_err_code ndr_err;
 
410
        DATA_BLOB blob;
 
411
        struct epm_InqObject *r;
 
412
 
 
413
        call = &ndr_table_epmapper.calls[NDR_EPM_INQOBJECT];
 
414
 
 
415
        r = talloc(talloc_tos(), struct epm_InqObject);
 
416
        if (r == NULL) {
 
417
                return false;
 
418
        }
 
419
 
 
420
        if (!prs_data_blob(&p->in_data.data, &blob, r)) {
 
421
                talloc_free(r);
 
422
                return false;
 
423
        }
 
424
 
 
425
        pull = ndr_pull_init_blob(&blob, r, NULL);
 
426
        if (pull == NULL) {
 
427
                talloc_free(r);
 
428
                return false;
 
429
        }
 
430
 
 
431
        pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
432
        ndr_err = call->ndr_pull(pull, NDR_IN, r);
 
433
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
434
                talloc_free(r);
 
435
                return false;
 
436
        }
 
437
 
 
438
        if (DEBUGLEVEL >= 10) {
 
439
                NDR_PRINT_IN_DEBUG(epm_InqObject, r);
 
440
        }
 
441
 
 
442
        r->out.result = _epm_InqObject(p, r);
 
443
 
 
444
        if (p->rng_fault_state) {
 
445
                talloc_free(r);
 
446
                /* Return true here, srv_pipe_hnd.c will take care */
 
447
                return true;
 
448
        }
 
449
 
 
450
        if (DEBUGLEVEL >= 10) {
 
451
                NDR_PRINT_OUT_DEBUG(epm_InqObject, r);
 
452
        }
 
453
 
 
454
        push = ndr_push_init_ctx(r, NULL);
 
455
        if (push == NULL) {
 
456
                talloc_free(r);
 
457
                return false;
 
458
        }
 
459
 
 
460
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
461
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
462
                talloc_free(r);
 
463
                return false;
 
464
        }
 
465
 
 
466
        blob = ndr_push_blob(push);
 
467
        if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
 
468
                talloc_free(r);
 
469
                return false;
 
470
        }
 
471
 
 
472
        talloc_free(r);
 
473
 
 
474
        return true;
 
475
}
 
476
 
 
477
static bool api_epm_MgmtDelete(pipes_struct *p)
 
478
{
 
479
        const struct ndr_interface_call *call;
 
480
        struct ndr_pull *pull;
 
481
        struct ndr_push *push;
 
482
        enum ndr_err_code ndr_err;
 
483
        DATA_BLOB blob;
 
484
        struct epm_MgmtDelete *r;
 
485
 
 
486
        call = &ndr_table_epmapper.calls[NDR_EPM_MGMTDELETE];
 
487
 
 
488
        r = talloc(talloc_tos(), struct epm_MgmtDelete);
 
489
        if (r == NULL) {
 
490
                return false;
 
491
        }
 
492
 
 
493
        if (!prs_data_blob(&p->in_data.data, &blob, r)) {
 
494
                talloc_free(r);
 
495
                return false;
 
496
        }
 
497
 
 
498
        pull = ndr_pull_init_blob(&blob, r, NULL);
 
499
        if (pull == NULL) {
 
500
                talloc_free(r);
 
501
                return false;
 
502
        }
 
503
 
 
504
        pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
505
        ndr_err = call->ndr_pull(pull, NDR_IN, r);
 
506
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
507
                talloc_free(r);
 
508
                return false;
 
509
        }
 
510
 
 
511
        if (DEBUGLEVEL >= 10) {
 
512
                NDR_PRINT_IN_DEBUG(epm_MgmtDelete, r);
 
513
        }
 
514
 
 
515
        r->out.result = _epm_MgmtDelete(p, r);
 
516
 
 
517
        if (p->rng_fault_state) {
 
518
                talloc_free(r);
 
519
                /* Return true here, srv_pipe_hnd.c will take care */
 
520
                return true;
 
521
        }
 
522
 
 
523
        if (DEBUGLEVEL >= 10) {
 
524
                NDR_PRINT_OUT_DEBUG(epm_MgmtDelete, r);
 
525
        }
 
526
 
 
527
        push = ndr_push_init_ctx(r, NULL);
 
528
        if (push == NULL) {
 
529
                talloc_free(r);
 
530
                return false;
 
531
        }
 
532
 
 
533
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
534
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
535
                talloc_free(r);
 
536
                return false;
 
537
        }
 
538
 
 
539
        blob = ndr_push_blob(push);
 
540
        if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
 
541
                talloc_free(r);
 
542
                return false;
 
543
        }
 
544
 
 
545
        talloc_free(r);
 
546
 
 
547
        return true;
 
548
}
 
549
 
 
550
static bool api_epm_MapAuth(pipes_struct *p)
 
551
{
 
552
        const struct ndr_interface_call *call;
 
553
        struct ndr_pull *pull;
 
554
        struct ndr_push *push;
 
555
        enum ndr_err_code ndr_err;
 
556
        DATA_BLOB blob;
 
557
        struct epm_MapAuth *r;
 
558
 
 
559
        call = &ndr_table_epmapper.calls[NDR_EPM_MAPAUTH];
 
560
 
 
561
        r = talloc(talloc_tos(), struct epm_MapAuth);
 
562
        if (r == NULL) {
 
563
                return false;
 
564
        }
 
565
 
 
566
        if (!prs_data_blob(&p->in_data.data, &blob, r)) {
 
567
                talloc_free(r);
 
568
                return false;
 
569
        }
 
570
 
 
571
        pull = ndr_pull_init_blob(&blob, r, NULL);
 
572
        if (pull == NULL) {
 
573
                talloc_free(r);
 
574
                return false;
 
575
        }
 
576
 
 
577
        pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
578
        ndr_err = call->ndr_pull(pull, NDR_IN, r);
 
579
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
580
                talloc_free(r);
 
581
                return false;
 
582
        }
 
583
 
 
584
        if (DEBUGLEVEL >= 10) {
 
585
                NDR_PRINT_IN_DEBUG(epm_MapAuth, r);
 
586
        }
 
587
 
 
588
        r->out.result = _epm_MapAuth(p, r);
 
589
 
 
590
        if (p->rng_fault_state) {
 
591
                talloc_free(r);
 
592
                /* Return true here, srv_pipe_hnd.c will take care */
 
593
                return true;
 
594
        }
 
595
 
 
596
        if (DEBUGLEVEL >= 10) {
 
597
                NDR_PRINT_OUT_DEBUG(epm_MapAuth, r);
 
598
        }
 
599
 
 
600
        push = ndr_push_init_ctx(r, NULL);
 
601
        if (push == NULL) {
 
602
                talloc_free(r);
 
603
                return false;
 
604
        }
 
605
 
 
606
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
607
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
608
                talloc_free(r);
 
609
                return false;
 
610
        }
 
611
 
 
612
        blob = ndr_push_blob(push);
 
613
        if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
 
614
                talloc_free(r);
 
615
                return false;
 
616
        }
 
617
 
 
618
        talloc_free(r);
 
619
 
 
620
        return true;
 
621
}
 
622
 
 
623
 
 
624
/* Tables */
 
625
static struct api_struct api_epmapper_cmds[] = 
 
626
{
 
627
        {"EPM_INSERT", NDR_EPM_INSERT, api_epm_Insert},
 
628
        {"EPM_DELETE", NDR_EPM_DELETE, api_epm_Delete},
 
629
        {"EPM_LOOKUP", NDR_EPM_LOOKUP, api_epm_Lookup},
 
630
        {"EPM_MAP", NDR_EPM_MAP, api_epm_Map},
 
631
        {"EPM_LOOKUPHANDLEFREE", NDR_EPM_LOOKUPHANDLEFREE, api_epm_LookupHandleFree},
 
632
        {"EPM_INQOBJECT", NDR_EPM_INQOBJECT, api_epm_InqObject},
 
633
        {"EPM_MGMTDELETE", NDR_EPM_MGMTDELETE, api_epm_MgmtDelete},
 
634
        {"EPM_MAPAUTH", NDR_EPM_MAPAUTH, api_epm_MapAuth},
 
635
};
 
636
 
 
637
void epmapper_get_pipe_fns(struct api_struct **fns, int *n_fns)
 
638
{
 
639
        *fns = api_epmapper_cmds;
 
640
        *n_fns = sizeof(api_epmapper_cmds) / sizeof(struct api_struct);
 
641
}
 
642
 
 
643
NTSTATUS rpc_epmapper_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *_r)
 
644
{
 
645
        if (cli->pipes_struct == NULL) {
 
646
                return NT_STATUS_INVALID_PARAMETER;
 
647
        }
 
648
 
 
649
        switch (opnum)
 
650
        {
 
651
                case NDR_EPM_INSERT: {
 
652
                        struct epm_Insert *r = (struct epm_Insert *)_r;
 
653
                        r->out.result = _epm_Insert(cli->pipes_struct, r);
 
654
                        return NT_STATUS_OK;
 
655
                }
 
656
 
 
657
                case NDR_EPM_DELETE: {
 
658
                        struct epm_Delete *r = (struct epm_Delete *)_r;
 
659
                        r->out.result = _epm_Delete(cli->pipes_struct, r);
 
660
                        return NT_STATUS_OK;
 
661
                }
 
662
 
 
663
                case NDR_EPM_LOOKUP: {
 
664
                        struct epm_Lookup *r = (struct epm_Lookup *)_r;
 
665
                        ZERO_STRUCT(r->out);
 
666
                        r->out.entry_handle = r->in.entry_handle;
 
667
                        r->out.num_ents = talloc_zero(mem_ctx, uint32_t);
 
668
                        if (r->out.num_ents == NULL) {
 
669
                        return NT_STATUS_NO_MEMORY;
 
670
                        }
 
671
 
 
672
                        r->out.entries = talloc_zero_array(mem_ctx, struct epm_entry_t, r->in.max_ents);
 
673
                        if (r->out.entries == NULL) {
 
674
                        return NT_STATUS_NO_MEMORY;
 
675
                        }
 
676
 
 
677
                        r->out.result = _epm_Lookup(cli->pipes_struct, r);
 
678
                        return NT_STATUS_OK;
 
679
                }
 
680
 
 
681
                case NDR_EPM_MAP: {
 
682
                        struct epm_Map *r = (struct epm_Map *)_r;
 
683
                        ZERO_STRUCT(r->out);
 
684
                        r->out.entry_handle = r->in.entry_handle;
 
685
                        r->out.num_towers = talloc_zero(mem_ctx, uint32_t);
 
686
                        if (r->out.num_towers == NULL) {
 
687
                        return NT_STATUS_NO_MEMORY;
 
688
                        }
 
689
 
 
690
                        r->out.towers = talloc_zero_array(mem_ctx, struct epm_twr_p_t, r->in.max_towers);
 
691
                        if (r->out.towers == NULL) {
 
692
                        return NT_STATUS_NO_MEMORY;
 
693
                        }
 
694
 
 
695
                        r->out.result = _epm_Map(cli->pipes_struct, r);
 
696
                        return NT_STATUS_OK;
 
697
                }
 
698
 
 
699
                case NDR_EPM_LOOKUPHANDLEFREE: {
 
700
                        struct epm_LookupHandleFree *r = (struct epm_LookupHandleFree *)_r;
 
701
                        ZERO_STRUCT(r->out);
 
702
                        r->out.entry_handle = r->in.entry_handle;
 
703
                        r->out.result = _epm_LookupHandleFree(cli->pipes_struct, r);
 
704
                        return NT_STATUS_OK;
 
705
                }
 
706
 
 
707
                case NDR_EPM_INQOBJECT: {
 
708
                        struct epm_InqObject *r = (struct epm_InqObject *)_r;
 
709
                        r->out.result = _epm_InqObject(cli->pipes_struct, r);
 
710
                        return NT_STATUS_OK;
 
711
                }
 
712
 
 
713
                case NDR_EPM_MGMTDELETE: {
 
714
                        struct epm_MgmtDelete *r = (struct epm_MgmtDelete *)_r;
 
715
                        r->out.result = _epm_MgmtDelete(cli->pipes_struct, r);
 
716
                        return NT_STATUS_OK;
 
717
                }
 
718
 
 
719
                case NDR_EPM_MAPAUTH: {
 
720
                        struct epm_MapAuth *r = (struct epm_MapAuth *)_r;
 
721
                        r->out.result = _epm_MapAuth(cli->pipes_struct, r);
 
722
                        return NT_STATUS_OK;
 
723
                }
 
724
 
 
725
                default:
 
726
                        return NT_STATUS_NOT_IMPLEMENTED;
 
727
        }
 
728
}
 
729
 
 
730
NTSTATUS rpc_epmapper_init(void)
 
731
{
 
732
        return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "epmapper", "epmapper", &ndr_table_epmapper, api_epmapper_cmds, sizeof(api_epmapper_cmds) / sizeof(struct api_struct));
 
733
}