mapiproxy/servers/default/nspi/dcesrv_exchange_nsp.c File Reference

OpenChange NSPI Server implementation. More...

#include "mapiproxy/dcesrv_mapiproxy.h"
#include "dcesrv_exchange_nsp.h"

Functions

static NTSTATUS dcesrv_exchange_nsp_dispatch (struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r, struct mapiproxy *mapiproxy)
static NTSTATUS dcesrv_exchange_nsp_init (struct dcesrv_context *dce_ctx)
static NTSTATUS dcesrv_exchange_nsp_unbind (struct server_id server_id, uint32_t context_id)
static struct emsabp_contextdcesrv_find_emsabp_context (struct GUID *uuid)
static struct
exchange_nsp_session
dcesrv_find_nsp_session (struct GUID *uuid)
static void dcesrv_NspiBind (struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct NspiBind *r)
static void dcesrv_NspiCompareMIds (struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct NspiCompareMIds *r)
static void dcesrv_NspiDeleteEntries (struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct NspiDeleteEntries *r)
static void dcesrv_NspiDNToMId (struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct NspiDNToMId *r)
static void dcesrv_NspiGetIDsFromNames (struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct NspiGetIDsFromNames *r)
static void dcesrv_NspiGetMatches (struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct NspiGetMatches *r)
static void dcesrv_NspiGetNamesFromIDs (struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct NspiGetNamesFromIDs *r)
static void dcesrv_NspiGetPropList (struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct NspiGetPropList *r)
static void dcesrv_NspiGetProps (struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct NspiGetProps *r)
static void dcesrv_NspiGetSpecialTable (struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct NspiGetSpecialTable *r)
static void dcesrv_NspiGetTemplateInfo (struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct NspiGetTemplateInfo *r)
static void dcesrv_NspiModLinkAtt (struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct NspiModLinkAtt *r)
static void dcesrv_NspiModProps (struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct NspiModProps *r)
static void dcesrv_NspiQueryColumns (struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct NspiQueryColumns *r)
static void dcesrv_NspiQueryRows (struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct NspiQueryRows *r)
static void dcesrv_NspiResolveNames (struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct NspiResolveNames *r)
static void dcesrv_NspiResolveNamesW (struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct NspiResolveNamesW *r)
static void dcesrv_NspiResortRestriction (struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct NspiResortRestriction *r)
static void dcesrv_NspiSeekEntries (struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct NspiSeekEntries *r)
static void dcesrv_NspiUnbind (struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct NspiUnbind *r)
static void dcesrv_NspiUpdateStat (struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct NspiUpdateStat *r)
NTSTATUS samba_init_module (void)

Variables

static TDB_CONTEXT * emsabp_tdb_ctx = NULL
static struct
exchange_nsp_session
nsp_session = NULL

Detailed Description

OpenChange NSPI Server implementation.


Function Documentation

static NTSTATUS dcesrv_exchange_nsp_dispatch ( struct dcesrv_call_state *  dce_call,
TALLOC_CTX *  mem_ctx,
void *  r,
struct mapiproxy mapiproxy 
) [static]
static NTSTATUS dcesrv_exchange_nsp_init ( struct dcesrv_context *  dce_ctx  )  [static]

Initialize the NSPI OpenChange server

Parameters:
dce_ctx pointer to the server context
Returns:
NT_STATUS_OK on success, otherwise NT_STATUS_NO_MEMORY

References emsabp_tdb_ctx, emsabp_tdb_init(), and exchange_nsp_session::session.

Referenced by samba_init_module().

static NTSTATUS dcesrv_exchange_nsp_unbind ( struct server_id  server_id,
uint32_t  context_id 
) [static]

Terminates the NSPI connection and release the associated session and context if still available. This case occurs when the client doesn't call NspiUnbind but quit unexpectedly.

Parameters:
server_id reference to the server identifier structure
context_id the connection context identifier
Returns:
NT_STATUS_OK on success

Referenced by samba_init_module().

static struct exchange_nsp_session* dcesrv_find_nsp_session ( struct GUID *  uuid  )  [static, read]
static void dcesrv_NspiBind ( struct dcesrv_call_state *  dce_call,
TALLOC_CTX *  mem_ctx,
struct NspiBind *  r 
) [static]

