f843795322522743f433c226d840a308bd690869
[samba.git] / source3 / librpc / rpc / dcerpc_ep.h
1 /*
2  *  Endpoint Mapper Functions
3  *  DCERPC local endpoint mapper client routines
4  *  Copyright (c) 2010-2011 Andreas Schneider.
5  *
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.
10  *
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.
15  *
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/>.
18  */
19
20 #ifndef _DCERPC_EP_H_
21 #define _DCERPC_EP_H_
22
23 struct dcesrv_context;
24 struct dcesrv_interface;
25
26 /**
27  * @brief Adds server address information in the local endpoint map.
28  *
29  * @param[in]  mem_ctx  The memory context to use for the binding handle.
30  *
31  * @param[in]  dce_ctx  The dcerpc server context
32  *
33  * @param[in]  iface  The interface to register in the endpoint mapper
34  *
35  * @param[in]  object_guid The object GUID that the server offers. The server
36  *                         application constructs this vector.
37  *
38  * @param[in]  annotation  Defines a character string comment applied to the
39  *                         element added to the local endpoint map. The string
40  *                         can be up to 64 characters long, including the null
41  *                         terminating character. Strings longer than 64
42  *                         characters are truncated. The application supplies
43  *                         the value NULL or the string "" to indicate an empty
44  *                         annotation string.
45  *
46  *                         When replacing elements, the annotation string
47  *                         supplied, including an empty annotation string,
48  *                         replaces any existing annotation string.
49  *
50  * @param[out] ph          A pointer to store the binding handle. The memory
51  *                         context will be the give one. If you free this handle
52  *                         then the connection will be closed.
53  *
54  * @return                 An NTSTATUS error code.
55  */
56 NTSTATUS dcerpc_ep_register(TALLOC_CTX *mem_ctx,
57                             struct messaging_context *msg_ctx,
58                             struct dcesrv_context *dce_ctx,
59                             const struct dcesrv_interface *iface,
60                             const struct GUID *object_guid,
61                             const char *annotation,
62                             struct dcerpc_binding_handle **ph);
63
64 NTSTATUS dcerpc_ep_register_noreplace(TALLOC_CTX *mem_ctx,
65                                       struct messaging_context *msg_ctx,
66                                       struct dcesrv_context *dce_ctx,
67                                       const struct dcesrv_interface *iface,
68                                       const struct GUID *object_guid,
69                                       const char *annotation,
70                                       struct dcerpc_binding_handle **ph);
71
72 NTSTATUS dcerpc_ep_unregister(struct messaging_context *msg_ctx,
73                               struct dcesrv_context *dce_ctx,
74                               const struct dcesrv_interface *iface,
75                               const struct GUID *object_guid);
76
77 #endif /* _DCERPC_EP_H_ */