openchangedb.c File Reference

OpenChange Dispatcher database routines. More...

#include <inttypes.h>
#include "mapiproxy/dcesrv_mapiproxy.h"
#include "mapiproxy/libmapiproxy/libmapiproxy.h"
#include "libmapi/libmapi.h"
#include "libmapi/libmapi_private.h"

Functions

static struct BinaryArray_r * decode_mv_binary (TALLOC_CTX *mem_ctx, const char *str)
 
static struct LongArray_r * decode_mv_long (TALLOC_CTX *mem_ctx, const char *str)
 
struct ldb_val ldb_binary_decode (TALLOC_CTX *, const char *)
 
_PUBLIC_ enum MAPISTATUS openchangedb_create_folder (struct ldb_context *ldb_ctx, uint64_t parentFolderID, uint64_t fid, uint64_t changeNumber, const char *MAPIStoreURI, int systemIdx)
 
_PUBLIC_ enum MAPISTATUS openchangedb_create_mailbox (struct ldb_context *ldb_ctx, const char *username, int systemIdx, uint64_t *fidp)
 
_PUBLIC_ enum MAPISTATUS openchangedb_delete_folder (struct ldb_context *ldb_ctx, uint64_t fid)
 
_PUBLIC_ enum MAPISTATUS openchangedb_get_distinguishedName (TALLOC_CTX *parent_ctx, struct ldb_context *ldb_ctx, uint64_t fid, char **distinguishedName)
 
_PUBLIC_ enum MAPISTATUS openchangedb_get_fid (struct ldb_context *ldb_ctx, const char *mapistoreURL, uint64_t *fidp)
 
_PUBLIC_ enum MAPISTATUS openchangedb_get_fid_by_name (struct ldb_context *ldb_ctx, uint64_t parent_fid, const char *foldername, uint64_t *fid)
 
_PUBLIC_ enum MAPISTATUS openchangedb_get_fid_from_partial_uri (struct ldb_context *ldb_ctx, const char *partialURI, uint64_t *fid)
 
_PUBLIC_ enum MAPISTATUS openchangedb_get_folder_count (struct ldb_context *ldb_ctx, uint64_t fid, uint32_t *RowCount)
 
_PUBLIC_ enum MAPISTATUS openchangedb_get_folder_property (TALLOC_CTX *parent_ctx, struct ldb_context *ldb_ctx, uint32_t proptag, uint64_t fid, void **data)
 
_PUBLIC_ enum MAPISTATUS openchangedb_get_mailboxDN (TALLOC_CTX *parent_ctx, struct ldb_context *ldb_ctx, uint64_t fid, char **mailboxDN)
 
_PUBLIC_ enum MAPISTATUS openchangedb_get_MailboxGuid (struct ldb_context *ldb_ctx, const char *recipient, struct GUID *MailboxGUID)
 
_PUBLIC_ enum MAPISTATUS openchangedb_get_MailboxReplica (struct ldb_context *ldb_ctx, const char *recipient, uint16_t *ReplID, struct GUID *ReplGUID)
 
_PUBLIC_ enum MAPISTATUS openchangedb_get_mapistoreURI (TALLOC_CTX *parent_ctx, struct ldb_context *ldb_ctx, uint64_t fid, char **mapistoreURL, bool mailboxstore)
 
_PUBLIC_ enum MAPISTATUS openchangedb_get_MAPIStoreURIs (struct ldb_context *ldb_ctx, const char *username, TALLOC_CTX *mem_ctx, struct StringArrayW_r **urisP)
 
_PUBLIC_ enum MAPISTATUS openchangedb_get_message_count (struct ldb_context *ldb_ctx, uint64_t fid, uint32_t *RowCount, bool fai)
 
_PUBLIC_ enum MAPISTATUS openchangedb_get_mid_by_subject (struct ldb_context *ldb_ctx, uint64_t parent_fid, const char *subject, bool mailboxstore, uint64_t *mid)
 
