summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-dcerpc-rfr.c
blob: ec51eabd1788506ddf4bc658454a11fb34be0cb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
/* DO NOT EDIT
	This file was automatically generated by Pidl
	from rfr.idl and rfr.cnf.

	Pidl is a perl based IDL compiler for DCE/RPC idl files.
	It is maintained by the Samba team, not the Wireshark team.
	Instructions on how to download and install Pidl can be
	found at https://wiki.wireshark.org/Pidl
*/


#include "config.h"
#include <string.h>
#include <wsutil/array.h>
#include <epan/packet.h>
#include <epan/tfs.h>

#include "packet-dcerpc.h"
#include "packet-dcerpc-nt.h"
#include "packet-windows-common.h"
#include "packet-dcerpc-rfr.h"
void proto_register_dcerpc_rfr(void);
void proto_reg_handoff_dcerpc_rfr(void);

/* Ett declarations */
static int ett_dcerpc_rfr;


/* Header field declarations */
static int hf_rfr_MAPISTATUS_status;
static int hf_rfr_RfrGetFQDNFromLegacyDN_cbMailboxServerDN;
static int hf_rfr_RfrGetFQDNFromLegacyDN_ppszServerFQDN;
static int hf_rfr_RfrGetFQDNFromLegacyDN_szMailboxServerDN;
static int hf_rfr_RfrGetFQDNFromLegacyDN_ulFlags;
static int hf_rfr_RfrGetNewDSA_pUserDN;
static int hf_rfr_RfrGetNewDSA_ppszServer;
static int hf_rfr_RfrGetNewDSA_ppszUnused;
static int hf_rfr_RfrGetNewDSA_ulFlags;
static int hf_rfr_opnum;

static int proto_dcerpc_rfr;
/* Version information */


static e_guid_t uuid_dcerpc_rfr = {
	0x1544f5e0, 0x613c, 0x11d1,
	{ 0x93, 0xdf, 0x00, 0xc0, 0x4f, 0xd7, 0xbd, 0x09 }
};
static uint16_t ver_dcerpc_rfr = 1;

