aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/bluetooth_hci_summary_dialog.cpp
diff options
context:
space:
mode:
authorJohn Thacker <johnthacker@gmail.com>2023-12-05 07:03:06 -0500
committerJohn Thacker <johnthacker@gmail.com>2023-12-07 01:00:42 +0000
commit8ebde1309d0cc0335e32cff8c7112dc98c05d5ed (patch)
tree560a0e29431d77dcdcabf7de2861b5ee21445bfb /ui/qt/bluetooth_hci_summary_dialog.cpp
parent577cc97f322d5df60a1215061aa8dc4aa2a0f75b (diff)
Improve interface displaying and writing with multiple sections
Update the functions that get an interface name or description to also take the section number in the record (0 if not present.) Store a mapping of SHB number and interface number to global interface number, and provide a function to access it. Use the function to display the correct interface name and description when there are multiple SHBs. Use this information to rewrite interface numbers when writing a pcapng file through wtap dumper, since we don't write additional SHBs to a file when dumping. We could, but we'd have to store exactly when to write the extra SHB when reading the file in sequentially (unlike the other internal blocks, IDB, NRB, and DSBs, that we intentionally move to the start.) Since we're changing the number of sections, perhaps we should edit the SHB options more? Merging handles interface numbers in its own manner, but also needs to know about the per-SHB interface ID to global ID mapping when doing so. Capinfos and capture file properties still require a bit more work for proper output. Fix #16531, fix #18049
Diffstat (limited to 'ui/qt/bluetooth_hci_summary_dialog.cpp')
-rw-r--r--ui/qt/bluetooth_hci_summary_dialog.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/ui/qt/bluetooth_hci_summary_dialog.cpp b/ui/qt/bluetooth_hci_summary_dialog.cpp
index 15d2df5e07..a29206cdd6 100644
--- a/ui/qt/bluetooth_hci_summary_dialog.cpp
+++ b/ui/qt/bluetooth_hci_summary_dialog.cpp
@@ -363,7 +363,8 @@ tap_packet_status BluetoothHciSummaryDialog::tapPacket(void *tapinfo_ptr, packet
gchar *interface;
const char *interface_name;
- interface_name = epan_get_interface_name(pinfo->epan, pinfo->rec->rec_header.packet_header.interface_id);
+ unsigned section_number = pinfo->rec->presence_flags & WTAP_HAS_SECTION_NUMBER ? pinfo->rec->section_number : 0;
+ interface_name = epan_get_interface_name(pinfo->epan, pinfo->rec->rec_header.packet_header.interface_id, section_number);
interface = wmem_strdup_printf(pinfo->pool, "%u: %s", pinfo->rec->rec_header.packet_header.interface_id, interface_name);
if (dialog->ui->interfaceComboBox->findText(interface) == -1)