2 libmapiserver - MAPI library for Server side
6 Copyright (C) Julien Kerihuel 2009
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 \file libmapiserver_oxcstor.c
25 \brief OXCSTOR ROP Response size calculations
28 #include "libmapiserver.h"
32 \details Calculate Logon Rop size
34 \param request pointer to the Logon EcDoRpc_MAPI_REQ structure
35 \param response pointer to the Logon EcDoRpc_MAPI_REPL structure
37 \return Size of Logon response
39 _PUBLIC_ uint16_t libmapiserver_RopLogon_size(struct EcDoRpc_MAPI_REQ *request,
40 struct EcDoRpc_MAPI_REPL *response)
42 uint16_t size = SIZE_DFLT_MAPI_RESPONSE;
44 if (!response || (response->error_code && response->error_code != ecWrongServer)) {
48 if (response->error_code == ecWrongServer) {
49 size += SIZE_DFLT_ROPLOGON_REDIRECT;
50 size += strlen (response->us.mapi_Logon.ServerName) + 1;
54 if (request->u.mapi_Logon.LogonFlags & LogonPrivate) {
55 size += SIZE_DFLT_ROPLOGON_MAILBOX;
57 size += SIZE_DFLT_ROPLOGON_PUBLICFOLDER;
64 \details Calculate SetReceiveFolder (0x26) Rop size
66 \param response pointer to the SetReceiveFolder EcDoRpc_MAPI_REPL
69 \return Size of SetReceiveFolder response
71 _PUBLIC_ uint16_t libmapiserver_RopSetReceiveFolder_size(struct EcDoRpc_MAPI_REPL *response)
73 return SIZE_DFLT_MAPI_RESPONSE;
78 \details Calculate GetReceiveFolder Rop size
80 \param response pointer to the GetReceiveFolder EcDoRpc_MAPI_REPL structure
82 \return Size of GetReceiveFolder response
84 _PUBLIC_ uint16_t libmapiserver_RopGetReceiveFolder_size(struct EcDoRpc_MAPI_REPL *response)
86 uint16_t size = SIZE_DFLT_MAPI_RESPONSE;
88 if (!response || response->error_code) {
92 size += SIZE_DFLT_ROPGETRECEIVEFOLDER;
93 size += strlen(response->u.mapi_GetReceiveFolder.MessageClass) + 1;
100 \details Calculate GetPerUserLongTermIds Rop size
102 \param response pointer to the GetPerUserLongTermIds EcDoRpc_MAPI_REPL structure
104 \return Size of GetPerUserLongTermIds response
106 _PUBLIC_ uint16_t libmapiserver_RopGetPerUserLongTermIds_size(struct EcDoRpc_MAPI_REPL *response)
108 uint16_t size = SIZE_DFLT_MAPI_RESPONSE;
111 if (!response || response->error_code) {
115 size += SIZE_DFLT_ROPGETPERUSERLONGTERMIDS;
117 for (i = 0; i < response->u.mapi_GetPerUserLongTermIds.LongTermIdCount; i++) {
118 size += libmapiserver_LongTermId_size();
126 \details Calculate ReadPerUserInformation Rop size
128 \param response pointer to the ReadPerUserInformation EcDoRpc_MAPI_REPL structure
130 \return Size of ReadPerUserInformation response
132 _PUBLIC_ uint16_t libmapiserver_RopReadPerUserInformation_size(struct EcDoRpc_MAPI_REPL *response)
134 uint16_t size = SIZE_DFLT_MAPI_RESPONSE;
136 if (!response || response->error_code) {
140 size += SIZE_DFLT_ROPREADPERUSERINFORMATION;
142 if (response->u.mapi_ReadPerUserInformation.DataSize) {
143 size += response->u.mapi_ReadPerUserInformation.DataSize;
150 \details Calculate GetPerUserLongTermIds Rop size
152 \param response pointer to the GetPerUserLongTermIds EcDoRpc_MAPI_REPL structure
154 \return Size of GetPerUserLongTermIds response
156 _PUBLIC_ uint16_t libmapiserver_RopGetPerUserGuid_size(struct EcDoRpc_MAPI_REPL *response)
158 uint16_t size = SIZE_DFLT_MAPI_RESPONSE;
160 if (!response || response->error_code) {
164 size += SIZE_DFLT_ROPGETPERUSERGUID;
170 \details Calculate GetReceiveFolderTable ROP size
172 \param response pointer to the GetReceiveFolderTable EcDoRpc_MAPI_REPL structure
174 \return Size of GetPerUserLongTermIds response
176 _PUBLIC_ uint16_t libmapiserver_RopGetReceiveFolderTable_size(struct EcDoRpc_MAPI_REPL *response)
179 uint16_t size = SIZE_DFLT_MAPI_RESPONSE;
181 if (!response || response->error_code) {
185 size += sizeof(uint32_t); /* cValues */
186 for (i = 0; i < response->u.mapi_GetReceiveFolderTable.cValues; ++i) {
187 size += sizeof(uint8_t); /* flag */
188 size += sizeof(uint64_t); /* fid */
189 size += strlen(response->u.mapi_GetReceiveFolderTable.entries[i].lpszMessageClass) + 1;
190 size += sizeof(struct FILETIME); /* modiftime */