const value_string rfr_MAPISTATUS_vals[] = {
	{ MAPI_E_SUCCESS, "MAPI_E_SUCCESS" },
	{ MAPI_E_NO_SUPPORT, "MAPI_E_NO_SUPPORT" },
	{ MAPI_E_BAD_CHARWIDTH, "MAPI_E_BAD_CHARWIDTH" },
	{ MAPI_E_STRING_TOO_LONG, "MAPI_E_STRING_TOO_LONG" },
	{ MAPI_E_UNKNOWN_FLAGS, "MAPI_E_UNKNOWN_FLAGS" },
	{ MAPI_E_INVALID_ENTRYID, "MAPI_E_INVALID_ENTRYID" },
	{ MAPI_E_INVALID_OBJECT, "MAPI_E_INVALID_OBJECT" },
	{ MAPI_E_OBJECT_CHANGED, "MAPI_E_OBJECT_CHANGED" },
	{ MAPI_E_OBJECT_DELETED, "MAPI_E_OBJECT_DELETED" },
	{ MAPI_E_BUSY, "MAPI_E_BUSY" },
	{ MAPI_E_NOT_ENOUGH_DISK, "MAPI_E_NOT_ENOUGH_DISK" },
	{ MAPI_E_NOT_ENOUGH_RESOURCES, "MAPI_E_NOT_ENOUGH_RESOURCES" },
	{ MAPI_E_NOT_FOUND, "MAPI_E_NOT_FOUND" },
	{ MAPI_E_VERSION, "MAPI_E_VERSION" },
	{ MAPI_E_LOGON_FAILED, "MAPI_E_LOGON_FAILED" },
	{ MAPI_E_SESSION_LIMIT, "MAPI_E_SESSION_LIMIT" },
	{ MAPI_E_USER_CANCEL, "MAPI_E_USER_CANCEL" },
	{ MAPI_E_UNABLE_TO_ABORT, "MAPI_E_UNABLE_TO_ABORT" },
	{ MAPI_E_NETWORK_ERROR, "MAPI_E_NETWORK_ERROR" },
	{ MAPI_E_DISK_ERROR, "MAPI_E_DISK_ERROR" },
	{ MAPI_E_TOO_COMPLEX, "MAPI_E_TOO_COMPLEX" },
	{ MAPI_E_BAD_COLUMN, "MAPI_E_BAD_COLUMN" },
	{ MAPI_E_EXTENDED_ERROR, "MAPI_E_EXTENDED_ERROR" },
	{ MAPI_E_COMPUTED, "MAPI_E_COMPUTED" },
	{ MAPI_E_CORRUPT_DATA, "MAPI_E_CORRUPT_DATA" },
	{ MAPI_E_UNCONFIGURED, "MAPI_E_UNCONFIGURED" },
	{ MAPI_E_FAILONEPROVIDER, "MAPI_E_FAILONEPROVIDER" },
	{ MAPI_E_UNKNOWN_CPID, "MAPI_E_UNKNOWN_CPID" },
	{ MAPI_E_UNKNOWN_LCID, "MAPI_E_UNKNOWN_LCID" },
	{ MAPI_E_PASSWORD_CHANGE_REQUIRED, "MAPI_E_PASSWORD_CHANGE_REQUIRED" },
	{ MAPI_E_PASSWORD_EXPIRED, "MAPI_E_PASSWORD_EXPIRED" },
	{ MAPI_E_INVALID_WORKSTATION_ACCOUNT, "MAPI_E_INVALID_WORKSTATION_ACCOUNT" },
	{ MAPI_E_INVALID_ACCESS_TIME, "MAPI_E_INVALID_ACCESS_TIME" },
	{ MAPI_E_ACCOUNT_DISABLED, "MAPI_E_ACCOUNT_DISABLED" },
	{ MAPI_E_END_OF_SESSION, "MAPI_E_END_OF_SESSION" },
	{ MAPI_E_UNKNOWN_ENTRYID, "MAPI_E_UNKNOWN_ENTRYID" },
	{ MAPI_E_MISSING_REQUIRED_COLUMN, "MAPI_E_MISSING_REQUIRED_COLUMN" },
	{ MAPI_W_NO_SERVICE, "MAPI_W_NO_SERVICE" },
	{ MAPI_E_BAD_VALUE, "MAPI_E_BAD_VALUE" },
	{ MAPI_E_INVALID_TYPE, "MAPI_E_INVALID_TYPE" },
	{ MAPI_E_TYPE_NO_SUPPORT, "MAPI_E_TYPE_NO_SUPPORT" },
	{ MAPI_E_UNEXPECTED_TYPE, "MAPI_E_UNEXPECTED_TYPE" },
	{ MAPI_E_TOO_BIG, "MAPI_E_TOO_BIG" },
	{ MAPI_E_DECLINE_COPY, "MAPI_E_DECLINE_COPY" },
	{ MAPI_E_UNEXPECTED_ID, "MAPI_E_UNEXPECTED_ID" },
	{ MAPI_W_ERRORS_RETURNED, "MAPI_W_ERRORS_RETURNED" },
	{ MAPI_E_UNABLE_TO_COMPLETE, "MAPI_E_UNABLE_TO_COMPLETE" },
	{ MAPI_E_TIMEOUT, "MAPI_E_TIMEOUT" },
	{ MAPI_E_TABLE_EMPTY, "MAPI_E_TABLE_EMPTY" },
	{ MAPI_E_TABLE_TOO_BIG, "MAPI_E_TABLE_TOO_BIG" },
	{ MAPI_E_INVALID_BOOKMARK, "MAPI_E_INVALID_BOOKMARK" },
	{ MAPI_W_POSITION_CHANGED, "MAPI_W_POSITION_CHANGED" },
	{ MAPI_W_APPROX_COUNT, "MAPI_W_APPROX_COUNT" },
	{ MAPI_E_WAIT, "MAPI_E_WAIT" },
	{ MAPI_E_CANCEL, "MAPI_E_CANCEL" },
	{ MAPI_E_NOT_ME, "MAPI_E_NOT_ME" },
	{ MAPI_W_CANCEL_MESSAGE, "MAPI_W_CANCEL_MESSAGE" },
	{ MAPI_E_CORRUPT_STORE, "MAPI_E_CORRUPT_STORE" },
	{ MAPI_E_NOT_IN_QUEUE, "MAPI_E_NOT_IN_QUEUE" },
	{ MAPI_E_NO_SUPPRESS, "MAPI_E_NO_SUPPRESS" },
	{ MAPI_E_COLLISION, "MAPI_E_COLLISION" },
	{ MAPI_E_NOT_INITIALIZED, "MAPI_E_NOT_INITIALIZED" },
	{ MAPI_E_NON_STANDARD, "MAPI_E_NON_STANDARD" },
	{ MAPI_E_NO_RECIPIENTS, "MAPI_E_NO_RECIPIENTS" },
	{ MAPI_E_SUBMITTED, "MAPI_E_SUBMITTED" },
	{ MAPI_E_HAS_FOLDERS, "MAPI_E_HAS_FOLDERS" },
	{ MAPI_E_HAS_MESSAGES, "MAPI_E_HAS_MESSAGES" },
	{ MAPI_E_FOLDER_CYCLE, "MAPI_E_FOLDER_CYCLE" },
	{ MAPI_W_PARTIAL_COMPLETION, "MAPI_W_PARTIAL_COMPLETION" },
	{ MAPI_E_AMBIGUOUS_RECIP, "MAPI_E_AMBIGUOUS_RECIP" },
	{ MAPI_E_RESERVED, "MAPI_E_RESERVED" },
{ 0, NULL }
};
static int rfr_dissect_element_RfrGetNewDSA_ulFlags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
static int rfr_dissect_element_RfrGetNewDSA_pUserDN(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
static int rfr_dissect_element_RfrGetNewDSA_pUserDN_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
static int rfr_dissect_element_RfrGetNewDSA_ppszUnused(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
static int rfr_dissect_element_RfrGetNewDSA_ppszUnused_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
static int rfr_dissect_element_RfrGetNewDSA_ppszUnused__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
static int rfr_dissect_element_RfrGetNewDSA_ppszServer(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
static int rfr_dissect_element_RfrGetNewDSA_ppszServer_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
static int rfr_dissect_element_RfrGetNewDSA_ppszServer__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
static int rfr_dissect_element_RfrGetFQDNFromLegacyDN_ulFlags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
static int rfr_dissect_element_RfrGetFQDNFromLegacyDN_cbMailboxServerDN(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
static int rfr_dissect_element_RfrGetFQDNFromLegacyDN_szMailboxServerDN(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
static int rfr_dissect_element_RfrGetFQDNFromLegacyDN_szMailboxServerDN_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
static int rfr_dissect_element_RfrGetFQDNFromLegacyDN_ppszServerFQDN(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
static int rfr_dissect_element_RfrGetFQDNFromLegacyDN_ppszServerFQDN_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);
static int rfr_dissect_element_RfrGetFQDNFromLegacyDN_ppszServerFQDN__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_);


/* IDL: enum { */
/* IDL: 	MAPI_E_SUCCESS=0x00000000, */
/* IDL: 	MAPI_E_NO_SUPPORT=0x80040102, */
/* IDL: 	MAPI_E_BAD_CHARWIDTH=0x80040103, */
/* IDL: 	MAPI_E_STRING_TOO_LONG=0x80040105, */
/* IDL: 	MAPI_E_UNKNOWN_FLAGS=0x80040106, */
/* IDL: 	MAPI_E_INVALID_ENTRYID=0x80040107, */
/* IDL: 	MAPI_E_INVALID_OBJECT=0x80040108, */
/* IDL: 	MAPI_E_OBJECT_CHANGED=0x80040109, */
/* IDL: 	MAPI_E_OBJECT_DELETED=0x8004010A, */
/* IDL: 	MAPI_E_BUSY=0x8004010B, */
/* IDL: 	MAPI_E_NOT_ENOUGH_DISK=0x8004010D, */
/* IDL: 	MAPI_E_NOT_ENOUGH_RESOURCES=0x8004010E, */
/* IDL: 	MAPI_E_NOT_FOUND=0x8004010F, */
/* IDL: 	MAPI_E_VERSION=0x80040110, */
/* IDL: 	MAPI_E_LOGON_FAILED=0x80040111, */
/* IDL: 	MAPI_E_SESSION_LIMIT=0x80040112, */
/* IDL: 	MAPI_E_USER_CANCEL=0x80040113, */
/* IDL: 	MAPI_E_UNABLE_TO_ABORT=0x80040114, */
/* IDL: 	MAPI_E_NETWORK_ERROR=0x80040115, */
/* IDL: 	MAPI_E_DISK_ERROR=0x80040116, */
/* IDL: 	MAPI_E_TOO_COMPLEX=0x80040117, */
/* IDL: 	MAPI_E_BAD_COLUMN=0x80040118, */
/* IDL: 	MAPI_E_EXTENDED_ERROR=0x80040119, */
/* IDL: 	MAPI_E_COMPUTED=0x8004011A, */
/* IDL: 	MAPI_E_CORRUPT_DATA=0x8004011B, */
/* IDL: 	MAPI_E_UNCONFIGURED=0x8004011C, */
/* IDL: 	MAPI_E_FAILONEPROVIDER=0x8004011D, */
/* IDL: 	MAPI_E_UNKNOWN_CPID=0x8004011E, */
/* IDL: 	MAPI_E_UNKNOWN_LCID=0x8004011F, */
/* IDL: 	MAPI_E_PASSWORD_CHANGE_REQUIRED=0x80040120, */
/* IDL: 	MAPI_E_PASSWORD_EXPIRED=0x80040121, */
/* IDL: 	MAPI_E_INVALID_WORKSTATION_ACCOUNT=0x80040122, */
/* IDL: 	MAPI_E_INVALID_ACCESS_TIME=0x80040123, */
/* IDL: 	MAPI_E_ACCOUNT_DISABLED=0x80040124, */
/* IDL: 	MAPI_E_END_OF_SESSION=0x80040200, */
/* IDL: 	MAPI_E_UNKNOWN_ENTRYID=0x80040201, */
/* IDL: 	MAPI_E_MISSING_REQUIRED_COLUMN=0x80040202, */
/* IDL: 	MAPI_W_NO_SERVICE=0x80040203, */
/* IDL: 	MAPI_E_BAD_VALUE=0x80040301, */
/* IDL: 	MAPI_E_INVALID_TYPE=0x80040302, */
/* IDL: 	MAPI_E_TYPE_NO_SUPPORT=0x80040303, */
/* IDL: 	MAPI_E_UNEXPECTED_TYPE=0x80040304, */
/* IDL: 	MAPI_E_TOO_BIG=0x80040305, */
/* IDL: 	MAPI_E_DECLINE_COPY=0x80040306, */
/* IDL: 	MAPI_E_UNEXPECTED_ID=0x80040307, */
/* IDL: 	MAPI_W_ERRORS_RETURNED=0x80040380, */
/* IDL: 	MAPI_E_UNABLE_TO_COMPLETE=0x80040400, */
/* IDL: 	MAPI_E_TIMEOUT=0x80040401, */
/* IDL: 	MAPI_E_TABLE_EMPTY=0x80040402, */
/* IDL: 	MAPI_E_TABLE_TOO_BIG=0x80040403, */
/* IDL: 	MAPI_E_INVALID_BOOKMARK=0x80040405, */
/* IDL: 	MAPI_W_POSITION_CHANGED=0x80040481, */
/* IDL: 	MAPI_W_APPROX_COUNT=0x80040482, */
/* IDL: 	MAPI_E_WAIT=0x80040500, */
/* IDL: 	MAPI_E_CANCEL=0x80040501, */
/* IDL: 	MAPI_E_NOT_ME=0x80040502, */
/* IDL: 	MAPI_W_CANCEL_MESSAGE=0x80040580, */
/* IDL: 	MAPI_E_CORRUPT_STORE=0x80040600, */
/* IDL: 	MAPI_E_NOT_IN_QUEUE=0x80040601, */
/* IDL: 	MAPI_E_NO_SUPPRESS=0x80040602, */
/* IDL: 	MAPI_E_COLLISION=0x80040604, */
/* IDL: 	MAPI_E_NOT_INITIALIZED=0x80040605, */
/* IDL: 	MAPI_E_NON_STANDARD=0x80040606, */
/* IDL: 	MAPI_E_NO_RECIPIENTS=0x80040607, */
/* IDL: 	MAPI_E_SUBMITTED=0x80040608, */
/* IDL: 	MAPI_E_HAS_FOLDERS=0x80040609, */
/* IDL: 	MAPI_E_HAS_MESSAGES=0x8004060A, */
/* IDL: 	MAPI_E_FOLDER_CYCLE=0x8004060B, */
/* IDL: 	MAPI_W_PARTIAL_COMPLETION=0x80040680, */
/* IDL: 	MAPI_E_AMBIGUOUS_RECIP=0x80040700, */
/* IDL: 	MAPI_E_RESERVED=0xFFFFFFFF, */
/* IDL: } */

int
rfr_dissect_enum_MAPISTATUS(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_, int hf_index _U_, uint32_t *param _U_)
{
	uint32_t parameter=0;
	if (param) {
		parameter = *param;
	}
	offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_index, &parameter);
	if (param) {
		*param = parameter;
	}
	return offset;
}

static int
rfr_dissect_element_RfrGetNewDSA_ulFlags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, di, drep, hf_rfr_RfrGetNewDSA_ulFlags, 0);

	return offset;
}

static int
rfr_dissect_element_RfrGetNewDSA_pUserDN(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, di, drep, rfr_dissect_element_RfrGetNewDSA_pUserDN_, NDR_POINTER_REF, "Pointer to PUserDN (uint8)",hf_rfr_RfrGetNewDSA_pUserDN);

	return offset;
}

