2010-09-02 16:24:26 +02:00
/*
* Endpoint Mapper Functions
* DCERPC local endpoint mapper client routines
2011-06-30 11:52:59 +02:00
* Copyright ( c ) 2010 - 2011 Andreas Schneider .
2010-09-02 16:24:26 +02:00
*
* 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
* the Free Software Foundation ; either version 3 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , see < http : //www.gnu.org/licenses/>.
*/
# ifndef _DCERPC_EP_H_
# define _DCERPC_EP_H_
2014-02-07 15:50:29 +01:00
struct dcerpc_binding_vector ;
2010-09-02 16:24:26 +02:00
2011-06-30 11:52:59 +02:00
/**
* @ 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 ) ;
2011-06-30 11:56:11 +02:00
/**
* @ 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 ) ;
2011-06-30 12:01:10 +02:00
/**
* @ brief Add a tcpip port to a binding vector .
*
* @ param [ in ] iface The rpc interface to add .
*
2015-06-03 13:33:00 +02:00
* @ param [ in ] bvec The binding vector to add the interface , host and port .
2011-06-30 12:01:10 +02:00
*
2015-06-03 13:33:00 +02:00
* @ param [ in ] host The ip address of the network interface bound .
2011-06-30 12:01:10 +02:00
*
* @ 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 ) ;
2011-06-30 12:02:33 +02:00
/**
* @ brief Add a unix socket ( ncalrpc ) to a binding vector .
*
* @ param [ in ] iface The rpc interface to add .
*
2015-06-03 13:33:00 +02:00
* @ param [ in ] bvec The binding vector to add the interface , host and port .
2011-06-30 12:02:33 +02:00
*
* @ 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 ) ;
2011-07-01 14:36:31 +02:00
/**
* @ 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 ) ;
2011-07-01 14:39:58 +02:00
/**
* @ 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 .
*/
NTSTATUS dcerpc_binding_vector_replace_iface ( const struct ndr_interface_table * iface ,
struct dcerpc_binding_vector * v ) ;
2010-09-02 16:24:26 +02:00
/**
* @ brief Adds server address information in the local endpoint map .
*
2011-03-09 10:17:06 +01:00
* @ param [ in ] mem_ctx The memory context to use for the binding handle .
*
2010-09-02 16:24:26 +02:00
* @ param [ in ] iface The interface specification to register with the local
* endpoint map .
*
* @ param [ in ] binding The server binding handles over which the server can
* receive remote procedure calls .
*
* @ param [ in ] object_guid The object GUID that the server offers . The server
* application constructs this vector .
*
* @ param [ in ] annotation Defines a character string comment applied to the
* element added to the local endpoint map . The string
* can be up to 64 characters long , including the null
* terminating character . Strings longer than 64
* characters are truncated . The application supplies
* the value NULL or the string " " to indicate an empty
* annotation string .
*
* When replacing elements , the annotation string
* supplied , including an empty annotation string ,
* replaces any existing annotation string .
*
2011-03-09 10:17:06 +01:00
* @ param [ out ] ph A pointer to store the binding handle . The memory
* context will be the give one . If you free this handle
* then the connection will be closed .
*
2010-09-02 16:24:26 +02:00
* @ return An NTSTATUS error code .
*/
2011-03-09 10:17:06 +01:00
NTSTATUS dcerpc_ep_register ( TALLOC_CTX * mem_ctx ,
2011-07-08 11:34:24 +02:00
struct messaging_context * msg_ctx ,
2011-03-09 10:17:06 +01:00
const struct ndr_interface_table * iface ,
2010-09-02 16:24:26 +02:00
const struct dcerpc_binding_vector * bind_vec ,
const struct GUID * object_guid ,
2011-03-09 10:17:06 +01:00
const char * annotation ,
struct dcerpc_binding_handle * * ph ) ;
2010-09-02 16:24:26 +02:00
2011-03-09 10:17:06 +01:00
NTSTATUS dcerpc_ep_register_noreplace ( TALLOC_CTX * mem_ctx ,
2011-07-08 11:34:24 +02:00
struct messaging_context * msg_ctx ,
2011-03-09 10:17:06 +01:00
const struct ndr_interface_table * iface ,
2010-09-02 16:24:26 +02:00
const struct dcerpc_binding_vector * bind_vec ,
const struct GUID * object_guid ,
2011-03-09 10:17:06 +01:00
const char * annotation ,
struct dcerpc_binding_handle * * ph ) ;
2010-09-02 16:24:26 +02:00
2011-07-08 11:34:24 +02:00
NTSTATUS dcerpc_ep_unregister ( struct messaging_context * msg_ctx ,
const struct ndr_interface_table * iface ,
2010-09-16 10:48:33 +02:00
const struct dcerpc_binding_vector * bind_vec ,
const struct GUID * object_guid ) ;
2010-09-02 16:24:26 +02:00
# endif /* _DCERPC_EP_H_ */