summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-10-30 22:34:38 +0000
committerLuke Leighton <lkcl@samba.org>1999-10-30 22:34:38 +0000
commit4cda1d2b4faaf9a3abeb338e909a52f8b51fd89d (patch)
tree76981c3569f836f7f815168f76caf7a255fc15e4 /source3/rpc_client
parenteae9b12ca56837a2a39c1ebad21eee7e502b579b (diff)
downloadsamba-4cda1d2b4faaf9a3abeb338e909a52f8b51fd89d.tar.gz
samba-4cda1d2b4faaf9a3abeb338e909a52f8b51fd89d.tar.bz2
samba-4cda1d2b4faaf9a3abeb338e909a52f8b51fd89d.zip
NetServerTransportEnum parsing, client-side and rpcclient "srvtransports" added.
(This used to be commit 37f4aac06fec3fbb34ed40d1010829b2e1f28558)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_lsarpc.c2
-rw-r--r--source3/rpc_client/cli_srvsvc.c77
2 files changed, 78 insertions, 1 deletions
diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c
index c30a8eaef9..b7134bebb6 100644
--- a/source3/rpc_client/cli_lsarpc.c
+++ b/source3/rpc_client/cli_lsarpc.c
@@ -58,7 +58,7 @@ BOOL lsa_open_policy(struct cli_state *cli, uint16 fnum,
if (sec_qos)
{
make_lsa_sec_qos(&qos, 2, 1, 0, 0x20000000);
- make_q_open_pol(&q_o, 0x5c, 0, 0, &qos);
+ make_q_open_pol(&q_o, 0x5c, 0, 0x02000000, &qos);
}
else
{
diff --git a/source3/rpc_client/cli_srvsvc.c b/source3/rpc_client/cli_srvsvc.c
index c3d608c4b3..0ade6799e9 100644
--- a/source3/rpc_client/cli_srvsvc.c
+++ b/source3/rpc_client/cli_srvsvc.c
@@ -32,6 +32,83 @@
extern int DEBUGLEVEL;
/****************************************************************************
+do a server net tprt enum
+****************************************************************************/
+BOOL do_srv_net_srv_tprt_enum(struct cli_state *cli, uint16 fnum,
+ char *server_name,
+ uint32 switch_value, SRV_TPRT_INFO_CTR *ctr,
+ uint32 preferred_len,
+ ENUM_HND *hnd)
+{
+ prs_struct data;
+ prs_struct rdata;
+ SRV_Q_NET_TPRT_ENUM q_o;
+ BOOL valid_enum = False;
+
+ if (server_name == NULL || ctr == NULL || preferred_len == 0) return False;
+
+ prs_init(&data , 1024, 4, SAFETY_MARGIN, False);
+ prs_init(&rdata, 0 , 4, SAFETY_MARGIN, True );
+
+ /* create and send a MSRPC command with api SRV_NETTPRTENUM */
+
+ DEBUG(4,("SRV Net Server Transport Enum(%s), level %d, enum:%8x\n",
+ server_name, switch_value, get_enum_hnd(hnd)));
+
+ ctr->switch_value = switch_value;
+ ctr->ptr_tprt_ctr = 1;
+ ctr->tprt.info0.num_entries_read = 0;
+ ctr->tprt.info0.ptr_tprt_info = 1;
+
+ /* store the parameters */
+ make_srv_q_net_tprt_enum(&q_o, server_name,
+ switch_value, ctr,
+ preferred_len,
+ hnd);
+
+ /* turn parameters into data stream */
+ srv_io_q_net_tprt_enum("", &q_o, &data, 0);
+
+ /* send the data on \PIPE\ */
+ if (rpc_api_pipe_req(cli, fnum, SRV_NETTRANSPORTENUM, &data, &rdata))
+ {
+ SRV_R_NET_TPRT_ENUM r_o;
+ BOOL p;
+
+ r_o.ctr = ctr;
+
+ srv_io_r_net_tprt_enum("", &r_o, &rdata, 0);
+ p = rdata.offset != 0;
+
+ if (p && r_o.status != 0)
+ {
+ /* report error code */
+ DEBUG(0,("SRV_R_NET_SRV_GET_INFO: %s\n", get_nt_error_msg(r_o.status)));
+ p = 0;
+ }
+
+ if (p && r_o.ctr->switch_value != switch_value)
+ {
+ /* different switch levels. oops. */
+ DEBUG(0,("SRV_R_NET_SRV_TPRT_ENUM: info class %d does not match request %d\n",
+ r_o.ctr->switch_value, switch_value));
+ p = 0;
+ }
+
+ if (p)
+ {
+ /* ok, at last: we're happy. */
+ valid_enum = True;
+ }
+ }
+
+ prs_mem_free(&data );
+ prs_mem_free(&rdata );
+
+ return valid_enum;
+}
+
+/****************************************************************************
do a server net conn enum
****************************************************************************/
BOOL do_srv_net_srv_conn_enum(struct cli_state *cli, uint16 fnum,