static int
rfr_dissect_element_RfrGetNewDSA_pUserDN_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	char *data;

	offset = dissect_ndr_cvstring(tvb, offset, pinfo, tree, di, drep, sizeof(uint8_t), hf_rfr_RfrGetNewDSA_pUserDN, false, &data);
	proto_item_append_text(tree, ": %s", data);

	return offset;
}

static int
rfr_dissect_element_RfrGetNewDSA_ppszUnused(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, di, drep, rfr_dissect_element_RfrGetNewDSA_ppszUnused_, NDR_POINTER_UNIQUE, "Pointer to PpszUnused (uint8)",hf_rfr_RfrGetNewDSA_ppszUnused);

	return offset;
}

static int
rfr_dissect_element_RfrGetNewDSA_ppszUnused_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, di, drep, rfr_dissect_element_RfrGetNewDSA_ppszUnused__, NDR_POINTER_UNIQUE, "Pointer to PpszUnused (uint8)",hf_rfr_RfrGetNewDSA_ppszUnused);

	return offset;
}

static int
rfr_dissect_element_RfrGetNewDSA_ppszUnused__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	char *data;

	offset = dissect_ndr_cvstring(tvb, offset, pinfo, tree, di, drep, sizeof(uint8_t), hf_rfr_RfrGetNewDSA_ppszUnused, false, &data);
	proto_item_append_text(tree, ": %s", data);

	return offset;
}

