mapiproxy/dcesrv_mapiproxy.c File Reference

mapiproxy main file More...

#include "mapiproxy/dcesrv_mapiproxy.h"
#include "mapiproxy/dcesrv_mapiproxy_proto.h"
#include <dlinklist.h>
#include "libmapi/libmapi.h"
#include "libmapi/libmapi_private.h"
#include "gen_ndr/ndr_exchange_s.c"

Functions

NTSTATUS dcerpc_server_mapiproxy_init (void)
static bool mapiproxy_fill_interface (struct dcesrv_interface *iface, const struct ndr_interface_table *tbl)
static NTSTATUS mapiproxy_op_bind (struct dcesrv_call_state *dce_call, const struct dcesrv_interface *iface, uint32_t if_version)
static NTSTATUS mapiproxy_op_bind_proxy (struct dcesrv_call_state *dce_call, const struct dcesrv_interface *iface, uint32_t if_version)
static NTSTATUS mapiproxy_op_connect (struct dcesrv_call_state *dce_call, const struct ndr_interface_table *table, const char *binding)
static NTSTATUS mapiproxy_op_dispatch (struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
static NTSTATUS mapiproxy_op_init_server (struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
static bool mapiproxy_op_interface_by_name (struct dcesrv_interface *iface, const char *name)
static bool mapiproxy_op_interface_by_uuid (struct dcesrv_interface *iface, const struct GUID *uuid, uint32_t if_version)
static NTSTATUS mapiproxy_op_ndr_pull (struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_pull *pull, void **r)
static NTSTATUS mapiproxy_op_ndr_push (struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, const void *r)
static NTSTATUS mapiproxy_op_reply (struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
static void mapiproxy_op_unbind (struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
static NTSTATUS mapiproxy_register_one_iface (struct dcesrv_context *dce_ctx, const struct dcesrv_interface *iface)
NTSTATUS samba_init_module (void)

Detailed Description

mapiproxy main file


Function Documentation

NTSTATUS dcerpc_server_mapiproxy_init ( void  )

register the mapiproxy endpoint server.

Returns:
NT_STATUS_OK on success, otherwise NTSTATUS error

References mapiproxy_op_init_server(), mapiproxy_op_interface_by_name(), mapiproxy_op_interface_by_uuid(), and ndr_table_init().

Referenced by samba_init_module().

static bool mapiproxy_fill_interface ( struct dcesrv_interface *  iface,
const struct ndr_interface_table *  tbl 
) [static]
static NTSTATUS mapiproxy_op_bind ( struct dcesrv_call_state *  dce_call,
const struct dcesrv_interface *  iface,
uint32_t  if_version 
) [static]

This function is called when the client binds to one of the interfaces mapiproxy handles.

Parameters:
dce_callpointer to the session context
ifacepointer to the dcesrv interface structure with function hooks
if_versionthe version of the pipe
Returns:
NT_STATUS_OK on success, otherwise NTSTATUS error

References dcesrv_mapiproxy_private::c_pipe, dcesrv_mapiproxy_private::connected, dcesrv_mapiproxy_private::exchname, mapiproxy_op_bind_proxy(), and dcesrv_mapiproxy_private::server_mode.

Referenced by mapiproxy_fill_interface().

static NTSTATUS mapiproxy_op_bind_proxy ( struct dcesrv_call_state *  dce_call,
const struct dcesrv_interface *  iface,
uint32_t  if_version 
) [static]
static NTSTATUS mapiproxy_op_connect ( struct dcesrv_call_state *  dce_call,
const struct ndr_interface_table *  table,
const char *  binding 
) [static]
static NTSTATUS mapiproxy_op_dispatch ( struct dcesrv_call_state *  dce_call,
TALLOC_CTX *  mem_ctx,
void *  r 
) [static]

This function is called after the pull but before the push. Moreover it is called before the request is forward to the remote endpoint.

Parameters:
dce_callpointer to the session context
mem_ctxpointer to the memory context
rgeneric pointer to the call mapped data
Returns:
NT_STATUS_OK on success, otherwise NTSTATUS error

References mapiproxy::ahead, dcesrv_mapiproxy_private::c_pipe, mapiproxy_module_dispatch(), mapiproxy_NspiDNToMId(), mapiproxy_server_dispatch(), mapiproxy_server_loaded(), mapiproxy::norelay, and dcesrv_mapiproxy_private::server_mode.

Referenced by mapiproxy_fill_interface().

static NTSTATUS mapiproxy_op_init_server ( struct dcesrv_context *  dce_ctx,
const struct dcesrv_endpoint_server *  ep_server 
) [static]

Initializes the server and register emsmdb,nspi and rfr interfaces

Parameters:
dce_ctxpointer to the dcesrv context
ep_serverpointer to the endpoint server list
Returns:
NT_STATUS_OK on success, otherwise NTSTATUS error

References mapiproxy_module_init(), mapiproxy_register_one_iface(), and mapiproxy_server_init().

Referenced by dcerpc_server_mapiproxy_init().

static bool mapiproxy_op_interface_by_name ( struct dcesrv_interface *  iface,
const char *  name 
) [static]
static bool mapiproxy_op_interface_by_uuid ( struct dcesrv_interface *  iface,
const struct GUID *  uuid,
uint32_t  if_version 
) [static]
static NTSTATUS mapiproxy_op_ndr_pull ( struct dcesrv_call_state *  dce_call,
TALLOC_CTX *  mem_ctx,
struct ndr_pull *  pull,
void **  r 
) [static]

This is the function called when mapiproxy receives a request. The request has already been extracted and its information filled into structures

Parameters:
dce_callpointer to the session context
mem_ctxpointer to the memory context
pullpointer on pointer to the ndr_pull structure
rgeneric pointer on pointer to the pulled ndr content
Returns:
NT_STATUS_OK on success, other NTSTATUS error

References dcesrv_mapiproxy_private::connected, mapiproxy_module_ndr_pull(), mapiproxy_module_pull(), mapiproxy_op_connect(), and dcesrv_mapiproxy_private::server_mode.

Referenced by mapiproxy_fill_interface().

static NTSTATUS mapiproxy_op_ndr_push ( struct dcesrv_call_state *  dce_call,
TALLOC_CTX *  mem_ctx,
struct ndr_push *  push,
const void *  r 
) [static]

This is the function called when mapiproxy receive a response. The response has already been extracted and its information filled into structures

Parameters:
dce_callpointer to the session context
mem_ctxpointer to the memory context
pushpointer to the ndr_push structure
rgeneric pointer to the data pushed
Returns:
NT_STATUS_OK on success, otherwise a NTSTATUS error

References mapiproxy_module_push(), mapiproxy_NspiGetProps(), mapiproxy_NspiQueryRows(), mapiproxy_RfrGetNewDSA(), mapiproxy_server_loaded(), and dcesrv_mapiproxy_private::server_mode.

Referenced by mapiproxy_fill_interface().

static NTSTATUS mapiproxy_op_reply ( struct dcesrv_call_state *  dce_call,
TALLOC_CTX *  mem_ctx,
void *  r 
) [static]
static void mapiproxy_op_unbind ( struct dcesrv_connection_context *  context,
const struct dcesrv_interface *  iface 
) [static]

Called when the client disconnects from one of the endpoints managed by mapiproxy.

Parameters:
contextpointer to the connection context
ifacepointer to the dcesrv interface structure with function hooks

References dcesrv_mapiproxy_private::c_pipe, mapiproxy_module_unbind(), and mapiproxy_server_unbind().

Referenced by mapiproxy_fill_interface().

static NTSTATUS mapiproxy_register_one_iface ( struct dcesrv_context *  dce_ctx,
const struct dcesrv_interface *  iface 
) [static]

Register an endpoint

Parameters:
dce_ctxpointer to the dcerpc context
ifacepointer to the dcesrv interface with function hooks
Returns:
NT_STATUS_OK on success, otherwise NTSTATUS error

Referenced by mapiproxy_op_init_server().

NTSTATUS samba_init_module ( void  )

Register mapiproxy dynamic shared object modules

This function registers mapiproxy modules located

Entry point of mapiproxy dynamic shared object.

This function first registers exchange endpoints and ndr tables, then attempts to register the mapiproxy interface.

Returns:
NT_STATUS_OK on success, otherwise NT_STATUS_UNSUCCESSFUL;

Entry point for the pack mapiproxy module

Returns:
NT_STATUS_OK on success, otherwise NTSTATUS error

Creative Commons License
Creative Commons Attribution icon Creative Commons Share Alike icon
This content is licensed under the Creative Commons
Attribution ShareAlike License v. 3.0:
http://creativecommons.org/licenses/by-sa/3.0/