exchange_nsp NspiBind (0x0) function, Initiates a NSPI session with the client.

This function checks if the user is an Exchange user and input parameters like codepage are valid. If it passes the tests, the function initializes an emsabp context and returns to the client a valid policy_handle and expected reply parameters.

Parameters:
dce_call pointer to the session context
mem_ctx pointer to the memory context
r pointer to the NspiBind call structure
Returns:
MAPI_E_SUCCESS on success, otherwise a MAPI error

References dcesrv_find_nsp_session(), DCESRV_NSP_RETURN, emsabp_destructor(), emsabp_init(), emsabp_tdb_ctx, emsabp_verify_codepage(), emsabp_verify_user(), EXCHANGE_HANDLE_NSP, mpm_session_increment_ref_count(), mpm_session_init(), mpm_session_set_destructor(), mpm_session_set_private_data(), emsabp_context::samdb_ctx, samdb_ntds_objectGUID(), exchange_nsp_session::session, and exchange_nsp_session::uuid.

static void dcesrv_NspiCompareMIds ( struct dcesrv_call_state *  dce_call,
TALLOC_CTX *  mem_ctx,
struct NspiCompareMIds *  r 
) [static]

exchange_nsp NspiCompareMIds (0xA) function

Parameters:
dce_call pointer to the session context
mem_ctx pointer to the memory context
r pointer to the NspiCompareMIds request data
Returns:
MAPI_E_SUCCESS on success

References DCESRV_NSP_RETURN.

static void dcesrv_NspiDeleteEntries ( struct dcesrv_call_state *  dce_call,
TALLOC_CTX *  mem_ctx,
struct NspiDeleteEntries *  r 
) [static]

exchange_nsp NspiDeleteEntries (0xF) function

Parameters:
dce_call pointer to the session context
mem_ctx pointer to the memory context
r pointer to the NspiDeleteEntries request data
Returns:
MAPI_E_SUCCESS on success

References DCESRV_NSP_RETURN.

static void dcesrv_NspiDNToMId ( struct dcesrv_call_state *  dce_call,
TALLOC_CTX *  mem_ctx,
struct NspiDNToMId *  r 
) [static]

exchange_nsp NspiDNToMId (0x7) function

Parameters:
dce_call pointer to the session context
mem_ctx pointer to the memory context
r pointer to the NspiDNToMId request data
Note:
Only searches within configuration.ldb are supported at the moment.
Returns:
MAPI_E_SUCCESS on success

References dcesrv_find_emsabp_context(), DCESRV_NSP_RETURN, emsabp_search_legacyExchangeDN(), emsabp_tdb_fetch_MId(), emsabp_tdb_insert(), emsabp_context::tdb_ctx, and emsabp_context::ttdb_ctx.

static void dcesrv_NspiGetIDsFromNames ( struct dcesrv_call_state *  dce_call,
TALLOC_CTX *  mem_ctx,
struct NspiGetIDsFromNames *  r 
) [static]

exchange_nsp NspiGetIDsFromNames (0x12) function

Parameters:
dce_call pointer to the session context
mem_ctx pointer to the memory context
r pointer to the NspiGetIDsFromNames request data
Returns:
MAPI_E_SUCCESS on success

References DCESRV_NSP_RETURN.

static void dcesrv_NspiGetMatches ( struct dcesrv_call_state *  dce_call,
TALLOC_CTX *  mem_ctx,
struct NspiGetMatches *  r 
) [static]

exchange_nsp NspiGetMatches (0x5) function

Parameters:
dce_call pointer to the session context
mem_ctx pointer to the memory context
r pointer to the NspiGetMatches request data
Returns:
MAPI_E_SUCCESS on success

References dcesrv_find_emsabp_context(), DCESRV_NSP_RETURN, emsabp_fetch_attrs(), and emsabp_search().

static void dcesrv_NspiGetNamesFromIDs ( struct dcesrv_call_state *  dce_call,
TALLOC_CTX *  mem_ctx,
struct NspiGetNamesFromIDs *  r 
) [static]

exchange_nsp NspiGetNamesFromIDs (0x11) function

