s3-rpc_client: Move client pipe functions to own header.
[samba.git] / source3 / utils / smbtree.c
index 02001f0abbdfce1dddfbce21346bd97dc3b214b2..81b9ca3257bd8aec0f9fa3c4b05ea096df0738f5 100644 (file)
@@ -20,6 +20,9 @@
 */
 
 #include "includes.h"
+#include "popt_common.h"
+#include "rpc_client/cli_pipe.h"
+#include "../librpc/gen_ndr/ndr_srvsvc_c.h"
 
 static int use_bcast;
 
@@ -148,7 +151,7 @@ static bool get_rpc_shares(struct cli_state *cli,
                           void *state)
 {
        NTSTATUS status;
-       struct rpc_pipe_client *pipe_hnd;
+       struct rpc_pipe_client *pipe_hnd = NULL;
        TALLOC_CTX *mem_ctx;
        WERROR werr;
        struct srvsvc_NetShareInfoCtr info_ctr;
@@ -156,6 +159,7 @@ static bool get_rpc_shares(struct cli_state *cli,
        int i;
        uint32_t resume_handle = 0;
        uint32_t total_entries = 0;
+       struct dcerpc_binding_handle *b;
 
        mem_ctx = talloc_new(NULL);
        if (mem_ctx == NULL) {
@@ -173,13 +177,15 @@ static bool get_rpc_shares(struct cli_state *cli,
                return False;
        }
 
+       b = pipe_hnd->binding_handle;
+
        ZERO_STRUCT(info_ctr);
        ZERO_STRUCT(ctr1);
 
        info_ctr.level = 1;
        info_ctr.ctr.ctr1 = &ctr1;
 
-       status = rpccli_srvsvc_NetShareEnumAll(pipe_hnd, mem_ctx,
+       status = dcerpc_srvsvc_NetShareEnumAll(b, mem_ctx,
                                               pipe_hnd->desthost,
                                               &info_ctr,
                                               0xffffffff,
@@ -289,9 +295,7 @@ static bool print_tree(struct user_auth_info *user_info)
 
        setlinebuf(stdout);
 
-       dbf = x_stderr;
-
-       setup_logging(argv[0],True);
+       setup_logging(argv[0], DEBUG_STDERR);
 
        auth_info = user_auth_info_init(frame);
        if (auth_info == NULL) {