_PUBLIC_ enum MAPISTATUS openchangedb_get_new_changeNumber (struct ldb_context *ldb_ctx, uint64_t *cn)
 
_PUBLIC_ enum MAPISTATUS openchangedb_get_new_changeNumbers (struct ldb_context *ldb_ctx, TALLOC_CTX *mem_ctx, uint64_t max, struct UI8Array_r **cns_p)
 
_PUBLIC_ enum MAPISTATUS openchangedb_get_new_folderID (struct ldb_context *ldb_ctx, uint64_t *fid)
 
_PUBLIC_ enum MAPISTATUS openchangedb_get_new_folderIDs (struct ldb_context *ldb_ctx, TALLOC_CTX *mem_ctx, uint64_t max, struct UI8Array_r **fids_p)
 
_PUBLIC_ enum MAPISTATUS openchangedb_get_next_changeNumber (struct ldb_context *ldb_ctx, uint64_t *cn)
 
_PUBLIC_ enum MAPISTATUS openchangedb_get_parent_fid (struct ldb_context *ldb_ctx, uint64_t fid, uint64_t *parent_fidp, bool mailboxstore)
 
void * openchangedb_get_property_data (TALLOC_CTX *mem_ctx, struct ldb_result *res, uint32_t pos, uint32_t proptag, const char *PidTagAttr)
 
void * openchangedb_get_property_data_message (TALLOC_CTX *mem_ctx, struct ldb_message *msg, uint32_t proptag, const char *PidTagAttr)
 
_PUBLIC_ enum MAPISTATUS openchangedb_get_PublicFolderID (struct ldb_context *ldb_ctx, uint32_t SystemIdx, uint64_t *FolderId)
 
_PUBLIC_ enum MAPISTATUS openchangedb_get_PublicFolderReplica (struct ldb_context *ldb_ctx, uint16_t *ReplID, struct GUID *ReplGUID)
 
_PUBLIC_ enum MAPISTATUS openchangedb_get_ReceiveFolder (TALLOC_CTX *parent_ctx, struct ldb_context *ldb_ctx, const char *recipient, const char *MessageClass, uint64_t *fid, const char **ExplicitMessageClass)
 
void * openchangedb_get_special_property (TALLOC_CTX *mem_ctx, struct ldb_context *ldb_ctx, struct ldb_result *res, uint32_t proptag, const char *PidTagAttr)
 
_PUBLIC_ enum MAPISTATUS openchangedb_get_system_idx (struct ldb_context *ldb_ctx, uint64_t fid, int *system_idx_p)
 
_PUBLIC_ enum MAPISTATUS openchangedb_get_SystemFolderID (struct ldb_context *ldb_ctx, const char *recipient, uint32_t SystemIdx, uint64_t *FolderId)
 
_PUBLIC_ enum MAPISTATUS openchangedb_get_table_property (TALLOC_CTX *parent_ctx, struct ldb_context *ldb_ctx, const char *ldb_filter, uint32_t proptag, uint32_t pos, void **data)
 
_PUBLIC_ enum MAPISTATUS openchangedb_get_TransportFolder (struct ldb_context *ldb_ctx, const char *recipient, uint64_t *FolderId)
 
_PUBLIC_ enum MAPISTATUS openchangedb_get_users_from_partial_uri (TALLOC_CTX *parent_ctx, struct ldb_context *ldb_ctx, const char *partialURI, uint32_t *count, char ***MAPIStoreURI, char ***users)
 
_PUBLIC_ enum MAPISTATUS openchangedb_lookup_folder_property (struct ldb_context *ldb_ctx, uint32_t proptag, uint64_t fid)
 
_PUBLIC_ enum MAPISTATUS openchangedb_reserve_fmid_range (struct ldb_context *ldb_ctx, uint64_t range_len, uint64_t *first_fmidp)
 
_PUBLIC_ enum MAPISTATUS openchangedb_set_folder_properties (struct ldb_context *ldb_ctx, uint64_t fid, struct SRow *row)
 
