mpm_cache.h File Reference
#include <stdio.h>
#include <dlinklist.h>

Data Structures

struct  mpm_attachment
 
struct  mpm_cache
 
struct  mpm_message
 
struct  mpm_stream
 A stream can either be for a message or attachment. More...
 

Macros

#define __BEGIN_DECLS
 
#define __END_DECLS
 
#define MPM_DB   "mpm_cache.ldb"
 
#define MPM_DB_STORAGE   "data"
 
#define MPM_ERROR   "[ERROR] mpm_cache:"
 
#define MPM_LOCATION   __FUNCTION__, __LINE__
 
#define MPM_NAME   "mpm_cache"
 
#define MPM_SESSION(x)   x->session->server_id.pid, x->session->server_id.task_id, x->session->server_id.vnn, x->session->context_id
 

Functions

NTSTATUS mpm_cache_ldb_add_attachment (TALLOC_CTX *, struct ldb_context *, struct mpm_attachment *)
 
NTSTATUS mpm_cache_ldb_add_message (TALLOC_CTX *, struct ldb_context *, struct mpm_message *)
 
NTSTATUS mpm_cache_ldb_add_stream (struct mpm_cache *, struct ldb_context *, struct mpm_stream *)
 
NTSTATUS mpm_cache_ldb_createdb (struct dcesrv_context *, const char *, struct ldb_context **)
 
NTSTATUS mpm_cache_stream_close (struct mpm_stream *)
 
NTSTATUS mpm_cache_stream_open (struct mpm_cache *, struct mpm_stream *)
 
NTSTATUS mpm_cache_stream_read (struct mpm_stream *, size_t, size_t *, uint8_t **)
 
NTSTATUS mpm_cache_stream_reset (struct mpm_stream *)
 
NTSTATUS mpm_cache_stream_write (struct mpm_stream *, uint16_t, uint8_t *)
 
__BEGIN_DECLS NTSTATUS samba_init_module (void)
 

Macro Definition Documentation

#define __BEGIN_DECLS
#define __END_DECLS
#define MPM_DB   "mpm_cache.ldb"

Referenced by cache_init().

#define MPM_DB_STORAGE   "data"
#define MPM_ERROR   "[ERROR] mpm_cache:"

Referenced by cache_init().

#define MPM_NAME   "mpm_cache"

Referenced by cache_init().

#define MPM_SESSION (   x)    x->session->server_id.pid, x->session->server_id.task_id, x->session->server_id.vnn, x->session->context_id

Function Documentation

NTSTATUS mpm_cache_ldb_add_attachment ( TALLOC_CTX *  mem_ctx,
struct ldb_context *  ldb_ctx,
struct mpm_attachment attach 
)

Add an attachment record to the TDB store

Parameters
mem_ctxpointer to the memory context
ldb_ctxpointer to the LDB context
attachpointer to the mpm_attachment entry
Returns
NT_STATUS_OK on success, otherwise a NT error

References mpm_attachment::AttachmentID, mpm_message::FolderId, mpm_attachment::message, mpm_message::MessageId, and MPM_LOCATION.

Referenced by cache_push_OpenAttach().

NTSTATUS mpm_cache_ldb_add_message ( TALLOC_CTX *  mem_ctx,
struct ldb_context *  ldb_ctx,
struct mpm_message message 
)

Add a message record to the TDB store

Parameters
mem_ctxpointer to the memory context
ldb_ctxpointer to the LDB context
messagepointer to the mpm_message entry with the folder and message ID
Returns
NT_STATUS_OK on success, otherwise a NT error

References mpm_message::FolderId, mpm_message::MessageId, mpm_cache_ldb_add_folder(), and MPM_LOCATION.

Referenced by cache_push_OpenMessage().

NTSTATUS mpm_cache_ldb_add_stream ( struct mpm_cache mpm,
struct ldb_context *  ldb_ctx,
struct mpm_stream stream 
)

Add stream references to a message or attachment in the TDB store

Parameters
mpmpointer to the cache module general structure
ldb_ctxpointer to the LDB context
streampointer to the mpm_stream entry
Returns
NT_STATUS_OK on success, otherwise NT error

