diff options
author | Michael Mann <mmann78@netscape.net> | 2012-09-27 16:49:31 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2012-09-27 16:49:31 +0000 |
commit | 99d0404b737d7779f8bbd46aa8626a3a8a09cd0a (patch) | |
tree | c76de43482274c70a994b55840655382def65b13 /epan | |
parent | 3b6428bb443db6817a31ead0c53f294b771f1962 (diff) | |
download | wireshark-99d0404b737d7779f8bbd46aa8626a3a8a09cd0a.tar.gz |
replaced decode_enumerated_bitfield calls with itemized filters
svn path=/trunk/; revision=45176
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-nfs.c | 47 | ||||
-rw-r--r-- | epan/dissectors/packet-q2931.c | 20 | ||||
-rw-r--r-- | epan/dissectors/packet-q931.c | 18 |
3 files changed, 48 insertions, 37 deletions
diff --git a/epan/dissectors/packet-nfs.c b/epan/dissectors/packet-nfs.c index d85de12f99..0b9cbf457b 100644 --- a/epan/dissectors/packet-nfs.c +++ b/epan/dissectors/packet-nfs.c @@ -371,6 +371,9 @@ static int hf_nfs_offset4 = -1; static int hf_nfs_specdata1 = -1; static int hf_nfs_specdata2 = -1; static int hf_nfs_lock_type4 = -1; +static int hf_nfs_open_rflags = -1; +static int hf_nfs_open_rflags_mlock = -1; +static int hf_nfs_open_rflags_confirm = -1; static int hf_nfs_reclaim4 = -1; static int hf_nfs_length4 = -1; static int hf_nfs_changeid4 = -1; @@ -8193,32 +8196,17 @@ static const value_string names_open4_result_flags[] = { }; static int -dissect_nfs_open4_rflags(tvbuff_t *tvb, int offset, - proto_tree *tree, const char *name) +dissect_nfs_open4_rflags(tvbuff_t *tvb, int offset, proto_tree *tree) { - guint rflags; - proto_item *rflags_item = NULL; - proto_item *rflags_tree = NULL; - - rflags = tvb_get_ntohl(tvb, offset); + proto_item *rflags_item; + proto_item *rflags_tree; if (tree) { - rflags_item = proto_tree_add_text(tree, tvb, offset, 4, - "%s: 0x%08x", name, rflags); - - { - rflags_tree = proto_item_add_subtree(rflags_item, - ett_nfs_open4_result_flags); - - proto_tree_add_text(rflags_tree, tvb, offset, 4, "%s", - decode_enumerated_bitfield(rflags, OPEN4_RESULT_MLOCK, 2, - names_open4_result_flags, "%s")); - - proto_tree_add_text(rflags_tree, tvb, offset, 4, "%s", - decode_enumerated_bitfield(rflags, OPEN4_RESULT_CONFIRM, 2, - names_open4_result_flags, "%s")); - } + rflags_item = proto_tree_add_item(tree, hf_nfs_open_rflags, tvb, offset, 4, ENC_BIG_ENDIAN); + rflags_tree = proto_item_add_subtree(rflags_item, ett_nfs_open4_result_flags); + proto_tree_add_item(rflags_tree, hf_nfs_open_rflags_mlock, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(rflags_tree, hf_nfs_open_rflags_confirm, tvb, offset, 4, ENC_BIG_ENDIAN); } offset += 4; @@ -9742,8 +9730,7 @@ dissect_nfs_resop4(tvbuff_t *tvb, int offset, packet_info *pinfo, offset = dissect_nfs_stateid4(tvb, offset, newftree, &sid_hash); offset = dissect_nfs_change_info4(tvb, offset, newftree, "change_info"); - offset = dissect_nfs_open4_rflags(tvb, offset, newftree, - "result_flags"); + offset = dissect_nfs_open4_rflags(tvb, offset, newftree); offset = dissect_nfs_attributes(tvb, offset, pinfo, newftree, FATTR4_BITMAP_ONLY); offset = dissect_nfs_open_delegation4(tvb, offset, pinfo, newftree); @@ -11320,6 +11307,18 @@ proto_register_nfs(void) "locktype", "nfs.locktype4", FT_UINT32, BASE_DEC, VALS(names_nfs_lock_type4), 0, NULL, HFILL }}, + { &hf_nfs_open_rflags, { + "results_flags", "nfs.open_rflags", FT_UINT32, BASE_HEX, + VALS(names_nfs_lock_type4), 0, NULL, HFILL }}, + + { &hf_nfs_open_rflags_mlock, { + "mlock", "nfs.open_rflags.mlock", FT_UINT32, BASE_DEC, + VALS(names_open4_result_flags), OPEN4_RESULT_MLOCK, NULL, HFILL }}, + + { &hf_nfs_open_rflags_confirm, { + "confirm", "nfs.open_rflags.confirm", FT_UINT32, BASE_DEC, + VALS(names_open4_result_flags), OPEN4_RESULT_CONFIRM, NULL, HFILL }}, + { &hf_nfs_reclaim4, { "reclaim", "nfs.reclaim4", FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0x0, NULL, HFILL }}, diff --git a/epan/dissectors/packet-q2931.c b/epan/dissectors/packet-q2931.c index d26f358fa2..acc0a758bf 100644 --- a/epan/dissectors/packet-q2931.c +++ b/epan/dissectors/packet-q2931.c @@ -54,6 +54,8 @@ static int hf_q2931_message_flag = -1; static int hf_q2931_message_action_indicator = -1; static int hf_q2931_message_len = -1; static int hf_q2931_ie_handling_instructions = -1; +static int hf_q2931_ie_coding_standard = -1; +static int hf_q2931_ie_action_indicator = -1; static gint ett_q2931 = -1; static gint ett_q2931_ext = -1; @@ -1990,17 +1992,10 @@ dissect_q2931_ie(tvbuff_t *tvb, int offset, int len, proto_tree *tree, "Information element extension: 0x%02x", info_element_ext); ie_ext_tree = proto_item_add_subtree(ti, ett_q2931_ie_ext); - proto_tree_add_text(ie_ext_tree, tvb, offset + 1, 1, "%s", - decode_enumerated_bitfield(info_element_ext, - Q2931_IE_COMPAT_CODING_STD, 8, - coding_std_vals, "Coding standard: %s")); + proto_tree_add_item(ie_ext_tree, hf_q2931_ie_coding_standard, tvb, offset+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(ie_ext_tree, hf_q2931_ie_handling_instructions, tvb, offset+1, 1, ENC_BIG_ENDIAN); if (info_element_ext & Q2931_IE_COMPAT_FOLLOW_INST) { - proto_tree_add_text(ie_ext_tree, tvb, offset + 1, 1, "%s", - decode_enumerated_bitfield(info_element_ext, - Q2931_IE_COMPAT_ACTION_IND, 8, - ie_action_ind_vals, - "Action indicator: %s")); + proto_tree_add_item(ie_ext_tree, hf_q2931_ie_action_indicator, tvb, offset+1, 1, ENC_BIG_ENDIAN); } proto_tree_add_text(ie_tree, tvb, offset + 2, 2, "Length: %u", len); @@ -2177,6 +2172,13 @@ proto_register_q2931(void) { "Handling Instructions", "q2931.ie_handling_instructions", FT_BOOLEAN, 8, TFS(&tfs_q2931_handling_instructions), Q2931_IE_COMPAT_FOLLOW_INST, NULL, HFILL }}, + { &hf_q2931_ie_coding_standard, + { "Coding standard", "q2931.ie_coding_standard", FT_UINT8, BASE_DEC, VALS(coding_std_vals), Q2931_IE_COMPAT_CODING_STD, + NULL, HFILL }}, + + { &hf_q2931_ie_action_indicator, + { "Action indicator", "q2931.ie_action_indicator", FT_UINT8, BASE_DEC, VALS(ie_action_ind_vals), Q2931_IE_COMPAT_ACTION_IND, + NULL, HFILL }}, }; static gint *ett[] = { &ett_q2931, diff --git a/epan/dissectors/packet-q931.c b/epan/dissectors/packet-q931.c index dd94923d85..b65c9de349 100644 --- a/epan/dissectors/packet-q931.c +++ b/epan/dissectors/packet-q931.c @@ -84,6 +84,8 @@ static int hf_q931_cause_value = -1; static int hf_q931_number_type = -1; static int hf_q931_numbering_plan = -1; static int hf_q931_extension_ind = -1; +static int hf_q931_extension_ind_preference = -1; +static int hf_q931_extension_ind_new_status = -1; static int hf_q931_calling_party_number = -1; static int hf_q931_called_party_number = -1; static int hf_q931_connected_number = -1; @@ -1444,10 +1446,8 @@ dissect_q931_change_status_ie(tvbuff_t *tvb, int offset, int len _U_, proto_tree octet = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_q931_extension_ind, tvb, offset, 1, ENC_BIG_ENDIAN); - proto_tree_add_text(tree, tvb, offset, 1, "%s", - decode_enumerated_bitfield_shifted(octet, 0x40, 8, VALS(q931_status_preference_vals), "Preference: %s")); - proto_tree_add_text(tree, tvb, offset, 1, "%s", - decode_enumerated_bitfield(octet, 0x07, 8, VALS(q931_new_status_vals), "New status: %s")); + proto_tree_add_item(tree, hf_q931_extension_ind_preference, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_q931_extension_ind_new_status, tvb, offset, 1, ENC_BIG_ENDIAN); } /* @@ -3448,6 +3448,16 @@ proto_register_q931(void) FT_BOOLEAN, 8, TFS(&q931_extension_ind_value), 0x80, NULL, HFILL }}, + { &hf_q931_extension_ind_preference, + { "Preference", "q931.extension_ind_preference", + FT_UINT8, BASE_DEC, VALS(q931_status_preference_vals), 0x40, + NULL, HFILL }}, + + { &hf_q931_extension_ind_new_status, + { "New status", "q931.extension_ind_new_status", + FT_UINT8, BASE_DEC, VALS(q931_new_status_vals), 0x07, + NULL, HFILL }}, + { &hf_q931_calling_party_number, { "Calling party number digits", "q931.calling_party_number.digits", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, |