_PUBLIC_ char * openchangedb_set_folder_property_data (TALLOC_CTX *mem_ctx, struct SPropValue *value)
 
_PUBLIC_ enum MAPISTATUS openchangedb_set_mapistoreURI (struct ldb_context *ldb_ctx, uint64_t fid, const char *mapistoreURL, bool mailboxstore)
 
_PUBLIC_ enum MAPISTATUS openchangedb_set_ReceiveFolder (struct ldb_context *ldb_ctx, const char *recipient, const char *MessageClass, uint64_t fid)
 
static char * openchangedb_unknown_property (TALLOC_CTX *mem_ctx, uint32_t proptag)
 

Variables

const char * openchangedb_nil_string = "<nil>"
 

Detailed Description

OpenChange Dispatcher database routines.

Function Documentation

static struct BinaryArray_r* decode_mv_binary ( TALLOC_CTX *  mem_ctx,
const char *  str 
)
static
static struct LongArray_r* decode_mv_long ( TALLOC_CTX *  mem_ctx,
const char *  str 
)
static
struct ldb_val ldb_binary_decode ( TALLOC_CTX *  ,
const char *   
)
_PUBLIC_ enum MAPISTATUS openchangedb_create_folder ( struct ldb_context *  ldb_ctx,
uint64_t  parentFolderID,
uint64_t  fid,
uint64_t  changeNumber,
const char *  MAPIStoreURI,
int  systemIdx 
)

Create a folder in openchangedb

Parameters
ldb_ctxpointer to the openchangedb LDB context
parentFolderIDthe FID of the parent folder
fidthe FID of the folder to create
MAPIStoreURIthe mapistore URI to associate to this folder
nt_timethe creation time of the folder
changeNumberthe change number
Returns
MAPISTORE_SUCCESS on success, otherwise MAPISTORE error

References openchangedb_get_distinguishedName(), and openchangedb_get_mailboxDN().

Referenced by emsmdbp_mailbox_provision(), emsmdbp_mailbox_provision_public_freebusy(), and emsmdbp_object_folder_commit_creation().

_PUBLIC_ enum MAPISTATUS openchangedb_create_mailbox ( struct ldb_context *  ldb_ctx,
const char *  username,
int  systemIdx,
uint64_t *  fidp 
)

Create a folder in openchangedb

Parameters
ldb_ctxpointer to the openchangedb LDB context
usernamethe owner of the mailbox
systemIdxthe id of the mailbox
fidpa pointer to the fid of the mailbox
Returns
MAPISTORE_SUCCESS on success, otherwise MAPISTORE error

References openchangedb_get_new_changeNumber(), and openchangedb_get_new_folderID().

Referenced by emsmdbp_mailbox_provision().

_PUBLIC_ enum MAPISTATUS openchangedb_delete_folder ( struct ldb_context *  ldb_ctx,
uint64_t  fid 
)
_PUBLIC_ enum MAPISTATUS openchangedb_get_distinguishedName ( TALLOC_CTX *  parent_ctx,
struct ldb_context *  ldb_ctx,
uint64_t  fid,
char **  distinguishedName 
)

Retrieve the distinguishedName associated to a mailbox system folder.

Parameters
parent_ctxpointer to the parent memory context
ldb_ctxpointer to the openchange LDB context
fidthe Folder identifier to search for
distinguishedNamepointer on pointer to the distinguishedName string the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

Referenced by openchangedb_create_folder(), openchangedb_delete_folder(), openchangedb_message_create(), and openchangedb_set_ReceiveFolder().

_PUBLIC_ enum MAPISTATUS openchangedb_get_fid ( struct ldb_context *  ldb_ctx,
const char *  mapistoreURL,
uint64_t *  fidp 
)

Retrieve the fid associated with a mapistore URI.

Parameters
ldb_ctxpointer to the openchange LDB context
fidthe Folder identifier to search for
mapistoreURLpointer on pointer to the mapistore URI the function returns
mailboxstoreboolean value which defines whether the record has to be searched within Public folders hierarchy or not
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

