summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2011-05-11 23:37:08 +0200
committerKarolin Seeger <kseeger@samba.org>2011-05-17 09:18:31 +0200
commit2f6958f0f315af8050843e601b8993850317e9a3 (patch)
treecfaeeb72af0e1e148f344966755b58c2b61ad176 /source4
parentf6ddd1e0bfca7be8d0758f7662c17fdd8374ba91 (diff)
downloadsamba-2f6958f0f315af8050843e601b8993850317e9a3.tar.gz
s4-libcli/rap: add smbcli_rap_netremotetod().
Guenther (cherry picked from commit b1948659ad987ce50d048dabc34f03031a243ee5) (cherry picked from commit 1ace9011db167b96cb60fef713d69d8d502e9222)
Diffstat (limited to 'source4')
-rw-r--r--source4/libcli/rap/rap.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/source4/libcli/rap/rap.c b/source4/libcli/rap/rap.c
index 5ea9e816e81..7743f64c4cc 100644
--- a/source4/libcli/rap/rap.c
+++ b/source4/libcli/rap/rap.c
@@ -1633,3 +1633,50 @@ NTSTATUS smbcli_rap_netuserdelete(struct smbcli_tree *tree,
talloc_free(call);
return result;
}
+
+NTSTATUS smbcli_rap_netremotetod(struct smbcli_tree *tree,
+ TALLOC_CTX *mem_ctx,
+ struct rap_NetRemoteTOD *r)
+{
+ struct rap_call *call;
+ NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
+
+ if (!(call = new_rap_cli_call(mem_ctx, RAP_NetRemoteTOD))) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ rap_cli_push_rcvbuf(call, r->in.bufsize);
+
+ rap_cli_expect_format(call, "DDBBBBWWBBWB");
+ rap_cli_expect_extra_format(call, "");
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(rap_NetRemoteTOD, r);
+ }
+
+ result = rap_cli_do_call(tree, call);
+
+ if (!NT_STATUS_IS_OK(result))
+ goto done;
+
+ result = NT_STATUS_INVALID_PARAMETER;
+
+ 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_rap_TimeOfDayInfo(call->ndr_pull_data, NDR_SCALARS|NDR_BUFFERS, &r->out.tod));
+
+ result = NT_STATUS_OK;
+
+ if (!NT_STATUS_IS_OK(result)) {
+ goto done;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(rap_NetRemoteTOD, r);
+ }
+
+ done:
+ talloc_free(call);
+ return result;
+}