sub ShowHelp()
{
print "
- perl DCE/RPC interface table generator
+ perl NDR interface table generator
Copyright (C) tridge\@samba.org
Usage: tables.pl [options] <idlfile>
- Options:
- --output OUTNAME put output in OUTNAME.*
\n";
exit(0);
}
my $found = 0;
while (my $line = <FILE>) {
- if ($line =~ /extern const struct dcerpc_interface_table (\w+);/) {
+ if ($line =~ /extern const struct ndr_interface_table (\w+);/) {
$found = 1;
- $init_fns.="\tlibrpc_register_interface(&$1);\n";
+ $init_fns.="\tstatus = ndr_table_register(&$1);\n";
+ $init_fns.="\tif (NT_STATUS_IS_ERR(status)) return status;\n\n";
}
}
if ($found) {
- print TABLEC "#include \"$filename\"\n";
+ print "#include \"$filename\"\n";
}
close(FILE);
}
-print "Creating $opt_output\n";
-open(TABLEC, ">$opt_output") || die "failed to open $opt_output\n";
-
-print TABLEC <<EOF;
+print <<EOF;
/* Automatically generated by tables.pl. DO NOT EDIT */
#include "includes.h"
+#include "librpc/ndr/libndr.h"
+#include "librpc/ndr/ndr_table.h"
EOF
process_file($_) foreach (@ARGV);
-print TABLEC <<EOF;
+print <<EOF;
-NTSTATUS dcerpc_table_init(void)
+NTSTATUS ndr_table_register_builtin_tables(void)
{
+ NTSTATUS status;
+
$init_fns
return NT_STATUS_OK;
}
EOF
-
-close(TABLEC);