r12510: Change the DCE/RPC interfaces to take a pointer to a
authorJelmer Vernooij <jelmer@samba.org>
Tue, 27 Dec 2005 14:28:01 +0000 (14:28 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:47:48 +0000 (13:47 -0500)
dcerpc_interface_table struct rather then a tuple of interface
name, UUID and version.

This removes the requirement for having a global list of DCE/RPC interfaces,
except for these parts of the code that use that list explicitly
(ndrdump and the scanner torture test).

This should also allow us to remove the hack that put the authservice parameter
in the dcerpc_binding struct as it can now be read directly from
dcerpc_interface_table.

I will now modify some of these functions to take a dcerpc_syntax_id
structure rather then a full dcerpc_interface_table.
(This used to be commit 8aae0f168e54c01d0866ad6e0da141dbd828574f)

69 files changed:
source4/client/client.c
source4/gtk/tools/gepdump.c
source4/gtk/tools/gwcrontab.c
source4/gtk/tools/gwsam.c
source4/lib/com/dcom/main.c
source4/lib/registry/reg_backend_rpc.c
source4/libcli/util/clilsa.c
source4/libnet/libnet_join.c
source4/libnet/libnet_passwd.c
source4/libnet/libnet_rpc.c
source4/libnet/libnet_rpc.h
source4/libnet/libnet_share.c
source4/libnet/libnet_time.c
source4/libnet/libnet_user.c
source4/libnet/libnet_vampire.c
source4/librpc/rpc/dcerpc.c
source4/librpc/rpc/dcerpc.h
source4/librpc/rpc/dcerpc_auth.c
source4/librpc/rpc/dcerpc_schannel.c
source4/librpc/rpc/dcerpc_util.c
source4/rpc_server/remote/dcesrv_remote.c
source4/scripting/ejs/smbcalls_rpc.c
source4/torture/ldap/common.c
source4/torture/libnet/domain.c
source4/torture/libnet/libnet_rpc.c
source4/torture/libnet/libnet_share.c
source4/torture/libnet/userinfo.c
source4/torture/libnet/userman.c
source4/torture/rpc/alter_context.c
source4/torture/rpc/atsvc.c
source4/torture/rpc/autoidl.c
source4/torture/rpc/bench.c
source4/torture/rpc/bind.c
source4/torture/rpc/countcalls.c
source4/torture/rpc/dcom.c
source4/torture/rpc/dfs.c
source4/torture/rpc/drsuapi.c
source4/torture/rpc/drsuapi_cracknames.c
source4/torture/rpc/dssetup.c
source4/torture/rpc/dssync.c
source4/torture/rpc/echo.c
source4/torture/rpc/epmapper.c
source4/torture/rpc/eventlog.c
source4/torture/rpc/initshutdown.c
source4/torture/rpc/lsa.c
source4/torture/rpc/mgmt.c
source4/torture/rpc/netlogon.c
source4/torture/rpc/oxidresolve.c
source4/torture/rpc/remact.c
source4/torture/rpc/rot.c
source4/torture/rpc/samlogon.c
source4/torture/rpc/samr.c
source4/torture/rpc/samsync.c
source4/torture/rpc/scanner.c
source4/torture/rpc/schannel.c
source4/torture/rpc/session_key.c
source4/torture/rpc/spoolss.c
source4/torture/rpc/srvsvc.c
source4/torture/rpc/svcctl.c
source4/torture/rpc/testjoin.c
source4/torture/rpc/unixinfo.c
source4/torture/rpc/winreg.c
source4/torture/rpc/wkssvc.c
source4/torture/torture.c
source4/utils/ntlm_auth.c
source4/winbind/wb_async_helpers.c
source4/winbind/wb_connect_lsa.c
source4/winbind/wb_connect_sam.c
source4/winbind/wb_init_domain.c

index 76d44b6920b0063a408c366c2ceba401f31742e4..2dfd1f940a23955cc6cbfb2ed6f8fd409aaf4c54 100644 (file)
@@ -2728,8 +2728,7 @@ static BOOL browse_host(const char *query_host)
        binding = talloc_asprintf(mem_ctx, "ncacn_np:%s", query_host);
 
        status = dcerpc_pipe_connect(mem_ctx, &p, binding, 
-                                    DCERPC_SRVSVC_UUID, 
-                                    DCERPC_SRVSVC_VERSION,
+                                        &dcerpc_table_srvsvc,
                                     cmdline_credentials, NULL);
        if (!NT_STATUS_IS_OK(status)) {
                d_printf("Failed to connect to %s - %s\n", 
index 41d523b7ceecff44e4e28266a3a0cf7a94e60e44..622d4b99aa14b044fd55365d41dfab1f8c039452 100644 (file)
@@ -196,7 +196,7 @@ static void on_connect_clicked(GtkButton *btn, gpointer         user_data)
        cli_credentials_set_gtk_callbacks(credentials);
 
        status = dcerpc_pipe_connect(talloc_autofree_context(), &epmapper_pipe, bs, 
-                                    DCERPC_EPMAPPER_UUID, DCERPC_EPMAPPER_VERSION, 
+                                        &dcerpc_table_epmapper,
                                     credentials, NULL);
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -208,7 +208,7 @@ static void on_connect_clicked(GtkButton *btn, gpointer         user_data)
 
        refresh_eps();
 
-       status = dcerpc_secondary_context(epmapper_pipe, &mgmt_pipe, DCERPC_MGMT_UUID, DCERPC_MGMT_VERSION);
+       status = dcerpc_secondary_context(epmapper_pipe, &mgmt_pipe, &dcerpc_table_mgmt);
 
        if (NT_STATUS_IS_ERR(status)) {
                mgmt_pipe = NULL;
index 647fdd2c1655d30f58e19350a3c6053c4dc702ba..fd4f41d06fa25f3ebf0530247c5b3656b67920ae 100644 (file)
@@ -107,8 +107,7 @@ static void on_connect_activate(GtkMenuItem *menuitem, gpointer user_data)
        
        status = dcerpc_pipe_connect_b(mem_ctx, &at_pipe,
                                       gtk_rpc_binding_dialog_get_binding(d, mem_ctx),
-                                      DCERPC_ATSVC_UUID,
-                                      DCERPC_ATSVC_VERSION,
+                                          &dcerpc_table_atsvc,
                                       credentials, NULL);
 
        if(!NT_STATUS_IS_OK(status)) {
index 644cc5c0439ad0b948ed02fd5b1942b00878e11a..f1cf8d5e857628ede6a449d713d3f57ba4d9a824 100644 (file)
@@ -131,7 +131,7 @@ static void connect_sam(void)
        /* If connected, get list of jobs */
        status = dcerpc_pipe_connect_b(mem_ctx, &sam_pipe,
                                       gtk_rpc_binding_dialog_get_binding(d, mem_ctx),
-                                      DCERPC_SAMR_UUID, DCERPC_SAMR_VERSION, cred, NULL);
+                                      &dcerpc_table_samr, cred, NULL);
 
        if(!NT_STATUS_IS_OK(status)) {
                gtk_show_ntstatus(mainwin, "While connecting to SAMR interface", status);
index 1ee5608895644de42b029bfb706ad1e22a378840..4a3dde86ec9a3c02b98bca22871eeeb9169cd0eb 100644 (file)
@@ -82,17 +82,15 @@ static NTSTATUS dcom_connect_host(struct com_context *ctx, struct dcerpc_pipe **
 
        if (server == NULL) { 
                return dcerpc_pipe_connect(ctx, p, "ncalrpc", 
-                                          DCERPC_IREMOTEACTIVATION_UUID, 
-                                          DCERPC_IREMOTEACTIVATION_VERSION,
-                                          ctx->dcom->credentials, ctx->event_ctx);
+                                                                  &dcerpc_table_IRemoteActivation,
+                                                                  ctx->dcom->credentials, ctx->event_ctx);
        }
 
        /* Allow server name to contain a binding string */
        if (NT_STATUS_IS_OK(dcerpc_parse_binding(mem_ctx, server, &bd))) {
                status = dcerpc_pipe_connect_b(ctx, p, bd, 
-                                              DCERPC_IREMOTEACTIVATION_UUID, 
-                                              DCERPC_IREMOTEACTIVATION_VERSION, 
-                                              ctx->dcom->credentials, ctx->event_ctx);
+                                                                          &dcerpc_table_IRemoteActivation,
+                                                                  ctx->dcom->credentials, ctx->event_ctx);
 
                talloc_free(mem_ctx);
                return status;
@@ -107,8 +105,7 @@ static NTSTATUS dcom_connect_host(struct com_context *ctx, struct dcerpc_pipe **
                }
                
                status = dcerpc_pipe_connect(ctx, p, binding, 
-                                            DCERPC_IREMOTEACTIVATION_UUID, 
-                                            DCERPC_IREMOTEACTIVATION_VERSION, 
+                                                                        &dcerpc_table_IRemoteActivation,
                                             ctx->dcom->credentials, ctx->event_ctx);
 
                if (NT_STATUS_IS_OK(status)) {
@@ -282,7 +279,11 @@ NTSTATUS dcom_get_pipe(struct IUnknown *iface, struct dcerpc_pipe **pp)
                if (!GUID_equal(&p->syntax.uuid, &iid)) {
                        struct dcerpc_pipe *p2;
                        ox->pipe->syntax.uuid = iid;
-                       status = dcerpc_secondary_context(p, &p2, uuid, 0);
+
+                       /* interface will always be present, so 
+                        * idl_iface_by_uuid can't return NULL */
+                       status = dcerpc_secondary_context(p, &p2, idl_iface_by_uuid(uuid));
+
                        if (NT_STATUS_IS_OK(status)) {
                                p = p2;
                        }
@@ -301,13 +302,10 @@ NTSTATUS dcom_get_pipe(struct IUnknown *iface, struct dcerpc_pipe **pp)
                if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(1, ("Error parsing string binding"));
                } else {
-                       /* TODO: jelmer, please look at this. The
-                          "NULL" here should be a real event
-                          context */
                        status = dcerpc_pipe_connect_b(NULL, &p, binding, 
-                                                      uuid, 0.0, 
+                                                      idl_iface_by_uuid(uuid),
                                                       iface->ctx->dcom->credentials,
-                                                      NULL);
+                                                          iface->ctx->event_ctx);
                }
                talloc_free(binding);
                i++;
index 81f002daa2291647dc79573286337833adf90f60..e799b3a8e4a3a7af8721a3e66234cc4da458d093 100644 (file)
@@ -371,8 +371,7 @@ WERROR reg_open_remote(struct registry_context **ctx, struct cli_credentials *cr
 
        status = dcerpc_pipe_connect(*ctx /* TALLOC_CTX */, 
                                     &p, location, 
-                                    DCERPC_WINREG_UUID,
-                                    DCERPC_WINREG_VERSION,
+                                        &dcerpc_table_winreg,
                                     credentials, ev);
        (*ctx)->backend_data = p;
 
index f5de5014e34f07d18de4eb303017ffd499d005ae..3c7850b7fd6f7ce7b3f87266cd463113438d56ca 100644 (file)
@@ -90,7 +90,7 @@ static NTSTATUS smblsa_connect(struct smbcli_state *cli)
        }
 
        /* bind to the LSA pipe */
-       status = dcerpc_bind_auth_none(lsa->pipe, DCERPC_LSARPC_UUID, DCERPC_LSARPC_VERSION);
+       status = dcerpc_bind_auth_none(lsa->pipe, &dcerpc_table_lsarpc);
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(lsa);
                 return status;
index 28d12247c9fd14ce04c6c22ed6ea4f7fcc3f0bb1..11e1dfc17576465b440e960a57b3e4fc9482de3b 100644 (file)
@@ -274,8 +274,7 @@ static NTSTATUS libnet_JoinADSDomain(struct libnet_context *ctx, struct libnet_J
        status = dcerpc_pipe_connect_b(tmp_ctx, 
                                       &drsuapi_pipe,
                                       drsuapi_binding,
-                                      DCERPC_DRSUAPI_UUID,
-                                      DCERPC_DRSUAPI_VERSION, 
+                                          &dcerpc_table_drsuapi,
                                       ctx->cred, 
                                       ctx->event_ctx);
        if (!NT_STATUS_IS_OK(status)) {
@@ -644,9 +643,7 @@ NTSTATUS libnet_JoinDomain(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, stru
                c->level             = LIBNET_RPC_CONNECT_BINDING;
                c->in.binding        = r->in.binding;
        }
-       c->in.dcerpc_iface_name      = DCERPC_LSARPC_NAME;
-       c->in.dcerpc_iface_uuid      = DCERPC_LSARPC_UUID;
-       c->in.dcerpc_iface_version   = DCERPC_LSARPC_VERSION;
+       c->in.dcerpc_iface      = &dcerpc_table_lsarpc;
        
        /* connect to the LSA pipe of the PDC */
 
@@ -761,7 +758,7 @@ NTSTATUS libnet_JoinDomain(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, stru
 
        /* Make binding string for samr, not the other pipe */
        status = dcerpc_epm_map_binding(tmp_ctx, samr_binding,                                  
-                                       DCERPC_SAMR_UUID, DCERPC_SAMR_VERSION,
+                                       &dcerpc_table_samr,
                                        lsa_pipe->conn->event_ctx);
        if (!NT_STATUS_IS_OK(status)) {
                r->out.error_string = talloc_asprintf(mem_ctx,
@@ -782,8 +779,7 @@ NTSTATUS libnet_JoinDomain(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, stru
                return status;
        }
 
-       status = dcerpc_pipe_auth(samr_pipe, samr_binding, DCERPC_SAMR_UUID, 
-                                 DCERPC_SAMR_VERSION, ctx->cred);
+       status = dcerpc_pipe_auth(samr_pipe, samr_binding, &dcerpc_table_samr, ctx->cred);
        if (!NT_STATUS_IS_OK(status)) {
                r->out.error_string = talloc_asprintf(mem_ctx,
                                                "SAMR bind failed: %s",
index cdd5043cb881f36e563f127c3fde180affd55e6c..db54935a78f2d8f7e5d5656757c4372f558603fe 100644 (file)
@@ -54,9 +54,7 @@ static NTSTATUS libnet_ChangePassword_samr(struct libnet_context *ctx, TALLOC_CT
        /* prepare connect to the SAMR pipe of the users domain PDC */
        c.level                    = LIBNET_RPC_CONNECT_PDC;
        c.in.domain_name           = r->samr.in.domain_name;
-       c.in.dcerpc_iface_name     = DCERPC_SAMR_NAME;
-       c.in.dcerpc_iface_uuid     = DCERPC_SAMR_UUID;
-       c.in.dcerpc_iface_version  = DCERPC_SAMR_VERSION;
+       c.in.dcerpc_iface          = &dcerpc_table_samr;
 
        /* 1. connect to the SAMR pipe of users domain PDC (maybe a standalone server or workstation) */
        status = libnet_RpcConnect(ctx, mem_ctx, &c);
@@ -517,9 +515,7 @@ static NTSTATUS libnet_SetPassword_samr(struct libnet_context *ctx, TALLOC_CTX *
        /* prepare connect to the SAMR pipe of users domain PDC */
        c.level                     = LIBNET_RPC_CONNECT_PDC;
        c.in.domain_name            = r->samr.in.domain_name;
-       c.in.dcerpc_iface_name      = DCERPC_SAMR_NAME;
-       c.in.dcerpc_iface_uuid      = DCERPC_SAMR_UUID;
-       c.in.dcerpc_iface_version   = DCERPC_SAMR_VERSION;
+       c.in.dcerpc_iface               = &dcerpc_table_samr;
 
        /* 1. connect to the SAMR pipe of users domain PDC (maybe a standalone server or workstation) */
        status = libnet_RpcConnect(ctx, mem_ctx, &c);
index e926fc3778c415eb58968c252cae779253d86fc5..6b94734f9b0b63203c7ddffae732ad3f8e6bf30d 100644 (file)
@@ -51,13 +51,13 @@ static NTSTATUS libnet_RpcConnectSrv(struct libnet_context *ctx, TALLOC_CTX *mem
 
        /* connect to remote dcerpc pipe */
        status = dcerpc_pipe_connect(mem_ctx, &r->out.dcerpc_pipe,
-                                    binding, r->in.dcerpc_iface_uuid, r->in.dcerpc_iface_version,
+                                    binding, r->in.dcerpc_iface,
                                     ctx->cred, ctx->event_ctx);
 
        if (!NT_STATUS_IS_OK(status)) {
                r->out.error_string = talloc_asprintf(mem_ctx,
                                                      "dcerpc_pipe_connect to pipe %s failed with %s\n",
-                                                     r->in.dcerpc_iface_name, binding);
+                                                     r->in.dcerpc_iface->name, binding);
                return status;
        }
 
@@ -98,9 +98,7 @@ static NTSTATUS libnet_RpcConnectPdc(struct libnet_context *ctx, TALLOC_CTX *mem
        /* ok, pdc has been found so do attempt to rpc connect */
        r2.level                    = LIBNET_RPC_CONNECT_SERVER;
        r2.in.domain_name           = talloc_strdup(mem_ctx, f.out.address[0]);
-       r2.in.dcerpc_iface_name     = r->in.dcerpc_iface_name;
-       r2.in.dcerpc_iface_uuid     = r->in.dcerpc_iface_uuid;
-       r2.in.dcerpc_iface_version  = r->in.dcerpc_iface_version;
+       r2.in.dcerpc_iface     = r->in.dcerpc_iface;
        
        status = libnet_RpcConnect(ctx, mem_ctx, &r2);
 
index 708084cf58934e2a1c6d0237129add9cf3fc00d6..d2a83bf642642294e8502f16faf34972dfe9fca3 100644 (file)
@@ -36,9 +36,7 @@ struct libnet_RpcConnect {
        struct {
                const char *domain_name;
                const char *binding;
-               const char *dcerpc_iface_name;
-               const char *dcerpc_iface_uuid;
-               uint32_t dcerpc_iface_version;
+               const struct dcerpc_interface_table *dcerpc_iface;
        } in;
        struct {
                struct dcerpc_pipe *dcerpc_pipe;
index 4b473436e123f79fed2eeb3de9a83809cad7a043..0473658da810ff7f55df84afa9d67150ef09438d 100644 (file)
@@ -34,9 +34,7 @@ NTSTATUS libnet_ListShares(struct libnet_context *ctx,
 
        c.level                      = LIBNET_RPC_CONNECT_SERVER;
        c.in.domain_name             = r->in.server_name;
-       c.in.dcerpc_iface_name       = DCERPC_SRVSVC_NAME;
-       c.in.dcerpc_iface_uuid       = DCERPC_SRVSVC_UUID;
-       c.in.dcerpc_iface_version    = DCERPC_SRVSVC_VERSION;
+       c.in.dcerpc_iface                = &dcerpc_table_srvsvc;
 
        status = libnet_RpcConnect(ctx, mem_ctx, &c);
        if (!NT_STATUS_IS_OK(status)) {
@@ -87,9 +85,7 @@ NTSTATUS libnet_AddShare(struct libnet_context *ctx,
 
        c.level                     = LIBNET_RPC_CONNECT_SERVER;
        c.in.domain_name            = r->in.server_name;
-       c.in.dcerpc_iface_name      = DCERPC_SRVSVC_NAME;
-       c.in.dcerpc_iface_uuid      = DCERPC_SRVSVC_UUID;
-       c.in.dcerpc_iface_version   = DCERPC_SRVSVC_VERSION;
+       c.in.dcerpc_iface               = &dcerpc_table_srvsvc;
 
        status = libnet_RpcConnect(ctx, mem_ctx, &c);
        if (!NT_STATUS_IS_OK(status)) {
@@ -128,9 +124,7 @@ NTSTATUS libnet_DelShare(struct libnet_context *ctx,
 
        c.level                      = LIBNET_RPC_CONNECT_SERVER;
        c.in.domain_name             = r->in.server_name;
-       c.in.dcerpc_iface_name       = DCERPC_SRVSVC_NAME;
-       c.in.dcerpc_iface_uuid       = DCERPC_SRVSVC_UUID;
-       c.in.dcerpc_iface_version    = DCERPC_SRVSVC_VERSION;
+       c.in.dcerpc_iface                = &dcerpc_table_srvsvc;
 
        status = libnet_RpcConnect(ctx, mem_ctx, &c);
        if (!NT_STATUS_IS_OK(status)) {
index 63d63e104f5154fd3fff010ec9a06c800cb42061..655a4755038e9d0a9e2e07e4dba73ef047a89953 100644 (file)
@@ -36,9 +36,7 @@ static NTSTATUS libnet_RemoteTOD_srvsvc(struct libnet_context *ctx, TALLOC_CTX *
        /* prepare connect to the SRVSVC pipe of a timeserver */
        c.level                    = LIBNET_RPC_CONNECT_SERVER;
        c.in.domain_name           = r->srvsvc.in.server_name;
-       c.in.dcerpc_iface_name     = DCERPC_SRVSVC_NAME;
-       c.in.dcerpc_iface_uuid     = DCERPC_SRVSVC_UUID;
-       c.in.dcerpc_iface_version  = DCERPC_SRVSVC_VERSION;
+       c.in.dcerpc_iface          = &dcerpc_table_srvsvc;
 
        /* 1. connect to the SRVSVC pipe of a timeserver */
        status = libnet_RpcConnect(ctx, mem_ctx, &c);
index 379989dd2b8fb05edbc79bbf0fc905065e52e4c1..c8e497a08eb3dbdb98dff2922e0f9f8a704810d6 100644 (file)
@@ -44,9 +44,7 @@ NTSTATUS libnet_CreateUser(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, stru
        /* connect rpc service of remote server */
        cn.level                      = LIBNET_RPC_CONNECT_SERVER;
        cn.in.domain_name             = talloc_strdup(mem_ctx, *fp.out.address);
-       cn.in.dcerpc_iface_name       = DCERPC_SAMR_NAME;
-       cn.in.dcerpc_iface_uuid       = DCERPC_SAMR_UUID;
-       cn.in.dcerpc_iface_version    = DCERPC_SAMR_VERSION;
+       cn.in.dcerpc_iface       = &dcerpc_table_samr;
 
        status = libnet_RpcConnect(ctx, mem_ctx, &cn);
        if (!NT_STATUS_IS_OK(status)) {
index 80da646200f4fc70141202636c56636d016cf139..d0b7722c08ce5009b18fc7ff0a94ece7c12fcefd 100644 (file)
@@ -212,8 +212,7 @@ NTSTATUS libnet_SamSync_netlogon(struct libnet_context *ctx, TALLOC_CTX *mem_ctx
 
        /* Setup schannel */
        nt_status = dcerpc_pipe_connect_b(samsync_ctx, &p, b, 
-                                         DCERPC_NETLOGON_UUID,
-                                         DCERPC_NETLOGON_VERSION,
+                                                                         &dcerpc_table_netlogon,
                                          machine_account, ctx->event_ctx);
 
        if (!NT_STATUS_IS_OK(nt_status)) {
index d8fb3e4e6a3b96a3faef2f2e078c1f79f913948f..b947b4aa5c2260617f7b16c748ec616f802c2ad1 100644 (file)
@@ -790,16 +790,16 @@ NTSTATUS dcerpc_auth3(struct dcerpc_connection *c,
 /*
   return the rpc syntax and transfer syntax given the pipe uuid and version
 */
-NTSTATUS dcerpc_init_syntaxes(const char *uuid, uint_t version,
+NTSTATUS dcerpc_init_syntaxes(const struct dcerpc_interface_table *table,
                              struct dcerpc_syntax_id *syntax,
                              struct dcerpc_syntax_id *transfer_syntax)
 {
        NTSTATUS status;
 
-       status = GUID_from_string(uuid, &syntax->uuid);
+       status = GUID_from_string(table->uuid, &syntax->uuid);
        if (!NT_STATUS_IS_OK(status)) return status;
 
-       syntax->if_version = version;
+       syntax->if_version = table->if_version;
 
        status = GUID_from_string(NDR_GUID, &transfer_syntax->uuid);
        if (!NT_STATUS_IS_OK(status)) return status;
@@ -812,13 +812,13 @@ NTSTATUS dcerpc_init_syntaxes(const char *uuid, uint_t version,
 /* perform a dcerpc bind, using the uuid as the key */
 NTSTATUS dcerpc_bind_byuuid(struct dcerpc_pipe *p, 
                            TALLOC_CTX *mem_ctx,
-                           const char *uuid, uint_t version)
+                           const struct dcerpc_interface_table *table)
 {
        struct dcerpc_syntax_id syntax;
        struct dcerpc_syntax_id transfer_syntax;
        NTSTATUS status;
 
-       status = dcerpc_init_syntaxes(uuid, version,
+       status = dcerpc_init_syntaxes(table,
                                      &syntax, &transfer_syntax);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(2,("Invalid uuid string in dcerpc_bind_byuuid\n"));
index 142b2287b6ed89a5069bae1f2e566f1d061af303..263121eaefcc86385cb89e7bd2ecbe4933eaf432 100644 (file)
@@ -198,9 +198,8 @@ struct dcerpc_binding {
 struct dcerpc_pipe_connect {
        struct dcerpc_pipe *pipe;
        struct dcerpc_binding *binding;
-       const char *pipe_uuid;
        const char *pipe_name;
-       uint32_t pipe_version;
+       const struct dcerpc_interface_table *interface;
        struct cli_credentials *creds;
 };
 
index dcf3334212786018d35a7627e883675c9288c845..c66384a3cfc0e20e1b3e5732b3440b8825f48738 100644 (file)
@@ -31,8 +31,7 @@
 
 struct composite_context *dcerpc_bind_auth_none_send(TALLOC_CTX *mem_ctx,
                                                     struct dcerpc_pipe *p,
-                                                    const char *uuid,
-                                                    uint_t version)
+                                                        const struct dcerpc_interface_table *table)
 {
        struct dcerpc_syntax_id syntax;
        struct dcerpc_syntax_id transfer_syntax;
@@ -42,7 +41,7 @@ struct composite_context *dcerpc_bind_auth_none_send(TALLOC_CTX *mem_ctx,
        c = talloc_zero(mem_ctx, struct composite_context);
        if (c == NULL) return NULL;
 
-       c->status = dcerpc_init_syntaxes(uuid, version,
+       c->status = dcerpc_init_syntaxes(table,
                                         &syntax, &transfer_syntax);
        if (!NT_STATUS_IS_OK(c->status)) {
                DEBUG(2,("Invalid uuid string in "
@@ -63,10 +62,10 @@ NTSTATUS dcerpc_bind_auth_none_recv(struct composite_context *ctx)
 }
 
 NTSTATUS dcerpc_bind_auth_none(struct dcerpc_pipe *p,
-                              const char *uuid, uint_t version)
+                              const struct dcerpc_interface_table *table)
 {
        struct composite_context *ctx;
-       ctx = dcerpc_bind_auth_none_send(p, p, uuid, version);
+       ctx = dcerpc_bind_auth_none_send(p, p, table);
        return dcerpc_bind_auth_none_recv(ctx);
 }
 
@@ -166,7 +165,7 @@ static void bind_auth_recv_bindreply(struct composite_context *creq)
 
 struct composite_context *dcerpc_bind_auth_send(TALLOC_CTX *mem_ctx,
                                                struct dcerpc_pipe *p,
-                                               const char *uuid, uint_t version,
+                                               const struct dcerpc_interface_table *table,
                                                struct cli_credentials *credentials,
                                                uint8_t auth_type,
                                                const char *service)
@@ -192,7 +191,7 @@ struct composite_context *dcerpc_bind_auth_send(TALLOC_CTX *mem_ctx,
 
        state->pipe = p;
 
-       c->status = dcerpc_init_syntaxes(uuid, version,
+       c->status = dcerpc_init_syntaxes(table,
                                         &syntax,
                                         &transfer_syntax);
        if (!NT_STATUS_IS_OK(c->status)) goto failed;
@@ -321,13 +320,13 @@ NTSTATUS dcerpc_bind_auth_recv(struct composite_context *creq)
   setup GENSEC on a DCE-RPC pipe
 */
 NTSTATUS dcerpc_bind_auth(struct dcerpc_pipe *p,
-                         const char *uuid, uint_t version,
+                         const struct dcerpc_interface_table *table,
                          struct cli_credentials *credentials,
                          uint8_t auth_type,
                          const char *service)
 {
        struct composite_context *creq;
-       creq = dcerpc_bind_auth_send(p, p, uuid, version, credentials,
+       creq = dcerpc_bind_auth_send(p, p, table, credentials,
                                     auth_type, service);
        return dcerpc_bind_auth_recv(creq);
 }
index e9e31f294f5c7d193d1282500db765524bdcb05b..d6971612f237e1cd7d126772bea778d25810eaf8 100644 (file)
@@ -65,7 +65,7 @@ static NTSTATUS dcerpc_schannel_key(TALLOC_CTX *tmp_ctx,
 
        /* Make binding string for netlogon, not the other pipe */
        status = dcerpc_epm_map_binding(tmp_ctx, b, 
-                                       DCERPC_NETLOGON_UUID, DCERPC_NETLOGON_VERSION,
+                                                                       &dcerpc_table_netlogon,
                                        p->conn->event_ctx);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0,("Failed to map DCERPC/TCP NCACN_NP pipe for '%s' - %s\n", 
@@ -78,8 +78,7 @@ static NTSTATUS dcerpc_schannel_key(TALLOC_CTX *tmp_ctx,
                return status;
        }
 
-       status = dcerpc_bind_auth_none(p2, DCERPC_NETLOGON_UUID, 
-                                      DCERPC_NETLOGON_VERSION);
+       status = dcerpc_bind_auth_none(p2, &dcerpc_table_netlogon);
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(p2);
                 return status;
@@ -142,7 +141,7 @@ static NTSTATUS dcerpc_schannel_key(TALLOC_CTX *tmp_ctx,
 
 NTSTATUS dcerpc_bind_auth_schannel(TALLOC_CTX *tmp_ctx, 
                                   struct dcerpc_pipe *p,
-                                  const char *uuid, uint_t version,
+                                  const struct dcerpc_interface_table *table,
                                   struct cli_credentials *credentials)
 {
        NTSTATUS status;
@@ -158,8 +157,7 @@ NTSTATUS dcerpc_bind_auth_schannel(TALLOC_CTX *tmp_ctx,
                return status;
        }
 
-       return dcerpc_bind_auth(p, uuid, version, 
-                               credentials, DCERPC_AUTH_TYPE_SCHANNEL,
+       return dcerpc_bind_auth(p, table, credentials, DCERPC_AUTH_TYPE_SCHANNEL,
                                NULL);
 }
 
index 72975461d009f687a7a853519bf8d083420ec260..039c3a6a453cf929fddcb6cee7b0177c5cb18dec 100644 (file)
@@ -823,7 +823,7 @@ NTSTATUS dcerpc_binding_build_tower(TALLOC_CTX *mem_ctx, struct dcerpc_binding *
 }
 
 NTSTATUS dcerpc_epm_map_binding(TALLOC_CTX *mem_ctx, struct dcerpc_binding *binding,
-                               const char *uuid, uint_t version, struct event_context *ev)
+                               const struct dcerpc_interface_table *table, struct event_context *ev)
 {
        struct dcerpc_pipe *p;
        NTSTATUS status;
@@ -832,7 +832,6 @@ NTSTATUS dcerpc_epm_map_binding(TALLOC_CTX *mem_ctx, struct dcerpc_binding *bind
        struct GUID guid;
        struct epm_twr_t twr, *twr_r;
        struct dcerpc_binding *epmapper_binding;
-       const struct dcerpc_interface_table *table = idl_iface_by_uuid(uuid);
        int i;
 
        struct cli_credentials *anon_creds
@@ -879,8 +878,7 @@ NTSTATUS dcerpc_epm_map_binding(TALLOC_CTX *mem_ctx, struct dcerpc_binding *bind
        status = dcerpc_pipe_connect_b(mem_ctx, 
                                       &p,
                                       epmapper_binding,
-                                      DCERPC_EPMAPPER_UUID,
-                                      DCERPC_EPMAPPER_VERSION,
+                                          &dcerpc_table_epmapper,
                                       anon_creds, ev);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -890,12 +888,12 @@ NTSTATUS dcerpc_epm_map_binding(TALLOC_CTX *mem_ctx, struct dcerpc_binding *bind
        ZERO_STRUCT(handle);
        ZERO_STRUCT(guid);
 
-       status = GUID_from_string(uuid, &binding->object);
+       status = GUID_from_string(table->uuid, &binding->object);
        if (NT_STATUS_IS_ERR(status)) {
                return status;
        }
 
-       binding->object_version = version;
+       binding->object_version = table->if_version;
 
        status = dcerpc_binding_build_tower(p, binding, &twr.tower);
        if (NT_STATUS_IS_ERR(status)) {
@@ -944,8 +942,7 @@ NTSTATUS dcerpc_epm_map_binding(TALLOC_CTX *mem_ctx, struct dcerpc_binding *bind
 */
 NTSTATUS dcerpc_pipe_auth(struct dcerpc_pipe *p, 
                          struct dcerpc_binding *binding,
-                         const char *pipe_uuid, 
-                         uint32_t pipe_version,
+                         const struct dcerpc_interface_table *table,
                          struct cli_credentials *credentials)
 {
        NTSTATUS status;
@@ -964,9 +961,7 @@ NTSTATUS dcerpc_pipe_auth(struct dcerpc_pipe *p,
                /* If we don't already have netlogon credentials for
                 * the schannel bind, then we have to get these
                 * first */
-               status = dcerpc_bind_auth_schannel(tmp_ctx, 
-                                                  p, pipe_uuid, pipe_version, 
-                                                  credentials);
+               status = dcerpc_bind_auth_schannel(tmp_ctx, p, table, credentials);
        } else if (!cli_credentials_is_anonymous(credentials) &&
                !(binding->transport == NCACN_NP &&
                  !(binding->flags & DCERPC_SIGN) &&
@@ -1001,15 +996,15 @@ NTSTATUS dcerpc_pipe_auth(struct dcerpc_pipe *p,
                        auth_type = DCERPC_AUTH_TYPE_NTLMSSP;
                }
 
-               status = dcerpc_bind_auth(p, pipe_uuid, pipe_version, 
+               status = dcerpc_bind_auth(p, table,
                                          credentials, auth_type,
                                          binding->authservice);
        } else {
-               status = dcerpc_bind_auth_none(p, pipe_uuid, pipe_version);
+               status = dcerpc_bind_auth_none(p, table);
        }
 
        if (!NT_STATUS_IS_OK(status)) {
-               DEBUG(0,("Failed to bind to uuid %s - %s\n", pipe_uuid, nt_errstr(status)));
+               DEBUG(0,("Failed to bind to uuid %s - %s\n", table->uuid, nt_errstr(status)));
        }
        talloc_free(tmp_ctx);
        return status;
@@ -1034,8 +1029,7 @@ static NTSTATUS dcerpc_pipe_connect_ncacn_np(TALLOC_CTX *tmp_ctx,
 static NTSTATUS dcerpc_pipe_connect_ncalrpc(TALLOC_CTX *tmp_ctx, 
                                            struct dcerpc_pipe *p, 
                                            struct dcerpc_binding *binding,
-                                           const char *pipe_uuid, 
-                                           uint32_t pipe_version)
+                                               const struct dcerpc_interface_table *table)
 {
        NTSTATUS status;
 
@@ -1056,8 +1050,7 @@ static NTSTATUS dcerpc_pipe_connect_ncalrpc(TALLOC_CTX *tmp_ctx,
 static NTSTATUS dcerpc_pipe_connect_ncacn_unix_stream(TALLOC_CTX *tmp_ctx, 
                                                      struct dcerpc_pipe *p, 
                                                      struct dcerpc_binding *binding,
-                                                     const char *pipe_uuid, 
-                                                     uint32_t pipe_version)
+                                                         const struct dcerpc_interface_table *table)
 {
        NTSTATUS status;
 
@@ -1071,7 +1064,7 @@ static NTSTATUS dcerpc_pipe_connect_ncacn_unix_stream(TALLOC_CTX *tmp_ctx,
                DEBUG(0,("Failed to open unix socket %s - %s\n", 
                         binding->endpoint, nt_errstr(status)));
                talloc_free(p);
-                return status;
+        return status;
        }
 
        return status;
@@ -1082,8 +1075,7 @@ static NTSTATUS dcerpc_pipe_connect_ncacn_unix_stream(TALLOC_CTX *tmp_ctx,
 static NTSTATUS dcerpc_pipe_connect_ncacn_ip_tcp(TALLOC_CTX *tmp_ctx, 
                                                 struct dcerpc_pipe *p, 
                                                 struct dcerpc_binding *binding,
-                                                const char *pipe_uuid, 
-                                                uint32_t pipe_version)
+                                                const struct dcerpc_interface_table *table)
 {
        NTSTATUS status;
        uint32_t port = 0;
@@ -1106,8 +1098,7 @@ static NTSTATUS dcerpc_pipe_connect_ncacn_ip_tcp(TALLOC_CTX *tmp_ctx,
 NTSTATUS dcerpc_pipe_connect_b(TALLOC_CTX *parent_ctx, 
                               struct dcerpc_pipe **pp, 
                               struct dcerpc_binding *binding,
-                              const char *pipe_uuid, 
-                              uint32_t pipe_version,
+                                  const struct dcerpc_interface_table *table,
                               struct cli_credentials *credentials,
                               struct event_context *ev)
 {
@@ -1130,12 +1121,11 @@ NTSTATUS dcerpc_pipe_connect_b(TALLOC_CTX *parent_ctx,
        case NCACN_IP_TCP:
        case NCALRPC:
                if (!binding->endpoint) {
-                       status = dcerpc_epm_map_binding(tmp_ctx, binding, 
-                                                       pipe_uuid, pipe_version, 
+                       status = dcerpc_epm_map_binding(tmp_ctx, binding, table,
                                                        p->conn->event_ctx);
                        if (!NT_STATUS_IS_OK(status)) {
                                DEBUG(0,("Failed to map DCERPC endpoint for '%s' - %s\n", 
-                                        pipe_uuid, nt_errstr(status)));
+                                        table->uuid, nt_errstr(status)));
                                return status;
                        }
                        DEBUG(2,("Mapped to DCERPC endpoint %s\n", binding->endpoint));
@@ -1150,8 +1140,7 @@ NTSTATUS dcerpc_pipe_connect_b(TALLOC_CTX *parent_ctx,
 
        pc.pipe          = p;
        pc.binding       = binding;
-       pc.pipe_uuid     = pipe_uuid;
-       pc.pipe_version  = pipe_version;
+       pc.interface     = table;
        pc.creds         = credentials;
 
        switch (binding->transport) {
@@ -1161,15 +1150,15 @@ NTSTATUS dcerpc_pipe_connect_b(TALLOC_CTX *parent_ctx,
 
        case NCACN_IP_TCP:
                status = dcerpc_pipe_connect_ncacn_ip_tcp(tmp_ctx, 
-                                                         p, binding, pipe_uuid, pipe_version);
+                                                         p, binding, table);
                break;
        case NCACN_UNIX_STREAM:
                status = dcerpc_pipe_connect_ncacn_unix_stream(tmp_ctx, 
-                                                              p, binding, pipe_uuid, pipe_version);
+                                                              p, binding, table);
                break;
        case NCALRPC:
                status = dcerpc_pipe_connect_ncalrpc(tmp_ctx, 
-                                                    p, binding, pipe_uuid, pipe_version);
+                                                    p, binding, table);
                break;
        default:
                return NT_STATUS_NOT_SUPPORTED;
@@ -1180,7 +1169,7 @@ NTSTATUS dcerpc_pipe_connect_b(TALLOC_CTX *parent_ctx,
                return status;
        }
 
-       status = dcerpc_pipe_auth(p, binding, pipe_uuid, pipe_version, credentials);
+       status = dcerpc_pipe_auth(p, binding, table, credentials);
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(p);
                return status;
@@ -1196,9 +1185,8 @@ NTSTATUS dcerpc_pipe_connect_b(TALLOC_CTX *parent_ctx,
    binding to determine the endpoint and options */
 NTSTATUS dcerpc_pipe_connect(TALLOC_CTX *parent_ctx, 
                             struct dcerpc_pipe **pp, 
-                            const char *binding,
-                            const char *pipe_uuid, 
-                            uint32_t pipe_version,
+                                const char *binding,
+                                const struct dcerpc_interface_table *table,
                             struct cli_credentials *credentials,
                             struct event_context *ev)
 {
@@ -1220,9 +1208,7 @@ NTSTATUS dcerpc_pipe_connect(TALLOC_CTX *parent_ctx,
 
        DEBUG(3,("Using binding %s\n", dcerpc_binding_string(tmp_ctx, b)));
 
-       status = dcerpc_pipe_connect_b(tmp_ctx,
-                                      pp, b, pipe_uuid, pipe_version, 
-                                      credentials, ev);
+       status = dcerpc_pipe_connect_b(tmp_ctx, pp, b, table, credentials, ev);
 
        if (NT_STATUS_IS_OK(status)) {
                *pp = talloc_steal(parent_ctx, *pp);
@@ -1344,8 +1330,7 @@ void dcerpc_log_packet(const struct dcerpc_interface_table *ndr,
 */
 NTSTATUS dcerpc_secondary_context(struct dcerpc_pipe *p, 
                                  struct dcerpc_pipe **pp2,
-                                 const char *pipe_uuid,
-                                 uint32_t pipe_version)
+                                 const struct dcerpc_interface_table *table)
 {
        NTSTATUS status;
        struct dcerpc_pipe *p2;
@@ -1359,12 +1344,12 @@ NTSTATUS dcerpc_secondary_context(struct dcerpc_pipe *p,
 
        p2->context_id = ++p->conn->next_context_id;
 
-       status = GUID_from_string(pipe_uuid, &p2->syntax.uuid);
+       status = GUID_from_string(table->uuid, &p2->syntax.uuid);
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(p2);
                return status;
        }
-       p2->syntax.if_version = pipe_version;
+       p2->syntax.if_version = table->if_version;
 
        status = GUID_from_string(NDR_GUID, &p2->transfer_syntax.uuid);
        if (!NT_STATUS_IS_OK(status)) {
index 9ba2419859b4dc6a46f133678cf84db098075730..b4f45614f1317e1f2e205de9d12b83e3cc4b8899 100644 (file)
@@ -31,6 +31,7 @@ struct dcesrv_remote_private {
 static NTSTATUS remote_op_bind(struct dcesrv_call_state *dce_call, const struct dcesrv_interface *iface)
 {
         NTSTATUS status;
+               const struct dcerpc_interface_table *table;
         struct dcesrv_remote_private *private;
        const char *binding = lp_parm_string(-1, "dcerpc_remote", "binding");
        const char *user, *pass, *domain;
@@ -48,7 +49,7 @@ static NTSTATUS remote_op_bind(struct dcesrv_call_state *dce_call, const struct
        dce_call->context->private = private;
 
        if (!binding) {
-               DEBUG(0,("You must specify a ncacn binding string\n"));
+               DEBUG(0,("You must specify a DCE/RPC binding string\n"));
                return NT_STATUS_INVALID_PARAMETER;
        }
 
@@ -56,6 +57,12 @@ static NTSTATUS remote_op_bind(struct dcesrv_call_state *dce_call, const struct
        pass = lp_parm_string(-1, "dcerpc_remote", "password");
        domain = lp_parm_string(-1, "dceprc_remote", "domain");
 
+       table = idl_iface_by_uuid(iface->uuid); /* FIXME: What about if_version ? */
+       if (!table) {
+               dce_call->fault_code = DCERPC_FAULT_UNK_IF;
+               return NT_STATUS_NET_WRITE_FAULT;
+       }
+
        if (user && pass) {
                DEBUG(5, ("dcerpc_remote: RPC Proxy: Using specified account\n"));
                credentials = cli_credentials_init(private);
@@ -88,8 +95,7 @@ static NTSTATUS remote_op_bind(struct dcesrv_call_state *dce_call, const struct
        }
 
        status = dcerpc_pipe_connect(private, 
-                                    &(private->c_pipe), binding, 
-                                    iface->uuid, iface->if_version, 
+                                    &(private->c_pipe), binding, table,
                                     credentials, dce_call->event_ctx);
 
        talloc_free(credentials);
@@ -272,13 +278,10 @@ static BOOL remote_op_interface_by_uuid(struct dcesrv_interface *iface, const ch
 
 static BOOL remote_op_interface_by_name(struct dcesrv_interface *iface, const char *name)
 {
-       const struct dcerpc_interface_list *l;
+       const struct dcerpc_interface_table *tbl = idl_iface_by_name(name);
 
-       for (l=librpc_dcerpc_pipes();l;l=l->next) {
-               if (strcmp(l->table->name, name)==0) {
-                       return remote_fill_interface(iface, l->table);
-               }
-       }
+       if (tbl)
+               return remote_fill_interface(iface, tbl);
 
        return False;   
 }
index 6d2d4119574c714625609c3baa6c93dcbd5e734d..dff04a4c404ea812d49efc2ed9047c01c28dd390 100644 (file)
@@ -153,9 +153,7 @@ static int ejs_rpc_connect(MprVarHandle eid, int argc, char **argv)
 
        ev = event_context_find(mprMemCtx());
 
-       status = dcerpc_pipe_connect(this, &p, binding, 
-                                    iface->uuid, iface->if_version, 
-                                    creds, ev);
+       status = dcerpc_pipe_connect(this, &p, binding, iface, creds, ev);
        if (!NT_STATUS_IS_OK(status)) goto done;
 
        /* callers don't allocate ref vars in the ejs interface */
index f5b2a1254d7e4cc9a68a6cc3b43710e3e0fbe84b..55356b24476a5e6082c8f91910d4b6467ada7e97 100644 (file)
@@ -24,7 +24,6 @@
 #include "includes.h"
 #include "asn_1.h"
 #include "libcli/ldap/ldap.h"
-#include "auth/gensec/gensec.h"
 
 NTSTATUS torture_ldap_bind(struct ldap_connection *conn, const char *userdn, const char *password)
 {
index 98c44cd942f0e275792bcc49889fd985dac9a69d..7f8600d2dd2c60044486ad5fc618c3eeaa35af8d 100644 (file)
@@ -83,9 +83,7 @@ BOOL torture_domainopen(void)
 
        status = torture_rpc_connection(mem_ctx, 
                                        &p,
-                                       DCERPC_SAMR_NAME,
-                                       DCERPC_SAMR_UUID,
-                                       DCERPC_SAMR_VERSION);
+                                       &dcerpc_table_samr);
        
        if (!NT_STATUS_IS_OK(status)) {
                return False;
index 4cd04ecb429286c8b785f575d5510ededf4462a7..071fe990043d85073b1e18832743677a3dd558bf 100644 (file)
@@ -31,15 +31,13 @@ BOOL test_lsa_connect(struct libnet_context *ctx)
        struct libnet_RpcConnect connect;
        connect.level                     = LIBNET_RPC_CONNECT_PDC;
        connect.in.domain_name            = lp_workgroup();
-       connect.in.dcerpc_iface_name      = DCERPC_LSARPC_NAME;
-       connect.in.dcerpc_iface_uuid      = DCERPC_LSARPC_UUID;
-       connect.in.dcerpc_iface_version   = DCERPC_LSARPC_VERSION;
+       connect.in.dcerpc_iface                   = &dcerpc_table_lsarpc;
 
        status = libnet_RpcConnect(ctx, ctx, &connect);
 
        if (!NT_STATUS_IS_OK(status)) {
                printf("Couldn't connect to rpc service %s on %s: %s\n",
-                      connect.in.dcerpc_iface_name, connect.in.domain_name,
+                      connect.in.dcerpc_iface->name, connect.in.domain_name,
                       nt_errstr(status));
 
                return False;
@@ -55,15 +53,13 @@ BOOL test_samr_connect(struct libnet_context *ctx)
        struct libnet_RpcConnect connect;
        connect.level                     = LIBNET_RPC_CONNECT_PDC;
        connect.in.domain_name            = lp_workgroup();
-       connect.in.dcerpc_iface_name      = DCERPC_SAMR_NAME;
-       connect.in.dcerpc_iface_uuid      = DCERPC_SAMR_UUID;
-       connect.in.dcerpc_iface_version   = DCERPC_SAMR_VERSION;
+       connect.in.dcerpc_iface           = &dcerpc_table_samr;
 
        status = libnet_RpcConnect(ctx, ctx, &connect);
 
        if (!NT_STATUS_IS_OK(status)) {
                printf("Couldn't connect to rpc service %s on %s: %s\n",
-                      connect.in.dcerpc_iface_name, connect.in.domain_name,
+                      connect.in.dcerpc_iface->name, connect.in.domain_name,
                       nt_errstr(status));
 
                return False;
index 3d770b4ca10f4bca950568b6e2ce190d42b3732f..1f0f5eacd37312cc7178b517641d8876e3d32c14 100644 (file)
@@ -218,9 +218,7 @@ BOOL torture_delshare(void)
 
        status = torture_rpc_connection(mem_ctx,
                                        &p,
-                                       DCERPC_SRVSVC_NAME,
-                                       DCERPC_SRVSVC_UUID,
-                                       DCERPC_SRVSVC_VERSION);
+                                       &dcerpc_table_srvsvc);
 
        if (!test_addshare(p, mem_ctx, host, TEST_SHARENAME)) {
                ret = False;
index 63724bc8b1e92d48a902c78ea090fee3c2135263..b987bd5c218fe52066879f13056ef5ee74f1269b 100644 (file)
@@ -279,9 +279,7 @@ BOOL torture_userinfo(void)
 
        status = torture_rpc_connection(mem_ctx, 
                                        &p,
-                                       DCERPC_SAMR_NAME,
-                                       DCERPC_SAMR_UUID,
-                                       DCERPC_SAMR_VERSION);
+                                       &dcerpc_table_samr);
        
        if (!NT_STATUS_IS_OK(status)) {
                return False;
index fc2a32c913fdaaccf15c3f026e1d6784f519adcd..6ec5d9a7b7b34d7d3bce92bd39e6379c23abfe58 100644 (file)
@@ -313,9 +313,7 @@ BOOL torture_useradd(void)
 
        status = torture_rpc_connection(mem_ctx, 
                                        &p,
-                                       DCERPC_SAMR_NAME,
-                                       DCERPC_SAMR_UUID,
-                                       DCERPC_SAMR_VERSION);
+                                       &dcerpc_table_samr);
        
        if (!NT_STATUS_IS_OK(status)) {
                return False;
@@ -374,9 +372,7 @@ BOOL torture_userdel(void)
 
        status = torture_rpc_connection(mem_ctx, 
                                        &p,
-                                       DCERPC_SAMR_NAME,
-                                       DCERPC_SAMR_UUID,
-                                       DCERPC_SAMR_VERSION);
+                                       &dcerpc_table_samr);
        
        if (!NT_STATUS_IS_OK(status)) {
                return False;
@@ -437,9 +433,7 @@ BOOL torture_usermod(void)
 
        status = torture_rpc_connection(mem_ctx, 
                                        &p,
-                                       DCERPC_SAMR_NAME,
-                                       DCERPC_SAMR_UUID,
-                                       DCERPC_SAMR_VERSION);
+                                       &dcerpc_table_samr);
        
        if (!NT_STATUS_IS_OK(status)) {
                return False;
index 0b2c324d36a8c2ecded4e10eb9025ec5a1c08fc6..a85a8504721894678c274b02912387b29cd1988e 100644 (file)
@@ -32,16 +32,14 @@ BOOL torture_rpc_alter_context(void)
        TALLOC_CTX *mem_ctx;
        BOOL ret = True;
        struct policy_handle *handle;
+       struct dcerpc_interface_table tmptbl;
        struct dcerpc_syntax_id syntax;
        struct dcerpc_syntax_id transfer_syntax;
 
        mem_ctx = talloc_init("torture_rpc_alter_context");
 
        printf("opening LSA connection\n");
-       status = torture_rpc_connection(mem_ctx, &p, 
-                                       DCERPC_LSARPC_NAME, 
-                                       DCERPC_LSARPC_UUID, 
-                                       DCERPC_LSARPC_VERSION);
+       status = torture_rpc_connection(mem_ctx, &p, &dcerpc_table_lsarpc);
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(mem_ctx);
                return False;
@@ -52,15 +50,17 @@ BOOL torture_rpc_alter_context(void)
        }
 
        printf("Opening secondary DSSETUP context\n");
-       status = dcerpc_secondary_context(p, &p2, DCERPC_DSSETUP_UUID, DCERPC_DSSETUP_VERSION);
+       status = dcerpc_secondary_context(p, &p2, &dcerpc_table_dssetup);
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(mem_ctx);
                printf("dcerpc_alter_context failed - %s\n", nt_errstr(status));
                return False;
        }
 
+       tmptbl = dcerpc_table_dssetup;
+       tmptbl.if_version += 100;
        printf("Opening bad secondary connection\n");
-       status = dcerpc_secondary_context(p, &p2, DCERPC_DSSETUP_UUID, DCERPC_DSSETUP_VERSION+100);
+       status = dcerpc_secondary_context(p, &p2, &tmptbl);
        if (NT_STATUS_IS_OK(status)) {
                talloc_free(mem_ctx);
                printf("dcerpc_alter_context with wrong version should fail\n");
index 0be4e3ca584c9de0c59d4e334c05a0840c8fa2d8..4447c8ac82747e2e66644eeac495ad9b8d55f138 100644 (file)
@@ -142,11 +142,7 @@ BOOL torture_rpc_atsvc(void)
 
        mem_ctx = talloc_init("torture_rpc_atsvc");
 
-       status = torture_rpc_connection(mem_ctx, 
-                                       &p, 
-                                       DCERPC_ATSVC_NAME, 
-                                       DCERPC_ATSVC_UUID, 
-                                       DCERPC_ATSVC_VERSION);
+       status = torture_rpc_connection(mem_ctx, &p, &dcerpc_table_atsvc);
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(mem_ctx);
                return False;
index 4cfee1a379c988e03c6193f5eecd752fedd7b4f1..4abe9f415eb1c914e7283b7dca77292c4ad1f80e 100644 (file)
@@ -94,8 +94,7 @@ static void reopen(TALLOC_CTX *mem_ctx,
        talloc_free(*p);
 
        status = torture_rpc_connection(mem_ctx, 
-                                       p, iface->endpoints->names[0], 
-                                       iface->uuid, iface->if_version);
+                                       p, iface);
        if (!NT_STATUS_IS_OK(status)) {
                printf("Failed to reopen '%s' - %s\n", iface->name, nt_errstr(status));
                exit(1);
index a2d0ba1dcf1d5d40bc3ad5b37a25402374985286..21afc560a08559d93372a677c8df367441d60b34 100644 (file)
@@ -102,9 +102,7 @@ BOOL torture_bench_rpc(void)
 
        status = torture_rpc_connection(mem_ctx, 
                                        &p,
-                                       DCERPC_SRVSVC_NAME,
-                                       DCERPC_SRVSVC_UUID,
-                                       DCERPC_SRVSVC_VERSION);
+                                       &dcerpc_table_srvsvc);
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(mem_ctx);
                return False;
index 6ab36cf510decddaa34e4f306e02c70c0266e8a1..d27fbb2b111e3d04e207622c6fbf4bbad426b322 100644 (file)
@@ -38,8 +38,6 @@
 BOOL torture_multi_bind(void) 
 {
        struct dcerpc_pipe *p;
-       const char *pipe_uuid = DCERPC_LSARPC_UUID;
-       uint32_t pipe_version = DCERPC_LSARPC_VERSION;
        struct dcerpc_binding *binding;
        const char *binding_string = lp_parm_string(-1, "torture", "binding");
        TALLOC_CTX *mem_ctx;
@@ -55,23 +53,18 @@ BOOL torture_multi_bind(void)
                return False;
        }
 
-       status = torture_rpc_connection(mem_ctx, 
-                                       &p, 
-                                       NULL,
-                                       pipe_uuid,
-                                       pipe_version);
+       status = torture_rpc_connection(mem_ctx, &p, &dcerpc_table_lsarpc);
        
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(mem_ctx);
                return False;
        }
 
-       status = dcerpc_pipe_auth(p, binding, pipe_uuid, pipe_version, 
-                                 cmdline_credentials);
+       status = dcerpc_pipe_auth(p, binding, &dcerpc_table_lsarpc, cmdline_credentials);
 
        if (NT_STATUS_IS_OK(status)) {
                printf("(incorrectly) allowed re-bind to uuid %s - %s\n", 
-                       pipe_uuid, nt_errstr(status));
+                       dcerpc_table_lsarpc.uuid, nt_errstr(status));
                ret = False;
        } else {
                printf("\n");
index cd78e2eba46a44c015d61dda1e8922a4d1117f80..0441191ebf9ca698247f93c0ce360276482fdee5 100644 (file)
@@ -44,8 +44,7 @@ BOOL torture_rpc_countcalls(void)
                return False;
        }
 
-       status = torture_rpc_connection(NULL, &p, iface->endpoints->names[0], 
-                                       iface->uuid, iface->if_version);
+       status = torture_rpc_connection(NULL, &p, iface);
        if (!NT_STATUS_IS_OK(status)) {
                printf("Failed to open '%s' - %s\n", iface->name, nt_errstr(status));
                return False;
index 318e9c88eaaea372e9003899486c7f8be58ea7bd..92559b95bf07388fc6e21defd1d731373368c11f 100644 (file)
@@ -32,10 +32,7 @@ BOOL torture_rpc_dcom(void)
 
        mem_ctx = talloc_init("torture_rpc_dcom");
 
-       status = torture_rpc_connection(mem_ctx, &p, 
-                                       DCERPC_IOXIDRESOLVER_NAME,
-                                       DCERPC_IOXIDRESOLVER_UUID,
-                                       DCERPC_IOXIDRESOLVER_VERSION);
+       status = torture_rpc_connection(mem_ctx, &p, &dcerpc_table_IOXIDResolver);
        if (!NT_STATUS_IS_OK(status)) {
                ret = False;
        }
index 4e33f921facb80841a110e2fbe3acaf54d0b5ef7..c455786a2713c371ca51af38e52ba0149083022a 100644 (file)
@@ -175,9 +175,7 @@ BOOL torture_rpc_dfs(void)
 
        status = torture_rpc_connection(mem_ctx, 
                                        &p, 
-                                       DCERPC_NETDFS_NAME,
-                                       DCERPC_NETDFS_UUID,
-                                       DCERPC_NETDFS_VERSION);
+                                       &dcerpc_table_netdfs);
        if (!NT_STATUS_IS_OK(status)) {
                return False;
        }
index a3310e144f812cb4939b5002b920c8f6e6d69445..9fbf0c21e68d6bcc7b403d8e0a3fd1388c88fe9a 100644 (file)
@@ -634,9 +634,7 @@ BOOL torture_rpc_drsuapi(void)
 
        status = torture_rpc_connection(mem_ctx, 
                                        &p, 
-                                       DCERPC_DRSUAPI_NAME,
-                                       DCERPC_DRSUAPI_UUID,
-                                       DCERPC_DRSUAPI_VERSION);
+                                       &dcerpc_table_drsuapi);
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(mem_ctx);
                return False;
index 40deb18fab75bd2d9ab4dd6e0be5fbeb2ada4835..3bfc0ee18aedcb0eaf408576ff90db6594de10b0 100644 (file)
@@ -784,15 +784,13 @@ BOOL torture_rpc_drsuapi_cracknames(void)
 
        status = torture_rpc_connection(mem_ctx, 
                                        &p, 
-                                       DCERPC_DRSUAPI_NAME,
-                                       DCERPC_DRSUAPI_UUID,
-                                       DCERPC_DRSUAPI_VERSION);
+                                       &dcerpc_table_drsuapi);
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(mem_ctx);
                return False;
        }
 
-       printf("Connected to DRAUAPI pipe\n");
+       printf("Connected to DRSUAPI pipe\n");
 
        ZERO_STRUCT(priv);
 
index d4f76fea90b60e2a8d6742c0b0c8c8017268aa98..2469d66330dcead63b2cd647629e6d5c8f11ab37 100644 (file)
@@ -64,10 +64,7 @@ BOOL torture_rpc_dssetup(void)
 
        mem_ctx = talloc_init("torture_rpc_dssetup");
 
-       status = torture_rpc_connection(mem_ctx, &p, 
-                                       DCERPC_DSSETUP_NAME, 
-                                       DCERPC_DSSETUP_UUID, 
-                                       DCERPC_DSSETUP_VERSION);
+       status = torture_rpc_connection(mem_ctx, &p, &dcerpc_table_dssetup);
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(mem_ctx);
 
index 8daba2438b203be980e14b7c317bf7a9a20b55b7..e28ff798a8b9f284c54586006cc0e7a0392f7002 100644 (file)
@@ -174,8 +174,7 @@ static BOOL _test_DsBind(struct DsSyncTest *ctx, struct cli_credentials *credent
 
        status = dcerpc_pipe_connect_b(ctx,
                                       &b->pipe, ctx->drsuapi_binding, 
-                                      DCERPC_DRSUAPI_UUID,
-                                      DCERPC_DRSUAPI_VERSION,
+                                          &dcerpc_table_drsuapi,
                                       credentials, event);
        
        if (!NT_STATUS_IS_OK(status)) {
index ae2be1fe6cd4d61dca8a666d74f3d3cd849d0e3a..0064374a01a499a0e1c475942ec6be94f96a42a6 100644 (file)
@@ -470,9 +470,7 @@ BOOL torture_rpc_echo(void)
 
        status = torture_rpc_connection(mem_ctx, 
                                        &p, 
-                                       DCERPC_RPCECHO_NAME,
-                                       DCERPC_RPCECHO_UUID,
-                                       DCERPC_RPCECHO_VERSION);
+                                       &dcerpc_table_rpcecho);
        if (!NT_STATUS_IS_OK(status)) {
                return False;
        }
index 28877fa1a45c733ecfebef1ef270c5d37984f8a2..f7935ce2d750d2f020544607278f3ae9f1b4055d 100644 (file)
@@ -281,11 +281,7 @@ BOOL torture_rpc_epmapper(void)
 
        mem_ctx = talloc_init("torture_rpc_epmapper");
 
-       status = torture_rpc_connection(mem_ctx, 
-                                       &p, 
-                                       DCERPC_EPMAPPER_NAME,
-                                       DCERPC_EPMAPPER_UUID,
-                                       DCERPC_EPMAPPER_VERSION);
+       status = torture_rpc_connection(mem_ctx, &p, &dcerpc_table_epmapper);
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(mem_ctx);
                return False;
index 576565e24758aa195d3673c527acb05b10de3250..56647cfc3ee590034970f1faebed22758e44b7e9 100644 (file)
@@ -229,11 +229,7 @@ BOOL torture_rpc_eventlog(void)
 
        mem_ctx = talloc_init("torture_rpc_atsvc");
 
-       status = torture_rpc_connection(mem_ctx, 
-                                       &p, 
-                                       DCERPC_EVENTLOG_NAME, 
-                                       DCERPC_EVENTLOG_UUID, 
-                                       DCERPC_EVENTLOG_VERSION);
+       status = torture_rpc_connection(mem_ctx, &p, &dcerpc_table_eventlog);
 
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(mem_ctx);
index ff1496aea415ec1ff6fda06de6f57f842d983fb1..29893d65151a2da1aad53d4ecf32f8f5ea85bdf1 100644 (file)
@@ -120,11 +120,7 @@ BOOL torture_rpc_initshutdown(void)
 
        mem_ctx = talloc_init("torture_rpc_initshutdown");
 
-       status = torture_rpc_connection(mem_ctx, 
-                                       &p, 
-                                       DCERPC_INITSHUTDOWN_NAME, 
-                                       DCERPC_INITSHUTDOWN_UUID, 
-                                       DCERPC_INITSHUTDOWN_VERSION);
+       status = torture_rpc_connection(mem_ctx, &p, &dcerpc_table_initshutdown);
 
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(mem_ctx);
index 9e5129bf5a18554425c2870e22efcb82bb5e49c2..0207c756bde1916638ee467917c6844dff836d38 100644 (file)
@@ -1818,11 +1818,7 @@ BOOL torture_rpc_lsa(void)
 
        mem_ctx = talloc_init("torture_rpc_lsa");
 
-       status = torture_rpc_connection(mem_ctx, 
-                                       &p, 
-                                       DCERPC_LSARPC_NAME, 
-                                       DCERPC_LSARPC_UUID, 
-                                       DCERPC_LSARPC_VERSION);
+       status = torture_rpc_connection(mem_ctx, &p, &dcerpc_table_lsarpc);
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(mem_ctx);
                return False;
index 7dfa67ce9502369e24ecbd17e941d1a77f47c72a..72495c248b9a5ca077548b1db67b6c2a8b914097 100644 (file)
@@ -210,9 +210,7 @@ BOOL torture_rpc_mgmt(void)
                printf("\nTesting pipe '%s'\n", l->table->name);
 
                if (b->transport == NCACN_IP_TCP) {
-                       status = dcerpc_epm_map_binding(loop_ctx, b, 
-                                                       l->table->uuid,
-                                                       l->table->if_version, NULL);
+                       status = dcerpc_epm_map_binding(loop_ctx, b, l->table, NULL);
                        if (!NT_STATUS_IS_OK(status)) {
                                talloc_free(loop_ctx);
                                printf("Failed to map port for uuid %s\n", l->table->uuid);
@@ -224,11 +222,7 @@ BOOL torture_rpc_mgmt(void)
 
                lp_set_cmdline("torture:binding", dcerpc_binding_string(loop_ctx, b));
 
-               status = torture_rpc_connection(loop_ctx, 
-                                               &p, 
-                                               l->table->name,
-                                               DCERPC_MGMT_UUID,
-                                               DCERPC_MGMT_VERSION);
+               status = torture_rpc_connection(loop_ctx, &p, &dcerpc_table_mgmt);
                if (!NT_STATUS_IS_OK(status)) {
                        talloc_free(loop_ctx);
                        ret = False;
index a02f670439ceee28f6a1059995be87f48a32d666..1958b9cdfd6d030c0caaab29d1127badee02b647 100644 (file)
@@ -1436,8 +1436,7 @@ static BOOL test_ManyGetDCName(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
                return False;
        }
 
-       status = dcerpc_bind_auth_none(p2, DCERPC_LSARPC_UUID, 
-                                      DCERPC_LSARPC_VERSION);
+       status = dcerpc_bind_auth_none(p2, &dcerpc_table_lsarpc);
        if (!NT_STATUS_IS_OK(status)) {
                printf("Failed to create bind on secondary connection\n");
                return False;
@@ -1526,10 +1525,7 @@ BOOL torture_rpc_netlogon(void)
 
        machine_password = cli_credentials_get_password(machine_credentials);
 
-       status = torture_rpc_connection(mem_ctx, &p, 
-                                       DCERPC_NETLOGON_NAME,
-                                       DCERPC_NETLOGON_UUID,
-                                       DCERPC_NETLOGON_VERSION);
+       status = torture_rpc_connection(mem_ctx, &p, &dcerpc_table_netlogon);
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(mem_ctx);
                return False;
index 8bb1a7ae0ab80efe013c25c3f1909589456e5acb..61ef9b8ee87074793f4b6ecef241a8378ba89b64 100644 (file)
@@ -227,9 +227,7 @@ BOOL torture_rpc_oxidresolve(void)
 
        status = torture_rpc_connection(mem_ctx, 
                                        &premact, 
-                                       DCERPC_IREMOTEACTIVATION_NAME, 
-                                       DCERPC_IREMOTEACTIVATION_UUID, 
-                                       DCERPC_IREMOTEACTIVATION_VERSION);                                                              
+                                       &dcerpc_table_IRemoteActivation);
                        
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(mem_ctx);
@@ -238,9 +236,7 @@ BOOL torture_rpc_oxidresolve(void)
 
        status = torture_rpc_connection(mem_ctx, 
                                        &p, 
-                                       DCERPC_IOXIDRESOLVER_NAME, 
-                                       DCERPC_IOXIDRESOLVER_UUID, 
-                                       DCERPC_IOXIDRESOLVER_VERSION);
+                                       &dcerpc_table_IOXIDResolver);
 
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(mem_ctx);
index bbda1978546478eacb9f30666259f738f0aae7f2..84d0a2e35c63c849c0d234119a3fa2f155a4fdd7 100644 (file)
@@ -105,9 +105,7 @@ BOOL torture_rpc_remact(void)
 
        status = torture_rpc_connection(mem_ctx,
                                        &p, 
-                                       DCERPC_IREMOTEACTIVATION_NAME,
-                                       DCERPC_IREMOTEACTIVATION_UUID, 
-                                       DCERPC_IREMOTEACTIVATION_VERSION);
+                                       &dcerpc_table_IRemoteActivation);
 
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(mem_ctx);
index ee47fe350e9fb474480348c0b9e1346ff9329e0b..c7694aa408a6a73991e49eb038732d3b0340b2c3 100644 (file)
@@ -33,9 +33,7 @@ BOOL torture_rpc_rot(void)
 
        status = torture_rpc_connection(mem_ctx, 
                                        &p, 
-                                       DCERPC_ROT_NAME, 
-                                       DCERPC_ROT_UUID, 
-                                       DCERPC_ROT_VERSION);
+                                       &dcerpc_table_rot);
 
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(mem_ctx);
index 43ab3f98742990ec1f7d8302cb67c85d4c1112b5..996d78d25f3b0b35fb9f7cae04cc97177eb09299 100644 (file)
@@ -1537,8 +1537,7 @@ BOOL torture_rpc_samlogon(void)
        b->flags |= DCERPC_SCHANNEL | DCERPC_SIGN | DCERPC_SCHANNEL_128;
 
        status = dcerpc_pipe_connect_b(mem_ctx, &p, b, 
-                                      DCERPC_NETLOGON_UUID,
-                                      DCERPC_NETLOGON_VERSION,
+                                                                  &dcerpc_table_netlogon,
                                       machine_credentials, NULL);
 
        if (!NT_STATUS_IS_OK(status)) {
index 42c005ab901d648523638fcd0582aff22a54f615..210e5def21207efee2d2718ab6279e17c169a159 100644 (file)
@@ -3350,11 +3350,7 @@ BOOL torture_rpc_samr(void)
 
        mem_ctx = talloc_init("torture_rpc_samr");
 
-       status = torture_rpc_connection(mem_ctx, 
-                                       &p, 
-                                       DCERPC_SAMR_NAME,
-                                       DCERPC_SAMR_UUID,
-                                       DCERPC_SAMR_VERSION);
+       status = torture_rpc_connection(mem_ctx, &p, &dcerpc_table_samr);
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(mem_ctx);
                return False;
index 7f77844459af3b89266df12465529d02e5ee5953..98fea05a1d161e361c8717e3e54b24f4c1f31812 100644 (file)
@@ -1475,9 +1475,7 @@ BOOL torture_rpc_samsync(void)
 
        status = torture_rpc_connection(samsync_state,
                                        &samsync_state->p_lsa, 
-                                       DCERPC_LSARPC_NAME,
-                                       DCERPC_LSARPC_UUID,
-                                       DCERPC_LSARPC_VERSION);
+                                       &dcerpc_table_lsarpc);
 
        if (!NT_STATUS_IS_OK(status)) {
                ret = False;
@@ -1529,8 +1527,7 @@ BOOL torture_rpc_samsync(void)
 
        status = dcerpc_pipe_connect_b(samsync_state,
                                       &samsync_state->p, b, 
-                                      DCERPC_NETLOGON_UUID,
-                                      DCERPC_NETLOGON_VERSION,
+                                          &dcerpc_table_netlogon,
                                       credentials, NULL);
        
        if (!NT_STATUS_IS_OK(status)) {
@@ -1569,8 +1566,7 @@ BOOL torture_rpc_samsync(void)
        status = dcerpc_pipe_connect_b(samsync_state, 
                                       &samsync_state->p_netlogon_wksta, 
                                       b_netlogon_wksta, 
-                                      DCERPC_NETLOGON_UUID,
-                                      DCERPC_NETLOGON_VERSION,
+                                          &dcerpc_table_netlogon,
                                       credentials_wksta, NULL);
 
        if (!NT_STATUS_IS_OK(status)) {
index a0adcea0ac0ba7d54f0fb8571e2e5fcf52c74cb0..1f612fbaee024209dbdb198bf11e3afd33e050da 100644 (file)
@@ -36,12 +36,16 @@ static BOOL test_num_calls(const struct dcerpc_interface_table *iface,
        int i;
        DATA_BLOB stub_in, stub_out;
        int idl_calls;
+       struct dcerpc_interface_table tbl;
 
-       uuid = GUID_string(mem_ctx, &id->uuid);
+       /* FIXME: This should be fixed when torture_rpc_connection 
+        * takes a dcerpc_syntax_id */
+       tbl.name = iface->name;
+       tbl.uuid = GUID_string(mem_ctx, &id->uuid);
+       tbl.if_version = id->if_version;
 
        status = torture_rpc_connection(mem_ctx, 
-                                       &p, iface->name,
-                                       uuid, id->if_version);
+                                       &p, iface);
        if (!NT_STATUS_IS_OK(status)) {
                printf("Failed to connect to '%s' on '%s' - %s\n", 
                       uuid, iface->name, nt_errstr(status));
@@ -166,9 +170,7 @@ BOOL torture_rpc_scanner(void)
                printf("\nTesting pipe '%s'\n", l->table->name);
 
                if (b->transport == NCACN_IP_TCP) {
-                       status = dcerpc_epm_map_binding(mem_ctx, b, 
-                                                        l->table->uuid,
-                                                        l->table->if_version, NULL);
+                       status = dcerpc_epm_map_binding(mem_ctx, b, l->table, NULL);
                        if (!NT_STATUS_IS_OK(status)) {
                                talloc_free(loop_ctx);
                                printf("Failed to map port for uuid %s\n", l->table->uuid);
@@ -180,11 +182,7 @@ BOOL torture_rpc_scanner(void)
 
                lp_set_cmdline("torture:binding", dcerpc_binding_string(mem_ctx, b));
 
-               status = torture_rpc_connection(loop_ctx, 
-                                               &p, 
-                                               l->table->name,
-                                               DCERPC_MGMT_UUID,
-                                               DCERPC_MGMT_VERSION);
+               status = torture_rpc_connection(loop_ctx, &p, &dcerpc_table_mgmt);
                if (!NT_STATUS_IS_OK(status)) {
                        talloc_free(loop_ctx);
                        ret = False;
index 338a71d27b1e7a98036e29c1fa7b3311bc5e1799..d0d7e051cbdf24373dada3c2fc53bae4e5e7f4c7 100644 (file)
@@ -181,10 +181,7 @@ static BOOL test_schannel(TALLOC_CTX *mem_ctx,
        b->flags &= ~DCERPC_AUTH_OPTIONS;
        b->flags |= dcerpc_flags;
 
-       status = dcerpc_pipe_connect_b(test_ctx, 
-                                      &p, b, 
-                                      DCERPC_SAMR_UUID,
-                                      DCERPC_SAMR_VERSION,
+       status = dcerpc_pipe_connect_b(test_ctx, &p, b, &dcerpc_table_samr,
                                       credentials, NULL);
        if (!NT_STATUS_IS_OK(status)) {
                printf("Failed to connect with schannel: %s\n", nt_errstr(status));
@@ -201,8 +198,7 @@ static BOOL test_schannel(TALLOC_CTX *mem_ctx,
         * the second */
 
        /* Swap the binding details from SAMR to NETLOGON */
-       status = dcerpc_epm_map_binding(test_ctx, b, DCERPC_NETLOGON_UUID,
-                                       DCERPC_NETLOGON_VERSION, NULL);
+       status = dcerpc_epm_map_binding(test_ctx, b, &dcerpc_table_netlogon, NULL);
        if (!NT_STATUS_IS_OK(status)) {
                goto failed;
        }
@@ -214,9 +210,7 @@ static BOOL test_schannel(TALLOC_CTX *mem_ctx,
                goto failed;
        }
 
-       status = dcerpc_bind_auth(p_netlogon, 
-                                 DCERPC_NETLOGON_UUID,
-                                 DCERPC_NETLOGON_VERSION, 
+       status = dcerpc_bind_auth(p_netlogon, &dcerpc_table_netlogon,
                                  credentials, DCERPC_AUTH_TYPE_SCHANNEL,
                                  NULL);
 
@@ -236,8 +230,7 @@ static BOOL test_schannel(TALLOC_CTX *mem_ctx,
        }
 
        /* Swap the binding details from SAMR to LSARPC */
-       status = dcerpc_epm_map_binding(test_ctx, b, DCERPC_LSARPC_UUID,
-                                       DCERPC_LSARPC_VERSION, NULL);
+       status = dcerpc_epm_map_binding(test_ctx, b, &dcerpc_table_lsarpc, NULL);
        if (!NT_STATUS_IS_OK(status)) {
                goto failed;
        }
@@ -249,9 +242,7 @@ static BOOL test_schannel(TALLOC_CTX *mem_ctx,
                goto failed;
        }
 
-       status = dcerpc_bind_auth(p_lsa, 
-                                 DCERPC_LSARPC_UUID,
-                                 DCERPC_LSARPC_VERSION, 
+       status = dcerpc_bind_auth(p_lsa, &dcerpc_table_lsarpc,
                                  credentials, DCERPC_AUTH_TYPE_SCHANNEL,
                                  NULL);
 
index 035ab7ace2e479c7768d7bc23930a531cff9a236..898991d88ee6a86e3439951beb253f9e04164737 100644 (file)
@@ -169,9 +169,7 @@ BOOL torture_rpc_lsa_secrets(void)
 
        status = torture_rpc_connection(mem_ctx, 
                                        &p, 
-                                       DCERPC_LSARPC_NAME, 
-                                       DCERPC_LSARPC_UUID, 
-                                       DCERPC_LSARPC_VERSION);
+                                       &dcerpc_table_lsarpc);
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(mem_ctx);
                return False;
index 76c8673d4feed8c9183c773f09aafe7a4926cb43..89407e33cc13a2e231f94126d04255b4482090d5 100644 (file)
@@ -1622,8 +1622,7 @@ static BOOL test_SecondaryClosePrinter(struct dcerpc_pipe *p, TALLOC_CTX *mem_ct
                return False;
        }
 
-       status = dcerpc_bind_auth_none(p2, DCERPC_SPOOLSS_UUID, 
-                                      DCERPC_SPOOLSS_VERSION);
+       status = dcerpc_bind_auth_none(p2, &dcerpc_table_spoolss);
        if (!NT_STATUS_IS_OK(status)) {
                printf("Failed to create bind on secondary connection\n");
                talloc_free(p2);
@@ -2059,11 +2058,7 @@ BOOL torture_rpc_spoolss(void)
 
        mem_ctx = talloc_init("torture_rpc_spoolss");
 
-       status = torture_rpc_connection(mem_ctx, 
-                                       &p, 
-                                       DCERPC_SPOOLSS_NAME,
-                                       DCERPC_SPOOLSS_UUID,
-                                       DCERPC_SPOOLSS_VERSION);
+       status = torture_rpc_connection(mem_ctx, &p, &dcerpc_table_spoolss);
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(mem_ctx);
                return False;
index 13b6cde675e00f54779a85e36fa32756d85d48ba..422e06f0560c00dd046f64d53900f185c3defbe2 100644 (file)
@@ -719,11 +719,7 @@ BOOL torture_rpc_srvsvc(void)
 
        mem_ctx = talloc_init("torture_rpc_srvsvc");
 
-       status = torture_rpc_connection(mem_ctx, 
-                                       &p,
-                                       DCERPC_SRVSVC_NAME,
-                                       DCERPC_SRVSVC_UUID,
-                                       DCERPC_SRVSVC_VERSION);
+       status = torture_rpc_connection(mem_ctx, &p, &dcerpc_table_srvsvc);
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(mem_ctx);
                return False;
index 44b79058a95fa1aca80942564d09e105b014619e..102e3bad91024e52e27ded380a7cc1e4ee648a55 100644 (file)
@@ -117,11 +117,7 @@ BOOL torture_rpc_svcctl(void)
 
        mem_ctx = talloc_init("torture_rpc_svcctl");
 
-       status = torture_rpc_connection(mem_ctx, 
-                                       &p,
-                                       DCERPC_SVCCTL_NAME,
-                                       DCERPC_SVCCTL_UUID,
-                                       DCERPC_SVCCTL_VERSION);
+       status = torture_rpc_connection(mem_ctx, &p, &dcerpc_table_svcctl);
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(mem_ctx);
                return False;
index 66cb4a42c14ee1dca207a3ded47e9f3299a1cc80..80342fa8bc217c9ca540d8029964a6841d057205 100644 (file)
@@ -128,9 +128,7 @@ struct test_join *torture_create_testuser(const char *username,
 
        status = torture_rpc_connection(join, 
                                        &join->p, 
-                                       DCERPC_SAMR_NAME,
-                                       DCERPC_SAMR_UUID,
-                                       DCERPC_SAMR_VERSION);
+                                       &dcerpc_table_samr);
        if (!NT_STATUS_IS_OK(status)) {
                return NULL;
        }
index caa268b0c891a469a914ba3e1891305de0aaa95d..24d6a30d55ed88b0e8c84971970f1019d6d128a2 100644 (file)
@@ -72,10 +72,7 @@ BOOL torture_rpc_unixinfo(void)
 
        mem_ctx = talloc_init("torture_rpc_unixinfo");
 
-       status = torture_rpc_connection(mem_ctx, &p, 
-                                       DCERPC_UNIXINFO_NAME,
-                                       DCERPC_UNIXINFO_UUID,
-                                       DCERPC_UNIXINFO_VERSION);
+       status = torture_rpc_connection(mem_ctx, &p, &dcerpc_table_unixinfo);
        if (!NT_STATUS_IS_OK(status)) {
                return False;
        }
index cfcb91cafb6e6376d46c6995e748b797adf314b1..3aaa7521fa5014ba827086096b54cabacd2a11a3 100644 (file)
@@ -798,11 +798,7 @@ BOOL torture_rpc_winreg(void)
        int i;
        mem_ctx = talloc_init("torture_rpc_winreg");
 
-       status = torture_rpc_connection(mem_ctx, 
-                                       &p, 
-                                       DCERPC_WINREG_NAME, 
-                                       DCERPC_WINREG_UUID, 
-                                       DCERPC_WINREG_VERSION);
+       status = torture_rpc_connection(mem_ctx, &p, &dcerpc_table_winreg);
 
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(mem_ctx);
index 7b8388b125e781572bcb4beba7cedd6d622f7674..7e71fc29b26cb1f07d9f3ff73b4ee3f1c407a007 100644 (file)
@@ -95,11 +95,7 @@ BOOL torture_rpc_wkssvc(void)
 
        mem_ctx = talloc_init("torture_rpc_wkssvc");
 
-       status = torture_rpc_connection(mem_ctx, 
-                                       &p, 
-                                       DCERPC_WKSSVC_NAME,
-                                       DCERPC_WKSSVC_UUID,
-                                       DCERPC_WKSSVC_VERSION);
+       status = torture_rpc_connection(mem_ctx, &p, &dcerpc_table_wkssvc);
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(mem_ctx);
                return False;
index 412db115b7a8f766cdf0709a5eae225ea545e266..a86a9257784ac00f1684cc135a6e148502610bd7 100644 (file)
@@ -123,9 +123,7 @@ BOOL torture_close_connection(struct smbcli_state *c)
 /* open a rpc connection to the chosen binding string */
 NTSTATUS torture_rpc_connection(TALLOC_CTX *parent_ctx, 
                                struct dcerpc_pipe **p, 
-                               const char *pipe_name,
-                               const char *pipe_uuid, 
-                               uint32_t pipe_version)
+                               const struct dcerpc_interface_table *table)
 {
         NTSTATUS status;
        const char *binding = lp_parm_string(-1, "torture", "binding");
@@ -136,7 +134,7 @@ NTSTATUS torture_rpc_connection(TALLOC_CTX *parent_ctx,
        }
 
        status = dcerpc_pipe_connect(parent_ctx, 
-                                    p, binding, pipe_uuid, pipe_version,
+                                    p, binding, table,
                                     cmdline_credentials, NULL);
  
         return status;
@@ -145,9 +143,7 @@ NTSTATUS torture_rpc_connection(TALLOC_CTX *parent_ctx,
 /* open a rpc connection to a specific transport */
 NTSTATUS torture_rpc_connection_transport(TALLOC_CTX *parent_ctx, 
                                          struct dcerpc_pipe **p, 
-                                         const char *pipe_name,
-                                         const char *pipe_uuid, 
-                                         uint32_t pipe_version,
+                                         const struct dcerpc_interface_table *table,
                                          enum dcerpc_transport_t transport)
 {
         NTSTATUS status;
@@ -170,7 +166,7 @@ NTSTATUS torture_rpc_connection_transport(TALLOC_CTX *parent_ctx,
 
        b->transport = transport;
 
-       status = dcerpc_pipe_connect_b(mem_ctx, p, b, pipe_uuid, pipe_version,
+       status = dcerpc_pipe_connect_b(mem_ctx, p, b, table,
                                       cmdline_credentials, NULL);
                                           
        if (NT_STATUS_IS_OK(status)) {
index 22fd377dca90e50c62daa67ceb14477b24b98a67..54920664ec819a8e1259cc7310c30b17cc876ea8 100644 (file)
@@ -875,7 +875,7 @@ enum {
        OPT_MULTIPLEX,
 };
 
- int main(int argc, const char **argv)
+int main(int argc, const char **argv)
 {
        static const char *helper_protocol;
        int opt;
index f6c61c8c3631ec1a4387404a7e27f9a893582593..330a6b4534c2ddc545284f85c8c7b1b290739f76 100644 (file)
@@ -247,8 +247,7 @@ static void get_schannel_creds_recv_pipe(struct composite_context *creq)
        if (!composite_is_ok(c)) return;
 
        creq = dcerpc_bind_auth_none_send(state, state->p,
-                                         DCERPC_NETLOGON_UUID,
-                                         DCERPC_NETLOGON_VERSION);
+                                                                         &dcerpc_table_netlogon);
        composite_continue(c, creq, get_schannel_creds_recv_anonbind, c);
 }
 
index 9443ef0dc7cd53110e1c1e4cff46777444714868..76f75eb0a4cf45cb8417578322e5a3dd3af001ef 100644 (file)
@@ -95,8 +95,7 @@ static void init_lsa_recv_pipe(struct composite_context *ctx)
        switch (state->auth_type) {
        case DCERPC_AUTH_TYPE_NONE:
                ctx = dcerpc_bind_auth_none_send(state, state->lsa_pipe,
-                                                DCERPC_LSARPC_UUID,
-                                                DCERPC_LSARPC_VERSION);
+                                                                                &dcerpc_table_lsarpc);
                composite_continue(state->ctx, ctx, init_lsa_recv_anon_bind,
                                   state);
                break;
@@ -108,8 +107,7 @@ static void init_lsa_recv_pipe(struct composite_context *ctx)
                }
                state->lsa_pipe->conn->flags |= (DCERPC_SIGN | DCERPC_SEAL);
                ctx = dcerpc_bind_auth_send(state, state->lsa_pipe,
-                                           DCERPC_LSARPC_UUID,
-                                           DCERPC_LSARPC_VERSION,
+                                                                       &dcerpc_table_lsarpc,
                                            state->creds, state->auth_type,
                                            NULL);
                composite_continue(state->ctx, ctx, init_lsa_recv_auth_bind,
index b5511a1a1227e01a70aaa2c2825a4fd577bc1fa3..e3b9c82310fb659e139b549de9664be6772fa5b4 100644 (file)
@@ -102,8 +102,7 @@ static void connect_samr_recv_pipe(struct composite_context *ctx)
        switch (state->auth_type) {
        case DCERPC_AUTH_TYPE_NONE:
                ctx = dcerpc_bind_auth_none_send(state, state->samr_pipe,
-                                                DCERPC_SAMR_UUID,
-                                                DCERPC_SAMR_VERSION);
+                                                                                &dcerpc_table_samr);
                composite_continue(state->ctx, ctx,
                                   connect_samr_recv_anon_bind, state);
                break;
@@ -115,8 +114,7 @@ static void connect_samr_recv_pipe(struct composite_context *ctx)
                }
                state->samr_pipe->conn->flags |= (DCERPC_SIGN | DCERPC_SEAL);
                ctx = dcerpc_bind_auth_send(state, state->samr_pipe,
-                                           DCERPC_SAMR_UUID,
-                                           DCERPC_SAMR_VERSION,
+                                                                       &dcerpc_table_samr,
                                            state->creds, state->auth_type,
                                            NULL);
                composite_continue(state->ctx, ctx,
index 07126dd04f9ad290a25ae54f89445e46df03e261..8b49ed73977c9b27d3da340ad5ad508234132a80 100644 (file)
@@ -216,8 +216,7 @@ static void init_domain_recv_netlogonpipe(struct composite_context *ctx)
        state->domain->netlogon_pipe->conn->flags |=
                (DCERPC_SIGN | DCERPC_SEAL);
        ctx = dcerpc_bind_auth_send(state, state->domain->netlogon_pipe,
-                                   DCERPC_NETLOGON_UUID,
-                                   DCERPC_NETLOGON_VERSION, 
+                                                               &dcerpc_table_netlogon,
                                    state->domain->schannel_creds,
                                    DCERPC_AUTH_TYPE_SCHANNEL,
                                    NULL);