~ubuntu-branches/debian/experimental/openchange/experimental

« back to all changes in this revision

Viewing changes to mapiproxy/libmapiserver/libmapiserver_oxomsg.c

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij, Mathieu Parent, Jelmer Vernooij
  • Date: 2010-06-19 00:14:54 UTC
  • mfrom: (1.2.1 upstream) (4.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20100619001454-c9qbwzlbv3rgqrir
Tags: 1:0.9+svn1970-1
[ Mathieu Parent ]
* Add Vcs-Browser
* libmapi-dev depends on libndr-standard-dev.
  Fix "Missing dependency on samba4-dev" (Closes: #549012)

[ Jelmer Vernooij ]
* Use source format version 3.
* Bump standards version to 3.8.4.
* New upstream snapshot.
* Add build dependency on zlib1g-dev. Closes: #577330
* Migrate packaging to Bazaar.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
   libmapiserver - MAPI library for Server side
 
3
 
 
4
   OpenChange Project
 
5
 
 
6
   Copyright (C) Brad Hards 2010
 
7
 
 
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.
 
12
   
 
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.
 
17
   
 
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/>.
 
20
 */
 
21
 
 
22
/**
 
23
   \file libmapiserver_oxomsg.c
 
24
 
 
25
   \brief OXOMSG ROP Response size calculations
 
26
 */
 
27
 
 
28
#include "libmapiserver.h"
 
29
#include <string.h>
 
30
 
 
31
/**
 
32
   \details Calculate SubmitMessage (0x32) Rop size
 
33
 
 
34
   \param response pointer to the SubmitMessage EcDoRpc_MAPI_REPL
 
35
   structure
 
36
 
 
37
   \return Size of SubmitMessage response
 
38
 */
 
39
_PUBLIC_ uint16_t libmapiserver_RopSubmitMessage_size(struct EcDoRpc_MAPI_REPL *response)
 
40
{
 
41
        return SIZE_DFLT_MAPI_RESPONSE;
 
42
}
 
43
 
 
44
 
 
45
/**
 
46
   \details Calculate SetSpooler (0x47) Rop size
 
47
 
 
48
   \param response pointer to the SetSpooler EcDoRpc_MAPI_REPL
 
49
   structure
 
50
 
 
51
   \return Size of SetSpooler response
 
52
 */
 
53
_PUBLIC_ uint16_t libmapiserver_RopSetSpooler_size(struct EcDoRpc_MAPI_REPL *response)
 
54
{
 
55
        return SIZE_DFLT_MAPI_RESPONSE;
 
56
}
 
57
 
 
58
 
 
59
/**
 
60
   \details Calculate GetAddressTypes (0x49) Rop size
 
61
 
 
62
   \param response pointer to the GetAddressTypes EcDoRpc_MAPI_REPL structure
 
63
 
 
64
   \return Size of GetAddressTypes response
 
65
 */
 
66
_PUBLIC_ uint16_t libmapiserver_RopGetAddressTypes_size(struct EcDoRpc_MAPI_REPL *response)
 
67
{
 
68
        uint16_t        size = SIZE_DFLT_MAPI_RESPONSE;
 
69
 
 
70
        if (!response || response->error_code) {
 
71
                return size;
 
72
        }
 
73
 
 
74
        size += SIZE_DFLT_ROPGETADDRESSTYPES;
 
75
        /* The length of the strings is variable, but given by the size parameter */
 
76
        size += response->u.mapi_AddressTypes.size;
 
77
 
 
78
        return size;
 
79
}
 
80
 
 
81
/**
 
82
   \details Calculate GetTransportFolder (0x6d) ROP size
 
83
 
 
84
   \param response pointer to the GetTransportFolder EcDoRpc_MAPI_REPL structure
 
85
 
 
86
   \return Size of GetTransportFolder response
 
87
 */
 
88
_PUBLIC_ uint16_t libmapiserver_RopGetTransportFolder_size(struct EcDoRpc_MAPI_REPL *response)
 
89
{
 
90
        uint16_t        size = SIZE_DFLT_MAPI_RESPONSE;
 
91
 
 
92
        if (!response || response->error_code) {
 
93
                return size;
 
94
        }
 
95
 
 
96
        size += SIZE_DFLT_ROPGETTRANSPORTFOLDER;
 
97
 
 
98
        return size;
 
99
}
 
100
 
 
101
 
 
102
/**
 
103
   \details Calculate OptionsData (0x6f) Rop size
 
104
 
 
105
   \param response pointer to the OptionsData EcDoRpc_MAPI_REPL structure
 
106
 
 
107
   \return Size of OptionsData response
 
108
 */
 
109
_PUBLIC_ uint16_t libmapiserver_RopOptionsData_size(struct EcDoRpc_MAPI_REPL *response)
 
110
{
 
111
        uint16_t        size = SIZE_DFLT_MAPI_RESPONSE;
 
112
 
 
113
        if (!response || response->error_code) {
 
114
                return size;
 
115
        }
 
116
 
 
117
        size += SIZE_DFLT_ROPOPTIONSDATA;
 
118
        size += response->u.mapi_OptionsData.OptionsInfo.cb;
 
119
        size += response->u.mapi_OptionsData.HelpFileSize;
 
120
        if (response->u.mapi_OptionsData.HelpFileSize != 0) {
 
121
                size += strlen(response->u.mapi_OptionsData.HelpFileName.HelpFileName) + 1;
 
122
        }
 
123
 
 
124
        return size;
 
125
}