diff options
author | Guy Harris <guy@alum.mit.edu> | 2011-02-12 19:59:41 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2011-02-12 19:59:41 +0000 |
commit | a595f69ce4ed6114beefc5d9e753c11ff7be1918 (patch) | |
tree | 8f369db2ef33d817abf53f91afd6e9ce962db7b1 /wiretap/btsnoop.c | |
parent | b83634d5a93cfda6f94ea2defe1940fd50f05c61 (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 'wiretap/btsnoop.c')
-rw-r--r-- | wiretap/btsnoop.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/wiretap/btsnoop.c b/wiretap/btsnoop.c index 909a8311f2..8e9b91ea33 100644 --- a/wiretap/btsnoop.c +++ b/wiretap/btsnoop.c @@ -138,7 +138,7 @@ int btsnoop_open(wtap *wth, int *err, gchar **err_info _U_) *err_info = g_strdup_printf("btsnoop: H5 capture logs unsupported"); return -1; case KHciLoggerDatalinkTypeH4: - file_encap=WTAP_ENCAP_BLUETOOTH_H4; + file_encap=WTAP_ENCAP_BLUETOOTH_H4_WITH_PHDR; break; default: *err = WTAP_ERR_UNSUPPORTED; @@ -209,7 +209,7 @@ static gboolean btsnoop_read(wtap *wth, int *err, gchar **err_info, wth->phdr.ts.nsecs = (guint)((ts % 1000000) * 1000); wth->phdr.caplen = packet_size; wth->phdr.len = orig_size; - if(wth->file_encap == WTAP_ENCAP_BLUETOOTH_H4) + if(wth->file_encap == WTAP_ENCAP_BLUETOOTH_H4_WITH_PHDR) { wth->pseudo_header.p2p.sent = (flags & KHciLoggerControllerToHost) ? FALSE : TRUE; } @@ -261,7 +261,7 @@ static gboolean btsnoop_seek_read(wtap *wth, gint64 seek_off, if (!snoop_read_rec_data(wth->random_fh, pd, length, err)) return FALSE; /* failed */ - if(wth->file_encap == WTAP_ENCAP_BLUETOOTH_H4) + if(wth->file_encap == WTAP_ENCAP_BLUETOOTH_H4_WITH_PHDR) { pseudo_header->p2p.sent = (flags & KHciLoggerControllerToHost) ? FALSE : TRUE; } |