mirror of
https://github.com/samba-team/samba.git
synced 2025-12-23 00:23:53 +03:00
Added srv_get_info client command.
This commit is contained in:
@@ -80,3 +80,49 @@ void cli_srvsvc_shutdown(struct cli_state *cli)
|
||||
if (cli->fd != -1) cli_ulogoff(cli);
|
||||
cli_shutdown(cli);
|
||||
}
|
||||
|
||||
uint32 cli_srvsvc_net_srv_get_info(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
uint32 switch_value, SRV_INFO_CTR *ctr)
|
||||
{
|
||||
prs_struct qbuf, rbuf;
|
||||
SRV_Q_NET_SRV_GET_INFO q;
|
||||
SRV_R_NET_SRV_GET_INFO r;
|
||||
uint32 result;
|
||||
|
||||
ZERO_STRUCT(q);
|
||||
ZERO_STRUCT(r);
|
||||
|
||||
/* Initialise parse structures */
|
||||
|
||||
prs_init(&qbuf, MAX_PDU_FRAG_LEN, mem_ctx, MARSHALL);
|
||||
prs_init(&rbuf, 0, mem_ctx, UNMARSHALL);
|
||||
|
||||
/* Initialise input parameters */
|
||||
|
||||
init_srv_q_net_srv_get_info(&q, cli->srv_name_slash, switch_value);
|
||||
|
||||
/* Marshall data and send request */
|
||||
|
||||
if (!srv_io_q_net_srv_get_info("", &q, &qbuf, 0) ||
|
||||
!rpc_api_pipe_req(cli, SRV_NET_SRV_GET_INFO, &qbuf, &rbuf)) {
|
||||
result = NT_STATUS_UNSUCCESSFUL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Unmarshall response */
|
||||
|
||||
r.ctr = ctr;
|
||||
|
||||
if (!srv_io_r_net_srv_get_info("", &r, &rbuf, 0)) {
|
||||
result = NT_STATUS_UNSUCCESSFUL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
result = r.status;
|
||||
|
||||
done:
|
||||
prs_mem_free(&qbuf);
|
||||
prs_mem_free(&rbuf);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user