From 46badf19089668e470e9bb5b2300017f8948b49e Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 16 Nov 2004 21:07:08 +0000 Subject: r3790: use a registration function that is called from dcerpc_*_init functions rather then a large table in librpc/gen_ndr/tables.c. This will allow us to only link in only the required gen_ndr files (speeds up linking quite a bit, makes binaries smaller). Each gen_ndr_* file now has a init function that calls the init functions of the interfaces it contains. I did it this way to keep pidl's code simple, though it might hurt startup time a bit. I'd be happy to change it if people like one function better. (This used to be commit 3c436590ae95b58ad6d00e72d6fdd08a4d80f208) --- source4/librpc/rpc/dcerpc.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'source4/librpc/rpc/dcerpc.c') diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c index f4b10f6b52..2427a22e59 100644 --- a/source4/librpc/rpc/dcerpc.c +++ b/source4/librpc/rpc/dcerpc.c @@ -24,12 +24,23 @@ #include "dlinklist.h" #include "librpc/gen_ndr/ndr_epmapper.h" -NTSTATUS librpc_init(void) +struct dcerpc_interface_list *dcerpc_pipes = NULL; + +NTSTATUS librpc_register_interface (const struct dcerpc_interface_table *interface) { - /* FIXME: Register module registration function here */ - return NT_STATUS_OK; + struct dcerpc_interface_list *l = talloc_p(NULL, struct dcerpc_interface_list); + + if (idl_iface_by_name (interface->name) != NULL) { + DEBUG(0, ("Attempt to register interface %s twice\n", interface->name)); + return NT_STATUS_OBJECT_NAME_COLLISION; + } + l->table = interface; + + DLIST_ADD(dcerpc_pipes, l); + + return NT_STATUS_OK; } - + /* initialise a dcerpc pipe. */ struct dcerpc_pipe *dcerpc_pipe_init(void) { -- cgit