new oxcfxics module: implemented stubs for "FastTransferSourceCopyTo" and "FastTransf...
authorwsourdeau <wsourdeau@71d39326-ef09-db11-b2a4-00e04c779ad1>
Mon, 6 Dec 2010 16:01:55 +0000 (16:01 +0000)
committerwsourdeau <wsourdeau@71d39326-ef09-db11-b2a4-00e04c779ad1>
Mon, 6 Dec 2010 16:01:55 +0000 (16:01 +0000)
git-svn-id: https://svn.openchange.org/openchange@2353 71d39326-ef09-db11-b2a4-00e04c779ad1

branches/sogo/Makefile
branches/sogo/mapiproxy/libmapiserver/libmapiserver.h
branches/sogo/mapiproxy/libmapiserver/libmapiserver_oxcfxics.c [new file with mode: 0644]
branches/sogo/mapiproxy/servers/default/emsmdb/dcesrv_exchange_emsmdb.c
branches/sogo/mapiproxy/servers/default/emsmdb/dcesrv_exchange_emsmdb.h
branches/sogo/mapiproxy/servers/default/emsmdb/oxcfxics.c [new file with mode: 0644]

index bf1c77b01362bfc6d7fe530d887a35a6dafcf19d..7f077c373bb70e588604825b22853258cbbfdbf5 100644 (file)
@@ -795,6 +795,7 @@ distclean:: libmapiserver-distclean
 mapiproxy/libmapiserver.$(SHLIBEXT).$(PACKAGE_VERSION):        mapiproxy/libmapiserver/libmapiserver_oxcstor.po        \
                                                        mapiproxy/libmapiserver/libmapiserver_oxcprpt.po        \
                                                        mapiproxy/libmapiserver/libmapiserver_oxcfold.po        \
+                                                       mapiproxy/libmapiserver/libmapiserver_oxcfxics.po       \
                                                        mapiproxy/libmapiserver/libmapiserver_oxctabl.po        \
                                                        mapiproxy/libmapiserver/libmapiserver_oxcmsg.po         \
                                                        mapiproxy/libmapiserver/libmapiserver_oxcnotif.po       \
@@ -1059,6 +1060,7 @@ mapiproxy/servers/exchange_emsmdb.$(SHLIBEXT):    mapiproxy/servers/default/emsmdb/
                                                mapiproxy/servers/default/emsmdb/oxcstor.po                     \
                                                mapiproxy/servers/default/emsmdb/oxcprpt.po                     \
                                                mapiproxy/servers/default/emsmdb/oxcfold.po                     \
+                                               mapiproxy/servers/default/emsmdb/oxcfxics.po                    \
                                                mapiproxy/servers/default/emsmdb/oxctabl.po                     \
                                                mapiproxy/servers/default/emsmdb/oxcmsg.po                      \
                                                mapiproxy/servers/default/emsmdb/oxcnotif.po                    \
@@ -1306,6 +1308,7 @@ bin/mapitest:     utils/mapitest/mapitest.o                       \
                utils/mapitest/module.o                         \
                utils/mapitest/modules/module_oxcstor.o         \
                utils/mapitest/modules/module_oxcfold.o         \
+               utils/mapitest/modules/module_oxcfxics.o        \
                utils/mapitest/modules/module_oxomsg.o          \
                utils/mapitest/modules/module_oxcmsg.o          \
                utils/mapitest/modules/module_oxcprpt.o         \
@@ -1332,13 +1335,14 @@ utils/mapitest/proto.h:                                 \
        utils/mapitest/module.c                         \
        utils/mapitest/modules/module_oxcstor.c         \
        utils/mapitest/modules/module_oxcfold.c         \
+       utils/mapitest/modules/module_oxcfxics.c        \
        utils/mapitest/modules/module_oxomsg.c          \
        utils/mapitest/modules/module_oxcmsg.c          \
        utils/mapitest/modules/module_oxcprpt.c         \
+       utils/mapitest/modules/module_oxcfxics.c        \
        utils/mapitest/modules/module_oxctable.c        \
        utils/mapitest/modules/module_oxorule.c         \
        utils/mapitest/modules/module_oxcnotif.c        \
