FIXUP: WIP: verification_trailer
[wireshark-wip.git] / epan / dissectors / packet-fmp.c
blobe44e1394650aecefe057067037ed88203b8fd314
1 /* packet-fmp.c
2 * Routines for fmp dissection
4 * $Id$
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 #include "config.h"
27 #include <epan/packet.h>
28 #include <epan/prefs.h>
29 #include "packet-fmp.h"
30 #include "packet-rpc.h"
33 static int hf_fmp_procedure = -1;
34 static int hf_fmp_fsID = -1;
35 static int hf_fmp_fsBlkSz = -1;
36 static int hf_fmp_sessionHandle = -1;
37 static int hf_fmp_fmpFHandle = -1;
38 static int hf_fmp_msgNum = -1;
39 static int hf_fmp_fileSize = -1;
40 static int hf_fmp_cookie = -1;
41 static int hf_fmp_firstLogBlk = -1;
42 static int hf_fmp_numBlksReq = -1;
44 static int proto_fmp = -1;
45 static int hf_fmp_hostID = -1;
46 static int hf_fmp_status = -1;
47 static int hf_fmp_btime = -1;
48 static int hf_fmp_time_sec = -1;
49 static int hf_fmp_time_nsec = -1;
50 static int hf_fmp_notifyPort = -1;
51 static int hf_fmp_minBlks = -1;
52 static int hf_fmp_eof = -1;
53 static int hf_fmp_path = -1;
54 static int hf_fmp_plugInID = -1;
55 static int hf_fmp_plugInBuf = -1;
56 static int hf_fmp_nfsFHandle = -1;
57 static int hf_fmp_extentList_len = -1;
58 static int hf_fmp_extent_state = -1;
59 static int hf_fmp_numBlks = -1;
60 static int hf_fmp_volID = -1;
61 static int hf_fmp_startOffset = -1;
62 static int hf_fmp_volHandle = -1;
63 static int hf_fmp_devSignature = -1;
64 static int hf_fmp_dskSigEnt_val = -1;
65 static int hf_fmp_mount_path = -1;
66 static int hf_fmp_sig_offset = -1;
67 static int hf_fmp_os_major = -1;
68 static int hf_fmp_os_minor = -1;
69 static int hf_fmp_os_name = -1;
70 static int hf_fmp_os_patch = -1;
71 static int hf_fmp_os_build = -1;
72 static int hf_fmp_server_version_string = -1;
73 static int hf_fmp_description = -1;
74 static int hf_fmp_nfsv3Attr_type = -1;
75 static int hf_fmp_nfsv3Attr_mode = -1;
76 static int hf_fmp_nfsv3Attr_nlink = -1;
77 static int hf_fmp_nfsv3Attr_uid = -1;
78 static int hf_fmp_nfsv3Attr_gid = -1;
79 static int hf_fmp_nfsv3Attr_used = -1;
80 static int hf_fmp_nfsv3Attr_rdev = -1;
81 static int hf_fmp_nfsv3Attr_fsid = -1;
82 static int hf_fmp_nfsv3Attr_fileid = -1;
83 static int hf_fmp_cmd = -1;
84 static int hf_fmp_topVolumeId = -1;
85 static int hf_fmp_cursor = -1;
86 static int hf_fmp_offset64 = -1;
87 static int hf_fmp_start_offset64 = -1;
88 static int hf_fmp_slice_size = -1;
89 static int hf_fmp_volume = -1;
90 static int hf_fmp_stripeSize = -1;
91 static int hf_fmp_firstLogBlk64 =-1;
92 static int hf_fmp_native_protocol = -1;
93 static int hf_fmp_encoding_mode = -1;
94 static int hf_fmp_capability = -1;
95 static int hf_fmp_devSerial_query_cmd = -1;
96 static int hf_fmp_volume_desc = -1;
97 static int hf_fmp_disk_identifier = -1;
98 static int hf_fmp_volume_mgmt_type = -1;
99 static int hf_fmp_notify_protocol = -1;
100 static int hf_fmp_client_error_number = -1;
101 /* Generated from convert_proto_tree_add_text.pl */
102 static int hf_fmp_cap_revoke_handle_list = -1;
103 static int hf_fmp_length_of_volume_list = -1;
104 static int hf_fmp_cap_unc_names = -1;
105 static int hf_fmp_length_of_list = -1;
106 static int hf_fmp_sigoffset = -1;
107 static int hf_fmp_uid = -1;
108 static int hf_fmp_fid = -1;
109 static int hf_fmp_fsid = -1;
110 static int hf_fmp_tid = -1;
111 static int hf_fmp_cifsport = -1;
112 static int hf_fmp_blockindex = -1;
113 static int hf_fmp_number_of_disk = -1;
114 static int hf_fmp_cap_cifsv2 = -1;
116 static gint ett_fmp = -1;
117 static gint ett_fmp_timeval = -1;
118 static gint ett_fmp_extList = -1;
119 static gint ett_fmp_ext = -1;
120 static gint ett_fmp_fileHandle = -1;
121 static gint ett_capabilities = -1;
122 static gint ett_HierVolumeDescription = -1;
123 static gint ett_attrs = -1;
125 static const value_string fmp_encoding_mode_vals[] = {
126 {FMP_ASCII, "ASCII"},
127 {FMP_UTF8, "UTF8"},
128 {FMP_UNICODE1, "UNICODE"},
129 {0,NULL}
132 static gboolean fmp_fhandle_reqrep_matching = FALSE;
134 static int
135 dissect_fmp_genString(tvbuff_t *tvb, int offset, proto_tree *tree)
137 proto_tree_add_item(tree, hf_fmp_encoding_mode, tvb, offset, 4, ENC_BIG_ENDIAN);
138 offset += 4;
140 if (try_val_to_str(tvb_get_ntohl(tvb, offset), fmp_encoding_mode_vals) == NULL)
141 return offset;
143 offset = dissect_rpc_string(tvb, tree, hf_fmp_path,
144 offset, NULL);
146 return offset;
149 static int
150 get_fileHandleSrc_size(tvbuff_t *tvb, int offset)
152 int length;
153 nativeProtocol np;
155 np = (nativeProtocol)tvb_get_ntohl(tvb, offset);
157 switch (np) {
158 case FMP_PATH:
159 length = 4 + FMP_MAX_PATH_LEN;
160 break;
161 case FMP_NFS:
162 length = 8 + tvb_get_ntohl(tvb, offset + 4);
163 break;
164 case FMP_CIFS:
165 length = 10;
166 break;
167 case FMP_FMP:
168 length = 8 + tvb_get_ntohl(tvb, offset + 4);
169 break;
170 case FMP_FS_ONLY:
171 length = 8;
172 break;
173 case FMP_SHARE:
174 /* FALLTHROUGH */
175 case FMP_MOUNT:
176 length = 8 + FMP_MAX_PATH_LEN;
177 break;
178 default:
179 length = 4;
180 break;
183 return length;
186 static int
187 dissect_fmp_fileHandleSrc(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
188 proto_tree *tree)
190 nativeProtocol np;
192 proto_item *fileHandleItem;
193 proto_tree *fileHandleTree;
194 int length;
196 length = get_fileHandleSrc_size(tvb, offset);
198 fileHandleItem = proto_tree_add_text(tree, tvb, offset, length,
199 "Source File Handle");
200 fileHandleTree = proto_item_add_subtree(fileHandleItem,
201 ett_fmp_fileHandle);
203 np = (nativeProtocol)tvb_get_ntohl(tvb, offset);
204 proto_tree_add_item(fileHandleTree, hf_fmp_native_protocol, tvb, offset, 4, ENC_BIG_ENDIAN);
205 offset += 4;
207 switch (np) {
208 case FMP_PATH:
209 offset = dissect_rpc_string(tvb, fileHandleTree,
210 hf_fmp_mount_path, offset, NULL);
211 break;
213 case FMP_NFS:
214 offset = dissect_rpc_data(tvb, fileHandleTree,
215 hf_fmp_nfsFHandle, offset);
216 break;
218 case FMP_CIFS:
219 proto_tree_add_item(fileHandleTree, hf_fmp_fid, tvb, offset, 2, ENC_BIG_ENDIAN);
220 offset += 2;
222 proto_tree_add_item(fileHandleTree, hf_fmp_tid, tvb, offset, 2, ENC_BIG_ENDIAN);
223 offset += 2;
225 proto_tree_add_item(fileHandleTree, hf_fmp_uid, tvb, offset, 2, ENC_BIG_ENDIAN);
226 offset += 2;
227 break;
229 case FMP_FMP:
230 offset = dissect_rpc_string(tvb, fileHandleTree,
231 hf_fmp_fmpFHandle, offset, NULL);
232 break;
234 case FMP_FS_ONLY:
235 proto_tree_add_item(fileHandleTree, hf_fmp_fsid, tvb, offset, 4, ENC_BIG_ENDIAN);
236 offset += 4;
237 break;
239 case FMP_SHARE:
240 offset = dissect_fmp_genString(tvb, offset, fileHandleTree);
241 break;
243 case FMP_MOUNT:
244 offset = dissect_fmp_genString(tvb, offset, fileHandleTree);
245 break;
247 case FMP_CIFSV2:
248 proto_tree_add_item(fileHandleTree, hf_fmp_fid, tvb, offset, 2, ENC_BIG_ENDIAN);
249 offset += 2;
251 proto_tree_add_item(fileHandleTree, hf_fmp_tid, tvb, offset, 2, ENC_BIG_ENDIAN);
252 offset += 2;
254 proto_tree_add_item(fileHandleTree, hf_fmp_uid, tvb, offset, 2, ENC_BIG_ENDIAN);
255 offset += 2;
257 proto_tree_add_item(fileHandleTree, hf_fmp_cifsport, tvb, offset, 2, ENC_BIG_ENDIAN);
258 offset += 2;
259 break;
260 case FMP_UNC:
261 offset = dissect_fmp_genString(tvb, offset, fileHandleTree);
262 break;
264 default:
265 break;
268 return offset;
271 static int
272 dissect_fmp_extentState(tvbuff_t *tvb, int offset, proto_tree *tree)
274 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_extent_state,
275 offset);
277 return offset;
280 static int
281 dissect_fmp_extent(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, guint32 ext_num)
283 proto_item *extItem;
284 proto_tree *extTree;
286 extItem = proto_tree_add_text(tree, tvb, offset, 20 ,
287 "Extent (%u)", (guint32) ext_num);
289 extTree = proto_item_add_subtree(extItem, ett_fmp_ext);
291 offset = dissect_rpc_uint32(tvb, extTree, hf_fmp_firstLogBlk,
292 offset);
293 offset = dissect_rpc_uint32(tvb, extTree, hf_fmp_numBlks,
294 offset);
295 offset = dissect_rpc_uint32(tvb, extTree, hf_fmp_volID, offset);
296 offset = dissect_rpc_uint32(tvb, extTree, hf_fmp_startOffset,
297 offset);
298 offset = dissect_fmp_extentState(tvb, offset, extTree);
300 return offset;
303 static int
304 dissect_fmp_extentList(tvbuff_t *tvb, int offset, packet_info *pinfo,
305 proto_tree *tree)
307 guint32 numExtents;
308 guint32 totalLength;
309 proto_item *extListItem;
310 proto_tree *extListTree;
311 guint32 i;
313 numExtents = tvb_get_ntohl(tvb, offset);
314 totalLength = 4 + (20 * numExtents);
316 extListItem = proto_tree_add_text(tree, tvb, offset, totalLength,
317 "Extent List");
318 extListTree = proto_item_add_subtree(extListItem, ett_fmp_extList);
320 offset = dissect_rpc_uint32(tvb, extListTree,
321 hf_fmp_extentList_len, offset);
323 for (i = 0; i < numExtents; i++) {
324 offset = dissect_fmp_extent(tvb, offset, pinfo, extListTree, i+1);
327 return offset;
331 static int
332 dissect_fmp_extentListEx(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
333 proto_tree *tree)
335 guint32 numExtents;
336 proto_item *extListItem;
337 proto_tree *extListTree;
338 guint32 i;
340 numExtents = tvb_get_ntohl(tvb, offset);
342 offset += 4;
344 for (i = 0; i < numExtents; i++) {
345 extListItem = proto_tree_add_text(tree, tvb, offset, 28,
346 "Extent List");
347 extListTree = proto_item_add_subtree(extListItem, ett_fmp_extList);
350 offset = dissect_rpc_uint64(tvb,extListTree , hf_fmp_firstLogBlk64, offset);
352 offset = dissect_rpc_uint32(tvb,extListTree , hf_fmp_numBlksReq,
353 offset);
355 offset = dissect_rpc_uint32(tvb,extListTree , hf_fmp_volID, offset);
357 offset = dissect_rpc_uint64(tvb,extListTree , hf_fmp_start_offset64, offset);
359 offset = dissect_fmp_extentState(tvb, offset, extListTree);
363 return offset;
367 static int
368 dissect_plugInID(tvbuff_t *tvb, int offset, proto_tree *tree)
370 if (!tree) {
371 return offset;
374 proto_tree_add_item(tree, hf_fmp_plugInID, tvb, offset, FMP_PLUG_IN_ID_SZ,
375 ENC_NA);
376 return offset;
379 static int
380 dissect_fmp_flushCmd(tvbuff_t *tvb, int offset, proto_tree *tree)
382 guint32 cmd;
383 char msg[MAX_MSG_SIZE];
384 guint32 bitValue;
385 int i;
387 if (tree) {
388 cmd = tvb_get_ntohl(tvb, offset);
390 /* Initialize the message for an empty string */
391 msg[0] = '\0';
393 for (i = 0; cmd != 0 && i < 32; i++) {
395 bitValue = 1 << i;
397 if (cmd & bitValue) {
398 switch (bitValue) {
399 case FMP_COMMIT_SPECIFIED:
400 g_strlcat(msg, "COMMIT_SPECIFIED", MAX_MSG_SIZE);
401 break;
402 case FMP_RELEASE_SPECIFIED:
403 g_strlcat(msg, "RELEASE_SPECIFIED", MAX_MSG_SIZE);
404 break;
405 case FMP_RELEASE_ALL:
406 g_strlcat(msg, "RELEASE_ALL", MAX_MSG_SIZE);
407 break;
408 case FMP_CLOSE_FILE:
409 g_strlcat(msg, "CLOSE_FILE", MAX_MSG_SIZE);
410 break;
411 case FMP_UPDATE_TIME:
412 g_strlcat(msg, "UPDATE_TIME", MAX_MSG_SIZE);
413 break;
414 case FMP_ACCESS_TIME:
415 g_strlcat(msg, "ACCESS_TIME", MAX_MSG_SIZE);
416 break;
417 default:
418 g_strlcat(msg, "UNKNOWN", MAX_MSG_SIZE);
419 break;
422 /* clear the bit that we processed */
423 cmd &= ~bitValue;
425 /* add a "bitwise inclusive OR" symbol between cmds */
426 if (cmd) {
427 g_strlcat(msg, " | ", MAX_MSG_SIZE);
432 if (strlen(msg) == 0) {
433 g_strlcpy(msg, "No command specified", MAX_MSG_SIZE);
436 proto_tree_add_text(tree, tvb, offset, 4, "Cmd: %s", msg);
438 offset += 4;
439 return offset;
442 static int
443 dissect_InterpretVolMgtStuff(tvbuff_t *tvb, int offset, proto_tree *tree)
445 int length, numdisks, i, j;
447 numdisks = tvb_get_ntohl(tvb, offset);
448 proto_tree_add_item(tree, hf_fmp_number_of_disk, tvb, offset, 4, ENC_BIG_ENDIAN);
449 offset += 4;
451 for (i=0; i<numdisks; i++) {
452 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_sig_offset, offset);
453 length = tvb_get_ntohl(tvb, offset);
454 proto_tree_add_item(tree, hf_fmp_length_of_list, tvb, offset, 4, ENC_BIG_ENDIAN);
455 offset += 4;
457 for (j=0; j<length; j++) {
458 proto_tree_add_item(tree, hf_fmp_sigoffset, tvb, offset, 4, ENC_BIG_ENDIAN);
459 offset += 4;
460 offset = dissect_rpc_string(tvb, tree, hf_fmp_dskSigEnt_val,
461 offset, NULL);
464 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_volID, offset);
467 return offset;
472 static int
473 dissect_fmp_capability(tvbuff_t *tvb, int offset, proto_tree *tree)
475 proto_tree_add_item(tree, hf_fmp_capability, tvb, offset, 4, ENC_BIG_ENDIAN);
476 return offset+4;
479 static int
480 dissect_fmp_timeval(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
481 proto_tree *tree, int hf_time, int hf_time_sec,
482 int hf_time_nsec)
484 if (tree) {
485 nstime_t ts;
487 proto_item* time_item;
488 proto_tree* time_tree;
490 ts.secs = tvb_get_ntohl(tvb, offset+0);
491 ts.nsecs = tvb_get_ntohl(tvb, offset+4);
493 time_item = proto_tree_add_time(tree, hf_time, tvb, offset, 8, &ts);
494 time_tree = proto_item_add_subtree(time_item, ett_fmp_timeval);
496 proto_tree_add_uint(time_tree, hf_time_sec, tvb, offset, 4,
497 (guint32) ts.secs);
498 proto_tree_add_uint(time_tree, hf_time_nsec, tvb, offset+4, 4,
499 ts.nsecs);
501 offset += 8;
502 return offset;
505 static int
506 dissect_fmp_heartBeatIntv(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
507 proto_tree *tree)
509 if (tree) {
510 proto_tree_add_text(tree, tvb, offset, 8,
511 "Heart Beat Interval: %d.%d seconds",
512 tvb_get_ntohl(tvb, offset),
513 tvb_get_ntohl(tvb, offset+4));
515 offset += 8;
516 return offset;
519 static int
520 dissect_fmp_status(tvbuff_t *tvb, int offset, proto_tree *tree, int *rval)
522 fmpStat status;
524 status = (fmpStat)tvb_get_ntohl(tvb, offset);
526 switch (status) {
527 case FMP_OK:
528 *rval = 0;
529 break;
530 case FMP_IOERROR:
531 *rval = 1;
532 break;
533 case FMP_NOMEM:
534 *rval = 1;
535 break;
536 case FMP_NOACCESS:
537 *rval = 1;
538 break;
539 case FMP_INVALIDARG:
541 *rval = 1;
542 break;
543 case FMP_FSFULL:
544 *rval = 0;
545 break;
546 case FMP_QUEUE_FULL:
547 case FMP_NOTIFY_ERROR:
548 case FMP_WRITER_LOST_BLK:
549 case FMP_WRONG_MSG_NUM:
550 case FMP_SESSION_LOST:
551 case FMP_REQUEST_CANCELLED:
552 *rval = 1;
553 break;
554 case FMP_HOT_SESSION:
555 *rval = 0;
556 break;
557 case FMP_COLD_SESSION:
558 *rval = 0;
559 break;
560 case FMP_CLIENT_TERMINATED:
561 *rval = 0;
562 break;
563 case FMP_REQUEST_QUEUED:
564 *rval = 0;
565 break;
566 case FMP_FALL_BACK:
567 *rval = 0;
568 break;
569 case FMP_WRITER_ZEROED_BLK:
570 *rval = 0;
571 break;
572 case FMP_WRONG_HANDLE:
573 *rval = 0;
574 break;
575 case FMP_DUPLICATE_OPEN:
576 *rval = 1;
577 break;
578 case FMP_PLUGIN_NOFUNC:
579 *rval = 1;
580 break;
581 default:
582 *rval = 1;
583 break;
585 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_status , offset);
586 return offset;
589 static int
590 dissect_fmp_devSerial(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
591 proto_tree *tree)
593 proto_tree_add_item(tree, hf_fmp_devSerial_query_cmd, tvb, offset, 4, ENC_BIG_ENDIAN);
594 offset += 4;
596 proto_tree_add_item(tree, hf_fmp_sigoffset, tvb, offset, 4, ENC_BIG_ENDIAN);
597 offset += 4;
599 offset = dissect_rpc_string(tvb, tree, hf_fmp_devSignature,
600 offset, NULL);
601 return offset;
604 static int
605 dissect_fmp_VolumeDescription(tvbuff_t *tvb, int offset, proto_tree * tree)
607 int i,length;
608 proto_tree *Hietree;
609 proto_item *ti;
610 fmpVolumeType volumeType;
611 fmpDiskIdentifierType diskIdentifierType;
613 volumeType = (fmpVolumeType)tvb_get_ntohl(tvb, offset);
614 ti = proto_tree_add_item(tree, hf_fmp_volume_desc, tvb, offset, 4, ENC_BIG_ENDIAN);
615 Hietree = proto_item_add_subtree(ti, ett_HierVolumeDescription);
616 offset += 4;
618 switch (volumeType) {
620 case FMP_VOLUME_DISK:
621 offset = dissect_rpc_uint32(tvb, Hietree, hf_fmp_volID, offset);
622 offset += 8; /* blockIndex64 */
623 diskIdentifierType = (fmpDiskIdentifierType)tvb_get_ntohl(tvb, offset);
624 proto_tree_add_item(Hietree, hf_fmp_disk_identifier, tvb, offset, 4, ENC_BIG_ENDIAN);
625 offset += 4;
627 switch (diskIdentifierType) {
628 case FMP_DISK_IDENTIFIER_SIGNATURE:
629 offset = dissect_rpc_uint64(tvb, Hietree, hf_fmp_sig_offset, offset);
630 length = tvb_get_ntohl(tvb, offset);
631 proto_tree_add_item(Hietree, hf_fmp_length_of_list, tvb, offset, 4, ENC_BIG_ENDIAN);
632 offset += 4;
634 for (i=0; i<length; i++) {
635 proto_tree_add_item(Hietree, hf_fmp_sigoffset, tvb, offset, 4, ENC_BIG_ENDIAN);
636 offset += 4;
637 offset = dissect_rpc_string(tvb, Hietree, hf_fmp_dskSigEnt_val, offset, NULL);
641 break;
643 case FMP_DISK_IDENTIFIER_SERIAL:
644 dissect_fmp_devSerial(tvb, offset, NULL, Hietree);
645 break;
648 break;
649 case FMP_VOLUME_SLICE:
650 offset = dissect_rpc_uint32(tvb, Hietree, hf_fmp_volID, offset);
652 offset = dissect_rpc_uint64(tvb, Hietree, hf_fmp_offset64, offset);
654 offset = dissect_rpc_uint64(tvb, Hietree, hf_fmp_slice_size, offset);
656 offset = dissect_rpc_uint32(tvb, Hietree, hf_fmp_volume, offset);
658 break;
660 case FMP_VOLUME_STRIPE:
661 offset = dissect_rpc_uint32(tvb, Hietree, hf_fmp_volID, offset);
663 offset = dissect_rpc_uint64(tvb, Hietree, hf_fmp_stripeSize, offset);
664 length = tvb_get_ntohl(tvb, offset);
665 proto_tree_add_item(Hietree, hf_fmp_length_of_list, tvb, offset, 4, ENC_BIG_ENDIAN);
666 offset += 4;
668 for (i=0; i<length; i++) {
669 offset = dissect_rpc_uint32(tvb, Hietree, hf_fmp_volume, offset); /* FIXME: Size or length not know */
672 break;
674 case FMP_VOLUME_META:
675 offset = dissect_rpc_uint32(tvb, Hietree, hf_fmp_volID, offset);
677 length = tvb_get_ntohl(tvb, offset);
678 proto_tree_add_item(Hietree, hf_fmp_length_of_list, tvb, offset, 4, ENC_BIG_ENDIAN);
679 offset += 4;
680 for (i=0; i<length; i++) {
681 offset = dissect_rpc_uint32(tvb, Hietree, hf_fmp_volume, offset); /* FIXME: Size or length not know */
683 break;
684 default:
685 break;
687 return offset;
691 static int
692 dissect_fmp_Hiervolume(tvbuff_t *tvb, int offset, proto_tree * tree)
695 int vollength;
697 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_topVolumeId, offset);
698 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cursor, offset);
699 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cookie, offset);
701 /* hierarchical description of volume. Each volume describes a
702 piece of the entire hierarchy and is guarenteed to only refer to
703 volumes that have already been described by the data structure up
704 to this point in time. In some extreme cases, the number of
705 volumes and their descriptions may be to large to fit in a single
706 RPC reply. In this case, the application may send getVolumeInfo
707 requests for the specific topVolumeId -- specifying the number of
708 volumes already recieved by the client, and the cookie. The
709 server is then responsible for sending another message containing
710 additional volumes. These RPCs exchanges may continue multiple
711 times, until the client has fetched the entire hierarchical
712 volume description. If the volume hierarchy changes duing a
713 multiple RPC sequence, the server will return an
714 FMP_VOLUME_CHANGED error, and the client must discard all
715 information already received and restart the request with
716 FMP_Mount.
719 vollength = tvb_get_ntohl(tvb, offset);
720 proto_tree_add_item(tree, hf_fmp_length_of_volume_list, tvb, offset, 4, ENC_BIG_ENDIAN);
721 offset += 4;
722 while (vollength) {
723 offset = dissect_fmp_VolumeDescription(tvb, offset, tree);
724 vollength--;
727 return offset;
733 static int
734 dissect_fmp_vmInfo(tvbuff_t *tvb, int offset, packet_info *pinfo,
735 proto_tree *tree)
737 int vmType;
738 guint32 phyVolList_len;
739 guint32 volIndex;
741 vmType = tvb_get_ntohl(tvb, offset);
742 proto_tree_add_item(tree, hf_fmp_volume_mgmt_type, tvb, offset, 4, ENC_BIG_ENDIAN);
744 switch (vmType) {
745 case FMP_SERVER_BASED:
747 * Need to finish
749 phyVolList_len = tvb_get_ntohl(tvb, offset);
750 offset += 4;
753 * Loop through and print all of the devInfo
754 * structures.
756 while (phyVolList_len) {
757 offset =
758 dissect_fmp_devSerial(tvb, offset, pinfo, tree);
759 volIndex = tvb_get_ntohl(tvb, offset);
760 proto_tree_add_text(tree, tvb, offset, 4, "0x%x",
761 volIndex);
762 offset += 4;
763 phyVolList_len--;
765 break;
767 case FMP_THIRD_PARTY:
768 offset = dissect_rpc_string(tvb, tree, hf_fmp_volHandle,
769 offset, NULL);
770 break;
772 case FMP_CLIENT_BASED_DART:
773 offset = dissect_rpc_string(tvb, tree, hf_fmp_volHandle,
774 offset, NULL);
775 break;
777 case FMP_CLIENT_BASED_SIMPLE:
779 * Decoding simpleVolInfo
781 offset = dissect_fmp_devSerial(tvb, offset, pinfo, tree);
783 proto_tree_add_item(tree, hf_fmp_blockindex, tvb, offset, 4, ENC_BIG_ENDIAN);
784 offset += 4;
785 break;
787 case FMP_DISK_SIGNATURE:
788 offset = dissect_InterpretVolMgtStuff(tvb, offset, tree);
789 break;
791 case FMP_HIERARCHICAL_VOLUME:
792 dissect_fmp_Hiervolume(tvb, offset, tree);
793 break;
795 default:
796 break;
799 return offset;
802 static int
803 dissect_fmp_notifyProtocol(tvbuff_t *tvb, int offset, proto_tree *tree)
805 proto_tree_add_item(tree, hf_fmp_notify_protocol, tvb, offset, 4, ENC_BIG_ENDIAN);
806 return (offset+4);
810 static int
811 dissect_fmp_capabilities(tvbuff_t *tvb, int offset, proto_tree *tree)
813 proto_tree *capTree;
814 proto_item *ti;
816 ti = proto_tree_add_text(tree, tvb, offset, 4, "Capabilities");
818 capTree = proto_item_add_subtree(ti, ett_capabilities);
820 proto_tree_add_item(capTree, hf_fmp_cap_revoke_handle_list, tvb, offset, 4, ENC_BIG_ENDIAN);
821 proto_tree_add_item(capTree, hf_fmp_cap_unc_names, tvb, offset, 4, ENC_BIG_ENDIAN);
822 proto_tree_add_item(capTree, hf_fmp_cap_cifsv2, tvb, offset, 4, ENC_BIG_ENDIAN);
823 return (offset+4);
826 static int
827 dissect_fmp_cerrInfo(tvbuff_t *tvb, int offset, proto_tree *tree)
829 int rval;
831 proto_tree_add_item(tree, hf_fmp_client_error_number, tvb, offset, 4, ENC_BIG_ENDIAN);
832 offset += 4;
834 offset = dissect_fmp_status(tvb, offset,tree, &rval);
836 return offset;
839 static int
840 dissect_fmp_attrs(tvbuff_t *tvb, int offset, proto_tree *tree)
842 proto_tree *attrstree;
843 proto_tree *attrsTree;
845 attrstree = proto_tree_add_text(tree, tvb, offset, 84,
846 "Attribute: ");
847 attrsTree = proto_item_add_subtree(attrstree,
848 ett_attrs );
849 offset = dissect_rpc_uint32(tvb, attrsTree, hf_fmp_nfsv3Attr_type, offset);
850 offset = dissect_rpc_uint32(tvb, attrsTree, hf_fmp_nfsv3Attr_mode, offset);
851 offset = dissect_rpc_uint32(tvb, attrsTree, hf_fmp_nfsv3Attr_nlink, offset);
852 offset = dissect_rpc_uint32(tvb, attrsTree, hf_fmp_nfsv3Attr_uid, offset);
853 offset = dissect_rpc_uint32(tvb, attrsTree, hf_fmp_nfsv3Attr_gid, offset);
854 offset = dissect_rpc_uint64(tvb, attrsTree, hf_fmp_fileSize, offset);
855 /* Here hf_fmp_fileSize is used in
856 * place of size
858 offset = dissect_rpc_uint64(tvb, attrsTree, hf_fmp_nfsv3Attr_used, offset);
859 offset = dissect_rpc_uint64(tvb, attrsTree, hf_fmp_nfsv3Attr_rdev, offset);
860 offset = dissect_rpc_uint64(tvb, attrsTree, hf_fmp_nfsv3Attr_fsid, offset);
861 offset = dissect_rpc_uint64(tvb, attrsTree, hf_fmp_nfsv3Attr_fileid, offset);
862 proto_tree_add_text(tree, tvb, offset, 8,"atime: %d.%d seconds",
863 tvb_get_ntohl(tvb, offset),tvb_get_ntohl(tvb, offset+4));
864 offset +=8;
865 proto_tree_add_text(tree, tvb, offset, 8,"mtime: %d.%d seconds",
866 tvb_get_ntohl(tvb, offset),tvb_get_ntohl(tvb, offset+4));
867 offset +=8;
868 proto_tree_add_text(tree, tvb, offset, 8,"ctime: %d.%d seconds",
869 tvb_get_ntohl(tvb, offset),tvb_get_ntohl(tvb, offset+4));
870 offset +=8;
871 return offset;
876 static int
877 dissect_FMP_SessionCreate_request(tvbuff_t *tvb, int offset, packet_info *pinfo,
878 proto_tree *tree, void* data _U_)
880 offset = dissect_rpc_string(tvb, tree, hf_fmp_hostID,
881 offset, NULL);
882 offset = dissect_fmp_timeval(tvb, offset, pinfo, tree, hf_fmp_btime,
883 hf_fmp_time_sec, hf_fmp_time_nsec);
884 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_notifyPort,
885 offset);
886 return offset;
889 static int
890 dissect_FMP_SessionCreate_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
891 proto_tree *tree, void* data _U_)
893 int rval;
895 offset = dissect_fmp_status(tvb, offset,tree, &rval);
896 if (rval == 0) {
897 offset = dissect_rpc_data(tvb, tree,
898 hf_fmp_sessionHandle, offset);
899 offset = dissect_rpc_string(tvb, tree, hf_fmp_hostID,
900 offset, NULL);
901 offset = dissect_fmp_timeval(tvb, offset, pinfo, tree,
902 hf_fmp_btime, hf_fmp_time_sec,
903 hf_fmp_time_nsec);
904 offset = dissect_fmp_heartBeatIntv(tvb, offset, pinfo, tree);
907 return offset;
910 static int
911 dissect_FMP_HeartBeat_request(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
912 proto_tree *tree, void* data _U_)
914 offset = dissect_rpc_data(tvb, tree, hf_fmp_sessionHandle,
915 offset);
917 return offset;
920 static int
921 dissect_FMP_HeartBeat_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
922 proto_tree *tree, void* data _U_)
924 int rval;
925 offset = dissect_fmp_status(tvb, offset,tree, &rval);
926 return offset;
929 static int
930 dissect_FMP_Mount_request(tvbuff_t *tvb, int offset, packet_info *pinfo,
931 proto_tree *tree, void* data _U_)
933 offset = dissect_rpc_data(tvb, tree, hf_fmp_sessionHandle,
934 offset);
935 offset = dissect_fmp_capability(tvb, offset, tree);
936 offset = dissect_fmp_fileHandleSrc(tvb, offset, pinfo, tree);
937 return offset;
940 static int
941 dissect_FMP_Mount_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
942 proto_tree *tree, void* data _U_)
944 int rval;
946 offset = dissect_fmp_status(tvb, offset,tree, &rval);
947 if (rval == 0) {
948 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_fsID,
949 offset);
950 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_fsBlkSz,
951 offset);
952 offset = dissect_fmp_vmInfo(tvb, offset, pinfo, tree);
955 return offset;
958 static int
959 dissect_FMP_Open_request(tvbuff_t *tvb, int offset, packet_info *pinfo,
960 proto_tree *tree, void* data _U_)
962 offset = dissect_rpc_data(tvb, tree, hf_fmp_sessionHandle,
963 offset);
964 offset = dissect_fmp_fileHandleSrc(tvb, offset, pinfo, tree);
965 return offset;
968 static int
969 dissect_FMP_Open_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
970 proto_tree *tree, void* data _U_)
972 int rval;
974 offset = dissect_fmp_status(tvb, offset,tree, &rval);
975 if (rval == 0) {
976 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle,
977 offset);
978 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum,
979 offset);
980 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_fileSize,
981 offset);
983 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_fsID,
984 offset);
986 return offset;
989 static int
990 dissect_FMP_Close_request(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
991 proto_tree *tree, void* data _U_)
993 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle, offset);
994 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
995 return offset;
998 static int
999 dissect_FMP_Close_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1000 proto_tree *tree, void* data _U_)
1002 int rval;
1004 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1005 if (rval == 0) {
1006 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum,
1007 offset);
1010 return offset;
1013 static int
1014 dissect_FMP_OpenGetMap_request(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
1016 offset = dissect_rpc_data(tvb, tree, hf_fmp_sessionHandle,
1017 offset);
1019 offset = dissect_fmp_fileHandleSrc(tvb, offset, pinfo, tree);
1020 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_firstLogBlk,
1021 offset);
1022 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_numBlksReq,
1023 offset);
1024 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_minBlks, offset);
1025 return offset;
1028 static int
1029 dissect_FMP_OpenGetMap_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
1030 proto_tree *tree, void* data _U_)
1032 int rval;
1034 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1035 if (rval == 0) {
1036 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle,
1037 offset);
1038 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum,
1039 offset);
1040 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cookie,
1041 offset);
1042 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_fileSize,
1043 offset);
1044 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_fsID,
1045 offset);
1046 offset = dissect_fmp_extentList(tvb, offset, pinfo, tree);
1049 return offset;
1052 static int
1053 dissect_FMP_OpenAllocSpace_request(tvbuff_t *tvb, int offset,
1054 packet_info *pinfo, proto_tree *tree, void* data _U_)
1056 offset = dissect_rpc_data(tvb , tree, hf_fmp_sessionHandle,
1057 offset);
1058 offset = dissect_fmp_fileHandleSrc(tvb, offset, pinfo, tree);
1059 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_firstLogBlk,
1060 offset);
1061 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_numBlksReq,
1062 offset);
1063 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_minBlks, offset);
1064 return offset;
1067 static int
1068 dissect_FMP_OpenAllocSpace_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
1069 proto_tree *tree, void* data _U_)
1071 int rval;
1073 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1074 if (rval == 0) {
1075 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle,
1076 offset);
1077 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum,
1078 offset);
1079 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cookie,
1080 offset);
1081 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_fileSize,
1082 offset);
1083 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_fsID,
1084 offset);
1085 offset = dissect_fmp_extentList(tvb, offset, pinfo, tree);
1087 return offset;
1090 static int
1091 dissect_FMP_GetMap_request(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1092 proto_tree *tree, void* data _U_)
1094 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle, offset);
1095 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
1096 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_firstLogBlk,
1097 offset);
1098 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_numBlksReq,
1099 offset);
1100 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_minBlks, offset);
1101 return offset;
1104 static int
1105 dissect_FMP_GetMap_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
1106 proto_tree *tree, void* data _U_)
1108 int rval;
1110 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1111 if (rval == 0) {
1112 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum,
1113 offset);
1114 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cookie,
1115 offset);
1116 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_fileSize,
1117 offset);
1118 offset = dissect_fmp_extentList(tvb, offset, pinfo, tree);
1121 return offset;
1124 static int
1125 dissect_FMP_AllocSpace_request(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1126 proto_tree *tree, void* data _U_)
1128 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle, offset);
1129 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
1130 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_firstLogBlk,
1131 offset);
1132 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_numBlksReq,
1133 offset);
1134 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_minBlks, offset);
1135 return offset;
1138 static int
1139 dissect_FMP_AllocSpace_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
1140 proto_tree *tree, void* data _U_)
1142 int rval;
1144 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1145 if (rval == 0) {
1146 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum,
1147 offset);
1148 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cookie,
1149 offset);
1150 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_fileSize,
1151 offset);
1152 offset = dissect_fmp_extentList(tvb, offset, pinfo, tree);
1155 return offset;
1158 static int
1159 dissect_FMP_Flush_request(tvbuff_t *tvb, int offset, packet_info *pinfo,
1160 proto_tree *tree, void* data _U_)
1162 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle, offset);
1163 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
1164 offset = dissect_fmp_flushCmd(tvb, offset, tree);
1165 offset = dissect_rpc_uint64(tvb,tree, hf_fmp_eof, offset);
1166 offset = dissect_fmp_extentList(tvb, offset, pinfo, tree);
1167 return offset;
1170 static int
1171 dissect_FMP_Flush_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1172 proto_tree *tree, void* data _U_)
1174 int rval;
1176 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1177 if (rval == 0) {
1178 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum,
1179 offset);
1181 return offset;
1184 static int
1185 dissect_FMP_CancelReq_request(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1186 proto_tree *tree, void* data _U_)
1188 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle, offset);
1189 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
1190 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cookie, offset);
1191 return offset;
1194 static int
1195 dissect_FMP_CancelReq_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1196 proto_tree *tree, void* data _U_)
1198 int rval;
1200 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1201 if (rval == 0) {
1202 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum,
1203 offset);
1205 return offset;
1208 static int
1209 dissect_FMP_PlugIn_request(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1210 proto_tree *tree, void* data _U_)
1212 offset = dissect_plugInID(tvb, offset, tree);
1213 offset = dissect_rpc_data(tvb, tree, hf_fmp_plugInBuf, offset);
1214 return offset;
1217 static int
1218 dissect_FMP_PlugIn_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1219 proto_tree *tree, void* data _U_)
1221 int rval;
1223 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1224 if (rval == 0) {
1225 offset = dissect_rpc_data(tvb, tree, hf_fmp_plugInBuf,
1226 offset);
1228 return offset;
1231 static int
1232 dissect_FMP_SessionTerminate_request(tvbuff_t *tvb, int offset,
1233 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1235 offset = dissect_rpc_data(tvb, tree, hf_fmp_sessionHandle,
1236 offset);
1237 return offset;
1240 static int
1241 dissect_FMP_SessionTerminate_reply(tvbuff_t *tvb, int offset,
1242 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1244 int rval;
1246 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1247 return offset;
1250 static int
1251 dissect_FMP_SessionCreateEx_request(tvbuff_t *tvb, int offset,packet_info *pinfo, proto_tree *tree, void* data _U_)
1254 offset = dissect_rpc_string(tvb, tree, hf_fmp_hostID,
1255 offset, NULL);
1256 offset = dissect_fmp_timeval(tvb, offset, pinfo ,tree, hf_fmp_btime,
1257 hf_fmp_time_sec, hf_fmp_time_nsec);
1258 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_notifyPort,
1259 offset);
1260 offset = dissect_fmp_notifyProtocol(tvb, offset, tree);
1262 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_os_major,
1263 offset);
1264 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_os_minor,
1265 offset);
1267 offset = dissect_rpc_string(tvb, tree, hf_fmp_os_name,
1268 offset, NULL);
1270 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_os_patch,
1271 offset);
1273 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_os_build,
1274 offset);
1276 offset = dissect_fmp_capabilities(tvb, offset, tree);
1278 return offset;
1282 static int
1283 dissect_FMP_SessionCreateEx_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
1286 int rval;
1288 offset = dissect_fmp_status(tvb, offset, tree, &rval);
1289 if (rval == 0) {
1290 offset = dissect_rpc_data(tvb, tree,
1291 hf_fmp_sessionHandle, offset);
1292 offset = dissect_rpc_string(tvb, tree, hf_fmp_hostID,
1293 offset, NULL);
1294 offset = dissect_fmp_timeval(tvb, offset, pinfo ,tree,
1295 hf_fmp_btime, hf_fmp_time_sec,
1296 hf_fmp_time_nsec);
1297 offset = dissect_fmp_heartBeatIntv(tvb, offset, pinfo , tree);
1299 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_os_major,
1300 offset);
1302 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_os_minor,
1303 offset);
1305 offset = dissect_rpc_string(tvb, tree, hf_fmp_server_version_string,
1306 offset, NULL);
1308 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_os_patch,
1309 offset);
1311 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_os_build,
1312 offset);
1314 offset = dissect_fmp_capabilities(tvb, offset, tree);
1317 return offset;
1321 static int
1322 dissect_FMP_ReportClientError_request(tvbuff_t *tvb, int offset,
1323 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1325 offset = dissect_rpc_string(tvb, tree, hf_fmp_description,
1326 offset, NULL);
1328 offset = dissect_fmp_cerrInfo(tvb, offset, tree);
1329 return offset;
1332 static int
1333 dissect_FMP_ReportClientError_reply(tvbuff_t *tvb, int offset,
1334 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1336 int rval;
1337 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1339 return offset;
1342 static int
1343 dissect_FMP_GetAttr_request(tvbuff_t *tvb, int offset,
1344 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1346 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle, offset);
1348 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
1350 return offset;
1354 static int
1355 dissect_FMP_GetAttr_reply(tvbuff_t *tvb, int offset,
1356 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1358 int rval;
1359 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1360 if (rval == 0) {
1361 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
1363 offset = dissect_fmp_attrs(tvb, offset, tree);
1366 return offset;
1369 static int
1370 dissect_FMP_OpenGetAttr_request(tvbuff_t *tvb, int offset,
1371 packet_info *pinfo, proto_tree *tree, void* data _U_)
1374 offset = dissect_rpc_data(tvb, tree, hf_fmp_sessionHandle,
1375 offset);
1377 offset = dissect_fmp_fileHandleSrc(tvb, offset, pinfo, tree);
1379 return offset;
1383 static int
1384 dissect_FMP_OpenGetAttr_reply(tvbuff_t *tvb, int offset,
1385 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1387 int rval;
1389 offset = dissect_fmp_status(tvb, offset, tree, &rval);
1391 if (rval == 0) {
1392 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle, offset);
1393 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
1394 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_fileSize, offset);
1395 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_fsID, offset);
1396 offset = dissect_fmp_attrs(tvb, offset, tree);
1400 return offset;
1404 static int
1405 dissect_FMP_FlushGetAttr_request(tvbuff_t *tvb, int offset,
1406 packet_info *pinfo, proto_tree *tree, void* data _U_)
1409 offset = dissect_fmp_fileHandleSrc(tvb, offset, pinfo, tree);
1410 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
1411 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cmd, offset);
1412 offset = dissect_rpc_uint64(tvb,tree, hf_fmp_eof, offset);
1414 proto_tree_add_text(tree, tvb, offset, 8,"mtime: %d.%d seconds",
1415 tvb_get_ntohl(tvb, offset),tvb_get_ntohl(tvb, offset+4));
1416 offset += 8;
1417 offset = dissect_fmp_extentList(tvb, offset, pinfo, tree);
1419 return offset;
1423 static int
1424 dissect_FMP_FlushGetAttr_reply(tvbuff_t *tvb, int offset,
1425 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1427 int rval;
1429 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1430 if (rval == 0) {
1431 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
1433 offset = dissect_fmp_attrs(tvb, offset, tree);
1436 return offset;
1440 static int
1441 dissect_FMP_GetVolumeInfo_request(tvbuff_t *tvb, int offset,
1442 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1444 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_topVolumeId, offset);
1445 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cursor, offset);
1446 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cookie, offset);
1447 return offset;
1452 static int
1453 dissect_FMP_GetVolumeInfo_reply(tvbuff_t *tvb, int offset,
1454 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1456 int rval;
1458 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1459 if (rval == 0) {
1460 /* FIXME: I don't know size of this volumes */
1461 offset = dissect_fmp_Hiervolume(tvb,offset, tree);
1463 return offset;
1467 static int
1468 dissect_FMP_OpenGetMapEx_request(tvbuff_t *tvb, int offset,
1469 packet_info *pinfo, proto_tree *tree, void* data _U_)
1471 offset = dissect_rpc_data(tvb, tree, hf_fmp_sessionHandle,
1472 offset);
1473 offset = dissect_fmp_fileHandleSrc(tvb, offset, pinfo, tree);
1474 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_firstLogBlk64, offset);
1475 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_numBlksReq,
1476 offset);
1477 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_minBlks, offset);
1478 return offset;
1482 static int
1483 dissect_FMP_OpenGetMapEx_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1484 proto_tree *tree, void* data _U_)
1486 int rval;
1487 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1488 if (rval == 0) {
1489 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle,
1490 offset);
1491 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum,
1492 offset);
1493 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cookie,
1494 offset);
1495 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_fileSize,
1496 offset);
1497 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_fsID,
1498 offset);
1499 offset = dissect_fmp_extentListEx(tvb, offset, pinfo, tree);
1502 return offset;
1506 static int
1507 dissect_FMP_OpenAllocSpaceEx_request(tvbuff_t *tvb, int offset,
1508 packet_info *pinfo, proto_tree *tree, void* data _U_)
1510 offset = dissect_rpc_data(tvb , tree, hf_fmp_sessionHandle,
1511 offset);
1512 offset = dissect_fmp_fileHandleSrc(tvb, offset, pinfo, tree);
1513 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_firstLogBlk64, offset);
1514 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_numBlksReq,
1515 offset);
1516 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_minBlks, offset);
1517 return offset;
1521 static int
1522 dissect_FMP_OpenAllocSpaceEx_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
1523 proto_tree *tree, void* data _U_)
1525 int rval;
1527 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1528 if (rval == 0) {
1529 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle,
1530 offset);
1531 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum,
1532 offset);
1533 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cookie,
1534 offset);
1535 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_fileSize,
1536 offset);
1537 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_fsID,
1538 offset);
1539 offset = dissect_fmp_extentListEx(tvb, offset, pinfo, tree);
1541 return offset;
1544 static int
1545 dissect_FMP_GetMapEx_request(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1546 proto_tree *tree, void* data _U_)
1548 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle, offset);
1549 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
1550 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_firstLogBlk64, offset);
1551 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_numBlksReq,
1552 offset);
1553 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_minBlks, offset);
1554 return offset;
1558 static int
1559 dissect_FMP_GetMapEx_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
1560 proto_tree *tree, void* data _U_)
1562 int rval;
1564 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1565 if (rval == 0) {
1566 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum,
1567 offset);
1568 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cookie,
1569 offset);
1570 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_fileSize,
1571 offset);
1572 offset = dissect_fmp_extentListEx(tvb, offset, pinfo, tree);
1575 return offset;
1579 static int
1580 dissect_FMP_AllocSpaceEx_request(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1581 proto_tree *tree, void* data _U_)
1583 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle, offset);
1584 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
1585 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_firstLogBlk64, offset);
1586 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_numBlksReq,
1587 offset);
1588 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_minBlks, offset);
1589 return offset;
1593 static int
1594 dissect_FMP_AllocSpaceEx_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
1595 proto_tree *tree, void* data _U_)
1597 int rval;
1599 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1600 if (rval == 0) {
1601 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum,
1602 offset);
1603 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cookie,
1604 offset);
1605 offset = dissect_rpc_uint64(tvb, tree, hf_fmp_fileSize,
1606 offset);
1607 offset = dissect_fmp_extentListEx(tvb, offset, pinfo, tree);
1610 return offset;
1613 static int
1614 dissect_FMP_FlushEx_request(tvbuff_t *tvb, int offset, packet_info *pinfo,
1615 proto_tree *tree, void* data _U_)
1617 offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle, offset);
1618 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
1619 offset = dissect_fmp_flushCmd(tvb, offset, tree);
1620 offset = dissect_rpc_uint64(tvb,tree, hf_fmp_eof, offset);
1621 offset = dissect_fmp_extentListEx(tvb, offset, pinfo, tree);
1622 return offset;
1625 static int
1626 dissect_FMP_FlushEx_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1627 proto_tree *tree, void* data _U_)
1629 int rval;
1631 offset = dissect_fmp_status(tvb, offset,tree, &rval);
1632 if (rval == 0) {
1633 offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum,
1634 offset);
1636 return offset;
1639 * proc number, "proc name", dissect_request, dissect_reply
1640 * NULL as function pointer means: type of arguments is "void".
1642 static const vsff fmp3_proc[] = {
1644 { 1,
1645 "SessionCreate",
1646 dissect_FMP_SessionCreate_request,
1647 dissect_FMP_SessionCreate_reply },
1649 { 2,
1650 "HeartBeat",
1651 dissect_FMP_HeartBeat_request,
1652 dissect_FMP_HeartBeat_reply },
1654 { 3,
1655 "Mount",
1656 dissect_FMP_Mount_request,
1657 dissect_FMP_Mount_reply },
1659 { 4,
1660 "Open",
1661 dissect_FMP_Open_request,
1662 dissect_FMP_Open_reply },
1664 { 5,
1665 "Close",
1666 dissect_FMP_Close_request,
1667 dissect_FMP_Close_reply },
1669 { 6,
1670 "OpenGetMap",
1671 dissect_FMP_OpenGetMap_request,
1672 dissect_FMP_OpenGetMap_reply },
1674 { 7,
1675 "OpenAllocSpace",
1676 dissect_FMP_OpenAllocSpace_request,
1677 dissect_FMP_OpenAllocSpace_reply },
1679 { 8,
1680 "GetMap",
1681 dissect_FMP_GetMap_request,
1682 dissect_FMP_GetMap_reply },
1684 { 9,
1685 "AllocSpace",
1686 dissect_FMP_AllocSpace_request,
1687 dissect_FMP_AllocSpace_reply },
1689 { 10,
1690 "Flush",
1691 dissect_FMP_Flush_request,
1692 dissect_FMP_Flush_reply },
1694 { 11,
1695 "CancelReq",
1696 dissect_FMP_CancelReq_request,
1697 dissect_FMP_CancelReq_reply },
1699 { 12,
1700 "PlugIn",
1701 dissect_FMP_PlugIn_request,
1702 dissect_FMP_PlugIn_reply },
1704 { 13,
1705 "SessionTerminate",
1706 dissect_FMP_SessionTerminate_request,
1707 dissect_FMP_SessionTerminate_reply },
1709 { 14,
1710 "SessionCreateEx",
1711 dissect_FMP_SessionCreateEx_request,
1712 dissect_FMP_SessionCreateEx_reply },
1714 { 15,
1715 "ReportClientError",
1716 dissect_FMP_ReportClientError_request,
1717 dissect_FMP_ReportClientError_reply },
1719 { 16 ,
1720 "Get Attribute",
1721 dissect_FMP_GetAttr_request,
1722 dissect_FMP_GetAttr_reply },
1724 { 17 ,
1725 "Open Get Attribute",
1726 dissect_FMP_OpenGetAttr_request,
1727 dissect_FMP_OpenGetAttr_reply },
1729 { 18 ,
1730 "Flush Get Attribute",
1731 dissect_FMP_FlushGetAttr_request,
1732 dissect_FMP_FlushGetAttr_reply },
1734 { 19 ,
1735 "OpenGetMapEx",
1736 dissect_FMP_OpenGetMapEx_request,
1737 dissect_FMP_OpenGetMapEx_reply },
1739 { 20 ,
1740 "OpenAllocSpaceEx",
1741 dissect_FMP_OpenAllocSpaceEx_request,
1742 dissect_FMP_OpenAllocSpaceEx_reply },
1744 { 21 ,
1745 "GetMapEx",
1746 dissect_FMP_GetMapEx_request,
1747 dissect_FMP_GetMapEx_reply },
1749 { 22 ,
1750 "AllocSpaceEx",
1751 dissect_FMP_AllocSpaceEx_request,
1752 dissect_FMP_AllocSpaceEx_reply },
1754 { 23 ,
1755 "FMP_FlushEx",
1756 dissect_FMP_FlushEx_request,
1757 dissect_FMP_FlushEx_reply },
1758 #if 0
1760 { 24 ,
1761 "FlushGetAttrEx",
1762 dissect_FMP_FlushGetAttrEx_request,
1763 dissect_FMP_FlushGetAttrEx_reply },
1765 #endif
1767 { 25 ,
1768 "GetVolumeInfo",
1769 dissect_FMP_GetVolumeInfo_request,
1770 dissect_FMP_GetVolumeInfo_reply },
1773 {0 , NULL , NULL , NULL }
1778 static const value_string fmp_proc_vals[] = {
1779 { 0, "NULL" },
1780 { 1, "SessionCreate" },
1781 { 2, "HeartBeat" },
1782 { 3, "Mount" },
1783 { 4, "Open" },
1784 { 5, "Close" },
1785 { 6, "OpenGetMap" },
1786 { 7, "OpenAllocSpace" },
1787 { 8, "GetMap" },
1788 { 9, "AllocSpace " },
1789 { 10, "Flush" },
1790 { 11, "CancelReq" },
1791 { 12, "PlugIn" },
1792 { 13, "SessionTerminate" },
1793 { 14, "SessionCreateEx" },
1794 { 15, "ReportClientError" },
1795 { 16, "GetAttr " },
1796 { 17, "OpenGetAttr" },
1797 { 18, "FlushGetAttr"},
1798 { 19, "OpenGetMapEx"},
1799 { 20, "OpenAllocSpaceEx"},
1800 { 21, "GetMapEx"},
1801 { 22, "AllocSpaceEx"},
1802 { 23, "FlushEx"},
1803 { 24, "FlushGetAttrEx"},
1804 { 25, "GetVolumeInfo"},
1805 { 0,NULL }
1809 static const value_string fmp_status_vals[] = {
1810 { 0, "OK"},
1811 { 5, "IOERROR"},
1812 { 12, "NOMEM"},
1813 { 13, "NOACCESS"},
1814 { 22, "INVALIDARG"},
1815 { 28, "FSFULL"},
1816 { 79, "QUEUE_FULL"},
1817 {500, "WRONG_MSG_NUM"},
1818 {501, "SESSION_LOST"},
1819 {502, "HOT_SESSION"},
1820 {503, "COLD_SESSION"},
1821 {504, "CLIENT_TERMINATED"},
1822 {505, "WRITER_LOST_BLK"},
1823 {506, "FMP_REQUEST_QUEUED"},
1824 {507, "FMP_FALL_BACK"},
1825 {508, "REQUEST_CANCELLED"},
1826 {509, "WRITER_ZEROED_BLK"},
1827 {510, "NOTIFY_ERROR"},
1828 {511, "FMP_WRONG_HANDLE"},
1829 {512, "DUPLICATE_OPEN"},
1830 {600, "PLUGIN_NOFUNC"},
1831 {0,NULL}
1835 static const value_string fmp_extentState_vals[] = {
1836 {0,"VALID_DATA"},
1837 {1,"INVALID_DATA"},
1838 {2,"NONE_DATA"},
1839 {0,NULL}
1842 static const value_string fmp_native_protocol_vals[] = {
1843 {FMP_PATH, "PATH"},
1844 {FMP_NFS, "NFS"},
1845 {FMP_CIFS, "CIFS"},
1846 {FMP_FMP, "FMP"},
1847 {FMP_FS_ONLY, "FS_ONLY"},
1848 {FMP_SHARE, "SHARE"},
1849 {FMP_MOUNT, "MOUNT"},
1850 {FMP_CIFSV2, "CIFSV2"},
1851 {FMP_UNC,"UNC"},
1852 {0,NULL}
1855 static const value_string fmp_volume_mgmt_capability_vals[] = {
1856 {FMP_SERVER_BASED, "SERVER_BASED"},
1857 {FMP_THIRD_PARTY, "THIRD_PARTY"},
1858 {FMP_CLIENT_BASED_DART, "CLIENT_BASED_DART"},
1859 {FMP_CLIENT_BASED_SIMPLE, "CLIENT_BASED_SIMPLE"},
1860 {FMP_HIERARCHICAL_VOLUME, "FMP_HIERARCHICAL_VOLUME"},
1861 {0,NULL}
1864 static const value_string fmp_query_cmd_vals[] = {
1865 {FMP_SCSI_INQUIRY, "SCSI_INQUIRY"},
1866 {FMP_DART_STAMP, "DART_STAMP"},
1867 {0,NULL}
1870 static const value_string fmp_volume_desc_vals[] = {
1871 {FMP_VOLUME_DISK, "DISK"},
1872 {FMP_VOLUME_SLICE, "SLICE"},
1873 {FMP_VOLUME_STRIPE, "STRIPE"},
1874 {FMP_VOLUME_META, "META"},
1875 {FMP_VOLUME_SLICE, "SLICE"},
1876 {FMP_VOLUME_SLICE, "SLICE"},
1877 {0,NULL}
1880 static const value_string fmp_disk_identifier_vals[] = {
1881 {FMP_DISK_IDENTIFIER_SIGNATURE, "SIGNATURE"},
1882 {FMP_DISK_IDENTIFIER_SERIAL, "SERIAL"},
1883 {0,NULL}
1886 static const value_string fmp_notify_protocol_vals[] = {
1887 {FMP_TCP, "TCP"},
1888 {FMP_UDP, "UDP"},
1889 {0,NULL}
1892 static const value_string fmp_volume_mgmt_type_vals[] = {
1893 {FMP_SERVER_BASED, "SERVER_BASED"},
1894 {FMP_THIRD_PARTY, "THIRD_PARTY"},
1895 {FMP_CLIENT_BASED_DART, "CLIENT_BASED_DART"},
1896 {FMP_CLIENT_BASED_SIMPLE, "CLIENT_BASED_SIMPLE"},
1897 {FMP_DISK_SIGNATURE, "DISK_SIGNATURE"},
1898 {FMP_HIERARCHICAL_VOLUME, "HIERARCHICAL_VOLUME"},
1899 {0,NULL}
1902 static const value_string fmp_client_error_number_vals[] = {
1903 {FMP_CE_GENERIC, "FMP_CE_GENERIC"},
1904 {FMP_CE_DISK_ERROR, "FMP_CE_DISK_ERROR"},
1905 {0,NULL}
1908 void
1909 proto_register_fmp(void)
1911 static hf_register_info hf[] = {
1912 { &hf_fmp_procedure,
1913 { "Procedure", "fmp.procedure",
1914 FT_UINT32, BASE_DEC, VALS(fmp_proc_vals),
1915 0, NULL, HFILL }}, /* New addition */
1917 { &hf_fmp_hostID,
1918 { "Host ID", "fmp.hostID",
1919 FT_STRING, BASE_NONE, NULL, 0,
1920 NULL, HFILL }},
1922 { &hf_fmp_btime,
1923 { "Boot Time", "fmp.btime",
1924 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
1925 "Machine Boot Time", HFILL }},
1927 { &hf_fmp_time_sec,
1928 { "seconds", "fmp.btime.sec",
1929 FT_UINT32, BASE_DEC, NULL, 0,
1930 NULL, HFILL }},
1932 { &hf_fmp_time_nsec,
1933 { "nanoseconds", "fmp.btime.nsec",
1934 FT_UINT32, BASE_DEC, NULL, 0,
1935 NULL, HFILL }},
1937 { &hf_fmp_notifyPort,
1938 { "Notify Port", "fmp.notifyPort",
1939 FT_UINT32, BASE_DEC, NULL, 0,
1940 NULL, HFILL }},
1942 { &hf_fmp_sessionHandle,
1943 { "Session Handle", "fmp.sessHandle",
1944 FT_BYTES, BASE_NONE, NULL, 0,
1945 NULL, HFILL }},
1947 { &hf_fmp_fmpFHandle,
1948 { "FMP File Handle", "fmp.fmpFHandle",
1949 FT_BYTES, BASE_NONE, NULL, 0,
1950 NULL,
1952 HFILL }},
1953 { &hf_fmp_nfsFHandle,
1954 { "NFS File Handle", "fmp.nfsFHandle",
1955 FT_BYTES, BASE_NONE, NULL, 0,
1956 NULL, HFILL }},
1958 { &hf_fmp_fsID,
1959 { "File System ID", "fmp.fsID",
1960 FT_UINT32, BASE_HEX, NULL, 0,
1961 NULL, HFILL }},
1963 { &hf_fmp_status,
1964 { "Status", "fmp.status",
1965 FT_UINT32, BASE_DEC, VALS(fmp_status_vals), 0,
1966 "Reply Status", HFILL }},
1968 { &hf_fmp_fsBlkSz,
1969 { "File System Block Size", "fmp.fsBlkSz",
1970 FT_UINT32, BASE_DEC, NULL, 0,
1971 NULL, HFILL }},
1973 { &hf_fmp_volHandle,
1974 { "Volume Handle", "fmp.volHandle",
1975 FT_STRING, BASE_NONE, NULL, 0,
1976 NULL, HFILL }},
1978 { &hf_fmp_dskSigEnt_val,
1979 { "Celerra Signature", "fmp.dsi.ds.dsList.dskSigLst_val.dse.dskSigEnt_val",
1980 FT_STRING, BASE_NONE, NULL, 0,
1981 NULL, HFILL }},
1983 { &hf_fmp_devSignature,
1984 { "Signature DATA", "fmp.devSig",
1985 FT_STRING, BASE_NONE, NULL, 0,
1986 NULL, HFILL }},
1988 { &hf_fmp_mount_path,
1989 { "Native Protocol: PATH", "fmp.mount_path",
1990 FT_STRING, BASE_NONE, NULL, 0,
1991 "Absolute path from the root on the server side", HFILL }},
1993 { &hf_fmp_sig_offset,
1994 { "Sig Offset", "fmp.dsi.ds.sig_offset",
1995 FT_UINT64, BASE_DEC, NULL, 0,
1996 NULL, HFILL }},
1998 { &hf_fmp_numBlksReq,
1999 { "Extent Length", "fmp.numBlksReq",
2000 FT_UINT32, BASE_DEC, NULL, 0,
2001 NULL, HFILL }},
2003 { &hf_fmp_minBlks,
2004 { "Minimum Blocks to Grant", "fmp.minBlks",
2005 FT_UINT32, BASE_DEC, NULL, 0,
2006 NULL, HFILL }},
2008 { &hf_fmp_msgNum,
2009 { "Message Number", "fmp.msgNum",
2010 FT_UINT32, BASE_DEC, NULL, 0,
2011 NULL, HFILL }},
2013 { &hf_fmp_cookie,
2014 { "Cookie", "fmp.cookie",
2015 FT_UINT32, BASE_HEX, NULL, 0,
2016 "Cookie for FMP_REQUEST_QUEUED Resp", HFILL }},
2018 { &hf_fmp_fileSize,
2019 { "File Size", "fmp.fileSize",
2020 FT_UINT64, BASE_DEC, NULL, 0,
2021 NULL, HFILL }},
2023 { &hf_fmp_extentList_len,
2024 { "Extent List Length", "fmp.extentList_len",
2025 FT_UINT32, BASE_DEC, NULL, 0,
2026 NULL, HFILL }},
2028 { &hf_fmp_extent_state,
2029 { "Extent State", "fmp.extentState",
2030 FT_UINT32,BASE_DEC, VALS(fmp_extentState_vals), 0,
2031 NULL, HFILL }},
2033 { &hf_fmp_firstLogBlk,
2034 { "First Logical File Block", "fmp.firstLogBlk",
2035 FT_UINT32, BASE_DEC, NULL, 0,
2036 NULL, HFILL }},
2038 { &hf_fmp_numBlks,
2039 { "Number of Blocks", "fmp.numBlks",
2040 FT_UINT32, BASE_DEC, NULL, 0,
2041 NULL, HFILL }},
2043 { &hf_fmp_volID,
2044 { "Volume ID inside DART", "fmp.volID",
2045 FT_UINT32, BASE_HEX, NULL, 0,
2046 NULL, HFILL }},
2048 { &hf_fmp_startOffset,
2049 { "Start Offset", "fmp.startOffset",
2050 FT_UINT32, BASE_DEC, NULL, 0,
2051 NULL, HFILL }},
2053 { &hf_fmp_start_offset64,
2054 { "Start offset", "fmp.start_offset64",
2055 FT_UINT64, BASE_DEC, NULL, 0,
2056 "Start Offset of extentEx", HFILL }},
2058 { &hf_fmp_eof,
2059 { "EOF", "fmp.eof",
2060 FT_UINT64, BASE_DEC, NULL, 0,
2061 "End Of File", HFILL }},
2063 { &hf_fmp_plugInID,
2064 { "Plug In Cmd ID", "fmp.plugInID",
2065 FT_BYTES, BASE_NONE, NULL, 0,
2066 NULL, HFILL }},
2068 { &hf_fmp_plugInBuf,
2069 { "Plug In Args", "fmp.plugIn",
2070 FT_BYTES, BASE_NONE, NULL, 0,
2071 NULL, HFILL }},
2073 { &hf_fmp_os_major,
2074 { "OS Major", "fmp.os_major",
2075 FT_UINT32, BASE_DEC, NULL, 0,
2076 NULL, HFILL }},
2078 { &hf_fmp_os_minor,
2079 { "OS Minor", "fmp.os_minor",
2080 FT_UINT32, BASE_DEC, NULL, 0,
2081 NULL, HFILL }},
2083 { &hf_fmp_os_name,
2084 { "OS Name", "fmp.os_name",
2085 FT_STRING, BASE_NONE, NULL, 0,
2086 NULL, HFILL }},
2088 { &hf_fmp_path,
2089 { "Mount Path", "fmp.Path",
2090 FT_STRING, BASE_NONE, NULL, 0,
2091 NULL, HFILL }},
2093 { &hf_fmp_os_patch,
2094 { "OS Path", "fmp.os_patch",
2095 FT_UINT32, BASE_DEC, NULL, 0,
2096 NULL, HFILL }},
2098 { &hf_fmp_os_build,
2099 { "OS Build", "fmp.os_build",
2100 FT_UINT32, BASE_DEC, NULL, 0,
2101 NULL, HFILL }},
2103 { &hf_fmp_server_version_string,
2104 { "Server Version String", "fmp.server_version_string",
2105 FT_STRING, BASE_NONE, NULL, 0,
2106 NULL, HFILL }},
2108 { &hf_fmp_description,
2109 { "Error Description", "fmp.description",
2110 FT_STRING, BASE_NONE, NULL, 0,
2111 "Client Error Description", HFILL }},
2113 { &hf_fmp_nfsv3Attr_type,
2114 { "Type", "fmp.nfsv3Attr_type",
2115 FT_UINT32, BASE_DEC, NULL, 0,
2116 "NFSV3 Attr Type", HFILL }},
2118 { &hf_fmp_nfsv3Attr_mode,
2119 { "Mode", "fmp.nfsv3Attr_mod",
2120 FT_UINT32, BASE_DEC, NULL, 0,
2121 NULL, HFILL }},
2123 { &hf_fmp_nfsv3Attr_nlink,
2124 { "nlink", "fmp.nfsv3Attr_nlink",
2125 FT_UINT32, BASE_DEC, NULL, 0,
2126 NULL, HFILL }},
2128 { &hf_fmp_nfsv3Attr_uid,
2129 { "uid", "fmp.nfsv3Attr_uid",
2130 FT_UINT32, BASE_DEC, NULL, 0,
2131 NULL, HFILL }},
2133 { &hf_fmp_nfsv3Attr_gid,
2134 { "gid", "fmp.nfsv3Attr_gid",
2135 FT_UINT32, BASE_DEC, NULL, 0,
2136 NULL, HFILL }},
2138 /* for nfsv3Attr_size use hf_fmp_fileSize */
2139 { &hf_fmp_nfsv3Attr_used,
2140 { "Used", "fmp.nfsv3Attr_used",
2141 FT_UINT64, BASE_DEC, NULL, 0,
2142 NULL, HFILL }},
2144 { &hf_fmp_nfsv3Attr_rdev,
2145 { "rdev", "fmp.nfsv3Attr_rdev",
2146 FT_UINT64, BASE_DEC, NULL, 0,
2147 NULL, HFILL }},
2149 { &hf_fmp_nfsv3Attr_fsid,
2150 { "fsid", "fmp.nfsv3Attr_fsid",
2151 FT_UINT64, BASE_DEC, NULL, 0,
2152 NULL, HFILL }},
2154 { &hf_fmp_nfsv3Attr_fileid,
2155 { "File ID", "fmp.nfsv3Attr_fileid",
2156 FT_UINT64, BASE_DEC, NULL, 0,
2157 NULL, HFILL }},
2159 { &hf_fmp_cmd,
2160 { "Command", "fmp.cmd",
2161 FT_UINT32, BASE_DEC, NULL, 0,
2162 NULL, HFILL }},
2164 { &hf_fmp_topVolumeId,
2165 { "Top Volume ID", "fmp.topVolumeId",
2166 FT_UINT32, BASE_HEX, NULL, 0,
2167 NULL, HFILL }},
2169 { &hf_fmp_cursor,
2170 { "number of volumes", "fmp.cursor",
2171 FT_UINT32, BASE_DEC, NULL, 0,
2172 NULL, HFILL }},
2174 { &hf_fmp_offset64,
2175 { "offset", "fmp.offset64",
2176 FT_UINT64, BASE_DEC, NULL, 0,
2177 NULL, HFILL }},
2179 { &hf_fmp_slice_size,
2180 { "size of the slice", "fmp.slice_size",
2181 FT_UINT64, BASE_DEC, NULL, 0,
2182 NULL, HFILL }},
2184 { &hf_fmp_volume,
2185 { "Volume ID's", "fmp.volume",
2186 FT_UINT32, BASE_HEX, NULL, 0,
2187 NULL, HFILL }},
2189 { &hf_fmp_stripeSize,
2190 { "size of the stripe", "fmp.stripeSize",
2191 FT_UINT64, BASE_DEC, NULL, 0,
2192 NULL, HFILL }},
2194 { &hf_fmp_firstLogBlk64,
2195 { "First Logical Block", "fmp.firstLogBlk64",
2196 FT_UINT64, BASE_DEC, NULL, 0,
2197 NULL, HFILL }},
2199 { &hf_fmp_native_protocol,
2200 { "Native Protocol", "fmp.native_protocol",
2201 FT_UINT32, BASE_DEC, VALS(fmp_native_protocol_vals), 0,
2202 NULL, HFILL }},
2204 { &hf_fmp_encoding_mode,
2205 { "Encoding Mode", "fmp.encoding_mode",
2206 FT_UINT32, BASE_DEC, VALS(fmp_encoding_mode_vals), 0,
2207 NULL, HFILL }},
2209 { &hf_fmp_capability,
2210 { "Volume Mgmt Capability", "fmp.capability",
2211 FT_UINT32, BASE_DEC, VALS(fmp_volume_mgmt_capability_vals), 0,
2212 NULL, HFILL }},
2214 { &hf_fmp_devSerial_query_cmd,
2215 { "Query Command", "fmp.devSerial.query_cmd",
2216 FT_UINT32, BASE_DEC, VALS(fmp_query_cmd_vals), 0,
2217 NULL, HFILL }},
2219 { &hf_fmp_volume_desc,
2220 { "VOLUME", "fmp.volume_desc",
2221 FT_UINT32, BASE_DEC, VALS(fmp_volume_desc_vals), 0,
2222 NULL, HFILL }},
2224 { &hf_fmp_disk_identifier,
2225 { "DISK IDENTIFIER", "fmp.disk_identifier",
2226 FT_UINT32, BASE_DEC, VALS(fmp_disk_identifier_vals), 0,
2227 NULL, HFILL }},
2229 { &hf_fmp_volume_mgmt_type,
2230 { "Volume Mgmt Type", "fmp.volume_mgmt_type",
2231 FT_UINT32, BASE_DEC, VALS(fmp_volume_mgmt_type_vals), 0,
2232 NULL, HFILL }},
2234 { &hf_fmp_notify_protocol,
2235 { "Protocol", "fmp.notify_protocol",
2236 FT_UINT32, BASE_DEC, VALS(fmp_notify_protocol_vals), 0,
2237 NULL, HFILL }},
2239 { &hf_fmp_client_error_number,
2240 { "CLIENT Error Number", "fmp.client_error_number",
2241 FT_UINT32, BASE_DEC, VALS(fmp_client_error_number_vals), 0,
2242 NULL, HFILL }},
2244 /* Generated from convert_proto_tree_add_text.pl */
2245 { &hf_fmp_fid, { "fid", "fmp.fid", FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2246 { &hf_fmp_tid, { "tid", "fmp.tid", FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2247 { &hf_fmp_uid, { "uid", "fmp.uid", FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2248 { &hf_fmp_fsid, { "FsID", "fmp.fsid", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2249 { &hf_fmp_cifsport, { "cifsPort", "fmp.cifsport", FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2250 { &hf_fmp_number_of_disk, { "Number of Disk", "fmp.number_of_disk", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2251 { &hf_fmp_length_of_list, { "Length of List", "fmp.length_of_list", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2252 { &hf_fmp_sigoffset, { "sigOffset", "fmp.sigoffset", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2253 { &hf_fmp_length_of_volume_list, { "Length of volume List", "fmp.length_of_volume_list", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2254 { &hf_fmp_blockindex, { "blockIndex", "fmp.blockindex", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2255 { &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 }},
2256 { &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 }},
2257 { &hf_fmp_cap_cifsv2, { "CAP_CIFSV2", "fmp.cap_cifsv2", FT_BOOLEAN, 32, TFS(&tfs_yes_no), FMP_CAP_CIFSV2, NULL, HFILL }},
2260 static gint *ett[] = {
2261 &ett_fmp,
2262 &ett_fmp_timeval,
2263 &ett_fmp_extList,
2264 &ett_fmp_ext,
2265 &ett_fmp_fileHandle,
2266 &ett_capabilities,
2267 &ett_HierVolumeDescription,
2268 &ett_attrs
2271 module_t *fmp_module;
2272 proto_fmp = proto_register_protocol("File Mapping Protocol", "FMP", "fmp");
2274 proto_register_field_array(proto_fmp, hf, array_length(hf));
2275 proto_register_subtree_array(ett, array_length(ett));
2277 fmp_module=prefs_register_protocol(proto_fmp, NULL);
2279 prefs_register_bool_preference(fmp_module, "fhandle_find_both_reqrep",
2280 "Fhandle filters finds both request/response",
2281 "With this option display filters for fmp fhandle a RPC call,"
2282 " even if the actual fhandle is only present in one of the packets",
2283 &fmp_fhandle_reqrep_matching);
2287 void
2288 proto_reg_handoff_fmp(void)
2290 /* Register the protocol as RPC */
2291 rpc_init_prog(proto_fmp, FMP_PROGRAM, ett_fmp);
2293 /* Register the procedure tables */
2294 rpc_init_proc_table(FMP_PROGRAM, FMP_VERSION_3, fmp3_proc, hf_fmp_procedure);