Referenced by emsmdbp_get_fid_from_uri(), and emsmdbp_mailbox_provision().

_PUBLIC_ enum MAPISTATUS openchangedb_get_fid_by_name ( struct ldb_context *  ldb_ctx,
uint64_t  parent_fid,
const char *  foldername,
uint64_t *  fid 
)

Retrieve the folder ID associated with a given folder name

This function looks up the specified foldername (as a PidTagDisplayName) and returns the associated folder ID. Note that folder names are only unique in the context of a parent folder, so the parent folder needs to be provided.

Parameters
ldb_ctxpointer to the openchange LDB context
parent_fidthe folder ID of the parent folder
foldernamethe name to look up
fidthe folder ID for the folder with the specified name (0 if not found)
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

Referenced by emsmdbp_mailbox_provision(), emsmdbp_mailbox_provision_public_freebusy(), emsmdbp_object_create_folder(), and emsmdbp_object_get_fid_by_name().

_PUBLIC_ enum MAPISTATUS openchangedb_get_fid_from_partial_uri ( struct ldb_context *  ldb_ctx,
const char *  partialURI,
uint64_t *  fid 
)
_PUBLIC_ enum MAPISTATUS openchangedb_get_folder_count ( struct ldb_context *  ldb_ctx,
uint64_t  fid,
uint32_t *  RowCount 
)

Retrieve the number of sub folders for a given fid

Parameters
ldb_ctxpointer to the openchange LDB context
fidthe folder identifier to use for the search
RowCountpointer to the returned number of results
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

Referenced by emsmdbp_folder_get_folder_count(), and emsmdbp_object_get_properties_systemspecialfolder().

_PUBLIC_ enum MAPISTATUS openchangedb_get_folder_property ( TALLOC_CTX *  parent_ctx,
struct ldb_context *  ldb_ctx,
uint32_t  proptag,
uint64_t  fid,
void **  data 
)

Retrieve a MAPI property value from a folder record

Parameters
parent_ctxpointer to the memory context
ldb_ctxpointer to the openchange LDB context
proptagthe MAPI property tag to retrieve value for
fidthe record folder identifier
datapointer on pointer to the data the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

References openchangedb_get_property_data(), openchangedb_get_special_property(), openchangedb_property_get_attribute(), and openchangedb_unknown_property().

Referenced by emsmdbp_mailbox_provision(), emsmdbp_object_get_properties_mailbox(), emsmdbp_object_get_properties_mapistore_root(), and emsmdbp_object_get_properties_systemspecialfolder().

_PUBLIC_ enum MAPISTATUS openchangedb_get_mailboxDN ( TALLOC_CTX *  parent_ctx,
struct ldb_context *  ldb_ctx,
uint64_t  fid,
char **  mailboxDN 
)

Retrieve the mailboxDN associated to a mailbox system folder.

Parameters
parent_ctxpointer to the parent memory context
ldb_ctxpointer to the openchange LDB context
fidthe folder identifier to search for
mailboxDNpointer on pointer to the mailboxDN string the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

Referenced by openchangedb_create_folder(), and openchangedb_message_create().

_PUBLIC_ enum MAPISTATUS openchangedb_get_MailboxGuid ( struct ldb_context *  ldb_ctx,
const char *  recipient,
struct GUID *  MailboxGUID 
)

Retrieve the mailbox GUID for given recipient from openchange dispatcher database

Parameters
ldb_ctxpointer to the OpenChange LDB context
recipientthe mailbox username
MailboxGUIDpointer to the mailbox GUID the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by emsmdbp_mailbox_provision(), and RopLogon_Mailbox().

_PUBLIC_ enum MAPISTATUS openchangedb_get_MailboxReplica ( struct ldb_context *  ldb_ctx,
const char *  recipient,
uint16_t *  ReplID,
struct GUID *  ReplGUID 
)

Retrieve the mailbox replica identifier and GUID for given recipient from openchange dispatcher database

