diff options
author | Tim Potter <tpot@samba.org> | 2002-05-30 07:12:32 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2002-05-30 07:12:32 +0000 |
commit | 0e3260de6fdaa93ce0dddd98b1413662be972ce3 (patch) | |
tree | 7b43dbbaa3fa36111bbfbeb4eab76619f085b6d7 /source3/libsmb | |
parent | 4d693305fda6c671484f7730bcc29944ae19546d (diff) | |
download | samba-0e3260de6fdaa93ce0dddd98b1413662be972ce3.tar.gz samba-0e3260de6fdaa93ce0dddd98b1413662be972ce3.tar.bz2 samba-0e3260de6fdaa93ce0dddd98b1413662be972ce3.zip |
Added netfileenum (sorry - no output though (-:) command.
(This used to be commit 099b750b4ed8f04a1fd8a018508d412691e37df6)
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/cli_srvsvc.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/source3/libsmb/cli_srvsvc.c b/source3/libsmb/cli_srvsvc.c index 9e2f5a3686..bc2058fdbd 100644 --- a/source3/libsmb/cli_srvsvc.c +++ b/source3/libsmb/cli_srvsvc.c @@ -233,3 +233,48 @@ WERROR cli_srvsvc_net_remote_tod(struct cli_state *cli, TALLOC_CTX *mem_ctx, return result; } + +WERROR cli_srvsvc_net_file_enum(struct cli_state *cli, TALLOC_CTX *mem_ctx, + uint32 file_level, SRV_FILE_INFO_CTR *ctr, + int preferred_len, ENUM_HND *hnd) +{ + prs_struct qbuf, rbuf; + SRV_Q_NET_FILE_ENUM q; + SRV_R_NET_FILE_ENUM r; + WERROR result = W_ERROR(ERRgeneral); + + 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_file_enum(&q, cli->srv_name_slash, NULL, file_level, + ctr, preferred_len, hnd); + + /* Marshall data and send request */ + + if (!srv_io_q_net_file_enum("", &q, &qbuf, 0) || + !rpc_api_pipe_req(cli, SRV_NET_FILE_ENUM, &qbuf, &rbuf)) + goto done; + + /* Unmarshall response */ + + if (!srv_io_r_net_file_enum("", &r, &rbuf, 0)) + goto done; + + result = r.status; + + if (!W_ERROR_IS_OK(result)) + goto done; + + done: + prs_mem_free(&qbuf); + prs_mem_free(&rbuf); + + return result; +} |