summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2011-03-18 01:22:59 +0100
committerGünther Deschner <gd@samba.org>2011-03-18 01:24:07 +0100
commit436b49771460139f1227b15445f68b80b5fbf6e6 (patch)
tree7ffd8c94a611a6638afad6ab74330f50170e303e /source4/libcli
parentf87a072b95e0eabffedb975d4fd4784300f7ad18 (diff)
downloadsamba-436b49771460139f1227b15445f68b80b5fbf6e6.tar.gz
samba-436b49771460139f1227b15445f68b80b5fbf6e6.tar.bz2
samba-436b49771460139f1227b15445f68b80b5fbf6e6.zip
s4-libcli/rap: add smbcli_rap_netsessiongetinfo().
Guenther
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/rap/rap.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/source4/libcli/rap/rap.c b/source4/libcli/rap/rap.c
index 08b02787dc..5ea9e816e8 100644
--- a/source4/libcli/rap/rap.c
+++ b/source4/libcli/rap/rap.c
@@ -1472,6 +1472,66 @@ NTSTATUS smbcli_rap_netsessionenum(struct smbcli_tree *tree,
return result;
}
+NTSTATUS smbcli_rap_netsessiongetinfo(struct smbcli_tree *tree,
+ TALLOC_CTX *mem_ctx,
+ struct rap_NetSessionGetInfo *r)
+{
+ struct rap_call *call;
+ NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
+
+ if (!(call = new_rap_cli_call(mem_ctx, RAP_WsessionGetInfo))) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ rap_cli_push_string(call, r->in.SessionName);
+ rap_cli_push_word(call, r->in.level);
+ rap_cli_push_rcvbuf(call, r->in.bufsize);
+ rap_cli_expect_word(call);
+
+ switch(r->in.level) {
+ case 2:
+ rap_cli_expect_format(call, "zzWWWDDDz");
+ break;
+ default:
+ result = NT_STATUS_INVALID_PARAMETER;
+ break;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(rap_NetSessionGetInfo, r);
+ }
+
+ result = rap_cli_do_call(tree, call);
+
+ if (!NT_STATUS_IS_OK(result))
+ goto done;
+
+ result = NT_STATUS_INVALID_PARAMETER;
+
+ ZERO_STRUCT(r->out);
+
+ NDR_GOTO(ndr_pull_rap_status(call->ndr_pull_param, NDR_SCALARS, &r->out.status));
+ NDR_GOTO(ndr_pull_uint16(call->ndr_pull_param, NDR_SCALARS, &r->out.convert));
+ NDR_GOTO(ndr_pull_uint16(call->ndr_pull_param, NDR_SCALARS, &r->out.available));
+
+ if (r->out.status == 0 && r->out.available) {
+ call->ndr_pull_data->relative_rap_convert = r->out.convert;
+
+ NDR_GOTO(ndr_pull_set_switch_value(call->ndr_pull_data, &r->out.info, r->in.level));
+ NDR_GOTO(ndr_pull_rap_session_info(call->ndr_pull_data, NDR_SCALARS|NDR_BUFFERS, &r->out.info));
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(rap_NetSessionGetInfo, r);
+ }
+
+ result = NT_STATUS_OK;
+ done:
+ talloc_free(call);
+ return result;
+}
+
+
NTSTATUS smbcli_rap_netuseradd(struct smbcli_tree *tree,
TALLOC_CTX *mem_ctx,
struct rap_NetUserAdd *r)