summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
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)