static int
rfr_dissect_element_RfrGetNewDSA_ppszServer(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, di, drep, rfr_dissect_element_RfrGetNewDSA_ppszServer_, NDR_POINTER_UNIQUE, "Pointer to PpszServer (uint8)",hf_rfr_RfrGetNewDSA_ppszServer);

	return offset;
}

static int
rfr_dissect_element_RfrGetNewDSA_ppszServer_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, di, drep, rfr_dissect_element_RfrGetNewDSA_ppszServer__, NDR_POINTER_UNIQUE, "Pointer to PpszServer (uint8)",hf_rfr_RfrGetNewDSA_ppszServer);

	return offset;
}

static int
rfr_dissect_element_RfrGetNewDSA_ppszServer__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	char *data;

	offset = dissect_ndr_cvstring(tvb, offset, pinfo, tree, di, drep, sizeof(uint8_t), hf_rfr_RfrGetNewDSA_ppszServer, false, &data);
	proto_item_append_text(tree, ": %s", data);

	return offset;
}

/* IDL: MAPISTATUS RfrGetNewDSA( */
/* IDL: [in] uint32 ulFlags, */
/* IDL: [charset(DOS)] [in] [ref] uint8 *pUserDN, */
/* IDL: [charset(DOS)] [in] [out] [unique(1)] uint8 **ppszUnused, */
/* IDL: [charset(DOS)] [in] [out] [unique(1)] uint8 **ppszServer */
/* IDL: ); */