Parameters
ldb_ctxpointer to the OpenChange LDB context
recipientthe mailbox username
ReplIDpointer to the replica identifier the function returns
ReplGUIDpointer to the replica GUID the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by EcDoRpc_RopSyncImportDeletes(), EcDoRpc_RopSyncImportHierarchyChange(), EcDoRpc_RopSyncImportMessageChange(), emsmdbp_guid_to_replid(), emsmdbp_mailbox_provision(), emsmdbp_object_synccontext_init(), emsmdbp_replid_to_guid(), emsmdbp_verify_user(), oxcfxics_fill_synccontext_with_messageChange(), oxcfxics_ndr_push_transfer_state(), oxcfxics_prepare_synccontext_with_folderChange(), and RopLogon_Mailbox().

_PUBLIC_ enum MAPISTATUS openchangedb_get_mapistoreURI ( TALLOC_CTX *  parent_ctx,
struct ldb_context *  ldb_ctx,
uint64_t  fid,
char **  mapistoreURL,
bool  mailboxstore 
)

Retrieve the mapistore URI associated to a mailbox system folder.

Parameters
parent_ctxpointer to the memory context
ldb_ctxpointer to the openchange LDB context
fidthe Folder identifier to search for
mapistoreURLpointer on pointer to the mapistore URI the function returns
ownerpointer on pointer to the owner of the parent mailbox
mailboxstoreboolean value which defines whether the record has to be searched within Public folders hierarchy or not
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

Referenced by emsmdbp_folder_delete(), emsmdbp_get_uri_from_fid(), emsmdbp_mailbox_provision(), emsmdbp_object_open_folder(), and emsmdbp_object_set_properties().

_PUBLIC_ enum MAPISTATUS openchangedb_get_MAPIStoreURIs ( struct ldb_context *  ldb_ctx,
const char *  username,
TALLOC_CTX *  mem_ctx,
struct StringArrayW_r **  urisP 
)

Retrieve a list of mapistore URI in use for a certain user

Parameters
ldb_ctxpointer to the openchange LDB context
fidthe Folder identifier to search for
mapistoreURLpointer on pointer to the mapistore URI the function returns
mailboxstoreboolean value which defines whether the record has to be searched within Public folders hierarchy or not
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

Referenced by emsmdbp_mailbox_provision().

_PUBLIC_ enum MAPISTATUS openchangedb_get_message_count ( struct ldb_context *  ldb_ctx,
uint64_t  fid,
uint32_t *  RowCount,
bool  fai 
)

Retrieve the number of messages within the specified folder

Parameters
ldb_ctxpointer to the openchange LDB context
fidthe folder identifier to use for the search
RowCountpointer to the returned number of results
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

Referenced by emsmdbp_folder_open_table().

_PUBLIC_ enum MAPISTATUS openchangedb_get_mid_by_subject ( struct ldb_context *  ldb_ctx,
uint64_t  parent_fid,
const char *  subject,
bool  mailboxstore,
uint64_t *  mid 
)

Retrieve the message ID associated with a given subject (normalized)

Parameters
ldb_ctxpointer to the openchange LDB context
parent_fidthe folder ID of the parent folder
subjectthe normalized subject to look up
midthe message ID for the message (0 if not found)
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

Referenced by emsmdbp_mailbox_provision_public_freebusy().

_PUBLIC_ enum MAPISTATUS openchangedb_get_new_changeNumber ( struct ldb_context *  ldb_ctx,
uint64_t *  cn 
)

Allocates a new change number and returns it

Parameters
ldb_ctxpointer to the openchange LDB context
cnpointer to the cn value the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by EcDoRpc_RopCreateFolder(), EcDoRpc_RopSyncImportHierarchyChange(), emsmdbp_mailbox_provision(), emsmdbp_mailbox_provision_public_freebusy(), openchangedb_create_mailbox(), and openchangedb_set_folder_properties().

