gensec: Cast data for MIT Kerberos correctly
[Samba.git] / source3 / librpc / rpc / dcerpc_ep.h
blob6cd46830a587c2064534658244901a62f3902e5a
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;
25 /**
26 * @brief Allocate a new binding vector.
28 * @param[in] mem_ctx The memory context to allocate the vector.
30 * @param[out] pbvec A pointer to store the binding vector.
32 * @return An NTSTATUS error code.
34 NTSTATUS dcerpc_binding_vector_new(TALLOC_CTX *mem_ctx,
35 struct dcerpc_binding_vector **pbvec);
37 /**
38 * @brief Add default named pipes to the binding vector.
40 * @param[in] iface The rpc interface to add.
42 * @param[in] bvec The binding vector to add the interface.
44 * @return An NTSTATUS error code.
46 NTSTATUS dcerpc_binding_vector_add_np_default(const struct ndr_interface_table *iface,
47 struct dcerpc_binding_vector *bvec);
49 /**
50 * @brief Add a tcpip port to a binding vector.
52 * @param[in] iface The rpc interface to add.
54 * @param[in] bvec The binding vector to add the interface, host and port.
56 * @param[in] host The ip address of the network interface bound.
58 * @param[in] port The port bound.
60 * @return An NTSTATUS error code.
62 NTSTATUS dcerpc_binding_vector_add_port(const struct ndr_interface_table *iface,
63 struct dcerpc_binding_vector *bvec,
64 const char *host,
65 uint16_t port);
67 /**
68 * @brief Add a unix socket (ncalrpc) to a binding vector.
70 * @param[in] iface The rpc interface to add.
72 * @param[in] bvec The binding vector to add the interface, host and port.
74 * @param[in] name The name of the unix socket.
76 * @return An NTSTATUS error code.
78 NTSTATUS dcerpc_binding_vector_add_unix(const struct ndr_interface_table *iface,
79 struct dcerpc_binding_vector *bvec,
80 const char *name);
82 /**
83 * @brief Duplicate a dcerpc_binding_vector.
85 * @param[in] mem_ctx The memory context to create the duplicate on.
87 * @param[in] bvec The binding vector to duplicate.
89 * @return The duplicated binding vector or NULL on error.
91 struct dcerpc_binding_vector *dcerpc_binding_vector_dup(TALLOC_CTX *mem_ctx,
92 const struct dcerpc_binding_vector *bvec);
94 /**
95 * @brief Replace the interface of the bindings in the vector.
97 * @param[in] iface The new interface identifier to use.
99 * @param[in] v The binding vector to change.
101 * @return An NTSTATUS error code.
103 NTSTATUS dcerpc_binding_vector_replace_iface(const struct ndr_interface_table *iface,
104 struct dcerpc_binding_vector *v);
107 * @brief Adds server address information in the local endpoint map.
109 * @param[in] mem_ctx The memory context to use for the binding handle.
111 * @param[in] iface The interface specification to register with the local
112 * endpoint map.
114 * @param[in] binding The server binding handles over which the server can
115 * receive remote procedure calls.
117 * @param[in] object_guid The object GUID that the server offers. The server
118 * application constructs this vector.
120 * @param[in] annotation Defines a character string comment applied to the
121 * element added to the local endpoint map. The string
122 * can be up to 64 characters long, including the null
123 * terminating character. Strings longer than 64
124 * characters are truncated. The application supplies
125 * the value NULL or the string "" to indicate an empty
126 * annotation string.
128 * When replacing elements, the annotation string
129 * supplied, including an empty annotation string,
130 * replaces any existing annotation string.
132 * @param[out] ph A pointer to store the binding handle. The memory
133 * context will be the give one. If you free this handle
134 * then the connection will be closed.
136 * @return An NTSTATUS error code.
138 NTSTATUS dcerpc_ep_register(TALLOC_CTX *mem_ctx,
139 struct messaging_context *msg_ctx,
140 const struct ndr_interface_table *iface,
141 const struct dcerpc_binding_vector *bind_vec,
142 const struct GUID *object_guid,
143 const char *annotation,
144 struct dcerpc_binding_handle **ph);
146 NTSTATUS dcerpc_ep_register_noreplace(TALLOC_CTX *mem_ctx,
147 struct messaging_context *msg_ctx,
148 const struct ndr_interface_table *iface,
149 const struct dcerpc_binding_vector *bind_vec,
150 const struct GUID *object_guid,
151 const char *annotation,
152 struct dcerpc_binding_handle **ph);
154 NTSTATUS dcerpc_ep_unregister(struct messaging_context *msg_ctx,
155 const struct ndr_interface_table *iface,
156 const struct dcerpc_binding_vector *bind_vec,
157 const struct GUID *object_guid);
159 #endif /* _DCERPC_EP_H_ */