summaryrefslogtreecommitdiff
path: root/source4/torture/rap
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-04-29 14:22:55 +0200
committerGünther Deschner <gd@samba.org>2010-04-29 14:24:06 +0200
commit99518bc1ea330474ba27dcce0dde141026ebaae2 (patch)
tree0dd40c370a3954b599ecf558089946d162df185a /source4/torture/rap
parentd266af79b3e96e534c8d0b41e22fa758387c8727 (diff)
downloadsamba-99518bc1ea330474ba27dcce0dde141026ebaae2.tar.gz
samba-99518bc1ea330474ba27dcce0dde141026ebaae2.tar.bz2
samba-99518bc1ea330474ba27dcce0dde141026ebaae2.zip
s4-smbtorture: add smbcli_rap_netprintjob{pause,continue,delete}.
Guenther
Diffstat (limited to 'source4/torture/rap')
-rw-r--r--source4/torture/rap/rap.c110
1 files changed, 110 insertions, 0 deletions
diff --git a/source4/torture/rap/rap.c b/source4/torture/rap/rap.c
index e1191bb731..9e2307ce10 100644
--- a/source4/torture/rap/rap.c
+++ b/source4/torture/rap/rap.c
@@ -765,6 +765,116 @@ NTSTATUS smbcli_rap_netprintqgetinfo(struct smbcli_tree *tree,
return result;
}
+NTSTATUS smbcli_rap_netprintjobpause(struct smbcli_tree *tree,
+ struct smb_iconv_convenience *iconv_convenience,
+ TALLOC_CTX *mem_ctx,
+ struct rap_NetPrintJobPause *r)
+{
+ struct rap_call *call;
+ NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
+
+ if (!(call = new_rap_cli_call(mem_ctx, iconv_convenience, RAP_WPrintJobPause))) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ rap_cli_push_word(call, r->in.JobID);
+
+ rap_cli_expect_format(call, "W");
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(rap_NetPrintJobPause, r);
+ }
+
+ result = rap_cli_do_call(tree, iconv_convenience, call);
+
+ if (!NT_STATUS_IS_OK(result))
+ goto done;
+
+ NDR_GOTO(ndr_pull_uint16(call->ndr_pull_param, NDR_SCALARS, &r->out.status));
+ NDR_GOTO(ndr_pull_uint16(call->ndr_pull_param, NDR_SCALARS, &r->out.convert));
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(rap_NetPrintJobPause, r);
+ }
+
+ done:
+ talloc_free(call);
+ return result;
+}
+
+NTSTATUS smbcli_rap_netprintjobcontinue(struct smbcli_tree *tree,
+ struct smb_iconv_convenience *iconv_convenience,
+ TALLOC_CTX *mem_ctx,
+ struct rap_NetPrintJobContinue *r)
+{
+ struct rap_call *call;
+ NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
+
+ if (!(call = new_rap_cli_call(mem_ctx, iconv_convenience, RAP_WPrintJobContinue))) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ rap_cli_push_word(call, r->in.JobID);
+
+ rap_cli_expect_format(call, "W");
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(rap_NetPrintJobContinue, r);
+ }
+
+ result = rap_cli_do_call(tree, iconv_convenience, call);
+
+ if (!NT_STATUS_IS_OK(result))
+ goto done;
+
+ NDR_GOTO(ndr_pull_uint16(call->ndr_pull_param, NDR_SCALARS, &r->out.status));
+ NDR_GOTO(ndr_pull_uint16(call->ndr_pull_param, NDR_SCALARS, &r->out.convert));
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(rap_NetPrintJobContinue, r);
+ }
+
+ done:
+ talloc_free(call);
+ return result;
+}
+
+NTSTATUS smbcli_rap_netprintjobdelete(struct smbcli_tree *tree,
+ struct smb_iconv_convenience *iconv_convenience,
+ TALLOC_CTX *mem_ctx,
+ struct rap_NetPrintJobDelete *r)
+{
+ struct rap_call *call;
+ NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
+
+ if (!(call = new_rap_cli_call(mem_ctx, iconv_convenience, RAP_WPrintJobDel))) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ rap_cli_push_word(call, r->in.JobID);
+
+ rap_cli_expect_format(call, "W");
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(rap_NetPrintJobDelete, r);
+ }
+
+ result = rap_cli_do_call(tree, iconv_convenience, call);
+
+ if (!NT_STATUS_IS_OK(result))
+ goto done;
+
+ NDR_GOTO(ndr_pull_uint16(call->ndr_pull_param, NDR_SCALARS, &r->out.status));
+ NDR_GOTO(ndr_pull_uint16(call->ndr_pull_param, NDR_SCALARS, &r->out.convert));
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(rap_NetPrintJobDelete, r);
+ }
+
+ done:
+ talloc_free(call);
+ return result;
+}
static bool test_netservergetinfo(struct torture_context *tctx,
struct smbcli_state *cli)