compilation errors due to addition of smb file handle parameter.
[samba.git] / source3 / utils / rpctorture.c
index 3b2a497ad4548c86cc64d44b74c5c795aaed4f58..831af55e0f3c6fd4c9fcf6376fb1447fb5efcfbb 100644 (file)
@@ -91,7 +91,6 @@ void rpcclient_init(void)
        smb_cli->capabilities |= CAP_STATUS32;
 
        pstrcpy(smb_cli->user_name, user_name);
-       smb_cli->nt_pipe_fnum   = 0xffff;
 
        get_passwd();
 
@@ -223,7 +222,7 @@ static void rand_buf(char *buf, int len)
 /****************************************************************************
 do a random rpc command
 ****************************************************************************/
-BOOL do_random_rpc(struct cli_state *cli, int max_len)
+BOOL do_random_rpc(struct cli_state *cli, uint16 nt_pipe_fnum, int max_len)
 {
        prs_struct rbuf;
        prs_struct buf; 
@@ -250,7 +249,7 @@ BOOL do_random_rpc(struct cli_state *cli, int max_len)
        buf.offset = param_len;
 
        /* send the data on \PIPE\ */
-       if (rpc_api_pipe_req(cli, opcode, &buf, &rbuf))
+       if (rpc_api_pipe_req(cli, nt_pipe_fnum, opcode, &buf, &rbuf))
        {
                response = rbuf.offset != 0;
 
@@ -275,6 +274,7 @@ BOOL do_random_rpc(struct cli_state *cli, int max_len)
 static void random_rpc_pipe_enc(char *pipe_name, struct client_info *cli_info,
                int numops)
 {
+       uint16 nt_pipe_fnum;
        int i;
 
        DEBUG(0,("starting random rpc test on %s (encryped)\n", pipe_name));
@@ -300,16 +300,16 @@ static void random_rpc_pipe_enc(char *pipe_name, struct client_info *cli_info,
        for (i = 1; i <= numops * 100; i++)
        {
                /* open session.  */
-               cli_nt_session_open(smb_cli, pipe_name);
+               cli_nt_session_open(smb_cli, pipe_name, &nt_pipe_fnum);
 
-               do_random_rpc(smb_cli, 1024);
+               do_random_rpc(smb_cli, nt_pipe_fnum, 1024);
                if (i % 500 == 0)
                {
                        DEBUG(0,("calls: %i\n", i));
                }
 
                /* close the session */
-               cli_nt_session_close(smb_cli);
+               cli_nt_session_close(smb_cli, nt_pipe_fnum);
        }
 
        /* close the rpc pipe */
@@ -322,6 +322,7 @@ static void random_rpc_pipe_enc(char *pipe_name, struct client_info *cli_info,
 static void random_rpc_pipe(char *pipe_name, struct client_info *cli_info,
                int numops)
 {
+       uint16 nt_pipe_fnum;
        int i;
 
        DEBUG(0,("starting random rpc test on %s\n", pipe_name));
@@ -334,7 +335,7 @@ static void random_rpc_pipe(char *pipe_name, struct client_info *cli_info,
        }
 
        /* open session.  */
-       if (!cli_nt_session_open(smb_cli, pipe_name))
+       if (!cli_nt_session_open(smb_cli, pipe_name, &nt_pipe_fnum))
        {
                DEBUG(0,("random rpc test: session open failed\n"));
                return;
@@ -342,7 +343,7 @@ static void random_rpc_pipe(char *pipe_name, struct client_info *cli_info,
 
        for (i = 1; i <= numops * 100; i++)
        {
-               do_random_rpc(smb_cli, 8192);
+               do_random_rpc(smb_cli, nt_pipe_fnum, 8192);
                if (i % 500 == 0)
                {
                        DEBUG(0,("calls: %i\n", i));
@@ -350,7 +351,7 @@ static void random_rpc_pipe(char *pipe_name, struct client_info *cli_info,
        }
 
        /* close the session */
-       cli_nt_session_close(smb_cli);
+       cli_nt_session_close(smb_cli, nt_pipe_fnum);
 
        /* close the rpc pipe */
        rpcclient_stop();
@@ -388,6 +389,7 @@ static void run_randomrpc(int numops, struct client_info *cli_info)
 
 static void run_samhandles(int numops, struct client_info *cli_info)
 {
+       uint16 nt_pipe_fnum;
        int i;
        int count = 0;
        int failed = 0;
@@ -412,7 +414,7 @@ static void run_samhandles(int numops, struct client_info *cli_info)
        }
 
        /* open session.  */
-       if (!cli_nt_session_open(smb_cli, PIPE_SAMR))
+       if (!cli_nt_session_open(smb_cli, PIPE_SAMR, &nt_pipe_fnum))
        {
                DEBUG(0,("samhandle test: session open failed\n"));
                return;
@@ -422,12 +424,12 @@ static void run_samhandles(int numops, struct client_info *cli_info)
        {
                POLICY_HND pol;
                POLICY_HND dom;
-               if (!do_samr_connect(smb_cli, srv_name, 0x20, &pol))
+               if (!samr_connect(smb_cli, nt_pipe_fnum, srv_name, 0x20, &pol))
                {
                        failed++;
                }
 /*
-               if (!do_samr_open_domain(smb_cli, srv_name, 0x00000020, &pol))
+               if (!samr_open_domain(smb_cli, nt_pipe_fnum, srv_name, 0x00000020, &pol))
                {
                        DEBUG(0,("samhandle domain open test (%i): failed\n", i));
                }
@@ -440,7 +442,7 @@ static void run_samhandles(int numops, struct client_info *cli_info)
        }
 
        /* close the session */
-       cli_nt_session_close(smb_cli);
+       cli_nt_session_close(smb_cli, nt_pipe_fnum);
 
        /* close the rpc pipe */
        rpcclient_stop();
@@ -451,6 +453,7 @@ static void run_samhandles(int numops, struct client_info *cli_info)
 
 static void run_lsahandles(int numops, struct client_info *cli_info)
 {
+       uint16 nt_pipe_fnum;
        int i;
        int count = 0;
        int failed = 0;
@@ -474,7 +477,7 @@ static void run_lsahandles(int numops, struct client_info *cli_info)
                return;
        }
        /* open session.  */
-       if (!cli_nt_session_open(smb_cli, PIPE_LSARPC))
+       if (!cli_nt_session_open(smb_cli, PIPE_LSARPC, &nt_pipe_fnum))
        {
                DEBUG(0,("lsahandle test: session open failed\n"));
                return;
@@ -483,7 +486,7 @@ static void run_lsahandles(int numops, struct client_info *cli_info)
        for (i = 1; i <= numops * 100; i++)
        {
                POLICY_HND pol;
-               if (!do_lsa_open_policy(smb_cli, srv_name, &pol, False))
+               if (!lsa_open_policy(smb_cli, nt_pipe_fnum, srv_name, &pol, False))
                {
                        failed++;
                }
@@ -495,7 +498,7 @@ static void run_lsahandles(int numops, struct client_info *cli_info)
        }
 
        /* close the session */
-       cli_nt_session_close(smb_cli);
+       cli_nt_session_close(smb_cli, nt_pipe_fnum);
 
        /* close the rpc pipe */
        rpcclient_stop();
@@ -506,6 +509,7 @@ static void run_lsahandles(int numops, struct client_info *cli_info)
 
 static void run_pipegobble(int numops, struct client_info *cli_info, char *pipe_name)
 {
+       uint16 nt_pipe_fnum;
        int i;
        int count = 0;
        int failed = 0;
@@ -531,7 +535,7 @@ static void run_pipegobble(int numops, struct client_info *cli_info, char *pipe_
        for (i = 1; i <= numops * 100; i++)
        {
                /* open session.  */
-               if (!cli_nt_session_open(smb_cli, pipe_name))
+               if (!cli_nt_session_open(smb_cli, pipe_name, &nt_pipe_fnum))
                {
                        DEBUG(0,("pipe gobble test: session open failed\n"));
                }
@@ -952,11 +956,11 @@ enum client_action
        }
 */
 
-       create_procs(nprocs, numops, &cli_info, run_pipegobbler);
+       create_procs(nprocs, numops, &cli_info, run_randomrpc);
 /*
+       create_procs(nprocs, numops, &cli_info, run_pipegobbler);
        create_procs(nprocs, numops, &cli_info, run_tcpconnect);
        create_procs(nprocs, numops, &cli_info, run_handles);
-       create_procs(nprocs, numops, &cli_info, run_randomrpc);
 */
 
        fflush(out_hnd);