static int
rfr_dissect_RfrGetNewDSA_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	uint32_t status;

	di->dcerpc_procedure_name="RfrGetNewDSA";
	offset = rfr_dissect_element_RfrGetNewDSA_ppszUnused(tvb, offset, pinfo, tree, di, drep);
	offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);

	offset = rfr_dissect_element_RfrGetNewDSA_ppszServer(tvb, offset, pinfo, tree, di, drep);
	offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);

	offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_rfr_MAPISTATUS_status, &status);
	if (status != 0)
		col_append_fstr(pinfo->cinfo, COL_INFO, ", Status: %s", val_to_str(status, rfr_MAPISTATUS_vals, "Unknown MAPISTATUS error 0x%08x"));

	return offset;
}

static int
rfr_dissect_RfrGetNewDSA_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	di->dcerpc_procedure_name="RfrGetNewDSA";
	offset = rfr_dissect_element_RfrGetNewDSA_ulFlags(tvb, offset, pinfo, tree, di, drep);
	offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
	offset = rfr_dissect_element_RfrGetNewDSA_pUserDN(tvb, offset, pinfo, tree, di, drep);
	offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
	offset = rfr_dissect_element_RfrGetNewDSA_ppszUnused(tvb, offset, pinfo, tree, di, drep);
	offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
	offset = rfr_dissect_element_RfrGetNewDSA_ppszServer(tvb, offset, pinfo, tree, di, drep);
	offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
	return offset;
}

