summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-04-28 12:50:58 +0200
committerGünther Deschner <gd@samba.org>2010-04-28 23:23:37 +0200
commit1764bcecf2f0fd388a888835019a8e064e6c30fa (patch)
tree515a7e15542be8738bd35d320370be574e400547
parent42003e5661549ed9c4f34174509c0f4977510f30 (diff)
downloadsamba-1764bcecf2f0fd388a888835019a8e064e6c30fa.tar.gz
samba-1764bcecf2f0fd388a888835019a8e064e6c30fa.tar.bz2
samba-1764bcecf2f0fd388a888835019a8e064e6c30fa.zip
s4-smbtorture: add smbcli_rap_netprintqenum.
Guenther
-rw-r--r--source4/torture/rap/rap.c110
1 files changed, 109 insertions, 1 deletions
diff --git a/source4/torture/rap/rap.c b/source4/torture/rap/rap.c
index bddfacef32..6e88b3017a 100644
--- a/source4/torture/rap/rap.c
+++ b/source4/torture/rap/rap.c
@@ -23,7 +23,7 @@
#include "libcli/libcli.h"
#include "torture/smbtorture.h"
#include "torture/util.h"
-#include "../librpc/gen_ndr/rap.h"
+#include "../librpc/gen_ndr/ndr_rap.h"
#include "librpc/ndr/libndr.h"
#include "param/param.h"
#include "torture/rap/proto.h"
@@ -502,6 +502,114 @@ NTSTATUS smbcli_rap_netservergetinfo(struct smbcli_tree *tree,
return result;
}
+NTSTATUS smbcli_rap_netprintqenum(struct smbcli_tree *tree,
+ struct smb_iconv_convenience *iconv_convenience,
+ TALLOC_CTX *mem_ctx,
+ struct rap_NetPrintQEnum *r)
+{
+ struct rap_call *call;
+ NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
+ int i;
+
+ if (!(call = new_rap_cli_call(mem_ctx, iconv_convenience, RAP_WPrintQEnum))) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ rap_cli_push_word(call, r->in.level);
+ rap_cli_push_rcvbuf(call, r->in.bufsize);
+ rap_cli_expect_multiple_entries(call);
+
+ switch(r->in.level) {
+ case 0:
+ rap_cli_expect_format(call, "B13");
+ break;
+ case 1:
+ rap_cli_expect_format(call, "B13BWWWzzzzzWW");
+ break;
+ case 2:
+ rap_cli_expect_format(call, "B13BWWWzzzzzWN");
+ break;
+ case 3:
+ rap_cli_expect_format(call, "zWWWWzzzzWWzzl");
+ break;
+ case 4:
+ rap_cli_expect_format(call, "zWWWWzzzzWNzzl");
+ break;
+ case 5:
+ rap_cli_expect_format(call, "z");
+ break;
+ default:
+ result = NT_STATUS_INVALID_PARAMETER;
+ goto done;
+ }
+
+ 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_uint16(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.count));
+ NDR_GOTO(ndr_pull_uint16(call->ndr_pull_param, NDR_SCALARS, &r->out.available));
+
+ r->out.info = talloc_array(mem_ctx, union rap_printq_info, r->out.count);
+
+ if (r->out.info == NULL) {
+ result = NT_STATUS_NO_MEMORY;
+ goto done;
+ }
+
+ for (i=0; i<r->out.count; i++) {
+ switch(r->in.level) {
+ case 0:
+ NDR_GOTO(ndr_pull_bytes(call->ndr_pull_data,
+ r->out.info[i].info0.PrintQName, 13));
+ break;
+ case 1:
+ NDR_GOTO(ndr_pull_bytes(call->ndr_pull_data,
+ r->out.info[i].info1.PrintQName, 13));
+ NDR_GOTO(ndr_pull_uint8(call->ndr_pull_data,
+ NDR_SCALARS, &r->out.info[i].info1.Pad1));
+ NDR_GOTO(ndr_pull_uint16(call->ndr_pull_data,
+ NDR_SCALARS, &r->out.info[i].info1.Priority));
+ NDR_GOTO(ndr_pull_uint16(call->ndr_pull_data,
+ NDR_SCALARS, &r->out.info[i].info1.StartTime));
+ NDR_GOTO(ndr_pull_uint16(call->ndr_pull_data,
+ NDR_SCALARS, &r->out.info[i].info1.UntilTime));
+ RAP_GOTO(rap_pull_string(mem_ctx, call->ndr_pull_data,
+ r->out.convert,
+ &r->out.info[i].info1.SeparatorPageFilename));
+ RAP_GOTO(rap_pull_string(mem_ctx, call->ndr_pull_data,
+ r->out.convert,
+ &r->out.info[i].info1.PrintProcessorDllName));
+ RAP_GOTO(rap_pull_string(mem_ctx, call->ndr_pull_data,
+ r->out.convert,
+ &r->out.info[i].info1.PrintDestinationsName));
+ RAP_GOTO(rap_pull_string(mem_ctx, call->ndr_pull_data,
+ r->out.convert,
+ &r->out.info[i].info1.PrintParameterString));
+ RAP_GOTO(rap_pull_string(mem_ctx, call->ndr_pull_data,
+ r->out.convert,
+ &r->out.info[i].info1.CommentString));
+ NDR_GOTO(ndr_pull_rap_PrintQStatusCode(call->ndr_pull_data,
+ NDR_SCALARS, &r->out.info[i].info1.PrintQStatus));
+ NDR_GOTO(ndr_pull_uint16(call->ndr_pull_data,
+ NDR_SCALARS, &r->out.info[i].info1.PrintJobCount));
+
+ break;
+ }
+ }
+
+ result = NT_STATUS_OK;
+
+ done:
+ talloc_free(call);
+ return result;
+}
+
static bool test_netservergetinfo(struct torture_context *tctx,
struct smbcli_state *cli)
{