_PUBLIC_ enum MAPISTATUS openchangedb_get_new_changeNumbers ( struct ldb_context *  ldb_ctx,
TALLOC_CTX *  mem_ctx,
uint64_t  max,
struct UI8Array_r **  cns_p 
)

Allocates a batch of new change numbers and returns them

Parameters
ldb_ctxpointer to the openchange LDB context
cnpointer to the cn value the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error
_PUBLIC_ enum MAPISTATUS openchangedb_get_new_folderID ( struct ldb_context *  ldb_ctx,
uint64_t *  fid 
)

Allocates a new FolderID and returns it

Parameters
ldb_ctxpointer to the openchange LDB context
fidpointer to the fid value the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by EcDoRpc_RopCreateFolder(), EcDoRpc_RopCreateMessage(), EcDoRpc_RopMoveCopyMessages(), EcDoRpc_RopOpenEmbeddedMessage(), emsmdbp_mailbox_provision(), emsmdbp_mailbox_provision_public_freebusy(), openchangedb_create_mailbox(), and oxomsg_mapistore_handle_message_relocation().

_PUBLIC_ enum MAPISTATUS openchangedb_get_new_folderIDs ( struct ldb_context *  ldb_ctx,
TALLOC_CTX *  mem_ctx,
uint64_t  max,
struct UI8Array_r **  fids_p 
)

Allocates a batch of new folder ids and returns them

Parameters
ldb_ctxpointer to the openchange LDB context
fidpointer to the fid value the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error
_PUBLIC_ enum MAPISTATUS openchangedb_get_next_changeNumber ( struct ldb_context *  ldb_ctx,
uint64_t *  cn 
)

Returns the change number that will be allocated when openchangedb_get_new_changeNumber is next invoked

Parameters
ldb_ctxpointer to the openchange LDB context
cnpointer to the cn value the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by oxcfxics_check_cnset().

_PUBLIC_ enum MAPISTATUS openchangedb_get_parent_fid ( struct ldb_context *  ldb_ctx,
uint64_t  fid,
uint64_t *  parent_fidp,
bool  mailboxstore 
)

Retrieve the parent fid associated to a mailbox system folder.

Parameters
ldb_ctxpointer to the openchange LDB context
fidthe Folder identifier to search for
parent_fidppointer to the parent_fid the function returns
mailboxstoreboolean value which defines whether the record has to be searched within Public folders hierarchy or not
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

Referenced by emsmdbp_get_parent_fid(), and emsmdbp_object_open_folder().

void* openchangedb_get_property_data ( TALLOC_CTX *  mem_ctx,
struct ldb_result *  res,
uint32_t  pos,
uint32_t  proptag,
const char *  PidTagAttr 
)

Retrieve a MAPI property from a OpenChange LDB result set

Parameters
mem_ctxpointer to the memory context
respointer to the LDB results
posthe LDB result index
proptagthe MAPI property tag to lookup
PidTagAttrthe mapped MAPI property name
Returns
valid data pointer on success, otherwise NULL

References openchangedb_get_property_data_message().

Referenced by openchangedb_get_folder_property(), openchangedb_get_table_property(), and openchangedb_table_get_property().

void* openchangedb_get_property_data_message ( TALLOC_CTX *  mem_ctx,
struct ldb_message *  msg,
uint32_t  proptag,
const char *  PidTagAttr 
)

Retrieve a MAPI property from an OpenChange LDB message

Parameters
mem_ctxpointer to the memory context
msgpointer to the LDB message
proptagthe MAPI property tag to lookup
PidTagAttrthe mapped MAPI property name
Returns
valid data pointer on success, otherwise NULL

References decode_mv_binary(), decode_mv_long(), ldb_binary_decode(), and openchangedb_nil_string.

Referenced by openchangedb_get_property_data(), and openchangedb_message_get_property().

_PUBLIC_ enum MAPISTATUS openchangedb_get_PublicFolderID ( struct ldb_context *  ldb_ctx,
uint32_t  SystemIdx,
uint64_t *  FolderId 
)

