summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-08-11 19:48:36 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:57:51 -0500
commit1d3b81e6c0c4c654c7395fe84b053cd77ef7d81a (patch)
tree3b193a8d482844dbdd05ae335882c800908bdd0f /source4
parentca72bdfecbea2e332821bc292b4bb34f6c96ac2e (diff)
downloadsamba-1d3b81e6c0c4c654c7395fe84b053cd77ef7d81a.tar.gz
samba-1d3b81e6c0c4c654c7395fe84b053cd77ef7d81a.tar.bz2
samba-1d3b81e6c0c4c654c7395fe84b053cd77ef7d81a.zip
r1736: - Pidl updates:
- Support for "object oriented" interfaces in pidl - Support for inherited interfaces in pidl - Simplification of the support for properties on an interface - Start on dcom rpc torture tests (This used to be commit 45c3d0036b8510102816f9cdff9210098259cc5f)
Diffstat (limited to 'source4')
-rw-r--r--source4/build/dcom/procedure14
-rw-r--r--source4/build/pidl/Makefile2
-rw-r--r--source4/build/pidl/dump.pm6
-rw-r--r--source4/build/pidl/eparser.pm104
-rw-r--r--source4/build/pidl/header.pm26
-rw-r--r--source4/build/pidl/idl.pm1215
-rw-r--r--source4/build/pidl/idl.yp89
-rw-r--r--source4/build/pidl/parser.pm28
-rwxr-xr-xsource4/build/pidl/pidl.pl2
-rw-r--r--source4/build/pidl/util.pm14
-rw-r--r--source4/librpc/idl/dcerpc.idl1
-rw-r--r--source4/librpc/idl/dcom.idl55
-rw-r--r--source4/librpc/idl/misc.idl1
-rw-r--r--source4/librpc/idl/schannel.idl1
-rw-r--r--source4/librpc/ndr/ndr_basic.c48
-rw-r--r--source4/torture/config.mk1
-rw-r--r--source4/torture/rpc/dcom.c47
17 files changed, 860 insertions, 794 deletions
diff --git a/source4/build/dcom/procedure b/source4/build/dcom/procedure
index 3ee1738ba9..09fcc5946f 100644
--- a/source4/build/dcom/procedure
+++ b/source4/build/dcom/procedure
@@ -2,6 +2,13 @@
- ServerAlive2()
- Bind to ISystemActivator
+with dcom, there is a new attribute for interfaces, 'object'. these
+object-oriented interfaces support inheritance. Everything that has the
+attribute 'object' has ([in] ORPCTHIS *this, [out] ORPCTHAT *that) as first
+arguments.
+
+OXID = Object Exporter ID
+
Everything based on IDispatch implements:
/*****************/
@@ -9,7 +16,7 @@ Everything based on IDispatch implements:
HRESULT QueryInterface(
[in] ORPCTHIS *this,
[out] ORPCTHAT *that,
- [in] REFIID riid,
+ [in] IID *riid,
[out] /* [iid_is] */ void **ppvObject);
/*****************/
@@ -47,7 +54,7 @@ HRESULT GetTypeInfo (
HRESULT GetIDsOfNames(
[in] ORPCTHIS *this,
[out] ORPCTHAT *that,
- [in] REFIID riid,
+ [in] IID *riid,
[size_is][in] LPOLESTR *rgszNames,
[in] UINT cNames,
[in] LCID lcid,
@@ -59,11 +66,10 @@ HRESULT Invoke(
[in] ORPCTHIS *this,
[out] ORPCTHAT *that,
[in] DISPID dispIdMember,
- [in] REFIID riid,
+ [in] IID *riid,
[in] LCID lcid,
[in] WORD wFlags,
[out][in] DISPPARAMS *pDispParams,
[out] VARIANT *pVarResult,
[out] EXCEPINFO *pExcepInfo,
[out] UINT *puArgErr);
-
diff --git a/source4/build/pidl/Makefile b/source4/build/pidl/Makefile
index e2cc7be3eb..944f3db8af 100644
--- a/source4/build/pidl/Makefile
+++ b/source4/build/pidl/Makefile
@@ -1,3 +1,5 @@
+all: idl.pm
+
idl.pm: idl.yp
yapp -s idl.yp
diff --git a/source4/build/pidl/dump.pm b/source4/build/pidl/dump.pm
index e74ffe6203..640bc3a120 100644
--- a/source4/build/pidl/dump.pm
+++ b/source4/build/pidl/dump.pm
@@ -183,7 +183,7 @@ sub DumpFunction($)
#####################################################################
# dump a module header
-sub DumpModuleHeader($)
+sub DumpInterfaceProperties($)
{
my($header) = shift;
my($data) = $header->{DATA};
@@ -208,6 +208,8 @@ sub DumpInterface($)
my($data) = $interface->{DATA};
my($res);
+ $res .= DumpInterfaceProperties($interface->{PROPERTIES});
+
$res .= "interface $interface->{NAME}\n{\n";
foreach my $d (@{$data}) {
($d->{TYPE} eq "TYPEDEF") &&
@@ -230,8 +232,6 @@ sub Dump($)
$res = "/* Dumped by pidl */\n\n";
foreach my $x (@{$idl}) {
- ($x->{TYPE} eq "MODULEHEADER") &&
- ($res .= DumpModuleHeader($x));
($x->{TYPE} eq "INTERFACE") &&
($res .= DumpInterface($x));
}
diff --git a/source4/build/pidl/eparser.pm b/source4/build/pidl/eparser.pm
index 0711790d23..acc8fddc80 100644
--- a/source4/build/pidl/eparser.pm
+++ b/source4/build/pidl/eparser.pm
@@ -14,9 +14,6 @@ my %needed;
my %structs;
my $module;
-my $if_uuid;
-my $if_version;
-my $if_endpoints;
sub pidl($)
{
@@ -933,17 +930,6 @@ sub BuildNeeded($)
}
}
-#####################################################################
-# parse the interface definitions
-sub ModuleHeader($)
-{
- my($h) = shift;
-
- $if_uuid = $h->{PROPERTIES}->{uuid};
- $if_version = $h->{PROPERTIES}->{version};
- $if_endpoints = $h->{PROPERTIES}->{endpoints};
-}
-
sub ParseHeader($$)
{
my($idl) = shift;
@@ -989,9 +975,6 @@ sub Parse($$)
open(OUT, ">$filename") || die "can't open $filename";
foreach my $x (@{$idl}) {
- ($x->{TYPE} eq "MODULEHEADER") &&
- ModuleHeader($x);
-
if ($x->{TYPE} eq "INTERFACE") {
$module = $x->{NAME};
BuildNeeded($x);
@@ -1001,16 +984,14 @@ sub Parse($$)
pidl "/* parser auto-generated by pidl */\n\n";
pidl "#ifdef HAVE_CONFIG_H\n";
pidl "#include \"config.h\"\n";
- pidl "#endif\n\n";
+ pidl "#endif\n\n";
- pidl "#include \"packet-dcerpc.h\"\n";
- pidl "#include \"packet-dcerpc-nt.h\"\n\n";
- pidl "#include \"packet-dcerpc-eparser.h\"\n\n";
+ pidl "#include \"packet-dcerpc.h\"\n";
+ pidl "#include \"packet-dcerpc-nt.h\"\n\n";
+ pidl "#include \"packet-dcerpc-eparser.h\"\n\n";
pidl "extern const value_string NT_errors[];\n\n";
- pidl "static int proto_dcerpc_$module = -1;\n\n";
-
pidl "static gint ett_dcerpc_$module = -1;\n\n";
pidl "static int hf_opnum = -1;\n";
@@ -1033,6 +1014,7 @@ sub Parse($$)
# Declarations for ett variables
foreach my $y (keys(%needed)) {
+
pidl "static gint $y = -1;\n", if $y =~ /^ett_/;
}
@@ -1043,24 +1025,26 @@ sub Parse($$)
}
# Only perform module initialisation if we found a uuid
-
- if (defined($if_uuid)) {
-
- pidl "static e_uuid_t uuid_dcerpc_$module = {\n";
- pidl "\t0x" . substr($if_uuid, 0, 8);
- pidl ", 0x" . substr($if_uuid, 9, 4);
- pidl ", 0x" . substr($if_uuid, 14, 4) . ",\n";
- pidl "\t{ 0x" . substr($if_uuid, 19, 2);
- pidl ", 0x" . substr($if_uuid, 21, 2);
- pidl ", 0x" . substr($if_uuid, 24, 2);
- pidl ", 0x" . substr($if_uuid, 26, 2);
- pidl ", 0x" . substr($if_uuid, 28, 2);
- pidl ", 0x" . substr($if_uuid, 30, 2);
- pidl ", 0x" . substr($if_uuid, 32, 2);
- pidl ", 0x" . substr($if_uuid, 34, 2) . " }\n";
- pidl "};\n\n";
-
- pidl "static guint16 ver_dcerpc_$module = " . $if_version . ";\n\n";
+
+ for my $x (@{$idl}) {
+ pidl "static int proto_dcerpc_" . $x->{NAME} ." = -1;\n\n";
+ if ((my $if_uuid = $x->{PROPERTIES}->{uuid})) {
+ pidl "static e_uuid_t uuid_dcerpc_" . $x->{NAME} ." = {\n";
+ pidl "\t0x" . substr($if_uuid, 0, 8);
+ pidl ", 0x" . substr($if_uuid, 9, 4);
+ pidl ", 0x" . substr($if_uuid, 14, 4) . ",\n";
+ pidl "\t{ 0x" . substr($if_uuid, 19, 2);
+ pidl ", 0x" . substr($if_uuid, 21, 2);
+ pidl ", 0x" . substr($if_uuid, 24, 2);
+ pidl ", 0x" . substr($if_uuid, 26, 2);
+ pidl ", 0x" . substr($if_uuid, 28, 2);
+ pidl ", 0x" . substr($if_uuid, 30, 2);
+ pidl ", 0x" . substr($if_uuid, 32, 2);
+ pidl ", 0x" . substr($if_uuid, 34, 2) . " }\n";
+ pidl "};\n\n";
+
+ pidl "static guint16 ver_dcerpc_" . $x->{NAME} . " = " . $x->{PROPERTIES}->{version}. ";\n\n";
+ }
}
pidl "void proto_register_dcerpc_$module(void)\n";
@@ -1092,31 +1076,33 @@ sub Parse($$)
}
pidl "\t};\n\n";
- if (defined($if_uuid)) {
-
- pidl "\tproto_dcerpc_$module = proto_register_protocol(\"$module\", \"$module\", \"$module\");\n\n";
+ for my $x (@{$idl}) {
+ if (defined($x->{PROPERTIES}->{uuid})) {
+ $module = $x->{NAME};
- pidl "\tproto_register_field_array(proto_dcerpc_$module, hf, array_length (hf));\n";
- pidl "\tproto_register_subtree_array(ett, array_length(ett));\n";
+ pidl "\tproto_dcerpc_$module = proto_register_protocol(\"$module\", \"$module\", \"$module\");\n\n";
- pidl "}\n\n";
+ pidl "\tproto_register_field_array(proto_dcerpc_$module, hf, array_length (hf));\n";
+ pidl "\tproto_register_subtree_array(ett, array_length(ett));\n";
- pidl "void proto_reg_handoff_dcerpc_$module(void)\n";
- pidl "{\n";
- pidl "\tdcerpc_init_uuid(proto_dcerpc_$module, ett_dcerpc_$module, \n";
- pidl "\t\t&uuid_dcerpc_$module, ver_dcerpc_$module, \n";
- pidl "\t\tdcerpc_" . $module . "_dissectors, hf_opnum);\n";
- pidl "}\n";
+ pidl "}\n\n";
- } else {
+ pidl "void proto_reg_handoff_dcerpc_$module(void)\n";
+ pidl "{\n";
+ pidl "\tdcerpc_init_uuid(proto_dcerpc_$module, ett_dcerpc_$module, \n";
+ pidl "\t\t&uuid_dcerpc_$module, ver_dcerpc_$module, \n";
+ pidl "\t\tdcerpc_" . $module . "_dissectors, hf_opnum);\n";
+ pidl "}\n";
- pidl "\tint proto_dcerpc;\n\n";
- pidl "\tproto_dcerpc = proto_get_id_by_filter_name(\"dcerpc\");\n";
- pidl "\tproto_register_field_array(proto_dcerpc, hf, array_length(hf));\n";
- pidl "\tproto_register_subtree_array(ett, array_length(ett));\n";
+ } else {
- pidl "}\n";
+ pidl "\tint proto_dcerpc;\n\n";
+ pidl "\tproto_dcerpc = proto_get_id_by_filter_name(\"dcerpc\");\n";
+ pidl "\tproto_register_field_array(proto_dcerpc, hf, array_length(hf));\n";
+ pidl "\tproto_register_subtree_array(ett, array_length(ett));\n";
+ pidl "}\n";
+ }
}
close(OUT);
diff --git a/source4/build/pidl/header.pm b/source4/build/pidl/header.pm
index 7618886bc2..589f9c6b54 100644
--- a/source4/build/pidl/header.pm
+++ b/source4/build/pidl/header.pm
@@ -9,8 +9,6 @@ use strict;
my($res);
my($tab_depth);
-my $if_uuid;
-my $if_version;
sub tabs()
{
@@ -187,6 +185,7 @@ sub HeaderFunctionInOut($$)
{
my($fn) = shift;
my($prop) = shift;
+
foreach my $e (@{$fn->{DATA}}) {
if (util::has_property($e, $prop)) {
HeaderElement($e);
@@ -220,6 +219,7 @@ sub HeaderFunctionInOut_needed($$)
sub HeaderFunction($)
{
my($fn) = shift;
+
$res .= "\nstruct $fn->{NAME} {\n";
$tab_depth++;
my $needed = 0;
@@ -272,12 +272,12 @@ sub HeaderInterface($)
$res .= "#ifndef _HEADER_NDR_$interface->{NAME}\n";
$res .= "#define _HEADER_NDR_$interface->{NAME}\n\n";
- if (defined $if_uuid) {
+ if (defined $interface->{PROPERTIES}->{uuid}) {
my $name = uc $interface->{NAME};
- $res .= "#define DCERPC_$name\_UUID \"$if_uuid\"\n";
+ $res .= "#define DCERPC_$name\_UUID \"$interface->{PROPERTIES}->{uuid}\"\n";
- if(!defined $if_version) { $if_version = "0.0"; }
- $res .= "#define DCERPC_$name\_VERSION $if_version\n";
+ if(!defined $interface->{PROPERTIES}->{version}) { $interface->{PROPERTIES}->{version} = "0.0"; }
+ $res .= "#define DCERPC_$name\_VERSION $interface->{PROPERTIES}->{version}\n";
$res .= "#define DCERPC_$name\_NAME \"$interface->{NAME}\"\n\n";
$res .= "extern const struct dcerpc_interface_table dcerpc_table_$interface->{NAME};\n";
$res .= "NTSTATUS dcerpc_$interface->{NAME}_init(void);\n\n";
@@ -306,17 +306,6 @@ sub HeaderInterface($)
}
#####################################################################
-# parse the interface definitions
-sub ModuleHeader($)
-{
- my($h) = shift;
-
- $if_uuid = $h->{PROPERTIES}->{uuid};
- $if_version = $h->{PROPERTIES}->{version};
-}
-
-
-#####################################################################
# parse a parsed IDL into a C header
sub Parse($)
{
@@ -325,9 +314,6 @@ sub Parse($)
$res = "/* header auto-generated by pidl */\n\n";
foreach my $x (@{$idl}) {
- ($x->{TYPE} eq "MODULEHEADER") &&
- ModuleHeader($x);
-
($x->{TYPE} eq "INTERFACE") &&
HeaderInterface($x);
}
diff --git a/source4/build/pidl/idl.pm b/source4/build/pidl/idl.pm
index e469c0fdc8..29e3cae9eb 100644
--- a/source4/build/pidl/idl.pm
+++ b/source4/build/pidl/idl.pm
@@ -500,88 +500,85 @@ sub new {
yystates =>
[
{#State 0
- ACTIONS => {
- "[" => 2
- },
+ DEFAULT => -1,
GOTOS => {
- 'idl_interface' => 1,
- 'idl' => 3,
- 'module_header' => 4
+ 'idl' => 1
}
},
{#State 1
- DEFAULT => -1
- },
- {#State 2
ACTIONS => {
- 'IDENTIFIER' => 5
+ '' => 2
},
- DEFAULT => -5,
+ DEFAULT => -44,
GOTOS => {
- 'module_params' => 7,
- 'identifier' => 6,
- 'module_param' => 8
+ 'interface' => 3,
+ 'property_list' => 4
}
},
+ {#State 2
+ DEFAULT => 0
+ },
{#State 3
+ DEFAULT => -2
+ },
+ {#State 4
ACTIONS => {
- '' => 9,
- "[" => 2
- },
- GOTOS => {
- 'idl_interface' => 10,
- 'module_header' => 4
+ "interface" => 6,
+ "[" => 5
}
},
- {#State 4
+ {#State 5
ACTIONS => {
- "interface" => 12
+ 'IDENTIFIER' => 7
},
GOTOS => {
- 'interface' => 11
+ 'identifier' => 8,
+ 'properties' => 10,
+ 'property' => 9
}
},
- {#State 5
- DEFAULT => -69
- },
{#State 6
ACTIONS => {
- "(" => 13
+ 'IDENTIFIER' => 7
+ },
+ GOTOS => {
+ 'identifier' => 11
}
},
{#State 7
- ACTIONS => {
- "," => 14,
- "]" => 15
- }
+ DEFAULT => -65
},
{#State 8
- DEFAULT => -6
+ ACTIONS => {
+ "(" => 12
+ },
+ DEFAULT => -48
},
{#State 9
- DEFAULT => 0
+ DEFAULT => -46
},
{#State 10
- DEFAULT => -2
+ ACTIONS => {
+ "," => 13,
+ "]" => 14
+ }
},
{#State 11
- DEFAULT => -3
- },
- {#State 12
ACTIONS => {
- 'IDENTIFIER' => 5
+ ":" => 15
},
+ DEFAULT => -4,
GOTOS => {
- 'identifier' => 16
+ 'base_interface' => 16
}
},
- {#State 13
+ {#State 12
ACTIONS => {
- 'IDENTIFIER' => 5,
+ 'IDENTIFIER' => 7,
'CONSTANT' => 23,
'TEXT' => 17
},
- DEFAULT => -56,
+ DEFAULT => -52,
GOTOS => {
'identifier' => 18,
'listtext' => 21,
@@ -590,97 +587,94 @@ sub new {
'constant' => 22
}
},
- {#State 14
+ {#State 13
ACTIONS => {
- 'IDENTIFIER' => 5
+ 'IDENTIFIER' => 7
},
GOTOS => {
- 'identifier' => 6,
- 'module_param' => 24
+ 'identifier' => 8,
+ 'property' => 24
}
},
+ {#State 14
+ DEFAULT => -45
+ },
{#State 15
- DEFAULT => -4
+ ACTIONS => {
+ 'IDENTIFIER' => 7
+ },
+ GOTOS => {
+ 'identifier' => 25
+ }
},
{#State 16
ACTIONS => {
- "{" => 25
+ "{" => 26
}
},
{#State 17
- DEFAULT => -71
+ DEFAULT => -67
},
{#State 18
- DEFAULT => -57
+ DEFAULT => -53
},
{#State 19
- DEFAULT => -59
+ DEFAULT => -55
},
{#State 20
ACTIONS => {
- "-" => 26,
- "+" => 27,
- "&" => 28,
- "/" => 29,
- "|" => 30,
- "(" => 31,
- "*" => 32,
- "." => 33,
- ">" => 34
+ "-" => 27,
+ "+" => 28,
+ "&" => 29,
+ "/" => 30,
+ "|" => 31,
+ "(" => 32,
+ "*" => 33,
+ "." => 34,
+ ">" => 35
},
- DEFAULT => -54
+ DEFAULT => -50
},
{#State 21
ACTIONS => {
- "," => 35,
- ")" => 36
+ "," => 36,
+ ")" => 37
}
},
{#State 22
- DEFAULT => -58
+ DEFAULT => -54
},
{#State 23
- DEFAULT => -70
+ DEFAULT => -66
},
{#State 24
- DEFAULT => -7
+ DEFAULT => -47
},
{#State 25
- ACTIONS => {
- "typedef" => 37,
- "const" => 43
- },
- DEFAULT => -48,
- GOTOS => {
- 'const' => 42,
- 'function' => 38,
- 'typedef' => 44,
- 'definitions' => 39,
- 'definition' => 41,
- 'property_list' => 40
- }
+ DEFAULT => -5
},
{#State 26
ACTIONS => {
- 'CONSTANT' => 23,
- 'TEXT' => 17,
- 'IDENTIFIER' => 5
+ "typedef" => 38,
+ "const" => 44
},
- DEFAULT => -56,
+ DEFAULT => -44,
GOTOS => {
- 'identifier' => 18,
- 'text' => 19,
- 'anytext' => 45,
- 'constant' => 22
+ 'const' => 43,
+ 'function' => 39,
+ 'typedef' => 45,
+ 'definitions' => 40,
+ 'definition' => 42,
+ 'property_list' => 41
}
},
{#State 27
ACTIONS => {
'CONSTANT' => 23,
'TEXT' => 17,
- 'IDENTIFIER' => 5
+ 'IDENTIFIER' => 7
},
- DEFAULT => -56,
+ DEFAULT => -52,
GOTOS => {
'identifier' => 18,
'text' => 19,
@@ -692,9 +686,9 @@ sub new {
ACTIONS => {
'CONSTANT' => 23,
'TEXT' => 17,
- 'IDENTIFIER' => 5
+ 'IDENTIFIER' => 7
},
- DEFAULT => -56,
+ DEFAULT => -52,
GOTOS => {
'identifier' => 18,
'text' => 19,
@@ -706,9 +700,9 @@ sub new {
ACTIONS => {
'CONSTANT' => 23,
'TEXT' => 17,
- 'IDENTIFIER' => 5
+ 'IDENTIFIER' => 7
},
- DEFAULT => -56,
+ DEFAULT => -52,
GOTOS => {
'identifier' => 18,
'text' => 19,
@@ -720,9 +714,9 @@ sub new {
ACTIONS => {
'CONSTANT' => 23,
'TEXT' => 17,
- 'IDENTIFIER' => 5
+ 'IDENTIFIER' => 7
},
- DEFAULT => -56,
+ DEFAULT => -52,
GOTOS => {
'identifier' => 18,
'text' => 19,
@@ -732,11 +726,11 @@ sub new {
},
{#State 31
ACTIONS => {
- 'IDENTIFIER' => 5,
'CONSTANT' => 23,
- 'TEXT' => 17
+ 'TEXT' => 17,
+ 'IDENTIFIER' => 7
},
- DEFAULT => -56,
+ DEFAULT => -52,
GOTOS => {
'identifier' => 18,
'text' => 19,
@@ -746,11 +740,11 @@ sub new {
},
{#State 32
ACTIONS => {
+ 'IDENTIFIER' => 7,
'CONSTANT' => 23,
- 'TEXT' => 17,
- 'IDENTIFIER' => 5
+ 'TEXT' => 17
},
- DEFAULT => -56,
+ DEFAULT => -52,
GOTOS => {
'identifier' => 18,
'text' => 19,
@@ -762,9 +756,9 @@ sub new {
ACTIONS => {
'CONSTANT' => 23,
'TEXT' => 17,
- 'IDENTIFIER' => 5
+ 'IDENTIFIER' => 7
},
- DEFAULT => -56,
+ DEFAULT => -52,
GOTOS => {
'identifier' => 18,
'text' => 19,
@@ -776,9 +770,9 @@ sub new {
ACTIONS => {
'CONSTANT' => 23,
'TEXT' => 17,
- 'IDENTIFIER' => 5
+ 'IDENTIFIER' => 7
},
- DEFAULT => -56,
+ DEFAULT => -52,
GOTOS => {
'identifier' => 18,
'text' => 19,
@@ -788,11 +782,11 @@ sub new {
},
{#State 35
ACTIONS => {
- 'IDENTIFIER' => 5,
'CONSTANT' => 23,
- 'TEXT' => 17
+ 'TEXT' => 17,
+ 'IDENTIFIER' => 7
},
- DEFAULT => -56,
+ DEFAULT => -52,
GOTOS => {
'identifier' => 18,
'text' => 19,
@@ -801,678 +795,621 @@ sub new {
}
},
{#State 36
- DEFAULT => -8
- },
- {#State 37
ACTIONS => {
- 'IDENTIFIER' => 5,
- "enum" => 55,
- 'void' => 56
+ 'IDENTIFIER' => 7,
+ 'CONSTANT' => 23,
+ 'TEXT' => 17
},
- DEFAULT => -48,
+ DEFAULT => -52,
GOTOS => {
- 'identifier' => 58,
- 'struct' => 59,
- 'enum' => 60,
- 'type' => 61,
- 'union' => 62,
- 'property_list' => 57
+ 'identifier' => 18,
+ 'text' => 19,
+ 'anytext' => 55,
+ 'constant' => 22
}
},
- {#State 38
- DEFAULT => -12
+ {#State 37
+ DEFAULT => -49
},
- {#State 39
+ {#State 38
ACTIONS => {
- "}" => 63,
- "typedef" => 37,
- "const" => 43
+ 'IDENTIFIER' => 7,
+ "enum" => 56,
+ 'void' => 57
},
- DEFAULT => -48,
+ DEFAULT => -44,
GOTOS => {
- 'const' => 42,
- 'function' => 38,
- 'typedef' => 44,
- 'definition' => 64,
- 'property_list' => 40
+ 'identifier' => 59,
+ 'struct' => 60,
+ 'enum' => 61,
+ 'type' => 62,
+ 'union' => 63,
+ 'property_list' => 58
}
},
+ {#State 39
+ DEFAULT => -8
+ },
{#State 40
ACTIONS => {
- 'IDENTIFIER' => 5,
- "enum" => 55,
- "[" => 65,
- 'void' => 56
+ "}" => 64,
+ "typedef" => 38,
+ "const" => 44
},
- DEFAULT => -48,
+ DEFAULT => -44,
GOTOS => {
- 'identifier' => 58,
- 'struct' => 59,
- 'enum' => 60,
- 'type' => 66,
- 'union' => 62,
- 'property_list' => 57
+ 'const' => 43,
+ 'function' => 39,
+ 'typedef' => 45,
+ 'definition' => 65,
+ 'property_list' => 41
}
},
{#State 41
- DEFAULT => -10
+ ACTIONS => {
+ 'IDENTIFIER' => 7,
+ "enum" => 56,
+ "[" => 5,
+ 'void' => 57
+ },
+ DEFAULT => -44,
+ GOTOS => {
+ 'identifier' => 59,
+ 'struct' => 60,
+ 'enum' => 61,
+ 'type' => 66,
+ 'union' => 63,
+ 'property_list' => 58
+ }
},
{#State 42
- DEFAULT => -13
+ DEFAULT => -6
},
{#State 43
+ DEFAULT => -9
+ },
+ {#State 44
ACTIONS => {
- 'IDENTIFIER' => 5
+ 'IDENTIFIER' => 7
},
GOTOS => {
'identifier' => 67
}
},
- {#State 44
- DEFAULT => -14
- },
{#State 45
- DEFAULT => -60
+ DEFAULT => -10
},
{#State 46
- DEFAULT => -67
+ DEFAULT => -56
},
{#State 47
- DEFAULT => -65
+ DEFAULT => -63
},
{#State 48
- DEFAULT => -66
+ DEFAULT => -61
},
{#State 49
- DEFAULT => -64
+ DEFAULT => -62
},
{#State 50
+ DEFAULT => -60
+ },
+ {#State 51
ACTIONS => {
- "-" => 26,
- "+" => 27,
- "&" => 28,
- "/" => 29,
- "(" => 31,
- "|" => 30,
- "*" => 32,
- "." => 33,
+ "-" => 27,
+ "+" => 28,
+ "&" => 29,
+ "/" => 30,
+ "(" => 32,
+ "|" => 31,
+ "*" => 33,
+ "." => 34,
")" => 68,
- ">" => 34
+ ">" => 35
}
},
- {#State 51
- DEFAULT => -62
- },
{#State 52
- DEFAULT => -61
+ DEFAULT => -58
},
{#State 53
- DEFAULT => -63
+ DEFAULT => -57
},
{#State 54
+ DEFAULT => -59
+ },
+ {#State 55
ACTIONS => {
- "-" => 26,
- "+" => 27,
- "&" => 28,
- "/" => 29,
- "(" => 31,
- "|" => 30,
- "*" => 32,
- "." => 33,
- ">" => 34
+ "-" => 27,
+ "+" => 28,
+ "&" => 29,
+ "/" => 30,
+ "(" => 32,
+ "|" => 31,
+ "*" => 33,
+ "." => 34,
+ ">" => 35
},
- DEFAULT => -55
+ DEFAULT => -51
},
- {#State 55
+ {#State 56
ACTIONS => {
"{" => 69
}
},
- {#State 56
- DEFAULT => -22
- },
{#State 57
+ DEFAULT => -18
+ },
+ {#State 58
ACTIONS => {
"union" => 70,
- "[" => 65,
+ "[" => 5,
"struct" => 71
}
},
- {#State 58
- DEFAULT => -21
- },
{#State 59
- DEFAULT => -18
+ DEFAULT => -17
},
{#State 60
- DEFAULT => -20
+ DEFAULT => -14
},
{#State 61
+ DEFAULT => -16
+ },
+ {#State 62
ACTIONS => {
- 'IDENTIFIER' => 5
+ 'IDENTIFIER' => 7
},
GOTOS => {
'identifier' => 72
}
},
- {#State 62
- DEFAULT => -19
- },
{#State 63
- DEFAULT => -9
+ DEFAULT => -15
},
{#State 64
- DEFAULT => -11
+ DEFAULT => -3
},
{#State 65
- ACTIONS => {
- 'IDENTIFIER' => 5
- },
- GOTOS => {
- 'identifier' => 74,
- 'property' => 75,
- 'properties' => 73
- }
+ DEFAULT => -7
},
{#State 66
ACTIONS => {
- 'IDENTIFIER' => 5
+ 'IDENTIFIER' => 7
},
GOTOS => {
- 'identifier' => 76
+ 'identifier' => 73
}
},
{#State 67
ACTIONS => {
- 'IDENTIFIER' => 5
+ 'IDENTIFIER' => 7
},
GOTOS => {
- 'identifier' => 77
+ 'identifier' => 74
}
},
{#State 68
ACTIONS => {
'CONSTANT' => 23,
'TEXT' => 17,
- 'IDENTIFIER' => 5
+ 'IDENTIFIER' => 7
},
- DEFAULT => -56,
+ DEFAULT => -52,
GOTOS => {
'identifier' => 18,
'text' => 19,
- 'anytext' => 78,
+ 'anytext' => 75,
'constant' => 22
}
},
{#State 69
ACTIONS => {
- 'IDENTIFIER' => 5
+ 'IDENTIFIER' => 7
},
GOTOS => {
- 'identifier' => 79,
- 'enum_element' => 80,
- 'enum_elements' => 81
+ 'identifier' => 76,
+ 'enum_element' => 77,
+ 'enum_elements' => 78
}
},
{#State 70
ACTIONS => {
- "{" => 82
+ "{" => 79
}
},
{#State 71
ACTIONS => {
- "{" => 83
+ "{" => 80
}
},
{#State 72
ACTIONS => {
- "[" => 85
+ "[" => 82
},
- DEFAULT => -45,
+ DEFAULT => -41,
GOTOS => {
- 'array_len' => 84
+ 'array_len' => 81
}
},
{#State 73
ACTIONS => {
- "," => 86,
- "]" => 87
+ "(" => 83
}
},
{#State 74
ACTIONS => {
- "(" => 88
- },
- DEFAULT => -52
+ "=" => 84
+ }
},
{#State 75
- DEFAULT => -50
+ DEFAULT => -64
},
{#State 76
ACTIONS => {
- "(" => 89
- }
+ "=" => 85
+ },
+ DEFAULT => -22
},
{#State 77
- ACTIONS => {
- "=" => 90
- }
+ DEFAULT => -20
},
{#State 78
- DEFAULT => -68
- },
- {#State 79
- ACTIONS => {
- "=" => 91
- },
- DEFAULT => -26
- },
- {#State 80
- DEFAULT => -24
- },
- {#State 81
ACTIONS => {
- "}" => 92,
- "," => 93
+ "}" => 86,
+ "," => 87
}
},
- {#State 82
+ {#State 79
ACTIONS => {
- "[" => 96
+ "[" => 90
},
GOTOS => {
- 'union_elements' => 94,
- 'union_element' => 95
+ 'union_elements' => 88,
+ 'union_element' => 89
}
},
- {#State 83
- DEFAULT => -39,
+ {#State 80
+ DEFAULT => -35,
GOTOS => {
- 'element_list1' => 97
+ 'element_list1' => 91
}
},
- {#State 84
+ {#State 81
ACTIONS => {
- ";" => 98
+ ";" => 92
}
},
- {#State 85
+ {#State 82
ACTIONS => {
- 'IDENTIFIER' => 5,
+ 'IDENTIFIER' => 7,
'CONSTANT' => 23,
'TEXT' => 17,
- "]" => 100
+ "]" => 94
},
- DEFAULT => -56,
+ DEFAULT => -52,
GOTOS => {
'identifier' => 18,
'text' => 19,
- 'anytext' => 99,
+ 'anytext' => 93,
'constant' => 22
}
},
- {#State 86
- ACTIONS => {
- 'IDENTIFIER' => 5
- },
- GOTOS => {
- 'identifier' => 74,
- 'property' => 101
- }
- },
- {#State 87
- DEFAULT => -49
- },
- {#State 88
- ACTIONS => {
- 'IDENTIFIER' => 5,
- 'CONSTANT' => 23,
- 'TEXT' => 17
- },
- DEFAULT => -56,
- GOTOS => {
- 'identifier' => 18,
- 'text' => 19,
- 'anytext' => 102,
- 'constant' => 22
- }
- },
- {#State 89
+ {#State 83
ACTIONS => {
- "void" => 105,
- "," => -41,
- ")" => -41
+ "void" => 97,
+ "," => -37,
+ ")" => -37
},
- DEFAULT => -48,
+ DEFAULT => -44,
GOTOS => {
- 'base_element' => 103,
- 'element_list2' => 106,
- 'property_list' => 104
+ 'base_element' => 95,
+ 'element_list2' => 98,
+ 'property_list' => 96
}
},
- {#State 90
+ {#State 84
ACTIONS => {
- 'IDENTIFIER' => 5,
+ 'IDENTIFIER' => 7,
'CONSTANT' => 23,
'TEXT' => 17
},
- DEFAULT => -56,
+ DEFAULT => -52,
GOTOS => {
'identifier' => 18,
'text' => 19,
- 'anytext' => 107,
+ 'anytext' => 99,
'constant' => 22
}
},
- {#State 91
+ {#State 85
ACTIONS => {
- 'IDENTIFIER' => 5,
+ 'IDENTIFIER' => 7,
'CONSTANT' => 23,
'TEXT' => 17
},
- DEFAULT => -56,
+ DEFAULT => -52,
GOTOS => {
'identifier' => 18,
'text' => 19,
- 'anytext' => 108,
+ 'anytext' => 100,
'constant' => 22
}
},
- {#State 92
- DEFAULT => -23
+ {#State 86
+ DEFAULT => -19
},
- {#State 93
+ {#State 87
ACTIONS => {
- 'IDENTIFIER' => 5
+ 'IDENTIFIER' => 7
},
GOTOS => {
- 'identifier' => 79,
- 'enum_element' => 109
+ 'identifier' => 76,
+ 'enum_element' => 101
}
},
- {#State 94
+ {#State 88
ACTIONS => {
- "}" => 110,
- "[" => 96
+ "}" => 102,
+ "[" => 90
},
GOTOS => {
- 'union_element' => 111
+ 'union_element' => 103
}
},
- {#State 95
- DEFAULT => -30
+ {#State 89
+ DEFAULT => -26
},
- {#State 96
+ {#State 90
ACTIONS => {
- "case" => 112,
- "default" => 113
+ "case" => 104,
+ "default" => 105
}
},
- {#State 97
+ {#State 91
ACTIONS => {
- "}" => 114
+ "}" => 106
},
- DEFAULT => -48,
+ DEFAULT => -44,
GOTOS => {
- 'base_element' => 115,
- 'property_list' => 104
+ 'base_element' => 107,
+ 'property_list' => 96
}
},
- {#State 98
- DEFAULT => -17
+ {#State 92
+ DEFAULT => -13
},
- {#State 99
+ {#State 93
ACTIONS => {
- "-" => 26,
- "+" => 27,
- "&" => 28,
- "/" => 29,
- "(" => 31,
- "|" => 30,
- "*" => 32,
- "." => 33,
- "]" => 116,
- ">" => 34
+ "-" => 27,
+ "+" => 28,
+ "&" => 29,
+ "/" => 30,
+ "(" => 32,
+ "|" => 31,
+ "*" => 33,
+ "." => 34,
+ "]" => 108,
+ ">" => 35
}
},
- {#State 100
- DEFAULT => -46
- },
- {#State 101
- DEFAULT => -51
- },
- {#State 102
- ACTIONS => {
- "-" => 26,
- "+" => 27,
- "&" => 28,
- "/" => 29,
- "(" => 31,
- "|" => 30,
- "*" => 32,
- "." => 33,
- ")" => 117,
- ">" => 34
- }
+ {#State 94
+ DEFAULT => -42
},
- {#State 103
- DEFAULT => -43
+ {#State 95
+ DEFAULT => -39
},
- {#State 104
+ {#State 96
ACTIONS => {
- 'IDENTIFIER' => 5,
- "enum" => 55,
- "[" => 65,
- 'void' => 56
+ 'IDENTIFIER' => 7,
+ "enum" => 56,
+ "[" => 5,
+ 'void' => 57
},
- DEFAULT => -48,
+ DEFAULT => -44,
GOTOS => {
- 'identifier' => 58,
- 'struct' => 59,
- 'enum' => 60,
- 'type' => 118,
- 'union' => 62,
- 'property_list' => 57
+ 'identifier' => 59,
+ 'struct' => 60,
+ 'enum' => 61,
+ 'type' => 109,
+ 'union' => 63,
+ 'property_list' => 58
}
},
- {#State 105
- DEFAULT => -42
+ {#State 97
+ DEFAULT => -38
},
- {#State 106
+ {#State 98
ACTIONS => {
- "," => 119,
- ")" => 120
+ "," => 110,
+ ")" => 111
}
},
- {#State 107
+ {#State 99
ACTIONS => {
- "-" => 26,
- "|" => 30,
- "(" => 31,
- "*" => 32,
- ";" => 121,
- "+" => 27,
- "&" => 28,
- "/" => 29,
- "." => 33,
- ">" => 34
+ "-" => 27,
+ "|" => 31,
+ "(" => 32,
+ "*" => 33,
+ ";" => 112,
+ "+" => 28,
+ "&" => 29,
+ "/" => 30,
+ "." => 34,
+ ">" => 35
}
},
- {#State 108
+ {#State 100
ACTIONS => {
- "-" => 26,
- "+" => 27,
- "&" => 28,
- "/" => 29,
- "(" => 31,
- "|" => 30,
- "*" => 32,
- "." => 33,
- ">" => 34
+ "-" => 27,
+ "+" => 28,
+ "&" => 29,
+ "/" => 30,
+ "(" => 32,
+ "|" => 31,
+ "*" => 33,
+ "." => 34,
+ ">" => 35
},
- DEFAULT => -27
+ DEFAULT => -23
},
- {#State 109
- DEFAULT => -25
+ {#State 101
+ DEFAULT => -21
},
- {#State 110
- DEFAULT => -29
+ {#State 102
+ DEFAULT => -25
},
- {#State 111
- DEFAULT => -31
+ {#State 103
+ DEFAULT => -27
},
- {#State 112
+ {#State 104
ACTIONS => {
- "(" => 122
+ "(" => 113
}
},
- {#State 113
+ {#State 105
ACTIONS => {
- "]" => 123
+ "]" => 114
}
},
- {#State 114
- DEFAULT => -28
+ {#State 106
+ DEFAULT => -24
},
- {#State 115
+ {#State 107
ACTIONS => {
- ";" => 124
+ ";" => 115
}
},
- {#State 116
- DEFAULT => -47
- },
- {#State 117
- DEFAULT => -53
+ {#State 108
+ DEFAULT => -43
},
- {#State 118
- DEFAULT => -37,
+ {#State 109
+ DEFAULT => -33,
GOTOS => {
- 'pointers' => 125
+ 'pointers' => 116
}
},
- {#State 119
- DEFAULT => -48,
+ {#State 110
+ DEFAULT => -44,
GOTOS => {
- 'base_element' => 126,
- 'property_list' => 104
+ 'base_element' => 117,
+ 'property_list' => 96
}
},
- {#State 120
+ {#State 111
ACTIONS => {
- ";" => 127
+ ";" => 118
}
},
- {#State 121
- DEFAULT => -15
+ {#State 112
+ DEFAULT => -11
},
- {#State 122
+ {#State 113
ACTIONS => {
- 'IDENTIFIER' => 5,
+ 'IDENTIFIER' => 7,
'CONSTANT' => 23,
'TEXT' => 17
},
- DEFAULT => -56,
+ DEFAULT => -52,
GOTOS => {
'identifier' => 18,
'text' => 19,
- 'anytext' => 128,
+ 'anytext' => 119,
'constant' => 22
}
},
- {#State 123
+ {#State 114
ACTIONS => {
- ";" => 129
+ ";" => 120
},
- DEFAULT => -48,
+ DEFAULT => -44,
GOTOS => {
- 'base_element' => 130,
- 'property_list' => 104
+ 'base_element' => 121,
+ 'property_list' => 96
}
},
- {#State 124
- DEFAULT => -40
+ {#State 115
+ DEFAULT => -36
},
- {#State 125
+ {#State 116
ACTIONS => {
- 'IDENTIFIER' => 5,
- "*" => 132
+ 'IDENTIFIER' => 7,
+ "*" => 123
},
GOTOS => {
- 'identifier' => 131
+ 'identifier' => 122
}
},
- {#State 126
- DEFAULT => -44
+ {#State 117
+ DEFAULT => -40
},
- {#State 127
- DEFAULT => -16
+ {#State 118
+ DEFAULT => -12
},
- {#State 128
+ {#State 119
ACTIONS => {
- "-" => 26,
- "+" => 27,
- "&" => 28,
- "/" => 29,
- "(" => 31,
- "|" => 30,
- "*" => 32,
- "." => 33,
- ")" => 133,
- ">" => 34
+ "-" => 27,
+ "+" => 28,
+ "&" => 29,
+ "/" => 30,
+ "(" => 32,
+ "|" => 31,
+ "*" => 33,
+ "." => 34,
+ ")" => 124,
+ ">" => 35
}
},
- {#State 129
- DEFAULT => -35
+ {#State 120
+ DEFAULT => -31
},
- {#State 130
+ {#State 121
ACTIONS => {
- ";" => 134
+ ";" => 125
}
},
- {#State 131
+ {#State 122
ACTIONS => {
- "[" => 85
+ "[" => 82
},
- DEFAULT => -45,
+ DEFAULT => -41,
GOTOS => {
- 'array_len' => 135
+ 'array_len' => 126
}
},
- {#State 132
- DEFAULT => -38
+ {#State 123
+ DEFAULT => -34
},
- {#State 133
+ {#State 124
ACTIONS => {
- "]" => 136
+ "]" => 127
}
},
- {#State 134
- DEFAULT => -34
+ {#State 125
+ DEFAULT => -30
},
- {#State 135
- DEFAULT => -36
+ {#State 126
+ DEFAULT => -32
},
- {#State 136
+ {#State 127
ACTIONS => {
- ";" => 137
+ ";" => 128
},
- DEFAULT => -48,
+ DEFAULT => -44,
GOTOS => {
- 'base_element' => 138,
- 'property_list' => 104
+ 'base_element' => 129,
+ 'property_list' => 96
}
},
- {#State 137
- DEFAULT => -33
+ {#State 128
+ DEFAULT => -29
},
- {#State 138
+ {#State 129
ACTIONS => {
- ";" => 139
+ ";" => 130
}
},
- {#State 139
- DEFAULT => -32
+ {#State 130
+ DEFAULT => -28
}
],
yyrules =>
@@ -1481,85 +1418,62 @@ sub new {
'$start', 2, undef
],
[#Rule 1
- 'idl', 1, undef
+ 'idl', 0, undef
],
[#Rule 2
'idl', 2,
sub
-#line 18 "build/pidl/idl.yp"
-{ util::FlattenArray([$_[1],$_[2]]) }
+#line 19 "build/pidl/idl.yp"
+{
+ push(@{$_[1]}, $_[2]); $_[1]
+ }
],
[#Rule 3
- 'idl_interface', 2,
-sub
-#line 21 "build/pidl/idl.yp"
-{ [ $_[1], $_[2] ] }
- ],
- [#Rule 4
- 'module_header', 3,
+ 'interface', 7,
sub
#line 25 "build/pidl/idl.yp"
-{{
- "TYPE" => "MODULEHEADER",
- "PROPERTIES" => util::FlattenHash($_[2])
+{$_[3] => {
+ "TYPE" => "INTERFACE",
+ "PROPERTIES" => $_[1],
+ "NAME" => $_[3],
+ "BASE" => $_[4],
+ "DATA" => $_[6],
}}
],
- [#Rule 5
- 'module_params', 0, undef
- ],
- [#Rule 6
- 'module_params', 1,
-sub
-#line 33 "build/pidl/idl.yp"
-{ [ $_[1] ] }
- ],
- [#Rule 7
- 'module_params', 3,
-sub
-#line 34 "build/pidl/idl.yp"
-{ push(@{$_[1]}, $_[3]); $_[1] }
- ],
- [#Rule 8
- 'module_param', 4,
-sub
-#line 38 "build/pidl/idl.yp"
-{ { "$_[1]" => "$_[3]" } }
+ [#Rule 4
+ 'base_interface', 0, undef
],
- [#Rule 9
- 'interface', 5,
+ [#Rule 5
+ 'base_interface', 2,
sub
-#line 42 "build/pidl/idl.yp"
-{{
- "TYPE" => "INTERFACE",
- "NAME" => $_[2],
- "DATA" => $_[4]
- }}
+#line 36 "build/pidl/idl.yp"
+{ $_[2] }
],
- [#Rule 10
+ [#Rule 6
'definitions', 1,
sub
-#line 50 "build/pidl/idl.yp"
+#line 40 "build/pidl/idl.yp"
{ [ $_[1] ] }
],
- [#Rule 11
+ [#Rule 7
'definitions', 2,
sub
-#line 51 "build/pidl/idl.yp"
+#line 41 "build/pidl/idl.yp"
{ push(@{$_[1]}, $_[2]); $_[1] }
],
- [#Rule 12
+ [#Rule 8
'definition', 1, undef
],
- [#Rule 13
+ [#Rule 9
'definition', 1, undef
],
- [#Rule 14
+ [#Rule 10
'definition', 1, undef
],
- [#Rule 15
+ [#Rule 11
'const', 6,
sub
-#line 59 "build/pidl/idl.yp"
+#line 49 "build/pidl/idl.yp"
{{
"TYPE" => "CONST",
"DTYPE" => $_[2],
@@ -1567,10 +1481,10 @@ sub
"VALUE" => $_[5]
}}
],
- [#Rule 16
+ [#Rule 12
'function', 7,
sub
-#line 69 "build/pidl/idl.yp"
+#line 59 "build/pidl/idl.yp"
{{
"TYPE" => "FUNCTION",
"NAME" => $_[3],
@@ -1579,10 +1493,10 @@ sub
"DATA" => $_[5]
}}
],
- [#Rule 17
+ [#Rule 13
'typedef', 5,
sub
-#line 79 "build/pidl/idl.yp"
+#line 69 "build/pidl/idl.yp"
{{
"TYPE" => "TYPEDEF",
"NAME" => $_[3],
@@ -1590,128 +1504,128 @@ sub
"ARRAY_LEN" => $_[4]
}}
],
- [#Rule 18
+ [#Rule 14
'type', 1, undef
],
- [#Rule 19
+ [#Rule 15
'type', 1, undef
],
- [#Rule 20
+ [#Rule 16
'type', 1, undef
],
- [#Rule 21
+ [#Rule 17
'type', 1, undef
],
- [#Rule 22
+ [#Rule 18
'type', 1,
sub
-#line 88 "build/pidl/idl.yp"
+#line 78 "build/pidl/idl.yp"
{ "void" }
],
- [#Rule 23
+ [#Rule 19
'enum', 4,
sub
-#line 93 "build/pidl/idl.yp"
+#line 83 "build/pidl/idl.yp"
{{
"TYPE" => "ENUM",
"ELEMENTS" => $_[3]
}}
],
- [#Rule 24
+ [#Rule 20
'enum_elements', 1,
sub
-#line 100 "build/pidl/idl.yp"
+#line 90 "build/pidl/idl.yp"
{ [ $_[1] ] }
],
- [#Rule 25
+ [#Rule 21
'enum_elements', 3,
sub
-#line 101 "build/pidl/idl.yp"
+#line 91 "build/pidl/idl.yp"
{ push(@{$_[1]}, $_[3]); $_[1] }
],
- [#Rule 26
+ [#Rule 22
'enum_element', 1, undef
],
- [#Rule 27
+ [#Rule 23
'enum_element', 3,
sub
-#line 105 "build/pidl/idl.yp"
+#line 95 "build/pidl/idl.yp"
{ "$_[1]$_[2]$_[3]" }
],
- [#Rule 28
+ [#Rule 24
'struct', 5,
sub
-#line 109 "build/pidl/idl.yp"
+#line 99 "build/pidl/idl.yp"
{{
"TYPE" => "STRUCT",
"PROPERTIES" => $_[1],
"ELEMENTS" => $_[4]
}}
],
- [#Rule 29
+ [#Rule 25
'union', 5,
sub
-#line 117 "build/pidl/idl.yp"
+#line 107 "build/pidl/idl.yp"
{{
"TYPE" => "UNION",
"PROPERTIES" => $_[1],
"DATA" => $_[4]
}}
],
- [#Rule 30
+ [#Rule 26
'union_elements', 1,
sub
-#line 125 "build/pidl/idl.yp"
+#line 115 "build/pidl/idl.yp"
{ [ $_[1] ] }
],
- [#Rule 31
+ [#Rule 27
'union_elements', 2,
sub
-#line 126 "build/pidl/idl.yp"
+#line 116 "build/pidl/idl.yp"
{ push(@{$_[1]}, $_[2]); $_[1] }
],
- [#Rule 32
+ [#Rule 28
'union_element', 8,
sub
-#line 131 "build/pidl/idl.yp"
+#line 121 "build/pidl/idl.yp"
{{
"TYPE" => "UNION_ELEMENT",
"CASE" => $_[4],
"DATA" => $_[7]
}}
],
- [#Rule 33
+ [#Rule 29
'union_element', 7,
sub
-#line 137 "build/pidl/idl.yp"
+#line 127 "build/pidl/idl.yp"
{{
"TYPE" => "EMPTY",
"CASE" => $_[4],
}}
],
- [#Rule 34
+ [#Rule 30
'union_element', 5,
sub
-#line 142 "build/pidl/idl.yp"
+#line 132 "build/pidl/idl.yp"
{{
"TYPE" => "UNION_ELEMENT",
"CASE" => "default",
"DATA" => $_[4]
}}
],
- [#Rule 35
+ [#Rule 31
'union_element', 4,
sub
-#line 148 "build/pidl/idl.yp"
+#line 138 "build/pidl/idl.yp"
{{
"TYPE" => "EMPTY",
"CASE" => "default",
}}
],
- [#Rule 36
+ [#Rule 32
'base_element', 5,
sub
-#line 155 "build/pidl/idl.yp"
+#line 145 "build/pidl/idl.yp"
{{
"NAME" => $_[4],
"TYPE" => $_[2],
@@ -1720,181 +1634,181 @@ sub
"ARRAY_LEN" => $_[5]
}}
],
- [#Rule 37
+ [#Rule 33
'pointers', 0,
sub
-#line 167 "build/pidl/idl.yp"
+#line 157 "build/pidl/idl.yp"
{ 0 }
],
- [#Rule 38
+ [#Rule 34
'pointers', 2,
sub
-#line 168 "build/pidl/idl.yp"
+#line 158 "build/pidl/idl.yp"
{ $_[1]+1 }
],
- [#Rule 39
+ [#Rule 35
'element_list1', 0, undef
],
- [#Rule 40
+ [#Rule 36
'element_list1', 3,
sub
-#line 175 "build/pidl/idl.yp"
+#line 165 "build/pidl/idl.yp"
{ push(@{$_[1]}, $_[2]); $_[1] }
],
- [#Rule 41
+ [#Rule 37
'element_list2', 0, undef
],
- [#Rule 42
+ [#Rule 38
'element_list2', 1, undef
],
- [#Rule 43
+ [#Rule 39
'element_list2', 1,
sub
-#line 181 "build/pidl/idl.yp"
+#line 171 "build/pidl/idl.yp"
{ [ $_[1] ] }
],
- [#Rule 44
+ [#Rule 40
'element_list2', 3,
sub
-#line 182 "build/pidl/idl.yp"
+#line 172 "build/pidl/idl.yp"
{ push(@{$_[1]}, $_[3]); $_[1] }
],
- [#Rule 45
+ [#Rule 41
'array_len', 0, undef
],
- [#Rule 46
+ [#Rule 42
'array_len', 2,
sub
-#line 187 "build/pidl/idl.yp"
+#line 177 "build/pidl/idl.yp"
{ "*" }
],
- [#Rule 47
+ [#Rule 43
'array_len', 3,
sub
-#line 188 "build/pidl/idl.yp"
+#line 178 "build/pidl/idl.yp"
{ "$_[2]" }
],
- [#Rule 48
+ [#Rule 44
'property_list', 0, undef
],
- [#Rule 49
+ [#Rule 45
'property_list', 4,
sub
-#line 194 "build/pidl/idl.yp"
+#line 184 "build/pidl/idl.yp"
{ util::FlattenHash([$_[1],$_[3]]); }
],
- [#Rule 50
+ [#Rule 46
'properties', 1,
sub
-#line 197 "build/pidl/idl.yp"
+#line 187 "build/pidl/idl.yp"
{ $_[1] }
],
- [#Rule 51
+ [#Rule 47
'properties', 3,
sub
-#line 198 "build/pidl/idl.yp"
+#line 188 "build/pidl/idl.yp"
{ util::FlattenHash([$_[1], $_[3]]); }
],
- [#Rule 52
+ [#Rule 48
'property', 1,
sub
-#line 201 "build/pidl/idl.yp"
+#line 191 "build/pidl/idl.yp"
{{ "$_[1]" => "1" }}
],
- [#Rule 53
+ [#Rule 49
'property', 4,
sub
-#line 202 "build/pidl/idl.yp"
+#line 192 "build/pidl/idl.yp"
{{ "$_[1]" => "$_[3]" }}
],
- [#Rule 54
+ [#Rule 50
'listtext', 1, undef
],
- [#Rule 55
+ [#Rule 51
'listtext', 3,
sub
-#line 207 "build/pidl/idl.yp"
+#line 197 "build/pidl/idl.yp"
{ "$_[1] $_[3]" }
],
- [#Rule 56
+ [#Rule 52
'anytext', 0,
sub
-#line 211 "build/pidl/idl.yp"
+#line 201 "build/pidl/idl.yp"
{ "" }
],
- [#Rule 57
+ [#Rule 53
'anytext', 1, undef
],
- [#Rule 58
+ [#Rule 54
'anytext', 1, undef
],
- [#Rule 59
+ [#Rule 55
'anytext', 1, undef
],
- [#Rule 60
+ [#Rule 56
'anytext', 3,
sub
-#line 213 "build/pidl/idl.yp"
+#line 203 "build/pidl/idl.yp"
{ "$_[1]$_[2]$_[3]" }
],
- [#Rule 61
+ [#Rule 57
'anytext', 3,
sub
-#line 214 "build/pidl/idl.yp"
+#line 204 "build/pidl/idl.yp"
{ "$_[1]$_[2]$_[3]" }
],
- [#Rule 62
+ [#Rule 58
'anytext', 3,
sub
-#line 215 "build/pidl/idl.yp"
+#line 205 "build/pidl/idl.yp"
{ "$_[1]$_[2]$_[3]" }
],
- [#Rule 63
+ [#Rule 59
'anytext', 3,
sub
-#line 216 "build/pidl/idl.yp"
+#line 206 "build/pidl/idl.yp"
{ "$_[1]$_[2]$_[3]" }
],
- [#Rule 64
+ [#Rule 60
'anytext', 3,
sub
-#line 217 "build/pidl/idl.yp"
+#line 207 "build/pidl/idl.yp"
{ "$_[1]$_[2]$_[3]" }
],
- [#Rule 65
+ [#Rule 61
'anytext', 3,
sub
-#line 218 "build/pidl/idl.yp"
+#line 208 "build/pidl/idl.yp"
{ "$_[1]$_[2]$_[3]" }
],
- [#Rule 66
+ [#Rule 62
'anytext', 3,
sub
-#line 219 "build/pidl/idl.yp"
+#line 209 "build/pidl/idl.yp"
{ "$_[1]$_[2]$_[3]" }
],
- [#Rule 67
+ [#Rule 63
'anytext', 3,
sub
-#line 220 "build/pidl/idl.yp"
+#line 210 "build/pidl/idl.yp"
{ "$_[1]$_[2]$_[3]" }
],
- [#Rule 68
+ [#Rule 64
'anytext', 5,
sub
-#line 221 "build/pidl/idl.yp"
+#line 211 "build/pidl/idl.yp"
{ "$_[1]$_[2]$_[3]$_[4]$_[5]" }
],
- [#Rule 69
+ [#Rule 65
'identifier', 1, undef
],
- [#Rule 70
+ [#Rule 66
'constant', 1, undef
],
- [#Rule 71
+ [#Rule 67
'text', 1,
sub
-#line 230 "build/pidl/idl.yp"
+#line 220 "build/pidl/idl.yp"
{ "\"$_[1]\"" }
]
],
@@ -1902,7 +1816,7 @@ sub
bless($self,$class);
}
-#line 236 "build/pidl/idl.yp"
+#line 226 "build/pidl/idl.yp"
use util;
@@ -1988,10 +1902,49 @@ sub parse_idl($$)
my $data = `$cpp -xc $filename`;
$/ = $saved_delim;
- $self->YYData->{INPUT} = $data;
- $self->YYData->{LINE} = 0;
- $self->YYData->{LAST_TOKEN} = "NONE";
- return $self->YYParse( yylex => \&_Lexer, yyerror => \&_Error );
+ $self->YYData->{INPUT} = $data;
+ $self->YYData->{LINE} = 0;
+ $self->YYData->{LAST_TOKEN} = "NONE";
+
+ my $idl = $self->YYParse( yylex => \&_Lexer, yyerror => \&_Error );
+
+ foreach my $x (@{$idl}) {
+ # Add [in] ORPCTHIS *this, [out] ORPCTHAT *that
+ # for 'object' interfaces
+ if (defined($x->{PROPERTIES}->{object})) {
+ foreach my $e (@{$x->{DATA}}) {
+ if($e->{TYPE} eq "FUNCTION") {
+ unshift(@{$e->{DATA}},
+ { 'NAME' => 'ORPCthis',
+ 'POINTERS' => 1,
+ 'PROPERTIES' => { 'in' => '1' },
+ 'TYPE' => 'ORPCTHIS'
+ });
+ unshift(@{$e->{DATA}},
+ { 'NAME' => 'ORPCthat',
+ 'POINTERS' => 1,
+ 'PROPERTIES' => { 'out' => '1' },
+ 'TYPE' => 'ORPCTHAT'
+ });
+ }
+ }
+ }
+
+ # Do the inheritance
+ if (defined($x->{BASE}) and $x->{BASE} ne "") {
+ my $parent = util::get_interface($idl, $x->{BASE});
+
+ if(not defined($parent)) {
+ die("No such parent interface " . $x->{BASE});
+ }
+
+ @{$x->{INHERITED_DATA}} = (@{$parent->{INHERITED_DATA}}, @{$x->{DATA}});
+ } else {
+ $x->{INHERITED_DATA} = $x->{DATA};
+ }
+ }
+
+ return $idl;
}
1;
diff --git a/source4/build/pidl/idl.yp b/source4/build/pidl/idl.yp
index cb293de272..77ebbc74a7 100644
--- a/source4/build/pidl/idl.yp
+++ b/source4/build/pidl/idl.yp
@@ -14,36 +14,26 @@
################
# grammer
%%
-idl: idl_interface
- | idl idl_interface { util::FlattenArray([$_[1],$_[2]]) }
-;
-
-idl_interface: module_header interface { [ $_[1], $_[2] ] }
+idl:
+ #empty { {} }
+ | idl interface {
+ push(@{$_[1]}, $_[2]); $_[1]
+ }
;
-module_header: '[' module_params ']'
- {{
- "TYPE" => "MODULEHEADER",
- "PROPERTIES" => util::FlattenHash($_[2])
+interface: property_list 'interface' identifier base_interface '{' definitions '}'
+ {$_[3] => {
+ "TYPE" => "INTERFACE",
+ "PROPERTIES" => $_[1],
+ "NAME" => $_[3],
+ "BASE" => $_[4],
+ "DATA" => $_[6],
}}
;
-module_params:
- #empty
- | module_param { [ $_[1] ] }
- | module_params ',' module_param { push(@{$_[1]}, $_[3]); $_[1] }
-;
-
-module_param: identifier '(' listtext ')'
-{ { "$_[1]" => "$_[3]" } }
-;
-
-interface: 'interface' identifier '{' definitions '}'
- {{
- "TYPE" => "INTERFACE",
- "NAME" => $_[2],
- "DATA" => $_[4]
- }}
+base_interface:
+ #empty
+ | ':' identifier { $_[2] }
;
definitions:
@@ -199,7 +189,7 @@ properties: property { $_[1] }
;
property: identifier {{ "$_[1]" => "1" }}
- | identifier '(' anytext ')' {{ "$_[1]" => "$_[3]" }}
+ | identifier '(' listtext ')' {{ "$_[1]" => "$_[3]" }}
;
listtext:
@@ -318,8 +308,47 @@ sub parse_idl($$)
my $data = `$cpp -xc $filename`;
$/ = $saved_delim;
- $self->YYData->{INPUT} = $data;
- $self->YYData->{LINE} = 0;
- $self->YYData->{LAST_TOKEN} = "NONE";
- return $self->YYParse( yylex => \&_Lexer, yyerror => \&_Error );
+ $self->YYData->{INPUT} = $data;
+ $self->YYData->{LINE} = 0;
+ $self->YYData->{LAST_TOKEN} = "NONE";
+
+ my $idl = $self->YYParse( yylex => \&_Lexer, yyerror => \&_Error );
+
+ foreach my $x (@{$idl}) {
+ # Add [in] ORPCTHIS *this, [out] ORPCTHAT *that
+ # for 'object' interfaces
+ if (defined($x->{PROPERTIES}->{object})) {
+ foreach my $e (@{$x->{DATA}}) {
+ if($e->{TYPE} eq "FUNCTION") {
+ unshift(@{$e->{DATA}},
+ { 'NAME' => 'ORPCthis',
+ 'POINTERS' => 1,
+ 'PROPERTIES' => { 'in' => '1' },
+ 'TYPE' => 'ORPCTHIS'
+ });
+ unshift(@{$e->{DATA}},
+ { 'NAME' => 'ORPCthat',
+ 'POINTERS' => 1,
+ 'PROPERTIES' => { 'out' => '1' },
+ 'TYPE' => 'ORPCTHAT'
+ });
+ }
+ }
+ }
+
+ # Do the inheritance
+ if (defined($x->{BASE}) and $x->{BASE} ne "") {
+ my $parent = util::get_interface($idl, $x->{BASE});
+
+ if(not defined($parent)) {
+ die("No such parent interface " . $x->{BASE});
+ }
+
+ @{$x->{INHERITED_DATA}} = (@{$parent->{INHERITED_DATA}}, @{$x->{DATA}});
+ } else {
+ $x->{INHERITED_DATA} = $x->{DATA};
+ }
+ }
+
+ return $idl;
}
diff --git a/source4/build/pidl/parser.pm b/source4/build/pidl/parser.pm
index bc9eaa627f..51d561d4b2 100644
--- a/source4/build/pidl/parser.pm
+++ b/source4/build/pidl/parser.pm
@@ -13,10 +13,6 @@ use client;
my %needed;
my %structs;
-my $if_uuid;
-my $if_version;
-my $if_endpoints;
-
sub pidl($)
{
print OUT shift;
@@ -622,7 +618,7 @@ sub ParseElementPrintBuffer($$)
}
if (util::array_size($e)) {
- ParseArrayPrint($e, $var_prefix);
+ ParseArrayPrint($e, $var_prefix)
} elsif (my $switch = util::has_property($e, "switch_is")) {
ParseElementPrintSwitch($e, $var_prefix, $switch);
} else {
@@ -1340,7 +1336,7 @@ sub ParseFunctionPull($)
sub FunctionTable($)
{
my($interface) = shift;
- my($data) = $interface->{DATA};
+ my($data) = $interface->{INHERITED_DATA};
my $count = 0;
my $uname = uc $interface->{NAME};
@@ -1368,11 +1364,11 @@ sub FunctionTable($)
my $endpoints;
- if (! defined $if_endpoints) {
- $if_endpoints = $interface->{NAME};
+ if (! defined $interface->{PROPERTIES}->{endpoints}) {
+ $interface->{PROPERTIES}->{endpoints} = $interface->{NAME};
}
- my @e = split / /, $if_endpoints;
+ my @e = split / /, $interface->{PROPERTIES}->{endpoints};
my $endpoint_count = $#e + 1;
pidl "static const char * const $interface->{NAME}\_endpoint_strings[] = {\n\t";
@@ -1501,17 +1497,6 @@ sub BuildNeeded($)
}
#####################################################################
-# parse the interface definitions
-sub ModuleHeader($)
-{
- my($h) = shift;
-
- $if_uuid = $h->{PROPERTIES}->{uuid};
- $if_version = $h->{PROPERTIES}->{version};
- $if_endpoints = $h->{PROPERTIES}->{endpoints};
-}
-
-#####################################################################
# parse a parsed IDL structure back into an IDL file
sub Parse($$)
{
@@ -1523,9 +1508,6 @@ sub Parse($$)
pidl "/* parser auto-generated by pidl */\n\n";
pidl "#include \"includes.h\"\n\n";
foreach my $x (@{$idl}) {
- ($x->{TYPE} eq "MODULEHEADER") &&
- ModuleHeader($x);
-
if ($x->{TYPE} eq "INTERFACE") {
BuildNeeded($x);
ParseInterface($x);
diff --git a/source4/build/pidl/pidl.pl b/source4/build/pidl/pidl.pl
index cebd545297..616727edc6 100755
--- a/source4/build/pidl/pidl.pl
+++ b/source4/build/pidl/pidl.pl
@@ -115,7 +115,7 @@ sub process_file($)
if ($opt_parse) {
$pidl = IdlParse($idl_file);
defined $pidl || die "Failed to parse $idl_file";
- IdlValidator::Validate($pidl);
+# IdlValidator::Validate($pidl);
if ($opt_keep && !util::SaveStructure($pidl_file, $pidl)) {
die "Failed to save $pidl_file\n";
}
diff --git a/source4/build/pidl/util.pm b/source4/build/pidl/util.pm
index f822222b45..1341d77ccc 100644
--- a/source4/build/pidl/util.pm
+++ b/source4/build/pidl/util.pm
@@ -154,6 +154,20 @@ sub SaveStructure($$)
}
#####################################################################
+# find an interface in an array of interfaces
+sub get_interface($$)
+{
+ my($if) = shift;
+ my($n) = shift;
+
+ foreach(@{$if}) {
+ if($_->{NAME} eq $n) { return $_; }
+ }
+
+ return 0;
+}
+
+#####################################################################
# see if a pidl property list contains a give property
sub has_property($$)
{
diff --git a/source4/librpc/idl/dcerpc.idl b/source4/librpc/idl/dcerpc.idl
index 71c1b26e2a..3618dfbb61 100644
--- a/source4/librpc/idl/dcerpc.idl
+++ b/source4/librpc/idl/dcerpc.idl
@@ -8,7 +8,6 @@
see http://www.opengroup.org/onlinepubs/9629399/chap12.htm for packet
layouts
*/
-[]
interface dcerpc
{
typedef [public] struct {
diff --git a/source4/librpc/idl/dcom.idl b/source4/librpc/idl/dcom.idl
index 9d5acb6ebd..dee52243a4 100644
--- a/source4/librpc/idl/dcom.idl
+++ b/source4/librpc/idl/dcom.idl
@@ -10,27 +10,22 @@ interface ObjectRpcBaseTypes
{
WERROR stub();
- typedef [public] struct {
- uint32 upper;
- uint32 lower;
- } hyper;
-
//////////////////////////////////////////////////////////////
// Identifier Definitions
////////////////////////////////////////////////////////////
// Machine Identifier
-#define MID hyper
+#define MID HYPER_T
// Object Exporter Identifier
-#define OXID hyper
+#define OXID HYPER_T
// Object Identifer
-#define OID hyper
+#define OID HYPER_T
// Ping Set Identifier
-#define SETID hyper
+#define SETID HYPER_T
// Interface Pointer Identifier
#define IPID GUID
@@ -186,7 +181,7 @@ interface ObjectRpcBaseTypes
const uint32 SORF_NULL = 0x0; // convenient for initializing SORF
const uint32 SORF_NOPING = 0x1000;// Pinging is not required
// standard object reference
- typedef struct
+ typedef [public] struct
{
uint32 flags; // STDOBJREF flags (see above)
uint32 cPublicRefs; // count of references passed
@@ -241,6 +236,26 @@ interface ObjectRpcBaseTypes
} MInterfacePointer;
}
+
+[
+ object,
+ uuid(00000000-0000-0000-C000-000000000046)
+]
+interface IUnknown
+{
+ /*****************/
+ /* Function 0x00 */
+ HRESULT QueryInterface();
+
+ /*****************/
+ /* Function 0x01 */
+ uint32 AddRef();
+
+ /*****************/
+ /* Function 0x02 */
+ uint32 Release();
+}
+
//////////////////////////////////////////////////////////////////
// The remote version of Iunknown. This interface exists on every
@@ -252,9 +267,10 @@ interface ObjectRpcBaseTypes
//
[
uuid(00000131-0000-0000-C000-000000000046),
+ object,
version(0.0)
]
-interface IRemUnknown // : IUnknown
+interface IRemUnknown : IUnknown
{
typedef struct
{
@@ -262,7 +278,7 @@ interface IRemUnknown // : IUnknown
STDOBJREF std; // data for returned interface
}
REMQIRESULT;
-
+
HRESULT RemQueryInterface (
[in] IPID *ripid, // interface to QI on
[in] uint32 cRefs, // count of AddRefs requested
@@ -291,15 +307,18 @@ interface IRemUnknown // : IUnknown
);
}
+
+
// Derived from IRemUnknown, this interface supports Remote Query interface
// for objects that supply additional data beyond the STDOBJREF in their
// marshaled interface packets.
[
+object,
uuid(00000143-0000-0000-C000-000000000046),
version(0.0)
]
-interface IRemUnknown2 //: IRemUnknown
+interface IRemUnknown2 : IRemUnknown
{
HRESULT RemQueryInterface2 (
[in] IPID *ripid,
@@ -308,7 +327,6 @@ interface IRemUnknown2 //: IRemUnknown
[out, size_is(cIids)] HRESULT *phr
//FIXME [out, size_is(cIids)] MInterfacePointer **ppMIF
);
-
}
[ uuid(99fcfec4-5260-101b-bbcb-00aa0021347a),
@@ -339,7 +357,7 @@ interface IOXIDResolver
// Returns S_TRUE if the SetId is known by the object exporter,
// S_FALSE if not.
[idempotent] WERROR SimplePing (
- [in] policy_handle hRpc,
+ [in,ref] policy_handle *hRpc,
[in] SETID *pSetId // Must not be zero
);
@@ -364,13 +382,13 @@ interface IOXIDResolver
// can be used to validate the binding
// from the client.
[idempotent] WERROR ServerAlive (
- [in] policy_handle hRpc
+ [in,ref] policy_handle *hRpc
);
// Method to get the protocol sequences, string bindings,
// RemoteUnknown IPID and COM version for an object server
// given its OXID. Supported by DCOM
// version 5.2 and above.
- [idempotent] error_status_t ResolveOxid2 (
+ [idempotent] WERROR ResolveOxid2 (
[in] policy_handle hRpc,
[in] OXID *pOxid,
[in] uint16 cRequestedProtseqs,
@@ -452,13 +470,10 @@ interface ISystemActivator
/* Function 0x03 */
NTSTATUS isa_Unknown3();
-
// Binding strings and the OBJREF_SIGNATURE in this call
/*****************/
/* Function 0x04 */
NTSTATUS isa_Unknown4();
-
-
}
[
diff --git a/source4/librpc/idl/misc.idl b/source4/librpc/idl/misc.idl
index d7163839d5..7fed02f5b1 100644
--- a/source4/librpc/idl/misc.idl
+++ b/source4/librpc/idl/misc.idl
@@ -4,7 +4,6 @@
miscellaneous IDL structures
*/
-[]
interface misc
{
/* a NULL sid */
diff --git a/source4/librpc/idl/schannel.idl b/source4/librpc/idl/schannel.idl
index a208ee89a3..157634ef76 100644
--- a/source4/librpc/idl/schannel.idl
+++ b/source4/librpc/idl/schannel.idl
@@ -4,7 +4,6 @@
schannel structures
*/
-[]
interface schannel
{
/*
diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c
index 5d4ade096f..bf72e0ad8b 100644
--- a/source4/librpc/ndr/ndr_basic.c
+++ b/source4/librpc/ndr/ndr_basic.c
@@ -207,6 +207,21 @@ NTSTATUS ndr_pull_array_uint32(struct ndr_pull *ndr, int ndr_flags, uint32_t *da
}
/*
+ pull a const array of HYPER_T
+*/
+NTSTATUS ndr_pull_array_HYPER_T(struct ndr_pull *ndr, int ndr_flags, HYPER_T *data, uint32_t n)
+{
+ uint32_t i;
+ if (!(ndr_flags & NDR_SCALARS)) {
+ return NT_STATUS_OK;
+ }
+ for (i=0;i<n;i++) {
+ NDR_CHECK(ndr_pull_HYPER_T(ndr, &data[i]));
+ }
+ return NT_STATUS_OK;
+}
+
+/*
push a uint8
*/
NTSTATUS ndr_push_uint8(struct ndr_push *ndr, uint8_t v)
@@ -347,6 +362,21 @@ NTSTATUS ndr_push_array_uint32(struct ndr_push *ndr, int ndr_flags, const uint32
}
/*
+ push an array of HYPER_T
+*/
+NTSTATUS ndr_push_array_HYPER_T(struct ndr_push *ndr, int ndr_flags, const HYPER_T *data, uint32_t n)
+{
+ int i;
+ if (!(ndr_flags & NDR_SCALARS)) {
+ return NT_STATUS_OK;
+ }
+ for (i=0;i<n;i++) {
+ NDR_CHECK(ndr_push_HYPER_T(ndr, data[i]));
+ }
+ return NT_STATUS_OK;
+}
+
+/*
save the current position
*/
void ndr_push_save(struct ndr_push *ndr, struct ndr_push_save *save)
@@ -798,6 +828,24 @@ void ndr_print_bad_level(struct ndr_print *ndr, const char *name, uint16_t level
ndr->print(ndr, "UNKNOWN LEVEL %u", level);
}
+void ndr_print_array_HYPER_T(struct ndr_print *ndr, const char *name,
+ const HYPER_T *data, uint32_t count)
+{
+ int i;
+
+ ndr->print(ndr, "%s: ARRAY(%d)", name, count);
+ ndr->depth++;
+ for (i=0;i<count;i++) {
+ char *idx=NULL;
+ asprintf(&idx, "[%d]", i);
+ if (idx) {
+ ndr_print_HYPER_T(ndr, idx, data[i]);
+ free(idx);
+ }
+ }
+ ndr->depth--;
+}
+
void ndr_print_array_uint32(struct ndr_print *ndr, const char *name,
const uint32_t *data, uint32_t count)
{
diff --git a/source4/torture/config.mk b/source4/torture/config.mk
index c520ef755b..157b06b3b8 100644
--- a/source4/torture/config.mk
+++ b/source4/torture/config.mk
@@ -49,6 +49,7 @@ REQUIRED_SUBSYSTEMS = \
ADD_OBJ_FILES = \
torture/rpc/lsa.o \
torture/rpc/echo.o \
+ torture/rpc/dcom.o \
torture/rpc/dfs.o \
torture/rpc/drsuapi.o \
torture/rpc/spoolss.o \
diff --git a/source4/torture/rpc/dcom.c b/source4/torture/rpc/dcom.c
new file mode 100644
index 0000000000..b42023eb2f
--- /dev/null
+++ b/source4/torture/rpc/dcom.c
@@ -0,0 +1,47 @@
+/*
+ Unix SMB/CIFS implementation.
+ test suite for dcom rpc operations
+
+ Copyright (C) Jelmer Vernooij 2004
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "includes.h"
+
+BOOL torture_rpc_dcom(int dummy)
+{
+ NTSTATUS status;
+ struct dcerpc_pipe *p;
+ TALLOC_CTX *mem_ctx;
+ BOOL ret = True;
+
+ mem_ctx = talloc_init("torture_rpc_dcom");
+
+ status = torture_rpc_connection(&p,
+ DCERPC_IOXIDRESOLVER_NAME,
+ DCERPC_IOXIDRESOLVER_UUID,
+ DCERPC_IOXIDRESOLVER_VERSION);
+ if (!NT_STATUS_IS_OK(status)) {
+ return False;
+ }
+
+ printf("\n");
+
+ talloc_destroy(mem_ctx);
+
+ torture_rpc_close(p);
+ return ret;
+}