-       utils/mapitest/modules/module_oxcfxics.c        \
        utils/mapitest/modules/module_oxcperm.c         \
        utils/mapitest/modules/module_nspi.c            \
        utils/mapitest/modules/module_noserver.c        \
index 51838de95e9990c6ec027f20ca0749dd165a6b5d..aa8476c1b55f0a02d372a942d3ecc37327bb9aaa 100644 (file)
  */
 #define        SIZE_DFLT_LONGTERMID            24
 
+/**
+   \details FastTransferSourceGetBuffer:
+   -# TransferStatus: uint16_t
+   -# InProgressCount: uint16_t
+   -# TotalStepCount: uint16_t
+   -# Reserved (1 byte): uint8_t
+   -# TransferBufferSize (2 bytes): uint16_t
+   -# TransferBuffer (variable): conditional (ReturnValue != 0x480)
+   -# BackoffTime (4 bytes): conditional (ReturnValue == 0x480), uint32_t
+ */
+#define SIZE_DFLT_ROPFASTTRANSFERSOURCEGETBUFFER 9
+
 __BEGIN_DECLS
 
 /* definitions from libmapiserver_oxcfold.c */
@@ -391,6 +403,10 @@ uint16_t libmapiserver_RopGetRulesTable_size(void);
 /* definitions from libmapiserver_oxcperm.c */
 uint16_t libmapiserver_RopGetPermissionsTable_size(struct EcDoRpc_MAPI_REPL *);
 
+/* definitions from libmapiserver_oxcfxics.c */
+uint16_t libmapiserver_RopFastTransferSourceCopyTo_size(struct EcDoRpc_MAPI_REPL *response);
+uint16_t libmapiserver_RopFastTransferSourceGetBuffer_size(struct EcDoRpc_MAPI_REPL *response);
+
 __END_DECLS
 
 #endif /* ! __LIBMAPISERVER_H__ */
