Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-fmp.c
blob9726babfd9c08b0ae9ce54f8c6744ad2a0aefd40
1 /* packet-fmp.c
2 * Routines for fmp dissection
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
11 #include "config.h"
13 #include <epan/packet.h>
14 #include <epan/prefs.h>
15 #include <epan/tfs.h>
16 #include "packet-fmp.h"
17 #include "packet-rpc.h"
19 void proto_register_fmp(void);
20 void proto_reg_handoff_fmp(void);
22 static int hf_fmp_procedure;
23 static int hf_fmp_fsID;
24 static int hf_fmp_fsBlkSz;
25 static int hf_fmp_sessionHandle;
26 static int hf_fmp_fmpFHandle;
27 static int hf_fmp_msgNum;
28 static int hf_fmp_fileSize;
29 static int hf_fmp_cookie;
30 static int hf_fmp_firstLogBlk;
31 static int hf_fmp_numBlksReq;
33 static int proto_fmp;
34 static int hf_fmp_hostID;
35 static int hf_fmp_status;
36 static int hf_fmp_btime;
37 static int hf_fmp_time_sec;
38 static int hf_fmp_time_nsec;
39 static int hf_fmp_notifyPort;
40 static int hf_fmp_minBlks;
41 static int hf_fmp_eof;
42 static int hf_fmp_path;
43 static int hf_fmp_plugInID;
44 static int hf_fmp_plugInBuf;
45 static int hf_fmp_nfsFHandle;
46 static int hf_fmp_extentList_len;
47 static int hf_fmp_extent_state;
48 static int hf_fmp_numBlks;
49 static int hf_fmp_volID;
50 static int hf_fmp_startOffset;
51 static int hf_fmp_volHandle;
52 static int hf_fmp_devSignature;
53 static int hf_fmp_dskSigEnt_val;
54 static int hf_fmp_mount_path;
55 static int hf_fmp_sig_offset;
56 static int hf_fmp_os_major;
57 static int hf_fmp_os_minor;
58 static int hf_fmp_os_name;
59 static int hf_fmp_os_patch;
60 static int hf_fmp_os_build;
61 static int hf_fmp_server_version_string;
62 static int hf_fmp_description;
63 static int hf_fmp_nfsv3Attr_type;
64 static int hf_fmp_nfsv3Attr_mode;
65 static int hf_fmp_nfsv3Attr_nlink;
66 static int hf_fmp_nfsv3Attr_uid;
67 static int hf_fmp_nfsv3Attr_gid;
68 static int hf_fmp_nfsv3Attr_used;
69 static int hf_fmp_nfsv3Attr_rdev;
70 static int hf_fmp_nfsv3Attr_fsid;
71 static int hf_fmp_nfsv3Attr_fileid;
72 static int hf_fmp_cmd;
73 static int hf_fmp_topVolumeId;
74 static int hf_fmp_cursor;
75 static int hf_fmp_offset64;
76 static int hf_fmp_start_offset64;
77 static int hf_fmp_slice_size;
78 static int hf_fmp_volume;
79 static int hf_fmp_stripeSize;
80 static int hf_fmp_firstLogBlk64;
81 static int hf_fmp_native_protocol;
82 static int hf_fmp_encoding_mode;
83 static int hf_fmp_capability;
84 static int hf_fmp_devSerial_query_cmd;
85 static int hf_fmp_volume_desc;
86 static int hf_fmp_disk_identifier;
87 static int hf_fmp_volume_mgmt_type;
88 static int hf_fmp_notify_protocol;
89 static int hf_fmp_client_error_number;
90 /* Generated from convert_proto_tree_add_text.pl */
91 static int hf_fmp_cap;
92 static int hf_fmp_cap_revoke_handle_list;
93 static int hf_fmp_length_of_volume_list;
94 static int hf_fmp_cap_unc_names;
95 static int hf_fmp_length_of_list;
96 static int hf_fmp_sigoffset;
97 static int hf_fmp_uid;
98 static int hf_fmp_fid;
99 static int hf_fmp_fsid;
100 static int hf_fmp_tid;
101 static int hf_fmp_cifsport;
102 static int hf_fmp_blockindex;
103 static int hf_fmp_number_of_disk;
104 static int hf_fmp_cap_cifsv2;
105 static int hf_fmp_mtime;
106 static int hf_fmp_atime;
107 static int hf_fmp_ctime;
108 static int hf_fmp_heartbeat_interval;
109 static int hf_fmp_volindex;
111 static int ett_fmp;
112 static int ett_fmp_timeval;
113 static int ett_fmp_extList;
114 static int ett_fmp_ext;
115 static int ett_fmp_fileHandle;
116 static int ett_capabilities;
117 static int ett_HierVolumeDescription;
118 static int ett_attrs;
120 static const value_string fmp_encoding_mode_vals[] = {
121 {FMP_ASCII, "ASCII"},
122 {FMP_UTF8, "UTF8"},
123 {FMP_UNICODE1, "UNICODE"},
124 {0,NULL}
127 static bool fmp_fhandle_reqrep_matching;
129 static int
130 dissect_fmp_genString(tvbuff_t *tvb, int offset, proto_tree *tree)
132 proto_tree_add_item(tree, hf_fmp_encoding_mode, tvb, offset, 4, ENC_BIG_ENDIAN);
133 offset += 4;
135 if (try_val_to_str(tvb_get_ntohl(tvb, offset), fmp_encoding_mode_vals) == NULL)
136 return offset;
138 offset = dissect_rpc_string(tvb, tree, hf_fmp_path,
139 offset, NULL);
141 return offset;
144 static int
145 get_fileHandleSrc_size(tvbuff_t *tvb, int offset)
147 int length;
148 nativeProtocol np;
150 np = (nativeProtocol)tvb_get_ntohl(tvb, offset);
152 switch (np) {
153 case FMP_PATH:
154 length = 4 + FMP_MAX_PATH_LEN;
155 break;
156 case FMP_NFS:
157 length = 8 + tvb_get_ntohl(tvb, offset + 4);
158 break;
159 case FMP_CIFS:
160 length = 10;
161 break;
162 case FMP_FMP:
163 length = 8 + tvb_get_ntohl(tvb, offset + 4);
164 break;
165 case FMP_FS_ONLY:
166 length = 8;
167 break;
168 case FMP_SHARE:
169 /* FALLTHROUGH */
170 case FMP_MOUNT:
171 length = 8 + FMP_MAX_PATH_LEN;
172 break;
173 default:
174 length = 4;
175 break;
178 return length;
181 static int
182 dissect_fmp_fileHandleSrc(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
183 proto_tree *tree)
185 nativeProtocol np;
187 proto_tree *fileHandleTree;
188 int length;
190 length = get_fileHandleSrc_size(tvb, offset);
192 fileHandleTree = proto_tree_add_subtree(tree, tvb, offset, length,
193 ett_fmp_fileHandle, NULL, "Source File Handle");
195 np = (nativeProtocol)tvb_get_ntohl(tvb, offset);
196 proto_tree_add_item(fileHandleTree, hf_fmp_native_protocol, tvb, offset, 4, ENC_BIG_ENDIAN);
197 offset += 4;
199 switch (np) {
200 case FMP_PATH:
201 offset = dissect_rpc_string(tvb, fileHandleTree,
202 hf_fmp_mount_path, offset, NULL);
203 break;
205 case FMP_NFS:
206 offset = dissect_rpc_data(tvb, fileHandleTree,
207 hf_fmp_nfsFHandle, offset);
208 break;
210 case FMP_CIFS:
211 proto_tree_add_item(fileHandleTree, hf_fmp_fid, tvb, offset, 2, ENC_BIG_ENDIAN);
212 offset += 2;
214 proto_tree_add_item(fileHandleTree, hf_fmp_tid, tvb, offset, 2, ENC_BIG_ENDIAN);
215 offset += 2;
217 proto_tree_add_item(fileHandleTree, hf_fmp_uid, tvb, offset, 2, ENC_BIG_ENDIAN);
218 offset += 2;
219 break;
221 case FMP_FMP:
222 offset = dissect_rpc_string(tvb, fileHandleTree,
223 hf_fmp_fmpFHandle, offset, NULL);
224 break;
226 case FMP_FS_ONLY:
227 proto_tree_add_item(fileHandleTree, hf_fmp_fsid, tvb, offset, 4, ENC_BIG_ENDIAN);
228 offset += 4;
229 break;
231 case FMP_SHARE:
232 offset = dissect_fmp_genString(tvb, offset, fileHandleTree);
233 break;
235 case FMP_MOUNT:
236 offset = dissect_fmp_genString(tvb, offset, fileHandleTree);
237 break;
239 case FMP_CIFSV2:
240 proto_tree_add_item(fileHandleTree, hf_fmp_fid, tvb, offset, 2, ENC_BIG_ENDIAN);
241 offset += 2;
243 proto_tree_add_item(fileHandleTree, hf_fmp_tid, tvb, offset, 2, ENC_BIG_ENDIAN);
244 offset += 2;
246 proto_tree_add_item(fileHandleTree, hf_fmp_uid, tvb, offset, 2, ENC_BIG_ENDIAN);
247 offset += 2;
249 proto_tree_add_item(fileHandleTree, hf_fmp_cifsport, tvb, offset, 2, ENC_BIG_ENDIAN);
250 offset += 2;
251 break;
252 case FMP_UNC:
253 offset = dissect_fmp_genString(tvb, offset, fileHandleTree);
254 break;
256 default:
257 break;
260 return offset;
263 static int
264 dissect_fmp_extentState(tvbuff_t *tvb, int offset, proto_tree *tree)
266 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_extent_state,
267 offset);
269 return offset;
272 static int
273 dissect_fmp_extent(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, uint32_t ext_num)
275 proto_tree *extTree;
277 extTree = proto_tree_add_subtree_format(tree, tvb, offset, 20 ,
278 ett_fmp_ext, NULL, "Extent (%u)", (uint32_t) ext_num);
280 offset = dissect_rpc_uint32(tvb, extTree, hf_fmp_firstLogBlk,
281 offset);
282 offset = dissect_rpc_uint32(tvb, extTree, hf_fmp_numBlks,
283 offset);
284 offset = dissect_rpc_uint32(tvb, extTree, hf_fmp_volID, offset);
285 offset = dissect_rpc_uint32(tvb, extTree, hf_fmp_startOffset,
286 offset);
287 offset = dissect_fmp_extentState(tvb, offset, extTree);
289 return offset;
292 static int
293 dissect_fmp_extentList(tvbuff_t *tvb, int offset, packet_info *pinfo,
294 proto_tree *tree)
296 uint32_t numExtents;
297 uint32_t totalLength;
298 proto_tree *extListTree;
299 uint32_t i;
301 numExtents = tvb_get_ntohl(tvb, offset);
302 totalLength = 4 + (20 * numExtents);
304 extListTree = proto_tree_add_subtree(tree, tvb, offset, totalLength,
305 ett_fmp_extList, NULL, "Extent List");
307 offset = dissect_rpc_uint32(tvb, extListTree,
308 hf_fmp_extentList_len, offset);
310 for (i = 0; i < numExtents; i++) {
311 offset = dissect_fmp_extent(tvb, offset, pinfo, extListTree, i+1);
314 return offset;
318 static int
319 dissect_fmp_extentListEx(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
320 proto_tree *tree)
322 uint32_t numExtents;
323 proto_tree *extListTree;
324 uint32_t i;
326 numExtents = tvb_get_ntohl(tvb, offset);
328 offset += 4;
330 for (i = 0; i < numExtents; i++) {
331 extListTree = proto_tree_add_subtree(tree, tvb, offset, 28,
332 ett_fmp_extList, NULL, "Extent List");
334 offset = dissect_rpc_uint64(tvb,extListTree , hf_fmp_firstLogBlk64, offset);
336 offset = dissect_rpc_uint32(tvb,extListTree , hf_fmp_numBlksReq,
337 offset);
339 offset = dissect_rpc_uint32(tvb,extListTree , hf_fmp_volID, offset);
341 offset = dissect_rpc_uint64(tvb,extListTree , hf_fmp_start_offset64, offset);
343 offset = dissect_fmp_extentState(tvb, offset, extListTree);
347 return offset;
351 static int
352 dissect_plugInID(tvbuff_t *tvb, int offset, proto_tree *tree)
354 if (!tree) {
355 return offset;
358 proto_tree_add_item(tree, hf_fmp_plugInID, tvb, offset, FMP_PLUG_IN_ID_SZ,
359 ENC_NA);
360 return offset;
363 static int
364 dissect_fmp_flushCmd(tvbuff_t *tvb, int offset, proto_tree *tree)
366 uint32_t cmd;
367 char msg[MAX_MSG_SIZE];
368 uint32_t bitValue;
369 int i;
371 if (tree) {
372 cmd = tvb_get_ntohl(tvb, offset);
374 /* Initialize the message for an empty string */
375 msg[0] = '\0';
377 for (i = 0; cmd != 0 && i < 32; i++) {
379 bitValue = 1U << i;
381 if (cmd & bitValue) {
382 switch (bitValue) {
383 case FMP_COMMIT_SPECIFIED:
384 (void) g_strlcat(msg, "COMMIT_SPECIFIED", MAX_MSG_SIZE);
385 break;
386 case FMP_RELEASE_SPECIFIED:
387 (void) g_strlcat(msg, "RELEASE_SPECIFIED", MAX_MSG_SIZE);
388 break;
389 case FMP_RELEASE_ALL:
390 (void) g_strlcat(msg, "RELEASE_ALL", MAX_MSG_SIZE);
391 break;
392 case FMP_CLOSE_FILE:
393 (void) g_strlcat(msg, "CLOSE_FILE", MAX_MSG_SIZE);
394 break;
395 case FMP_UPDATE_TIME:
396 (void) g_strlcat(msg, "UPDATE_TIME", MAX_MSG_SIZE);
397 break;
398 case FMP_ACCESS_TIME:
399 (void) g_strlcat(msg, "ACCESS_TIME", MAX_MSG_SIZE);
400 break;
401 default:
402 (void) g_strlcat(msg, "UNKNOWN", MAX_MSG_SIZE);
403 break;
406 /* clear the bit that we processed */
407 cmd &= ~bitValue;
409 /* add a "bitwise inclusive OR" symbol between cmds */
410 if (cmd) {
411 (void) g_strlcat(msg, " | ", MAX_MSG_SIZE);
416 if (strlen(msg) == 0) {
417 (void) g_strlcpy(msg, "No command specified", MAX_MSG_SIZE);
420 proto_tree_add_uint_format_value(tree, hf_fmp_cmd, tvb, offset, 4, cmd, "%s", msg);
422 offset += 4;
423 return offset;
426 static int
427 dissect_InterpretVolMgtStuff(tvbuff_t *tvb, int offset, proto_tree *tree)
429 int length, numdisks, i, j;
431 numdisks = tvb_get_ntohl(tvb, offset);
432 proto_tree_add_item(tree, hf_fmp_number_of_disk, tvb, offset, 4, ENC_BIG_ENDIAN);
433 offset += 4;
435 for (i=0; i<numdisks; i++) {
436 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_sig_offset, offset);
437 length = tvb_get_ntohl(tvb, offset);
438 proto_tree_add_item(tree, hf_fmp_length_of_list, tvb, offset, 4, ENC_BIG_ENDIAN);
439 offset += 4;
441 for (j=0; j<length; j++) {
442 proto_tree_add_item(tree, hf_fmp_sigoffset, tvb, offset, 4, ENC_BIG_ENDIAN);
443 offset += 4;
444 offset = dissect_rpc_string(tvb, tree, hf_fmp_dskSigEnt_val,
445 offset, NULL);
448 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_volID, offset);
451 return offset;
456 static int
457 dissect_fmp_capability(tvbuff_t *tvb, int offset, proto_tree *tree)
459 proto_tree_add_item(tree, hf_fmp_capability, tvb, offset, 4, ENC_BIG_ENDIAN);
460 return offset+4;
463 static int
464 dissect_fmp_timeval(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
465 proto_tree *tree, int hf_time, int hf_time_sec,
466 int hf_time_nsec)
468 if (tree) {
469 nstime_t ts;
471 proto_item* time_item;
472 proto_tree* time_tree;
474 ts.secs = tvb_get_ntohl(tvb, offset+0);
475 ts.nsecs = tvb_get_ntohl(tvb, offset+4);
477 time_item = proto_tree_add_time(tree, hf_time, tvb, offset, 8, &ts);
478 time_tree = proto_item_add_subtree(time_item, ett_fmp_timeval);
480 proto_tree_add_uint(time_tree, hf_time_sec, tvb, offset, 4,
481 (uint32_t) ts.secs);
482 proto_tree_add_uint(time_tree, hf_time_nsec, tvb, offset+4, 4,
483 ts.nsecs);
485 offset += 8;
486 return offset;
489 static int
490 dissect_fmp_heartBeatIntv(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
491 proto_tree *tree)
493 proto_tree_add_item(tree, hf_fmp_heartbeat_interval, tvb, offset, 8, ENC_BIG_ENDIAN);
494 offset += 8;
495 return offset;
498 static int
499 dissect_fmp_status(tvbuff_t *tvb, int offset, proto_tree *tree, int *rval)
501 fmpStat status;
503 status = (fmpStat)tvb_get_ntohl(tvb, offset);
505 switch (status) {
506 case FMP_OK:
507 *rval = 0;
508 break;
509 case FMP_IOERROR:
510 *rval = 1;
511 break;
512 case FMP_NOMEM:
513 *rval = 1;
514 break;
515 case FMP_NOACCESS:
516 *rval = 1;
517 break;
518 case FMP_INVALIDARG:
520 *rval = 1;
521 break;
522 case FMP_FSFULL:
523 *rval = 0;
524 break;
525 case FMP_QUEUE_FULL:
526 case FMP_NOTIFY_ERROR:
527 case FMP_WRITER_LOST_BLK:
528 case FMP_WRONG_MSG_NUM:
529 case FMP_SESSION_LOST:
530 case FMP_REQUEST_CANCELLED:
531 *rval = 1;
532 break;
533 case FMP_HOT_SESSION:
534 *rval = 0;
535 break;
536 case FMP_COLD_SESSION:
537 *rval = 0;
538 break;
539 case FMP_CLIENT_TERMINATED:
540 *rval = 0;
541 break;
542 case FMP_REQUEST_QUEUED:
543 *rval = 0;
544 break;
545 case FMP_FALL_BACK:
546 *rval = 0;
547 break;
548 case FMP_WRITER_ZEROED_BLK:
549 *rval = 0;
550 break;
551 case FMP_WRONG_HANDLE:
552 *rval = 0;
553 break;
554 case FMP_DUPLICATE_OPEN:
555 *rval = 1;
556 break;
557 case FMP_PLUGIN_NOFUNC:
558 *rval = 1;
559 break;
560 default:
561 *rval = 1;
562 break;
564 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_status , offset);
565 return offset;
568 static int
569 dissect_fmp_devSerial(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
570 proto_tree *tree)
572 proto_tree_add_item(tree, hf_fmp_devSerial_query_cmd, tvb, offset, 4, ENC_BIG_ENDIAN);
573 offset += 4;
575 proto_tree_add_item(tree, hf_fmp_sigoffset, tvb, offset, 4, ENC_BIG_ENDIAN);
576 offset += 4;
578 offset = dissect_rpc_string(tvb, tree, hf_fmp_devSignature,
579 offset, NULL);
580 return offset;
583 static int
584 dissect_fmp_VolumeDescription(tvbuff_t *tvb, int offset, proto_tree * tree)
586 int i,length;
587 proto_tree *Hietree;
588 proto_item *ti;
589 fmpVolumeType volumeType;
590 fmpDiskIdentifierType diskIdentifierType;
592 volumeType = (fmpVolumeType)tvb_get_ntohl(tvb, offset);
593 ti = proto_tree_add_item(tree, hf_fmp_volume_desc, tvb, offset, 4, ENC_BIG_ENDIAN);
594 Hietree = proto_item_add_subtree(ti, ett_HierVolumeDescription);
595 offset += 4;
597 switch (volumeType) {
599 case FMP_VOLUME_DISK:
600 offset = dissect_rpc_uint32(tvb, Hietree, hf_fmp_volID, offset);
601 offset += 8; /* blockIndex64 */
602 diskIdentifierType = (fmpDiskIdentifierType)tvb_get_ntohl(tvb, offset);
603 proto_tree_add_item(Hietree, hf_fmp_disk_identifier, tvb, offset, 4, ENC_BIG_ENDIAN);
604 offset += 4;
606 switch (diskIdentifierType) {
607 case FMP_DISK_IDENTIFIER_SIGNATURE:
608 offset = dissect_rpc_uint64(tvb, Hietree, hf_fmp_sig_offset, offset);
609 length = tvb_get_ntohl(tvb, offset);
610 proto_tree_add_item(Hietree, hf_fmp_length_of_list, tvb, offset, 4, ENC_BIG_ENDIAN);
611 offset += 4;
613 for (i=0; i<length; i++) {
614 proto_tree_add_item(Hietree, hf_fmp_sigoffset, tvb, offset, 4, ENC_BIG_ENDIAN);
615 offset += 4;
616 offset = dissect_rpc_string(tvb, Hietree, hf_fmp_dskSigEnt_val, offset, NULL);
620 break;
622 case FMP_DISK_IDENTIFIER_SERIAL:
623 dissect_fmp_devSerial(tvb, offset, NULL, Hietree);
624 break;
627 break;
628 case FMP_VOLUME_SLICE:
629 offset = dissect_rpc_uint32(tvb, Hietree, hf_fmp_volID, offset);
631 offset = dissect_rpc_uint64(tvb, Hietree, hf_fmp_offset64, offset);
633 offset = dissect_rpc_uint64(tvb, Hietree, hf_fmp_slice_size, offset);
635 offset = dissect_rpc_uint32(tvb, Hietree, hf_fmp_volume, offset);
637 break;
639 case FMP_VOLUME_STRIPE:
640 offset = dissect_rpc_uint32(tvb, Hietree, hf_fmp_volID, offset);
642 offset = dissect_rpc_uint64(tvb, Hietree, hf_fmp_stripeSize, offset);
643 length = tvb_get_ntohl(tvb, offset);
644 proto_tree_add_item(Hietree, hf_fmp_length_of_list, tvb, offset, 4, ENC_BIG_ENDIAN);
645 offset += 4;
647 for (i=0; i<length; i++) {
648 offset = dissect_rpc_uint32(tvb, Hietree, hf_fmp_volume, offset); /* FIXME: Size or length not know */
651 break;
653 case FMP_VOLUME_META:
654 offset = dissect_rpc_uint32(tvb, Hietree, hf_fmp_volID, offset);
656 length = tvb_get_ntohl(tvb, offset);
657 proto_tree_add_item(Hietree, hf_fmp_length_of_list, tvb, offset, 4, ENC_BIG_ENDIAN);
658 offset += 4;
659 for (i=0; i<length; i++) {
660 offset = dissect_rpc_uint32(tvb, Hietree, hf_fmp_volume, offset); /* FIXME: Size or length not know */
662 break;
663 default:
664 break;
666 return offset;
670 static int
671 dissect_fmp_Hiervolume(tvbuff_t *tvb, int offset, proto_tree * tree)
674 int vollength;
676 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_topVolumeId, offset);
677 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cursor, offset);
678 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cookie, offset);
680 /* hierarchical description of volume. Each volume describes a
681 piece of the entire hierarchy and is guaranteed to only refer to
682 volumes that have already been described by the data structure up
683 to this point in time. In some extreme cases, the number of
684 volumes and their descriptions may be to large to fit in a single
685 RPC reply. In this case, the application may send getVolumeInfo
686 requests for the specific topVolumeId -- specifying the number of
687 volumes already received by the client, and the cookie. The
688 server is then responsible for sending another message containing
689 additional volumes. These RPCs exchanges may continue multiple
690 times, until the client has fetched the entire hierarchical
691 volume description. If the volume hierarchy changes duing a
692 multiple RPC sequence, the server will return an
693 FMP_VOLUME_CHANGED error, and the client must discard all
694 information already received and restart the request with
695 FMP_Mount.
698 vollength = tvb_get_ntohl(tvb, offset);
699 proto_tree_add_item(tree, hf_fmp_length_of_volume_list, tvb, offset, 4, ENC_BIG_ENDIAN);
700 offset += 4;
701 while (vollength) {
702 offset = dissect_fmp_VolumeDescription(tvb, offset, tree);
703 vollength--;
706 return offset;
712 static int
713 dissect_fmp_vmInfo(tvbuff_t *tvb, int offset, packet_info *pinfo,
714 proto_tree *tree)
716 int vmType;
717 uint32_t phyVolList_len;
719 vmType = tvb_get_ntohl(tvb, offset);
720 proto_tree_add_item(tree, hf_fmp_volume_mgmt_type, tvb, offset, 4, ENC_BIG_ENDIAN);
722 switch (vmType) {
723 case FMP_SERVER_BASED:
725 * Need to finish
727 phyVolList_len = tvb_get_ntohl(tvb, offset);
728 offset += 4;
731 * Loop through and print all of the devInfo
732 * structures.
734 while (phyVolList_len) {
735 offset = dissect_fmp_devSerial(tvb, offset, pinfo, tree);
736 proto_tree_add_item(tree, hf_fmp_volindex, tvb, offset, 4, ENC_BIG_ENDIAN);
737 offset += 4;
738 phyVolList_len--;
740 break;
742 case FMP_THIRD_PARTY:
743 offset = dissect_rpc_string(tvb, tree, hf_fmp_volHandle,
744 offset, NULL);
745 break;
747 case FMP_CLIENT_BASED_DART:
748 offset = dissect_rpc_string(tvb, tree, hf_fmp_volHandle,
749 offset, NULL);
750 break;
752 case FMP_CLIENT_BASED_SIMPLE:
754 * Decoding simpleVolInfo
756 offset = dissect_fmp_devSerial(tvb, offset, pinfo, tree);
758 proto_tree_add_item(tree, hf_fmp_blockindex, tvb, offset, 4, ENC_BIG_ENDIAN);
759 offset += 4;
760 break;
762 case FMP_DISK_SIGNATURE:
763 offset = dissect_InterpretVolMgtStuff(tvb, offset, tree);
764 break;
766 case FMP_HIERARCHICAL_VOLUME:
767 dissect_fmp_Hiervolume(tvb, offset, tree);
768 break;
770 default:
771 break;
774 return offset;
777 static int
778 dissect_fmp_notifyProtocol(tvbuff_t *tvb, int offset, proto_tree *tree)
780 proto_tree_add_item(tree, hf_fmp_notify_protocol, tvb, offset, 4, ENC_BIG_ENDIAN);
781 return (offset+4);
785 static int
786 dissect_fmp_capabilities(tvbuff_t *tvb, int offset, proto_tree *tree)
788 static int * const capabilities[] = {
789 &hf_fmp_cap_revoke_handle_list,
790 &hf_fmp_cap_unc_names,
791 &hf_fmp_cap_cifsv2,
792 NULL
795 proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_fmp_cap, ett_capabilities,
796 capabilities, ENC_BIG_ENDIAN, BMT_NO_APPEND);
797 return (offset+4);
800 static int
801 dissect_fmp_cerrInfo(tvbuff_t *tvb, int offset, proto_tree *tree)
803 int rval;
805 proto_tree_add_item(tree, hf_fmp_client_error_number, tvb, offset, 4, ENC_BIG_ENDIAN);
806 offset += 4;
808 offset = dissect_fmp_status(tvb, offset,tree, &rval);
810 return offset;
813 static int
814 dissect_fmp_attrs(tvbuff_t *tvb, int offset, proto_tree *tree)
816 proto_tree *attrsTree;
818 attrsTree = proto_tree_add_subtree(tree, tvb, offset, 84,
819 ett_attrs, NULL, "Attribute: ");
820 offset = dissect_rpc_uint32(tvb, attrsTree, hf_fmp_nfsv3Attr_type, offset);
821 offset = dissect_rpc_uint32(tvb, attrsTree, hf_fmp_nfsv3Attr_mode, offset);
822 offset = dissect_rpc_uint32(tvb, attrsTree, hf_fmp_nfsv3Attr_nlink, offset);
823 offset = dissect_rpc_uint32(tvb, attrsTree, hf_fmp_nfsv3Attr_uid, offset);
824 offset = dissect_rpc_uint32(tvb, attrsTree, hf_fmp_nfsv3Attr_gid, offset);
825 offset = dissect_rpc_uint64(tvb, attrsTree, hf_fmp_fileSize, offset);
826 /* Here hf_fmp_fileSize is used in
827 * place of size
829 offset = dissect_rpc_uint64(tvb, attrsTree, hf_fmp_nfsv3Attr_used, offset);
830 offset = dissect_rpc_uint64(tvb, attrsTree, hf_fmp_nfsv3Attr_rdev, offset);
831 offset = dissect_rpc_uint64(tvb, attrsTree, hf_fmp_nfsv3Attr_fsid, offset);
832 offset = dissect_rpc_uint64(tvb, attrsTree, hf_fmp_nfsv3Attr_fileid, offset);
833 proto_tree_add_item(tree, hf_fmp_atime, tvb, offset, 8, ENC_BIG_ENDIAN);
834 offset +=8;
835 proto_tree_add_item(tree, hf_fmp_mtime, tvb, offset, 8, ENC_BIG_ENDIAN);
836 offset +=8;
837 proto_tree_add_item(tree, hf_fmp_ctime, tvb, offset, 8, ENC_BIG_ENDIAN);
838 offset +=8;
839 return offset;
844 static int
845 dissect_FMP_SessionCreate_request(tvbuff_t *tvb, packet_info *pinfo,
846 proto_tree *tree, void* data _U_)
848 int offset = 0;
849 offset = dissect_rpc_string(tvb, tree, hf_fmp_hostID,
850 offset, NULL);
851 offset = dissect_fmp_timeval(tvb, offset, pinfo, tree, hf_fmp_btime,
852 hf_fmp_time_sec, hf_fmp_time_nsec);
853 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_notifyPort,
854 offset);
855 return offset;
858 static int
859 dissect_FMP_SessionCreate_reply(tvbuff_t *tvb, packet_info *pinfo,
860 proto_tree *tree, void* data _U_)
862 int rval;
863 int offset = 0;
865 offset = dissect_fmp_status(tvb, offset,tree, &rval);
866 if (rval == 0) {
867 offset = dissect_rpc_data(tvb, tree,
868 hf_fmp_sessionHandle, offset);
869 offset = dissect_rpc_string(tvb, tree, hf_fmp_hostID,
870 offset, NULL);
871 offset = dissect_fmp_timeval(tvb, offset, pinfo, tree,
872 hf_fmp_btime, hf_fmp_time_sec,
873 hf_fmp_time_nsec);
874 offset = dissect_fmp_heartBeatIntv(tvb, offset, pinfo, tree);
877 return offset;
880 static int
881 dissect_FMP_HeartBeat_request(tvbuff_t *tvb, packet_info *pinfo _U_,
882 proto_tree *tree, void* data _U_)
884 return dissect_rpc_data(tvb, tree, hf_fmp_sessionHandle, 0);
887 static int
888 dissect_FMP_HeartBeat_reply(tvbuff_t *tvb, packet_info *pinfo _U_,
889 proto_tree *tree, void* data _U_)
891 int rval;
893 return dissect_fmp_status(tvb, 0, tree, &rval);
896 static int
897 dissect_FMP_Mount_request(tvbuff_t *tvb, packet_info *pinfo,
898 proto_tree *tree, void* data _U_)
900 int offset = 0;
901 offset = dissect_rpc_data(tvb, tree, hf_fmp_sessionHandle,
902 offset);
903 offset = dissect_fmp_capability(tvb, offset, tree);
904 offset = dissect_fmp_fileHandleSrc(tvb, offset, pinfo, tree);
905 return offset;
908 static int
909 dissect_FMP_Mount_reply(tvbuff_t *tvb, packet_info *pinfo,
910 proto_tree *tree, void* data _U_)
912 int rval;
913 int offset = 0;
915 offset = dissect_fmp_status(tvb, offset,tree, &rval);
916 if (rval == 0) {
917 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_fsID,
918 offset);
919 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_fsBlkSz,
920 offset);
921 offset = dissect_fmp_vmInfo(tvb, offset, pinfo, tree);
924 return offset;
927 static int
928 dissect_FMP_Open_request(tvbuff_t *tvb, packet_info *pinfo,
929 proto_tree *tree, void* data _U_)
931 int offset = 0;
932 offset = dissect_rpc_data(tvb, tree, hf_fmp_sessionHandle,
933 offset);
934 offset = dissect_fmp_fileHandleSrc(tvb, offset, pinfo, tree);
935 return offset;
938 static int
939 dissect_FMP_Open_reply(tvbuff_t *tvb, packet_info *pinfo _U_,
940 proto_tree *tree, void* data _U_)
942 int rval;
943 int offset = 0;
945 offset = dissect_fmp_status(tvb, offset,tree, &rval);
946 if (rval == 0) {
947 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle,
948 offset);
949 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum,
950 offset);
951 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_fileSize,
952 offset);
954 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_fsID,
955 offset);
957 return offset;
960 static int
961 dissect_FMP_Close_request(tvbuff_t *tvb, packet_info *pinfo _U_,
962 proto_tree *tree, void* data _U_)
964 int offset = 0;
966 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle, offset);
967 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
968 return offset;
971 static int
972 dissect_FMP_Close_reply(tvbuff_t *tvb, packet_info *pinfo _U_,
973 proto_tree *tree, void* data _U_)
975 int rval;
976 int offset = 0;
978 offset = dissect_fmp_status(tvb, offset,tree, &rval);
979 if (rval == 0) {
980 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum,
981 offset);
984 return offset;
987 static int
988 dissect_FMP_OpenGetMap_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
990 int offset = 0;
991 offset = dissect_rpc_data(tvb, tree, hf_fmp_sessionHandle,
992 offset);
994 offset = dissect_fmp_fileHandleSrc(tvb, offset, pinfo, tree);
995 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_firstLogBlk,
996 offset);
997 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_numBlksReq,
998 offset);
999 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_minBlks, offset);
1000 return offset;
1003 static int
1004 dissect_FMP_OpenGetMap_reply(tvbuff_t *tvb, packet_info *pinfo,
1005 proto_tree *tree, void* data _U_)
1007 int rval;
1008 int offset = 0;
1010 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1011 if (rval == 0) {
1012 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle,
1013 offset);
1014 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum,
1015 offset);
1016 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cookie,
1017 offset);
1018 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_fileSize,
1019 offset);
1020 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_fsID,
1021 offset);
1022 offset = dissect_fmp_extentList(tvb, offset, pinfo, tree);
1025 return offset;
1028 static int
1029 dissect_FMP_OpenAllocSpace_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
1031 int offset = 0;
1032 offset = dissect_rpc_data(tvb, tree, hf_fmp_sessionHandle, offset);
1033 offset = dissect_fmp_fileHandleSrc(tvb, offset, pinfo, tree);
1034 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_firstLogBlk, offset);
1035 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_numBlksReq, offset);
1036 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_minBlks, offset);
1037 return offset;
1040 static int
1041 dissect_FMP_OpenAllocSpace_reply(tvbuff_t *tvb, packet_info *pinfo,
1042 proto_tree *tree, void* data _U_)
1044 int rval;
1045 int offset = 0;
1047 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1048 if (rval == 0) {
1049 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle,
1050 offset);
1051 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum,
1052 offset);
1053 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cookie,
1054 offset);
1055 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_fileSize,
1056 offset);
1057 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_fsID,
1058 offset);
1059 offset = dissect_fmp_extentList(tvb, offset, pinfo, tree);
1061 return offset;
1064 static int
1065 dissect_FMP_GetMap_request(tvbuff_t *tvb, packet_info *pinfo _U_,
1066 proto_tree *tree, void* data _U_)
1068 int offset = 0;
1069 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle, offset);
1070 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
1071 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_firstLogBlk,
1072 offset);
1073 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_numBlksReq,
1074 offset);
1075 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_minBlks, offset);
1076 return offset;
1079 static int
1080 dissect_FMP_GetMap_reply(tvbuff_t *tvb, packet_info *pinfo,
1081 proto_tree *tree, void* data _U_)
1083 int rval;
1084 int offset = 0;
1086 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1087 if (rval == 0) {
1088 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum,
1089 offset);
1090 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cookie,
1091 offset);
1092 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_fileSize,
1093 offset);
1094 offset = dissect_fmp_extentList(tvb, offset, pinfo, tree);
1097 return offset;
1100 static int
1101 dissect_FMP_AllocSpace_request(tvbuff_t *tvb, packet_info *pinfo _U_,
1102 proto_tree *tree, void* data _U_)
1104 int offset = 0;
1105 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle, offset);
1106 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
1107 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_firstLogBlk,
1108 offset);
1109 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_numBlksReq,
1110 offset);
1111 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_minBlks, offset);
1112 return offset;
1115 static int
1116 dissect_FMP_AllocSpace_reply(tvbuff_t *tvb, packet_info *pinfo,
1117 proto_tree *tree, void* data _U_)
1119 int rval;
1120 int offset = 0;
1122 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1123 if (rval == 0) {
1124 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum,
1125 offset);
1126 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cookie,
1127 offset);
1128 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_fileSize,
1129 offset);
1130 offset = dissect_fmp_extentList(tvb, offset, pinfo, tree);
1133 return offset;
1136 static int
1137 dissect_FMP_Flush_request(tvbuff_t *tvb, packet_info *pinfo,
1138 proto_tree *tree, void* data _U_)
1140 int offset = 0;
1141 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle, offset);
1142 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
1143 offset = dissect_fmp_flushCmd(tvb, offset, tree);
1144 offset = dissect_rpc_uint64(tvb,tree, hf_fmp_eof, offset);
1145 offset = dissect_fmp_extentList(tvb, offset, pinfo, tree);
1146 return offset;
1149 static int
1150 dissect_FMP_Flush_reply(tvbuff_t *tvb, packet_info *pinfo _U_,
1151 proto_tree *tree, void* data _U_)
1153 int rval;
1154 int offset = 0;
1156 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1157 if (rval == 0) {
1158 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum,
1159 offset);
1161 return offset;
1164 static int
1165 dissect_FMP_CancelReq_request(tvbuff_t *tvb, packet_info *pinfo _U_,
1166 proto_tree *tree, void* data _U_)
1168 int offset = 0;
1169 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle, offset);
1170 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
1171 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cookie, offset);
1172 return offset;
1175 static int
1176 dissect_FMP_CancelReq_reply(tvbuff_t *tvb, packet_info *pinfo _U_,
1177 proto_tree *tree, void* data _U_)
1179 int rval;
1180 int offset = 0;
1182 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1183 if (rval == 0) {
1184 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum,
1185 offset);
1187 return offset;
1190 static int
1191 dissect_FMP_PlugIn_request(tvbuff_t *tvb, packet_info *pinfo _U_,
1192 proto_tree *tree, void* data _U_)
1194 int offset = 0;
1195 offset = dissect_plugInID(tvb, offset, tree);
1196 offset = dissect_rpc_data(tvb, tree, hf_fmp_plugInBuf, offset);
1197 return offset;
1200 static int
1201 dissect_FMP_PlugIn_reply(tvbuff_t *tvb, packet_info *pinfo _U_,
1202 proto_tree *tree, void* data _U_)
1204 int rval;
1205 int offset = 0;
1207 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1208 if (rval == 0) {
1209 offset = dissect_rpc_data(tvb, tree, hf_fmp_plugInBuf,
1210 offset);
1212 return offset;
1215 static int
1216 dissect_FMP_SessionTerminate_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1218 return dissect_rpc_data(tvb, tree, hf_fmp_sessionHandle, 0);
1221 static int
1222 dissect_FMP_SessionTerminate_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1224 int rval;
1226 return dissect_fmp_status(tvb, 0,tree, &rval);
1229 static int
1230 dissect_FMP_SessionCreateEx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
1232 int offset = 0;
1234 offset = dissect_rpc_string(tvb, tree, hf_fmp_hostID,
1235 offset, NULL);
1236 offset = dissect_fmp_timeval(tvb, offset, pinfo ,tree, hf_fmp_btime,
1237 hf_fmp_time_sec, hf_fmp_time_nsec);
1238 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_notifyPort,
1239 offset);
1240 offset = dissect_fmp_notifyProtocol(tvb, offset, tree);
1242 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_os_major,
1243 offset);
1244 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_os_minor,
1245 offset);
1247 offset = dissect_rpc_string(tvb, tree, hf_fmp_os_name,
1248 offset, NULL);
1250 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_os_patch,
1251 offset);
1253 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_os_build,
1254 offset);
1256 offset = dissect_fmp_capabilities(tvb, offset, tree);
1258 return offset;
1262 static int
1263 dissect_FMP_SessionCreateEx_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
1265 int rval;
1266 int offset = 0;
1268 offset = dissect_fmp_status(tvb, offset, tree, &rval);
1269 if (rval == 0) {
1270 offset = dissect_rpc_data(tvb, tree,
1271 hf_fmp_sessionHandle, offset);
1272 offset = dissect_rpc_string(tvb, tree, hf_fmp_hostID,
1273 offset, NULL);
1274 offset = dissect_fmp_timeval(tvb, offset, pinfo ,tree,
1275 hf_fmp_btime, hf_fmp_time_sec,
1276 hf_fmp_time_nsec);
1277 offset = dissect_fmp_heartBeatIntv(tvb, offset, pinfo , tree);
1279 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_os_major,
1280 offset);
1282 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_os_minor,
1283 offset);
1285 offset = dissect_rpc_string(tvb, tree, hf_fmp_server_version_string,
1286 offset, NULL);
1288 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_os_patch,
1289 offset);
1291 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_os_build,
1292 offset);
1294 offset = dissect_fmp_capabilities(tvb, offset, tree);
1297 return offset;
1301 static int
1302 dissect_FMP_ReportClientError_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1304 int offset = 0;
1305 offset = dissect_rpc_string(tvb, tree, hf_fmp_description,
1306 offset, NULL);
1308 offset = dissect_fmp_cerrInfo(tvb, offset, tree);
1309 return offset;
1312 static int
1313 dissect_FMP_ReportClientError_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1315 int rval;
1316 int offset = 0;
1317 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1319 return offset;
1322 static int
1323 dissect_FMP_GetAttr_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1325 int offset = 0;
1326 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle, offset);
1328 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
1330 return offset;
1334 static int
1335 dissect_FMP_GetAttr_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1337 int rval;
1338 int offset = 0;
1339 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1340 if (rval == 0) {
1341 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
1343 offset = dissect_fmp_attrs(tvb, offset, tree);
1346 return offset;
1349 static int
1350 dissect_FMP_OpenGetAttr_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
1352 int offset = 0;
1354 offset = dissect_rpc_data(tvb, tree, hf_fmp_sessionHandle,
1355 offset);
1357 offset = dissect_fmp_fileHandleSrc(tvb, offset, pinfo, tree);
1359 return offset;
1363 static int
1364 dissect_FMP_OpenGetAttr_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1366 int rval;
1367 int offset = 0;
1369 offset = dissect_fmp_status(tvb, offset, tree, &rval);
1371 if (rval == 0) {
1372 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle, offset);
1373 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
1374 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_fileSize, offset);
1375 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_fsID, offset);
1376 offset = dissect_fmp_attrs(tvb, offset, tree);
1380 return offset;
1384 static int
1385 dissect_FMP_FlushGetAttr_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
1387 int offset = 0;
1389 offset = dissect_fmp_fileHandleSrc(tvb, offset, pinfo, tree);
1390 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
1391 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cmd, offset);
1392 offset = dissect_rpc_uint64(tvb,tree, hf_fmp_eof, offset);
1394 proto_tree_add_item(tree, hf_fmp_mtime, tvb, offset, 8, ENC_BIG_ENDIAN);
1395 offset += 8;
1396 offset = dissect_fmp_extentList(tvb, offset, pinfo, tree);
1398 return offset;
1402 static int
1403 dissect_FMP_FlushGetAttr_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1405 int rval;
1406 int offset = 0;
1408 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1409 if (rval == 0) {
1410 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
1412 offset = dissect_fmp_attrs(tvb, offset, tree);
1415 return offset;
1419 static int
1420 dissect_FMP_GetVolumeInfo_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1422 int offset = 0;
1423 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_topVolumeId, offset);
1424 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cursor, offset);
1425 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cookie, offset);
1426 return offset;
1431 static int
1432 dissect_FMP_GetVolumeInfo_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1434 int rval;
1435 int offset = 0;
1437 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1438 if (rval == 0) {
1439 /* FIXME: I don't know size of this volumes */
1440 offset = dissect_fmp_Hiervolume(tvb,offset, tree);
1442 return offset;
1446 static int
1447 dissect_FMP_OpenGetMapEx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
1449 int offset = 0;
1450 offset = dissect_rpc_data(tvb, tree, hf_fmp_sessionHandle,
1451 offset);
1452 offset = dissect_fmp_fileHandleSrc(tvb, offset, pinfo, tree);
1453 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_firstLogBlk64, offset);
1454 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_numBlksReq,
1455 offset);
1456 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_minBlks, offset);
1457 return offset;
1461 static int
1462 dissect_FMP_OpenGetMapEx_reply(tvbuff_t *tvb, packet_info *pinfo,
1463 proto_tree *tree, void* data _U_)
1465 int rval;
1466 int offset = 0;
1467 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1468 if (rval == 0) {
1469 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle,
1470 offset);
1471 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum,
1472 offset);
1473 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cookie,
1474 offset);
1475 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_fileSize,
1476 offset);
1477 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_fsID,
1478 offset);
1479 offset = dissect_fmp_extentListEx(tvb, offset, pinfo, tree);
1482 return offset;
1486 static int
1487 dissect_FMP_OpenAllocSpaceEx_request(tvbuff_t *tvb,
1488 packet_info *pinfo, proto_tree *tree, void* data _U_)
1490 int offset = 0;
1491 offset = dissect_rpc_data(tvb , tree, hf_fmp_sessionHandle,
1492 offset);
1493 offset = dissect_fmp_fileHandleSrc(tvb, offset, pinfo, tree);
1494 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_firstLogBlk64, offset);
1495 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_numBlksReq,
1496 offset);
1497 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_minBlks, offset);
1498 return offset;
1502 static int
1503 dissect_FMP_OpenAllocSpaceEx_reply(tvbuff_t *tvb, packet_info *pinfo,
1504 proto_tree *tree, void* data _U_)
1506 int rval;
1507 int offset = 0;
1509 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1510 if (rval == 0) {
1511 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle,
1512 offset);
1513 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum,
1514 offset);
1515 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cookie,
1516 offset);
1517 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_fileSize,
1518 offset);
1519 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_fsID,
1520 offset);
1521 offset = dissect_fmp_extentListEx(tvb, offset, pinfo, tree);
1523 return offset;
1526 static int
1527 dissect_FMP_GetMapEx_request(tvbuff_t *tvb, packet_info *pinfo _U_,
1528 proto_tree *tree, void* data _U_)
1530 int offset = 0;
1531 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle, offset);
1532 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
1533 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_firstLogBlk64, offset);
1534 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_numBlksReq,
1535 offset);
1536 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_minBlks, offset);
1537 return offset;
1541 static int
1542 dissect_FMP_GetMapEx_reply(tvbuff_t *tvb, packet_info *pinfo,
1543 proto_tree *tree, void* data _U_)
1545 int rval;
1546 int offset = 0;
1548 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1549 if (rval == 0) {
1550 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum,
1551 offset);
1552 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cookie,
1553 offset);
1554 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_fileSize,
1555 offset);
1556 offset = dissect_fmp_extentListEx(tvb, offset, pinfo, tree);
1559 return offset;
1563 static int
1564 dissect_FMP_AllocSpaceEx_request(tvbuff_t *tvb, packet_info *pinfo _U_,
1565 proto_tree *tree, void* data _U_)
1567 int offset = 0;
1568 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle, offset);
1569 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
1570 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_firstLogBlk64, offset);
1571 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_numBlksReq,
1572 offset);
1573 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_minBlks, offset);
1574 return offset;
1578 static int
1579 dissect_FMP_AllocSpaceEx_reply(tvbuff_t *tvb, packet_info *pinfo,
1580 proto_tree *tree, void* data _U_)
1582 int rval;
1583 int offset = 0;
1585 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1586 if (rval == 0) {
1587 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum,
1588 offset);
1589 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cookie,
1590 offset);
1591 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_fileSize,
1592 offset);
1593 offset = dissect_fmp_extentListEx(tvb, offset, pinfo, tree);
1596 return offset;
1599 static int
1600 dissect_FMP_FlushEx_request(tvbuff_t *tvb, packet_info *pinfo,
1601 proto_tree *tree, void* data _U_)
1603 int offset = 0;
1604 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle, offset);
1605 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
1606 offset = dissect_fmp_flushCmd(tvb, offset, tree);
1607 offset = dissect_rpc_uint64(tvb,tree, hf_fmp_eof, offset);
1608 offset = dissect_fmp_extentListEx(tvb, offset, pinfo, tree);
1609 return offset;
1612 static int
1613 dissect_FMP_FlushEx_reply(tvbuff_t *tvb, packet_info *pinfo _U_,
1614 proto_tree *tree, void* data _U_)
1616 int rval;
1617 int offset = 0;
1619 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1620 if (rval == 0) {
1621 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum,
1622 offset);
1624 return offset;
1627 * proc number, "proc name", dissect_request, dissect_reply
1629 static const vsff fmp3_proc[] = {
1630 { 0,
1631 "NULL",
1632 dissect_rpc_void,
1633 dissect_rpc_void, },
1635 { 1,
1636 "SessionCreate",
1637 dissect_FMP_SessionCreate_request,
1638 dissect_FMP_SessionCreate_reply },
1640 { 2,
1641 "HeartBeat",
1642 dissect_FMP_HeartBeat_request,
1643 dissect_FMP_HeartBeat_reply },
1645 { 3,
1646 "Mount",
1647 dissect_FMP_Mount_request,
1648 dissect_FMP_Mount_reply },
1650 { 4,
1651 "Open",
1652 dissect_FMP_Open_request,
1653 dissect_FMP_Open_reply },
1655 { 5,
1656 "Close",
1657 dissect_FMP_Close_request,
1658 dissect_FMP_Close_reply },
1660 { 6,
1661 "OpenGetMap",
1662 dissect_FMP_OpenGetMap_request,
1663 dissect_FMP_OpenGetMap_reply },
1665 { 7,
1666 "OpenAllocSpace",
1667 dissect_FMP_OpenAllocSpace_request,
1668 dissect_FMP_OpenAllocSpace_reply },
1670 { 8,
1671 "GetMap",
1672 dissect_FMP_GetMap_request,
1673 dissect_FMP_GetMap_reply },
1675 { 9,
1676 "AllocSpace",
1677 dissect_FMP_AllocSpace_request,
1678 dissect_FMP_AllocSpace_reply },
1680 { 10,
1681 "Flush",
1682 dissect_FMP_Flush_request,
1683 dissect_FMP_Flush_reply },
1685 { 11,
1686 "CancelReq",
1687 dissect_FMP_CancelReq_request,
1688 dissect_FMP_CancelReq_reply },
1690 { 12,
1691 "PlugIn",
1692 dissect_FMP_PlugIn_request,
1693 dissect_FMP_PlugIn_reply },
1695 { 13,
1696 "SessionTerminate",
1697 dissect_FMP_SessionTerminate_request,
1698 dissect_FMP_SessionTerminate_reply },
1700 { 14,
1701 "SessionCreateEx",
1702 dissect_FMP_SessionCreateEx_request,
1703 dissect_FMP_SessionCreateEx_reply },
1705 { 15,
1706 "ReportClientError",
1707 dissect_FMP_ReportClientError_request,
1708 dissect_FMP_ReportClientError_reply },
1710 { 16 ,
1711 "Get Attribute",
1712 dissect_FMP_GetAttr_request,
1713 dissect_FMP_GetAttr_reply },
1715 { 17 ,
1716 "Open Get Attribute",
1717 dissect_FMP_OpenGetAttr_request,
1718 dissect_FMP_OpenGetAttr_reply },
1720 { 18 ,
1721 "Flush Get Attribute",
1722 dissect_FMP_FlushGetAttr_request,
1723 dissect_FMP_FlushGetAttr_reply },
1725 { 19 ,
1726 "OpenGetMapEx",
1727 dissect_FMP_OpenGetMapEx_request,
1728 dissect_FMP_OpenGetMapEx_reply },
1730 { 20 ,
1731 "OpenAllocSpaceEx",
1732 dissect_FMP_OpenAllocSpaceEx_request,
1733 dissect_FMP_OpenAllocSpaceEx_reply },
1735 { 21 ,
1736 "GetMapEx",
1737 dissect_FMP_GetMapEx_request,
1738 dissect_FMP_GetMapEx_reply },
1740 { 22 ,
1741 "AllocSpaceEx",
1742 dissect_FMP_AllocSpaceEx_request,
1743 dissect_FMP_AllocSpaceEx_reply },
1745 { 23 ,
1746 "FMP_FlushEx",
1747 dissect_FMP_FlushEx_request,
1748 dissect_FMP_FlushEx_reply },
1749 #if 0
1751 { 24 ,
1752 "FlushGetAttrEx",
1753 dissect_FMP_FlushGetAttrEx_request,
1754 dissect_FMP_FlushGetAttrEx_reply },
1756 #endif
1758 { 25 ,
1759 "GetVolumeInfo",
1760 dissect_FMP_GetVolumeInfo_request,
1761 dissect_FMP_GetVolumeInfo_reply },
1764 {0 , NULL , NULL , NULL }
1769 static const rpc_prog_vers_info fmp_vers_info[] = {
1770 { FMP_VERSION_3, fmp3_proc, &hf_fmp_procedure }
1774 static const value_string fmp_proc_vals[] = {
1775 { 0, "NULL" },
1776 { 1, "SessionCreate" },
1777 { 2, "HeartBeat" },
1778 { 3, "Mount" },
1779 { 4, "Open" },
1780 { 5, "Close" },
1781 { 6, "OpenGetMap" },
1782 { 7, "OpenAllocSpace" },
1783 { 8, "GetMap" },
1784 { 9, "AllocSpace " },
1785 { 10, "Flush" },
1786 { 11, "CancelReq" },
1787 { 12, "PlugIn" },
1788 { 13, "SessionTerminate" },
1789 { 14, "SessionCreateEx" },
1790 { 15, "ReportClientError" },
1791 { 16, "GetAttr " },
1792 { 17, "OpenGetAttr" },
1793 { 18, "FlushGetAttr"},
1794 { 19, "OpenGetMapEx"},
1795 { 20, "OpenAllocSpaceEx"},
1796 { 21, "GetMapEx"},
1797 { 22, "AllocSpaceEx"},
1798 { 23, "FlushEx"},
1799 { 24, "FlushGetAttrEx"},
1800 { 25, "GetVolumeInfo"},
1801 { 0,NULL }
1805 static const value_string fmp_status_vals[] = {
1806 { 0, "OK"},
1807 { 5, "IOERROR"},
1808 { 12, "NOMEM"},
1809 { 13, "NOACCESS"},
1810 { 22, "INVALIDARG"},
1811 { 28, "FSFULL"},
1812 { 79, "QUEUE_FULL"},
1813 {500, "WRONG_MSG_NUM"},
1814 {501, "SESSION_LOST"},
1815 {502, "HOT_SESSION"},
1816 {503, "COLD_SESSION"},
1817 {504, "CLIENT_TERMINATED"},
1818 {505, "WRITER_LOST_BLK"},
1819 {506, "FMP_REQUEST_QUEUED"},
1820 {507, "FMP_FALL_BACK"},
1821 {508, "REQUEST_CANCELLED"},
1822 {509, "WRITER_ZEROED_BLK"},
1823 {510, "NOTIFY_ERROR"},
1824 {511, "FMP_WRONG_HANDLE"},
1825 {512, "DUPLICATE_OPEN"},
1826 {600, "PLUGIN_NOFUNC"},
1827 {0,NULL}
1831 static const value_string fmp_extentState_vals[] = {
1832 {0,"VALID_DATA"},
1833 {1,"INVALID_DATA"},
1834 {2,"NONE_DATA"},
1835 {0,NULL}
1838 static const value_string fmp_native_protocol_vals[] = {
1839 {FMP_PATH, "PATH"},
1840 {FMP_NFS, "NFS"},
1841 {FMP_CIFS, "CIFS"},
1842 {FMP_FMP, "FMP"},
1843 {FMP_FS_ONLY, "FS_ONLY"},
1844 {FMP_SHARE, "SHARE"},
1845 {FMP_MOUNT, "MOUNT"},
1846 {FMP_CIFSV2, "CIFSV2"},
1847 {FMP_UNC,"UNC"},
1848 {0,NULL}
1851 static const value_string fmp_volume_mgmt_capability_vals[] = {
1852 {FMP_SERVER_BASED, "SERVER_BASED"},
1853 {FMP_THIRD_PARTY, "THIRD_PARTY"},
1854 {FMP_CLIENT_BASED_DART, "CLIENT_BASED_DART"},
1855 {FMP_CLIENT_BASED_SIMPLE, "CLIENT_BASED_SIMPLE"},
1856 {FMP_HIERARCHICAL_VOLUME, "FMP_HIERARCHICAL_VOLUME"},
1857 {0,NULL}
1860 static const value_string fmp_query_cmd_vals[] = {
1861 {FMP_SCSI_INQUIRY, "SCSI_INQUIRY"},
1862 {FMP_DART_STAMP, "DART_STAMP"},
1863 {0,NULL}
1866 static const value_string fmp_volume_desc_vals[] = {
1867 {FMP_VOLUME_DISK, "DISK"},
1868 {FMP_VOLUME_SLICE, "SLICE"},
1869 {FMP_VOLUME_STRIPE, "STRIPE"},
1870 {FMP_VOLUME_META, "META"},
1871 {FMP_VOLUME_SLICE, "SLICE"},
1872 {FMP_VOLUME_SLICE, "SLICE"},
1873 {0,NULL}
1876 static const value_string fmp_disk_identifier_vals[] = {
1877 {FMP_DISK_IDENTIFIER_SIGNATURE, "SIGNATURE"},
1878 {FMP_DISK_IDENTIFIER_SERIAL, "SERIAL"},
1879 {0,NULL}
1882 static const value_string fmp_notify_protocol_vals[] = {
1883 {FMP_TCP, "TCP"},
1884 {FMP_UDP, "UDP"},
1885 {0,NULL}
1888 static const value_string fmp_volume_mgmt_type_vals[] = {
1889 {FMP_SERVER_BASED, "SERVER_BASED"},
1890 {FMP_THIRD_PARTY, "THIRD_PARTY"},
1891 {FMP_CLIENT_BASED_DART, "CLIENT_BASED_DART"},
1892 {FMP_CLIENT_BASED_SIMPLE, "CLIENT_BASED_SIMPLE"},
1893 {FMP_DISK_SIGNATURE, "DISK_SIGNATURE"},
1894 {FMP_HIERARCHICAL_VOLUME, "HIERARCHICAL_VOLUME"},
1895 {0,NULL}
1898 static const value_string fmp_client_error_number_vals[] = {
1899 {FMP_CE_GENERIC, "FMP_CE_GENERIC"},
1900 {FMP_CE_DISK_ERROR, "FMP_CE_DISK_ERROR"},
1901 {0,NULL}
1904 void
1905 proto_register_fmp(void)
1907 static hf_register_info hf[] = {
1908 { &hf_fmp_procedure,
1909 { "Procedure", "fmp.procedure",
1910 FT_UINT32, BASE_DEC, VALS(fmp_proc_vals),
1911 0, NULL, HFILL }}, /* New addition */
1913 { &hf_fmp_hostID,
1914 { "Host ID", "fmp.hostID",
1915 FT_STRING, BASE_NONE, NULL, 0,
1916 NULL, HFILL }},
1918 { &hf_fmp_btime,
1919 { "Boot Time", "fmp.btime",
1920 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
1921 "Machine Boot Time", HFILL }},
1923 { &hf_fmp_time_sec,
1924 { "seconds", "fmp.btime.sec",
1925 FT_UINT32, BASE_DEC, NULL, 0,
1926 NULL, HFILL }},
1928 { &hf_fmp_time_nsec,
1929 { "nanoseconds", "fmp.btime.nsec",
1930 FT_UINT32, BASE_DEC, NULL, 0,
1931 NULL, HFILL }},
1933 { &hf_fmp_notifyPort,
1934 { "Notify Port", "fmp.notifyPort",
1935 FT_UINT32, BASE_DEC, NULL, 0,
1936 NULL, HFILL }},
1938 { &hf_fmp_sessionHandle,
1939 { "Session Handle", "fmp.sessHandle",
1940 FT_BYTES, BASE_NONE, NULL, 0,
1941 NULL, HFILL }},
1943 { &hf_fmp_fmpFHandle,
1944 { "FMP File Handle", "fmp.fmpFHandle",
1945 FT_BYTES, BASE_NONE, NULL, 0,
1946 NULL,
1948 HFILL }},
1949 { &hf_fmp_nfsFHandle,
1950 { "NFS File Handle", "fmp.nfsFHandle",
1951 FT_BYTES, BASE_NONE, NULL, 0,
1952 NULL, HFILL }},
1954 { &hf_fmp_fsID,
1955 { "File System ID", "fmp.fsID",
1956 FT_UINT32, BASE_HEX, NULL, 0,
1957 NULL, HFILL }},
1959 { &hf_fmp_status,
1960 { "Status", "fmp.status",
1961 FT_UINT32, BASE_DEC, VALS(fmp_status_vals), 0,
1962 "Reply Status", HFILL }},
1964 { &hf_fmp_fsBlkSz,
1965 { "File System Block Size", "fmp.fsBlkSz",
1966 FT_UINT32, BASE_DEC, NULL, 0,
1967 NULL, HFILL }},
1969 { &hf_fmp_volHandle,
1970 { "Volume Handle", "fmp.volHandle",
1971 FT_STRING, BASE_NONE, NULL, 0,
1972 NULL, HFILL }},
1974 { &hf_fmp_dskSigEnt_val,
1975 { "Celerra Signature", "fmp.dsi.ds.dsList.dskSigLst_val.dse.dskSigEnt_val",
1976 FT_STRING, BASE_NONE, NULL, 0,
1977 NULL, HFILL }},
1979 { &hf_fmp_devSignature,
1980 { "Signature DATA", "fmp.devSig",
1981 FT_STRING, BASE_NONE, NULL, 0,
1982 NULL, HFILL }},
1984 { &hf_fmp_mount_path,
1985 { "Native Protocol: PATH", "fmp.mount_path",
1986 FT_STRING, BASE_NONE, NULL, 0,
1987 "Absolute path from the root on the server side", HFILL }},
1989 { &hf_fmp_sig_offset,
1990 { "Sig Offset", "fmp.dsi.ds.sig_offset",
1991 FT_UINT64, BASE_DEC, NULL, 0,
1992 NULL, HFILL }},
1994 { &hf_fmp_numBlksReq,
1995 { "Extent Length", "fmp.numBlksReq",
1996 FT_UINT32, BASE_DEC, NULL, 0,
1997 NULL, HFILL }},
1999 { &hf_fmp_minBlks,
2000 { "Minimum Blocks to Grant", "fmp.minBlks",
2001 FT_UINT32, BASE_DEC, NULL, 0,
2002 NULL, HFILL }},
2004 { &hf_fmp_msgNum,
2005 { "Message Number", "fmp.msgNum",
2006 FT_UINT32, BASE_DEC, NULL, 0,
2007 NULL, HFILL }},
2009 { &hf_fmp_cookie,
2010 { "Cookie", "fmp.cookie",
2011 FT_UINT32, BASE_HEX, NULL, 0,
2012 "Cookie for FMP_REQUEST_QUEUED Resp", HFILL }},
2014 { &hf_fmp_fileSize,
2015 { "File Size", "fmp.fileSize",
2016 FT_UINT64, BASE_DEC, NULL, 0,
2017 NULL, HFILL }},
2019 { &hf_fmp_extentList_len,
2020 { "Extent List Length", "fmp.extentList_len",
2021 FT_UINT32, BASE_DEC, NULL, 0,
2022 NULL, HFILL }},
2024 { &hf_fmp_extent_state,
2025 { "Extent State", "fmp.extentState",
2026 FT_UINT32,BASE_DEC, VALS(fmp_extentState_vals), 0,
2027 NULL, HFILL }},
2029 { &hf_fmp_firstLogBlk,
2030 { "First Logical File Block", "fmp.firstLogBlk",
2031 FT_UINT32, BASE_DEC, NULL, 0,
2032 NULL, HFILL }},
2034 { &hf_fmp_numBlks,
2035 { "Number of Blocks", "fmp.numBlks",
2036 FT_UINT32, BASE_DEC, NULL, 0,
2037 NULL, HFILL }},
2039 { &hf_fmp_volID,
2040 { "Volume ID inside DART", "fmp.volID",
2041 FT_UINT32, BASE_HEX, NULL, 0,
2042 NULL, HFILL }},
2044 { &hf_fmp_startOffset,
2045 { "Start Offset", "fmp.startOffset",
2046 FT_UINT32, BASE_DEC, NULL, 0,
2047 NULL, HFILL }},
2049 { &hf_fmp_start_offset64,
2050 { "Start offset", "fmp.start_offset64",
2051 FT_UINT64, BASE_DEC, NULL, 0,
2052 "Start Offset of extentEx", HFILL }},
2054 { &hf_fmp_eof,
2055 { "EOF", "fmp.eof",
2056 FT_UINT64, BASE_DEC, NULL, 0,
2057 "End Of File", HFILL }},
2059 { &hf_fmp_plugInID,
2060 { "Plug In Cmd ID", "fmp.plugInID",
2061 FT_BYTES, BASE_NONE, NULL, 0,
2062 NULL, HFILL }},
2064 { &hf_fmp_plugInBuf,
2065 { "Plug In Args", "fmp.plugIn",
2066 FT_BYTES, BASE_NONE, NULL, 0,
2067 NULL, HFILL }},
2069 { &hf_fmp_os_major,
2070 { "OS Major", "fmp.os_major",
2071 FT_UINT32, BASE_DEC, NULL, 0,
2072 NULL, HFILL }},
2074 { &hf_fmp_os_minor,
2075 { "OS Minor", "fmp.os_minor",
2076 FT_UINT32, BASE_DEC, NULL, 0,
2077 NULL, HFILL }},
2079 { &hf_fmp_os_name,
2080 { "OS Name", "fmp.os_name",
2081 FT_STRING, BASE_NONE, NULL, 0,
2082 NULL, HFILL }},
2084 { &hf_fmp_path,
2085 { "Mount Path", "fmp.Path",
2086 FT_STRING, BASE_NONE, NULL, 0,
2087 NULL, HFILL }},
2089 { &hf_fmp_os_patch,
2090 { "OS Path", "fmp.os_patch",
2091 FT_UINT32, BASE_DEC, NULL, 0,
2092 NULL, HFILL }},
2094 { &hf_fmp_os_build,
2095 { "OS Build", "fmp.os_build",
2096 FT_UINT32, BASE_DEC, NULL, 0,
2097 NULL, HFILL }},
2099 { &hf_fmp_server_version_string,
2100 { "Server Version String", "fmp.server_version_string",
2101 FT_STRING, BASE_NONE, NULL, 0,
2102 NULL, HFILL }},
2104 { &hf_fmp_description,
2105 { "Error Description", "fmp.description",
2106 FT_STRING, BASE_NONE, NULL, 0,
2107 "Client Error Description", HFILL }},
2109 { &hf_fmp_nfsv3Attr_type,
2110 { "Type", "fmp.nfsv3Attr_type",
2111 FT_UINT32, BASE_DEC, NULL, 0,
2112 "NFSV3 Attr Type", HFILL }},
2114 { &hf_fmp_nfsv3Attr_mode,
2115 { "Mode", "fmp.nfsv3Attr_mod",
2116 FT_UINT32, BASE_DEC, NULL, 0,
2117 NULL, HFILL }},
2119 { &hf_fmp_nfsv3Attr_nlink,
2120 { "nlink", "fmp.nfsv3Attr_nlink",
2121 FT_UINT32, BASE_DEC, NULL, 0,
2122 NULL, HFILL }},
2124 { &hf_fmp_nfsv3Attr_uid,
2125 { "uid", "fmp.nfsv3Attr_uid",
2126 FT_UINT32, BASE_DEC, NULL, 0,
2127 NULL, HFILL }},
2129 { &hf_fmp_nfsv3Attr_gid,
2130 { "gid", "fmp.nfsv3Attr_gid",
2131 FT_UINT32, BASE_DEC, NULL, 0,
2132 NULL, HFILL }},
2134 /* for nfsv3Attr_size use hf_fmp_fileSize */
2135 { &hf_fmp_nfsv3Attr_used,
2136 { "Used", "fmp.nfsv3Attr_used",
2137 FT_UINT64, BASE_DEC, NULL, 0,
2138 NULL, HFILL }},
2140 { &hf_fmp_nfsv3Attr_rdev,
2141 { "rdev", "fmp.nfsv3Attr_rdev",
2142 FT_UINT64, BASE_DEC, NULL, 0,
2143 NULL, HFILL }},
2145 { &hf_fmp_nfsv3Attr_fsid,
2146 { "fsid", "fmp.nfsv3Attr_fsid",
2147 FT_UINT64, BASE_DEC, NULL, 0,
2148 NULL, HFILL }},
2150 { &hf_fmp_nfsv3Attr_fileid,
2151 { "File ID", "fmp.nfsv3Attr_fileid",
2152 FT_UINT64, BASE_DEC, NULL, 0,
2153 NULL, HFILL }},
2155 { &hf_fmp_cmd,
2156 { "Command", "fmp.cmd",
2157 FT_UINT32, BASE_DEC, NULL, 0,
2158 NULL, HFILL }},
2160 { &hf_fmp_topVolumeId,
2161 { "Top Volume ID", "fmp.topVolumeId",
2162 FT_UINT32, BASE_HEX, NULL, 0,
2163 NULL, HFILL }},
2165 { &hf_fmp_cursor,
2166 { "number of volumes", "fmp.cursor",
2167 FT_UINT32, BASE_DEC, NULL, 0,
2168 NULL, HFILL }},
2170 { &hf_fmp_offset64,
2171 { "offset", "fmp.offset64",
2172 FT_UINT64, BASE_DEC, NULL, 0,
2173 NULL, HFILL }},
2175 { &hf_fmp_slice_size,
2176 { "size of the slice", "fmp.slice_size",
2177 FT_UINT64, BASE_DEC, NULL, 0,
2178 NULL, HFILL }},
2180 { &hf_fmp_volume,
2181 { "Volume ID's", "fmp.volume",
2182 FT_UINT32, BASE_HEX, NULL, 0,
2183 NULL, HFILL }},
2185 { &hf_fmp_stripeSize,
2186 { "size of the stripe", "fmp.stripeSize",
2187 FT_UINT64, BASE_DEC, NULL, 0,
2188 NULL, HFILL }},
2190 { &hf_fmp_firstLogBlk64,
2191 { "First Logical Block", "fmp.firstLogBlk64",
2192 FT_UINT64, BASE_DEC, NULL, 0,
2193 NULL, HFILL }},
2195 { &hf_fmp_native_protocol,
2196 { "Native Protocol", "fmp.native_protocol",
2197 FT_UINT32, BASE_DEC, VALS(fmp_native_protocol_vals), 0,
2198 NULL, HFILL }},
2200 { &hf_fmp_encoding_mode,
2201 { "Encoding Mode", "fmp.encoding_mode",
2202 FT_UINT32, BASE_DEC, VALS(fmp_encoding_mode_vals), 0,
2203 NULL, HFILL }},
2205 { &hf_fmp_capability,
2206 { "Volume Mgmt Capability", "fmp.capability",
2207 FT_UINT32, BASE_DEC, VALS(fmp_volume_mgmt_capability_vals), 0,
2208 NULL, HFILL }},
2210 { &hf_fmp_devSerial_query_cmd,
2211 { "Query Command", "fmp.devSerial.query_cmd",
2212 FT_UINT32, BASE_DEC, VALS(fmp_query_cmd_vals), 0,
2213 NULL, HFILL }},
2215 { &hf_fmp_volume_desc,
2216 { "VOLUME", "fmp.volume_desc",
2217 FT_UINT32, BASE_DEC, VALS(fmp_volume_desc_vals), 0,
2218 NULL, HFILL }},
2220 { &hf_fmp_disk_identifier,
2221 { "DISK IDENTIFIER", "fmp.disk_identifier",
2222 FT_UINT32, BASE_DEC, VALS(fmp_disk_identifier_vals), 0,
2223 NULL, HFILL }},
2225 { &hf_fmp_volume_mgmt_type,
2226 { "Volume Mgmt Type", "fmp.volume_mgmt_type",
2227 FT_UINT32, BASE_DEC, VALS(fmp_volume_mgmt_type_vals), 0,
2228 NULL, HFILL }},
2230 { &hf_fmp_notify_protocol,
2231 { "Protocol", "fmp.notify_protocol",
2232 FT_UINT32, BASE_DEC, VALS(fmp_notify_protocol_vals), 0,
2233 NULL, HFILL }},
2235 { &hf_fmp_client_error_number,
2236 { "CLIENT Error Number", "fmp.client_error_number",
2237 FT_UINT32, BASE_DEC, VALS(fmp_client_error_number_vals), 0,
2238 NULL, HFILL }},
2240 /* Generated from convert_proto_tree_add_text.pl */
2241 { &hf_fmp_fid, { "fid", "fmp.fid", FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2242 { &hf_fmp_tid, { "tid", "fmp.tid", FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2243 { &hf_fmp_uid, { "uid", "fmp.uid", FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2244 { &hf_fmp_fsid, { "FsID", "fmp.fsid", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2245 { &hf_fmp_cifsport, { "cifsPort", "fmp.cifsport", FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2246 { &hf_fmp_number_of_disk, { "Number of Disk", "fmp.number_of_disk", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2247 { &hf_fmp_length_of_list, { "Length of List", "fmp.length_of_list", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2248 { &hf_fmp_sigoffset, { "sigOffset", "fmp.sigoffset", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2249 { &hf_fmp_length_of_volume_list, { "Length of volume List", "fmp.length_of_volume_list", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2250 { &hf_fmp_blockindex, { "blockIndex", "fmp.blockindex", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2251 { &hf_fmp_cap, { "Capabilities", "fmp.cap", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2252 { &hf_fmp_cap_revoke_handle_list, { "CAP_REVOKE_HANDLE_LIST", "fmp.cap.revoke_handle_list", FT_BOOLEAN, 32, TFS(&tfs_yes_no), FMP_CAP_REVOKE_HANDLE_LIST, NULL, HFILL }},
2253 { &hf_fmp_cap_unc_names, { "CAP_UNC_NAMES", "fmp.cap.unc_names", FT_BOOLEAN, 32, TFS(&tfs_yes_no), FMP_CAP_UNC_NAMES, NULL, HFILL }},
2254 { &hf_fmp_cap_cifsv2, { "CAP_CIFSV2", "fmp.cap.cifsv2", FT_BOOLEAN, 32, TFS(&tfs_yes_no), FMP_CAP_CIFSV2, NULL, HFILL }},
2255 { &hf_fmp_mtime, { "mtime", "fmp.mtime", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2256 { &hf_fmp_atime, { "atime", "fmp.atime", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2257 { &hf_fmp_ctime, { "ctime", "fmp.ctime", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2258 { &hf_fmp_heartbeat_interval, { "Heartbeat interval", "fmp.heartbeat_interval", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2259 { &hf_fmp_volindex, { "volIndex", "fmp.volindex", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2262 static int *ett[] = {
2263 &ett_fmp,
2264 &ett_fmp_timeval,
2265 &ett_fmp_extList,
2266 &ett_fmp_ext,
2267 &ett_fmp_fileHandle,
2268 &ett_capabilities,
2269 &ett_HierVolumeDescription,
2270 &ett_attrs
2273 module_t *fmp_module;
2274 proto_fmp = proto_register_protocol("File Mapping Protocol", "FMP", "fmp");
2276 proto_register_field_array(proto_fmp, hf, array_length(hf));
2277 proto_register_subtree_array(ett, array_length(ett));
2279 fmp_module=prefs_register_protocol(proto_fmp, NULL);
2281 prefs_register_bool_preference(fmp_module, "fhandle_find_both_reqrep",
2282 "Fhandle filters finds both request/response",
2283 "With this option display filters for fmp fhandle a RPC call,"
2284 " even if the actual fhandle is only present in one of the packets",
2285 &fmp_fhandle_reqrep_matching);
2289 void
2290 proto_reg_handoff_fmp(void)
2292 /* Register the protocol as RPC */
2293 rpc_init_prog(proto_fmp, FMP_PROGRAM, ett_fmp,
2294 G_N_ELEMENTS(fmp_vers_info), fmp_vers_info);
2298 * Editor modelines - https://www.wireshark.org/tools/modelines.html
2300 * Local variables:
2301 * c-basic-offset: 4
2302 * tab-width: 8
2303 * indent-tabs-mode: nil
2304 * End:
2306 * vi: set shiftwidth=4 tabstop=8 expandtab:
2307 * :indentSize=4:tabSize=8:noTabs=true: