summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-10-20 13:19:39 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-10-20 13:19:39 +0200
commite0905c30908b4d621030689d33de28a13c04a690 (patch)
treefe4a2e8ab06ab5dfbcb40e32df385dcdd6767d46
parent29838debb3d350aaee0bf9744f1a7371b8b06736 (diff)
downloadsamba-e0905c30908b4d621030689d33de28a13c04a690.tar.gz
samba-e0905c30908b4d621030689d33de28a13c04a690.tar.bz2
samba-e0905c30908b4d621030689d33de28a13c04a690.zip
Use tables in Samba 3 ndrdump.
-rw-r--r--librpc/ndr/ndr_table.c (renamed from source4/librpc/ndr/ndr_table.c)1
-rw-r--r--librpc/ndr/ndr_table.h13
-rw-r--r--librpc/tables.pl (renamed from source4/librpc/tables.pl)0
-rw-r--r--librpc/tools/ndrdump.c20
-rw-r--r--source3/Makefile.in12
-rw-r--r--source3/librpc/gen_ndr/tables.c83
-rw-r--r--source4/librpc/config.mk6
7 files changed, 112 insertions, 23 deletions
diff --git a/source4/librpc/ndr/ndr_table.c b/librpc/ndr/ndr_table.c
index 6308ba20dd..f7c381f22e 100644
--- a/source4/librpc/ndr/ndr_table.c
+++ b/librpc/ndr/ndr_table.c
@@ -24,6 +24,7 @@
#include "../lib/util/dlinklist.h"
#include "librpc/ndr/libndr.h"
#include "librpc/ndr/ndr_table.h"
+#undef strcasecmp
static struct ndr_interface_list *ndr_interfaces;
diff --git a/librpc/ndr/ndr_table.h b/librpc/ndr/ndr_table.h
new file mode 100644
index 0000000000..905c2e5e43
--- /dev/null
+++ b/librpc/ndr/ndr_table.h
@@ -0,0 +1,13 @@
+#ifndef _NDR_TABLE_PROTO_H_
+#define _NDR_TABLE_PROTO_H_
+
+NTSTATUS ndr_table_register(const struct ndr_interface_table *table);
+const char *ndr_interface_name(const struct GUID *uuid, uint32_t if_version);
+int ndr_interface_num_calls(const struct GUID *uuid, uint32_t if_version);
+const struct ndr_interface_table *ndr_table_by_name(const char *name);
+const struct ndr_interface_table *ndr_table_by_uuid(const struct GUID *uuid);
+const struct ndr_interface_list *ndr_table_list(void);
+NTSTATUS ndr_table_init(void);
+
+#endif /* _NDR_TABLE_PROTO_H_ */
+
diff --git a/source4/librpc/tables.pl b/librpc/tables.pl
index 04764f5fa0..04764f5fa0 100644
--- a/source4/librpc/tables.pl
+++ b/librpc/tables.pl
diff --git a/librpc/tools/ndrdump.c b/librpc/tools/ndrdump.c
index b24868eace..3d7c644902 100644
--- a/librpc/tools/ndrdump.c
+++ b/librpc/tools/ndrdump.c
@@ -19,12 +19,12 @@
*/
#include "includes.h"
-#if (_SAMBA_BUILD_ >= 4)
-#include "lib/cmdline/popt_common.h"
#include "system/filesys.h"
#include "system/locale.h"
#include "librpc/ndr/libndr.h"
#include "librpc/ndr/ndr_table.h"
+#if (_SAMBA_BUILD_ >= 4)
+#include "lib/cmdline/popt_common.h"
#include "param/param.h"
#endif
@@ -49,8 +49,6 @@ static const struct ndr_interface_call *find_function(
return &p->calls[i];
}
-#if (_SAMBA_BUILD_ >= 4)
-
_NORETURN_ static void show_pipes(void)
{
const struct ndr_interface_list *l;
@@ -66,8 +64,6 @@ _NORETURN_ static void show_pipes(void)
exit(1);
}
-#endif
-
_NORETURN_ static void show_functions(const struct ndr_interface_table *p)
{
int i;
@@ -174,9 +170,8 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force)
{ NULL }
};
-#if (_SAMBA_BUILD_ >= 4)
ndr_table_init();
-#else
+#if (_SAMBA_BUILD_ >= 3)
/* Initialise samba stuff */
load_case_tables();
@@ -213,21 +208,13 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force)
if (!pipe_name) {
poptPrintUsage(pc, stderr, 0);
-#if (_SAMBA_BUILD_ >= 4)
show_pipes();
-#endif
exit(1);
}
if (plugin != NULL) {
p = load_iface_from_plugin(plugin, pipe_name);
}
-#if (_SAMBA_BUILD_ <= 3)
- else {
- fprintf(stderr, "Only loading from DSO's supported in Samba 3\n");
- exit(1);
- }
-#else
if (!p) {
p = ndr_table_by_name(pipe_name);
}
@@ -241,7 +228,6 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force)
p = ndr_table_by_uuid(&uuid);
}
}
-#endif
if (!p) {
printf("Unknown pipe or UUID '%s'\n", pipe_name);
diff --git a/source3/Makefile.in b/source3/Makefile.in
index eddcaaac42..ba8fde0fa1 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -984,7 +984,11 @@ REPLACETORT_OBJ = @libreplacedir@/test/testsuite.o \
NDRDUMP_OBJ = ../librpc/tools/ndrdump.o \
$(PARAM_OBJ) $(LIBNDR_GEN_OBJ) \
$(LIBSAMBA_OBJ) $(LIB_NONSMBD_OBJ) $(POPT_LIB_OBJ) \
- librpc/gen_ndr/ndr_svcctl.o
+ $(LIBNDR_DRSUAPI_OBJ) $(COMPRESSION_OBJ) \
+ librpc/gen_ndr/ndr_svcctl.o \
+ librpc/gen_ndr/tables.o ../librpc/ndr/ndr_table.o \
+ ../librpc/ndr/ndr_krb5pac.o \
+ librpc/gen_ndr/ndr_krb5pac.o
DEBUG2HTML_OBJ = utils/debug2html.o utils/debugparse.o
@@ -1217,6 +1221,10 @@ samba3-idl::
../librpc/idl/ntsvcs.idl librpc/idl/libnetapi.idl ../librpc/idl/drsuapi.idl \
../librpc/idl/drsblobs.idl ../librpc/idl/nbt.idl
+librpc/gen_ndr/tables.c:: librpc/gen_ndr/*.h
+ @echo "Generating $@"
+ @$(PERL) ../librpc/tables.pl $^ > $@
+
#####################################################################
@@ -1539,7 +1547,7 @@ bin/locktest2@EXEEXT@: $(BINARY_PREREQS) $(LOCKTEST2_OBJ) @BUILD_POPT@ @LIBTALLO
bin/ndrdump@EXEEXT@: $(BINARY_PREREQS) $(NDRDUMP_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
@echo Linking $@
@$(CC) $(FLAGS) -o $@ $(NDRDUMP_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) \
- $(POPT_LIBS) $(LDAP_LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS)
+ $(POPT_LIBS) $(LDAP_LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(ZLIB_LIBS)
bin/debug2html@EXEEXT@: $(BINARY_PREREQS) $(DEBUG2HTML_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@
@echo Linking $@
diff --git a/source3/librpc/gen_ndr/tables.c b/source3/librpc/gen_ndr/tables.c
new file mode 100644
index 0000000000..f2064d95ac
--- /dev/null
+++ b/source3/librpc/gen_ndr/tables.c
@@ -0,0 +1,83 @@
+
+/* Automatically generated by tables.pl. DO NOT EDIT */
+
+#include "includes.h"
+#include "librpc/ndr/libndr.h"
+#include "librpc/ndr/ndr_table.h"
+#include "librpc/gen_ndr/ndr_dfs.h"
+#include "librpc/gen_ndr/ndr_drsblobs.h"
+#include "librpc/gen_ndr/ndr_drsuapi.h"
+#include "librpc/gen_ndr/ndr_dssetup.h"
+#include "librpc/gen_ndr/ndr_echo.h"
+#include "librpc/gen_ndr/ndr_epmapper.h"
+#include "librpc/gen_ndr/ndr_eventlog.h"
+#include "librpc/gen_ndr/ndr_initshutdown.h"
+#include "librpc/gen_ndr/ndr_krb5pac.h"
+#include "librpc/gen_ndr/ndr_lsa.h"
+#include "librpc/gen_ndr/ndr_netlogon.h"
+#include "librpc/gen_ndr/ndr_ntsvcs.h"
+#include "librpc/gen_ndr/ndr_samr.h"
+#include "librpc/gen_ndr/ndr_srvsvc.h"
+#include "librpc/gen_ndr/ndr_svcctl.h"
+#include "librpc/gen_ndr/ndr_winreg.h"
+#include "librpc/gen_ndr/ndr_wkssvc.h"
+
+NTSTATUS ndr_table_register_builtin_tables(void)
+{
+ NTSTATUS status;
+
+ status = ndr_table_register(&ndr_table_netdfs);
+ if (NT_STATUS_IS_ERR(status)) return status;
+
+ status = ndr_table_register(&ndr_table_drsblobs);
+ if (NT_STATUS_IS_ERR(status)) return status;
+
+ status = ndr_table_register(&ndr_table_drsuapi);
+ if (NT_STATUS_IS_ERR(status)) return status;
+
+ status = ndr_table_register(&ndr_table_dssetup);
+ if (NT_STATUS_IS_ERR(status)) return status;
+
+ status = ndr_table_register(&ndr_table_rpcecho);
+ if (NT_STATUS_IS_ERR(status)) return status;
+
+ status = ndr_table_register(&ndr_table_epmapper);
+ if (NT_STATUS_IS_ERR(status)) return status;
+
+ status = ndr_table_register(&ndr_table_eventlog);
+ if (NT_STATUS_IS_ERR(status)) return status;
+
+ status = ndr_table_register(&ndr_table_initshutdown);
+ if (NT_STATUS_IS_ERR(status)) return status;
+
+ status = ndr_table_register(&ndr_table_krb5pac);
+ if (NT_STATUS_IS_ERR(status)) return status;
+
+ status = ndr_table_register(&ndr_table_lsarpc);
+ if (NT_STATUS_IS_ERR(status)) return status;
+
+ status = ndr_table_register(&ndr_table_netlogon);
+ if (NT_STATUS_IS_ERR(status)) return status;
+
+ status = ndr_table_register(&ndr_table_ntsvcs);
+ if (NT_STATUS_IS_ERR(status)) return status;
+
+ status = ndr_table_register(&ndr_table_samr);
+ if (NT_STATUS_IS_ERR(status)) return status;
+
+ status = ndr_table_register(&ndr_table_srvsvc);
+ if (NT_STATUS_IS_ERR(status)) return status;
+
+ status = ndr_table_register(&ndr_table_svcctl);
+ if (NT_STATUS_IS_ERR(status)) return status;
+
+ status = ndr_table_register(&ndr_table_winreg);
+ if (NT_STATUS_IS_ERR(status)) return status;
+
+ status = ndr_table_register(&ndr_table_wkssvc);
+ if (NT_STATUS_IS_ERR(status)) return status;
+
+
+
+ return NT_STATUS_OK;
+}
diff --git a/source4/librpc/config.mk b/source4/librpc/config.mk
index 819b79f91f..6a0cd00e11 100644
--- a/source4/librpc/config.mk
+++ b/source4/librpc/config.mk
@@ -373,7 +373,7 @@ clean::
$(gen_ndrsrcdir)/tables.c: $(IDL_NDR_PARSE_H_FILES)
@echo Generating $@
- @$(PERL) $(librpcsrcdir)/tables.pl --output=$@ $^ > $(gen_ndrsrcdir)/tables.x
+ @$(PERL) ../librpc/tables.pl --output=$@ $^ > $(gen_ndrsrcdir)/tables.x
@mv $(gen_ndrsrcdir)/tables.x $@
[SUBSYSTEM::NDR_TABLE]
@@ -390,9 +390,7 @@ PUBLIC_DEPENDENCIES = \
NDR_SASL_HELPERS NDR_NOTIFY NDR_WINBIND NDR_FRSRPC NDR_FRSAPI NDR_NFS4ACL NDR_NTP_SIGND \
NDR_DCOM NDR_WMI
-NDR_TABLE_OBJ_FILES = $(ndrsrcdir)/ndr_table.o $(gen_ndrsrcdir)/tables.o
-
-$(eval $(call proto_header_template,$(ndrsrcdir)/ndr_table.h,$(NDR_TABLE_OBJ_FILES:.o=.c)))
+NDR_TABLE_OBJ_FILES = ../librpc/ndr/ndr_table.o $(gen_ndrsrcdir)/tables.o
[SUBSYSTEM::RPC_NDR_ROT]
PUBLIC_DEPENDENCIES = NDR_ROT dcerpc