2 * Unix SMB/CIFS implementation.
3 * server auto-generated by pidl. DO NOT MODIFY!
7 #include "librpc/gen_ndr/srv_wbint.h"
9 static bool api_wbint_Ping(pipes_struct
*p
)
11 const struct ndr_interface_call
*call
;
12 struct ndr_pull
*pull
;
13 struct ndr_push
*push
;
14 enum ndr_err_code ndr_err
;
18 call
= &ndr_table_wbint
.calls
[NDR_WBINT_PING
];
20 r
= talloc(talloc_tos(), struct wbint_Ping
);
25 if (!prs_data_blob(&p
->in_data
.data
, &blob
, r
)) {
30 pull
= ndr_pull_init_blob(&blob
, r
, NULL
);
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
)) {
43 if (DEBUGLEVEL
>= 10) {
44 NDR_PRINT_IN_DEBUG(wbint_Ping
, r
);
48 r
->out
.out_data
= talloc_zero(r
, uint32_t);
49 if (r
->out
.out_data
== NULL
) {
56 if (p
->rng_fault_state
) {
58 /* Return true here, srv_pipe_hnd.c will take care */
62 if (DEBUGLEVEL
>= 10) {
63 NDR_PRINT_OUT_DEBUG(wbint_Ping
, r
);
66 push
= ndr_push_init_ctx(r
, NULL
);
72 ndr_err
= call
->ndr_push(push
, NDR_OUT
, r
);
73 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err
)) {
78 blob
= ndr_push_blob(push
);
79 if (!prs_copy_data_in(&p
->out_data
.rdata
, (const char *)blob
.data
, (uint32_t)blob
.length
)) {
89 static bool api_wbint_LookupSid(pipes_struct
*p
)
91 const struct ndr_interface_call
*call
;
92 struct ndr_pull
*pull
;
93 struct ndr_push
*push
;
94 enum ndr_err_code ndr_err
;
96 struct wbint_LookupSid
*r
;
98 call
= &ndr_table_wbint
.calls
[NDR_WBINT_LOOKUPSID
];
100 r
= talloc(talloc_tos(), struct wbint_LookupSid
);
105 if (!prs_data_blob(&p
->in_data
.data
, &blob
, r
)) {
110 pull
= ndr_pull_init_blob(&blob
, r
, NULL
);
116 pull
->flags
|= LIBNDR_FLAG_REF_ALLOC
;
117 ndr_err
= call
->ndr_pull(pull
, NDR_IN
, r
);
118 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err
)) {
123 if (DEBUGLEVEL
>= 10) {
124 NDR_PRINT_IN_DEBUG(wbint_LookupSid
, r
);
128 r
->out
.type
= talloc_zero(r
, enum lsa_SidType
);
129 if (r
->out
.type
== NULL
) {
134 r
->out
.domain
= talloc_zero(r
, const char *);
135 if (r
->out
.domain
== NULL
) {
140 r
->out
.name
= talloc_zero(r
, const char *);
141 if (r
->out
.name
== NULL
) {
146 r
->out
.result
= _wbint_LookupSid(p
, r
);
148 if (p
->rng_fault_state
) {
150 /* Return true here, srv_pipe_hnd.c will take care */
154 if (DEBUGLEVEL
>= 10) {
155 NDR_PRINT_OUT_DEBUG(wbint_LookupSid
, r
);
158 push
= ndr_push_init_ctx(r
, NULL
);
164 ndr_err
= call
->ndr_push(push
, NDR_OUT
, r
);
165 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err
)) {
170 blob
= ndr_push_blob(push
);
171 if (!prs_copy_data_in(&p
->out_data
.rdata
, (const char *)blob
.data
, (uint32_t)blob
.length
)) {
181 static bool api_wbint_LookupName(pipes_struct
*p
)
183 const struct ndr_interface_call
*call
;
184 struct ndr_pull
*pull
;
185 struct ndr_push
*push
;
186 enum ndr_err_code ndr_err
;
188 struct wbint_LookupName
*r
;
190 call
= &ndr_table_wbint
.calls
[NDR_WBINT_LOOKUPNAME
];
192 r
= talloc(talloc_tos(), struct wbint_LookupName
);
197 if (!prs_data_blob(&p
->in_data
.data
, &blob
, r
)) {
202 pull
= ndr_pull_init_blob(&blob
, r
, NULL
);
208 pull
->flags
|= LIBNDR_FLAG_REF_ALLOC
;
209 ndr_err
= call
->ndr_pull(pull
, NDR_IN
, r
);
210 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err
)) {
215 if (DEBUGLEVEL
>= 10) {
216 NDR_PRINT_IN_DEBUG(wbint_LookupName
, r
);
220 r
->out
.type
= talloc_zero(r
, enum lsa_SidType
);
221 if (r
->out
.type
== NULL
) {
226 r
->out
.sid
= talloc_zero(r
, struct dom_sid
);
227 if (r
->out
.sid
== NULL
) {
232 r
->out
.result
= _wbint_LookupName(p
, r
);
234 if (p
->rng_fault_state
) {
236 /* Return true here, srv_pipe_hnd.c will take care */
240 if (DEBUGLEVEL
>= 10) {
241 NDR_PRINT_OUT_DEBUG(wbint_LookupName
, r
);
244 push
= ndr_push_init_ctx(r
, NULL
);
250 ndr_err
= call
->ndr_push(push
, NDR_OUT
, r
);
251 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err
)) {
256 blob
= ndr_push_blob(push
);
257 if (!prs_copy_data_in(&p
->out_data
.rdata
, (const char *)blob
.data
, (uint32_t)blob
.length
)) {
267 static bool api_wbint_Sid2Uid(pipes_struct
*p
)
269 const struct ndr_interface_call
*call
;
270 struct ndr_pull
*pull
;
271 struct ndr_push
*push
;
272 enum ndr_err_code ndr_err
;
274 struct wbint_Sid2Uid
*r
;
276 call
= &ndr_table_wbint
.calls
[NDR_WBINT_SID2UID
];
278 r
= talloc(talloc_tos(), struct wbint_Sid2Uid
);
283 if (!prs_data_blob(&p
->in_data
.data
, &blob
, r
)) {
288 pull
= ndr_pull_init_blob(&blob
, r
, NULL
);
294 pull
->flags
|= LIBNDR_FLAG_REF_ALLOC
;
295 ndr_err
= call
->ndr_pull(pull
, NDR_IN
, r
);
296 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err
)) {
301 if (DEBUGLEVEL
>= 10) {
302 NDR_PRINT_IN_DEBUG(wbint_Sid2Uid
, r
);
306 r
->out
.uid
= talloc_zero(r
, uint64_t);
307 if (r
->out
.uid
== NULL
) {
312 r
->out
.result
= _wbint_Sid2Uid(p
, r
);
314 if (p
->rng_fault_state
) {
316 /* Return true here, srv_pipe_hnd.c will take care */
320 if (DEBUGLEVEL
>= 10) {
321 NDR_PRINT_OUT_DEBUG(wbint_Sid2Uid
, r
);
324 push
= ndr_push_init_ctx(r
, NULL
);
330 ndr_err
= call
->ndr_push(push
, NDR_OUT
, r
);
331 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err
)) {
336 blob
= ndr_push_blob(push
);
337 if (!prs_copy_data_in(&p
->out_data
.rdata
, (const char *)blob
.data
, (uint32_t)blob
.length
)) {
349 static struct api_struct api_wbint_cmds
[] =
351 {"WBINT_PING", NDR_WBINT_PING
, api_wbint_Ping
},
352 {"WBINT_LOOKUPSID", NDR_WBINT_LOOKUPSID
, api_wbint_LookupSid
},
353 {"WBINT_LOOKUPNAME", NDR_WBINT_LOOKUPNAME
, api_wbint_LookupName
},
354 {"WBINT_SID2UID", NDR_WBINT_SID2UID
, api_wbint_Sid2Uid
},
357 void wbint_get_pipe_fns(struct api_struct
**fns
, int *n_fns
)
359 *fns
= api_wbint_cmds
;
360 *n_fns
= sizeof(api_wbint_cmds
) / sizeof(struct api_struct
);
363 NTSTATUS
rpc_wbint_dispatch(struct rpc_pipe_client
*cli
, TALLOC_CTX
*mem_ctx
, const struct ndr_interface_table
*table
, uint32_t opnum
, void *_r
)
365 if (cli
->pipes_struct
== NULL
) {
366 return NT_STATUS_INVALID_PARAMETER
;
371 case NDR_WBINT_PING
: {
372 struct wbint_Ping
*r
= (struct wbint_Ping
*)_r
;
374 r
->out
.out_data
= talloc_zero(mem_ctx
, uint32_t);
375 if (r
->out
.out_data
== NULL
) {
376 return NT_STATUS_NO_MEMORY
;
379 _wbint_Ping(cli
->pipes_struct
, r
);
383 case NDR_WBINT_LOOKUPSID
: {
384 struct wbint_LookupSid
*r
= (struct wbint_LookupSid
*)_r
;
386 r
->out
.type
= talloc_zero(mem_ctx
, enum lsa_SidType
);
387 if (r
->out
.type
== NULL
) {
388 return NT_STATUS_NO_MEMORY
;
391 r
->out
.domain
= talloc_zero(mem_ctx
, const char *);
392 if (r
->out
.domain
== NULL
) {
393 return NT_STATUS_NO_MEMORY
;
396 r
->out
.name
= talloc_zero(mem_ctx
, const char *);
397 if (r
->out
.name
== NULL
) {
398 return NT_STATUS_NO_MEMORY
;
401 r
->out
.result
= _wbint_LookupSid(cli
->pipes_struct
, r
);
405 case NDR_WBINT_LOOKUPNAME
: {
406 struct wbint_LookupName
*r
= (struct wbint_LookupName
*)_r
;
408 r
->out
.type
= talloc_zero(mem_ctx
, enum lsa_SidType
);
409 if (r
->out
.type
== NULL
) {
410 return NT_STATUS_NO_MEMORY
;
413 r
->out
.sid
= talloc_zero(mem_ctx
, struct dom_sid
);
414 if (r
->out
.sid
== NULL
) {
415 return NT_STATUS_NO_MEMORY
;
418 r
->out
.result
= _wbint_LookupName(cli
->pipes_struct
, r
);
422 case NDR_WBINT_SID2UID
: {
423 struct wbint_Sid2Uid
*r
= (struct wbint_Sid2Uid
*)_r
;
425 r
->out
.uid
= talloc_zero(mem_ctx
, uint64_t);
426 if (r
->out
.uid
== NULL
) {
427 return NT_STATUS_NO_MEMORY
;
430 r
->out
.result
= _wbint_Sid2Uid(cli
->pipes_struct
, r
);
435 return NT_STATUS_NOT_IMPLEMENTED
;
439 NTSTATUS
rpc_wbint_init(void)
441 return rpc_srv_register(SMB_RPC_INTERFACE_VERSION
, "wbint", "wbint", &ndr_table_wbint
, api_wbint_cmds
, sizeof(api_wbint_cmds
) / sizeof(struct api_struct
));