Retrieve the public folder FolderID (fid) for a given folder type

Parameters
ldb_ctxpointer to the OpenChange LDB context
SystemIdxthe system folder index
FolderIdpointer to the folder identifier the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by emsmdbp_mailbox_provision_public_freebusy(), emsmdbp_object_mailbox_init(), and RopLogon_PublicFolder().

_PUBLIC_ enum MAPISTATUS openchangedb_get_PublicFolderReplica ( struct ldb_context *  ldb_ctx,
uint16_t *  ReplID,
struct GUID *  ReplGUID 
)

Retrieve the public folder replica identifier and GUID from the openchange dispatcher database

Parameters
ldb_ctxpointer to the OpenChange LDB context
ReplIDpointer to the replica identifier the function returns
ReplGUIDpointer to the replica GUID the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by RopLogon_PublicFolder().

_PUBLIC_ enum MAPISTATUS openchangedb_get_ReceiveFolder ( TALLOC_CTX *  parent_ctx,
struct ldb_context *  ldb_ctx,
const char *  recipient,
const char *  MessageClass,
uint64_t *  fid,
const char **  ExplicitMessageClass 
)

Retrieve the Explicit message class and Folder identifier associated to the MessageClass search pattern.

Parameters
parent_ctxpointer to the memory context
ldb_ctxpointer to the openchange LDB context
recipientpointer to the mailbox's username
MessageClasssubstring to search for
fidpointer to the folder identifier the function returns
ExplicitMessageClasspointer on pointer to the complete message class the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

Referenced by RopGetReceiveFolder().

void* openchangedb_get_special_property ( TALLOC_CTX *  mem_ctx,
struct ldb_context *  ldb_ctx,
struct ldb_result *  res,
uint32_t  proptag,
const char *  PidTagAttr 
)

Retrieve a special MAPI property from an openchangedb record

Parameters
mem_ctxpointer to the memory context
ldb_ctxpointer to the OpenChange LDB context
respointer to the LDB result
proptagthe MAPI property tag to lookup
PidTagAttrthe mapped MAPI property name
Returns
pointer to valid data on success, otherwise NULL

Referenced by openchangedb_get_folder_property(), openchangedb_get_table_property(), and openchangedb_table_get_property().

_PUBLIC_ enum MAPISTATUS openchangedb_get_system_idx ( struct ldb_context *  ldb_ctx,
uint64_t  fid,
int *  system_idx_p 
)

Retrieve the system idx associated with a folder record

Parameters
ldb_ctxpointer to the openchange LDB context
fidthe folder identifier to use for the search
system_idx_ppointer to the returned value
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

Referenced by emsmdbp_folder_move_folder().

_PUBLIC_ enum MAPISTATUS openchangedb_get_SystemFolderID ( struct ldb_context *  ldb_ctx,
const char *  recipient,
uint32_t  SystemIdx,
uint64_t *  FolderId 
)

Retrieve the mailbox FolderID for given recipient from openchange dispatcher database

Parameters
ldb_ctxpointer to the OpenChange LDB context
recipientthe mailbox username
SystemIdxthe system folder index
FolderIdpointer to the folder identifier the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by emsmdbp_fetch_freebusy(), emsmdbp_mailbox_provision(), emsmdbp_object_mailbox_init(), and RopLogon_Mailbox().

_PUBLIC_ enum MAPISTATUS openchangedb_get_table_property ( TALLOC_CTX *  parent_ctx,
struct ldb_context *  ldb_ctx,
const char *  ldb_filter,
uint32_t  proptag,
uint32_t  pos,
void **  data 
)

Retrieve a MAPI property from a table (ldb search results)

Parameters
parent_ctxpointer to the memory context
ldb_ctxpointer to the openchange LDB context
ldb_filterthe ldb search string
proptagthe MAPI property tag to retrieve value for
posthe record position in search results
datapointer on pointer to the data the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

