[SCM] Samba Shared Repository - branch v3-6-test updated
Stefan Metzmacher
metze at samba.org
Thu Mar 10 10:32:29 MST 2011
The branch, v3-6-test has been updated
via 902fb32 frstrans.idl: add idl for RawGetFileDataAsync() and RdcGetFileDataAsync()
via 5f6ed3f pidl: add support for 'pipe' at the NDR layer
via 35615f0 pidl/idl.yp: fill 'pipe' elements with array and count
via 926d537 pidl:NDR/Client: skip all functions if pipe elements are used
via 0b479cb pidl:NDR/Client: skip sync functions if pipe elements are used
via 0536914 pidl:Python: don't generate functions with pipe elements
via 9dcd0b0 pidl:Samba3/ClientNDR: don't generate stubs for functions with pipe elements
via a24476d pidl/NDR: add ContainsPipe() function
via a1fc75a librpc/tools/ndrdump: add support for dcerpc 'pipe' elements in functions
via 3dbb218 librpc/ndr: add ndr_push_pipe_chunk_trailer() and ndr_check_pipe_chunk_trailer()
via 101c57e librpc/ndr: add ndr_interface_call_pipe
via 6c07d0a pidl/Typelist: add is_fixed_size_scalar()
via 7d5c980 pidl/Typelist: dnsp_name and dnsp_string are scalar references
from a938c1c s3:test: ignore "setup directory" parameter in the net registry roundtrip test
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test
- Log -----------------------------------------------------------------
commit 902fb321f8d76e59f15710e3c3e27c81d2a0946d
Author: Stefan Metzmacher <metze at samba.org>
Date: Sat Sep 18 19:45:27 2010 +0200
frstrans.idl: add idl for RawGetFileDataAsync() and RdcGetFileDataAsync()
metze
Autobuild-User: Stefan Metzmacher <metze at samba.org>
Autobuild-Date: Thu Mar 10 15:18:22 CET 2011 on sn-devel-104
(cherry picked from commit 969c7bd77bdda55b9a07fc6381c4c1f562861cbe)
commit 5f6ed3f151d3678775d120b01a45009d8846e7e7
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Sep 21 01:44:38 2010 +0200
pidl: add support for 'pipe' at the NDR layer
metze
(cherry picked from commit d79fb9098bc3ce37daa8ab6d51dc62ad0bc2ad26)
commit 35615f011c91344d737db0830f8549cf2ac9ef67
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Sep 21 19:30:08 2010 +0200
pidl/idl.yp: fill 'pipe' elements with array and count
metze
(cherry picked from commit f43e757096750dc2844af49363981fd0246d9f48)
commit 926d537728e04f55f62ea7a82ec224a9c81457c6
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Oct 11 08:03:18 2010 +0200
pidl:NDR/Client: skip all functions if pipe elements are used
We don't support pipe at the dcerpc level yet.
metze
(cherry picked from commit 91ef69435167f44d1353e15cef2eb4969b53d27c)
commit 0b479cb9052b8e50dfdd470eaf179253d2000267
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Oct 11 08:03:18 2010 +0200
pidl:NDR/Client: skip sync functions if pipe elements are used
metze
(cherry picked from commit f383497436dbbadfdcb1062fee0c111eca50df7d)
commit 05369146cbfd781fa4942d765955b30b756b7768
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Oct 11 07:54:59 2010 +0200
pidl:Python: don't generate functions with pipe elements
metze
(cherry picked from commit 7537f9c9bb78992850a641973a8df818d2fcaf25)
commit 9dcd0b0ebb760851b87156160c1962e5e848c633
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Oct 11 07:53:48 2010 +0200
pidl:Samba3/ClientNDR: don't generate stubs for functions with pipe elements
metze
(cherry picked from commit 29bd658634e9afe0037170a2f3ad2512f9106761)
commit a24476d527397a14a6225502fb436601de93b4a2
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Sep 21 02:20:14 2010 +0200
pidl/NDR: add ContainsPipe() function
metze
(cherry picked from commit eaa7ecdda7938e12db94f5ecbb978e5e7bca5f16)
commit a1fc75a9fbddd397b8640f8476adcd9f23ad04ce
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Sep 21 08:34:31 2010 +0200
librpc/tools/ndrdump: add support for dcerpc 'pipe' elements in functions
metze
(cherry picked from commit 7d451838b978b7a88bc45a9fc878b99af59be7c3)
commit 3dbb2187444306db5a505e13f9c02973faf6dfec
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Sep 21 05:18:02 2010 +0200
librpc/ndr: add ndr_push_pipe_chunk_trailer() and ndr_check_pipe_chunk_trailer()
metze
(cherry picked from commit 2a47ed81066ccf7573b80e0a85bce8eb9866c628)
commit 101c57e90d9feb653de182164ab6c3def79eef71
Author: Stefan Metzmacher <metze at samba.org>
Date: Sun Sep 19 13:56:13 2010 +0200
librpc/ndr: add ndr_interface_call_pipe
metze
(cherry picked from commit eceea8641e9079534a15ce01d24ef94acbe49d98)
commit 6c07d0a6010268f795de908f28ec97c93fddad46
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Mar 8 15:45:33 2011 +0100
pidl/Typelist: add is_fixed_size_scalar()
metze
(cherry picked from commit 6e4e3f57e43189fa2944c841982621594d167d2d)
commit 7d5c980030116e11a5714722d5920e7e8a69e747
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Mar 8 15:44:31 2011 +0100
pidl/Typelist: dnsp_name and dnsp_string are scalar references
metze
(cherry picked from commit 6ef40f31992455c7603f0722846cfab4fe4fa0bc)
-----------------------------------------------------------------------
Summary of changes:
librpc/idl/frstrans.idl | 12 ++-
librpc/ndr/libndr.h | 18 +++
librpc/ndr/ndr.c | 34 +++++
librpc/tools/ndrdump.c | 78 ++++++++++-
pidl/idl.yp | 26 ++++-
pidl/lib/Parse/Pidl/IDL.pm | 86 ++++++++-----
pidl/lib/Parse/Pidl/NDR.pm | 149 ++++++++++++++++++++--
pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm | 11 ++
pidl/lib/Parse/Pidl/Samba4/Header.pm | 26 ++++
pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm | 66 +++++++++-
pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 213 +++++++++++++++++++++++++++++-
pidl/lib/Parse/Pidl/Samba4/Python.pm | 11 ++-
pidl/lib/Parse/Pidl/Typelist.pm | 33 ++++-
13 files changed, 701 insertions(+), 62 deletions(-)
Changeset truncated at 500 lines:
diff --git a/librpc/idl/frstrans.idl b/librpc/idl/frstrans.idl
index 74f3c64..a60529b 100644
--- a/librpc/idl/frstrans.idl
+++ b/librpc/idl/frstrans.idl
@@ -277,9 +277,17 @@ interface frstrans
/*****************/
/* Function 0x0f */
- [todo] void FRSTRANS_RAW_GET_FILE_DATA_ASYNC();
+ typedef pipe uint8 frstrans_BytePipe;
+
+ WERROR frstrans_RawGetFileDataAsync(
+ [in,ref] policy_handle *server_context,
+ [out,ref] frstrans_BytePipe *byte_pipe
+ );
/*****************/
/* Function 0x10 */
- [todo] void FRSTRANS_RDC_GET_FILE_DATA_ASYNC();
+ WERROR frstrans_RdcGetFileDataAsync(
+ [in,ref] policy_handle *server_context,
+ [out,ref] frstrans_BytePipe *byte_pipe
+ );
}
diff --git a/librpc/ndr/libndr.h b/librpc/ndr/libndr.h
index 21e4bda..1f1f019 100644
--- a/librpc/ndr/libndr.h
+++ b/librpc/ndr/libndr.h
@@ -330,12 +330,28 @@ extern const struct ndr_syntax_id ndr_transfer_syntax;
extern const struct ndr_syntax_id ndr64_transfer_syntax;
extern const struct ndr_syntax_id null_ndr_syntax_id;
+struct ndr_interface_call_pipe {
+ const char *name;
+ const char *chunk_struct_name;
+ size_t chunk_struct_size;
+ ndr_push_flags_fn_t ndr_push;
+ ndr_pull_flags_fn_t ndr_pull;
+ ndr_print_fn_t ndr_print;
+};
+
+struct ndr_interface_call_pipes {
+ uint32_t num_pipes;
+ const struct ndr_interface_call_pipe *pipes;
+};
+
struct ndr_interface_call {
const char *name;
size_t struct_size;
ndr_push_flags_fn_t ndr_push;
ndr_pull_flags_fn_t ndr_pull;
ndr_print_function_t ndr_print;
+ struct ndr_interface_call_pipes in_pipes;
+ struct ndr_interface_call_pipes out_pipes;
};
struct ndr_interface_string_array {
@@ -453,6 +469,8 @@ enum ndr_err_code ndr_check_array_size(struct ndr_pull *ndr, void *p, uint32_t s
enum ndr_err_code ndr_pull_array_length(struct ndr_pull *ndr, const void *p);
uint32_t ndr_get_array_length(struct ndr_pull *ndr, const void *p);
enum ndr_err_code ndr_check_array_length(struct ndr_pull *ndr, void *p, uint32_t length);
+enum ndr_err_code ndr_push_pipe_chunk_trailer(struct ndr_push *ndr, int ndr_flags, uint32_t count);
+enum ndr_err_code ndr_check_pipe_chunk_trailer(struct ndr_pull *ndr, int ndr_flags, uint32_t count);
enum ndr_err_code ndr_push_set_switch_value(struct ndr_push *ndr, const void *p, uint32_t val);
enum ndr_err_code ndr_pull_set_switch_value(struct ndr_pull *ndr, const void *p, uint32_t val);
enum ndr_err_code ndr_print_set_switch_value(struct ndr_print *ndr, const void *p, uint32_t val);
diff --git a/librpc/ndr/ndr.c b/librpc/ndr/ndr.c
index cfeb231..56d1fab 100644
--- a/librpc/ndr/ndr.c
+++ b/librpc/ndr/ndr.c
@@ -829,6 +829,40 @@ _PUBLIC_ enum ndr_err_code ndr_check_array_length(struct ndr_pull *ndr, void *p,
return NDR_ERR_SUCCESS;
}
+_PUBLIC_ enum ndr_err_code ndr_push_pipe_chunk_trailer(struct ndr_push *ndr, int ndr_flags, uint32_t count)
+{
+ if (ndr->flags & LIBNDR_FLAG_NDR64) {
+ int64_t tmp = 0 - (int64_t)count;
+ uint64_t ncount = tmp;
+
+ NDR_CHECK(ndr_push_hyper(ndr, ndr_flags, ncount));
+ }
+
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_check_pipe_chunk_trailer(struct ndr_pull *ndr, int ndr_flags, uint32_t count)
+{
+ if (ndr->flags & LIBNDR_FLAG_NDR64) {
+ int64_t tmp = 0 - (int64_t)count;
+ uint64_t ncount1 = tmp;
+ uint64_t ncount2;
+
+ NDR_CHECK(ndr_pull_hyper(ndr, ndr_flags, &ncount2));
+ if (ncount1 == ncount2) {
+ return NDR_ERR_SUCCESS;
+ }
+
+ return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE,
+ "Bad pipe trailer[%lld should be %lld] size was %lu\"",
+ (unsigned long long)ncount2,
+ (unsigned long long)ncount1,
+ (unsigned long)count);
+ }
+
+ return NDR_ERR_SUCCESS;
+}
+
/*
store a switch value
*/
diff --git a/librpc/tools/ndrdump.c b/librpc/tools/ndrdump.c
index f0f4eaf..284dbce 100644
--- a/librpc/tools/ndrdump.c
+++ b/librpc/tools/ndrdump.c
@@ -137,6 +137,53 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force)
dump_data_cb(d, l, !force, printf_cb, NULL);
}
+static NTSTATUS ndrdump_pull_and_print_pipes(const char *function,
+ struct ndr_pull *ndr_pull,
+ struct ndr_print *ndr_print,
+ const struct ndr_interface_call_pipes *pipes)
+{
+ NTSTATUS status;
+ enum ndr_err_code ndr_err;
+ uint32_t i;
+
+ for (i=0; i < pipes->num_pipes; i++) {
+ uint64_t idx = 0;
+ while (true) {
+ uint32_t *count;
+ void *c;
+ char *n;
+
+ c = talloc_zero_size(ndr_pull, pipes->pipes[i].chunk_struct_size);
+ talloc_set_name(c, "struct %s", pipes->pipes[i].name);
+ /*
+ * Note: the first struct member is always
+ * 'uint32_t count;'
+ */
+ count = (uint32_t *)c;
+
+ n = talloc_asprintf(c, "%s: %s[%llu]",
+ function, pipes->pipes[i].name,
+ (unsigned long long)idx);
+
+ ndr_err = pipes->pipes[i].ndr_pull(ndr_pull, NDR_SCALARS, c);
+ status = ndr_map_error2ntstatus(ndr_err);
+
+ printf("pull returned %s\n", nt_errstr(status));
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+ pipes->pipes[i].ndr_print(ndr_print, n, c);
+
+ if (*count == 0) {
+ break;
+ }
+ idx++;
+ }
+ }
+
+ return NT_STATUS_OK;
+}
+
int main(int argc, const char *argv[])
{
const struct ndr_interface_table *p = NULL;
@@ -172,6 +219,8 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force)
POPT_COMMON_VERSION
{ NULL }
};
+ struct ndr_interface_call_pipes *in_pipes = NULL;
+ struct ndr_interface_call_pipes *out_pipes = NULL;
ndr_table_init();
@@ -247,19 +296,21 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force)
exit(1);
}
+ f = find_function(p, function);
+
if (strcmp(inout, "in") == 0 ||
strcmp(inout, "request") == 0) {
flags = NDR_IN;
+ in_pipes = &f->in_pipes;
} else if (strcmp(inout, "out") == 0 ||
strcmp(inout, "response") == 0) {
flags = NDR_OUT;
+ out_pipes = &f->out_pipes;
} else {
printf("Bad inout value '%s'\n", inout);
exit(1);
}
- f = find_function(p, function);
-
mem_ctx = talloc_init("ndrdump");
st = talloc_zero_size(mem_ctx, f->struct_size);
@@ -331,6 +382,18 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force)
ndr_pull->flags |= LIBNDR_FLAG_NDR64;
}
+ ndr_print = talloc_zero(mem_ctx, struct ndr_print);
+ ndr_print->print = ndr_print_printf_helper;
+ ndr_print->depth = 1;
+
+ if (out_pipes) {
+ status = ndrdump_pull_and_print_pipes(function, ndr_pull, ndr_print, out_pipes);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("dump FAILED\n");
+ exit(1);
+ }
+ }
+
ndr_err = f->ndr_pull(ndr_pull, flags, st);
status = ndr_map_error2ntstatus(ndr_err);
@@ -348,9 +411,6 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force)
ndrdump_data(blob.data, blob.length, dumpdata);
}
- ndr_print = talloc_zero(mem_ctx, struct ndr_print);
- ndr_print->print = ndr_print_printf_helper;
- ndr_print->depth = 1;
f->ndr_print(ndr_print, function, flags, st);
if (!NT_STATUS_IS_OK(status)) {
@@ -358,6 +418,14 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force)
exit(1);
}
+ if (in_pipes) {
+ status = ndrdump_pull_and_print_pipes(function, ndr_pull, ndr_print, in_pipes);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("dump FAILED\n");
+ exit(1);
+ }
+ }
+
if (validate) {
DATA_BLOB v_blob;
struct ndr_push *ndr_v_push;
diff --git a/pidl/idl.yp b/pidl/idl.yp
index 0062859..b5c5185 100644
--- a/pidl/idl.yp
+++ b/pidl/idl.yp
@@ -387,7 +387,31 @@ pipe:
{{
"TYPE" => "PIPE",
"PROPERTIES" => $_[1],
- "DATA" => $_[3],
+ "NAME" => undef,
+ "DATA" => {
+ "TYPE" => "STRUCT",
+ "PROPERTIES" => $_[1],
+ "NAME" => undef,
+ "ELEMENTS" => [{
+ "NAME" => "count",
+ "PROPERTIES" => $_[1],
+ "POINTERS" => 0,
+ "ARRAY_LEN" => [],
+ "TYPE" => "uint3264",
+ "FILE" => $_[0]->YYData->{FILE},
+ "LINE" => $_[0]->YYData->{LINE},
+ },{
+ "NAME" => "array",
+ "PROPERTIES" => $_[1],
+ "POINTERS" => 0,
+ "ARRAY_LEN" => [ "count" ],
+ "TYPE" => $_[3],
+ "FILE" => $_[0]->YYData->{FILE},
+ "LINE" => $_[0]->YYData->{LINE},
+ }],
+ "FILE" => $_[0]->YYData->{FILE},
+ "LINE" => $_[0]->YYData->{LINE},
+ },
"FILE" => $_[0]->YYData->{FILE},
"LINE" => $_[0]->YYData->{LINE},
}}
diff --git a/pidl/lib/Parse/Pidl/IDL.pm b/pidl/lib/Parse/Pidl/IDL.pm
index bafa2ce..d4820ff 100644
--- a/pidl/lib/Parse/Pidl/IDL.pm
+++ b/pidl/lib/Parse/Pidl/IDL.pm
@@ -2249,7 +2249,31 @@ sub
{{
"TYPE" => "PIPE",
"PROPERTIES" => $_[1],
- "DATA" => $_[3],
+ "NAME" => undef,
+ "DATA" => {
+ "TYPE" => "STRUCT",
+ "PROPERTIES" => $_[1],
+ "NAME" => undef,
+ "ELEMENTS" => [{
+ "NAME" => "count",
+ "PROPERTIES" => $_[1],
+ "POINTERS" => 0,
+ "ARRAY_LEN" => [],
+ "TYPE" => "uint3264",
+ "FILE" => $_[0]->YYData->{FILE},
+ "LINE" => $_[0]->YYData->{LINE},
+ },{
+ "NAME" => "array",
+ "PROPERTIES" => $_[1],
+ "POINTERS" => 0,
+ "ARRAY_LEN" => [ "count" ],
+ "TYPE" => $_[3],
+ "FILE" => $_[0]->YYData->{FILE},
+ "LINE" => $_[0]->YYData->{LINE},
+ }],
+ "FILE" => $_[0]->YYData->{FILE},
+ "LINE" => $_[0]->YYData->{LINE},
+ },
"FILE" => $_[0]->YYData->{FILE},
"LINE" => $_[0]->YYData->{LINE},
}}
@@ -2257,13 +2281,13 @@ sub
[#Rule 78
'element_list1', 0,
sub
-#line 398 "idl.yp"
+#line 422 "idl.yp"
{ [] }
],
[#Rule 79
'element_list1', 3,
sub
-#line 400 "idl.yp"
+#line 424 "idl.yp"
{ push(@{$_[1]}, $_[2]); $_[1] }
],
[#Rule 80
@@ -2281,13 +2305,13 @@ sub
[#Rule 84
'element_list2', 2,
sub
-#line 414 "idl.yp"
+#line 438 "idl.yp"
{ [ $_[2] ] }
],
[#Rule 85
'element_list2', 4,
sub
-#line 416 "idl.yp"
+#line 440 "idl.yp"
{ push(@{$_[1]}, $_[4]); $_[1] }
],
[#Rule 86
@@ -2296,13 +2320,13 @@ sub
[#Rule 87
'array_len', 3,
sub
-#line 422 "idl.yp"
+#line 446 "idl.yp"
{ push(@{$_[3]}, "*"); $_[3] }
],
[#Rule 88
'array_len', 4,
sub
-#line 424 "idl.yp"
+#line 448 "idl.yp"
{ push(@{$_[4]}, "$_[2]"); $_[4] }
],
[#Rule 89
@@ -2311,31 +2335,31 @@ sub
[#Rule 90
'property_list', 4,
sub
-#line 430 "idl.yp"
+#line 454 "idl.yp"
{ FlattenHash([$_[1],$_[3]]); }
],
[#Rule 91
'properties', 1,
sub
-#line 434 "idl.yp"
+#line 458 "idl.yp"
{ $_[1] }
],
[#Rule 92
'properties', 3,
sub
-#line 436 "idl.yp"
+#line 460 "idl.yp"
{ FlattenHash([$_[1], $_[3]]); }
],
[#Rule 93
'property', 1,
sub
-#line 440 "idl.yp"
+#line 464 "idl.yp"
{{ "$_[1]" => "1" }}
],
[#Rule 94
'property', 4,
sub
-#line 442 "idl.yp"
+#line 466 "idl.yp"
{{ "$_[1]" => "$_[3]" }}
],
[#Rule 95
@@ -2344,13 +2368,13 @@ sub
[#Rule 96
'commalisttext', 3,
sub
-#line 448 "idl.yp"
+#line 472 "idl.yp"
{ "$_[1],$_[3]" }
],
[#Rule 97
'anytext', 0,
sub
-#line 453 "idl.yp"
+#line 477 "idl.yp"
{ "" }
],
[#Rule 98
@@ -2365,91 +2389,91 @@ sub
[#Rule 101
'anytext', 3,
sub
-#line 461 "idl.yp"
+#line 485 "idl.yp"
{ "$_[1]$_[2]$_[3]" }
],
[#Rule 102
'anytext', 3,
sub
-#line 463 "idl.yp"
+#line 487 "idl.yp"
{ "$_[1]$_[2]$_[3]" }
],
[#Rule 103
'anytext', 3,
sub
-#line 465 "idl.yp"
+#line 489 "idl.yp"
{ "$_[1]$_[2]$_[3]" }
],
[#Rule 104
'anytext', 3,
sub
-#line 467 "idl.yp"
+#line 491 "idl.yp"
{ "$_[1]$_[2]$_[3]" }
],
[#Rule 105
'anytext', 3,
sub
-#line 469 "idl.yp"
+#line 493 "idl.yp"
{ "$_[1]$_[2]$_[3]" }
],
[#Rule 106
'anytext', 3,
sub
-#line 471 "idl.yp"
+#line 495 "idl.yp"
{ "$_[1]$_[2]$_[3]" }
],
[#Rule 107
'anytext', 3,
sub
-#line 473 "idl.yp"
+#line 497 "idl.yp"
{ "$_[1]$_[2]$_[3]" }
],
[#Rule 108
'anytext', 3,
sub
-#line 475 "idl.yp"
+#line 499 "idl.yp"
{ "$_[1]$_[2]$_[3]" }
],
[#Rule 109
'anytext', 3,
sub
-#line 477 "idl.yp"
+#line 501 "idl.yp"
{ "$_[1]$_[2]$_[3]" }
],
[#Rule 110
'anytext', 3,
sub
-#line 479 "idl.yp"
+#line 503 "idl.yp"
{ "$_[1]$_[2]$_[3]" }
],
[#Rule 111
'anytext', 3,
sub
-#line 481 "idl.yp"
+#line 505 "idl.yp"
{ "$_[1]$_[2]$_[3]" }
],
[#Rule 112
--
Samba Shared Repository
More information about the samba-cvs
mailing list