diff options
Diffstat (limited to 'epan/dissectors/packet-pvfs2.c')
-rw-r--r-- | epan/dissectors/packet-pvfs2.c | 358 |
1 files changed, 178 insertions, 180 deletions
diff --git a/epan/dissectors/packet-pvfs2.c b/epan/dissectors/packet-pvfs2.c index fe929142a1..1ee3fd320d 100644 --- a/epan/dissectors/packet-pvfs2.c +++ b/epan/dissectors/packet-pvfs2.c @@ -7,6 +7,9 @@ * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs * + * Dissector for Parallel Virtual File System (PVFS) version 2. + * https://web.archive.org/web/20160701052501/http://www.pvfs.org/ + * * Copied from packet-smb.c and others * * TODO @@ -25,6 +28,7 @@ #include <epan/prefs.h> #include <epan/strutil.h> #include <epan/expert.h> +#include <epan/charsets.h> #include <wsutil/ws_roundup.h> #include "packet-tcp.h" @@ -42,150 +46,152 @@ static gboolean pvfs_desegment = TRUE; void proto_register_pvfs(void); void proto_reg_handoff_pvfs(void); +static dissector_handle_t pvfs_handle; + /* Initialize the protocol and registered fields */ -static int proto_pvfs = -1; -static int hf_pvfs_magic_nr = -1; -static int hf_pvfs_uid = -1; -static int hf_pvfs_gid = -1; -static int hf_pvfs_mode = -1; -static int hf_pvfs_tag = -1; -static int hf_pvfs_size = -1; -static int hf_pvfs_release_number = -1; -static int hf_pvfs_encoding = -1; -static int hf_pvfs_server_op = -1; -/* static int hf_pvfs_handle = -1; */ -static int hf_pvfs_fs_id = -1; -static int hf_pvfs_attrmask = -1; -static int hf_pvfs_attr = -1; -static int hf_pvfs_ds_type = -1; -static int hf_pvfs_error = -1; -static int hf_pvfs_atime = -1; -static int hf_pvfs_atime_sec = -1; -static int hf_pvfs_atime_nsec = -1; -static int hf_pvfs_mtime = -1; -static int hf_pvfs_mtime_sec = -1; -static int hf_pvfs_mtime_nsec = -1; -static int hf_pvfs_ctime = -1; -static int hf_pvfs_ctime_sec = -1; -static int hf_pvfs_ctime_nsec = -1; -static int hf_pvfs_parent_atime = -1; -static int hf_pvfs_parent_atime_sec = -1; -static int hf_pvfs_parent_atime_nsec = -1; -static int hf_pvfs_parent_mtime = -1; -static int hf_pvfs_parent_mtime_sec = -1; -static int hf_pvfs_parent_mtime_nsec = -1; -static int hf_pvfs_parent_ctime = -1; -static int hf_pvfs_parent_ctime_sec = -1; -static int hf_pvfs_parent_ctime_nsec = -1; -static int hf_pvfs_distribution = -1; -static int hf_pvfs_dfile_count = -1; -static int hf_pvfs_dirent_count = -1; -static int hf_pvfs_directory_version = -1; -static int hf_pvfs_path = -1; -static int hf_pvfs_total_completed = -1; -static int hf_pvfs_io_dist = -1; -static int hf_pvfs_aggregate_size = -1; -static int hf_pvfs_io_type = -1; -static int hf_pvfs_flowproto_type = -1; -static int hf_pvfs_server_param = -1; -static int hf_pvfs_prev_value = -1; -/* static int hf_pvfs_ram_free_bytes = -1; */ -static int hf_pvfs_bytes_available = -1; -static int hf_pvfs_bytes_total = -1; -static int hf_pvfs_ram_bytes_total = -1; -static int hf_pvfs_ram_bytes_free = -1; -static int hf_pvfs_load_average_1s = -1; -static int hf_pvfs_load_average_5s = -1; -static int hf_pvfs_load_average_15s = -1; -static int hf_pvfs_uptime_seconds = -1; -static int hf_pvfs_handles_available = -1; -static int hf_pvfs_handles_total = -1; -static int hf_pvfs_unused = -1; -static int hf_pvfs_context_id = -1; -static int hf_pvfs_offset = -1; -static int hf_pvfs_stride = -1; -static int hf_pvfs_lb = -1; -static int hf_pvfs_ub = -1; -static int hf_pvfs_end_time_ms = -1; -static int hf_pvfs_cur_time_ms = -1; -static int hf_pvfs_start_time_ms = -1; -static int hf_pvfs_bytes_written = -1; -static int hf_pvfs_bytes_read = -1; -static int hf_pvfs_metadata_write = -1; -static int hf_pvfs_metadata_read = -1; -static int hf_pvfs_b_size = -1; -static int hf_pvfs_k_size = -1; -static int hf_pvfs_id_gen_t = -1; -static int hf_pvfs_attribute_key = -1; -static int hf_pvfs_attribute_value = -1; -static int hf_pvfs_strip_size = -1; -static int hf_pvfs_ereg = -1; -static int hf_pvfs_sreg = -1; -static int hf_pvfs_num_eregs = -1; -static int hf_pvfs_num_blocks = -1; -static int hf_pvfs_num_contig_chunks = -1; -static int hf_pvfs_server_nr = -1; -static int hf_pvfs_server_count = -1; -static int hf_pvfs_fh_length = -1; -static int hf_pvfs_fh_hash = -1; -static int hf_pvfs_permissions = -1; -static int hf_pvfs_server_mode = -1; -static int hf_pvfs_depth = -1; -static int hf_pvfs_num_nested_req = -1; -static int hf_pvfs_committed = -1; -static int hf_pvfs_refcount = -1; -static int hf_pvfs_numreq = -1; -static int hf_pvfs_truncate_request_flags = -1; -static int hf_pvfs_ds_position = -1; -static int hf_pvfs_dirent_limit = -1; -static int hf_pvfs_flush_request_flags = -1; -static int hf_pvfs_next_id = -1; -static int hf_pvfs_mgmt_perf_mon_request_count = -1; -static int hf_pvfs_mgmt_perf_mon_request_event_count = -1; -static int hf_pvfs_lookup_path_response_handle_count = -1; -static int hf_pvfs_getconfig_response_total_bytes = -1; -static int hf_pvfs_getconfig_response_lines = -1; -static int hf_pvfs_getconfig_response_config_bytes = -1; -static int hf_pvfs_mgmt_perf_mon_response_suggested_next_id = -1; -static int hf_pvfs_mgmt_perf_stat_valid_flag = -1; -static int hf_pvfs_mgmt_perf_stat_id = -1; -static int hf_pvfs_mgmt_perf_mon_response_perf_array_count = -1; -static int hf_pvfs_mgmt_iterate_handles_response_ds_position = -1; -static int hf_pvfs_mgmt_iterate_handles_response_handle_count = -1; -static int hf_pvfs_mgmt_dspace_info_list_response_dspace_info_count = -1; -static int hf_pvfs_mgmt_event_mon_response_api = -1; -static int hf_pvfs_mgmt_event_mon_response_operation = -1; -static int hf_pvfs_mgmt_event_mon_response_value = -1; -static int hf_pvfs_mgmt_event_mon_response_flags = -1; -static int hf_pvfs_mgmt_event_mon_response_tv_sec = -1; -static int hf_pvfs_mgmt_event_mon_response_tv_usec = -1; -static int hf_pvfs_fill_bytes = -1; -static int hf_pvfs_target_path_len = -1; -static int hf_pvfs_version2 = -1; -static int hf_pvfs_flow_data = -1; -static int hf_pvfs_getconfig_response_entry = -1; -static int hf_fhandle_data = -1; -static int hf_pvfs_opaque_length = -1; +static int proto_pvfs; +static int hf_pvfs_magic_nr; +static int hf_pvfs_uid; +static int hf_pvfs_gid; +static int hf_pvfs_mode; +static int hf_pvfs_tag; +static int hf_pvfs_size; +static int hf_pvfs_release_number; +static int hf_pvfs_encoding; +static int hf_pvfs_server_op; +/* static int hf_pvfs_handle; */ +static int hf_pvfs_fs_id; +static int hf_pvfs_attrmask; +static int hf_pvfs_attr; +static int hf_pvfs_ds_type; +static int hf_pvfs_error; +static int hf_pvfs_atime; +static int hf_pvfs_atime_sec; +static int hf_pvfs_atime_nsec; +static int hf_pvfs_mtime; +static int hf_pvfs_mtime_sec; +static int hf_pvfs_mtime_nsec; +static int hf_pvfs_ctime; +static int hf_pvfs_ctime_sec; +static int hf_pvfs_ctime_nsec; +static int hf_pvfs_parent_atime; +static int hf_pvfs_parent_atime_sec; +static int hf_pvfs_parent_atime_nsec; +static int hf_pvfs_parent_mtime; +static int hf_pvfs_parent_mtime_sec; +static int hf_pvfs_parent_mtime_nsec; +static int hf_pvfs_parent_ctime; +static int hf_pvfs_parent_ctime_sec; +static int hf_pvfs_parent_ctime_nsec; +static int hf_pvfs_distribution; +static int hf_pvfs_dfile_count; +static int hf_pvfs_dirent_count; +static int hf_pvfs_directory_version; +static int hf_pvfs_path; +static int hf_pvfs_total_completed; +static int hf_pvfs_io_dist; +static int hf_pvfs_aggregate_size; +static int hf_pvfs_io_type; +static int hf_pvfs_flowproto_type; +static int hf_pvfs_server_param; +static int hf_pvfs_prev_value; +/* static int hf_pvfs_ram_free_bytes; */ +static int hf_pvfs_bytes_available; +static int hf_pvfs_bytes_total; +static int hf_pvfs_ram_bytes_total; +static int hf_pvfs_ram_bytes_free; +static int hf_pvfs_load_average_1s; +static int hf_pvfs_load_average_5s; +static int hf_pvfs_load_average_15s; +static int hf_pvfs_uptime_seconds; +static int hf_pvfs_handles_available; +static int hf_pvfs_handles_total; +static int hf_pvfs_unused; +static int hf_pvfs_context_id; +static int hf_pvfs_offset; +static int hf_pvfs_stride; +static int hf_pvfs_lb; +static int hf_pvfs_ub; +static int hf_pvfs_end_time_ms; +static int hf_pvfs_cur_time_ms; +static int hf_pvfs_start_time_ms; +static int hf_pvfs_bytes_written; +static int hf_pvfs_bytes_read; +static int hf_pvfs_metadata_write; +static int hf_pvfs_metadata_read; +static int hf_pvfs_b_size; +static int hf_pvfs_k_size; +static int hf_pvfs_id_gen_t; +static int hf_pvfs_attribute_key; +static int hf_pvfs_attribute_value; +static int hf_pvfs_strip_size; +static int hf_pvfs_ereg; +static int hf_pvfs_sreg; +static int hf_pvfs_num_eregs; +static int hf_pvfs_num_blocks; +static int hf_pvfs_num_contig_chunks; +static int hf_pvfs_server_nr; +static int hf_pvfs_server_count; +static int hf_pvfs_fh_length; +static int hf_pvfs_fh_hash; +static int hf_pvfs_permissions; +static int hf_pvfs_server_mode; +static int hf_pvfs_depth; +static int hf_pvfs_num_nested_req; +static int hf_pvfs_committed; +static int hf_pvfs_refcount; +static int hf_pvfs_numreq; +static int hf_pvfs_truncate_request_flags; +static int hf_pvfs_ds_position; +static int hf_pvfs_dirent_limit; +static int hf_pvfs_flush_request_flags; +static int hf_pvfs_next_id; +static int hf_pvfs_mgmt_perf_mon_request_count; +static int hf_pvfs_mgmt_perf_mon_request_event_count; +static int hf_pvfs_lookup_path_response_handle_count; +static int hf_pvfs_getconfig_response_total_bytes; +static int hf_pvfs_getconfig_response_lines; +static int hf_pvfs_getconfig_response_config_bytes; +static int hf_pvfs_mgmt_perf_mon_response_suggested_next_id; +static int hf_pvfs_mgmt_perf_stat_valid_flag; +static int hf_pvfs_mgmt_perf_stat_id; +static int hf_pvfs_mgmt_perf_mon_response_perf_array_count; +static int hf_pvfs_mgmt_iterate_handles_response_ds_position; +static int hf_pvfs_mgmt_iterate_handles_response_handle_count; +static int hf_pvfs_mgmt_dspace_info_list_response_dspace_info_count; +static int hf_pvfs_mgmt_event_mon_response_api; +static int hf_pvfs_mgmt_event_mon_response_operation; +static int hf_pvfs_mgmt_event_mon_response_value; +static int hf_pvfs_mgmt_event_mon_response_flags; +static int hf_pvfs_mgmt_event_mon_response_tv_sec; +static int hf_pvfs_mgmt_event_mon_response_tv_usec; +static int hf_pvfs_fill_bytes; +static int hf_pvfs_target_path_len; +static int hf_pvfs_version2; +static int hf_pvfs_flow_data; +static int hf_pvfs_getconfig_response_entry; +static int hf_fhandle_data; +static int hf_pvfs_opaque_length; /* Initialize the subtree pointers */ -static gint ett_pvfs = -1; -static gint ett_pvfs_hdr = -1; -static gint ett_pvfs_credentials = -1; -static gint ett_pvfs_server_config = -1; -static gint ett_pvfs_server_config_branch = -1; -static gint ett_pvfs_attrmask = -1; -static gint ett_pvfs_time = -1; -static gint ett_pvfs_extent_array_tree = -1; -static gint ett_pvfs_extent_item = -1; -static gint ett_pvfs_string = -1; -static gint ett_pvfs_attr_tree = -1; -static gint ett_pvfs_distribution = -1; -static gint ett_pvfs_mgmt_perf_stat = -1; -static gint ett_pvfs_mgmt_dspace_info = -1; -static gint ett_pvfs_attr = -1; -static gint ett_pvfs_fh = -1; - -static expert_field ei_pvfs_malformed = EI_INIT; +static gint ett_pvfs; +static gint ett_pvfs_hdr; +static gint ett_pvfs_credentials; +static gint ett_pvfs_server_config; +static gint ett_pvfs_server_config_branch; +static gint ett_pvfs_attrmask; +static gint ett_pvfs_time; +static gint ett_pvfs_extent_array_tree; +static gint ett_pvfs_extent_item; +static gint ett_pvfs_string; +static gint ett_pvfs_attr_tree; +static gint ett_pvfs_distribution; +static gint ett_pvfs_mgmt_perf_stat; +static gint ett_pvfs_mgmt_dspace_info; +static gint ett_pvfs_attr; +static gint ett_pvfs_fh; + +static expert_field ei_pvfs_malformed; #define BMI_MAGIC_NR 51903 @@ -711,7 +717,7 @@ dissect_pvfs2_attrmask(tvbuff_t *tvb, proto_tree *tree, int offset, for (i = 0; i < 32; i++) { - if (attrmask & (1 << i)) + if (attrmask & (1u << i)) proto_tree_add_uint(attrtree, hf_pvfs_attr, tvb, offset, 4, i); } @@ -858,22 +864,16 @@ dissect_pvfs_opaque_data(tvbuff_t *tvb, int offset, } if (string_data) { - char *tmpstr; - - tmpstr = (char *) tvb_get_string_enc(pinfo->pool, tvb, data_offset, - string_length_copy, ENC_ASCII); - - string_buffer = (char *)memcpy(wmem_alloc(pinfo->pool, string_length_copy+1), tmpstr, string_length_copy); + string_buffer = tvb_get_string_enc(pinfo->pool, tvb, data_offset, string_length_copy, ENC_ASCII); } else { string_buffer = (char *) tvb_memcpy(tvb, wmem_alloc(pinfo->pool, string_length_copy+1), data_offset, string_length_copy); + string_buffer[string_length_copy] = '\0'; } - string_buffer[string_length_copy] = '\0'; - /* calculate a nice printable string */ if (string_length) { - if (string_length != string_length_copy) { + if (string_length != strlen(string_buffer)) { if (string_data) { char *formatted; size_t string_buffer_size = 0; @@ -887,7 +887,7 @@ dissect_pvfs_opaque_data(tvbuff_t *tvb, int offset, /* alloc maximum data area */ string_buffer_temp = (char*) wmem_alloc(pinfo->pool, string_buffer_size); /* copy over the data */ - g_snprintf(string_buffer_temp, (gulong)string_buffer_size, + snprintf(string_buffer_temp, string_buffer_size, "%s<TRUNCATED>", formatted); /* append <TRUNCATED> */ /* This way, we get the TRUNCATED even @@ -973,9 +973,9 @@ dissect_pvfs_opaque_data(tvbuff_t *tvb, int offset, static int dissect_pvfs_string(tvbuff_t *tvb, proto_tree *tree, int hfindex, - int offset, const char **string_buffer_ret) + int offset, packet_info *pinfo, const char **string_buffer_ret) { - return dissect_pvfs_opaque_data(tvb, offset, tree, NULL, hfindex, + return dissect_pvfs_opaque_data(tvb, offset, tree, pinfo, hfindex, FALSE, 0, TRUE, string_buffer_ret); } @@ -1165,7 +1165,7 @@ dissect_pvfs_distribution(tvbuff_t *tvb, proto_tree *tree, int offset, /* io_dist */ offset = dissect_pvfs_string(tvb, dist_tree, hf_pvfs_io_dist, offset, - NULL); + pinfo, NULL); /* TODO: only one distribution type is currently supported */ if (issimplestripe) @@ -1268,7 +1268,7 @@ dissect_pvfs_object_attr(tvbuff_t *tvb, proto_tree *tree, int offset, /* target_path */ offset = dissect_pvfs_string(tvb, attr_tree, hf_pvfs_path, - offset, NULL); + offset, pinfo, NULL); } else { @@ -1539,7 +1539,7 @@ dissect_pvfs2_lookup_path_request(tvbuff_t *tvb, proto_tree *tree, int offset, packet_info *pinfo) { /* Path */ - offset = dissect_pvfs_string(tvb, tree, hf_pvfs_path, offset, NULL); + offset = dissect_pvfs_string(tvb, tree, hf_pvfs_path, offset, pinfo, NULL); /* fs_id */ offset = dissect_pvfs_fs_id(tvb, tree, offset); @@ -1560,7 +1560,7 @@ dissect_pvfs2_crdirent_request(tvbuff_t *tvb, proto_tree *tree, int offset, packet_info *pinfo) { /* Filename */ - offset = dissect_pvfs_string(tvb, tree, hf_pvfs_path, offset, NULL); + offset = dissect_pvfs_string(tvb, tree, hf_pvfs_path, offset, pinfo, NULL); offset = dissect_pvfs_fh(tvb, offset, pinfo, tree, "file handle", NULL); @@ -1593,7 +1593,7 @@ dissect_pvfs2_rmdirent_request(tvbuff_t *tvb, proto_tree *tree, int offset, packet_info *pinfo) { /* path */ - offset = dissect_pvfs_string(tvb, tree, hf_pvfs_path, offset, NULL); + offset = dissect_pvfs_string(tvb, tree, hf_pvfs_path, offset, pinfo, NULL); /* handle */ offset = dissect_pvfs_fh(tvb, offset, pinfo, tree, "handle", NULL); @@ -1623,7 +1623,7 @@ dissect_pvfs2_chdirent_request(tvbuff_t *tvb, proto_tree *tree, int offset, packet_info *pinfo) { /* path */ - offset = dissect_pvfs_string(tvb, tree, hf_pvfs_path, offset, NULL); + offset = dissect_pvfs_string(tvb, tree, hf_pvfs_path, offset, pinfo, NULL); /* New directory entry handle */ offset = dissect_pvfs_fh(tvb, offset, pinfo, tree, "new directory handle", @@ -1846,7 +1846,7 @@ dissect_pvfs2_mgmt_remove_dirent_request(tvbuff_t *tvb, offset += 4; /* entry */ - offset = dissect_pvfs_string(tvb, tree, hf_pvfs_path, offset, NULL); + offset = dissect_pvfs_string(tvb, tree, hf_pvfs_path, offset, pinfo, NULL); return offset; } @@ -1866,22 +1866,22 @@ dissect_pvfs2_mgmt_get_dirdata_handle_request(tvbuff_t *tvb, /* TODO: untested/incomplete */ static int -dissect_pvfs_ds_keyval(tvbuff_t *tvb, proto_tree *tree, int offset) +dissect_pvfs_ds_keyval(tvbuff_t *tvb, proto_tree *tree, int offset, packet_info *pinfo) { /* attribute key */ offset = dissect_pvfs_string(tvb, tree, hf_pvfs_attribute_key, offset, - NULL); + pinfo, NULL); /* attribute value */ offset = dissect_pvfs_string(tvb, tree, hf_pvfs_attribute_value, offset, - NULL); + pinfo, NULL); return offset; } /* TODO: incomplete/untested */ static int -dissect_ds_keyval_array(tvbuff_t *tvb, proto_tree *tree, int offset) +dissect_ds_keyval_array(tvbuff_t *tvb, proto_tree *tree, int offset, packet_info *pinfo) { guint32 nKey, i; @@ -1890,7 +1890,7 @@ dissect_ds_keyval_array(tvbuff_t *tvb, proto_tree *tree, int offset) offset += 4; for (i = 0; i < nKey; i++) - offset = dissect_pvfs_ds_keyval(tvb, tree, offset); + offset = dissect_pvfs_ds_keyval(tvb, tree, offset, pinfo); return offset; } @@ -1908,7 +1908,7 @@ dissect_pvfs2_geteattr_request(tvbuff_t *tvb, proto_tree *tree, offset += 4; - offset = dissect_ds_keyval_array(tvb, tree, offset); + offset = dissect_ds_keyval_array(tvb, tree, offset, pinfo); return offset; } @@ -1926,7 +1926,7 @@ dissect_pvfs2_seteattr_request(tvbuff_t *tvb, proto_tree *tree, offset += 4; - offset = dissect_ds_keyval_array(tvb, tree, offset); + offset = dissect_ds_keyval_array(tvb, tree, offset, pinfo); return offset; } @@ -1943,7 +1943,7 @@ dissect_pvfs2_deleattr_request(tvbuff_t *tvb, proto_tree *tree, offset = dissect_pvfs_fs_id(tvb, tree, offset); /* key */ - offset = dissect_pvfs_ds_keyval(tvb, tree, offset); + offset = dissect_pvfs_ds_keyval(tvb, tree, offset, pinfo); return offset; } @@ -1951,7 +1951,7 @@ dissect_pvfs2_deleattr_request(tvbuff_t *tvb, proto_tree *tree, static void pvfc_fmt_release_num(gchar *result, guint32 release_nr) { - g_snprintf( result, ITEM_LABEL_LENGTH, "%d (%d.%d.%d)", + snprintf( result, ITEM_LABEL_LENGTH, "%d (%d.%d.%d)", release_nr, release_nr / 10000, (release_nr % 10000) / 100, @@ -2261,7 +2261,7 @@ dissect_pvfs2_readdir_response(tvbuff_t *tvb, proto_tree *tree, int offset, for (nCount = 0; nCount < dirent_count; nCount++) { - offset = dissect_pvfs_string(tvb, tree, hf_pvfs_path, offset, NULL); + offset = dissect_pvfs_string(tvb, tree, hf_pvfs_path, offset, pinfo, NULL); offset = dissect_pvfs_fh(tvb, offset, pinfo, tree, "handle", NULL); } @@ -2337,9 +2337,9 @@ dissect_pvfs2_getconfig_response(tvbuff_t *tvb, proto_tree *parent_tree, guint32 entry_length = 0, tmp_entry_length = 0; guint32 bufsiz = sizeof(entry); - while ((*ptr != '\n') && (*ptr != '\0') && - (bytes_processed < total_config_bytes) && - (entry_length < bufsiz)) + while ((bytes_processed < total_config_bytes) && + (entry_length < bufsiz) && + (*ptr != '\n') && (*ptr != '\0')) { *pentry++ = *ptr++; @@ -2367,8 +2367,8 @@ dissect_pvfs2_getconfig_response(tvbuff_t *tvb, proto_tree *parent_tree, *pentry= '\0'; - tmp_entry = entry; - tmp_entry_length = entry_length; + tmp_entry = get_ascii_string(pinfo->pool, entry, entry_length); + tmp_entry_length = (guint32)strlen(tmp_entry); /* Remove all whitespace from front of entry */ while ((tmp_entry_length > 0) && (!g_ascii_isalnum(*tmp_entry)) && @@ -2696,7 +2696,7 @@ dissect_pvfs2_geteattr_response(tvbuff_t *tvb, proto_tree *tree, int offset, offset += 4; /* Dissect nKey & ds_keyval array */ - offset = dissect_ds_keyval_array(tvb, tree, offset); + offset = dissect_ds_keyval_array(tvb, tree, offset, pinfo); return offset; } @@ -3575,6 +3575,7 @@ proto_register_pvfs(void) /* Register the protocol name and description */ proto_pvfs = proto_register_protocol("Parallel Virtual File System", "PVFS", "pvfs"); + pvfs_handle = register_dissector("pvfs", dissect_pvfs_heur, proto_pvfs); /* * Required function calls to register the header fields and @@ -3599,9 +3600,6 @@ proto_register_pvfs(void) void proto_reg_handoff_pvfs(void) { - dissector_handle_t pvfs_handle; - - pvfs_handle = create_dissector_handle(dissect_pvfs_heur, proto_pvfs); dissector_add_uint_with_preference("tcp.port", TCP_PORT_PVFS2, pvfs_handle); heur_dissector_add("tcp", dissect_pvfs_heur, "PVFS over TCP", "pvfs_tcp", proto_pvfs, HEURISTIC_ENABLE); |