Parameters:
dce_call pointer to the session context
mem_ctx pointer to the memory context
r pointer to the NspiGetNamesFromIDs request data
Returns:
MAPI_E_SUCCESS on success

References DCESRV_NSP_RETURN.

static void dcesrv_NspiGetPropList ( struct dcesrv_call_state *  dce_call,
TALLOC_CTX *  mem_ctx,
struct NspiGetPropList *  r 
) [static]

exchange_nsp NspiGetPropList (0x8) function

Parameters:
dce_call pointer to the session context
mem_ctx pointer to the memory context
r pointer to the NspiGetPropList request data
Returns:
MAPI_E_SUCCESS on success

References DCESRV_NSP_RETURN.

static void dcesrv_NspiGetProps ( struct dcesrv_call_state *  dce_call,
TALLOC_CTX *  mem_ctx,
struct NspiGetProps *  r 
) [static]

exchange_nsp NspiGetProps (0x9) function

Parameters:
dce_call pointer to the session context
mem_ctx pointer to the memory context
r pointer to the NspiGetProps request data
Returns:
MAPI_E_SUCCESS on success

References dcesrv_find_emsabp_context(), DCESRV_NSP_RETURN, emsabp_fetch_attrs(), emsabp_tdb_lookup_MId(), and emsabp_context::tdb_ctx.

static void dcesrv_NspiGetSpecialTable ( struct dcesrv_call_state *  dce_call,
TALLOC_CTX *  mem_ctx,
struct NspiGetSpecialTable *  r 
) [static]

exchange_nsp NspiGetSpecialTable (0xC) function

Parameters:
dce_call pointer to the session context
mem_ctx pointer to the memory context
r pointer to the NspiGetSpecialTable request data
Note:
MS-NSPI specifies lpVersion "holds the value of the version number of the hierarchy table that the client has." We will ignore this for the moment.
Returns:
MAPI_E_SUCCESS on success

References dcesrv_find_emsabp_context(), DCESRV_NSP_RETURN, emsabp_get_CreationTemplatesTable(), and emsabp_get_HierarchyTable().

static void dcesrv_NspiGetTemplateInfo ( struct dcesrv_call_state *  dce_call,
TALLOC_CTX *  mem_ctx,
struct NspiGetTemplateInfo *  r 
) [static]

exchange_nsp NspiGetTemplateInfo (0xD) function

Parameters:
dce_call pointer to the session context
mem_ctx pointer to the memory context
r pointer to the NspiGetTemplateInfo request data
Returns:
MAPI_E_SUCCESS on success

References DCESRV_NSP_RETURN.

static void dcesrv_NspiModLinkAtt ( struct dcesrv_call_state *  dce_call,
TALLOC_CTX *  mem_ctx,
struct NspiModLinkAtt *  r 
) [static]

exchange_nsp NspiModLinkAtt (0xE) function

Parameters:
dce_call pointer to the session context
mem_ctx pointer to the memory context
r pointer to the NspiModLinkAtt request data
Returns:
MAPI_E_SUCCESS on success

References DCESRV_NSP_RETURN.

static void dcesrv_NspiModProps ( struct dcesrv_call_state *  dce_call,
TALLOC_CTX *  mem_ctx,
struct NspiModProps *  r 
) [static]

exchange_nsp NspiModProps (0xB) function

Parameters:
dce_call pointer to the session context
mem_ctx pointer to the memory context
r pointer to the NspiModProps request data
Returns:
MAPI_E_SUCCESS on success

References DCESRV_NSP_RETURN.

static void dcesrv_NspiQueryColumns ( struct dcesrv_call_state *  dce_call,
TALLOC_CTX *  mem_ctx,
struct NspiQueryColumns *  r 
) [static]

exchange_nsp NspiQueryColumns (0x10) function

Parameters:
dce_call pointer to the session context
mem_ctx pointer to the memory context
r pointer to the NspiQueryColumns request data
Returns:
MAPI_E_SUCCESS on success

References DCESRV_NSP_RETURN.

static void dcesrv_NspiQueryRows ( struct dcesrv_call_state *  dce_call,
TALLOC_CTX *  mem_ctx,
struct NspiQueryRows *  r 
) [static]

exchange_nsp NspiQueryRows (0x3) function

