diff options
author | Michael Mann <mmann78@netscape.net> | 2013-10-27 16:03:11 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2013-10-27 16:03:11 +0000 |
commit | 471f21181b866fc1328b61a2ea4584b400388d7b (patch) | |
tree | d98992020277c9f9e591babddd359c8b03d9238b /epan/dissectors/packet-qllc.c | |
parent | 394f67c1b7ab65b6fb89610ce251be62b8509208 (diff) |
Have X.25 dissector pass boolean q_bit_set value through dissector data rather than pinfo->private_data.
Other "related" dissectors weren't manipulating pinfo->private_data, so it doesn't make sense for them to bother saving/restore it (now that q_bit_set isn't being used)
svn path=/trunk/; revision=52894
Diffstat (limited to 'epan/dissectors/packet-qllc.c')
-rw-r--r-- | epan/dissectors/packet-qllc.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/epan/dissectors/packet-qllc.c b/epan/dissectors/packet-qllc.c index 1c2c32794b..1834516447 100644 --- a/epan/dissectors/packet-qllc.c +++ b/epan/dissectors/packet-qllc.c @@ -71,12 +71,12 @@ static const value_string qllc_control_vals[] = { }; -static void -dissect_qllc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_qllc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { - proto_tree *qllc_tree = NULL; - proto_item *qllc_ti = NULL; - gboolean *q_bit_set = (gboolean *)pinfo->private_data; + proto_tree *qllc_tree; + proto_item *qllc_ti; + gboolean *q_bit_set = (gboolean *)data; guint8 addr, ctrl; gboolean command = FALSE; @@ -84,25 +84,21 @@ dissect_qllc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * If the Q bit isn't set, this is just SNA data. */ if (!(*q_bit_set)) { - call_dissector(sna_handle, tvb, pinfo, tree); - return; + call_dissector(sna_handle, tvb, pinfo, tree); + return tvb_length(tvb); } /* Summary information */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "QLLC"); col_clear(pinfo->cinfo, COL_INFO); - if (tree) { - qllc_ti = proto_tree_add_item(tree, proto_qllc, tvb, 0, -1, ENC_NA); - qllc_tree = proto_item_add_subtree(qllc_ti, ett_qllc); - } + qllc_ti = proto_tree_add_item(tree, proto_qllc, tvb, 0, -1, ENC_NA); + qllc_tree = proto_item_add_subtree(qllc_ti, ett_qllc); /* Get the address; we need it to determine if this is a * COMMAND or a RESPONSE */ addr = tvb_get_guint8(tvb, 0); - if (tree) { proto_tree_add_item(qllc_tree, hf_qllc_address, tvb, 0, 1, ENC_BIG_ENDIAN); - } /* The address field equals X'FF' in commands (except QRR) * and anything in responses. */ @@ -116,14 +112,14 @@ dissect_qllc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * a COMMAND or RESPONSE. */ if (ctrl == QRD_QDISC_VALUE) { if (command) { - col_set_str(pinfo->cinfo, COL_INFO, QDISC_TEXT); + col_set_str(pinfo->cinfo, COL_INFO, QDISC_TEXT); if (tree) { proto_tree_add_text(qllc_tree, tvb, 1, 1, "Control Field: %s (0x%02x)", QDISC_TEXT, ctrl); } } else { - col_set_str(pinfo->cinfo, COL_INFO, QRD_TEXT); + col_set_str(pinfo->cinfo, COL_INFO, QRD_TEXT); if (tree) { proto_tree_add_text(qllc_tree, tvb, 1, 1, "Control Field: %s (0x%02x)", QRD_TEXT, ctrl); @@ -154,6 +150,8 @@ dissect_qllc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (ctrl == QXID || ctrl == QTEST || ctrl == QFRMR) { /* yes */ } + + return tvb_length(tvb); } void @@ -173,11 +171,10 @@ proto_register_qllc(void) &ett_qllc, }; - proto_qllc = proto_register_protocol("Qualified Logical Link Control", - "QLLC", "qllc"); + proto_qllc = proto_register_protocol("Qualified Logical Link Control", "QLLC", "qllc"); proto_register_field_array(proto_qllc, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - register_dissector("qllc", dissect_qllc, proto_qllc); + new_register_dissector("qllc", dissect_qllc, proto_qllc); } void |