s3-librpc: Add dcerpc_binding_vector_replace_iface().
[Samba/gebeck_regimport.git] / source3 / librpc / rpc / dcerpc_ep.h
blobba1e688e6c1307ef9b6474f961e6d13d0b71eff2
1 /*
2 * Endpoint Mapper Functions
3 * DCERPC local endpoint mapper client routines
4 * Copyright (c) 2010-2011 Andreas Schneider.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20 #ifndef _DCERPC_EP_H_
21 #define _DCERPC_EP_H_
23 struct dcerpc_binding_vector {
24 struct dcerpc_binding *bindings;
25 uint32_t count;
26 uint32_t allocated;
29 /**
30 * @brief Allocate a new binding vector.
32 * @param[in] mem_ctx The memory context to allocate the vector.
34 * @param[out] pbvec A pointer to store the binding vector.
36 * @return An NTSTATUS error code.
38 NTSTATUS dcerpc_binding_vector_new(TALLOC_CTX *mem_ctx,
39 struct dcerpc_binding_vector **pbvec);
41 /**
42 * @brief Add default named pipes to the binding vector.
44 * @param[in] iface The rpc interface to add.
46 * @param[in] bvec The binding vector to add the interface.
48 * @return An NTSTATUS error code.
50 NTSTATUS dcerpc_binding_vector_add_np_default(const struct ndr_interface_table *iface,
51 struct dcerpc_binding_vector *bvec);
53 /**
54 * @brief Add a tcpip port to a binding vector.
56 * @param[in] iface The rpc interface to add.
58 * @param[in] bvec The binding vector to add the intface, host and port.
60 * @param[in] host The ip address of the network inteface bound.
62 * @param[in] port The port bound.
64 * @return An NTSTATUS error code.
66 NTSTATUS dcerpc_binding_vector_add_port(const struct ndr_interface_table *iface,
67 struct dcerpc_binding_vector *bvec,
68 const char *host,
69 uint16_t port);
71 /**
72 * @brief Add a unix socket (ncalrpc) to a binding vector.
74 * @param[in] iface The rpc interface to add.
76 * @param[in] bvec The binding vector to add the intface, host and port.
78 * @param[in] name The name of the unix socket.
80 * @return An NTSTATUS error code.
82 NTSTATUS dcerpc_binding_vector_add_unix(const struct ndr_interface_table *iface,
83 struct dcerpc_binding_vector *bvec,
84 const char *name);
86 /**
87 * @brief Duplicate a dcerpc_binding_vector.
89 * @param[in] mem_ctx The memory context to create the duplicate on.
91 * @param[in] bvec The binding vector to duplicate.
93 * @return The duplicated binding vector or NULL on error.
95 struct dcerpc_binding_vector *dcerpc_binding_vector_dup(TALLOC_CTX *mem_ctx,
96 const struct dcerpc_binding_vector *bvec);
98 /**
99 * @brief Replace the interface of the bindings in the vector.
101 * @param[in] iface The new interface identifier to use.
103 * @param[in] v The binding vector to change.
105 * @return An NTSTATUS error code.
107 NTSTATUS dcerpc_binding_vector_replace_iface(const struct ndr_interface_table *iface,
108 struct dcerpc_binding_vector *v);
110 NTSTATUS dcerpc_binding_vector_create(TALLOC_CTX *mem_ctx,
111 const struct ndr_interface_table *iface,
112 uint16_t port,
113 const char *ncalrpc,
114 struct dcerpc_binding_vector **pbvec);
117 * @brief Adds server address information in the local endpoint map.
119 * @param[in] mem_ctx The memory context to use for the binding handle.
121 * @param[in] iface The interface specification to register with the local
122 * endpoint map.
124 * @param[in] binding The server binding handles over which the server can
125 * receive remote procedure calls.
127 * @param[in] object_guid The object GUID that the server offers. The server
128 * application constructs this vector.
130 * @param[in] annotation Defines a character string comment applied to the
131 * element added to the local endpoint map. The string
132 * can be up to 64 characters long, including the null
133 * terminating character. Strings longer than 64
134 * characters are truncated. The application supplies
135 * the value NULL or the string "" to indicate an empty
136 * annotation string.
138 * When replacing elements, the annotation string
139 * supplied, including an empty annotation string,
140 * replaces any existing annotation string.
142 * @param[out] ph A pointer to store the binding handle. The memory
143 * context will be the give one. If you free this handle
144 * then the connection will be closed.
146 * @return An NTSTATUS error code.
148 NTSTATUS dcerpc_ep_register(TALLOC_CTX *mem_ctx,
149 struct messaging_context *msg_ctx,
150 const struct ndr_interface_table *iface,
151 const struct dcerpc_binding_vector *bind_vec,
152 const struct GUID *object_guid,
153 const char *annotation,
154 struct dcerpc_binding_handle **ph);
156 NTSTATUS dcerpc_ep_register_noreplace(TALLOC_CTX *mem_ctx,
157 struct messaging_context *msg_ctx,
158 const struct ndr_interface_table *iface,
159 const struct dcerpc_binding_vector *bind_vec,
160 const struct GUID *object_guid,
161 const char *annotation,
162 struct dcerpc_binding_handle **ph);
164 NTSTATUS dcerpc_ep_unregister(struct messaging_context *msg_ctx,
165 const struct ndr_interface_table *iface,
166 const struct dcerpc_binding_vector *bind_vec,
167 const struct GUID *object_guid);
169 #endif /* _DCERPC_EP_H_ */