Skip to content

Commit

Permalink
Fix issue #9 - Wireshark plugins do not work in 1.12 due to check_col()
Browse files Browse the repository at this point in the history
(cherry picked from commit 7e0e8e6)
  • Loading branch information
dominicgs committed Nov 1, 2014
1 parent 8110359 commit 1ccad01
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
9 changes: 3 additions & 6 deletions wireshark/plugins/btbb/packet-btbb.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,7 @@ dissect_btbb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
/* maybe should verify HEC */

/* make entries in protocol column and info column on summary display */
if (check_col(pinfo->cinfo, COL_PROTOCOL))
col_set_str(pinfo->cinfo, COL_PROTOCOL, "Bluetooth");
col_set_str(pinfo->cinfo, COL_PROTOCOL, "Bluetooth");

if (tvb_length(tvb) == 0) {
info = "ID";
Expand All @@ -301,10 +300,8 @@ dissect_btbb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
info = val_to_str(type, packet_types, "Unknown type: 0x%x");
}

if (check_col(pinfo->cinfo, COL_INFO)) {
col_clear(pinfo->cinfo, COL_INFO);
col_add_str(pinfo->cinfo, COL_INFO, info);
}
col_clear(pinfo->cinfo, COL_INFO);
col_add_str(pinfo->cinfo, COL_INFO, info);

/* see if we are being asked for details */
if (tree) {
Expand Down
18 changes: 6 additions & 12 deletions wireshark/plugins/btbb/packet-btlmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
* Routines for Bluetooth LMP dissection
* Copyright 2009, Michael Ossmann <[email protected]>
*
* $Id$
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1998 Gerald Combs
Expand Down Expand Up @@ -1885,12 +1883,10 @@ dissect_btlmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
DISSECTOR_ASSERT(len >= 1);

/* make entries in protocol column and info column on summary display */
if (check_col(pinfo->cinfo, COL_PROTOCOL))
col_set_str(pinfo->cinfo, COL_PROTOCOL, "LMP");
col_set_str(pinfo->cinfo, COL_PROTOCOL, "LMP");

/* clear the info column first just in case of type fetching failure. */
if (check_col(pinfo->cinfo, COL_INFO))
col_clear(pinfo->cinfo, COL_INFO);
col_clear(pinfo->cinfo, COL_INFO);

op = tvb_get_guint8(tvb, offset) >> 1;

Expand All @@ -1899,13 +1895,11 @@ dissect_btlmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)

eop = tvb_get_guint8(tvb, offset + 1);

if (check_col(pinfo->cinfo, COL_INFO))
col_add_str(pinfo->cinfo, COL_INFO, val_to_str(eop,
opcode, "Unknown Extended Opcode (%d)"));
col_add_str(pinfo->cinfo, COL_INFO, val_to_str(eop,
opcode, "Unknown Extended Opcode (%d)"));
} else {
if (check_col(pinfo->cinfo, COL_INFO))
col_add_str(pinfo->cinfo, COL_INFO, val_to_str(op,
opcode, "Unknown Opcode (%d)"));
col_add_str(pinfo->cinfo, COL_INFO, val_to_str(op,
opcode, "Unknown Opcode (%d)"));
}

/* see if we are being asked for details */
Expand Down

0 comments on commit 1ccad01

Please sign in to comment.