diff --git a/branches/sogo/mapiproxy/libmapiserver/libmapiserver_oxcfxics.c b/branches/sogo/mapiproxy/libmapiserver/libmapiserver_oxcfxics.c
new file mode 100644 (file)
index 0000000..00fc054
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+   OpenChange Server implementation
+
+   EMSMDBP: EMSMDB Provider implementation
+
+   Copyright (C) Inverse inc. 2010
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+   \file libmapiserver_oxcfxics.c
+
+   \brief OXCFXICS ROP Response size calculations
+ */
+
+#include "libmapiserver.h"
+
+/**
+   \details Calculate FastTransferSourceCopyTo (0x4d) Rop size
+
+   \param response pointer to the FastTransferSourceCopyTo EcDoRpc_MAPI_REPL
+   structure
+
+   \return Size of FastTransferSourceCopyTo response
+ */
+_PUBLIC_ uint16_t libmapiserver_RopFastTransferSourceCopyTo_size(struct EcDoRpc_MAPI_REPL *response)
+{
+       return SIZE_DFLT_MAPI_RESPONSE;
+}
+
+
+/**
+   \details Calculate FastTransferSourceGetBuffer (0x4d) Rop size
+
+   \param response pointer to the FastTransferSourceGetBuffer EcDoRpc_MAPI_REPL
+   structure
+
+   \return Size of FastTransferSourceGetBuffer response
+ */
+_PUBLIC_ uint16_t libmapiserver_RopFastTransferSourceGetBuffer_size(struct EcDoRpc_MAPI_REPL *response)
+{
+       uint16_t        size = SIZE_DFLT_MAPI_RESPONSE;
+
+       if (!response || response->error_code) {
+               if (response->error_code == ecServerBusy) {
+                       size += sizeof (uint32_t); /* size of BackoffTime */
+               }
+               return size;
+       }
+
+       size += SIZE_DFLT_ROPFASTTRANSFERSOURCEGETBUFFER + response->u.mapi_FastTransferSourceGetBuffer.TransferBuffer.length;
+
+       return size;
+}
index 94388c8c42ad7fb1e5b2729fb627f9a6db574b1f..3fbb0bb6c43fa191f5c158e4b04efe4466754b0d 100644 (file)
@@ -541,8 +541,18 @@ static struct mapi_response *EcDoRpc_process_transaction(TALLOC_CTX *mem_ctx,
                /* op_MAPI_TransportSend: 0x4a */
                /* op_MAPI_FastTransferSourceCopyMessages: 0x4b */
                /* op_MAPI_FastTransferSourceCopyFolder: 0x4c */
-               /* op_MAPI_FastTransferSourceCopyTo: 0x4d */
-               /* op_MAPI_FastTransferSourceGetBuffer: 0x4e */
+               case op_MAPI_FastTransferSourceCopyTo: /* 0x4d */
+                       retval = EcDoRpc_RopFastTransferSourceCopyTo(mem_ctx, emsmdbp_ctx, 
+                                                                    &(mapi_request->mapi_req[i]),
+                                                                    &(mapi_response->mapi_repl[idx]),
+                                                                    mapi_response->handles, &size);
+                       break;
+               case op_MAPI_FastTransferSourceGetBuffer: /* 0x4e */
+                       retval = EcDoRpc_RopFastTransferSourceGetBuffer(mem_ctx, emsmdbp_ctx, 
+                                                                       &(mapi_request->mapi_req[i]),
+                                                                       &(mapi_response->mapi_repl[idx]),
+                                                                       mapi_response->handles, &size);
+                       break;
                case op_MAPI_FindRow: /* 0x4f */
                        retval = EcDoRpc_RopFindRow(mem_ctx, emsmdbp_ctx, 
                                                    &(mapi_request->mapi_req[i]),
index bc6f8c5d68e234b4bc62b1d7fea6166af007cff6..eeaf2615432b0182382f037374dd3789baaa5893 100644 (file)
@@ -256,6 +256,9 @@ enum MAPISTATUS EcDoRpc_RopGetRulesTable(TALLOC_CTX *, struct emsmdbp_context *,
 /* definitions from oxcperm.c */
 enum MAPISTATUS EcDoRpc_RopGetPermissionsTable(TALLOC_CTX *, struct emsmdbp_context *, struct EcDoRpc_MAPI_REQ *, struct EcDoRpc_MAPI_REPL *, uint32_t *, uint16_t *);
 
+/* definitions from oxcfxics.c */
+enum MAPISTATUS EcDoRpc_RopFastTransferSourceCopyTo(TALLOC_CTX *, struct emsmdbp_context *, struct EcDoRpc_MAPI_REQ *, struct EcDoRpc_MAPI_REPL *, uint32_t *, uint16_t *);
+enum MAPISTATUS EcDoRpc_RopFastTransferSourceGetBuffer(TALLOC_CTX *, struct emsmdbp_context *, struct EcDoRpc_MAPI_REQ *, struct EcDoRpc_MAPI_REPL *, uint32_t *, uint16_t *);
 
 __END_DECLS
 
diff --git a/branches/sogo/mapiproxy/servers/default/emsmdb/oxcfxics.c b/branches/sogo/mapiproxy/servers/default/emsmdb/oxcfxics.c
new file mode 100644 (file)
index 0000000..3769a2a
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+   OpenChange Server implementation
+
+   EMSMDBP: EMSMDB Provider implementation
+
+   Copyright (C) Inverse inc. 2010
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+   \file oxcfxics.c
+
+   \brief FastTransfer and ICS object routines and Rops
+ */
+
+#include "mapiproxy/libmapiserver/libmapiserver.h"
+#include "dcesrv_exchange_emsmdb.h"
+
+/**
+   \details EcDoRpc EcDoRpc_RopFastTransferSourceCopyTo (0x4d) Rop. This operation initializes a FastTransfer operation to download content from a given messaging object and its descendant subobjects.
+
+   \param mem_ctx pointer to the memory context
+   \param emsmdbp_ctx pointer to the emsmdb provider context
+   \param mapi_req pointer to the OpenMessage EcDoRpc_MAPI_REQ
+   structure
+   \param mapi_repl pointer to the OpenMessage EcDoRpc_MAPI_REPL
+   structure
+   \param handles pointer to the MAPI handles array
+   \param size pointer to the mapi_response size to update
+
+   \return MAPI_E_SUCCESS on success, otherwise MAPI error
+ */
+_PUBLIC_ enum MAPISTATUS EcDoRpc_RopFastTransferSourceCopyTo(TALLOC_CTX *mem_ctx,
+                                                            struct emsmdbp_context *emsmdbp_ctx,
+                                                            struct EcDoRpc_MAPI_REQ *mapi_req,
+                                                            struct EcDoRpc_MAPI_REPL *mapi_repl,
+                                                            uint32_t *handles, uint16_t *size)
+{
+       DEBUG(4, ("exchange_emsmdb: [OXCMSG] FastTransferSourceCopyTo (0x4d) - unimplemented\n"));
+
+       /* Sanity checks */
+       OPENCHANGE_RETVAL_IF(!emsmdbp_ctx, MAPI_E_NOT_INITIALIZED, NULL);
+       OPENCHANGE_RETVAL_IF(!mapi_req, MAPI_E_INVALID_PARAMETER, NULL);
+       OPENCHANGE_RETVAL_IF(!mapi_repl, MAPI_E_INVALID_PARAMETER, NULL);
+       OPENCHANGE_RETVAL_IF(!handles, MAPI_E_INVALID_PARAMETER, NULL);
+       OPENCHANGE_RETVAL_IF(!size, MAPI_E_INVALID_PARAMETER, NULL);
+
+       mapi_repl->opnum = mapi_req->opnum;
+       mapi_repl->error_code = MAPI_E_SUCCESS;
+       mapi_repl->handle_idx = mapi_req->handle_idx;
+
+       /* TODO: actually implement this */
+       mapi_repl->error_code = MAPI_E_NO_SUPPORT;
+
+       *size += libmapiserver_RopFastTransferSourceCopyTo_size(mapi_repl);
+
+       return MAPI_E_SUCCESS;
+}
+
+/**
+   \details EcDoRpc EcDoRpc_RopFastTransferSourceGetBuffer (0x4e) Rop. This operation downloads the next portion of a FastTransfer stream that is produced by a previously configured download operation.
+
+   \param mem_ctx pointer to the memory context
+   \param emsmdbp_ctx pointer to the emsmdb provider context
+   \param mapi_req pointer to the OpenMessage EcDoRpc_MAPI_REQ
+   structure
+   \param mapi_repl pointer to the OpenMessage EcDoRpc_MAPI_REPL
+   structure
+   \param handles pointer to the MAPI handles array
+   \param size pointer to the mapi_response size to update
+
+   \return MAPI_E_SUCCESS on success, otherwise MAPI error
+ */
+_PUBLIC_ enum MAPISTATUS EcDoRpc_RopFastTransferSourceGetBuffer(TALLOC_CTX *mem_ctx,
+                                                               struct emsmdbp_context *emsmdbp_ctx,
+                                                               struct EcDoRpc_MAPI_REQ *mapi_req,
+                                                               struct EcDoRpc_MAPI_REPL *mapi_repl,
+                                                               uint32_t *handles, uint16_t *size)
+{
+       DEBUG(4, ("exchange_emsmdb: [OXCMSG] FastTransferSourceGetBuffer (0x4e) - unimplemented\n"));
+
+       /* Sanity checks */
+       OPENCHANGE_RETVAL_IF(!emsmdbp_ctx, MAPI_E_NOT_INITIALIZED, NULL);
+       OPENCHANGE_RETVAL_IF(!mapi_req, MAPI_E_INVALID_PARAMETER, NULL);
+       OPENCHANGE_RETVAL_IF(!mapi_repl, MAPI_E_INVALID_PARAMETER, NULL);
+       OPENCHANGE_RETVAL_IF(!handles, MAPI_E_INVALID_PARAMETER, NULL);
+       OPENCHANGE_RETVAL_IF(!size, MAPI_E_INVALID_PARAMETER, NULL);
+
+       mapi_repl->opnum = mapi_req->opnum;
+       mapi_repl->error_code = MAPI_E_SUCCESS;
+       mapi_repl->handle_idx = mapi_req->handle_idx;
+
+       /* TODO: actually implement this */
+       mapi_repl->error_code = MAPI_E_NO_SUPPORT;
+
+       *size += libmapiserver_RopFastTransferSourceGetBuffer_size(mapi_repl);
+
+       return MAPI_E_SUCCESS;
+}