aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-netbios.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2012-09-26 18:10:29 +0000
committerMichael Mann <mmann78@netscape.net>2012-09-26 18:10:29 +0000
commit97c808c75cefd738279906855724e4d5f675cdd2 (patch)
treef282e3e2ba2de801d962bf1ebc0c90324f299fdb /epan/dissectors/packet-netbios.c
parent2edc3c1822c06e6a2e61ba7954a499a75476b3ae (diff)
replaced decode_boolean_bitfield calls with itemized filters
svn path=/trunk/; revision=45152
Diffstat (limited to 'epan/dissectors/packet-netbios.c')
-rw-r--r--epan/dissectors/packet-netbios.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/epan/dissectors/packet-netbios.c b/epan/dissectors/packet-netbios.c
index f0acf1b56e..0a86c324fa 100644
--- a/epan/dissectors/packet-netbios.c
+++ b/epan/dissectors/packet-netbios.c
@@ -104,6 +104,9 @@ static int hf_netb_local_ses_no = -1;
static int hf_netb_remote_ses_no = -1;
static int hf_netb_data1 = -1;
static int hf_netb_data2 = -1;
+static int hf_netb_data2_frame = -1;
+static int hf_netb_data2_user = -1;
+static int hf_netb_data2_status = -1;
static int hf_netb_fragments = -1;
static int hf_netb_fragment = -1;
static int hf_netb_fragment_overlap = -1;
@@ -796,7 +799,6 @@ dissect_netb_status_resp( tvbuff_t *tvb, int offset, proto_tree *tree)
guint8 status_response = tvb_get_guint8( tvb, offset + NB_DATA1);
proto_item *td2;
proto_tree *data2_tree;
- guint16 data2;
nb_call_name_type( tvb, offset, tree);
if (status_response == 0) {
@@ -807,24 +809,13 @@ dissect_netb_status_resp( tvbuff_t *tvb, int offset, proto_tree *tree)
"Status response: NetBIOS 2.1, %u names sent so far",
status_response);
}
- data2 = tvb_get_letohs( tvb, offset + NB_DATA2);
- td2 = proto_tree_add_text(tree, tvb, offset + NB_DATA2, 2, "Status: 0x%04x",
- data2);
+ td2 = proto_tree_add_item(tree, hf_netb_data2, tvb, offset + NB_DATA2, 2, ENC_LITTLE_ENDIAN);
data2_tree = proto_item_add_subtree(td2, ett_netb_status);
- if (data2 & 0x8000) {
- proto_tree_add_text(data2_tree, tvb, offset, 2, "%s",
- decode_boolean_bitfield(data2, 0x8000, 8*2,
- "Data length exceeds maximum frame size", NULL));
- }
- if (data2 & 0x4000) {
- proto_tree_add_text(data2_tree, tvb, offset, 2, "%s",
- decode_boolean_bitfield(data2, 0x4000, 8*2,
- "Data length exceeds user's buffer", NULL));
- }
- proto_tree_add_text(data2_tree, tvb, offset, 2, "%s",
- decode_numeric_bitfield(data2, 0x3FFF, 2*8,
- "Status data length = %u"));
+ proto_tree_add_item(data2_tree, hf_netb_data2_frame, tvb, offset + NB_DATA2, 2, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(data2_tree, hf_netb_data2_user, tvb, offset + NB_DATA2, 2, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(data2_tree, hf_netb_data2_status, tvb, offset + NB_DATA2, 2, ENC_LITTLE_ENDIAN);
+
nb_xmit_corrl( tvb, offset, tree);
netbios_add_name("Receiver's Name", tvb, offset + NB_RECVER_NAME, tree);
netbios_add_name("Sender's Name", tvb, offset + NB_SENDER_NAME,
@@ -1372,6 +1363,18 @@ void proto_register_netbios(void)
{ "DATA2 value", "netbios.data2", FT_UINT16, BASE_HEX, NULL, 0x0,
NULL, HFILL }},
+ { &hf_netb_data2_frame,
+ { "Data length exceeds maximum frame size", "netbios.data2.frame", FT_BOOLEAN, 16,
+ TFS(&tfs_yes_no), 0x8000, NULL, HFILL }},
+
+ { &hf_netb_data2_user,
+ { "Data length exceeds user's buffer", "netbios.data2.user", FT_BOOLEAN, 16,
+ TFS(&tfs_yes_no), 0x4000, NULL, HFILL }},
+
+ { &hf_netb_data2_status,
+ { "Status data length", "netbios.data2.status", FT_UINT16, BASE_DEC, NULL, 0x3FFF,
+ NULL, HFILL }},
+
{ &hf_netb_fragment_overlap,
{ "Fragment overlap", "netbios.fragment.overlap", FT_BOOLEAN, BASE_NONE,
NULL, 0x0, "Fragment overlaps with other fragments", HFILL }},