diff options
author | Luke Leighton <lkcl@samba.org> | 1999-11-27 22:53:28 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1999-11-27 22:53:28 +0000 |
commit | 601d217f44ea1ce3735b9267b6f829b472a982b4 (patch) | |
tree | 6c203457c918bba8b349268cd0d97ac5c15a6162 | |
parent | 4c3556fae73c60693355f95f48ac63834ba4dd10 (diff) | |
download | samba-601d217f44ea1ce3735b9267b6f829b472a982b4.tar.gz samba-601d217f44ea1ce3735b9267b6f829b472a982b4.tar.xz samba-601d217f44ea1ce3735b9267b6f829b472a982b4.zip |
moved browser command brsinfo over to new abstracted connection
-rw-r--r-- | source/include/proto.h | 15 | ||||
-rw-r--r-- | source/rpc_client/cli_brs.c | 18 | ||||
-rw-r--r-- | source/rpcclient/cmd_brs.c | 14 |
3 files changed, 20 insertions, 27 deletions
diff --git a/source/include/proto.h b/source/include/proto.h index fac04a152f8..7a6afbe7925 100644 --- a/source/include/proto.h +++ b/source/include/proto.h @@ -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 */ diff --git a/source/rpc_client/cli_brs.c b/source/rpc_client/cli_brs.c index 01fc0439539..f4e055f3944 100644 --- a/source/rpc_client/cli_brs.c +++ b/source/rpc_client/cli_brs.c @@ -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; } diff --git a/source/rpcclient/cmd_brs.c b/source/rpcclient/cmd_brs.c index ff8e1cf66a8..ca1dbe036ca 100644 --- a/source/rpcclient/cmd_brs.c +++ b/source/rpcclient/cmd_brs.c @@ -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) { |