References mpm_stream::ahead, mpm_stream::attachment, mpm_attachment::AttachmentID, mpm_stream::cached, mpm_stream::filename, mpm_message::FolderId, mpm_attachment::message, mpm_stream::message, mpm_message::MessageId, mpm_cache_stream_open(), MPM_LOCATION, mpm_stream::PropertyTag, and mpm_stream::StreamSize.

Referenced by cache_push_OpenStream().

NTSTATUS mpm_cache_ldb_createdb ( struct dcesrv_context *  dce_ctx,
const char *  database,
struct ldb_context **  ldb_ctx 
)

Create the cache database

Parameters
dce_ctxpointer to the session context
databasethe complete path to the tdb store
ldb_ctxpointer to pointer on the the LDB context
Returns
NT_STATUS_OK on success, otherwise NT_ERROR: NT_STATUS_NO_MEMORY, NT_STATUS_NOT_FOUND.

Referenced by cache_init().

NTSTATUS mpm_cache_stream_close ( struct mpm_stream stream)

Close the filesystem stream

Parameters
streampointer to the mpm_stream entry
Returns
NT_STATUS_OK on success, otherwise NT_STATUS_NOT_FOUND

References mpm_stream::fp.

Referenced by cache_exec_sync_cmd(), cache_pull_Release(), and cache_unbind().

NTSTATUS mpm_cache_stream_open ( struct mpm_cache mpm,
struct mpm_stream stream 
)

Create a file: message or attachment in the cache

If the stream is attached to an attachment: FolderID/MessageID/AttachmentID.stream If the stream is attached to a message: FolderID/MessageID.stream

Parameters
mpmpointer to the cache module general structure
streampointer to the mpm_stream entry
Returns
Return a FILE pointer otherwise NULL

References mpm_stream::attachment, mpm_attachment::AttachmentID, mpm_cache::dbpath, mpm_stream::filename, mpm_message::FolderId, mpm_stream::fp, mpm_attachment::message, mpm_stream::message, mpm_message::MessageId, MPM_LOCATION, and mpm_stream::offset.

Referenced by cache_exec_sync_cmd(), and mpm_cache_ldb_add_stream().

NTSTATUS mpm_cache_stream_read ( struct mpm_stream stream,
size_t  input_size,
size_t *  length,
uint8_t **  data 
)

Read input_size bytes from a local binary stream

Parameters
streampointer to the mpm_stream entry
input_sizethe number of bytes to read
lengthoutput pointer to the length effectively read from the stream
dataoutput pointer to the binary data read from the stream
Returns
NT_STATUS_OK

References mpm_stream::fp, MPM_LOCATION, and mpm_stream::offset.

Referenced by cache_dispatch().

NTSTATUS mpm_cache_stream_reset ( struct mpm_stream stream)

Rewind a stream to the beginning

Parameters
streampointer to the mpm_stream entry
Returns
NT_STATUS_OK on success

References mpm_stream::fp, and mpm_stream::offset.

Referenced by cache_dispatch().

NTSTATUS mpm_cache_stream_write ( struct mpm_stream stream,
uint16_t  length,
uint8_t *  data 
)

Write length bytes to a local stream

Parameters
streampointer to the mpm_stream entry
lengththe data length to write to the stream
datapointer to the data to write to the stream
Returns
NT_STATUS_OK on success, otherwise NT_STATUS_UNSUCCESSFUL

References mpm_stream::fp, MPM_LOCATION, and mpm_stream::offset.

Referenced by cache_dispatch(), and cache_push_ReadStream().

__BEGIN_DECLS 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

Entry point for the cache mapiproxy module

Returns
NT_STATUS_OK on success, otherwise NTSTATUS error

Entry point for the downgrade mapiproxy module

Returns
NT_STATUS_OK on success, otherwise NTSTATUS error

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

Entry point for the cache mapiproxy module

Returns
NT_STATUS_OK on success, otherwise NTSTATUS error

Entry point for the downgrade mapiproxy module

Returns
NT_STATUS_OK on success, otherwise NTSTATUS error

Entry point for the pack mapiproxy module

Returns
NT_STATUS_OK on success, otherwise NTSTATUS error

Entry point for the default OpenChange EMSMDB server

Returns
NT_STATUS_OK on success, otherwise NTSTATUS error

Entry point for the default OpenChange NSPI server

Returns
NT_STATUS_OK on success, otherwise NTSTATUS error

Entry point for the default OpenChange RFR server

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/