summaryrefslogtreecommitdiff
path: root/source4/build
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-28 05:20:11 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-28 05:20:11 +0000
commitba33beec050bdc4bf0452761c481ea41985b831f (patch)
tree179e98e27411d9c3ca70ab799d73273306b480ed /source4/build
parentd419464d87127c9464d1a00976a36774835d196d (diff)
downloadsamba-ba33beec050bdc4bf0452761c481ea41985b831f.tar.gz
samba-ba33beec050bdc4bf0452761c481ea41985b831f.tar.bz2
samba-ba33beec050bdc4bf0452761c481ea41985b831f.zip
* added a bunch of placeholder IDL files
* allow for an interface to list its endpoints in the IDL file, so we can automatically make the server listen on the right pipes, and can scan pipes more easily (I don't take advantage of this yet, just putting the infrastructure in place) (This used to be commit c8b8480244b4ab6204403dc65e92e4317b410a84)
Diffstat (limited to 'source4/build')
-rw-r--r--source4/build/pidl/idl.gram2
-rw-r--r--source4/build/pidl/parser.pm44
2 files changed, 44 insertions, 2 deletions
diff --git a/source4/build/pidl/idl.gram b/source4/build/pidl/idl.gram
index b354b9772a..adabbe41a6 100644
--- a/source4/build/pidl/idl.gram
+++ b/source4/build/pidl/idl.gram
@@ -17,7 +17,7 @@ module_header: '[' <commit> module_param(s? /,/) ']'
}}
| <error?>
-module_param: identifier '(' text ')'
+module_param: identifier '(' <commit> text ')'
{{ "$item{identifier}" => "$item{text}" }}
| <error>
diff --git a/source4/build/pidl/parser.pm b/source4/build/pidl/parser.pm
index a10058a160..5bf5e4220f 100644
--- a/source4/build/pidl/parser.pm
+++ b/source4/build/pidl/parser.pm
@@ -14,6 +14,10 @@ use client;
my %needed;
my %structs;
+my $if_uuid;
+my $if_version;
+my $if_endpoints;
+
sub pidl($)
{
print OUT shift;
@@ -1281,7 +1285,31 @@ sub FunctionTable($)
}
pidl "\t{ NULL, 0, NULL, NULL }\n};\n\n";
- pidl "\nconst struct dcerpc_interface_table dcerpc_table_$interface->{NAME} = {\"$interface->{NAME}\", DCERPC_$uname\_UUID, DCERPC_$uname\_VERSION, $count, $interface->{NAME}\_calls};\n\n";
+ my $endpoints;
+
+ if (! defined $if_endpoints) {
+ $if_endpoints = $interface->{NAME};
+ }
+
+ pidl "static const struct dcerpc_endpoint_list $interface->{NAME}\_endpoints = {\n";
+ my @e = split / /, $if_endpoints;
+ my $endpoint_count = $#e + 1;
+ pidl "\t$endpoint_count,\n";
+ pidl "\t{ ";
+ for (my $i=0; $i < $#e; $i++) {
+ pidl "\"$e[$i]\", ";
+ }
+ pidl "\"$e[$#e]\" }\n";
+ pidl "};\n\n";
+
+ pidl "\nconst struct dcerpc_interface_table dcerpc_table_$interface->{NAME} = {\n";
+ pidl "\t\"$interface->{NAME}\",\n";
+ pidl "\tDCERPC_$uname\_UUID,\n";
+ pidl "\tDCERPC_$uname\_VERSION,\n";
+ pidl "\t$count,\n";
+ pidl "\t$interface->{NAME}\_calls,\n";
+ pidl "\t&$interface->{NAME}\_endpoints\n";
+ pidl "};\n\n";
}
@@ -1389,6 +1417,17 @@ 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($$)
{
@@ -1400,6 +1439,9 @@ 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);