mirror of
https://github.com/samba-team/samba.git
synced 2025-06-24 15:17:06 +03:00
dcerpc_alter_context and multiple context_ids in the dcerpc client library. This stage does the following: - split "struct dcerpc_pipe" into two parts, the main part being "struct dcerpc_connection", which contains all the parts not dependent on the context, and "struct dcerpc_pipe" which has the context dependent part. This is similar to the layering in libcli_*() for SMB - disable the current dcerpc_alter code. I've used a #warning until i get the 2nd phase finished. I don't know how portable #warning is, but it won't be long before I add full alter context support anyway, so it won't last long - cleanup the allocation of dcerpc_pipe structures. The previous code was quite awkward. (This used to be commit 4004c69937be7e5dae56f9567ca607f982d395d3)
71 lines
1.6 KiB
Perl
71 lines
1.6 KiB
Perl
###################################################
|
|
# client calls generator
|
|
# Copyright tridge@samba.org 2003
|
|
# released under the GNU GPL
|
|
|
|
package IdlClient;
|
|
|
|
use strict;
|
|
|
|
my($res);
|
|
|
|
#####################################################################
|
|
# parse a function
|
|
sub ParseFunction($$)
|
|
{
|
|
my $interface = shift;
|
|
my $fn = shift;
|
|
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 ($fn->{RETURN_TYPE} eq "NTSTATUS") {
|
|
$res .= "\tif (NT_STATUS_IS_OK(status)) status = r->out.result;\n";
|
|
}
|
|
$res .=
|
|
"
|
|
return status;
|
|
}
|
|
";
|
|
}
|
|
|
|
|
|
#####################################################################
|
|
# parse the interface definitions
|
|
sub ParseInterface($)
|
|
{
|
|
my($interface) = shift;
|
|
my($data) = $interface->{DATA};
|
|
$res = "/* Client functions generated by pidl */\n\n";
|
|
foreach my $d (@{$data}) {
|
|
($d->{TYPE} eq "FUNCTION") &&
|
|
ParseFunction($interface, $d);
|
|
}
|
|
return $res;
|
|
}
|
|
|
|
1;
|