summaryrefslogtreecommitdiff
path: root/source4/torture/rap
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-05-04 15:29:53 +0200
committerGünther Deschner <gd@samba.org>2010-05-04 15:49:40 +0200
commitff256b41b81b4a22187abdfd2cf80e977eeb2a4a (patch)
tree2d9a36c3182f6d88d7eca43e51f2b91892cd327d /source4/torture/rap
parenteee803372ae948a578fdda668fb8a2fe3c195788 (diff)
downloadsamba-ff256b41b81b4a22187abdfd2cf80e977eeb2a4a.tar.gz
samba-ff256b41b81b4a22187abdfd2cf80e977eeb2a4a.tar.bz2
samba-ff256b41b81b4a22187abdfd2cf80e977eeb2a4a.zip
s4-smbtorture: add smbcli_rap_netprintdestgetinfo().
Guenther
Diffstat (limited to 'source4/torture/rap')
-rw-r--r--source4/torture/rap/rap.c81
1 files changed, 81 insertions, 0 deletions
diff --git a/source4/torture/rap/rap.c b/source4/torture/rap/rap.c
index 001c131287..3e93b086ce 100644
--- a/source4/torture/rap/rap.c
+++ b/source4/torture/rap/rap.c
@@ -1513,6 +1513,87 @@ NTSTATUS smbcli_rap_netprintdestenum(struct smbcli_tree *tree,
return result;
}
+NTSTATUS smbcli_rap_netprintdestgetinfo(struct smbcli_tree *tree,
+ struct smb_iconv_convenience *iconv_convenience,
+ TALLOC_CTX *mem_ctx,
+ struct rap_NetPrintDestGetInfo *r)
+{
+ struct rap_call *call;
+ NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
+ int i;
+
+ if (!(call = new_rap_cli_call(mem_ctx, iconv_convenience, RAP_WPrintDestGetInfo))) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ rap_cli_push_string(call, r->in.PrintDestName);
+ 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 0:
+ rap_cli_expect_format(call, "B9");
+ break;
+ case 1:
+ rap_cli_expect_format(call, "B9B21WWzW");
+ break;
+ case 2:
+ rap_cli_expect_format(call, "z");
+ break;
+ case 3:
+ rap_cli_expect_format(call, "zzzWWzzzWW");
+ break;
+ default:
+ result = NT_STATUS_INVALID_PARAMETER;
+ goto done;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(rap_NetPrintDestGetInfo, r);
+ }
+
+ result = rap_cli_do_call(tree, iconv_convenience, 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_uint16(call->ndr_pull_param, NDR_SCALARS, &r->out.available));
+
+ switch(r->in.level) {
+ case 0:
+ result = rap_pull_rap_PrintDest0(mem_ctx, call->ndr_pull_data, r->out.convert, &r->out.info.info0);
+ break;
+ case 1:
+ result = rap_pull_rap_PrintDest1(mem_ctx, call->ndr_pull_data, r->out.convert, &r->out.info.info1);
+ break;
+ case 2:
+ result = rap_pull_rap_PrintDest2(mem_ctx, call->ndr_pull_data, r->out.convert, &r->out.info.info2);
+ break;
+ case 3:
+ result = rap_pull_rap_PrintDest3(mem_ctx, call->ndr_pull_data, r->out.convert, &r->out.info.info3);
+ break;
+ }
+
+ if (!NT_STATUS_IS_OK(result)) {
+ goto done;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(rap_NetPrintDestGetInfo, r);
+ }
+
+ result = NT_STATUS_OK;
+
+ done:
+ talloc_free(call);
+ return result;
+}
+
static bool test_netservergetinfo(struct torture_context *tctx,
struct smbcli_state *cli)
{