References openchangedb_get_property_data(), openchangedb_get_special_property(), openchangedb_property_get_attribute(), and openchangedb_unknown_property().

_PUBLIC_ enum MAPISTATUS openchangedb_get_TransportFolder ( struct ldb_context *  ldb_ctx,
const char *  recipient,
uint64_t *  FolderId 
)

Retrieve the Transport Folder FolderID for given recipient from openchange dispatcher database

Parameters
ldb_ctxpointer to the OpenChange LDB context
recipientthe mailbox username
FolderIdpointer to the folder identifier the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by EcDoRpc_RopGetTransportFolder().

_PUBLIC_ enum MAPISTATUS openchangedb_get_users_from_partial_uri ( TALLOC_CTX *  parent_ctx,
struct ldb_context *  ldb_ctx,
const char *  partialURI,
uint32_t *  count,
char ***  MAPIStoreURI,
char ***  users 
)
_PUBLIC_ enum MAPISTATUS openchangedb_lookup_folder_property ( struct ldb_context *  ldb_ctx,
uint32_t  proptag,
uint64_t  fid 
)

Check if a property exists within an openchange dispatcher database record

Parameters
ldb_ctxpointer to the openchange LDB context
proptagthe MAPI property tag to lookup
fidthe record folder identifier
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

References openchangedb_property_get_attribute(), and openchangedb_unknown_property().

_PUBLIC_ enum MAPISTATUS openchangedb_reserve_fmid_range ( struct ldb_context *  ldb_ctx,
uint64_t  range_len,
uint64_t *  first_fmidp 
)

Reserve a range of FMID

Parameters
ldb_ctxpointer to the openchange LDB context
fidpointer to the fid value the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by EcDoRpc_RopGetLocalReplicaIds().

_PUBLIC_ enum MAPISTATUS openchangedb_set_folder_properties ( struct ldb_context *  ldb_ctx,
uint64_t  fid,
struct SRow *  row 
)
_PUBLIC_ char* openchangedb_set_folder_property_data ( TALLOC_CTX *  mem_ctx,
struct SPropValue *  value 
)

Build a MAPI property suitable for a OpenChange LDB message

Parameters
mem_ctxpointer to the memory context
valuethe MAPI property
Returns
valid string pointer on success, otherwise NULL

References openchangedb_nil_string, and openchangedb_set_folder_property_data().

Referenced by openchangedb_message_set_properties(), openchangedb_set_folder_properties(), and openchangedb_set_folder_property_data().

_PUBLIC_ enum MAPISTATUS openchangedb_set_mapistoreURI ( struct ldb_context *  ldb_ctx,
uint64_t  fid,
const char *  mapistoreURL,
bool  mailboxstore 
)

Store the mapistore URI associated to a mailbox system folder.

Parameters
parent_ctxpointer to the memory context
ldb_ctxpointer to the openchange LDB context
fidthe Folder identifier to search for
mapistoreURLpointer on pointer to the mapistore URI the function returns
ownerpointer on pointer to the owner of the parent mailbox
mailboxstoreboolean value which defines whether the record has to be searched within Public folders hierarchy or not
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

Referenced by emsmdbp_object_set_properties().

_PUBLIC_ enum MAPISTATUS openchangedb_set_ReceiveFolder ( struct ldb_context *  ldb_ctx,
const char *  recipient,
const char *  MessageClass,
uint64_t  fid 
)

Set the receive folder for a specific message class.

Parameters
parent_ctxpointer to the memory context
ldb_ctxpointer to the openchange LDB context
recipientpointer to the mailbox's username
MessageClassmessage class (e.g. IPM.whatever) to set
fidfolder identifier for the recipient folder for the message class
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

References openchangedb_get_distinguishedName().

Referenced by emsmdbp_mailbox_provision(), and RopSetReceiveFolder().

static char* openchangedb_unknown_property ( TALLOC_CTX *  mem_ctx,
uint32_t  proptag 
)
static

Variable Documentation

const char* openchangedb_nil_string = "<nil>"

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/