]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
moved browser command brsinfo over to new abstracted connection
authorLuke Leighton <lkcl@samba.org>
Sat, 27 Nov 1999 22:53:28 +0000 (22:53 +0000)
committerLuke Leighton <lkcl@samba.org>
Sat, 27 Nov 1999 22:53:28 +0000 (22:53 +0000)
(This used to be commit 601d217f44ea1ce3735b9267b6f829b472a982b4)

source3/include/proto.h
source3/rpc_client/cli_brs.c
source3/rpcclient/cmd_brs.c

index fac04a152f82a081ec9127945aa6d47d3ba3d80f..7a6afbe7925fbe0fbbd33f0fdb034635a82f9f19 100644 (file)
@@ -1769,21 +1769,18 @@ BOOL profile_setup(BOOL rdonly);
 
 /*The following definitions come from  rpc_client/cli_atsvc.c  */
 
-BOOL at_add_job(struct cli_state *cli, uint16 fnum, 
-               char *server_name, AT_JOB_INFO *info, char *command,
+BOOL at_add_job(
+               char *srv_name, AT_JOB_INFO *info, char *command,
                uint32 *jobid);
-BOOL at_del_job(struct cli_state *cli, uint16 fnum, 
-               char *server_name, uint32 min_jobid, uint32 max_jobid);
-BOOL at_enum_jobs(struct cli_state *cli, uint16 fnum, 
-                 char *server_name, uint32 *num_jobs,
+BOOL at_del_job( char *srv_name, uint32 min_jobid, uint32 max_jobid);
+BOOL at_enum_jobs( char *srv_name, uint32 *num_jobs,
                  AT_ENUM_INFO *jobs, char ***commands);
-BOOL at_query_job(struct cli_state *cli, uint16 fnum, char *server_name,
+BOOL at_query_job(char *srv_name,
                  uint32 jobid, AT_JOB_INFO *job, fstring command);
 
 /*The following definitions come from  rpc_client/cli_brs.c  */
 
-BOOL do_brs_query_info(struct cli_state *cli, uint16 fnum, 
-                       const char *server_name, uint32 switch_value,
+BOOL brs_query_info( const char *srv_name, uint32 switch_value,
                        void *id);
 
 /*The following definitions come from  rpc_client/cli_connect.c  */
index 01fc0439539487557752b69f37c9b46bd16dafef..f4e055f394413e25191a48622d5652d0c671be9c 100644 (file)
@@ -33,8 +33,7 @@ extern int DEBUGLEVEL;
 /****************************************************************************
 do a BRS Query 
 ****************************************************************************/
-BOOL do_brs_query_info(struct cli_state *cli, uint16 fnum, 
-                       const char *server_name, uint32 switch_value,
+BOOL brs_query_info( const char *srv_name, uint32 switch_value,
                        void *id)
 {
        prs_struct rbuf;
@@ -42,7 +41,14 @@ BOOL do_brs_query_info(struct cli_state *cli, uint16 fnum,
        BRS_Q_QUERY_INFO q_o;
        BOOL valid_info = False;
 
-       if (server_name == NULL || id == NULL) return False;
+       struct cli_connection *con = NULL;
+
+       if (!cli_connection_init(srv_name, PIPE_BROWSER, &con))
+       {
+               return False;
+       }
+
+       if (id == NULL) return False;
 
        prs_init(&buf , 1024, 4, SAFETY_MARGIN, False);
        prs_init(&rbuf, 0   , 4, SAFETY_MARGIN, True );
@@ -52,13 +58,13 @@ BOOL do_brs_query_info(struct cli_state *cli, uint16 fnum,
        DEBUG(4,("BRS Query Info\n"));
 
        /* store the parameters */
-       make_brs_q_query_info(&q_o, server_name, switch_value);
+       make_brs_q_query_info(&q_o, srv_name, switch_value);
 
        /* turn parameters into data stream */
        brs_io_q_query_info("", &q_o, &buf, 0);
 
        /* send the data on \PIPE\ */
-       if (rpc_api_pipe_req(cli, fnum, BRS_QUERY_INFO, &buf, &rbuf))
+       if (rpc_con_pipe_req(con, BRS_QUERY_INFO, &buf, &rbuf))
        {
                BRS_R_QUERY_INFO r_o;
                BOOL p;
@@ -84,6 +90,8 @@ BOOL do_brs_query_info(struct cli_state *cli, uint16 fnum,
        prs_mem_free(&rbuf);
        prs_mem_free(&buf );
 
+       cli_connection_unlink(con);
+
        return valid_info;
 }
 
index ff8e1cf66a8db4242e972187cfad47aa5b3eb43f..ca1dbe036ca45670688e48d1cdcb8d3ddf30c618 100644 (file)
@@ -33,8 +33,6 @@ extern int DEBUGLEVEL;
 
 #define DEBUG_TESTING
 
-extern struct cli_state *smb_cli;
-
 extern FILE* out_hnd;
 
 
@@ -43,7 +41,6 @@ Browser get info query
 ****************************************************************************/
 void cmd_brs_query_info(struct client_info *info, int argc, char *argv[])
 {
-       uint16 nt_pipe_fnum;
        fstring dest_brs;
        BRS_INFO_100 ctr;
        uint32 info_level = 100;
@@ -64,17 +61,8 @@ void cmd_brs_query_info(struct client_info *info, int argc, char *argv[])
        DEBUG(4,("cmd_brs_query_info: server:%s info level: %d\n",
                                dest_brs, info_level));
 
-       DEBUG(5, ("cmd_brs_query_info: smb_cli->fd:%d\n", smb_cli->fd));
-
-       /* open LSARPC session. */
-       res = res ? cli_nt_session_open(smb_cli, PIPE_BROWSER, &nt_pipe_fnum) : False;
-
        /* send info level: receive requested info.  hopefully. */
-       res = res ? do_brs_query_info(smb_cli, nt_pipe_fnum,
-                               dest_brs, info_level, &ctr) : False;
-
-       /* close the session */
-       cli_nt_session_close(smb_cli, nt_pipe_fnum);
+       res = res ? brs_query_info( dest_brs, info_level, &ctr) : False;
 
        if (res)
        {