From ebfbb2a7abe33e47af48d69164c37f4c24b7f8ed Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 24 Dec 2005 22:11:44 +0000 Subject: r12463: Rename 'Samba' namespace to 'Samba4' (This used to be commit f25358270d44a5642adbb85ecaa50b2e5730d7f0) --- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm | 102 +++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm (limited to 'source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm new file mode 100644 index 0000000000..83f9034c7c --- /dev/null +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm @@ -0,0 +1,102 @@ +################################################### +# client calls generator +# Copyright tridge@samba.org 2003 +# released under the GNU GPL + +package Parse::Pidl::Samba4::NDR::Client; + +use vars qw($VERSION); +$VERSION = '0.01'; + +use strict; + +my($res); + +##################################################################### +# parse a function +sub ParseFunction($$) +{ + my ($interface, $fn) = @_; + my $name = $fn->{NAME}; + my $uname = uc $name; + + $res .= " +struct rpc_request *dcerpc_$name\_send(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name *r) +{ + if (p->conn->flags & DCERPC_DEBUG_PRINT_IN) { + NDR_PRINT_IN_DEBUG($name, r); + } + + return dcerpc_ndr_request_send(p, NULL, &dcerpc_table_$interface->{NAME}, DCERPC_$uname, mem_ctx, r); +} + +NTSTATUS dcerpc_$name(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name *r) +{ + struct rpc_request *req; + NTSTATUS status; + + req = dcerpc_$name\_send(p, mem_ctx, r); + if (req == NULL) return NT_STATUS_NO_MEMORY; + + status = dcerpc_ndr_request_recv(req); + + if (NT_STATUS_IS_OK(status) && (p->conn->flags & DCERPC_DEBUG_PRINT_OUT)) { + NDR_PRINT_OUT_DEBUG($name, r); + } +"; + + if (defined($fn->{RETURN_TYPE}) and $fn->{RETURN_TYPE} eq "NTSTATUS") { + $res .= "\tif (NT_STATUS_IS_OK(status)) status = r->out.result;\n"; + } + $res .= +" + return status; +} +"; +} + +my %done; + +##################################################################### +# parse the interface definitions +sub ParseInterface($) +{ + my($interface) = shift; + $res .= "/* $interface->{NAME} - client functions generated by pidl */\n\n"; + + foreach my $fn (@{$interface->{FUNCTIONS}}) { + next if not defined($fn->{OPNUM}); + next if defined($done{$fn->{NAME}}); + ParseFunction($interface, $fn); + $done{$fn->{NAME}} = 1; + } + + return $res; +} + +sub Parse($$) +{ + my($ndr) = shift; + my($filename) = shift; + + my $h_filename = $filename; + $res = ""; + + if ($h_filename =~ /(.*)\.c/) { + $h_filename = "$1.h"; + } + + $res .= "/* client functions auto-generated by pidl */\n"; + $res .= "\n"; + $res .= "#include \"includes.h\"\n"; + $res .= "#include \"$h_filename\"\n"; + $res .= "\n"; + + foreach my $x (@{$ndr}) { + ($x->{TYPE} eq "INTERFACE") && ParseInterface($x); + } + + return $res; +} + +1; -- cgit From f07143c35cc4514e6714d34e43ea065c38fc2321 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 9 Mar 2006 21:59:37 +0000 Subject: r14105: fix whitespaces metze (This used to be commit 1b4c9f7fc203908d9cdd331f26b983fb445f05e2) --- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm index 83f9034c7c..1da765303c 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm @@ -40,7 +40,7 @@ NTSTATUS dcerpc_$name(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name * status = dcerpc_ndr_request_recv(req); - if (NT_STATUS_IS_OK(status) && (p->conn->flags & DCERPC_DEBUG_PRINT_OUT)) { + if (NT_STATUS_IS_OK(status) && (p->conn->flags & DCERPC_DEBUG_PRINT_OUT)) { NDR_PRINT_OUT_DEBUG($name, r); } "; -- cgit From 1060f6b3f621cb70b075a879f129e57f10fdbf8a Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 14 Mar 2006 23:35:30 +0000 Subject: r14402: Generate seperate headers for RPC client functions. (This used to be commit 7054ebf0249930843a2baf4d023ae8f62cedb109) --- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm | 25 +++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm index 1da765303c..60faa78df3 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm @@ -10,7 +10,7 @@ $VERSION = '0.01'; use strict; -my($res); +my($res,$res_hdr); ##################################################################### # parse a function @@ -20,6 +20,10 @@ sub ParseFunction($$) my $name = $fn->{NAME}; my $uname = uc $name; + $res_hdr .= "\nstruct rpc_request *dcerpc_$name\_send(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name *r); +NTSTATUS dcerpc_$name(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name *r); +"; + $res .= " struct rpc_request *dcerpc_$name\_send(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name *r) { @@ -74,29 +78,28 @@ sub ParseInterface($) return $res; } -sub Parse($$) +sub Parse($$$$) { - my($ndr) = shift; - my($filename) = shift; + my($ndr,$header,$ndr_header,$client_header) = @_; - my $h_filename = $filename; $res = ""; - - if ($h_filename =~ /(.*)\.c/) { - $h_filename = "$1.h"; - } + $res_hdr = ""; $res .= "/* client functions auto-generated by pidl */\n"; $res .= "\n"; $res .= "#include \"includes.h\"\n"; - $res .= "#include \"$h_filename\"\n"; + $res .= "#include \"$ndr_header\"\n"; + $res .= "#include \"$client_header\"\n"; $res .= "\n"; + $res_hdr .= "#include \"librpc/rpc/dcerpc.h\"\n"; + $res_hdr .= "#include \"$header\"\n"; + foreach my $x (@{$ndr}) { ($x->{TYPE} eq "INTERFACE") && ParseInterface($x); } - return $res; + return ($res,$res_hdr); } 1; -- cgit From 84aea6eca58b20f32fad0de0f43d9a5c7de247c9 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 15 Mar 2006 17:26:53 +0000 Subject: r14455: also add the: #ifndef FOO #define FOO ... #endif to the client headers metze (This used to be commit c0dd773537bda9980e77eb6eda848161b7df82e5) --- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm index 60faa78df3..0f3a86e81e 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm @@ -66,6 +66,10 @@ my %done; sub ParseInterface($) { my($interface) = shift; + + $res_hdr .= "#ifndef _HEADER_RPC_$interface->{NAME}\n"; + $res_hdr .= "#define _HEADER_RPC_$interface->{NAME}\n\n"; + $res .= "/* $interface->{NAME} - client functions generated by pidl */\n\n"; foreach my $fn (@{$interface->{FUNCTIONS}}) { @@ -75,6 +79,8 @@ sub ParseInterface($) $done{$fn->{NAME}} = 1; } + $res_hdr .= "#endif /* _HEADER_RPC_$interface->{NAME} */\n"; + return $res; } -- cgit From 4f1c8daa36a7a0372c5fd9eab51f3c16ee81c49d Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 16 Mar 2006 12:43:28 +0000 Subject: r14470: Remove some unnecessary headers. (This used to be commit f7312dab3b9aba2b2b82e8a6e0c483a32a03a63a) --- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm index 0f3a86e81e..d52dc12ec3 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm @@ -70,6 +70,10 @@ sub ParseInterface($) $res_hdr .= "#ifndef _HEADER_RPC_$interface->{NAME}\n"; $res_hdr .= "#define _HEADER_RPC_$interface->{NAME}\n\n"; + if (defined $interface->{PROPERTIES}->{uuid}) { + $res_hdr .= "extern const struct dcerpc_interface_table dcerpc_table_$interface->{NAME};\n"; + } + $res .= "/* $interface->{NAME} - client functions generated by pidl */\n\n"; foreach my $fn (@{$interface->{FUNCTIONS}}) { -- cgit From 4469fa31e3e3b2d62da7686fd6426bb44be09830 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 16 Mar 2006 21:35:31 +0000 Subject: r14491: Allow building more output outside of the Samba source tree (This used to be commit 272ca8e636cc5043279ff247fc8d5693a9181992) --- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm index d52dc12ec3..f19f4df319 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm @@ -5,6 +5,8 @@ package Parse::Pidl::Samba4::NDR::Client; +use Parse::Pidl::Samba4 qw(choose_header is_intree); + use vars qw($VERSION); $VERSION = '0.01'; @@ -97,12 +99,21 @@ sub Parse($$$$) $res .= "/* client functions auto-generated by pidl */\n"; $res .= "\n"; - $res .= "#include \"includes.h\"\n"; + if (is_intree()) { + $res .= "#include \"includes.h\"\n"; + } else { + $res .= "#define _GNU_SOURCE\n"; + $res .= "#include \n"; + $res .= "#include \n"; + $res .= "#include \n"; + $res .= "#include \n"; + $res .= "#include \n"; + } $res .= "#include \"$ndr_header\"\n"; $res .= "#include \"$client_header\"\n"; $res .= "\n"; - $res_hdr .= "#include \"librpc/rpc/dcerpc.h\"\n"; + $res_hdr .= choose_header("librpc/rpc/dcerpc.h", "dcerpc.h")."\n"; $res_hdr .= "#include \"$header\"\n"; foreach my $x (@{$ndr}) { -- cgit From b6cae24de839756db87a62213795856c0051b8b9 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 24 Mar 2006 01:03:02 +0000 Subject: r14687: Start working on support for represent_as() and transmit_as() as an alternative to subcontext() (This used to be commit 744402160d5f994f5440553bb726e95a13033a83) --- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm index f19f4df319..ace1e79672 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm @@ -1,6 +1,7 @@ ################################################### # client calls generator # Copyright tridge@samba.org 2003 +# Copyright jelmer@samba.org 2005-2006 # released under the GNU GPL package Parse::Pidl::Samba4::NDR::Client; -- cgit From 1b22141c874ff704ad4fe048d4464168495c36b6 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 2 Apr 2006 16:26:02 +0000 Subject: r14867: Include in external compiles (This used to be commit 03224dab111b931effd548586e630480fa1423b1) --- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm index ace1e79672..3b12c8f173 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm @@ -105,6 +105,7 @@ sub Parse($$$$) } else { $res .= "#define _GNU_SOURCE\n"; $res .= "#include \n"; + $res .= "#include \n"; $res .= "#include \n"; $res .= "#include \n"; $res .= "#include \n"; -- cgit From b8cdadced4d2a26a63b8bbe397c12df949783ed4 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 19 Aug 2007 20:46:45 +0000 Subject: r24551: rename dcerpc_interface_table -> ndr_interface_table rename dcerpc_interface_list -> ndr_interface_list and move them to libndr.h metze (This used to be commit 4adbebef5df2f833d2d4bfcdda72a34179d52f5c) --- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm index 3b12c8f173..bf8ac300ac 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm @@ -74,7 +74,7 @@ sub ParseInterface($) $res_hdr .= "#define _HEADER_RPC_$interface->{NAME}\n\n"; if (defined $interface->{PROPERTIES}->{uuid}) { - $res_hdr .= "extern const struct dcerpc_interface_table dcerpc_table_$interface->{NAME};\n"; + $res_hdr .= "extern const struct ndr_interface_table dcerpc_table_$interface->{NAME};\n"; } $res .= "/* $interface->{NAME} - client functions generated by pidl */\n\n"; -- cgit From f14bd1a90ab47a418c0ec2492990a417a0bb3bf6 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 19 Aug 2007 21:23:03 +0000 Subject: r24557: rename 'dcerpc_table_' -> 'ndr_table_' metze (This used to be commit 84651aee81aaabbebf52ffc3fbcbabb2eec6eed5) --- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm index bf8ac300ac..97d0e6dccb 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm @@ -34,7 +34,7 @@ struct rpc_request *dcerpc_$name\_send(struct dcerpc_pipe *p, TALLOC_CTX *mem_ct NDR_PRINT_IN_DEBUG($name, r); } - return dcerpc_ndr_request_send(p, NULL, &dcerpc_table_$interface->{NAME}, DCERPC_$uname, mem_ctx, r); + return dcerpc_ndr_request_send(p, NULL, &ndr_table_$interface->{NAME}, DCERPC_$uname, mem_ctx, r); } NTSTATUS dcerpc_$name(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name *r) @@ -74,7 +74,7 @@ sub ParseInterface($) $res_hdr .= "#define _HEADER_RPC_$interface->{NAME}\n\n"; if (defined $interface->{PROPERTIES}->{uuid}) { - $res_hdr .= "extern const struct ndr_interface_table dcerpc_table_$interface->{NAME};\n"; + $res_hdr .= "extern const struct ndr_interface_table ndr_table_$interface->{NAME};\n"; } $res .= "/* $interface->{NAME} - client functions generated by pidl */\n\n"; -- cgit From 0d7d5a6d492253f184ac58fe45ca22af5a3731de Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 19 Aug 2007 22:09:21 +0000 Subject: r24560: rename some DCERPC_ prefixes into NDR_ metze (This used to be commit f874eca5dab74e930d0ec52abeb06295d2d90476) --- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm index 97d0e6dccb..cf14b645a9 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm @@ -34,7 +34,7 @@ struct rpc_request *dcerpc_$name\_send(struct dcerpc_pipe *p, TALLOC_CTX *mem_ct NDR_PRINT_IN_DEBUG($name, r); } - return dcerpc_ndr_request_send(p, NULL, &ndr_table_$interface->{NAME}, DCERPC_$uname, mem_ctx, r); + return dcerpc_ndr_request_send(p, NULL, &ndr_table_$interface->{NAME}, NDR_$uname, mem_ctx, r); } NTSTATUS dcerpc_$name(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name *r) -- cgit From 621fcfcd1c8dc4ccbe8f3d58d988b9ce40b3fad3 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 1 Oct 2007 21:38:15 +0000 Subject: r25453: Fix include for NTSTATUS. (This used to be commit 3c2d06d8fc8783362a6ff934e86ea4a4da2c6906) --- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm index cf14b645a9..e9c158e933 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm @@ -109,7 +109,7 @@ sub Parse($$$$) $res .= "#include \n"; $res .= "#include \n"; $res .= "#include \n"; - $res .= "#include \n"; + $res .= "#include \n"; } $res .= "#include \"$ndr_header\"\n"; $res .= "#include \"$client_header\"\n"; -- cgit From d49f94621bd1d18437d5846d61b84054f35d39e4 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 16 Apr 2008 17:21:48 +0200 Subject: Provide stubs when the [todo] attribute is set. (This used to be commit 356a5d24747bb5e1ef9774c690a5ec386a4a165e) --- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm | 54 ++++++++++++++++++------ 1 file changed, 41 insertions(+), 13 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm index e9c158e933..f8209be654 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm @@ -7,6 +7,7 @@ package Parse::Pidl::Samba4::NDR::Client; use Parse::Pidl::Samba4 qw(choose_header is_intree); +use Parse::Pidl::Util qw(has_property); use vars qw($VERSION); $VERSION = '0.01'; @@ -15,30 +16,45 @@ use strict; my($res,$res_hdr); -##################################################################### -# parse a function -sub ParseFunction($$) +sub ParseFunctionSend($$$) { - my ($interface, $fn) = @_; - my $name = $fn->{NAME}; + my ($interface, $fn, $name) = @_; my $uname = uc $name; - $res_hdr .= "\nstruct rpc_request *dcerpc_$name\_send(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name *r); -NTSTATUS dcerpc_$name(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name *r); -"; + my $proto = "struct rpc_request *dcerpc_$name\_send(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name *r)"; - $res .= " -struct rpc_request *dcerpc_$name\_send(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name *r) -{ + $res_hdr .= "\n$proto;\n"; + + $res .= "$proto\n{\n"; + + if (has_property($fn, "todo")) { + $res .= "\treturn NULL;\n"; + } else { + $res .= " if (p->conn->flags & DCERPC_DEBUG_PRINT_IN) { NDR_PRINT_IN_DEBUG($name, r); } return dcerpc_ndr_request_send(p, NULL, &ndr_table_$interface->{NAME}, NDR_$uname, mem_ctx, r); +"; + } + + $res .= "}\n\n"; } -NTSTATUS dcerpc_$name(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name *r) +sub ParseFunctionSync($$$) { + my ($interface, $fn, $name) = @_; + + my $proto = "NTSTATUS dcerpc_$name(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name *r)"; + + $res_hdr .= "\n$proto;\n"; + $res .= "$proto\n{\n"; + + if (has_property($fn, "todo")) { + $res .= "\treturn NT_STATUS_NOT_IMPLEMENTED;\n"; + } else { + $res .= " struct rpc_request *req; NTSTATUS status; @@ -58,8 +74,20 @@ NTSTATUS dcerpc_$name(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name * $res .= " return status; -} "; + } + + $res .= "}\n\n"; +} + +##################################################################### +# parse a function +sub ParseFunction($$) +{ + my ($interface, $fn) = @_; + + ParseFunctionSend($interface, $fn, $fn->{NAME}); + ParseFunctionSync($interface, $fn, $fn->{NAME}); } my %done; -- cgit