Parameters:
dce_call pointer to the session context
mem_ctx pointer to the memory context
r pointer to the NspiQueryRows request data
Returns:
MAPI_E_SUCCESS on success

References dcesrv_find_emsabp_context(), DCESRV_NSP_RETURN, emsabp_ab_container_enum(), emsabp_fetch_attrs(), emsabp_fetch_attrs_from_msg(), emsabp_tdb_lookup_MId(), and emsabp_context::tdb_ctx.

static void dcesrv_NspiResolveNames ( struct dcesrv_call_state *  dce_call,
TALLOC_CTX *  mem_ctx,
struct NspiResolveNames *  r 
) [static]

exchange_nsp NspiResolveNames (0x13) function

Parameters:
dce_call pointer to the session context
mem_ctx pointer to the memory context
r pointer to the NspiResolveNames request data
Returns:
MAPI_E_SUCCESS on success

References dcesrv_find_emsabp_context(), DCESRV_NSP_RETURN, emsabp_ab_container_by_id(), emsabp_fetch_attrs_from_msg(), and emsabp_context::samdb_ctx.

static void dcesrv_NspiResolveNamesW ( struct dcesrv_call_state *  dce_call,
TALLOC_CTX *  mem_ctx,
struct NspiResolveNamesW *  r 
) [static]

exchange_nsp NspiResolveNamesW (0x14) function

Parameters:
dce_call pointer to the session context
mem_ctx pointer to the memory context
r pointer to the NspiResolveNamesW request data
Returns:
MAPI_E_SUCCESS on success

References dcesrv_find_emsabp_context(), DCESRV_NSP_RETURN, emsabp_ab_container_by_id(), emsabp_fetch_attrs_from_msg(), and emsabp_context::samdb_ctx.

static void dcesrv_NspiResortRestriction ( struct dcesrv_call_state *  dce_call,
TALLOC_CTX *  mem_ctx,
struct NspiResortRestriction *  r 
) [static]

exchange_nsp NspiResortRestriction (0x6) function

Parameters:
dce_call pointer to the session context
mem_ctx pointer to the memory context
r pointer to the NspiResortRestriction request data
Returns:
MAPI_E_SUCCESS on success

References DCESRV_NSP_RETURN.

static void dcesrv_NspiSeekEntries ( struct dcesrv_call_state *  dce_call,
TALLOC_CTX *  mem_ctx,
struct NspiSeekEntries *  r 
) [static]

exchange_nsp NspiSeekEntries (0x4) function

Parameters:
dce_call pointer to the session context
mem_ctx pointer to the memory context
r pointer to the NspiSeekEntries request data
Returns:
MAPI_E_SUCCESS on success

References dcesrv_find_emsabp_context(), DCESRV_NSP_RETURN, emsabp_fetch_attrs(), emsabp_search(), emsabp_tdb_lookup_MId(), and emsabp_context::tdb_ctx.

static void dcesrv_NspiUnbind ( struct dcesrv_call_state *  dce_call,
TALLOC_CTX *  mem_ctx,
struct NspiUnbind *  r 
) [static]

exchange_nsp NspiUnbind (0x1) function, Terminates a NSPI session with the client

Parameters:
dce_call pointer to the session context
mem_ctx pointer to the memory context
r pointer to the NspiUnbind call structure

References dcesrv_find_nsp_session(), DCESRV_NSP_RETURN, mpm_session_release(), and exchange_nsp_session::session.

static void dcesrv_NspiUpdateStat ( struct dcesrv_call_state *  dce_call,
TALLOC_CTX *  mem_ctx,
struct NspiUpdateStat *  r 
) [static]

exchange_nsp NspiUpdateStat (0x2) function

Parameters:
dce_call pointer to the session context
mem_ctx pointer to the memory context
r pointer to the NspiUpdateStat request data
Returns:
MAPI_E_SUCCESS on success

References dcesrv_find_emsabp_context(), DCESRV_NSP_RETURN, emsabp_search(), emsabp_tdb_lookup_MId(), and emsabp_context::tdb_ctx.


Variable Documentation

TDB_CONTEXT* emsabp_tdb_ctx = NULL [static]
struct exchange_nsp_session* nsp_session = NULL [static]

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/