diff options
author | Tim Potter <tpot@samba.org> | 2001-05-24 08:02:27 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2001-05-24 08:02:27 +0000 |
commit | 69eb5affbd01f3961077e85f11663de1418f1d13 (patch) | |
tree | 9115c2673d3a285f86434ee4b2ff66b6226a6830 /source3/libsmb | |
parent | 6958bfa518ef4f0ddd88c31b071f7c23158854e4 (diff) | |
download | samba-69eb5affbd01f3961077e85f11663de1418f1d13.tar.gz samba-69eb5affbd01f3961077e85f11663de1418f1d13.tar.bz2 samba-69eb5affbd01f3961077e85f11663de1418f1d13.zip |
Added srv_get_info client command.
(This used to be commit ee599c9481c26d8407f03a9897eb5f1abd1e47f1)
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/cli_srvsvc.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/source3/libsmb/cli_srvsvc.c b/source3/libsmb/cli_srvsvc.c index 9d13e94930..8209d9301f 100644 --- a/source3/libsmb/cli_srvsvc.c +++ b/source3/libsmb/cli_srvsvc.c @@ -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; +} |