[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Mon Aug 1 04:32:02 MDT 2011


The branch, master has been updated
       via  f72d56d s3-rpc_server: Only setup tcpip ports if epmapper is enabled.
       via  aca4dbe s3-rpc_server: Use rpc_spoolss_mode().
       via  538bd1e s3-rpc_server: Add rpc_spoolss_mode().
       via  b11878d s3-rpc_server: Enable endpoint mapper as daemon by default.
       via  d189d2b s3-rpc_server: Use rpc_epmapper_mode().
       via  176ce4b s3-rpc_server: Add rpc_epmapper_mode().
       via  9c5f2ec s3-rpc_server: Disable listening on tcpip ports by default.
       via  e0931a5 s3-torture: Run epmapper as daemon and the tests over ncalrpc.
       via  4854272 s3-epmd: Use rpc_setup_tcpip_sockets().
       via  4b751b2 s3-librpc: Remove obsolete dcerpc_binding_vector_create().
       via  0fef676 s3-rpc_server: Use binding vector in rpc_ep_try_register().
       via  498e53c s3-rpc_server: Add RPC socket helper functions.
       via  02cdb65 s3-librpc: Add dcerpc_binding_vector_replace_iface().
       via  9cc6f90 s3-librpc: Add dcerpc_binding_vector_dup().
       via  169d0c4 s3-librpc: Add dcerpc_binding_vector_add_unix().
       via  eaced2e s3-librpc: Add dcerpc_binding_vector_add_port().
       via  c810e47 s3-librpc: Add dcerpc_binding_vector_add_np_default().
       via  08523ed s3-librpc: Add dcerpc_binding_vector_new().
       via  d597bf4 s3-rpc_server: Rename to rpc service setup.
       via  e25b34a s3-rpc_server: Move the endpoint registration to own file.
       via  cca96e4 s3-rpc_server: Added common function to create tcpip socket.
      from  95e8f09 s3-lsa: Fix crypto prototypes.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit f72d56de5092a10d78798f233e29b23d62cc425a
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Aug 1 11:14:12 2011 +0200

    s3-rpc_server: Only setup tcpip ports if epmapper is enabled.
    
    Autobuild-User: Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date: Mon Aug  1 12:31:59 CEST 2011 on sn-devel-104

commit aca4dbe0008fe76841b0191602f5da416931fe07
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Jul 29 17:46:37 2011 +0200

    s3-rpc_server: Use rpc_spoolss_mode().

commit 538bd1eca6846e3c5a52d792e456f463348527bc
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Jul 29 17:46:21 2011 +0200

    s3-rpc_server: Add rpc_spoolss_mode().

commit b11878d5a5fb6beb1a393a9ff7da5e5d7e711c6c
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Jul 29 17:25:39 2011 +0200

    s3-rpc_server: Enable endpoint mapper as daemon by default.

commit d189d2bf32c9ddb9d13a61586f17da97aea83663
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Jul 14 10:40:53 2011 +0200

    s3-rpc_server: Use rpc_epmapper_mode().
    
    Remove embedded mode cause this will not work. It was only there for
    testing.

commit 176ce4b42f6629fe33a2ff51b3c70bb74c109637
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Jul 29 11:44:02 2011 +0200

    s3-rpc_server: Add rpc_epmapper_mode().

commit 9c5f2ec12136eac5ede41ccef581b2bf934429ca
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Jul 14 10:37:49 2011 +0200

    s3-rpc_server: Disable listening on tcpip ports by default.

commit e0931a53c894e9d267c2d4b5d1b667209f9540ab
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Jul 11 17:02:36 2011 +0200

    s3-torture: Run epmapper as daemon and the tests over ncalrpc.

commit 48542728b11db3227fe821463f7d6b2230ae608b
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Jul 5 12:04:00 2011 +0200

    s3-epmd: Use rpc_setup_tcpip_sockets().

commit 4b751b29e50ea87bd3f082d63014cbcbff8bc519
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Jul 13 13:49:57 2011 +0200

    s3-librpc: Remove obsolete dcerpc_binding_vector_create().

commit 0fef6766b9e4c8612b2ad547720ec47463917192
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Jul 1 18:40:38 2011 +0200

    s3-rpc_server: Use binding vector in rpc_ep_try_register().

commit 498e53c22008c918e2ae5ca8126a8b1b2e8322df
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Jun 30 10:46:48 2011 +0200

    s3-rpc_server: Add RPC socket helper functions.

commit 02cdb65fc67954e3811349021563f496fc282f7b
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Jul 1 14:39:58 2011 +0200

    s3-librpc: Add dcerpc_binding_vector_replace_iface().

commit 9cc6f904240897c81caf78b2c228b776b553ce63
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Jul 1 14:36:31 2011 +0200

    s3-librpc: Add dcerpc_binding_vector_dup().

commit 169d0c431265651996f3063c3de6503f84894720
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Jun 30 12:02:33 2011 +0200

    s3-librpc: Add dcerpc_binding_vector_add_unix().

commit eaced2e909b58ce5b83998e6bde9750985f7a99d
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Jun 30 12:01:10 2011 +0200

    s3-librpc: Add dcerpc_binding_vector_add_port().

commit c810e475194775c63f32c4efeb9a505d9647b2bc
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Jun 30 11:56:11 2011 +0200

    s3-librpc: Add dcerpc_binding_vector_add_np_default().

commit 08523ed6b8105aee97225bdf389bd029754aacb1
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Jun 30 11:52:59 2011 +0200

    s3-librpc: Add dcerpc_binding_vector_new().

commit d597bf4dad0deaf2536436a9f4c2e7affd42e668
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Jun 6 11:13:10 2011 +0200

    s3-rpc_server: Rename to rpc service setup.

commit e25b34ab0c565cb702b278d22552828e6ba090a5
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Jun 6 11:10:02 2011 +0200

    s3-rpc_server: Move the endpoint registration to own file.

commit cca96e47268d32e12e1b6b9a187f3096efa12b29
Author: Andreas Schneider <asn at samba.org>
Date:   Mon May 23 16:00:30 2011 +0200

    s3-rpc_server: Added common function to create tcpip socket.

-----------------------------------------------------------------------

Summary of changes:
 selftest/target/Samba3.pm              |    4 +-
 source3/Makefile.in                    |    4 +-
 source3/include/proto.h                |    1 +
 source3/librpc/rpc/dcerpc_ep.c         |  288 ++++++--
 source3/librpc/rpc/dcerpc_ep.h         |   88 +++-
 source3/printing/spoolssd.c            |   26 +-
 source3/rpc_server/epmd.c              |   87 +--
 source3/rpc_server/rpc_ep_register.c   |  272 ++++++++
 source3/rpc_server/rpc_ep_register.h   |   50 ++
 source3/rpc_server/rpc_ep_setup.c      | 1179 --------------------------------
 source3/rpc_server/rpc_ep_setup.h      |   56 --
 source3/rpc_server/rpc_server.c        |   59 +-
 source3/rpc_server/rpc_service_setup.c | 1039 ++++++++++++++++++++++++++++
 source3/rpc_server/rpc_service_setup.h |   77 +++
 source3/rpc_server/rpc_sock_helper.c   |  271 ++++++++
 source3/rpc_server/rpc_sock_helper.h   |   40 ++
 source3/rpc_server/wscript_build       |    4 +-
 source3/selftest/tests.py              |    9 +-
 source3/smbd/server.c                  |   16 +-
 19 files changed, 2149 insertions(+), 1421 deletions(-)
 create mode 100644 source3/rpc_server/rpc_ep_register.c
 create mode 100644 source3/rpc_server/rpc_ep_register.h
 delete mode 100644 source3/rpc_server/rpc_ep_setup.c
 delete mode 100644 source3/rpc_server/rpc_ep_setup.h
 create mode 100644 source3/rpc_server/rpc_service_setup.c
 create mode 100644 source3/rpc_server/rpc_service_setup.h
 create mode 100644 source3/rpc_server/rpc_sock_helper.c
 create mode 100644 source3/rpc_server/rpc_sock_helper.h


Changeset truncated at 500 lines:

diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 93b999f..c45c878 100644
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -285,6 +285,7 @@ sub setup_plugin_s4_dc($$$$)
         auth methods = guest samba4
         domain logons = yes
         rpc_server:epmapper = external
+        rpc_server:tcpip = no
         rpc_server:lsass = external
         rpc_server:lsarpc = external
         rpc_server:netlogon = external
@@ -900,7 +901,8 @@ sub provision($$$$$$$)
 	lpq cache time = 0
 
 	ncalrpc dir = $prefix_abs/ncalrpc
-	rpc_server:epmapper = embedded
+	rpc_server:epmapper = daemon
+	rpc_server:tcpip = yes
 
         resolv:host file = $dns_host_file
 
diff --git a/source3/Makefile.in b/source3/Makefile.in
index ff2d433..f1fe0dd 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -749,7 +749,7 @@ RPC_RPCECHO_OBJ = rpc_server/echo/srv_echo_nt.o librpc/gen_ndr/srv_echo.o
 
 RPC_EPMAPPER_OBJ = rpc_server/epmapper/srv_epmapper.o librpc/gen_ndr/srv_epmapper.o
 
-RPC_SERVER_REGISTER_OBJ = rpc_server/rpc_ep_setup.o $(DCE_RPC_EP_OBJ)
+RPC_SERVER_REGISTER_OBJ = rpc_server/rpc_ep_register.o $(DCE_RPC_EP_OBJ)
 
 RPC_SERVER_OBJ = $(RPC_LSARPC_OBJ) $(RPC_WINREG_OBJ) $(RPC_INITSHUTDOWN_OBJ) \
 		 $(RPC_DSSETUP_OBJ) $(RPC_WKSSVC_OBJ) $(RPC_SVCCTL_OBJ) \
@@ -765,6 +765,8 @@ RPC_SERVER_OBJ = $(RPC_LSARPC_OBJ) $(RPC_WINREG_OBJ) $(RPC_INITSHUTDOWN_OBJ) \
 		 $(LIBCLI_NETLOGON_OBJ) \
 		 $(RPC_SERVER_REGISTER_OBJ) \
 		 $(RPC_CLIENT_SCHANNEL_OBJ) \
+		 rpc_server/rpc_sock_helper.o \
+		 rpc_server/rpc_service_setup.o \
 		 rpc_client/init_netlogon.o \
 		 rpc_client/init_samr.o
 
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 095c52c..2619e7b 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -793,6 +793,7 @@ int get_remote_hostname(const struct tsocket_address *remote_address,
 int create_pipe_sock(const char *socket_dir,
 		     const char *socket_name,
 		     mode_t dir_perms);
+int create_tcpip_socket(const struct sockaddr_storage *ifss, uint16_t *port);
 const char *get_mydnsfullname(void);
 bool is_myname_or_ipaddr(const char *s);
 struct tevent_req *getaddrinfo_send(TALLOC_CTX *mem_ctx,
diff --git a/source3/librpc/rpc/dcerpc_ep.c b/source3/librpc/rpc/dcerpc_ep.c
index 14d475f..336ff87 100644
--- a/source3/librpc/rpc/dcerpc_ep.c
+++ b/source3/librpc/rpc/dcerpc_ep.c
@@ -1,7 +1,7 @@
 /*
  *  Endpoint Mapper Functions
  *  DCERPC local endpoint mapper client routines
- *  Copyright (c) 2010      Andreas Schneider.
+ *  Copyright (c) 2010-2011 Andreas Schneider.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -28,16 +28,29 @@
 
 #define EPM_MAX_ANNOTATION_SIZE 64
 
-NTSTATUS dcerpc_binding_vector_create(TALLOC_CTX *mem_ctx,
-				      const struct ndr_interface_table *iface,
-				      uint16_t port,
-				      const char *ncalrpc,
-				      struct dcerpc_binding_vector **pbvec)
+static bool binding_vector_realloc(struct dcerpc_binding_vector *bvec)
+{
+	if (bvec->count >= bvec->allocated) {
+		struct dcerpc_binding *tmp;
+
+		tmp = talloc_realloc(bvec,
+				     bvec->bindings,
+				     struct dcerpc_binding,
+				     bvec->allocated * 2);
+		if (tmp == NULL) {
+			return false;
+		}
+		bvec->bindings = tmp;
+		bvec->allocated = bvec->allocated * 2;
+	}
+
+	return true;
+}
+
+NTSTATUS dcerpc_binding_vector_new(TALLOC_CTX *mem_ctx,
+				   struct dcerpc_binding_vector **pbvec)
 {
 	struct dcerpc_binding_vector *bvec;
-	uint32_t ep_count;
-	uint32_t count = 0;
-	uint32_t i;
 	NTSTATUS status;
 	TALLOC_CTX *tmp_ctx;
 
@@ -46,91 +59,236 @@ NTSTATUS dcerpc_binding_vector_create(TALLOC_CTX *mem_ctx,
 		return NT_STATUS_NO_MEMORY;
 	}
 
-	ep_count = iface->endpoints->count;
-
 	bvec = talloc_zero(tmp_ctx, struct dcerpc_binding_vector);
 	if (bvec == NULL) {
 		status = NT_STATUS_NO_MEMORY;
 		goto done;
 	}
 
-	bvec->bindings = talloc_zero_array(bvec, struct dcerpc_binding, ep_count);
+	bvec->bindings = talloc_zero_array(bvec,
+					   struct dcerpc_binding,
+					   4);
 	if (bvec->bindings == NULL) {
 		status = NT_STATUS_NO_MEMORY;
 		goto done;
 	}
 
+	bvec->allocated = 4;
+	bvec->count = 0;
+
+	*pbvec = talloc_move(mem_ctx, &bvec);
+
+	status = NT_STATUS_OK;
+done:
+	talloc_free(tmp_ctx);
+
+	return status;
+}
+
+NTSTATUS dcerpc_binding_vector_add_np_default(const struct ndr_interface_table *iface,
+					      struct dcerpc_binding_vector *bvec)
+{
+	uint32_t ep_count = iface->endpoints->count;
+	uint32_t i;
+	NTSTATUS status;
+	bool ok;
+
 	for (i = 0; i < ep_count; i++) {
 		struct dcerpc_binding *b;
 
 		b = talloc_zero(bvec->bindings, struct dcerpc_binding);
 		if (b == NULL) {
-			status = NT_STATUS_NO_MEMORY;
-			goto done;
+			return NT_STATUS_NO_MEMORY;
 		}
 
 		status = dcerpc_parse_binding(b, iface->endpoints->names[i], &b);
 		if (!NT_STATUS_IS_OK(status)) {
-			status = NT_STATUS_UNSUCCESSFUL;
-			goto done;
+			return NT_STATUS_UNSUCCESSFUL;
+		}
+
+		/* Only add the named pipes defined in the iface endpoints */
+		if (b->transport != NCACN_NP) {
+			talloc_free(b);
+			continue;
 		}
 
 		b->object = iface->syntax_id;
 
-		switch (b->transport) {
-			case NCACN_NP:
-				b->host = talloc_asprintf(b, "\\\\%s", lp_netbios_name());
-				if (b->host == NULL) {
-					status = NT_STATUS_NO_MEMORY;
-					goto done;
-				}
-				break;
-			case NCACN_IP_TCP:
-				if (port == 0) {
-					talloc_free(b);
-					continue;
-				}
-
-				b->endpoint = talloc_asprintf(b, "%u", port);
-				if (b->endpoint == NULL) {
-					status = NT_STATUS_NO_MEMORY;
-					goto done;
-				}
-
-				break;
-			case NCALRPC:
-				if (ncalrpc == NULL) {
-					talloc_free(b);
-					continue;
-				}
-
-				b->endpoint = talloc_asprintf(b,
-							      "%s/%s",
-							      lp_ncalrpc_dir(),
-							      ncalrpc);
-				if (b->endpoint == NULL) {
-					status = NT_STATUS_NO_MEMORY;
-					goto done;
-				}
-				break;
-			default:
-				talloc_free(b);
-				continue;
+		b->host = talloc_asprintf(b, "\\\\%s", lp_netbios_name());
+		if (b->host == NULL) {
+			talloc_free(b);
+			return NT_STATUS_NO_MEMORY;
+		}
+
+		ok = binding_vector_realloc(bvec);
+		if (!ok) {
+			talloc_free(b);
+			return NT_STATUS_NO_MEMORY;
 		}
 
-		bvec->bindings[count] = *b;
-		count++;
+		bvec->bindings[bvec->count] = *b;
+		bvec->count++;
 	}
 
-	bvec->count = count;
+	return NT_STATUS_OK;
+}
 
-	*pbvec = talloc_move(mem_ctx, &bvec);
+NTSTATUS dcerpc_binding_vector_add_port(const struct ndr_interface_table *iface,
+					struct dcerpc_binding_vector *bvec,
+					const char *host,
+					uint16_t port)
+{
+	uint32_t ep_count = iface->endpoints->count;
+	uint32_t i;
+	NTSTATUS status;
+	bool ok;
 
-	status = NT_STATUS_OK;
-done:
-	talloc_free(tmp_ctx);
+	for (i = 0; i < ep_count; i++) {
+		struct dcerpc_binding *b;
 
-	return status;
+		b = talloc_zero(bvec->bindings, struct dcerpc_binding);
+		if (b == NULL) {
+			return NT_STATUS_NO_MEMORY;
+		}
+
+		status = dcerpc_parse_binding(b, iface->endpoints->names[i], &b);
+		if (!NT_STATUS_IS_OK(status)) {
+			return NT_STATUS_UNSUCCESSFUL;
+		}
+
+		if (b->transport != NCACN_IP_TCP) {
+			talloc_free(b);
+			continue;
+		}
+
+		b->object = iface->syntax_id;
+
+		b->host = talloc_strdup(b, host);
+		if (b->host == NULL) {
+			talloc_free(b);
+			return NT_STATUS_NO_MEMORY;
+		}
+
+		b->endpoint = talloc_asprintf(b, "%u", port);
+		if (b->endpoint == NULL) {
+			talloc_free(b);
+			return NT_STATUS_NO_MEMORY;
+		}
+
+		ok = binding_vector_realloc(bvec);
+		if (!ok) {
+			talloc_free(b);
+			return NT_STATUS_NO_MEMORY;
+		}
+
+		bvec->bindings[bvec->count] = *b;
+		bvec->count++;
+
+		break;
+	}
+
+	return NT_STATUS_OK;
+}
+
+NTSTATUS dcerpc_binding_vector_add_unix(const struct ndr_interface_table *iface,
+					struct dcerpc_binding_vector *bvec,
+					const char *name)
+{
+	uint32_t ep_count = iface->endpoints->count;
+	uint32_t i;
+	NTSTATUS status;
+	bool ok;
+
+	for (i = 0; i < ep_count; i++) {
+		struct dcerpc_binding *b;
+
+		b = talloc_zero(bvec->bindings, struct dcerpc_binding);
+		if (b == NULL) {
+			return NT_STATUS_NO_MEMORY;
+		}
+
+		status = dcerpc_parse_binding(b, iface->endpoints->names[i], &b);
+		if (!NT_STATUS_IS_OK(status)) {
+			return NT_STATUS_UNSUCCESSFUL;
+		}
+
+		if (b->transport != NCALRPC) {
+			talloc_free(b);
+			continue;
+		}
+
+		b->object = iface->syntax_id;
+
+		b->endpoint = talloc_asprintf(b,
+					      "%s/%s",
+					      lp_ncalrpc_dir(),
+					      name);
+		if (b->endpoint == NULL) {
+			talloc_free(b);
+			return NT_STATUS_NO_MEMORY;
+		}
+
+		ok = binding_vector_realloc(bvec);
+		if (!ok) {
+			talloc_free(b);
+			return NT_STATUS_NO_MEMORY;
+		}
+
+		bvec->bindings[bvec->count] = *b;
+		bvec->count++;
+
+		break;
+	}
+
+	return NT_STATUS_OK;
+}
+
+NTSTATUS dcerpc_binding_vector_replace_iface(const struct ndr_interface_table *iface,
+					     struct dcerpc_binding_vector *v)
+{
+	uint32_t i;
+
+	for (i = 0; i < v->count; i++) {
+		struct dcerpc_binding *b;
+
+		b = &(v->bindings[i]);
+		b->object = iface->syntax_id;
+	}
+
+	return NT_STATUS_OK;
+}
+
+struct dcerpc_binding_vector *dcerpc_binding_vector_dup(TALLOC_CTX *mem_ctx,
+							const struct dcerpc_binding_vector *bvec)
+{
+	struct dcerpc_binding_vector *v;
+	uint32_t i;
+
+	v = talloc(mem_ctx, struct dcerpc_binding_vector);
+	if (v == NULL) {
+		return NULL;
+	}
+
+	v->bindings = talloc_array(v, struct dcerpc_binding, bvec->allocated);
+	if (v->bindings == NULL) {
+		talloc_free(v);
+		return NULL;
+	}
+	v->allocated = bvec->allocated;
+
+	for (i = 0; i < bvec->count; i++) {
+		struct dcerpc_binding *b;
+
+		b = dcerpc_binding_dup(v->bindings, &bvec->bindings[i]);
+		if (b == NULL) {
+			talloc_free(v);
+			return NULL;
+		}
+		v->bindings[i] = *b;
+	}
+	v->count = bvec->count;
+
+	return v;
 }
 
 static NTSTATUS ep_register(TALLOC_CTX *mem_ctx,
diff --git a/source3/librpc/rpc/dcerpc_ep.h b/source3/librpc/rpc/dcerpc_ep.h
index 226d402..8bcf184 100644
--- a/source3/librpc/rpc/dcerpc_ep.h
+++ b/source3/librpc/rpc/dcerpc_ep.h
@@ -1,7 +1,7 @@
 /*
  *  Endpoint Mapper Functions
  *  DCERPC local endpoint mapper client routines
- *  Copyright (c) 2010      Andreas Schneider.
+ *  Copyright (c) 2010-2011 Andreas Schneider.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -23,13 +23,89 @@
 struct dcerpc_binding_vector {
     struct dcerpc_binding *bindings;
     uint32_t count;
+    uint32_t allocated;
 };
 
-NTSTATUS dcerpc_binding_vector_create(TALLOC_CTX *mem_ctx,
-				      const struct ndr_interface_table *iface,
-				      uint16_t port,
-				      const char *ncalrpc,
-				      struct dcerpc_binding_vector **pbvec);
+/**
+ * @brief Allocate a new binding vector.
+ *
+ * @param[in]  mem_ctx  The memory context to allocate the vector.
+ *
+ * @param[out] pbvec    A pointer to store the binding vector.
+ *
+ * @return              An NTSTATUS error code.
+ */
+NTSTATUS dcerpc_binding_vector_new(TALLOC_CTX *mem_ctx,
+				   struct dcerpc_binding_vector **pbvec);
+
+/**
+ * @brief Add default named pipes to the binding vector.
+ *
+ * @param[in] iface     The rpc interface to add.
+ *
+ * @param[in] bvec      The binding vector to add the interface.
+ *
+ * @return              An NTSTATUS error code.
+ */
+NTSTATUS dcerpc_binding_vector_add_np_default(const struct ndr_interface_table *iface,
+					      struct dcerpc_binding_vector *bvec);
+
+/**
+ * @brief Add a tcpip port to a binding vector.
+ *
+ * @param[in] iface     The rpc interface to add.
+ *
+ * @param[in] bvec      The binding vector to add the intface, host and port.
+ *
+ * @param[in] host      The ip address of the network inteface bound.
+ *
+ * @param[in] port      The port bound.
+ *
+ * @return              An NTSTATUS error code.
+ */
+NTSTATUS dcerpc_binding_vector_add_port(const struct ndr_interface_table *iface,
+					struct dcerpc_binding_vector *bvec,
+					const char *host,
+					uint16_t port);
+
+/**
+ * @brief Add a unix socket (ncalrpc) to a binding vector.
+ *
+ * @param[in] iface     The rpc interface to add.
+ *
+ * @param[in] bvec      The binding vector to add the intface, host and port.
+ *
+ * @param[in] name      The name of the unix socket.
+ *
+ * @return              An NTSTATUS error code.
+ */
+NTSTATUS dcerpc_binding_vector_add_unix(const struct ndr_interface_table *iface,
+					struct dcerpc_binding_vector *bvec,
+					const char *name);
+
+/**
+ * @brief Duplicate a dcerpc_binding_vector.
+ *
+ * @param[in] mem_ctx   The memory context to create the duplicate on.
+ *
+ * @param[in] bvec      The binding vector to duplicate.
+ *
+ * @return              The duplicated binding vector or NULL on error.
+ */
+struct dcerpc_binding_vector *dcerpc_binding_vector_dup(TALLOC_CTX *mem_ctx,
+							const struct dcerpc_binding_vector *bvec);
+
+/**
+ * @brief Replace the interface of the bindings in the vector.
+ *
+ * @param[in] iface     The new interface identifier to use.
+ *
+ * @param[in] v         The binding vector to change.
+ *
+ * @return              An NTSTATUS error code.


-- 
Samba Shared Repository


More information about the samba-cvs mailing list