aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-hci_h4.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2011-02-12 19:59:41 +0000
committerGuy Harris <guy@alum.mit.edu>2011-02-12 19:59:41 +0000
commita595f69ce4ed6114beefc5d9e753c11ff7be1918 (patch)
tree8f369db2ef33d817abf53f91afd6e9ce962db7b1 /epan/dissectors/packet-hci_h4.c
parentb83634d5a93cfda6f94ea2defe1940fd50f05c61 (diff)
The lack of _WITH_PHDR in WTAP_ENCAP_BLUETOOTH_H4 means there's no
pseudo-header, and hence there's no direction indication. Don't set pinfo->p2p_dir for it. Use WTAP_ENCAP_BLUETOOTH_H4_WITH_PHDR, not WTAP_ENCAP_BLUETOOTH_H4, for capture files where we have the direction. Don't assume pinfo->p2p_dir is either P2P_DIR_SENT or P2P_DIR_RECV when setting the info column in various Bluetooth dissectors; it might be unknown. In the HCI H4 dissector, put the direction into the info column regardless of whether we have a type match or not; the dissectors for HCI packet types appear to assume it's been set (as they put a blank at the beginning of the stuff they append to the direction). svn path=/trunk/; revision=35933
Diffstat (limited to 'epan/dissectors/packet-hci_h4.c')
-rw-r--r--epan/dissectors/packet-hci_h4.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/epan/dissectors/packet-hci_h4.c b/epan/dissectors/packet-hci_h4.c
index f71ea67fe1..c941a51de5 100644
--- a/epan/dissectors/packet-hci_h4.c
+++ b/epan/dissectors/packet-hci_h4.c
@@ -69,7 +69,24 @@ dissect_hci_h4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree *hci_h4_tree=NULL;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "HCI H4");
- col_clear(pinfo->cinfo, COL_INFO);
+ switch (pinfo->p2p_dir) {
+
+ case P2P_DIR_SENT:
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Sent ");
+ break;
+
+ case P2P_DIR_RECV:
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Rcvd ");
+ break;
+
+ case P2P_DIR_UNKNOWN:
+ break;
+
+ default:
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction %d ",
+ pinfo->p2p_dir);
+ break;
+ }
type = tvb_get_guint8(tvb, 0);
@@ -83,13 +100,11 @@ dissect_hci_h4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(hci_h4_tree, hf_hci_h4_type,
tvb, 0, 1, TRUE);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s",
+ val_to_str(type, hci_h4_type_vals, "Unknown HCI packet type 0x%02x"));
next_tvb = tvb_new_subset_remaining(tvb, 1);
if(!dissector_try_uint(hci_h4_table, type, next_tvb, pinfo, tree)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
- pinfo->p2p_dir==P2P_DIR_SENT ? "Sent" : "Rcvd",
- val_to_str(type, hci_h4_type_vals, "Unknown HCI packet type 0x%02x"));
-
call_dissector(data_handle, next_tvb, pinfo, tree);
}
}