idmap_rfc2307: Fix wbinfo --gid-to-sid query
[Samba.git] / source3 / librpc / rpc / dcerpc_ep.h
blob8bcf184280b4ddc648113a620b3ff2341365a523
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);
111 * @brief Adds server address information in the local endpoint map.
113 * @param[in] mem_ctx The memory context to use for the binding handle.
115 * @param[in] iface The interface specification to register with the local
116 * endpoint map.
118 * @param[in] binding The server binding handles over which the server can
119 * receive remote procedure calls.
121 * @param[in] object_guid The object GUID that the server offers. The server
122 * application constructs this vector.
124 * @param[in] annotation Defines a character string comment applied to the
125 * element added to the local endpoint map. The string
126 * can be up to 64 characters long, including the null
127 * terminating character. Strings longer than 64
128 * characters are truncated. The application supplies
129 * the value NULL or the string "" to indicate an empty
130 * annotation string.
132 * When replacing elements, the annotation string
133 * supplied, including an empty annotation string,
134 * replaces any existing annotation string.
136 * @param[out] ph A pointer to store the binding handle. The memory
137 * context will be the give one. If you free this handle
138 * then the connection will be closed.
140 * @return An NTSTATUS error code.
142 NTSTATUS dcerpc_ep_register(TALLOC_CTX *mem_ctx,
143 struct messaging_context *msg_ctx,
144 const struct ndr_interface_table *iface,
145 const struct dcerpc_binding_vector *bind_vec,
146 const struct GUID *object_guid,
147 const char *annotation,
148 struct dcerpc_binding_handle **ph);
150 NTSTATUS dcerpc_ep_register_noreplace(TALLOC_CTX *mem_ctx,
151 struct messaging_context *msg_ctx,
152 const struct ndr_interface_table *iface,
153 const struct dcerpc_binding_vector *bind_vec,
154 const struct GUID *object_guid,
155 const char *annotation,
156 struct dcerpc_binding_handle **ph);
158 NTSTATUS dcerpc_ep_unregister(struct messaging_context *msg_ctx,
159 const struct ndr_interface_table *iface,
160 const struct dcerpc_binding_vector *bind_vec,
161 const struct GUID *object_guid);
163 #endif /* _DCERPC_EP_H_ */