static int
rfr_dissect_element_RfrGetFQDNFromLegacyDN_ulFlags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, di, drep, hf_rfr_RfrGetFQDNFromLegacyDN_ulFlags, 0);

	return offset;
}

static int
rfr_dissect_element_RfrGetFQDNFromLegacyDN_cbMailboxServerDN(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, di, drep, hf_rfr_RfrGetFQDNFromLegacyDN_cbMailboxServerDN, 0);

	return offset;
}

static int
rfr_dissect_element_RfrGetFQDNFromLegacyDN_szMailboxServerDN(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, di, drep, rfr_dissect_element_RfrGetFQDNFromLegacyDN_szMailboxServerDN_, NDR_POINTER_REF, "Pointer to SzMailboxServerDN (uint8)",hf_rfr_RfrGetFQDNFromLegacyDN_szMailboxServerDN);

	return offset;
}

static int
rfr_dissect_element_RfrGetFQDNFromLegacyDN_szMailboxServerDN_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	char *data;

	offset = dissect_ndr_cvstring(tvb, offset, pinfo, tree, di, drep, sizeof(uint8_t), hf_rfr_RfrGetFQDNFromLegacyDN_szMailboxServerDN, false, &data);
	proto_item_append_text(tree, ": %s", data);

	return offset;
}

static int
rfr_dissect_element_RfrGetFQDNFromLegacyDN_ppszServerFQDN(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, di, drep, rfr_dissect_element_RfrGetFQDNFromLegacyDN_ppszServerFQDN_, NDR_POINTER_REF, "Pointer to PpszServerFQDN (uint8)",hf_rfr_RfrGetFQDNFromLegacyDN_ppszServerFQDN);

	return offset;
}

static int
rfr_dissect_element_RfrGetFQDNFromLegacyDN_ppszServerFQDN_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, di, drep, rfr_dissect_element_RfrGetFQDNFromLegacyDN_ppszServerFQDN__, NDR_POINTER_UNIQUE, "Pointer to PpszServerFQDN (uint8)",hf_rfr_RfrGetFQDNFromLegacyDN_ppszServerFQDN);

	return offset;
}

static int
rfr_dissect_element_RfrGetFQDNFromLegacyDN_ppszServerFQDN__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	char *data;

	offset = dissect_ndr_cvstring(tvb, offset, pinfo, tree, di, drep, sizeof(uint8_t), hf_rfr_RfrGetFQDNFromLegacyDN_ppszServerFQDN, false, &data);
	proto_item_append_text(tree, ": %s", data);

	return offset;
}

/* IDL: MAPISTATUS RfrGetFQDNFromLegacyDN( */
/* IDL: [in] uint32 ulFlags, */
/* IDL: [in] [range(10,1024)] uint32 cbMailboxServerDN, */
/* IDL: [charset(DOS)] [in] [ref] [size_is(cbMailboxServerDN)] uint8 *szMailboxServerDN, */
/* IDL: [charset(DOS)] [out] [ref] uint8 **ppszServerFQDN */
/* IDL: ); */

