diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2004-11-16 21:07:08 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:05:53 -0500 |
commit | 46badf19089668e470e9bb5b2300017f8948b49e (patch) | |
tree | 5625999d4333c30f6cedce7cbfc73ced1b2791ef /source4/torture | |
parent | 83d29e9bac43f643eb4ab11871425019f2ea9421 (diff) | |
download | samba-46badf19089668e470e9bb5b2300017f8948b49e.tar.gz samba-46badf19089668e470e9bb5b2300017f8948b49e.tar.xz samba-46badf19089668e470e9bb5b2300017f8948b49e.zip |
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)
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/dcom/simple.c | 3 | ||||
-rw-r--r-- | source4/torture/rpc/mgmt.c | 21 | ||||
-rw-r--r-- | source4/torture/rpc/scanner.c | 23 |
3 files changed, 21 insertions, 26 deletions
diff --git a/source4/torture/dcom/simple.c b/source4/torture/dcom/simple.c index 85bf194091..fe44a78cf5 100644 --- a/source4/torture/dcom/simple.c +++ b/source4/torture/dcom/simple.c @@ -47,9 +47,6 @@ BOOL torture_dcom_simple(void) mem_ctx = talloc_init("torture_dcom_simple"); - dcom_IUnknown_init(); - dcom_IStream_init(); - dcom_init(&ctx, lp_parm_string(-1, "torture", "userdomain"), lp_parm_string(-1, "torture", "username"), lp_parm_string(-1, "torture", "password")); diff --git a/source4/torture/rpc/mgmt.c b/source4/torture/rpc/mgmt.c index 45a96cf9f9..0353dd6189 100644 --- a/source4/torture/rpc/mgmt.c +++ b/source4/torture/rpc/mgmt.c @@ -21,7 +21,6 @@ #include "includes.h" #include "librpc/gen_ndr/ndr_mgmt.h" -#include "librpc/gen_ndr/tables.h" /* @@ -180,8 +179,8 @@ BOOL torture_rpc_mgmt(void) struct dcerpc_pipe *p; TALLOC_CTX *mem_ctx; BOOL ret = True; - int i; const char *binding = lp_parm_string(-1, "torture", "binding"); + struct dcerpc_interface_list *l; struct dcerpc_binding b; mem_ctx = talloc_init("torture_rpc_mgmt"); @@ -197,31 +196,31 @@ BOOL torture_rpc_mgmt(void) return False; } - for (i=0;dcerpc_pipes[i];i++) { + for (l=dcerpc_pipes;l;l=l->next) { /* some interfaces are not mappable */ - if (dcerpc_pipes[i]->num_calls == 0 || - strcmp(dcerpc_pipes[i]->name, "mgmt") == 0) { + if (l->table->num_calls == 0 || + strcmp(l->table->name, "mgmt") == 0) { continue; } - printf("\nTesting pipe '%s'\n", dcerpc_pipes[i]->name); + printf("\nTesting pipe '%s'\n", l->table->name); if (b.transport == NCACN_IP_TCP) { status = dcerpc_epm_map_binding(mem_ctx, &b, - dcerpc_pipes[i]->uuid, - dcerpc_pipes[i]->if_version); + l->table->uuid, + l->table->if_version); if (!NT_STATUS_IS_OK(status)) { - printf("Failed to map port for uuid %s\n", dcerpc_pipes[i]->uuid); + printf("Failed to map port for uuid %s\n", l->table->uuid); continue; } } else { - b.endpoint = dcerpc_pipes[i]->name; + b.endpoint = l->table->name; } lp_set_cmdline("torture:binding", dcerpc_binding_string(mem_ctx, &b)); status = torture_rpc_connection(&p, - dcerpc_pipes[i]->name, + l->table->name, DCERPC_MGMT_UUID, DCERPC_MGMT_VERSION); if (!NT_STATUS_IS_OK(status)) { diff --git a/source4/torture/rpc/scanner.c b/source4/torture/rpc/scanner.c index 4a1210119c..f9a4d337af 100644 --- a/source4/torture/rpc/scanner.c +++ b/source4/torture/rpc/scanner.c @@ -22,7 +22,6 @@ #include "includes.h" #include "librpc/gen_ndr/ndr_mgmt.h" -#include "librpc/gen_ndr/tables.h" /* work out how many calls there are for an interface @@ -135,7 +134,7 @@ BOOL torture_rpc_scanner(void) struct dcerpc_pipe *p; TALLOC_CTX *mem_ctx; BOOL ret = True; - int i; + struct dcerpc_interface_list *l; const char *binding = lp_parm_string(-1, "torture", "binding"); struct dcerpc_binding b; @@ -152,31 +151,31 @@ BOOL torture_rpc_scanner(void) return False; } - for (i=0;dcerpc_pipes[i];i++) { + for (l=dcerpc_pipes;l;l=l->next) { /* some interfaces are not mappable */ - if (dcerpc_pipes[i]->num_calls == 0 || - strcmp(dcerpc_pipes[i]->name, "mgmt") == 0) { + if (l->table->num_calls == 0 || + strcmp(l->table->name, "mgmt") == 0) { continue; } - printf("\nTesting pipe '%s'\n", dcerpc_pipes[i]->name); + printf("\nTesting pipe '%s'\n", l->table->name); if (b.transport == NCACN_IP_TCP) { status = dcerpc_epm_map_binding(mem_ctx, &b, - dcerpc_pipes[i]->uuid, - dcerpc_pipes[i]->if_version); + l->table->uuid, + l->table->if_version); if (!NT_STATUS_IS_OK(status)) { - printf("Failed to map port for uuid %s\n", dcerpc_pipes[i]->uuid); + printf("Failed to map port for uuid %s\n", l->table->uuid); continue; } } else { - b.endpoint = dcerpc_pipes[i]->name; + b.endpoint = l->table->name; } lp_set_cmdline("torture:binding", dcerpc_binding_string(mem_ctx, &b)); status = torture_rpc_connection(&p, - dcerpc_pipes[i]->name, + l->table->name, DCERPC_MGMT_UUID, DCERPC_MGMT_VERSION); if (!NT_STATUS_IS_OK(status)) { @@ -184,7 +183,7 @@ BOOL torture_rpc_scanner(void) continue; } - if (!test_inq_if_ids(p, mem_ctx, dcerpc_pipes[i])) { + if (!test_inq_if_ids(p, mem_ctx, l->table)) { ret = False; } |