MAPIProxy 2.0 API Documentation

- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

Functions
emsabp_tdb.c File Reference

EMSABP TDB database API. More...

`#include "mapiproxy/dcesrv_mapiproxy.h"`
`#include "dcesrv_exchange_nsp.h"`
`#include <util/debug.h>`

## Functions
_PUBLIC_ enum MAPISTATUS | emsabp_tdb_close (TDB_CONTEXT *tdb_ctx)
_PUBLIC_ enum MAPISTATUS | emsabp_tdb_fetch (TDB_CONTEXT *tdb_ctx, const char *keyname, TDB_DATA *result)
_PUBLIC_ enum MAPISTATUS | emsabp_tdb_fetch_dn_from_MId (TALLOC_CTX *mem_ctx, TDB_CONTEXT *tdb_ctx, uint32_t MId, char **dn)
_PUBLIC_ enum MAPISTATUS | emsabp_tdb_fetch_MId (TDB_CONTEXT *tdb_ctx, const char *keyname, uint32_t *MId)
_PUBLIC_ TDB_CONTEXT * | emsabp_tdb_init (TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
_PUBLIC_ TDB_CONTEXT * | emsabp_tdb_init_tmp (TALLOC_CTX *mem_ctx)
_PUBLIC_ enum MAPISTATUS | emsabp_tdb_insert (TDB_CONTEXT *tdb_ctx, const char *keyname)
_PUBLIC_ bool | emsabp_tdb_lookup_MId (TDB_CONTEXT *tdb_ctx, uint32_t MId)

## Detailed Description

EMSABP TDB database API.

## Function Documentation

_PUBLIC_ enum MAPISTATUS emsabp_tdb_close | ( | TDB_CONTEXT * | tdb_ctx | ) |

Close EMSABP TDB database

Returns
  MAPI_E_SUCCESS on success, otherwise MAPI_E_INVALID_PARAMETER

_PUBLIC_ enum MAPISTATUS emsabp_tdb_fetch | ( | TDB_CONTEXT * | tdb_ctx,
|  | const char * | keyname,
|  | TDB_DATA * | result
| ) |  |

Fetch an element within a TDB database given its key

Parameters

  tdb_ctx | pointer to the EMSABP TDB context
  keyname | pointer to the TDB key to fetch
  result | pointer on TDB results

Returns
  MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

Referenced by emsabp_tdb_init(), and emsabp_tdb_insert().

_PUBLIC_ enum MAPISTATUS emsabp_tdb_fetch_dn_from_MId | ( | TALLOC_CTX * | mem_ctx,
|  | TDB_CONTEXT * | tdb_ctx,
|  | uint32_t | MId,
|  | char ** | dn
| ) |  |

Traverse the EMSABP TDB and fetch the DN associated with the MId

Parameters

  mem_ctx | pointer to the memory context
  tdb_ctx | pointer to the EMSABP TDB context
  MId | MID to search
  dn | pointer on pointer to the dn to return

Returns
  MAPI_E_SUCCESS on success, otherwise false

Referenced by emsabp_ab_container_by_id(), and emsabp_fetch_attrs().

_PUBLIC_ enum MAPISTATUS emsabp_tdb_fetch_MId | ( | TDB_CONTEXT * | tdb_ctx,
|  | const char * | keyname,
|  | uint32_t * | MId
| ) |  |

Retrieve the Minimal EntryID associated to a given DN

Parameters

  tdb_ctx | pointer to the EMSABP TDB context
  keyname | pointer to the TDB key to search for
  MId | pointer on the integer the function returns

Returns
  MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by dcesrv_NspiDNToMId(), emsabp_fetch_attrs_from_msg(), emsabp_search(), and emsabp_table_fetch_attrs().

_PUBLIC_ TDB_CONTEXT* emsabp_tdb_init | ( | TALLOC_CTX * | mem_ctx,
|  | struct loadparm_context * | lp_ctx
| ) |  |

Open EMSABP TDB database

Parameters

  mem_ctx | pointer to the memory context
  lp_ctx | pointer to the loadparm context

Returns
  MAPI_E_SUCCESS on success, otherwise MAPI error

References emsabp_tdb_fetch(), and mapiproxy_server_emsabp_tdb_init().

Referenced by dcesrv_exchange_nsp_init().

_PUBLIC_ TDB_CONTEXT* emsabp_tdb_init_tmp | ( | TALLOC_CTX * | mem_ctx | ) |

Initialize a temporary (on-memory) TDB database. This database is used to store temporary MId used within a session lifetime.

Parameters

  mem_ctx | pointer to the memory context

Returns
  Allocated TDB context on success, otherwise NULL

Referenced by emsabp_init().

_PUBLIC_ enum MAPISTATUS emsabp_tdb_insert | ( | TDB_CONTEXT * | tdb_ctx,
|  | const char * | keyname
| ) |  |

Insert an element into TDB database

Parameters

  tdb_ctx | pointer to the EMSABP TDB context
  keyname | pointer to the TDB key name string

Returns
  MAPI_E_SUCCESS on success, otherwise MAPI error

References emsabp_tdb_fetch().

Referenced by dcesrv_NspiDNToMId(), emsabp_fetch_attrs_from_msg(), emsabp_search(), and emsabp_table_fetch_attrs().

_PUBLIC_ bool emsabp_tdb_lookup_MId | ( | TDB_CONTEXT * | tdb_ctx,
|  | uint32_t | MId
| ) |  |

Traverse the EMSABP TDB database and look for the input MId

Parameters

  tdb_ctx | pointer to the EMSABP TDB context
  MId | MID to lookup

Returns
  true on success, otherwise false

Referenced by dcesrv_NspiGetProps(), dcesrv_NspiQueryRows(), dcesrv_NspiSeekEntries(), dcesrv_NspiUpdateStat(), and emsabp_search().

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