2 * Routines for NDMP dissection
3 * 2001 Ronnie Sahlberg (see AUTHORS for email)
5 * $Id: packet-ndmp.c,v 1.25 2003/12/27 04:01:17 guy Exp $
7 * Ethereal - Network traffic analyzer
8 * By Gerald Combs <gerald@ethereal.com>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 /* see www.ndmp.org for protocol specifications.
27 this file implements version 3 of ndmp
38 #include <epan/packet.h>
39 #include <epan/conversation.h>
40 #include "packet-rpc.h"
41 #include "packet-scsi.h"
42 #include "packet-frame.h"
44 #include "reassemble.h"
45 #include "rpc_defrag.h"
47 #define TCP_PORT_NDMP 10000
49 static int proto_ndmp = -1;
50 static int hf_ndmp_version = -1;
51 static int hf_ndmp_header = -1;
52 static int hf_ndmp_sequence = -1;
53 static int hf_ndmp_reply_sequence = -1;
54 static int hf_ndmp_timestamp = -1;
55 static int hf_ndmp_msgtype = -1;
56 static int hf_ndmp_msg = -1;
57 static int hf_ndmp_error = -1;
58 static int hf_ndmp_hostname = -1;
59 static int hf_ndmp_os_type = -1;
60 static int hf_ndmp_os_vers = -1;
61 static int hf_ndmp_hostid = -1;
62 static int hf_ndmp_addr_types = -1;
63 static int hf_ndmp_addr_type = -1;
64 static int hf_ndmp_auth_type = -1;
65 static int hf_ndmp_auth_types = -1;
66 static int hf_ndmp_auth_challenge = -1;
67 static int hf_ndmp_auth_digest = -1;
68 static int hf_ndmp_auth_id = -1;
69 static int hf_ndmp_auth_password = -1;
70 static int hf_ndmp_butype_info = -1;
71 static int hf_ndmp_butype_name = -1;
72 static int hf_ndmp_butype_default_env = -1;
73 static int hf_ndmp_butype_attr_backup_file_history = -1;
74 static int hf_ndmp_butype_attr_backup_filelist = -1;
75 static int hf_ndmp_butype_attr_recover_filelist = -1;
76 static int hf_ndmp_butype_attr_backup_direct = -1;
77 static int hf_ndmp_butype_attr_recover_direct = -1;
78 static int hf_ndmp_butype_attr_backup_incremental = -1;
79 static int hf_ndmp_butype_attr_recover_incremental = -1;
80 static int hf_ndmp_butype_attr_backup_utf8 = -1;
81 static int hf_ndmp_butype_attr_recover_utf8 = -1;
82 static int hf_ndmp_butype_env_name = -1;
83 static int hf_ndmp_butype_env_value = -1;
84 static int hf_ndmp_fs_info = -1;
85 static int hf_ndmp_fs_invalid_total_size = -1;
86 static int hf_ndmp_fs_invalid_used_size = -1;
87 static int hf_ndmp_fs_invalid_avail_size = -1;
88 static int hf_ndmp_fs_invalid_total_inodes = -1;
89 static int hf_ndmp_fs_invalid_used_inodes = -1;
90 static int hf_ndmp_fs_fs_type = -1;
91 static int hf_ndmp_fs_logical_device = -1;
92 static int hf_ndmp_fs_physical_device = -1;
93 static int hf_ndmp_fs_total_size = -1;
94 static int hf_ndmp_fs_used_size = -1;
95 static int hf_ndmp_fs_avail_size = -1;
96 static int hf_ndmp_fs_total_inodes = -1;
97 static int hf_ndmp_fs_used_inodes = -1;
98 static int hf_ndmp_fs_env = -1;
99 static int hf_ndmp_fs_env_name = -1;
100 static int hf_ndmp_fs_env_value = -1;
101 static int hf_ndmp_fs_status = -1;
102 static int hf_ndmp_tape_info = -1;
103 static int hf_ndmp_tape_model = -1;
104 static int hf_ndmp_tape_dev_cap = -1;
105 static int hf_ndmp_tape_device = -1;
106 static int hf_ndmp_tape_open_mode = -1;
107 static int hf_ndmp_tape_attr_rewind = -1;
108 static int hf_ndmp_tape_attr_unload = -1;
109 static int hf_ndmp_tape_capability = -1;
110 static int hf_ndmp_tape_capability_name = -1;
111 static int hf_ndmp_tape_capability_value = -1;
112 static int hf_ndmp_scsi_info = -1;
113 static int hf_ndmp_scsi_model = -1;
114 static int hf_ndmp_server_vendor = -1;
115 static int hf_ndmp_server_product = -1;
116 static int hf_ndmp_server_revision = -1;
117 static int hf_ndmp_scsi_device = -1;
118 static int hf_ndmp_scsi_controller = -1;
119 static int hf_ndmp_scsi_id = -1;
120 static int hf_ndmp_scsi_lun = -1;
121 static int hf_ndmp_execute_cdb_flags_data_in = -1;
122 static int hf_ndmp_execute_cdb_flags_data_out = -1;
123 static int hf_ndmp_execute_cdb_timeout = -1;
124 static int hf_ndmp_execute_cdb_datain_len = -1;
125 static int hf_ndmp_execute_cdb_cdb_len = -1;
126 static int hf_ndmp_execute_cdb_dataout = -1;
127 static int hf_ndmp_execute_cdb_status = -1;
128 static int hf_ndmp_execute_cdb_dataout_len = -1;
129 static int hf_ndmp_execute_cdb_datain = -1;
130 static int hf_ndmp_execute_cdb_sns_len = -1;
131 static int hf_ndmp_tape_invalid_file_num = -1;
132 static int hf_ndmp_tape_invalid_soft_errors = -1;
133 static int hf_ndmp_tape_invalid_block_size = -1;
134 static int hf_ndmp_tape_invalid_block_no = -1;
135 static int hf_ndmp_tape_invalid_total_space = -1;
136 static int hf_ndmp_tape_invalid_space_remain = -1;
137 static int hf_ndmp_tape_invalid_partition = -1;
138 static int hf_ndmp_tape_flags_no_rewind = -1;
139 static int hf_ndmp_tape_flags_write_protect = -1;
140 static int hf_ndmp_tape_flags_error = -1;
141 static int hf_ndmp_tape_flags_unload = -1;
142 static int hf_ndmp_tape_file_num = -1;
143 static int hf_ndmp_tape_soft_errors = -1;
144 static int hf_ndmp_tape_block_size = -1;
145 static int hf_ndmp_tape_block_no = -1;
146 static int hf_ndmp_tape_total_space = -1;
147 static int hf_ndmp_tape_space_remain = -1;
148 static int hf_ndmp_tape_partition = -1;
149 static int hf_ndmp_tape_mtio_op = -1;
150 static int hf_ndmp_count = -1;
151 static int hf_ndmp_resid_count = -1;
152 static int hf_ndmp_mover_state = -1;
153 static int hf_ndmp_mover_pause = -1;
154 static int hf_ndmp_halt = -1;
155 static int hf_ndmp_halt_reason = -1;
156 static int hf_ndmp_record_size = -1;
157 static int hf_ndmp_record_num = -1;
158 static int hf_ndmp_data_written = -1;
159 static int hf_ndmp_seek_position = -1;
160 static int hf_ndmp_bytes_left_to_read = -1;
161 static int hf_ndmp_window_offset = -1;
162 static int hf_ndmp_window_length = -1;
163 static int hf_ndmp_addr_ip = -1;
164 static int hf_ndmp_addr_tcp = -1;
165 static int hf_ndmp_addr_fcal_loop_id = -1;
166 static int hf_ndmp_addr_ipc = -1;
167 static int hf_ndmp_mover_mode = -1;
168 static int hf_ndmp_file_name = -1;
169 static int hf_ndmp_nt_file_name = -1;
170 static int hf_ndmp_dos_file_name = -1;
171 static int hf_ndmp_log_type = -1;
172 static int hf_ndmp_log_message_id = -1;
173 static int hf_ndmp_log_message = -1;
174 static int hf_ndmp_connected = -1;
175 static int hf_ndmp_connected_reason = -1;
176 static int hf_ndmp_data = -1;
177 static int hf_ndmp_files = -1;
178 static int hf_ndmp_file_fs_type = -1;
179 static int hf_ndmp_file_names = -1;
180 static int hf_ndmp_file_stats = -1;
181 static int hf_ndmp_file_node = -1;
182 static int hf_ndmp_file_parent = -1;
183 static int hf_ndmp_file_fh_info = -1;
184 static int hf_ndmp_file_invalid_atime = -1;
185 static int hf_ndmp_file_invalid_ctime = -1;
186 static int hf_ndmp_file_invalid_group = -1;
187 static int hf_ndmp_file_type = -1;
188 static int hf_ndmp_file_mtime = -1;
189 static int hf_ndmp_file_atime = -1;
190 static int hf_ndmp_file_ctime = -1;
191 static int hf_ndmp_file_owner = -1;
192 static int hf_ndmp_file_group = -1;
193 static int hf_ndmp_file_fattr = -1;
194 static int hf_ndmp_file_size = -1;
195 static int hf_ndmp_file_links = -1;
196 static int hf_ndmp_dirs = -1;
197 static int hf_ndmp_nodes = -1;
198 static int hf_ndmp_nlist = -1;
199 static int hf_ndmp_bu_original_path = -1;
200 static int hf_ndmp_bu_destination_dir = -1;
201 static int hf_ndmp_bu_new_name = -1;
202 static int hf_ndmp_bu_other_name = -1;
203 static int hf_ndmp_state_invalid_ebr = -1;
204 static int hf_ndmp_state_invalid_etr = -1;
205 static int hf_ndmp_bu_operation = -1;
206 static int hf_ndmp_data_state = -1;
207 static int hf_ndmp_data_halted = -1;
208 static int hf_ndmp_data_bytes_processed = -1;
209 static int hf_ndmp_data_est_bytes_remain = -1;
210 static int hf_ndmp_data_est_time_remain = -1;
212 static gint ett_ndmp = -1;
213 static gint ett_ndmp_header = -1;
214 static gint ett_ndmp_butype_attrs = -1;
215 static gint ett_ndmp_fs_invalid = -1;
216 static gint ett_ndmp_tape_attr = -1;
217 static gint ett_ndmp_execute_cdb_flags = -1;
218 static gint ett_ndmp_execute_cdb_cdb = -1;
219 static gint ett_ndmp_execute_cdb_sns = -1;
220 static gint ett_ndmp_execute_cdb_payload = -1;
221 static gint ett_ndmp_tape_invalid = -1;
222 static gint ett_ndmp_tape_flags = -1;
223 static gint ett_ndmp_addr = -1;
224 static gint ett_ndmp_file = -1;
225 static gint ett_ndmp_file_name = -1;
226 static gint ett_ndmp_file_stats = -1;
227 static gint ett_ndmp_file_invalids = -1;
228 static gint ett_ndmp_state_invalids = -1;
239 /* desegmentation of NDMP packets */
240 static gboolean ndmp_desegment = TRUE;
242 /* defragmentation of fragmented NDMP records */
243 static gboolean ndmp_defragment = FALSE;
245 #define NDMP_MESSAGE_REQUEST 0x00
246 #define NDMP_MESSAGE_REPLY 0x01
247 static const value_string msg_type_vals[] = {
248 {NDMP_MESSAGE_REQUEST, "Request"},
249 {NDMP_MESSAGE_REPLY, "Reply"},
253 #define NDMP_NO_ERR 0x00
254 #define NDMP_NOT_SUPPORTED_ERR 0x01
255 #define NDMP_DEVICE_BUSY_ERR 0x02
256 #define NDMP_DEVICE_OPENED_ERR 0x03
257 #define NDMP_NOT_AUTHORIZED_ERR 0x04
258 #define NDMP_PERMISSION_ERR 0x05
259 #define NDMP_DEV_NOT_OPEN_ERR 0x06
260 #define NDMP_IO_ERR 0x07
261 #define NDMP_TIMEOUT_ERR 0x08
262 #define NDMP_ILLEGAL_ARGS_ERR 0x09
263 #define NDMP_NO_TAPE_LOADED_ERR 0x0a
264 #define NDMP_WRITE_PROTECT_ERR 0x0b
265 #define NDMP_EOF_ERR 0x0c
266 #define NDMP_EOM_ERR 0x0d
267 #define NDMP_FILE_NOT_FOUND_ERR 0x0e
268 #define NDMP_BAD_FILE_ERR 0x0f
269 #define NDMP_NO_DEVICE_ERR 0x10
270 #define NDMP_NO_BUS_ERR 0x11
271 #define NDMP_XDR_DECODE_ERR 0x12
272 #define NDMP_ILLEGAL_STATE_ERR 0x13
273 #define NDMP_UNDEFINED_ERR 0x14
274 #define NDMP_XDR_ENCODE_ERR 0x15
275 #define NDMP_NO_MEM_ERR 0x16
276 #define NDMP_CONNECT_ERR 0x17
278 static const value_string error_vals[] = {
279 {NDMP_NO_ERR, "NO_ERR"},
280 {NDMP_NOT_SUPPORTED_ERR, "NOT_SUPPORTED_ERR"},
281 {NDMP_DEVICE_BUSY_ERR, "DEVICE_BUSY_ERR"},
282 {NDMP_DEVICE_OPENED_ERR, "DEVICE_OPENED_ERR"},
283 {NDMP_NOT_AUTHORIZED_ERR, "NOT_AUTHORIZED_ERR"},
284 {NDMP_PERMISSION_ERR, "PERMISSION_ERR"},
285 {NDMP_DEV_NOT_OPEN_ERR, "DEV_NOT_OPEN_ERR"},
286 {NDMP_IO_ERR, "IO_ERR"},
287 {NDMP_TIMEOUT_ERR, "TIMEOUT_ERR"},
288 {NDMP_ILLEGAL_ARGS_ERR, "ILLEGAL_ARGS_ERR"},
289 {NDMP_NO_TAPE_LOADED_ERR, "NO_TAPE_LOADED_ERR"},
290 {NDMP_WRITE_PROTECT_ERR, "WRITE_PROTECT_ERR"},
291 {NDMP_EOF_ERR, "EOF_ERR"},
292 {NDMP_EOM_ERR, "EOM_ERR"},
293 {NDMP_FILE_NOT_FOUND_ERR, "FILE_NOT_FOUND_ERR"},
294 {NDMP_BAD_FILE_ERR, "BAD_FILE_ERR"},
295 {NDMP_NO_DEVICE_ERR, "NO_DEVICE_ERR"},
296 {NDMP_NO_BUS_ERR, "NO_BUS_ERR"},
297 {NDMP_XDR_DECODE_ERR, "XDR_DECODE_ERR"},
298 {NDMP_ILLEGAL_STATE_ERR, "ILLEGAL_STATE_ERR"},
299 {NDMP_UNDEFINED_ERR, "UNDEFINED_ERR"},
300 {NDMP_XDR_ENCODE_ERR, "XDR_ENCODE_ERR"},
301 {NDMP_NO_MEM_ERR, "NO_MEM_ERR"},
302 {NDMP_CONNECT_ERR, "CONNECT_ERR"},
308 #define NDMP_CONFIG_GET_HOST_INFO 0x100
309 #define NDMP_CONFIG_GET_CONNECTION_TYPE 0x102
310 #define NDMP_CONFIG_GET_AUTH_ATTR 0x103
311 #define NDMP_CONFIG_GET_BUTYPE_INFO 0x104
312 #define NDMP_CONFIG_GET_FS_INFO 0x105
313 #define NDMP_CONFIG_GET_TAPE_INFO 0x106
314 #define NDMP_CONFIG_GET_SCSI_INFO 0x107
315 #define NDMP_CONFIG_GET_SERVER_INFO 0x108
316 #define NDMP_SCSI_OPEN 0x200
317 #define NDMP_SCSI_CLOSE 0x201
318 #define NDMP_SCSI_GET_STATE 0x202
319 #define NDMP_SCSI_SET_TARGET 0x203
320 #define NDMP_SCSI_RESET_DEVICE 0x204
321 #define NDMP_SCSI_RESET_BUS 0x205
322 #define NDMP_SCSI_EXECUTE_CDB 0x206
323 #define NDMP_TAPE_OPEN 0x300
324 #define NDMP_TAPE_CLOSE 0x301
325 #define NDMP_TAPE_GET_STATE 0x302
326 #define NDMP_TAPE_MTIO 0x303
327 #define NDMP_TAPE_WRITE 0x304
328 #define NDMP_TAPE_READ 0x305
329 #define NDMP_TAPE_EXECUTE_CDB 0x307
330 #define NDMP_DATA_GET_STATE 0x400
331 #define NDMP_DATA_START_BACKUP 0x401
332 #define NDMP_DATA_START_RECOVER 0x402
333 #define NDMP_DATA_ABORT 0x403
334 #define NDMP_DATA_GET_ENV 0x404
335 #define NDMP_DATA_STOP 0x407
336 #define NDMP_DATA_LISTEN 0x409
337 #define NDMP_DATA_CONNECT 0x40a
338 #define NDMP_NOTIFY_DATA_HALTED 0x501
339 #define NDMP_NOTIFY_CONNECTED 0x502
340 #define NDMP_NOTIFY_MOVER_HALTED 0x503
341 #define NDMP_NOTIFY_MOVER_PAUSED 0x504
342 #define NDMP_NOTIFY_DATA_READ 0x505
343 #define NDMP_LOG_FILE 0x602
344 #define NDMP_LOG_MESSAGE 0x603
345 #define NDMP_FH_ADD_FILE 0x703
346 #define NDMP_FH_ADD_DIR 0x704
347 #define NDMP_FH_ADD_NODE 0x705
348 #define NDMP_CONNECT_OPEN 0x900
349 #define NDMP_CONNECT_CLIENT_AUTH 0x901
350 #define NDMP_CONNECT_CLOSE 0x902
351 #define NDMP_CONNECT_SERVER_AUTH 0x903
352 #define NDMP_MOVER_GET_STATE 0xa00
353 #define NDMP_MOVER_LISTEN 0xa01
354 #define NDMP_MOVER_CONTINUE 0xa02
355 #define NDMP_MOVER_ABORT 0xa03
356 #define NDMP_MOVER_STOP 0xa04
357 #define NDMP_MOVER_SET_WINDOW 0xa05
358 #define NDMP_MOVER_READ 0xa06
359 #define NDMP_MOVER_CLOSE 0xa07
360 #define NDMP_MOVER_SET_RECORD_SIZE 0xa08
361 #define NDMP_MOVER_CONNECT 0xa09
366 static const value_string msg_vals[] = {
367 {NDMP_CONFIG_GET_HOST_INFO, "CONFIG_GET_HOST_INFO"},
368 {NDMP_CONFIG_GET_CONNECTION_TYPE, "CONFIG_GET_CONNECTION_TYPE"},
369 {NDMP_CONFIG_GET_AUTH_ATTR, "CONFIG_GET_AUTH_ATTR"},
370 {NDMP_CONFIG_GET_BUTYPE_INFO, "CONFIG_GET_BUTYPE_INFO"},
371 {NDMP_CONFIG_GET_FS_INFO, "CONFIG_GET_FS_INFO"},
372 {NDMP_CONFIG_GET_TAPE_INFO, "CONFIG_GET_TAPE_INFO"},
373 {NDMP_CONFIG_GET_SCSI_INFO, "CONFIG_GET_SCSI_INFO"},
374 {NDMP_CONFIG_GET_SERVER_INFO, "CONFIG_GET_SERVER_INFO"},
375 {NDMP_SCSI_OPEN, "SCSI_OPEN"},
376 {NDMP_SCSI_CLOSE, "SCSI_CLOSE"},
377 {NDMP_SCSI_GET_STATE, "SCSI_GET_STATE"},
378 {NDMP_SCSI_SET_TARGET, "SCSI_SET_TARGET"},
379 {NDMP_SCSI_RESET_DEVICE, "SCSI_RESET_DEVICE"},
380 {NDMP_SCSI_RESET_BUS, "SCSI_RESET_BUS"},
381 {NDMP_SCSI_EXECUTE_CDB, "SCSI_EXECUTE_CDB"},
382 {NDMP_TAPE_OPEN, "TAPE_OPEN"},
383 {NDMP_TAPE_CLOSE, "TAPE_CLOSE"},
384 {NDMP_TAPE_GET_STATE, "TAPE_GET_STATE"},
385 {NDMP_TAPE_MTIO, "TAPE_MTIO"},
386 {NDMP_TAPE_WRITE, "TAPE_WRITE"},
387 {NDMP_TAPE_READ, "TAPE_READ"},
388 {NDMP_TAPE_EXECUTE_CDB, "TAPE_EXECUTE_CDB"},
389 {NDMP_DATA_GET_STATE, "DATA_GET_STATE"},
390 {NDMP_DATA_START_BACKUP, "DATA_START_BACKUP"},
391 {NDMP_DATA_START_RECOVER, "DATA_START_RECOVER"},
392 {NDMP_DATA_ABORT, "DATA_ABORT"},
393 {NDMP_DATA_GET_ENV, "DATA_GET_ENV"},
394 {NDMP_DATA_STOP, "DATA_STOP"},
395 {NDMP_DATA_LISTEN, "DATA_LISTEN"},
396 {NDMP_DATA_CONNECT, "DATA_CONNECT"},
397 {NDMP_NOTIFY_DATA_HALTED, "NOTIFY_DATA_HALTED"},
398 {NDMP_NOTIFY_CONNECTED, "NOTIFY_CONNECTED"},
399 {NDMP_NOTIFY_MOVER_HALTED, "NOTIFY_MOVER_HALTED"},
400 {NDMP_NOTIFY_MOVER_PAUSED, "NOTIFY_MOVER_PAUSED"},
401 {NDMP_NOTIFY_DATA_READ, "NOTIFY_DATA_READ"},
402 {NDMP_LOG_FILE, "LOG_FILE"},
403 {NDMP_LOG_MESSAGE, "LOG_MESSAGE"},
404 {NDMP_FH_ADD_FILE, "FH_ADD_FILE"},
405 {NDMP_FH_ADD_DIR, "FH_ADD_DIR"},
406 {NDMP_FH_ADD_NODE, "FH_ADD_NODE"},
407 {NDMP_CONNECT_OPEN, "CONNECT_OPEN"},
408 {NDMP_CONNECT_CLIENT_AUTH, "CONNECT_CLIENT_AUTH"},
409 {NDMP_CONNECT_CLOSE, "CONNECT_CLOSE"},
410 {NDMP_CONNECT_SERVER_AUTH, "CONNECT_SERVER_AUTH"},
411 {NDMP_MOVER_GET_STATE, "MOVER_GET_STATE"},
412 {NDMP_MOVER_LISTEN, "MOVER_LISTEN"},
413 {NDMP_MOVER_CONTINUE, "MOVER_CONTINUE"},
414 {NDMP_MOVER_ABORT, "MOVER_ABORT"},
415 {NDMP_MOVER_STOP, "MOVER_STOP"},
416 {NDMP_MOVER_SET_WINDOW, "MOVER_SET_WINDOW"},
417 {NDMP_MOVER_READ, "MOVER_READ"},
418 {NDMP_MOVER_CLOSE, "MOVER_CLOSE"},
419 {NDMP_MOVER_SET_RECORD_SIZE, "MOVER_SET_RECORD_SIZE"},
420 {NDMP_MOVER_CONNECT, "MOVER_CONNECT"},
425 dissect_connect_open_request(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
426 proto_tree *tree, guint32 seq _U_)
429 proto_tree_add_item(tree, hf_ndmp_version, tvb, offset, 4, FALSE);
436 dissect_error(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
437 proto_tree *tree, guint32 seq _U_)
440 proto_tree_add_item(tree, hf_ndmp_error, tvb, offset, 4, FALSE);
447 dissect_ndmp_get_host_info_reply(tvbuff_t *tvb, int offset,
448 packet_info *pinfo _U_, proto_tree *tree, guint32 seq _U_)
451 proto_tree_add_item(tree, hf_ndmp_error, tvb, offset, 4, FALSE);
455 offset = dissect_rpc_string(tvb, tree,
456 hf_ndmp_hostname, offset, NULL);
459 offset = dissect_rpc_string(tvb, tree,
460 hf_ndmp_os_type, offset, NULL);
463 offset = dissect_rpc_string(tvb, tree,
464 hf_ndmp_os_vers, offset, NULL);
467 offset = dissect_rpc_string(tvb, tree,
468 hf_ndmp_hostid, offset, NULL);
473 #define NDMP_ADDR_LOCAL 0
474 #define NDMP_ADDR_TCP 1
475 #define NDMP_ADDR_FC 2
476 #define NDMP_ADDR_IPC 3
477 static const value_string addr_type_vals[] = {
478 {NDMP_ADDR_LOCAL, "Local"},
479 {NDMP_ADDR_TCP, "TCP"},
480 {NDMP_ADDR_FC, "FC"},
481 {NDMP_ADDR_IPC, "IPC"},
486 dissect_ndmp_addr_type(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
489 proto_tree_add_item(tree, hf_ndmp_addr_type, tvb, offset, 4, FALSE);
496 dissect_ndmp_addr_msg(tvbuff_t *tvb, int offset, packet_info *pinfo,
497 proto_tree *tree, guint32 seq _U_)
500 return dissect_ndmp_addr_type(tvb, offset, pinfo, tree);
504 dissect_ndmp_config_get_connection_type_reply(tvbuff_t *tvb, int offset,
505 packet_info *pinfo, proto_tree *tree, guint32 seq _U_)
508 proto_tree_add_item(tree, hf_ndmp_error, tvb, offset, 4, FALSE);
512 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
513 dissect_ndmp_addr_type, hf_ndmp_addr_types);
518 #define NDMP_AUTH_NONE 0
519 #define NDMP_AUTH_TEXT 1
520 #define NDMP_AUTH_MD5 2
521 static const value_string auth_type_vals[] = {
522 {NDMP_AUTH_NONE, "None"},
523 {NDMP_AUTH_TEXT, "Text"},
524 {NDMP_AUTH_MD5, "MD5"},
528 dissect_auth_type(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
531 proto_tree_add_item(tree, hf_ndmp_auth_type, tvb, offset, 4, FALSE);
538 dissect_get_auth_type_request(tvbuff_t *tvb, int offset, packet_info *pinfo,
539 proto_tree *tree, guint32 seq _U_)
542 return dissect_auth_type(tvb, offset, pinfo, tree);
546 dissect_auth_attr_msg(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
547 proto_tree *tree, guint32 seq _U_)
551 type=tvb_get_ntohl(tvb,offset);
554 proto_tree_add_item(tree, hf_ndmp_auth_type, tvb, offset, 4, FALSE);
563 proto_tree_add_item(tree, hf_ndmp_auth_challenge,
564 tvb, offset, 64, FALSE);
572 dissect_default_env(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
576 offset = dissect_rpc_string(tvb, tree,
577 hf_ndmp_butype_env_name, offset, NULL);
580 offset = dissect_rpc_string(tvb, tree,
581 hf_ndmp_butype_env_value, offset, NULL);
587 static const true_false_string tfs_butype_attr_backup_file_history = {
588 "Backup FILE HISTORY",
589 "Do NOT backup file history"
591 static const true_false_string tfs_butype_attr_backup_filelist = {
593 "Do NOT backup filelist"
595 static const true_false_string tfs_butype_attr_recover_filelist = {
597 "Do NOT recover filelist"
599 static const true_false_string tfs_butype_attr_backup_direct = {
600 "Perform DIRECT backup",
601 "Do NOT perform direct backup"
603 static const true_false_string tfs_butype_attr_recover_direct = {
604 "Perform DIRECT recovery",
605 "Do NOT perform direct recovery"
607 static const true_false_string tfs_butype_attr_backup_incremental = {
608 "Perform INCREMENTAL backup",
609 "Perform FULL backup"
611 static const true_false_string tfs_butype_attr_recover_incremental = {
612 "Perform INCREMENTAL revocery",
613 "Perform FULL recovery"
615 static const true_false_string tfs_butype_attr_backup_utf8 = {
617 "Normal backup. Do NOT use utf8"
619 static const true_false_string tfs_butype_attr_recover_utf8 = {
620 "Recover using UTF8",
621 "Normal recover. Do NOT use utf8"
624 dissect_butype_attrs(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
625 proto_tree *parent_tree)
627 proto_item* item = NULL;
628 proto_tree* tree = NULL;
631 flags=tvb_get_ntohl(tvb, offset);
633 item = proto_tree_add_text(parent_tree, tvb, offset, 4,
634 "Attributes: 0x%08x", flags);
635 tree = proto_item_add_subtree(item, ett_ndmp_butype_attrs);
638 proto_tree_add_boolean(tree, hf_ndmp_butype_attr_recover_utf8,
639 tvb, offset, 4, flags);
640 proto_tree_add_boolean(tree, hf_ndmp_butype_attr_backup_utf8,
641 tvb, offset, 4, flags);
642 proto_tree_add_boolean(tree, hf_ndmp_butype_attr_recover_incremental,
643 tvb, offset, 4, flags);
644 proto_tree_add_boolean(tree, hf_ndmp_butype_attr_backup_incremental,
645 tvb, offset, 4, flags);
646 proto_tree_add_boolean(tree, hf_ndmp_butype_attr_recover_direct,
647 tvb, offset, 4, flags);
648 proto_tree_add_boolean(tree, hf_ndmp_butype_attr_backup_direct,
649 tvb, offset, 4, flags);
650 proto_tree_add_boolean(tree, hf_ndmp_butype_attr_recover_filelist,
651 tvb, offset, 4, flags);
652 proto_tree_add_boolean(tree, hf_ndmp_butype_attr_backup_filelist,
653 tvb, offset, 4, flags);
654 proto_tree_add_boolean(tree, hf_ndmp_butype_attr_backup_file_history,
655 tvb, offset, 4, flags);
662 dissect_butype_info(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
665 offset = dissect_rpc_string(tvb, tree,
666 hf_ndmp_butype_name, offset, NULL);
669 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
670 dissect_default_env, hf_ndmp_butype_default_env);
673 offset = dissect_butype_attrs(tvb, offset, pinfo, tree);
679 dissect_get_butype_info_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
680 proto_tree *tree, guint32 seq _U_)
683 proto_tree_add_item(tree, hf_ndmp_error, tvb, offset, 4, FALSE);
687 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
688 dissect_butype_info, hf_ndmp_butype_info);
693 static const true_false_string tfs_fs_invalid_total_size = {
694 "Total size is INVALID",
695 "Total size is VALID"
697 static const true_false_string tfs_fs_invalid_used_size = {
698 "Used size is INVALID",
701 static const true_false_string tfs_fs_invalid_avail_size = {
702 "Available size is INVALID",
703 "Available size is VALID"
705 static const true_false_string tfs_fs_invalid_total_inodes = {
706 "Total inode count is INVALID",
707 "Total inode count is VALID"
709 static const true_false_string tfs_fs_invalid_used_inodes = {
710 "Used inode count is INVALID",
711 "Used inode count is VALID"
714 dissect_fs_invalid(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
715 proto_tree *parent_tree)
717 proto_item* item = NULL;
718 proto_tree* tree = NULL;
721 flags=tvb_get_ntohl(tvb, offset);
723 item = proto_tree_add_text(parent_tree, tvb, offset, 4,
724 "Invalids: 0x%08x", flags);
725 tree = proto_item_add_subtree(item, ett_ndmp_fs_invalid);
728 proto_tree_add_boolean(tree, hf_ndmp_fs_invalid_used_inodes,
729 tvb, offset, 4, flags);
730 proto_tree_add_boolean(tree, hf_ndmp_fs_invalid_total_inodes,
731 tvb, offset, 4, flags);
732 proto_tree_add_boolean(tree, hf_ndmp_fs_invalid_avail_size,
733 tvb, offset, 4, flags);
734 proto_tree_add_boolean(tree, hf_ndmp_fs_invalid_used_size,
735 tvb, offset, 4, flags);
736 proto_tree_add_boolean(tree, hf_ndmp_fs_invalid_total_size,
737 tvb, offset, 4, flags);
744 dissect_fs_env(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
748 offset = dissect_rpc_string(tvb, tree,
749 hf_ndmp_fs_env_name, offset, NULL);
752 offset = dissect_rpc_string(tvb, tree,
753 hf_ndmp_fs_env_value, offset, NULL);
759 dissect_fs_info(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
762 offset=dissect_fs_invalid(tvb, offset, pinfo, tree);
765 offset = dissect_rpc_string(tvb, tree,
766 hf_ndmp_fs_fs_type, offset, NULL);
768 /* fs logical device */
769 offset = dissect_rpc_string(tvb, tree,
770 hf_ndmp_fs_logical_device, offset, NULL);
772 /* fs physical device */
773 offset = dissect_rpc_string(tvb, tree,
774 hf_ndmp_fs_physical_device, offset, NULL);
777 offset = dissect_rpc_uint64(tvb, tree, hf_ndmp_fs_total_size,
781 offset = dissect_rpc_uint64(tvb, tree, hf_ndmp_fs_used_size,
785 offset = dissect_rpc_uint64(tvb, tree, hf_ndmp_fs_avail_size,
789 offset = dissect_rpc_uint64(tvb, tree, hf_ndmp_fs_total_inodes,
793 offset = dissect_rpc_uint64(tvb, tree, hf_ndmp_fs_used_inodes,
797 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
798 dissect_fs_env, hf_ndmp_fs_env);
801 offset = dissect_rpc_string(tvb, tree,
802 hf_ndmp_fs_status, offset, NULL);
808 dissect_get_fs_info_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
809 proto_tree *tree, guint32 seq _U_)
812 proto_tree_add_item(tree, hf_ndmp_error, tvb, offset, 4, FALSE);
816 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
817 dissect_fs_info, hf_ndmp_fs_info);
822 static const true_false_string tfs_tape_attr_rewind = {
823 "Device supports REWIND",
824 "Device does NOT support rewind"
826 static const true_false_string tfs_tape_attr_unload = {
827 "Device supports UNLOAD",
828 "Device does NOT support unload"
831 dissect_tape_attr(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
832 proto_tree *parent_tree)
834 proto_item* item = NULL;
835 proto_tree* tree = NULL;
838 flags=tvb_get_ntohl(tvb, offset);
840 item = proto_tree_add_text(parent_tree, tvb, offset, 4,
841 "Attributes: 0x%08x", flags);
842 tree = proto_item_add_subtree(item, ett_ndmp_tape_attr);
845 proto_tree_add_boolean(tree, hf_ndmp_tape_attr_unload,
846 tvb, offset, 4, flags);
847 proto_tree_add_boolean(tree, hf_ndmp_tape_attr_rewind,
848 tvb, offset, 4, flags);
855 dissect_tape_capability(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
859 offset = dissect_rpc_string(tvb, tree,
860 hf_ndmp_tape_capability_name, offset, NULL);
863 offset = dissect_rpc_string(tvb, tree,
864 hf_ndmp_tape_capability_value, offset, NULL);
870 dissect_tape_dev_cap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
873 offset = dissect_rpc_string(tvb, tree,
874 hf_ndmp_tape_device, offset, NULL);
876 /* tape attributes */
877 offset = dissect_tape_attr(tvb, offset, pinfo, tree);
880 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
881 dissect_tape_capability, hf_ndmp_tape_capability);
887 dissect_tape_info(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
890 offset = dissect_rpc_string(tvb, tree,
891 hf_ndmp_tape_model, offset, NULL);
893 /* device capabilites */
894 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
895 dissect_tape_dev_cap, hf_ndmp_tape_dev_cap);
901 dissect_get_tape_info_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
902 proto_tree *tree, guint32 seq _U_)
905 proto_tree_add_item(tree, hf_ndmp_error, tvb, offset, 4, FALSE);
909 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
910 dissect_tape_info, hf_ndmp_tape_info);
916 dissect_scsi_info(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
919 offset = dissect_rpc_string(tvb, tree,
920 hf_ndmp_scsi_model, offset, NULL);
922 /* device capabilites */
923 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
924 dissect_tape_dev_cap, hf_ndmp_tape_dev_cap);
930 dissect_get_scsi_info_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
931 proto_tree *tree, guint32 seq _U_)
934 proto_tree_add_item(tree, hf_ndmp_error, tvb, offset, 4, FALSE);
938 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
939 dissect_scsi_info, hf_ndmp_scsi_info);
945 dissect_get_server_info_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
946 proto_tree *tree, guint32 seq _U_)
949 proto_tree_add_item(tree, hf_ndmp_error, tvb, offset, 4, FALSE);
953 offset = dissect_rpc_string(tvb, tree,
954 hf_ndmp_server_vendor, offset, NULL);
957 offset = dissect_rpc_string(tvb, tree,
958 hf_ndmp_server_product, offset, NULL);
961 offset = dissect_rpc_string(tvb, tree,
962 hf_ndmp_server_revision, offset, NULL);
966 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
967 dissect_auth_type, hf_ndmp_auth_types);
973 dissect_scsi_open_request(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
974 proto_tree *tree, guint32 seq _U_)
977 offset = dissect_rpc_string(tvb, tree,
978 hf_ndmp_scsi_device, offset, NULL);
984 dissect_scsi_get_state_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
985 proto_tree *tree, guint32 seq _U_)
988 proto_tree_add_item(tree, hf_ndmp_error, tvb, offset, 4, FALSE);
992 proto_tree_add_item(tree, hf_ndmp_scsi_controller, tvb, offset, 4, FALSE);
996 proto_tree_add_item(tree, hf_ndmp_scsi_id, tvb, offset, 4, FALSE);
1000 proto_tree_add_item(tree, hf_ndmp_scsi_lun, tvb, offset, 4, FALSE);
1007 dissect_scsi_set_state_request(tvbuff_t *tvb, int offset,
1008 packet_info *pinfo _U_, proto_tree *tree, guint32 seq _U_)
1011 offset = dissect_rpc_string(tvb, tree,
1012 hf_ndmp_scsi_device, offset, NULL);
1015 proto_tree_add_item(tree, hf_ndmp_scsi_controller, tvb, offset, 4, FALSE);
1019 proto_tree_add_item(tree, hf_ndmp_scsi_id, tvb, offset, 4, FALSE);
1023 proto_tree_add_item(tree, hf_ndmp_scsi_lun, tvb, offset, 4, FALSE);
1030 dissect_execute_cdb_flags(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1031 proto_tree *parent_tree)
1033 proto_item* item = NULL;
1034 proto_tree* tree = NULL;
1037 flags = tvb_get_ntohl(tvb, offset);
1039 item = proto_tree_add_text(parent_tree, tvb, offset, 4,
1040 "Flags: 0x%08x", flags);
1041 tree = proto_item_add_subtree(item, ett_ndmp_execute_cdb_flags);
1044 proto_tree_add_boolean(tree, hf_ndmp_execute_cdb_flags_data_in,
1045 tvb, offset, 4, flags);
1046 proto_tree_add_boolean(tree, hf_ndmp_execute_cdb_flags_data_out,
1047 tvb, offset, 4, flags);
1053 dissect_execute_cdb_cdb(tvbuff_t *tvb, int offset, packet_info *pinfo,
1054 proto_tree *parent_tree, gint devtype)
1056 proto_item* item = NULL;
1057 proto_tree* tree = NULL;
1059 guint32 cdb_len_full;
1061 cdb_len = tvb_get_ntohl(tvb, offset);
1062 cdb_len_full = rpc_roundup(cdb_len);
1065 item = proto_tree_add_text(parent_tree, tvb, offset,
1066 4+cdb_len_full, "CDB");
1067 tree = proto_item_add_subtree(item, ett_ndmp_execute_cdb_cdb);
1070 proto_tree_add_uint(tree, hf_ndmp_execute_cdb_cdb_len, tvb, offset, 4,
1075 dissect_scsi_cdb(tvb, pinfo, tree, offset, cdb_len, devtype);
1076 offset += cdb_len_full;
1084 dissect_execute_cdb_payload(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree,
1085 char *name, int hf_len, gboolean isreq)
1087 proto_item* item = NULL;
1088 proto_tree* tree = NULL;
1089 guint32 payload_len;
1090 guint32 payload_len_full;
1092 payload_len = tvb_get_ntohl(tvb, offset);
1093 payload_len_full = rpc_roundup(payload_len);
1096 item = proto_tree_add_text(parent_tree, tvb, offset,
1097 4+payload_len_full, "%s", name);
1098 tree = proto_item_add_subtree(item,
1099 ett_ndmp_execute_cdb_payload);
1102 proto_tree_add_uint(tree, hf_len, tvb, offset, 4, payload_len);
1105 if (payload_len != 0) {
1106 dissect_scsi_payload(tvb, pinfo, tree, offset, isreq,
1108 offset += payload_len_full;
1115 * XXX - we assume that NDMP_SCSI_EXECUTE_CDB requests only go to SCSI Media
1116 * Changer devices and NDMP_TAPE_EXECUTE_CDB only go to SCSI Sequential
1119 * If that's not the case, we'll have to use the SCSI dissector's mechanisms
1120 * for saving inquiry data for devices, and use inquiry data when available.
1121 * Unfortunately, that means we need to save the name of the device, and
1122 * use it as a device identifier; as the name isn't available in the
1123 * NDMP_SCSI_EXECUTE_CDB or NDMP_TAPE_EXECUTE_CDB messages, that means
1124 * we need to remember the currently-opened "SCSI" and "TAPE" devices
1125 * from NDMP_SCSI_OPEN and NDMP_TAPE_OPEN, and attach to all frames
1126 * that are the ones that trigger the dissection of NDMP_SCSI_EXECUTE_CDB
1127 * or NDMP_TAPE_EXECUTE_CDB requests pointers to those names.
1130 dissect_execute_cdb_request(tvbuff_t *tvb, int offset, packet_info *pinfo,
1131 proto_tree *tree, guint32 seq, gint devtype)
1133 conversation_t *conversation;
1134 scsi_task_id_t task_key;
1137 * We need to provide SCSI task information to the SCSI
1138 * dissection routines. We use a conversation plus the
1139 * sequence number in requests and the reply sequence
1140 * number in replies to identify SCSI tasks.
1142 conversation = find_conversation(&pinfo->src, &pinfo->dst,
1143 pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
1144 if (conversation == NULL) {
1145 conversation = conversation_new(&pinfo->src, &pinfo->dst,
1146 pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
1148 task_key.conv_id = conversation->index;
1149 task_key.task_id = seq;
1150 pinfo->private_data = &task_key;
1153 offset = dissect_execute_cdb_flags(tvb, offset, pinfo, tree);
1156 proto_tree_add_item(tree, hf_ndmp_execute_cdb_timeout, tvb, offset, 4, FALSE);
1160 proto_tree_add_item(tree, hf_ndmp_execute_cdb_datain_len, tvb, offset, 4, FALSE);
1164 offset = dissect_execute_cdb_cdb(tvb, offset, pinfo, tree, devtype);
1167 offset = dissect_execute_cdb_payload(tvb, offset, pinfo, tree,
1168 "Data out", hf_ndmp_execute_cdb_dataout_len, TRUE);
1174 dissect_execute_cdb_request_mc(tvbuff_t *tvb, int offset, packet_info *pinfo,
1175 proto_tree *tree, guint32 seq)
1177 return dissect_execute_cdb_request(tvb, offset, pinfo, tree, seq,
1182 dissect_execute_cdb_request_tape(tvbuff_t *tvb, int offset, packet_info *pinfo,
1183 proto_tree *tree, guint32 seq)
1185 return dissect_execute_cdb_request(tvb, offset, pinfo, tree, seq,
1190 dissect_execute_cdb_sns(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree)
1192 proto_item* item = NULL;
1193 proto_tree* tree = NULL;
1195 guint32 sns_len_full;
1197 sns_len = tvb_get_ntohl(tvb, offset);
1198 sns_len_full = rpc_roundup(sns_len);
1201 item = proto_tree_add_text(parent_tree, tvb, offset,
1202 4+sns_len_full, "Sense data");
1203 tree = proto_item_add_subtree(item, ett_ndmp_execute_cdb_sns);
1206 proto_tree_add_uint(tree, hf_ndmp_execute_cdb_sns_len, tvb, offset, 4,
1211 dissect_scsi_snsinfo(tvb, pinfo, tree, offset, sns_len);
1212 offset += sns_len_full;
1219 dissect_execute_cdb_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
1220 proto_tree *tree, guint32 seq)
1222 conversation_t *conversation;
1223 scsi_task_id_t task_key;
1226 * We need to provide SCSI task information to the SCSI
1227 * dissection routines. We use a conversation plus the
1228 * sequence number in requests and the reply sequence
1229 * number in replies to identify SCSI tasks.
1231 conversation = find_conversation(&pinfo->src, &pinfo->dst,
1232 pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
1233 if (conversation != NULL) {
1234 task_key.conv_id = conversation->index;
1235 task_key.task_id = seq;
1236 pinfo->private_data = &task_key;
1238 /* no conversation, meaning we didn't see the request */
1239 pinfo->private_data = NULL;
1243 proto_tree_add_item(tree, hf_ndmp_error, tvb, offset, 4, FALSE);
1247 proto_tree_add_item(tree, hf_ndmp_execute_cdb_status, tvb, offset, 4, FALSE);
1251 proto_tree_add_item(tree, hf_ndmp_execute_cdb_dataout_len, tvb, offset, 4, FALSE);
1255 offset = dissect_execute_cdb_payload(tvb, offset, pinfo, tree,
1256 "Data in", hf_ndmp_execute_cdb_datain_len, FALSE);
1259 offset = dissect_execute_cdb_sns(tvb, offset, pinfo, tree);
1264 #define NDMP_TAPE_OPEN_MODE_READ 0
1265 #define NDMP_TAPE_OPEN_MODE_RDWR 1
1266 static const value_string tape_open_mode_vals[] = {
1267 {NDMP_TAPE_OPEN_MODE_READ, "Read"},
1268 {NDMP_TAPE_OPEN_MODE_RDWR, "Read/Write"},
1273 dissect_tape_open_request(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1274 proto_tree *tree, guint32 seq _U_)
1277 offset = dissect_rpc_string(tvb, tree,
1278 hf_ndmp_tape_device, offset, NULL);
1281 proto_tree_add_item(tree, hf_ndmp_tape_open_mode, tvb, offset, 4, FALSE);
1288 static const true_false_string tfs_ndmp_tape_invalid_file_num = {
1289 "File num is valid",
1290 "File num is INVALID"
1292 static const true_false_string tfs_ndmp_tape_invalid_soft_errors = {
1293 "Soft errors is valid",
1294 "Soft errors is INVALID"
1296 static const true_false_string tfs_ndmp_tape_invalid_block_size = {
1297 "Block size is valid",
1298 "Block size is INVALID"
1300 static const true_false_string tfs_ndmp_tape_invalid_block_no = {
1301 "Block no is valid",
1302 "Block no is INVALID"
1304 static const true_false_string tfs_ndmp_tape_invalid_total_space = {
1305 "Total space is valid",
1306 "Total space is INVALID"
1308 static const true_false_string tfs_ndmp_tape_invalid_space_remain = {
1309 "Space remaining is INVALID",
1310 "Space remaining is valid"
1312 static const true_false_string tfs_ndmp_tape_invalid_partition = {
1313 "Partition is INVALID",
1314 "Partition is valid"
1317 dissect_tape_invalid(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1318 proto_tree *parent_tree)
1320 proto_item* item = NULL;
1321 proto_tree* tree = NULL;
1324 flags=tvb_get_ntohl(tvb, offset);
1326 item = proto_tree_add_text(parent_tree, tvb, offset, 4,
1327 "Invalids: 0x%08x", flags);
1328 tree = proto_item_add_subtree(item, ett_ndmp_tape_invalid);
1331 proto_tree_add_boolean(tree, hf_ndmp_tape_invalid_partition,
1332 tvb, offset, 4, flags);
1333 proto_tree_add_boolean(tree, hf_ndmp_tape_invalid_space_remain,
1334 tvb, offset, 4, flags);
1335 proto_tree_add_boolean(tree, hf_ndmp_tape_invalid_total_space,
1336 tvb, offset, 4, flags);
1337 proto_tree_add_boolean(tree, hf_ndmp_tape_invalid_block_no,
1338 tvb, offset, 4, flags);
1339 proto_tree_add_boolean(tree, hf_ndmp_tape_invalid_block_size,
1340 tvb, offset, 4, flags);
1341 proto_tree_add_boolean(tree, hf_ndmp_tape_invalid_soft_errors,
1342 tvb, offset, 4, flags);
1343 proto_tree_add_boolean(tree, hf_ndmp_tape_invalid_file_num,
1344 tvb, offset, 4, flags);
1350 static const true_false_string tfs_ndmp_tape_flags_no_rewind = {
1351 "This is a NON-REWINDING device",
1352 "This device supports rewind"
1354 static const true_false_string tfs_ndmp_tape_flags_write_protect = {
1355 "This device is WRITE-PROTECTED",
1356 "This device is NOT write-protected"
1358 static const true_false_string tfs_ndmp_tape_flags_error = {
1359 "This device shows ERROR",
1360 "This device shows NO errors"
1362 static const true_false_string tfs_ndmp_tape_flags_unload = {
1363 "This device supports UNLOAD",
1364 "This device does NOT support unload"
1367 dissect_tape_flags(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1368 proto_tree *parent_tree)
1370 proto_item* item = NULL;
1371 proto_tree* tree = NULL;
1374 flags=tvb_get_ntohl(tvb, offset);
1376 item = proto_tree_add_text(parent_tree, tvb, offset, 4,
1377 "Flags: 0x%08x", flags);
1378 tree = proto_item_add_subtree(item, ett_ndmp_tape_flags);
1382 proto_tree_add_boolean(tree, hf_ndmp_tape_flags_unload,
1383 tvb, offset, 4, flags);
1384 proto_tree_add_boolean(tree, hf_ndmp_tape_flags_error,
1385 tvb, offset, 4, flags);
1386 proto_tree_add_boolean(tree, hf_ndmp_tape_flags_write_protect,
1387 tvb, offset, 4, flags);
1388 proto_tree_add_boolean(tree, hf_ndmp_tape_flags_no_rewind,
1389 tvb, offset, 4, flags);
1396 dissect_tape_get_state_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
1397 proto_tree *tree, guint32 seq _U_)
1400 offset=dissect_tape_invalid(tvb, offset, pinfo, tree);
1403 proto_tree_add_item(tree, hf_ndmp_error, tvb, offset, 4, FALSE);
1407 offset=dissect_tape_flags(tvb, offset, pinfo, tree);
1410 proto_tree_add_item(tree, hf_ndmp_tape_file_num, tvb, offset, 4, FALSE);
1414 proto_tree_add_item(tree, hf_ndmp_tape_soft_errors, tvb, offset, 4, FALSE);
1418 proto_tree_add_item(tree, hf_ndmp_tape_block_size, tvb, offset, 4, FALSE);
1422 proto_tree_add_item(tree, hf_ndmp_tape_block_no, tvb, offset, 4, FALSE);
1426 offset = dissect_rpc_uint64(tvb, tree,hf_ndmp_tape_total_space,
1430 offset = dissect_rpc_uint64(tvb, tree,hf_ndmp_tape_space_remain,
1434 proto_tree_add_item(tree, hf_ndmp_tape_partition, tvb, offset, 4, FALSE);
1440 #define NDMP_TAPE_MTIO_FSF 0
1441 #define NDMP_TAPE_MTIO_BSF 1
1442 #define NDMP_TAPE_MTIO_FSR 2
1443 #define NDMP_TAPE_MTIO_BSR 3
1444 #define NDMP_TAPE_MTIO_REW 4
1445 #define NDMP_TAPE_MTIO_EOF 5
1446 #define NDMP_TAPE_MTIO_OFF 6
1447 static const value_string tape_mtio_vals[] = {
1448 {NDMP_TAPE_MTIO_FSF, "FSF"},
1449 {NDMP_TAPE_MTIO_BSF, "BSF"},
1450 {NDMP_TAPE_MTIO_FSR, "FSR"},
1451 {NDMP_TAPE_MTIO_BSR, "BSR"},
1452 {NDMP_TAPE_MTIO_REW, "REW"},
1453 {NDMP_TAPE_MTIO_EOF, "EOF"},
1454 {NDMP_TAPE_MTIO_OFF, "OFF"},
1459 dissect_tape_mtio_request(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1460 proto_tree *tree, guint32 seq _U_)
1463 proto_tree_add_item(tree, hf_ndmp_tape_mtio_op, tvb, offset, 4, FALSE);
1467 proto_tree_add_item(tree, hf_ndmp_count, tvb, offset, 4, FALSE);
1474 dissect_tape_mtio_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1475 proto_tree *tree, guint32 seq _U_)
1478 proto_tree_add_item(tree, hf_ndmp_error, tvb, offset, 4, FALSE);
1482 proto_tree_add_item(tree, hf_ndmp_resid_count, tvb, offset, 4, FALSE);
1488 #define NDMP_MOVER_STATE_IDLE 0
1489 #define NDMP_MOVER_STATE_LISTEN 1
1490 #define NDMP_MOVER_STATE_ACTIVE 2
1491 #define NDMP_MOVER_STATE_PAUSED 3
1492 #define NDMP_MOVER_STATE_HALTED 4
1493 static const value_string mover_state_vals[] = {
1494 {NDMP_MOVER_STATE_IDLE, "MOVER_STATE_IDLE"},
1495 {NDMP_MOVER_STATE_LISTEN, "MOVER_STATE_LISTEN"},
1496 {NDMP_MOVER_STATE_ACTIVE, "MOVER_STATE_ACTIVE"},
1497 {NDMP_MOVER_STATE_PAUSED, "MOVER_STATE_PAUSED"},
1498 {NDMP_MOVER_STATE_HALTED, "MOVER_STATE_HALTED"},
1502 #define NDMP_MOVER_PAUSE_NA 0
1503 #define NDMP_MOVER_PAUSE_EOM 1
1504 #define NDMP_MOVER_PAUSE_EOF 2
1505 #define NDMP_MOVER_PAUSE_SEEK 3
1506 #define NDMP_MOVER_PAUSE_MEDIA_ERROR 4
1507 #define NDMP_MOVER_PAUSE_EOW 5
1508 static const value_string mover_pause_vals[] = {
1509 {NDMP_MOVER_PAUSE_NA, "MOVER_PAUSE_NA"},
1510 {NDMP_MOVER_PAUSE_EOM, "MOVER_PAUSE_EOM"},
1511 {NDMP_MOVER_PAUSE_EOF, "MOVER_PAUSE_EOF"},
1512 {NDMP_MOVER_PAUSE_SEEK, "MOVER_PAUSE_SEEK"},
1513 {NDMP_MOVER_PAUSE_MEDIA_ERROR, "MOVER_PAUSE_MEDIA_ERROR"},
1514 {NDMP_MOVER_PAUSE_EOW, "MOVER_PAUSE_EOW"},
1518 #define NDMP_HALT_NA 0
1519 #define NDMP_HALT_CONNECT_CLOSE 1
1520 #define NDMP_HALT_ABORTED 2
1521 #define NDMP_HALT_INTERNAL_ERROR 3
1522 #define NDMP_HALT_CONNECT_ERROR 4
1523 static const value_string halt_vals[] = {
1524 {NDMP_HALT_NA, "HALT_NA"},
1525 {NDMP_HALT_CONNECT_CLOSE, "HALT_CONNECT_CLOSE"},
1526 {NDMP_HALT_ABORTED, "HALT_ABORTED"},
1527 {NDMP_HALT_INTERNAL_ERROR, "HALT_INTERNAL_ERROR"},
1528 {NDMP_HALT_CONNECT_ERROR, "HALT_CONNECT_ERROR"},
1533 dissect_ndmp_addr(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1534 proto_tree *parent_tree)
1536 proto_item* item = NULL;
1537 proto_tree* tree = NULL;
1540 type=tvb_get_ntohl(tvb, offset);
1542 item = proto_tree_add_text(parent_tree, tvb, offset, 4,
1543 "Type: %s ", val_to_str(type, addr_type_vals,"Unknown addr type (0x%02x)") );
1544 tree = proto_item_add_subtree(item, ett_ndmp_addr);
1548 proto_tree_add_item(tree, hf_ndmp_addr_type, tvb, offset, 4, FALSE);
1553 case NDMP_ADDR_LOCAL:
1557 proto_tree_add_item(tree, hf_ndmp_addr_ip, tvb, offset, 4, FALSE);
1561 proto_tree_add_item(tree, hf_ndmp_addr_tcp, tvb, offset, 4, FALSE);
1567 proto_tree_add_item(tree, hf_ndmp_addr_fcal_loop_id, tvb, offset, 4, FALSE);
1573 offset = dissect_rpc_data(tvb, tree, hf_ndmp_addr_ipc, offset);
1581 dissect_mover_get_state_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
1582 proto_tree *tree, guint32 seq _U_)
1585 proto_tree_add_item(tree, hf_ndmp_error, tvb, offset, 4, FALSE);
1589 proto_tree_add_item(tree, hf_ndmp_mover_state, tvb, offset, 4, FALSE);
1593 proto_tree_add_item(tree, hf_ndmp_mover_pause, tvb, offset, 4, FALSE);
1597 proto_tree_add_item(tree, hf_ndmp_halt, tvb, offset, 4, FALSE);
1601 proto_tree_add_item(tree, hf_ndmp_record_size, tvb, offset, 4, FALSE);
1605 proto_tree_add_item(tree, hf_ndmp_record_num, tvb, offset, 4, FALSE);
1609 proto_tree_add_item(tree, hf_ndmp_data_written, tvb, offset, 8, FALSE);
1613 proto_tree_add_item(tree, hf_ndmp_seek_position, tvb, offset, 8, FALSE);
1616 /* bytes left to read */
1617 proto_tree_add_item(tree, hf_ndmp_bytes_left_to_read, tvb, offset, 8, FALSE);
1621 proto_tree_add_item(tree, hf_ndmp_window_offset, tvb, offset, 8, FALSE);
1625 proto_tree_add_item(tree, hf_ndmp_window_length, tvb, offset, 8, FALSE);
1629 offset=dissect_ndmp_addr(tvb, offset, pinfo, tree);
1634 #define NDMP_MOVER_MODE_READ 0
1635 #define NDMP_MOVER_MODE_WRITE 1
1636 static const value_string mover_mode_vals[] = {
1637 {NDMP_MOVER_MODE_READ, "MODE_READ"},
1638 {NDMP_MOVER_MODE_WRITE, "MOVER_MODE_WRITE"},
1643 dissect_mover_listen_request(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1644 proto_tree *tree, guint32 seq _U_)
1647 proto_tree_add_item(tree, hf_ndmp_mover_mode, tvb, offset, 4, FALSE);
1651 proto_tree_add_item(tree, hf_ndmp_addr_type, tvb, offset, 4, FALSE);
1658 dissect_mover_listen_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
1659 proto_tree *tree, guint32 seq _U_)
1662 proto_tree_add_item(tree, hf_ndmp_error, tvb, offset, 4, FALSE);
1666 offset=dissect_ndmp_addr(tvb, offset, pinfo, tree);
1672 dissect_mover_set_window_request(tvbuff_t *tvb, int offset,
1673 packet_info *pinfo _U_, proto_tree *tree, guint32 seq _U_)
1676 proto_tree_add_item(tree, hf_ndmp_window_offset, tvb, offset, 8, FALSE);
1680 proto_tree_add_item(tree, hf_ndmp_window_length, tvb, offset, 8, FALSE);
1687 dissect_mover_set_record_size_request(tvbuff_t *tvb, int offset,
1688 packet_info *pinfo _U_, proto_tree *tree, guint32 seq _U_)
1691 proto_tree_add_item(tree, hf_ndmp_record_size, tvb, offset, 4, FALSE);
1698 dissect_mover_connect_request(tvbuff_t *tvb, int offset, packet_info *pinfo,
1699 proto_tree *tree, guint32 seq _U_)
1702 proto_tree_add_item(tree, hf_ndmp_mover_mode, tvb, offset, 4, FALSE);
1706 offset=dissect_ndmp_addr(tvb, offset, pinfo, tree);
1712 dissect_log_file_request(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1713 proto_tree *tree, guint32 seq _U_)
1716 offset = dissect_rpc_string(tvb, tree,
1717 hf_ndmp_file_name, offset, NULL);
1720 proto_tree_add_item(tree, hf_ndmp_error, tvb, offset, 4, FALSE);
1726 #define NDMP_LOG_TYPE_NORMAL 0
1727 #define NDMP_LOG_TYPE_DEBUG 1
1728 #define NDMP_LOG_TYPE_ERROR 2
1729 #define NDMP_LOG_TYPE_WARNING 3
1730 static const value_string log_type_vals[] = {
1731 {NDMP_LOG_TYPE_NORMAL, "NORMAL"},
1732 {NDMP_LOG_TYPE_DEBUG, "DEBUG"},
1733 {NDMP_LOG_TYPE_ERROR, "ERROR"},
1734 {NDMP_LOG_TYPE_WARNING, "WARNING"},
1739 dissect_log_message_request(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1740 proto_tree *tree, guint32 seq _U_)
1743 proto_tree_add_item(tree, hf_ndmp_log_type, tvb, offset, 4, FALSE);
1747 proto_tree_add_item(tree, hf_ndmp_log_message_id, tvb, offset, 4, FALSE);
1751 offset = dissect_rpc_string(tvb, tree,
1752 hf_ndmp_log_message, offset, NULL);
1758 dissect_notify_data_halted_request(tvbuff_t *tvb, int offset,
1759 packet_info *pinfo _U_, proto_tree *tree, guint32 seq _U_)
1762 proto_tree_add_item(tree, hf_ndmp_halt, tvb, offset, 4, FALSE);
1766 offset = dissect_rpc_string(tvb, tree,
1767 hf_ndmp_halt_reason, offset, NULL);
1772 #define NDMP_CONNECTED_CONNECTED 0
1773 #define NDMP_CONNECTED_SHUTDOWN 1
1774 #define NDMP_CONNECTED_REFUSED 2
1775 static const value_string connected_vals[] = {
1776 {NDMP_CONNECTED_CONNECTED, "CONNECTED"},
1777 {NDMP_CONNECTED_SHUTDOWN, "SHUTDOWN"},
1778 {NDMP_CONNECTED_REFUSED, "REFUSED"},
1783 dissect_notify_connected_request(tvbuff_t *tvb, int offset,
1784 packet_info *pinfo _U_, proto_tree *tree, guint32 seq _U_)
1787 proto_tree_add_item(tree, hf_ndmp_connected, tvb, offset, 4, FALSE);
1790 /* version number */
1791 proto_tree_add_item(tree, hf_ndmp_version, tvb, offset, 4, FALSE);
1795 offset = dissect_rpc_string(tvb, tree,
1796 hf_ndmp_connected_reason, offset, NULL);
1803 dissect_notify_mover_paused_request(tvbuff_t *tvb, int offset,
1804 packet_info *pinfo _U_, proto_tree *tree, guint32 seq _U_)
1807 proto_tree_add_item(tree, hf_ndmp_mover_pause, tvb, offset, 4, FALSE);
1811 proto_tree_add_item(tree, hf_ndmp_seek_position, tvb, offset, 8, FALSE);
1818 dissect_auth_data(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1823 type=tvb_get_ntohl(tvb,offset);
1826 proto_tree_add_item(tree, hf_ndmp_auth_type, tvb, offset, 4, FALSE);
1830 case NDMP_AUTH_NONE:
1832 case NDMP_AUTH_TEXT:
1834 offset = dissect_rpc_string(tvb, tree,
1835 hf_ndmp_auth_id, offset, NULL);
1838 offset = dissect_rpc_string(tvb, tree,
1839 hf_ndmp_auth_password, offset, NULL);
1845 offset = dissect_rpc_string(tvb, tree,
1846 hf_ndmp_auth_id, offset, NULL);
1849 proto_tree_add_item(tree, hf_ndmp_auth_digest,
1850 tvb, offset, 16, FALSE);
1858 dissect_connect_client_auth_request(tvbuff_t *tvb, int offset,
1859 packet_info *pinfo, proto_tree *tree, guint32 seq _U_)
1861 return dissect_auth_data(tvb, offset, pinfo, tree);
1865 dissect_connect_server_auth_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
1866 proto_tree *tree, guint32 seq _U_)
1869 proto_tree_add_item(tree, hf_ndmp_error, tvb, offset, 4, FALSE);
1873 offset = dissect_auth_data(tvb, offset, pinfo, tree);
1879 dissect_tape_write_request(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1880 proto_tree *tree, guint32 seq _U_)
1883 offset = dissect_rpc_data(tvb, tree, hf_ndmp_data, offset);
1889 dissect_tape_write_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1890 proto_tree *tree, guint32 seq _U_)
1893 proto_tree_add_item(tree, hf_ndmp_error, tvb, offset, 4, FALSE);
1897 proto_tree_add_item(tree, hf_ndmp_count, tvb, offset, 4, FALSE);
1904 dissect_tape_read_request(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1905 proto_tree *tree, guint32 seq _U_)
1908 proto_tree_add_item(tree, hf_ndmp_count, tvb, offset, 4, FALSE);
1915 dissect_tape_read_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1916 proto_tree *tree, guint32 seq _U_)
1919 proto_tree_add_item(tree, hf_ndmp_error, tvb, offset, 4, FALSE);
1923 offset = dissect_rpc_data(tvb, tree, hf_ndmp_data, offset);
1928 #define NDMP_FS_UNIX 0
1929 #define NDMP_FS_NT 1
1930 #define NDMP_FS_OTHER 2
1931 static const value_string file_fs_type_vals[] = {
1932 {NDMP_FS_UNIX, "UNIX"},
1934 {NDMP_FS_OTHER, "OTHER"},
1939 dissect_file_name(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree)
1941 proto_item* item = NULL;
1942 proto_tree* tree = NULL;
1943 int old_offset=offset;
1948 item = proto_tree_add_text(parent_tree, tvb, offset, -1,
1950 tree = proto_item_add_subtree(item, ett_ndmp_file_name);
1954 type=tvb_get_ntohl(tvb, offset);
1955 proto_tree_add_item(tree, hf_ndmp_file_fs_type, tvb, offset, 4, FALSE);
1961 offset = dissect_rpc_string(tvb, tree,
1962 hf_ndmp_file_name, offset, &name);
1963 if (check_col(pinfo->cinfo, COL_INFO)){
1964 col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name);
1969 offset = dissect_rpc_string(tvb, tree,
1970 hf_ndmp_nt_file_name, offset, &name);
1971 if (check_col(pinfo->cinfo, COL_INFO)){
1972 col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name);
1976 offset = dissect_rpc_string(tvb, tree,
1977 hf_ndmp_dos_file_name, offset, NULL);
1981 offset = dissect_rpc_string(tvb, tree,
1982 hf_ndmp_file_name, offset, &name);
1983 if (check_col(pinfo->cinfo, COL_INFO)){
1984 col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name);
1988 if (check_col(pinfo->cinfo, COL_INFO)){
1989 col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)",
1990 val_to_str(type, file_fs_type_vals, "Unknown type") );
1993 proto_item_set_len(item, offset-old_offset);
1998 static const true_false_string tfs_ndmp_file_invalid_atime = {
2002 static const true_false_string tfs_ndmp_file_invalid_ctime = {
2006 static const true_false_string tfs_ndmp_file_invalid_group = {
2011 dissect_file_invalids(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
2012 proto_tree *parent_tree)
2014 proto_item* item = NULL;
2015 proto_tree* tree = NULL;
2018 flags=tvb_get_ntohl(tvb, offset);
2020 item = proto_tree_add_text(parent_tree, tvb, offset, 4,
2021 "Invalids: 0x%08x", flags);
2022 tree = proto_item_add_subtree(item, ett_ndmp_file_invalids);
2025 proto_tree_add_boolean(tree, hf_ndmp_file_invalid_group,
2026 tvb, offset, 4, flags);
2027 proto_tree_add_boolean(tree, hf_ndmp_file_invalid_ctime,
2028 tvb, offset, 4, flags);
2029 proto_tree_add_boolean(tree, hf_ndmp_file_invalid_atime,
2030 tvb, offset, 4, flags);
2036 #define NDMP_FILE_TYPE_DIR 0
2037 #define NDMP_FILE_TYPE_FIFO 1
2038 #define NDMP_FILE_TYPE_CSPEC 2
2039 #define NDMP_FILE_TYPE_BSPEC 3
2040 #define NDMP_FILE_TYPE_REG 4
2041 #define NDMP_FILE_TYPE_SLINK 5
2042 #define NDMP_FILE_TYPE_SOCK 6
2043 #define NDMP_FILE_TYPE_REGISTRY 7
2044 #define NDMP_FILE_TYPE_OTHER 8
2045 static const value_string file_type_vals[] = {
2046 {NDMP_FILE_TYPE_DIR, "DIR"},
2047 {NDMP_FILE_TYPE_FIFO, "FIFO"},
2048 {NDMP_FILE_TYPE_CSPEC, "CSPEC"},
2049 {NDMP_FILE_TYPE_BSPEC, "BSPEC"},
2050 {NDMP_FILE_TYPE_REG, "REG"},
2051 {NDMP_FILE_TYPE_SLINK, "SLINK"},
2052 {NDMP_FILE_TYPE_SOCK, "SOCK"},
2053 {NDMP_FILE_TYPE_REGISTRY, "REGISTRY"},
2054 {NDMP_FILE_TYPE_OTHER, "OTHER"},
2059 dissect_file_stats(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree)
2061 proto_item* item = NULL;
2062 proto_tree* tree = NULL;
2063 int old_offset=offset;
2067 item = proto_tree_add_text(parent_tree, tvb, offset, -1,
2069 tree = proto_item_add_subtree(item, ett_ndmp_file_stats);
2073 offset = dissect_file_invalids(tvb, offset, pinfo, tree);
2076 proto_tree_add_item(tree, hf_ndmp_file_fs_type, tvb, offset, 4, FALSE);
2080 proto_tree_add_item(tree, hf_ndmp_file_type, tvb, offset, 4, FALSE);
2084 ns.secs=tvb_get_ntohl(tvb, offset);
2086 proto_tree_add_time(tree, hf_ndmp_file_mtime, tvb, offset, 4, &ns);
2090 ns.secs=tvb_get_ntohl(tvb, offset);
2092 proto_tree_add_time(tree, hf_ndmp_file_atime, tvb, offset, 4, &ns);
2096 ns.secs=tvb_get_ntohl(tvb, offset);
2098 proto_tree_add_time(tree, hf_ndmp_file_ctime, tvb, offset, 4, &ns);
2102 proto_tree_add_item(tree, hf_ndmp_file_owner, tvb, offset, 4, FALSE);
2106 proto_tree_add_item(tree, hf_ndmp_file_group, tvb, offset, 4, FALSE);
2109 /*XXX here we should do proper dissection of mode for unix or
2110 fattr for nt, call appropriate functions in nfs/smb*/
2112 proto_tree_add_item(tree, hf_ndmp_file_fattr, tvb, offset, 4, FALSE);
2116 offset = dissect_rpc_uint64(tvb, tree, hf_ndmp_file_size,
2120 proto_tree_add_item(tree, hf_ndmp_file_links, tvb, offset, 4, FALSE);
2123 proto_item_set_len(item, offset-old_offset);
2129 dissect_file(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree)
2131 proto_item* item = NULL;
2132 proto_tree* tree = NULL;
2133 int old_offset=offset;
2136 item = proto_tree_add_text(parent_tree, tvb, offset, -1,
2138 tree = proto_item_add_subtree(item, ett_ndmp_file);
2142 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
2143 dissect_file_name, hf_ndmp_file_names);
2146 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
2147 dissect_file_stats, hf_ndmp_file_stats);
2150 proto_tree_add_item(tree, hf_ndmp_file_node, tvb, offset, 8, FALSE);
2154 proto_tree_add_item(tree, hf_ndmp_file_fh_info, tvb, offset, 8, FALSE);
2157 proto_item_set_len(item, offset-old_offset);
2162 dissect_fh_add_file_request(tvbuff_t *tvb, int offset, packet_info *pinfo,
2163 proto_tree *tree, guint32 seq _U_)
2166 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
2167 dissect_file, hf_ndmp_files);
2173 dissect_dir(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
2176 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
2177 dissect_file_name, hf_ndmp_file_names);
2180 proto_tree_add_item(tree, hf_ndmp_file_node, tvb, offset, 8, FALSE);
2184 proto_tree_add_item(tree, hf_ndmp_file_parent, tvb, offset, 8, FALSE);
2191 dissect_fh_add_dir_request(tvbuff_t *tvb, int offset, packet_info *pinfo,
2192 proto_tree *tree, guint32 seq _U_)
2195 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
2196 dissect_dir, hf_ndmp_dirs);
2202 dissect_node(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
2205 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
2206 dissect_file_stats, hf_ndmp_file_stats);
2209 proto_tree_add_item(tree, hf_ndmp_file_node, tvb, offset, 8, FALSE);
2213 proto_tree_add_item(tree, hf_ndmp_file_fh_info, tvb, offset, 8, FALSE);
2221 dissect_fh_add_node_request(tvbuff_t *tvb, int offset, packet_info *pinfo,
2222 proto_tree *tree, guint32 seq _U_)
2225 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
2226 dissect_node, hf_ndmp_nodes);
2232 dissect_data_start_backup_request(tvbuff_t *tvb, int offset, packet_info *pinfo,
2233 proto_tree *tree, guint32 seq _U_)
2236 offset = dissect_rpc_string(tvb, tree,
2237 hf_ndmp_butype_name, offset, NULL);
2240 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
2241 dissect_default_env, hf_ndmp_butype_default_env);
2247 dissect_nlist(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
2251 offset = dissect_rpc_string(tvb, tree,
2252 hf_ndmp_bu_original_path, offset, NULL);
2255 offset = dissect_rpc_string(tvb, tree,
2256 hf_ndmp_bu_destination_dir, offset, NULL);
2259 offset = dissect_rpc_string(tvb, tree,
2260 hf_ndmp_bu_new_name, offset, NULL);
2263 offset = dissect_rpc_string(tvb, tree,
2264 hf_ndmp_bu_other_name, offset, NULL);
2267 proto_tree_add_item(tree, hf_ndmp_file_node, tvb, offset, 8, FALSE);
2271 proto_tree_add_item(tree, hf_ndmp_file_fh_info, tvb, offset, 8, FALSE);
2279 dissect_data_start_recover_request(tvbuff_t *tvb, int offset,
2280 packet_info *pinfo, proto_tree *tree, guint32 seq _U_)
2283 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
2284 dissect_default_env, hf_ndmp_butype_default_env);
2287 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
2288 dissect_nlist, hf_ndmp_nlist);
2291 offset = dissect_rpc_string(tvb, tree,
2292 hf_ndmp_butype_name, offset, NULL);
2298 dissect_data_get_env_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
2299 proto_tree *tree, guint32 seq _U_)
2302 proto_tree_add_item(tree, hf_ndmp_error, tvb, offset, 4, FALSE);
2306 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
2307 dissect_default_env, hf_ndmp_butype_default_env);
2313 static const true_false_string tfs_ndmp_state_invalid_ebr = {
2314 "Estimated Bytes Remaining is INVALID",
2315 "Estimated Bytes Remaining is valid"
2317 static const true_false_string tfs_ndmp_state_invalid_etr = {
2318 "Estimated Time Remaining is INVALID",
2319 "Estimated Time Remaining is valid"
2322 dissect_state_invalids(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
2323 proto_tree *parent_tree)
2325 proto_item* item = NULL;
2326 proto_tree* tree = NULL;
2329 flags=tvb_get_ntohl(tvb, offset);
2331 item = proto_tree_add_text(parent_tree, tvb, offset, 4,
2332 "Invalids: 0x%08x", flags);
2333 tree = proto_item_add_subtree(item, ett_ndmp_state_invalids);
2336 proto_tree_add_boolean(tree, hf_ndmp_state_invalid_etr,
2337 tvb, offset, 4, flags);
2338 proto_tree_add_boolean(tree, hf_ndmp_state_invalid_ebr,
2339 tvb, offset, 4, flags);
2345 #define NDMP_DATA_OP_NOACTION 0
2346 #define NDMP_DATA_OP_BACKUP 1
2347 #define NDMP_DATA_OP_RESTORE 2
2348 static const value_string bu_operation_vals[] = {
2349 {NDMP_DATA_OP_NOACTION, "NOACTION"},
2350 {NDMP_DATA_OP_BACKUP, "BACKUP"},
2351 {NDMP_DATA_OP_RESTORE, "RESTORE"},
2355 #define NDMP_DATA_STATE_IDLE 0
2356 #define NDMP_DATA_STATE_ACTIVE 1
2357 #define NDMP_DATA_STATE_HALTED 2
2358 #define NDMP_DATA_STATE_LISTEN 3
2359 #define NDMP_DATA_STATE_CONNECTED 4
2360 static const value_string data_state_vals[] = {
2361 {NDMP_DATA_STATE_IDLE, "IDLE"},
2362 {NDMP_DATA_STATE_ACTIVE, "ACTIVE"},
2363 {NDMP_DATA_STATE_HALTED, "HALTED"},
2364 {NDMP_DATA_STATE_LISTEN, "LISTEN"},
2365 {NDMP_DATA_STATE_CONNECTED, "CONNECTED"},
2369 #define NDMP_DATA_HALTED_NA 0
2370 #define NDMP_DATA_HALTED_SUCCESSFUL 1
2371 #define NDMP_DATA_HALTED_ABORTED 2
2372 #define NDMP_DATA_HALTED_INTERNAL_ERROR 3
2373 #define NDMP_DATA_HALTED_CONNECT_ERROR 4
2374 static const value_string data_halted_vals[] = {
2375 {NDMP_DATA_HALTED_NA, "HALTED_NA"},
2376 {NDMP_DATA_HALTED_SUCCESSFUL, "HALTED_SUCCESSFUL"},
2377 {NDMP_DATA_HALTED_ABORTED, "HALTED_ABORTED"},
2378 {NDMP_DATA_HALTED_INTERNAL_ERROR, "HALTED_INTERNAL_ERROR"},
2379 {NDMP_DATA_HALTED_CONNECT_ERROR, "HALTED_CONNECT_ERROR"},
2384 dissect_data_get_state_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
2385 proto_tree *tree, guint32 seq _U_)
2390 offset = dissect_state_invalids(tvb, offset, pinfo, tree);
2393 proto_tree_add_item(tree, hf_ndmp_error, tvb, offset, 4, FALSE);
2397 proto_tree_add_item(tree, hf_ndmp_bu_operation, tvb, offset, 4, FALSE);
2401 proto_tree_add_item(tree, hf_ndmp_data_state, tvb, offset, 4, FALSE);
2405 proto_tree_add_item(tree, hf_ndmp_data_halted, tvb, offset, 4, FALSE);
2409 offset = dissect_rpc_uint64(tvb, tree, hf_ndmp_data_bytes_processed,
2412 /*est bytes remain*/
2413 offset = dissect_rpc_uint64(tvb, tree, hf_ndmp_data_est_bytes_remain,
2416 /* est time remain */
2417 ns.secs=tvb_get_ntohl(tvb, offset);
2419 proto_tree_add_time(tree, hf_ndmp_data_est_time_remain, tvb, offset, 4, &ns);
2423 offset=dissect_ndmp_addr(tvb, offset, pinfo, tree);
2426 proto_tree_add_item(tree, hf_ndmp_window_offset, tvb, offset, 8, FALSE);
2430 proto_tree_add_item(tree, hf_ndmp_window_length, tvb, offset, 8, FALSE);
2437 typedef struct _ndmp_command {
2439 int (*request) (tvbuff_t *tvb, int offset, packet_info *pinfo,
2440 proto_tree *tree, guint32 seq);
2441 int (*response)(tvbuff_t *tvb, int offset, packet_info *pinfo,
2442 proto_tree *tree, guint32 seq);
2445 static const ndmp_command ndmp_commands[] = {
2446 {NDMP_CONFIG_GET_HOST_INFO,
2447 NULL, dissect_ndmp_get_host_info_reply},
2448 {NDMP_CONFIG_GET_CONNECTION_TYPE,
2449 NULL, dissect_ndmp_config_get_connection_type_reply},
2450 {NDMP_CONFIG_GET_AUTH_ATTR,
2451 dissect_get_auth_type_request, dissect_auth_attr_msg},
2452 {NDMP_CONFIG_GET_BUTYPE_INFO,
2453 NULL, dissect_get_butype_info_reply},
2454 {NDMP_CONFIG_GET_FS_INFO,
2455 NULL, dissect_get_fs_info_reply},
2456 {NDMP_CONFIG_GET_TAPE_INFO,
2457 NULL, dissect_get_tape_info_reply},
2458 {NDMP_CONFIG_GET_SCSI_INFO,
2459 NULL, dissect_get_scsi_info_reply},
2460 {NDMP_CONFIG_GET_SERVER_INFO,
2461 NULL, dissect_get_server_info_reply},
2463 dissect_scsi_open_request, dissect_error},
2465 NULL, dissect_error},
2466 {NDMP_SCSI_GET_STATE,
2467 NULL, dissect_scsi_get_state_reply},
2468 {NDMP_SCSI_SET_TARGET,
2469 dissect_scsi_set_state_request, dissect_error},
2470 {NDMP_SCSI_RESET_DEVICE,
2471 NULL, dissect_error},
2472 {NDMP_SCSI_RESET_BUS,
2473 NULL, dissect_error},
2474 {NDMP_SCSI_EXECUTE_CDB,
2475 dissect_execute_cdb_request_mc, dissect_execute_cdb_reply},
2477 dissect_tape_open_request, dissect_error},
2479 NULL, dissect_error},
2480 {NDMP_TAPE_GET_STATE,
2481 NULL, dissect_tape_get_state_reply},
2483 dissect_tape_mtio_request, dissect_tape_mtio_reply},
2485 dissect_tape_write_request, dissect_tape_write_reply},
2487 dissect_tape_read_request, dissect_tape_read_reply},
2488 {NDMP_TAPE_EXECUTE_CDB,
2489 dissect_execute_cdb_request_tape, dissect_execute_cdb_reply},
2490 {NDMP_DATA_GET_STATE,
2491 NULL, dissect_data_get_state_reply},
2492 {NDMP_DATA_START_BACKUP,
2493 dissect_data_start_backup_request, dissect_error },
2494 {NDMP_DATA_START_RECOVER,
2495 dissect_data_start_recover_request, dissect_error },
2497 NULL, dissect_error},
2499 NULL, dissect_data_get_env_reply},
2501 NULL, dissect_error},
2503 dissect_ndmp_addr_msg, dissect_mover_listen_reply},
2505 dissect_ndmp_addr_msg, dissect_error},
2506 {NDMP_NOTIFY_DATA_HALTED,
2507 dissect_notify_data_halted_request, NULL},
2508 {NDMP_NOTIFY_CONNECTED,
2509 dissect_notify_connected_request, NULL},
2510 {NDMP_NOTIFY_MOVER_HALTED,
2511 dissect_notify_data_halted_request, NULL},
2512 {NDMP_NOTIFY_MOVER_PAUSED,
2513 dissect_notify_mover_paused_request, NULL},
2514 {NDMP_NOTIFY_DATA_READ,
2515 dissect_mover_set_window_request, NULL},
2517 dissect_log_file_request, NULL},
2519 dissect_log_message_request, NULL},
2521 dissect_fh_add_file_request, NULL},
2523 dissect_fh_add_dir_request, NULL},
2525 dissect_fh_add_node_request, NULL},
2527 dissect_connect_open_request, dissect_error},
2528 {NDMP_CONNECT_CLIENT_AUTH,
2529 dissect_connect_client_auth_request, dissect_error},
2530 {NDMP_CONNECT_CLOSE,
2532 {NDMP_CONNECT_SERVER_AUTH,
2533 dissect_auth_attr_msg, dissect_connect_server_auth_reply},
2534 {NDMP_MOVER_GET_STATE,
2535 NULL, dissect_mover_get_state_reply},
2537 dissect_mover_listen_request, dissect_mover_listen_reply},
2538 {NDMP_MOVER_CONTINUE,
2539 NULL, dissect_error},
2541 NULL, dissect_error},
2543 NULL, dissect_error},
2544 {NDMP_MOVER_SET_WINDOW,
2545 dissect_mover_set_window_request, dissect_error},
2547 dissect_mover_set_window_request, dissect_error},
2549 NULL, dissect_error},
2550 {NDMP_MOVER_SET_RECORD_SIZE,
2551 dissect_mover_set_record_size_request, dissect_error},
2552 {NDMP_MOVER_CONNECT,
2553 dissect_mover_connect_request, dissect_error},
2559 dissect_ndmp_header(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, struct ndmp_header *nh)
2561 proto_item* item = NULL;
2562 proto_tree* tree = NULL;
2566 item = proto_tree_add_item(parent_tree, hf_ndmp_header, tvb,
2568 tree = proto_item_add_subtree(item, ett_ndmp_header);
2571 /* sequence number */
2572 proto_tree_add_uint(tree, hf_ndmp_sequence, tvb, offset, 4, nh->seq);
2578 proto_tree_add_time(tree, hf_ndmp_timestamp, tvb, offset, 4, &ns);
2582 proto_tree_add_uint(tree, hf_ndmp_msgtype, tvb, offset, 4, nh->type);
2586 proto_tree_add_uint(tree, hf_ndmp_msg, tvb, offset, 4, nh->msg);
2589 /* Reply sequence number */
2590 proto_tree_add_uint(tree, hf_ndmp_reply_sequence, tvb, offset, 4, nh->rep_seq);
2594 proto_tree_add_uint(tree, hf_ndmp_error, tvb, offset, 4, nh->err);
2597 if (check_col(pinfo->cinfo, COL_INFO)){
2598 col_append_fstr(pinfo->cinfo, COL_INFO, "%s %s",
2599 val_to_str(nh->msg, msg_vals, "Unknown Message (0x%02x)"),
2600 val_to_str(nh->type, msg_type_vals, "Unknown Type (0x%02x)")
2609 dissect_ndmp_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, struct ndmp_header *nh)
2612 proto_item *cmd_item=NULL;
2613 proto_tree *cmd_tree=NULL;
2615 offset=dissect_ndmp_header(tvb, offset, pinfo, tree, nh);
2617 for(i=0;ndmp_commands[i].cmd!=0;i++){
2618 if(ndmp_commands[i].cmd==nh->msg){
2624 if(ndmp_commands[i].cmd==0){
2625 /* we do not know this message */
2626 proto_tree_add_text(tree, tvb, offset, -1, "Unknown type of NDMP message: 0x%02x", nh->msg);
2627 offset+=tvb_length_remaining(tvb, offset);
2631 if (tvb_reported_length_remaining(tvb, offset) > 0) {
2633 cmd_item = proto_tree_add_text(tree, tvb, offset, -1,
2634 msg_vals[i].strptr);
2635 cmd_tree = proto_item_add_subtree(cmd_item, ett_ndmp);
2639 if(nh->type==NDMP_MESSAGE_REQUEST){
2640 if(ndmp_commands[i].request){
2641 offset=ndmp_commands[i].request(tvb, offset, pinfo, cmd_tree,
2645 if(ndmp_commands[i].response){
2646 offset=ndmp_commands[i].response(tvb, offset, pinfo, cmd_tree,
2655 dissect_ndmp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
2656 tvbuff_t *frag_tvb, fragment_data *ipfd_head, gboolean is_tcp,
2657 guint32 rpc_rm, gboolean first_pdu)
2659 int offset = (is_tcp && tvb == frag_tvb) ? 4 : 0;
2661 struct ndmp_header nh;
2662 proto_item *ndmp_item = NULL;
2663 proto_tree *ndmp_tree = NULL;
2665 /* size of this NDMP PDU */
2666 size = tvb_length_remaining(tvb, offset);
2668 /* too short to be NDMP */
2673 * Check the NDMP header, if we have it.
2675 nh.seq = tvb_get_ntohl(tvb, offset);
2676 nh.time = tvb_get_ntohl(tvb, offset+4);
2677 nh.type = tvb_get_ntohl(tvb, offset+8);
2678 nh.msg = tvb_get_ntohl(tvb, offset+12);
2679 nh.rep_seq = tvb_get_ntohl(tvb, offset+16);
2680 nh.err = tvb_get_ntohl(tvb, offset+20);
2684 if (nh.msg > 0xa09 || nh.msg == 0)
2690 * Check if this is the last fragment.
2692 if (!(rpc_rm & RPC_RM_LASTFRAG)) {
2694 * This isn't the last fragment.
2695 * If we're doing reassembly, just return
2696 * TRUE to indicate that this looks like
2697 * the beginning of an NDMP message,
2698 * and let them do reassembly.
2700 if (ndmp_defragment)
2704 if (check_col(pinfo->cinfo, COL_PROTOCOL))
2705 col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDMP");
2706 if (check_col(pinfo->cinfo, COL_INFO)) {
2708 col_clear(pinfo->cinfo, COL_INFO);
2710 col_append_fstr(pinfo->cinfo, COL_INFO, "; ");
2714 ndmp_item = proto_tree_add_item(tree, proto_ndmp,
2716 ndmp_tree = proto_item_add_subtree(ndmp_item, ett_ndmp);
2719 show_rpc_fraginfo(tvb, frag_tvb, ndmp_tree, rpc_rm,
2725 * We cannot trust what dissect_ndmp_cmd() tells us, as there
2726 * are implementations which pad some additional data after
2727 * the PDU. We MUST use size.
2729 dissect_ndmp_cmd(tvb, offset, pinfo, ndmp_tree, &nh);
2734 dissect_ndmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2738 gboolean first_pdu = TRUE;
2740 while (tvb_reported_length_remaining(tvb, offset) != 0) {
2742 * Process this fragment.
2744 len = dissect_rpc_fragment(tvb, offset, pinfo, tree,
2745 dissect_ndmp_message, FALSE, proto_ndmp, ett_ndmp,
2746 ndmp_defragment, first_pdu);
2750 * We need more data from the TCP stream for
2757 * It's not NDMP. Stop processing.
2767 proto_register_ndmp(void)
2770 static hf_register_info hf_ndmp[] = {
2771 { &hf_ndmp_header, {
2772 "NDMP Header", "ndmp.header", FT_NONE, 0,
2773 NULL, 0, "NDMP Header", HFILL }},
2775 { &hf_ndmp_sequence, {
2776 "Sequence", "ndmp.sequence", FT_UINT32, BASE_DEC,
2777 NULL, 0, "Sequence number for NDMP PDU", HFILL }},
2779 { &hf_ndmp_reply_sequence, {
2780 "Reply Sequence", "ndmp.reply_sequence", FT_UINT32, BASE_DEC,
2781 NULL, 0, "Reply Sequence number for NDMP PDU", HFILL }},
2783 { &hf_ndmp_timestamp, {
2784 "Time", "ndmp.timestamp", FT_ABSOLUTE_TIME, BASE_NONE,
2785 NULL, 0, "Timestamp for this NDMP PDU", HFILL }},
2787 { &hf_ndmp_msgtype, {
2788 "Type", "ndmp.msg_type", FT_UINT32, BASE_DEC,
2789 VALS(msg_type_vals), 0, "Is this a Request or Response?", HFILL }},
2792 "Message", "ndmp.msg", FT_UINT32, BASE_HEX,
2793 VALS(msg_vals), 0, "Type of NDMP PDU", HFILL }},
2796 "Error", "ndmp.error", FT_UINT32, BASE_DEC,
2797 VALS(error_vals), 0, "Error code for this NDMP PDU", HFILL }},
2799 { &hf_ndmp_version, {
2800 "Version", "ndmp.version", FT_UINT32, BASE_DEC,
2801 NULL, 0, "Version of NDMP protocol", HFILL }},
2803 { &hf_ndmp_hostname, {
2804 "Hostname", "ndmp.hostname", FT_STRING, BASE_NONE,
2805 NULL, 0, "Hostname", HFILL }},
2807 { &hf_ndmp_hostid, {
2808 "HostID", "ndmp.hostid", FT_STRING, BASE_NONE,
2809 NULL, 0, "HostID", HFILL }},
2811 { &hf_ndmp_os_type, {
2812 "OS Type", "ndmp.os.type", FT_STRING, BASE_NONE,
2813 NULL, 0, "OS Type", HFILL }},
2815 { &hf_ndmp_os_vers, {
2816 "OS Version", "ndmp.os.version", FT_STRING, BASE_NONE,
2817 NULL, 0, "OS Version", HFILL }},
2819 { &hf_ndmp_addr_types, {
2820 "Addr Types", "ndmp.addr_types", FT_NONE, BASE_NONE,
2821 NULL, 0, "List Of Address Types", HFILL }},
2823 { &hf_ndmp_addr_type, {
2824 "Addr Type", "ndmp.addr_type", FT_UINT32, BASE_DEC,
2825 VALS(addr_type_vals), 0, "Address Type", HFILL }},
2827 { &hf_ndmp_auth_type, {
2828 "Auth Type", "ndmp.auth_type", FT_UINT32, BASE_DEC,
2829 VALS(auth_type_vals), 0, "Authentication Type", HFILL }},
2831 { &hf_ndmp_auth_challenge, {
2832 "Challenge", "ndmp.auth.challenge", FT_BYTES, BASE_HEX,
2833 NULL, 0, "Authentication Challenge", HFILL }},
2835 { &hf_ndmp_auth_digest, {
2836 "Digest", "ndmp.auth.digest", FT_BYTES, BASE_HEX,
2837 NULL, 0, "Authentication Digest", HFILL }},
2839 { &hf_ndmp_butype_info, {
2840 "Butype Info", "ndmp.butype.info", FT_NONE, BASE_NONE,
2841 NULL, 0, "Butype Info", HFILL }},
2843 { &hf_ndmp_butype_name, {
2844 "Butype Name", "ndmp.butype.name", FT_STRING, BASE_NONE,
2845 NULL, 0, "Name of Butype", HFILL }},
2847 { &hf_ndmp_butype_default_env, {
2848 "Default Env", "ndmp.butype.default_env", FT_NONE, BASE_NONE,
2849 NULL, 0, "Default Env's for this Butype Info", HFILL }},
2851 { &hf_ndmp_butype_attr_backup_file_history, {
2852 "", "ndmp.butype.attr.backup_file_history", FT_BOOLEAN, 32,
2853 TFS(&tfs_butype_attr_backup_file_history), 0x00000001, "backup_file_history", HFILL }},
2855 { &hf_ndmp_butype_attr_backup_filelist, {
2856 "", "ndmp.butype.attr.backup_filelist", FT_BOOLEAN, 32,
2857 TFS(&tfs_butype_attr_backup_filelist), 0x00000002, "backup_filelist", HFILL }},
2859 { &hf_ndmp_butype_attr_recover_filelist, {
2860 "", "ndmp.butype.attr.recover_filelist", FT_BOOLEAN, 32,
2861 TFS(&tfs_butype_attr_recover_filelist), 0x00000004, "recover_filelist", HFILL }},
2863 { &hf_ndmp_butype_attr_backup_direct, {
2864 "", "ndmp.butype.attr.backup_direct", FT_BOOLEAN, 32,
2865 TFS(&tfs_butype_attr_backup_direct), 0x00000008, "backup_direct", HFILL }},
2867 { &hf_ndmp_butype_attr_recover_direct, {
2868 "", "ndmp.butype.attr.recover_direct", FT_BOOLEAN, 32,
2869 TFS(&tfs_butype_attr_recover_direct), 0x00000010, "recover_direct", HFILL }},
2871 { &hf_ndmp_butype_attr_backup_incremental, {
2872 "", "ndmp.butype.attr.backup_incremental", FT_BOOLEAN, 32,
2873 TFS(&tfs_butype_attr_backup_incremental), 0x00000020, "backup_incremental", HFILL }},
2875 { &hf_ndmp_butype_attr_recover_incremental, {
2876 "", "ndmp.butype.attr.recover_incremental", FT_BOOLEAN, 32,
2877 TFS(&tfs_butype_attr_recover_incremental), 0x00000040, "recover_incremental", HFILL }},
2879 { &hf_ndmp_butype_attr_backup_utf8, {
2880 "", "ndmp.butype.attr.backup_utf8", FT_BOOLEAN, 32,
2881 TFS(&tfs_butype_attr_backup_utf8), 0x00000080, "backup_utf8", HFILL }},
2883 { &hf_ndmp_butype_attr_recover_utf8, {
2884 "", "ndmp.butype.attr.recover_utf8", FT_BOOLEAN, 32,
2885 TFS(&tfs_butype_attr_recover_utf8), 0x00000100, "recover_utf8", HFILL }},
2887 { &hf_ndmp_butype_env_name, {
2888 "Name", "ndmp.butype.env.name", FT_STRING, BASE_NONE,
2889 NULL, 0, "Name for this env-variable", HFILL }},
2891 { &hf_ndmp_butype_env_value, {
2892 "Value", "ndmp.butype.env.value", FT_STRING, BASE_NONE,
2893 NULL, 0, "Value for this env-variable", HFILL }},
2895 { &hf_ndmp_fs_info, {
2896 "FS Info", "ndmp.fs.info", FT_NONE, BASE_NONE,
2897 NULL, 0, "FS Info", HFILL }},
2899 { &hf_ndmp_fs_invalid_total_size, {
2900 "", "ndmp.fs.invalid.total_size", FT_BOOLEAN, 32,
2901 TFS(&tfs_fs_invalid_total_size), 0x00000001, "If total size is invalid", HFILL }},
2903 { &hf_ndmp_fs_invalid_used_size, {
2904 "", "ndmp.fs.invalid.used_size", FT_BOOLEAN, 32,
2905 TFS(&tfs_fs_invalid_used_size), 0x00000002, "If used size is invalid", HFILL }},
2907 { &hf_ndmp_fs_invalid_avail_size, {
2908 "", "ndmp.fs.invalid.avail_size", FT_BOOLEAN, 32,
2909 TFS(&tfs_fs_invalid_avail_size), 0x00000004, "If available size is invalid", HFILL }},
2911 { &hf_ndmp_fs_invalid_total_inodes, {
2912 "", "ndmp.fs.invalid.total_inodes", FT_BOOLEAN, 32,
2913 TFS(&tfs_fs_invalid_total_inodes), 0x00000008, "If total number of inodes is invalid", HFILL }},
2915 { &hf_ndmp_fs_invalid_used_inodes, {
2916 "", "ndmp.fs.invalid.used_inodes", FT_BOOLEAN, 32,
2917 TFS(&tfs_fs_invalid_used_inodes), 0x00000010, "If used number of inodes is invalid", HFILL }},
2919 { &hf_ndmp_fs_fs_type, {
2920 "Type", "ndmp.fs.type", FT_STRING, BASE_NONE,
2921 NULL, 0, "Type of FS", HFILL }},
2923 { &hf_ndmp_fs_logical_device, {
2924 "Logical Device", "ndmp.fs.logical_device", FT_STRING, BASE_NONE,
2925 NULL, 0, "Name of logical device", HFILL }},
2927 { &hf_ndmp_fs_physical_device, {
2928 "Physical Device", "ndmp.fs.physical_device", FT_STRING, BASE_NONE,
2929 NULL, 0, "Name of physical device", HFILL }},
2931 { &hf_ndmp_fs_total_size, {
2932 "Total Size", "ndmp.fs.total_size", FT_UINT64, BASE_DEC,
2933 NULL, 0, "Total size of FS", HFILL }},
2935 { &hf_ndmp_fs_used_size, {
2936 "Used Size", "ndmp.fs.used_size", FT_UINT64, BASE_DEC,
2937 NULL, 0, "Total used size of FS", HFILL }},
2939 { &hf_ndmp_fs_avail_size, {
2940 "Avail Size", "ndmp.fs.avail_size", FT_UINT64, BASE_DEC,
2941 NULL, 0, "Total available size on FS", HFILL }},
2943 { &hf_ndmp_fs_total_inodes, {
2944 "Total Inodes", "ndmp.fs.total_inodes", FT_UINT64, BASE_DEC,
2945 NULL, 0, "Total number of inodes on FS", HFILL }},
2947 { &hf_ndmp_fs_used_inodes, {
2948 "Used Inodes", "ndmp.fs.used_inodes", FT_UINT64, BASE_DEC,
2949 NULL, 0, "Number of used inodes on FS", HFILL }},
2951 { &hf_ndmp_fs_env, {
2952 "Env variables", "ndmp.fs.env", FT_NONE, BASE_NONE,
2953 NULL, 0, "Environment variables for FS", HFILL }},
2955 { &hf_ndmp_fs_env_name, {
2956 "Name", "ndmp.fs.env.name", FT_STRING, BASE_NONE,
2957 NULL, 0, "Name for this env-variable", HFILL }},
2959 { &hf_ndmp_fs_env_value, {
2960 "Value", "ndmp.fs.env.value", FT_STRING, BASE_NONE,
2961 NULL, 0, "Value for this env-variable", HFILL }},
2963 { &hf_ndmp_fs_status, {
2964 "Status", "ndmp.fs.status", FT_STRING, BASE_NONE,
2965 NULL, 0, "Status for this FS", HFILL }},
2967 { &hf_ndmp_tape_info, {
2968 "Tape Info", "ndmp.tape.info", FT_NONE, BASE_NONE,
2969 NULL, 0, "Tape Info", HFILL }},
2971 { &hf_ndmp_tape_model, {
2972 "Model", "ndmp.tape.model", FT_STRING, BASE_NONE,
2973 NULL, 0, "Model of the TAPE drive", HFILL }},
2975 { &hf_ndmp_tape_dev_cap, {
2976 "Device Capability", "ndmp.tape.dev_cap", FT_NONE, BASE_NONE,
2977 NULL, 0, "Tape Device Capability", HFILL }},
2979 { &hf_ndmp_tape_device, {
2980 "Device", "ndmp.tape.device", FT_STRING, BASE_NONE,
2981 NULL, 0, "Name of TAPE Device", HFILL }},
2983 { &hf_ndmp_tape_attr_rewind, {
2984 "", "ndmp.tape.attr.rewind", FT_BOOLEAN, 32,
2985 TFS(&tfs_tape_attr_rewind), 0x00000001, "If this device supports rewind", HFILL }},
2987 { &hf_ndmp_tape_attr_unload, {
2988 "", "ndmp.tape.attr.unload", FT_BOOLEAN, 32,
2989 TFS(&tfs_tape_attr_unload), 0x00000002, "If this device supports unload", HFILL }},
2991 { &hf_ndmp_tape_capability, {
2992 "Tape Capabilities", "ndmp.tape.capability", FT_NONE, BASE_NONE,
2993 NULL, 0, "Tape Capabilities", HFILL }},
2995 { &hf_ndmp_tape_capability_name, {
2996 "Name", "ndmp.tape.cap.name", FT_STRING, BASE_NONE,
2997 NULL, 0, "Name for this env-variable", HFILL }},
2999 { &hf_ndmp_tape_capability_value, {
3000 "Value", "ndmp.tape.cap.value", FT_STRING, BASE_NONE,
3001 NULL, 0, "Value for this env-variable", HFILL }},
3003 { &hf_ndmp_scsi_info, {
3004 "SCSI Info", "ndmp.scsi.info", FT_NONE, BASE_NONE,
3005 NULL, 0, "SCSI Info", HFILL }},
3007 { &hf_ndmp_scsi_model, {
3008 "Model", "ndmp.scsi.model", FT_STRING, BASE_NONE,
3009 NULL, 0, "Model of the SCSI device", HFILL }},
3011 { &hf_ndmp_server_vendor, {
3012 "Vendor", "ndmp.server.vendor", FT_STRING, BASE_NONE,
3013 NULL, 0, "Name of vendor", HFILL }},
3015 { &hf_ndmp_server_product, {
3016 "Product", "ndmp.server.product", FT_STRING, BASE_NONE,
3017 NULL, 0, "Name of product", HFILL }},
3019 { &hf_ndmp_server_revision, {
3020 "Revision", "ndmp.server.revision", FT_STRING, BASE_NONE,
3021 NULL, 0, "Revision of this product", HFILL }},
3023 { &hf_ndmp_auth_types, {
3024 "Auth types", "ndmp.auth.types", FT_NONE, BASE_NONE,
3025 NULL, 0, "Auth types", HFILL }},
3027 { &hf_ndmp_scsi_device, {
3028 "Device", "ndmp.scsi.device", FT_STRING, BASE_NONE,
3029 NULL, 0, "Name of SCSI Device", HFILL }},
3031 { &hf_ndmp_scsi_controller, {
3032 "Controller", "ndmp.scsi.controller", FT_UINT32, BASE_DEC,
3033 NULL, 0, "Target Controller", HFILL }},
3035 { &hf_ndmp_scsi_id, {
3036 "ID", "ndmp.scsi.id", FT_UINT32, BASE_DEC,
3037 NULL, 0, "Target ID", HFILL }},
3039 { &hf_ndmp_scsi_lun, {
3040 "LUN", "ndmp.scsi.lun", FT_UINT32, BASE_DEC,
3041 NULL, 0, "Target LUN", HFILL }},
3043 { &hf_ndmp_execute_cdb_flags_data_in, {
3044 "DATA_IN", "ndmp.execute_cdb.flags.data_in", FT_BOOLEAN, 32,
3045 NULL, 0x00000001, "DATA_IN", HFILL }},
3047 { &hf_ndmp_execute_cdb_flags_data_out, {
3048 "DATA_OUT", "ndmp.execute_cdb.flags.data_out", FT_BOOLEAN, 32,
3049 NULL, 0x00000002, "DATA_OUT", HFILL }},
3051 { &hf_ndmp_execute_cdb_timeout, {
3052 "Timeout", "ndmp.execute_cdb.timeout", FT_UINT32, BASE_DEC,
3053 NULL, 0, "Reselect timeout, in milliseconds", HFILL }},
3055 { &hf_ndmp_execute_cdb_datain_len, {
3056 "Data in length", "ndmp.execute_cdb.datain_len", FT_UINT32, BASE_DEC,
3057 NULL, 0, "Expected length of data bytes to read", HFILL }},
3059 { &hf_ndmp_execute_cdb_cdb_len, {
3060 "CDB length", "ndmp.execute_cdb.cdb_len", FT_UINT32, BASE_DEC,
3061 NULL, 0, "Length of CDB", HFILL }},
3063 { &hf_ndmp_execute_cdb_dataout, {
3064 "Data out", "ndmp.execute_cdb.dataout", FT_BYTES, BASE_NONE,
3065 NULL, 0, "Data to be transferred to the SCSI device", HFILL }},
3067 { &hf_ndmp_execute_cdb_status, {
3068 "Status", "ndmp.execute_cdb.status", FT_UINT8, BASE_DEC,
3069 VALS(scsi_status_val), 0, "SCSI status", HFILL }},
3071 { &hf_ndmp_execute_cdb_dataout_len, {
3072 "Data out length", "ndmp.execute_cdb.dataout_len", FT_UINT32, BASE_DEC,
3073 NULL, 0, "Number of bytes transferred to the device", HFILL }},
3075 { &hf_ndmp_execute_cdb_datain, {
3076 "Data in", "ndmp.execute_cdb.datain", FT_BYTES, BASE_NONE,
3077 NULL, 0, "Data transferred from the SCSI device", HFILL }},
3079 { &hf_ndmp_execute_cdb_sns_len, {
3080 "Sense data length", "ndmp.execute_cdb.sns_len", FT_UINT32, BASE_DEC,
3081 NULL, 0, "Length of sense data", HFILL }},
3083 { &hf_ndmp_tape_open_mode, {
3084 "Mode", "ndmp.tape.open_mode", FT_UINT32, BASE_DEC,
3085 VALS(tape_open_mode_vals), 0, "Mode to open tape in", HFILL }},
3087 { &hf_ndmp_tape_invalid_file_num, {
3088 "", "ndmp.tape.invalid.file_num", FT_BOOLEAN, 32,
3089 TFS(&tfs_ndmp_tape_invalid_file_num), 0x00000001, "invalid_file_num", HFILL }},
3091 { &hf_ndmp_tape_invalid_soft_errors, {
3092 "", "ndmp.tape.invalid.soft_errors", FT_BOOLEAN, 32,
3093 TFS(&tfs_ndmp_tape_invalid_soft_errors), 0x00000002, "soft_errors", HFILL }},
3095 { &hf_ndmp_tape_invalid_block_size, {
3096 "", "ndmp.tape.invalid.block_size", FT_BOOLEAN, 32,
3097 TFS(&tfs_ndmp_tape_invalid_block_size), 0x00000004, "block_size", HFILL }},
3099 { &hf_ndmp_tape_invalid_block_no, {
3100 "", "ndmp.tape.invalid.block_no", FT_BOOLEAN, 32,
3101 TFS(&tfs_ndmp_tape_invalid_block_no), 0x00000008, "block_no", HFILL }},
3103 { &hf_ndmp_tape_invalid_total_space, {
3104 "", "ndmp.tape.invalid.total_space", FT_BOOLEAN, 32,
3105 TFS(&tfs_ndmp_tape_invalid_total_space), 0x00000010, "total_space", HFILL }},
3107 { &hf_ndmp_tape_invalid_space_remain, {
3108 "", "ndmp.tape.invalid.space_remain", FT_BOOLEAN, 32,
3109 TFS(&tfs_ndmp_tape_invalid_space_remain), 0x00000020, "space_remain", HFILL }},
3111 { &hf_ndmp_tape_invalid_partition, {
3112 "", "ndmp.tape.invalid.partition", FT_BOOLEAN, 32,
3113 TFS(&tfs_ndmp_tape_invalid_partition), 0x00000040, "partition", HFILL }},
3115 { &hf_ndmp_tape_flags_no_rewind, {
3116 "", "ndmp.tape.flags.no_rewind", FT_BOOLEAN, 32,
3117 TFS(&tfs_ndmp_tape_flags_no_rewind), 0x00000008, "no_rewind", HFILL, }},
3119 { &hf_ndmp_tape_flags_write_protect, {
3120 "", "ndmp.tape.flags.write_protect", FT_BOOLEAN, 32,
3121 TFS(&tfs_ndmp_tape_flags_write_protect), 0x00000010, "write_protect", HFILL, }},
3123 { &hf_ndmp_tape_flags_error, {
3124 "", "ndmp.tape.flags.error", FT_BOOLEAN, 32,
3125 TFS(&tfs_ndmp_tape_flags_error), 0x00000020, "error", HFILL, }},
3127 { &hf_ndmp_tape_flags_unload, {
3128 "", "ndmp.tape.flags.unload", FT_BOOLEAN, 32,
3129 TFS(&tfs_ndmp_tape_flags_unload), 0x00000040, "unload", HFILL, }},
3131 { &hf_ndmp_tape_file_num, {
3132 "file_num", "ndmp.tape.status.file_num", FT_UINT32, BASE_DEC,
3133 NULL, 0, "file_num", HFILL }},
3135 { &hf_ndmp_tape_soft_errors, {
3136 "soft_errors", "ndmp.tape.status.soft_errors", FT_UINT32, BASE_DEC,
3137 NULL, 0, "soft_errors", HFILL }},
3139 { &hf_ndmp_tape_block_size, {
3140 "block_size", "ndmp.tape.status.block_size", FT_UINT32, BASE_DEC,
3141 NULL, 0, "block_size", HFILL }},
3143 { &hf_ndmp_tape_block_no, {
3144 "block_no", "ndmp.tape.status.block_no", FT_UINT32, BASE_DEC,
3145 NULL, 0, "block_no", HFILL }},
3147 { &hf_ndmp_tape_total_space, {
3148 "total_space", "ndmp.tape.status.total_space", FT_UINT64, BASE_DEC,
3149 NULL, 0, "total_space", HFILL }},
3151 { &hf_ndmp_tape_space_remain, {
3152 "space_remain", "ndmp.tape.status.space_remain", FT_UINT64, BASE_DEC,
3153 NULL, 0, "space_remain", HFILL }},
3155 { &hf_ndmp_tape_partition, {
3156 "partition", "ndmp.tape.status.partition", FT_UINT32, BASE_DEC,
3157 NULL, 0, "partition", HFILL }},
3159 { &hf_ndmp_tape_mtio_op, {
3160 "Operation", "ndmp.tape.mtio.op", FT_UINT32, BASE_DEC,
3161 VALS(tape_mtio_vals), 0, "MTIO Operation", HFILL }},
3164 "Count", "ndmp.count", FT_UINT32, BASE_DEC,
3165 NULL, 0, "Number of bytes/objects/operations", HFILL }},
3167 { &hf_ndmp_resid_count, {
3168 "Resid Count", "ndmp.resid_count", FT_UINT32, BASE_DEC,
3169 NULL, 0, "Number of remaining bytes/objects/operations", HFILL }},
3171 { &hf_ndmp_mover_state, {
3172 "State", "ndmp.mover.state", FT_UINT32, BASE_DEC,
3173 VALS(mover_state_vals), 0, "State of the selected mover", HFILL }},
3175 { &hf_ndmp_mover_pause, {
3176 "Pause", "ndmp.mover.pause", FT_UINT32, BASE_DEC,
3177 VALS(mover_pause_vals), 0, "Reason why the mover paused", HFILL }},
3180 "Halt", "ndmp.halt", FT_UINT32, BASE_DEC,
3181 VALS(halt_vals), 0, "Reason why it halted", HFILL }},
3183 { &hf_ndmp_record_size, {
3184 "Record Size", "ndmp.record.size", FT_UINT32, BASE_DEC,
3185 NULL, 0, "Record size in bytes", HFILL }},
3187 { &hf_ndmp_record_num, {
3188 "Record Num", "ndmp.record.num", FT_UINT32, BASE_DEC,
3189 NULL, 0, "Number of records", HFILL }},
3191 { &hf_ndmp_data_written, {
3192 "Data Written", "ndmp.data.written", FT_UINT64, BASE_DEC,
3193 NULL, 0, "Number of data bytes written", HFILL }},
3195 { &hf_ndmp_seek_position, {
3196 "Seek Position", "ndmp.seek.position", FT_UINT64, BASE_DEC,
3197 NULL, 0, "Current seek position on device", HFILL }},
3199 { &hf_ndmp_bytes_left_to_read, {
3200 "Bytes left to read", "ndmp.bytes_left_to_read", FT_UINT64, BASE_DEC,
3201 NULL, 0, "Number of bytes left to be read from the device", HFILL }},
3203 { &hf_ndmp_window_offset, {
3204 "Window Offset", "ndmp.window.offset", FT_UINT64, BASE_DEC,
3205 NULL, 0, "Offset to window in bytes", HFILL }},
3207 { &hf_ndmp_window_length, {
3208 "Window Length", "ndmp.window.length", FT_UINT64, BASE_DEC,
3209 NULL, 0, "Size of window in bytes", HFILL }},
3211 { &hf_ndmp_addr_ip, {
3212 "IP Address", "ndmp.addr.ip", FT_IPv4, BASE_DEC,
3213 NULL, 0, "IP Address", HFILL }},
3215 { &hf_ndmp_addr_tcp, {
3216 "TCP Port", "ndmp.addr.tcp_port", FT_UINT32, BASE_DEC,
3217 NULL, 0, "TCP Port", HFILL }},
3219 { &hf_ndmp_addr_fcal_loop_id, {
3220 "Loop ID", "ndmp.addr.loop_id", FT_UINT32, BASE_HEX,
3221 NULL, 0, "FCAL Loop ID", HFILL }},
3223 { &hf_ndmp_addr_ipc, {
3224 "IPC", "ndmp.addr.ipc", FT_BYTES, BASE_HEX,
3225 NULL, 0, "IPC identifier", HFILL }},
3227 { &hf_ndmp_mover_mode, {
3228 "Mode", "ndmp.mover.mode", FT_UINT32, BASE_HEX,
3229 VALS(mover_mode_vals), 0, "Mover Mode", HFILL }},
3231 { &hf_ndmp_file_name, {
3232 "File", "ndmp.file", FT_STRING, BASE_NONE,
3233 NULL, 0, "Name of File", HFILL }},
3235 { &hf_ndmp_nt_file_name, {
3236 "NT File", "ndmp.file", FT_STRING, BASE_NONE,
3237 NULL, 0, "NT Name of File", HFILL }},
3239 { &hf_ndmp_dos_file_name, {
3240 "DOS File", "ndmp.file", FT_STRING, BASE_NONE,
3241 NULL, 0, "DOS Name of File", HFILL }},
3243 { &hf_ndmp_log_type, {
3244 "Type", "ndmp.log.type", FT_UINT32, BASE_HEX,
3245 VALS(log_type_vals), 0, "Type of log entry", HFILL }},
3247 { &hf_ndmp_log_message_id, {
3248 "Message ID", "ndmp.log.message.id", FT_UINT32, BASE_DEC,
3249 NULL, 0, "ID of this log entry", HFILL }},
3251 { &hf_ndmp_log_message, {
3252 "Message", "ndmp.log.message", FT_STRING, BASE_NONE,
3253 NULL, 0, "Log entry", HFILL }},
3255 { &hf_ndmp_halt_reason, {
3256 "Reason", "ndmp.halt.reason", FT_STRING, BASE_NONE,
3257 NULL, 0, "Textual reason for why it halted", HFILL }},
3259 { &hf_ndmp_connected, {
3260 "Connected", "ndmp.connected", FT_UINT32, BASE_DEC,
3261 VALS(connected_vals), 0, "Status of connection", HFILL }},
3263 { &hf_ndmp_connected_reason, {
3264 "Reason", "ndmp.connected.reason", FT_STRING, BASE_NONE,
3265 NULL, 0, "Textual description of the connection status", HFILL }},
3267 { &hf_ndmp_auth_id, {
3268 "ID", "ndmp.auth.id", FT_STRING, BASE_NONE,
3269 NULL, 0, "ID of client authenticating", HFILL }},
3271 { &hf_ndmp_auth_password, {
3272 "Password", "ndmp.auth.password", FT_STRING, BASE_NONE,
3273 NULL, 0, "Password of client authenticating", HFILL }},
3276 "Data", "ndmp.data", FT_BYTES, BASE_HEX,
3277 NULL, 0, "Data written/read", HFILL }},
3280 "Files", "ndmp.files", FT_NONE, 0,
3281 NULL, 0, "List of files", HFILL }},
3283 { &hf_ndmp_file_names, {
3284 "File Names", "ndmp.file.names", FT_NONE, 0,
3285 NULL, 0, "List of file names", HFILL }},
3287 { &hf_ndmp_file_fs_type, {
3288 "File FS Type", "ndmp.file.fs_type", FT_UINT32, BASE_DEC,
3289 VALS(file_fs_type_vals), 0, "Type of file permissions (UNIX or NT)", HFILL }},
3291 { &hf_ndmp_file_type, {
3292 "File Type", "ndmp.file.type", FT_UINT32, BASE_DEC,
3293 VALS(file_type_vals), 0, "Type of file", HFILL }},
3295 { &hf_ndmp_file_stats, {
3296 "File Stats", "ndmp.file.stats", FT_NONE, 0,
3297 NULL, 0, "List of file stats", HFILL }},
3299 { &hf_ndmp_file_node, {
3300 "Node", "ndmp.file.node", FT_UINT64, BASE_DEC,
3301 NULL, 0, "Node used for direct access", HFILL }},
3303 { &hf_ndmp_file_parent, {
3304 "Parent", "ndmp.file.parent", FT_UINT64, BASE_DEC,
3305 NULL, 0, "Parent node(directory) for this node", HFILL }},
3307 { &hf_ndmp_file_fh_info, {
3308 "FH Info", "ndmp.file.fh_info", FT_UINT64, BASE_DEC,
3309 NULL, 0, "FH Info used for direct access", HFILL }},
3311 { &hf_ndmp_file_invalid_atime, {
3312 "", "ndmp.file.invalid_atime", FT_BOOLEAN, 32,
3313 TFS(&tfs_ndmp_file_invalid_atime), 0x00000001, "invalid_atime", HFILL, }},
3315 { &hf_ndmp_file_invalid_ctime, {
3316 "", "ndmp.file.invalid_ctime", FT_BOOLEAN, 32,
3317 TFS(&tfs_ndmp_file_invalid_ctime), 0x00000002, "invalid_ctime", HFILL, }},
3319 { &hf_ndmp_file_invalid_group, {
3320 "", "ndmp.file.invalid_group", FT_BOOLEAN, 32,
3321 TFS(&tfs_ndmp_file_invalid_group), 0x00000004, "invalid_group", HFILL, }},
3323 { &hf_ndmp_file_mtime, {
3324 "mtime", "ndmp.file.mtime", FT_ABSOLUTE_TIME, BASE_NONE,
3325 NULL, 0, "Timestamp for mtime for this file", HFILL }},
3327 { &hf_ndmp_file_atime, {
3328 "atime", "ndmp.file.atime", FT_ABSOLUTE_TIME, BASE_NONE,
3329 NULL, 0, "Timestamp for atime for this file", HFILL }},
3331 { &hf_ndmp_file_ctime, {
3332 "ctime", "ndmp.file.ctime", FT_ABSOLUTE_TIME, BASE_NONE,
3333 NULL, 0, "Timestamp for ctime for this file", HFILL }},
3335 { &hf_ndmp_file_owner, {
3336 "Owner", "ndmp.file.owner", FT_UINT32, BASE_DEC,
3337 NULL, 0, "UID for UNIX, owner for NT", HFILL }},
3339 { &hf_ndmp_file_group, {
3340 "Group", "ndmp.file.group", FT_UINT32, BASE_DEC,
3341 NULL, 0, "GID for UNIX, NA for NT", HFILL }},
3343 { &hf_ndmp_file_fattr, {
3344 "Fattr", "ndmp.file.fattr", FT_UINT32, BASE_HEX,
3345 NULL, 0, "Mode for UNIX, fattr for NT", HFILL }},
3347 { &hf_ndmp_file_size, {
3348 "Size", "ndmp.file.size", FT_UINT64, BASE_DEC,
3349 NULL, 0, "File Size", HFILL }},
3351 { &hf_ndmp_file_links, {
3352 "Links", "ndmp.file.links", FT_UINT32, BASE_DEC,
3353 NULL, 0, "Number of links to this file", HFILL }},
3356 "Dirs", "ndmp.dirs", FT_NONE, 0,
3357 NULL, 0, "List of directories", HFILL }},
3360 "Nodes", "ndmp.nodes", FT_NONE, 0,
3361 NULL, 0, "List of nodes", HFILL }},
3364 "Nlist", "ndmp.nlist", FT_NONE, 0,
3365 NULL, 0, "List of names", HFILL }},
3367 { &hf_ndmp_bu_original_path, {
3368 "Original Path", "ndmp.bu.original_path", FT_STRING, BASE_NONE,
3369 NULL, 0, "Original path where backup was created", HFILL }},
3371 { &hf_ndmp_bu_destination_dir, {
3372 "Destination Dir", "ndmp.bu.destination_dir", FT_STRING, BASE_NONE,
3373 NULL, 0, "Destination directory to restore backup to", HFILL }},
3375 { &hf_ndmp_bu_new_name, {
3376 "New Name", "ndmp.bu.new_name", FT_STRING, BASE_NONE,
3377 NULL, 0, "New Name", HFILL }},
3379 { &hf_ndmp_bu_other_name, {
3380 "Other Name", "ndmp.bu.other_name", FT_STRING, BASE_NONE,
3381 NULL, 0, "Other Name", HFILL }},
3383 { &hf_ndmp_state_invalid_ebr, {
3384 "", "ndmp.bu.state.invalid_ebr", FT_BOOLEAN, 32,
3385 TFS(&tfs_ndmp_state_invalid_ebr), 0x00000001, "Whether EstimatedBytesLeft is valid or not", HFILL, }},
3387 { &hf_ndmp_state_invalid_etr, {
3388 "", "ndmp.bu.state.invalid_etr", FT_BOOLEAN, 32,
3389 TFS(&tfs_ndmp_state_invalid_etr), 0x00000002, "Whether EstimatedTimeLeft is valid or not", HFILL, }},
3391 { &hf_ndmp_bu_operation, {
3392 "Operation", "ndmp.bu.operation", FT_UINT32, BASE_DEC,
3393 VALS(bu_operation_vals), 0, "BU Operation", HFILL, }},
3395 { &hf_ndmp_data_state, {
3396 "State", "ndmp.data.state", FT_UINT32, BASE_DEC,
3397 VALS(data_state_vals), 0, "Data state", HFILL, }},
3399 { &hf_ndmp_data_halted, {
3400 "Halted Reason", "ndmp.data.halted", FT_UINT32, BASE_DEC,
3401 VALS(data_halted_vals), 0, "Data halted reason", HFILL, }},
3403 { &hf_ndmp_data_bytes_processed, {
3404 "Bytes Processed", "ndmp.data.bytes_processed", FT_UINT64, BASE_DEC,
3405 NULL, 0, "Number of bytes processed", HFILL }},
3407 { &hf_ndmp_data_est_bytes_remain, {
3408 "Est Bytes Remain", "ndmp.data.est_bytes_remain", FT_UINT64, BASE_DEC,
3409 NULL, 0, "Estimated number of bytes remaining", HFILL }},
3411 { &hf_ndmp_data_est_time_remain, {
3412 "Est Time Remain", "ndmp.data.est_time_remain", FT_RELATIVE_TIME, BASE_DEC,
3413 NULL, 0, "Estimated time remaining", HFILL }},
3416 static gint *ett[] = {
3419 &ett_ndmp_butype_attrs,
3420 &ett_ndmp_fs_invalid,
3421 &ett_ndmp_tape_attr,
3422 &ett_ndmp_execute_cdb_flags,
3423 &ett_ndmp_execute_cdb_cdb,
3424 &ett_ndmp_execute_cdb_sns,
3425 &ett_ndmp_execute_cdb_payload,
3426 &ett_ndmp_tape_invalid,
3427 &ett_ndmp_tape_flags,
3430 &ett_ndmp_file_name,
3431 &ett_ndmp_file_stats,
3432 &ett_ndmp_file_invalids,
3433 &ett_ndmp_state_invalids,
3436 module_t *ndmp_module;
3438 proto_ndmp = proto_register_protocol("Network Data Management Protocol", "NDMP", "ndmp");
3439 proto_register_field_array(proto_ndmp, hf_ndmp, array_length(hf_ndmp));
3441 proto_register_subtree_array(ett, array_length(ett));
3443 /* desegmentation */
3444 ndmp_module = prefs_register_protocol(proto_ndmp, NULL);
3445 prefs_register_bool_preference(ndmp_module, "desegment",
3446 "Desegment all NDMP messages spanning multiple TCP segments",
3447 "Whether the dissector should desegment NDMP messages",
3449 prefs_register_bool_preference(ndmp_module, "defragment",
3450 "Defragment all multi-fragment NDMP messages",
3451 "Whether the dissector should defragment multi-fragment NDMP messages",
3456 proto_reg_handoff_ndmp(void)
3458 dissector_handle_t ndmp_handle;
3460 ndmp_handle = create_dissector_handle(dissect_ndmp, proto_ndmp);
3461 dissector_add("tcp.port",TCP_PORT_NDMP, ndmp_handle);