static int
rfr_dissect_RfrGetFQDNFromLegacyDN_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	uint32_t status;

	di->dcerpc_procedure_name="RfrGetFQDNFromLegacyDN";
	offset = rfr_dissect_element_RfrGetFQDNFromLegacyDN_ppszServerFQDN(tvb, offset, pinfo, tree, di, drep);
	offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);

	offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_rfr_MAPISTATUS_status, &status);
	if (status != 0)
		col_append_fstr(pinfo->cinfo, COL_INFO, ", Status: %s", val_to_str(status, rfr_MAPISTATUS_vals, "Unknown MAPISTATUS error 0x%08x"));

	return offset;
}

static int
rfr_dissect_RfrGetFQDNFromLegacyDN_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, uint8_t *drep _U_)
{
	di->dcerpc_procedure_name="RfrGetFQDNFromLegacyDN";
	offset = rfr_dissect_element_RfrGetFQDNFromLegacyDN_ulFlags(tvb, offset, pinfo, tree, di, drep);
	offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
	offset = rfr_dissect_element_RfrGetFQDNFromLegacyDN_cbMailboxServerDN(tvb, offset, pinfo, tree, di, drep);
	offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
	offset = rfr_dissect_element_RfrGetFQDNFromLegacyDN_szMailboxServerDN(tvb, offset, pinfo, tree, di, drep);
	offset = dissect_deferred_pointers(pinfo, tvb, offset, di, drep);
	return offset;
}


static const dcerpc_sub_dissector rfr_dissectors[] = {
	{ 0, "RfrGetNewDSA",
	   rfr_dissect_RfrGetNewDSA_request, rfr_dissect_RfrGetNewDSA_response},
	{ 1, "RfrGetFQDNFromLegacyDN",
	   rfr_dissect_RfrGetFQDNFromLegacyDN_request, rfr_dissect_RfrGetFQDNFromLegacyDN_response},
	{ 0, NULL, NULL, NULL }
};

void proto_register_dcerpc_rfr(void)
{
	static hf_register_info hf[] = {
	{ &hf_rfr_MAPISTATUS_status,
	  { "MAPISTATUS", "rfr.MAPISTATUS_status", FT_UINT32, BASE_HEX, VALS(rfr_MAPISTATUS_vals), 0, NULL, HFILL }},
	{ &hf_rfr_RfrGetFQDNFromLegacyDN_cbMailboxServerDN,
	  { "CbMailboxServerDN", "rfr.RfrGetFQDNFromLegacyDN.cbMailboxServerDN", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
	{ &hf_rfr_RfrGetFQDNFromLegacyDN_ppszServerFQDN,
	  { "PpszServerFQDN", "rfr.RfrGetFQDNFromLegacyDN.ppszServerFQDN", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
	{ &hf_rfr_RfrGetFQDNFromLegacyDN_szMailboxServerDN,
	  { "SzMailboxServerDN", "rfr.RfrGetFQDNFromLegacyDN.szMailboxServerDN", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
	{ &hf_rfr_RfrGetFQDNFromLegacyDN_ulFlags,
	  { "UlFlags", "rfr.RfrGetFQDNFromLegacyDN.ulFlags", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
	{ &hf_rfr_RfrGetNewDSA_pUserDN,
	  { "PUserDN", "rfr.RfrGetNewDSA.pUserDN", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
	{ &hf_rfr_RfrGetNewDSA_ppszServer,
	  { "PpszServer", "rfr.RfrGetNewDSA.ppszServer", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
	{ &hf_rfr_RfrGetNewDSA_ppszUnused,
	  { "PpszUnused", "rfr.RfrGetNewDSA.ppszUnused", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
	{ &hf_rfr_RfrGetNewDSA_ulFlags,
	  { "UlFlags", "rfr.RfrGetNewDSA.ulFlags", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
	{ &hf_rfr_opnum,
	  { "Operation", "rfr.opnum", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
	};


	static int *ett[] = {
		&ett_dcerpc_rfr,
	};

	proto_dcerpc_rfr = proto_register_protocol("Exchange 2003 Directory Request For Response", "RFR", "rfr");
	proto_register_field_array(proto_dcerpc_rfr, hf, array_length (hf));
	proto_register_subtree_array(ett, array_length(ett));
}

void proto_reg_handoff_dcerpc_rfr(void)
{
	dcerpc_init_uuid(proto_dcerpc_rfr, ett_dcerpc_rfr,
		&uuid_dcerpc_rfr, ver_dcerpc_rfr,
		rfr_dissectors, hf_rfr_opnum);
}