diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-12-31 19:36:12 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2019-01-01 05:03:42 +0000 |
commit | 2d41b15495e245d9292ba42dd3954bdebc9f3290 (patch) | |
tree | 40282b7aab9f1347489126dd98974a681dca888f /ui/qt | |
parent | ba589a4e445a8ad8054073eff846087fc61c9ef8 (diff) |
Add a "failed" return for tap packet routines.
This allows taps that can fail to report an error and fail; a failed
tap's packet routine won't be called again, so they don't have to keep
track of whether they've failed themselves.
We make the return value from the packet routine an enum.
Don't have a separate type for the per-packet routine for "follow" taps;
they're expected to act like tap packet routines, so just use the type
for tap packet routines.
One tap packet routine returned -1; that's not a valid return value, and
wasn't one before this change (the return value was a boolean), so
presume the intent was "don't redraw".
Another tap routine's early return, without doing any work, returned
TRUE; this is presumably an error (no work done, no need to redraw), so
presumably it should be "don't redraw".
Clean up some white space while we're at it.
Change-Id: Ia7d2b717b2cace4b13c2b886e699aa4d79cc82c8
Reviewed-on: https://code.wireshark.org/review/31283
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/qt')
38 files changed, 116 insertions, 107 deletions
diff --git a/ui/qt/bluetooth_att_server_attributes_dialog.cpp b/ui/qt/bluetooth_att_server_attributes_dialog.cpp index 973c09d5ee..d13aa91cf4 100644 --- a/ui/qt/bluetooth_att_server_attributes_dialog.cpp +++ b/ui/qt/bluetooth_att_server_attributes_dialog.cpp @@ -32,7 +32,7 @@ static const int column_number_handle = 0; static const int column_number_uuid = 1; static const int column_number_uuid_name = 2; -static gboolean +static tap_packet_status btatt_handle_tap_packet(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *edt, const void* data) { tapinfo_t *tapinfo = (tapinfo_t *) tapinfo_ptr; @@ -40,7 +40,7 @@ btatt_handle_tap_packet(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *e if (tapinfo->tap_packet) tapinfo->tap_packet(tapinfo, pinfo, edt, data); - return TRUE; + return TAP_PACKET_REDRAW; } static void @@ -225,7 +225,7 @@ void BluetoothAttServerAttributesDialog::tapReset(void *tapinfo_ptr) } -gboolean BluetoothAttServerAttributesDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data) +tap_packet_status BluetoothAttServerAttributesDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data) { tapinfo_t *tapinfo = static_cast<tapinfo_t *>(tapinfo_ptr); BluetoothAttServerAttributesDialog *dialog = static_cast<BluetoothAttServerAttributesDialog *>(tapinfo->ui); @@ -236,10 +236,10 @@ gboolean BluetoothAttServerAttributesDialog::tapPacket(void *tapinfo_ptr, packet gchar *addr = NULL; if (dialog->file_closed_) - return FALSE; + return TAP_PACKET_DONT_REDRAW; if (pinfo->rec->rec_type != REC_TYPE_PACKET) - return FALSE; + return TAP_PACKET_DONT_REDRAW; if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID) { gchar *interface; @@ -253,7 +253,7 @@ gboolean BluetoothAttServerAttributesDialog::tapPacket(void *tapinfo_ptr, packet if (interface && dialog->ui->interfaceComboBox->currentIndex() > 0) { if (dialog->ui->interfaceComboBox->currentText() != interface) - return TRUE; + return TAP_PACKET_REDRAW; } } @@ -266,7 +266,7 @@ gboolean BluetoothAttServerAttributesDialog::tapPacket(void *tapinfo_ptr, packet if (addr && dialog->ui->deviceComboBox->currentIndex() > 0) { if (dialog->ui->deviceComboBox->currentText() != addr) - return TRUE; + return TAP_PACKET_REDRAW; } handle.sprintf("0x%04x", tap_handles->handle); @@ -282,7 +282,7 @@ gboolean BluetoothAttServerAttributesDialog::tapPacket(void *tapinfo_ptr, packet if (item->text(column_number_handle) == handle && item->text(column_number_uuid) == uuid && item->text(column_number_uuid_name) == uuid_name) - return TRUE; + return TAP_PACKET_REDRAW; ++i_item; } } @@ -297,7 +297,7 @@ gboolean BluetoothAttServerAttributesDialog::tapPacket(void *tapinfo_ptr, packet dialog->ui->tableTreeWidget->resizeColumnToContents(i); } - return TRUE; + return TAP_PACKET_REDRAW; } void BluetoothAttServerAttributesDialog::interfaceCurrentIndexChanged(int) diff --git a/ui/qt/bluetooth_att_server_attributes_dialog.h b/ui/qt/bluetooth_att_server_attributes_dialog.h index 5566b3676e..e8b35f7dbb 100644 --- a/ui/qt/bluetooth_att_server_attributes_dialog.h +++ b/ui/qt/bluetooth_att_server_attributes_dialog.h @@ -64,7 +64,7 @@ private: QMenu context_menu_; static void tapReset(void *tapinfo_ptr); - static gboolean tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data); + static tap_packet_status tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data); private slots: void captureFileClosing(); diff --git a/ui/qt/bluetooth_device_dialog.cpp b/ui/qt/bluetooth_device_dialog.cpp index ff13eb646d..09d8c1a006 100644 --- a/ui/qt/bluetooth_device_dialog.cpp +++ b/ui/qt/bluetooth_device_dialog.cpp @@ -56,7 +56,7 @@ static const int row_number_page_timeout = 19; static const int row_number_simple_pairing_mode = 20; static const int row_number_voice_setting = 21; -static gboolean +static tap_packet_status bluetooth_device_tap_packet(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *edt, const void* data) { bluetooth_device_tapinfo_t *tapinfo = (bluetooth_device_tapinfo_t *) tapinfo_ptr; @@ -64,7 +64,7 @@ bluetooth_device_tap_packet(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_ if (tapinfo->tap_packet) tapinfo->tap_packet(tapinfo, pinfo, edt, data); - return TRUE; + return TAP_PACKET_REDRAW; } static void @@ -359,7 +359,7 @@ void BluetoothDeviceDialog::saveItemData(QTableWidgetItem *item, } -gboolean BluetoothDeviceDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data) +tap_packet_status BluetoothDeviceDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data) { bluetooth_device_tapinfo_t *tapinfo = static_cast<bluetooth_device_tapinfo_t *>(tapinfo_ptr); BluetoothDeviceDialog *dialog = static_cast<BluetoothDeviceDialog *>(tapinfo->ui); @@ -375,14 +375,14 @@ gboolean BluetoothDeviceDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, tableWidget = dialog->ui->tableWidget; if (!((!tap_device->is_local && tap_device->has_bd_addr) || (tap_device->is_local && tapinfo->is_local && tap_device->interface_id == tapinfo->interface_id && tap_device->adapter_id == tapinfo->adapter_id))) { - return TRUE; + return TAP_PACKET_REDRAW; } if (!tap_device->is_local && tap_device->has_bd_addr) { bd_addr.sprintf("%02x:%02x:%02x:%02x:%02x:%02x", tap_device->bd_addr[0], tap_device->bd_addr[1], tap_device->bd_addr[2], tap_device->bd_addr[3], tap_device->bd_addr[4], tap_device->bd_addr[5]); if (bd_addr != tapinfo->bdAddr) - return TRUE; + return TAP_PACKET_REDRAW; } if (tap_device->has_bd_addr) { @@ -616,7 +616,7 @@ gboolean BluetoothDeviceDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, dialog->ui->hintLabel->setText(QString(tr("%1 changes")).arg(*tapinfo->changes)); - return TRUE; + return TAP_PACKET_REDRAW; } void BluetoothDeviceDialog::interfaceCurrentIndexChanged(int) diff --git a/ui/qt/bluetooth_device_dialog.h b/ui/qt/bluetooth_device_dialog.h index b63acc1ac3..d5860a33f7 100644 --- a/ui/qt/bluetooth_device_dialog.h +++ b/ui/qt/bluetooth_device_dialog.h @@ -79,7 +79,7 @@ private: guint changes_; static void tapReset(void *tapinfo_ptr); - static gboolean tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data); + static tap_packet_status tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data); static void updateChanges(QTableWidget *tableWidget, QString value, const int row, guint *changes, packet_info *pinfo); static void saveItemData(QTableWidgetItem *item, bluetooth_device_tap_t *tap_device, packet_info *pinfo); diff --git a/ui/qt/bluetooth_devices_dialog.cpp b/ui/qt/bluetooth_devices_dialog.cpp index 242edd424c..ec6043bcbf 100644 --- a/ui/qt/bluetooth_devices_dialog.cpp +++ b/ui/qt/bluetooth_devices_dialog.cpp @@ -43,7 +43,7 @@ static const int column_number_hci_revision = 7; static const int column_number_is_local_adapter = 8; -static gboolean +static tap_packet_status bluetooth_device_tap_packet(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *edt, const void* data) { bluetooth_devices_tapinfo_t *tapinfo = (bluetooth_devices_tapinfo_t *) tapinfo_ptr; @@ -51,7 +51,7 @@ bluetooth_device_tap_packet(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_ if (tapinfo->tap_packet) tapinfo->tap_packet(tapinfo, pinfo, edt, data); - return TRUE; + return TAP_PACKET_REDRAW; } static void @@ -253,7 +253,7 @@ void BluetoothDevicesDialog::tapReset(void *tapinfo_ptr) bluetooth_devices_dialog->ui->tableTreeWidget->clear(); } -gboolean BluetoothDevicesDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data) +tap_packet_status BluetoothDevicesDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data) { bluetooth_devices_tapinfo_t *tapinfo = static_cast<bluetooth_devices_tapinfo_t *>(tapinfo_ptr); BluetoothDevicesDialog *dialog = static_cast<BluetoothDevicesDialog *>(tapinfo->ui); @@ -264,10 +264,10 @@ gboolean BluetoothDevicesDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo QTreeWidgetItem *item = NULL; if (dialog->file_closed_) - return FALSE; + return TAP_PACKET_DONT_REDRAW; if (pinfo->rec->rec_type != REC_TYPE_PACKET) - return FALSE; + return TAP_PACKET_DONT_REDRAW; if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID) { gchar *interface; @@ -281,7 +281,7 @@ gboolean BluetoothDevicesDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo if (interface && dialog->ui->interfaceComboBox->currentIndex() > 0) { if (dialog->ui->interfaceComboBox->currentText() != interface) - return TRUE; + return TAP_PACKET_REDRAW; } } @@ -370,7 +370,7 @@ gboolean BluetoothDevicesDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo dialog->ui->hintLabel->setText(QString(tr("%1 items; Right click for more option; Double click for device details")).arg(dialog->ui->tableTreeWidget->topLevelItemCount())); - return TRUE; + return TAP_PACKET_REDRAW; } void BluetoothDevicesDialog::interfaceCurrentIndexChanged(int) diff --git a/ui/qt/bluetooth_devices_dialog.h b/ui/qt/bluetooth_devices_dialog.h index 94d14043a1..4d07e1ec2f 100644 --- a/ui/qt/bluetooth_devices_dialog.h +++ b/ui/qt/bluetooth_devices_dialog.h @@ -65,7 +65,7 @@ private: QMenu context_menu_; static void tapReset(void *tapinfo_ptr); - static gboolean tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data); + static tap_packet_status tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data); private slots: void captureFileClosing(); diff --git a/ui/qt/bluetooth_hci_summary_dialog.cpp b/ui/qt/bluetooth_hci_summary_dialog.cpp index 19b82f0542..044a6beb7d 100644 --- a/ui/qt/bluetooth_hci_summary_dialog.cpp +++ b/ui/qt/bluetooth_hci_summary_dialog.cpp @@ -44,7 +44,7 @@ static const int column_number_reason = 7; static const int column_number_hardware_error = 8; static const int column_number_occurrence = 9; -static gboolean +static tap_packet_status bluetooth_hci_summary_tap_packet(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *edt, const void* data) { bluetooth_hci_summary_tapinfo_t *tapinfo = (bluetooth_hci_summary_tapinfo_t *) tapinfo_ptr; @@ -52,7 +52,7 @@ bluetooth_hci_summary_tap_packet(void *tapinfo_ptr, packet_info *pinfo, epan_dis if (tapinfo->tap_packet) tapinfo->tap_packet(tapinfo, pinfo, edt, data); - return TRUE; + return TAP_PACKET_REDRAW; } static void @@ -332,7 +332,7 @@ void BluetoothHciSummaryDialog::tapReset(void *tapinfo_ptr) dialog->item_hardware_errors_->setText(column_number_occurrence, "0"); } -gboolean BluetoothHciSummaryDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data) +tap_packet_status BluetoothHciSummaryDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data) { bluetooth_hci_summary_tapinfo_t *tapinfo = static_cast<bluetooth_hci_summary_tapinfo_t *>(tapinfo_ptr); BluetoothHciSummaryDialog *dialog = static_cast<BluetoothHciSummaryDialog *>(tapinfo->ui); @@ -346,10 +346,10 @@ gboolean BluetoothHciSummaryDialog::tapPacket(void *tapinfo_ptr, packet_info *pi QString name; if (dialog->file_closed_) - return FALSE; + return TAP_PACKET_DONT_REDRAW; if (pinfo->rec->rec_type != REC_TYPE_PACKET) - return FALSE; + return TAP_PACKET_DONT_REDRAW; name = tr("Unknown"); @@ -365,7 +365,7 @@ gboolean BluetoothHciSummaryDialog::tapPacket(void *tapinfo_ptr, packet_info *pi if (interface && dialog->ui->interfaceComboBox->currentIndex() > 0) { if (dialog->ui->interfaceComboBox->currentText() != interface) - return TRUE; + return TAP_PACKET_REDRAW; } } @@ -377,7 +377,7 @@ gboolean BluetoothHciSummaryDialog::tapPacket(void *tapinfo_ptr, packet_info *pi if (dialog->ui->adapterComboBox->currentIndex() > 0) { if (dialog->ui->adapterComboBox->currentText() != adapter) - return TRUE; + return TAP_PACKET_REDRAW; } switch (tap_hci->type) { @@ -768,7 +768,7 @@ gboolean BluetoothHciSummaryDialog::tapPacket(void *tapinfo_ptr, packet_info *pi dialog->ui->tableTreeWidget->resizeColumnToContents(i); } - return TRUE; + return TAP_PACKET_REDRAW; } void BluetoothHciSummaryDialog::interfaceCurrentIndexChanged(int) diff --git a/ui/qt/bluetooth_hci_summary_dialog.h b/ui/qt/bluetooth_hci_summary_dialog.h index 1d3c299a18..0595031ffa 100644 --- a/ui/qt/bluetooth_hci_summary_dialog.h +++ b/ui/qt/bluetooth_hci_summary_dialog.h @@ -79,7 +79,7 @@ private: QTreeWidgetItem *item_hardware_errors_; static void tapReset(void *tapinfo_ptr); - static gboolean tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data); + static tap_packet_status tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data); private slots: void captureFileClosing(); diff --git a/ui/qt/gsm_map_summary_dialog.cpp b/ui/qt/gsm_map_summary_dialog.cpp index 0d37d75980..49aa13259a 100644 --- a/ui/qt/gsm_map_summary_dialog.cpp +++ b/ui/qt/gsm_map_summary_dialog.cpp @@ -337,7 +337,7 @@ gsm_map_summary_reset(void *tapdata) } -static gboolean +static tap_packet_status gsm_map_summary_packet(void *tapdata, packet_info *, epan_dissect_t *, const void *gmtr_ptr) { gsm_map_stat_t *gm_stat = (gsm_map_stat_t *)tapdata; @@ -354,7 +354,7 @@ gsm_map_summary_packet(void *tapdata, packet_info *, epan_dissect_t *, const voi gm_stat->size_rr[gm_tap_rec->opcode] += gm_tap_rec->size; } - return(FALSE); /* We have no draw callback */ + return(TAP_PACKET_DONT_REDRAW); /* We have no draw callback */ } void diff --git a/ui/qt/iax2_analysis_dialog.cpp b/ui/qt/iax2_analysis_dialog.cpp index 4e45127864..e1cf0117b8 100644 --- a/ui/qt/iax2_analysis_dialog.cpp +++ b/ui/qt/iax2_analysis_dialog.cpp @@ -613,21 +613,21 @@ void Iax2AnalysisDialog::tapReset(void *tapinfoptr) iax2_analysis_dialog->resetStatistics(); } -gboolean Iax2AnalysisDialog::tapPacket(void *tapinfoptr, packet_info *pinfo, struct epan_dissect *, const void *iax2info_ptr) +tap_packet_status Iax2AnalysisDialog::tapPacket(void *tapinfoptr, packet_info *pinfo, struct epan_dissect *, const void *iax2info_ptr) { Iax2AnalysisDialog *iax2_analysis_dialog = dynamic_cast<Iax2AnalysisDialog *>((Iax2AnalysisDialog*)tapinfoptr); - if (!iax2_analysis_dialog) return FALSE; + if (!iax2_analysis_dialog) return TAP_PACKET_DONT_REDRAW; const iax2_info_t *iax2info = (const iax2_info_t *)iax2info_ptr; - if (!iax2info) return FALSE; + if (!iax2info) return TAP_PACKET_DONT_REDRAW; /* we ignore packets that are not displayed */ if (pinfo->fd->passed_dfilter == 0) - return FALSE; + return TAP_PACKET_DONT_REDRAW; /* we ignore packets that carry no data */ if (iax2info->payload_len < 1) - return FALSE; + return TAP_PACKET_DONT_REDRAW; /* is it the forward direction? */ else if ((cmp_address(&(iax2_analysis_dialog->fwd_id_.src_addr), &(pinfo->src)) == 0) @@ -645,7 +645,7 @@ gboolean Iax2AnalysisDialog::tapPacket(void *tapinfoptr, packet_info *pinfo, str iax2_analysis_dialog->addPacket(false, pinfo, iax2info); } - return FALSE; + return TAP_PACKET_DONT_REDRAW; } void Iax2AnalysisDialog::tapDraw(void *tapinfoptr) diff --git a/ui/qt/iax2_analysis_dialog.h b/ui/qt/iax2_analysis_dialog.h index 81f55875f9..e03a524e3d 100644 --- a/ui/qt/iax2_analysis_dialog.h +++ b/ui/qt/iax2_analysis_dialog.h @@ -108,7 +108,7 @@ private: // Tap callbacks static void tapReset(void *tapinfo_ptr); - static gboolean tapPacket(void *tapinfo_ptr, packet_info *pinfo, struct epan_dissect *, const void *iax2info_ptr); + static tap_packet_status tapPacket(void *tapinfo_ptr, packet_info *pinfo, struct epan_dissect *, const void *iax2info_ptr); static void tapDraw(void *tapinfo_ptr); void resetStatistics(); diff --git a/ui/qt/io_graph_dialog.cpp b/ui/qt/io_graph_dialog.cpp index 8edcd3ccfe..7f2f5e0cb1 100644 --- a/ui/qt/io_graph_dialog.cpp +++ b/ui/qt/io_graph_dialog.cpp @@ -2055,11 +2055,11 @@ void IOGraph::tapReset(void *iog_ptr) } // "tap_packet" callback for register_tap_listener -gboolean IOGraph::tapPacket(void *iog_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *) +tap_packet_status IOGraph::tapPacket(void *iog_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *) { IOGraph *iog = static_cast<IOGraph *>(iog_ptr); if (!pinfo || !iog) { - return FALSE; + return TAP_PACKET_DONT_REDRAW; } int idx = get_io_graph_index(pinfo, iog->interval_); @@ -2068,7 +2068,7 @@ gboolean IOGraph::tapPacket(void *iog_ptr, packet_info *pinfo, epan_dissect_t *e /* some sanity checks */ if ((idx < 0) || (idx >= max_io_items_)) { iog->cur_idx_ = max_io_items_ - 1; - return FALSE; + return TAP_PACKET_DONT_REDRAW; } /* update num_items */ @@ -2092,7 +2092,7 @@ gboolean IOGraph::tapPacket(void *iog_ptr, packet_info *pinfo, epan_dissect_t *e } if (!update_io_graph_item(iog->items_, idx, pinfo, adv_edt, iog->hf_index_, iog->val_units_, iog->interval_)) { - return FALSE; + return TAP_PACKET_DONT_REDRAW; } // qDebug() << "=tapPacket" << iog->name_ << idx << iog->hf_index_ << iog->val_units_ << iog->num_items_; @@ -2100,7 +2100,7 @@ gboolean IOGraph::tapPacket(void *iog_ptr, packet_info *pinfo, epan_dissect_t *e if (recalc) { emit iog->requestRecalc(); } - return TRUE; + return TAP_PACKET_REDRAW; } // "tap_draw" callback for register_tap_listener diff --git a/ui/qt/io_graph_dialog.h b/ui/qt/io_graph_dialog.h index 036d84dd8f..184d3a97a3 100644 --- a/ui/qt/io_graph_dialog.h +++ b/ui/qt/io_graph_dialog.h @@ -92,7 +92,7 @@ signals: private: // Callbacks for register_tap_listener static void tapReset(void *iog_ptr); - static gboolean tapPacket(void *iog_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *data); + static tap_packet_status tapPacket(void *iog_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *data); static void tapDraw(void *iog_ptr); void calculateScaledValueUnit(); diff --git a/ui/qt/lbm_lbtrm_transport_dialog.cpp b/ui/qt/lbm_lbtrm_transport_dialog.cpp index 24657869a0..dc593d8bd3 100644 --- a/ui/qt/lbm_lbtrm_transport_dialog.cpp +++ b/ui/qt/lbm_lbtrm_transport_dialog.cpp @@ -1323,7 +1323,7 @@ void LBMLBTRMTransportDialog::resetTap(void * tap_data) info->clearMaps(); } -gboolean LBMLBTRMTransportDialog::tapPacket(void * tap_data, packet_info * pinfo, epan_dissect_t *, const void * tap_info) +tap_packet_status LBMLBTRMTransportDialog::tapPacket(void * tap_data, packet_info * pinfo, epan_dissect_t *, const void * tap_info) { if (pinfo->fd->passed_dfilter == 1) { @@ -1332,7 +1332,7 @@ gboolean LBMLBTRMTransportDialog::tapPacket(void * tap_data, packet_info * pinfo info->processPacket(pinfo, tapinfo); } - return (TRUE); + return (TAP_PACKET_REDRAW); } void LBMLBTRMTransportDialog::drawTreeItems(void *) diff --git a/ui/qt/lbm_lbtrm_transport_dialog.h b/ui/qt/lbm_lbtrm_transport_dialog.h index 0c208b274f..b19f800bf7 100644 --- a/ui/qt/lbm_lbtrm_transport_dialog.h +++ b/ui/qt/lbm_lbtrm_transport_dialog.h @@ -18,6 +18,7 @@ #include "cfile.h" #include <epan/packet_info.h> +#include <epan/tap.h> #include <QDialog> class QHeaderView; @@ -65,7 +66,7 @@ class LBMLBTRMTransportDialog : public QDialog void resetReceiversDetail(void); void fillTree(void); static void resetTap(void * tap_data); - static gboolean tapPacket(void * tap_data, packet_info * pinfo, epan_dissect_t * edt, const void * stream_info); + static tap_packet_status tapPacket(void * tap_data, packet_info * pinfo, epan_dissect_t * edt, const void * stream_info); static void drawTreeItems(void * tap_data); void loadSourceDataDetails(LBMLBTRMSourceTransportEntry * transport); void loadSourceRXDataDetails(LBMLBTRMSourceTransportEntry * transport); diff --git a/ui/qt/lbm_lbtru_transport_dialog.cpp b/ui/qt/lbm_lbtru_transport_dialog.cpp index 2052318134..920287b622 100644 --- a/ui/qt/lbm_lbtru_transport_dialog.cpp +++ b/ui/qt/lbm_lbtru_transport_dialog.cpp @@ -1742,7 +1742,7 @@ void LBMLBTRUTransportDialog::resetTap(void * tap_data) info->clearMaps(); } -gboolean LBMLBTRUTransportDialog::tapPacket(void * tap_data, packet_info * pinfo, epan_dissect_t *, const void * tap_info) +tap_packet_status LBMLBTRUTransportDialog::tapPacket(void * tap_data, packet_info * pinfo, epan_dissect_t *, const void * tap_info) { if (pinfo->fd->passed_dfilter == 1) { @@ -1751,7 +1751,7 @@ gboolean LBMLBTRUTransportDialog::tapPacket(void * tap_data, packet_info * pinfo info->processPacket(pinfo, tapinfo); } - return (TRUE); + return (TAP_PACKET_REDRAW); } void LBMLBTRUTransportDialog::drawTreeItems(void *) diff --git a/ui/qt/lbm_lbtru_transport_dialog.h b/ui/qt/lbm_lbtru_transport_dialog.h index 84bdd467bb..cb57c70fed 100644 --- a/ui/qt/lbm_lbtru_transport_dialog.h +++ b/ui/qt/lbm_lbtru_transport_dialog.h @@ -18,6 +18,7 @@ #include "cfile.h" #include <epan/packet_info.h> +#include <epan/tap.h> #include <QDialog> class QHeaderView; @@ -67,7 +68,7 @@ class LBMLBTRUTransportDialog : public QDialog void resetReceiversDetail(void); void fillTree(void); static void resetTap(void * tap_data); - static gboolean tapPacket(void * tap_data, packet_info * pinfo, epan_dissect_t * edt, const void * stream_info); + static tap_packet_status tapPacket(void * tap_data, packet_info * pinfo, epan_dissect_t * edt, const void * stream_info); static void drawTreeItems(void * tap_data); void loadSourceDataDetails(LBMLBTRUSourceTransportEntry * transport); void loadSourceRXDataDetails(LBMLBTRUSourceTransportEntry * transport); diff --git a/ui/qt/lbm_stream_dialog.cpp b/ui/qt/lbm_stream_dialog.cpp index 732c59d393..c93d1958e2 100644 --- a/ui/qt/lbm_stream_dialog.cpp +++ b/ui/qt/lbm_stream_dialog.cpp @@ -399,7 +399,7 @@ void LBMStreamDialog::resetTap(void * tap_data) dialog->m_ui->lbm_stream_TreeWidget->clear(); } -gboolean LBMStreamDialog::tapPacket(void * tap_data, packet_info * pinfo, epan_dissect_t *, const void * stream_info) +tap_packet_status LBMStreamDialog::tapPacket(void * tap_data, packet_info * pinfo, epan_dissect_t *, const void * stream_info) { if (pinfo->fd->passed_dfilter == 1) { @@ -408,7 +408,7 @@ gboolean LBMStreamDialog::tapPacket(void * tap_data, packet_info * pinfo, epan_d info->processPacket(pinfo, tapinfo); } - return (TRUE); + return (TAP_PACKET_REDRAW); } void LBMStreamDialog::drawTreeItems(void *) diff --git a/ui/qt/lbm_stream_dialog.h b/ui/qt/lbm_stream_dialog.h index 8e1eb595b6..1ba87c75b1 100644 --- a/ui/qt/lbm_stream_dialog.h +++ b/ui/qt/lbm_stream_dialog.h @@ -18,6 +18,7 @@ #include "cfile.h" #include <epan/packet_info.h> +#include <epan/tap.h> #include <QDialog> namespace Ui @@ -49,7 +50,7 @@ class LBMStreamDialog : public QDialog void fillTree(void); static void resetTap(void * tap_data); - static gboolean tapPacket(void * tap_data, packet_info * pinfo, epan_dissect_t * edt, const void * stream_info); + static tap_packet_status tapPacket(void * tap_data, packet_info * pinfo, epan_dissect_t * edt, const void * stream_info); static void drawTreeItems(void * tap_data); private slots: diff --git a/ui/qt/lte_mac_statistics_dialog.cpp b/ui/qt/lte_mac_statistics_dialog.cpp index 012f65f1fb..b356364d28 100644 --- a/ui/qt/lte_mac_statistics_dialog.cpp +++ b/ui/qt/lte_mac_statistics_dialog.cpp @@ -712,14 +712,14 @@ void LteMacStatisticsDialog::tapReset(void *ws_dlg_ptr) //--------------------------------------------------------------------------------------- // Process tap info from a new packet. -// Returns TRUE if a redraw is needed. -gboolean LteMacStatisticsDialog::tapPacket(void *ws_dlg_ptr, struct _packet_info *, epan_dissect *, const void *mac_lte_tap_info_ptr) +// Returns TAP_PACKET_REDRAW if a redraw is needed, TAP_PACKET_DONT_REDRAW otherwise. +tap_packet_status LteMacStatisticsDialog::tapPacket(void *ws_dlg_ptr, struct _packet_info *, epan_dissect *, const void *mac_lte_tap_info_ptr) { // Look up dialog and tap info. LteMacStatisticsDialog *ws_dlg = static_cast<LteMacStatisticsDialog *>(ws_dlg_ptr); const mac_lte_tap_info *mlt_info = (const mac_lte_tap_info *) mac_lte_tap_info_ptr; if (!ws_dlg || !mlt_info) { - return FALSE; + return TAP_PACKET_DONT_REDRAW; } // Update common stats. @@ -727,7 +727,7 @@ gboolean LteMacStatisticsDialog::tapPacket(void *ws_dlg_ptr, struct _packet_info // Nothing more to do if tap entry isn't for a UE. if ((mlt_info->rntiType != C_RNTI) && (mlt_info->rntiType != SPS_RNTI)) { - return FALSE; + return TAP_PACKET_DONT_REDRAW; } // Look for an existing UE to match this tap info. @@ -757,7 +757,7 @@ gboolean LteMacStatisticsDialog::tapPacket(void *ws_dlg_ptr, struct _packet_info // Update the UE item with info from tap! mac_ue_ti->update(mlt_info); - return TRUE; + return TAP_PACKET_REDRAW; } // Return total number of frames tapped. diff --git a/ui/qt/lte_mac_statistics_dialog.h b/ui/qt/lte_mac_statistics_dialog.h index 8ba8ec15cc..79f79306e4 100644 --- a/ui/qt/lte_mac_statistics_dialog.h +++ b/ui/qt/lte_mac_statistics_dialog.h @@ -52,7 +52,7 @@ private: // Callbacks for register_tap_listener static void tapReset(void *ws_dlg_ptr); - static gboolean tapPacket(void *ws_dlg_ptr, struct _packet_info *, struct epan_dissect *, const void *mac_lte_tap_info_ptr); + static tap_packet_status tapPacket(void *ws_dlg_ptr, struct _packet_info *, struct epan_dissect *, const void *mac_lte_tap_info_ptr); static void tapDraw(void *ws_dlg_ptr); virtual const QString filterExpression(); diff --git a/ui/qt/lte_rlc_statistics_dialog.cpp b/ui/qt/lte_rlc_statistics_dialog.cpp index 36ce1b127f..e87d703df3 100644 --- a/ui/qt/lte_rlc_statistics_dialog.cpp +++ b/ui/qt/lte_rlc_statistics_dialog.cpp @@ -771,14 +771,14 @@ void LteRlcStatisticsDialog::tapReset(void *ws_dlg_ptr) } // Process the tap info from a dissected RLC PDU. -// Returns TRUE if a redraw is needed. -gboolean LteRlcStatisticsDialog::tapPacket(void *ws_dlg_ptr, struct _packet_info *, epan_dissect *, const void *rlc_lte_tap_info_ptr) +// Returns TAP_PACKET_REDRAW if a redraw is needed, TAP_PACKET_DONT_REDRAW otherwise. +tap_packet_status LteRlcStatisticsDialog::tapPacket(void *ws_dlg_ptr, struct _packet_info *, epan_dissect *, const void *rlc_lte_tap_info_ptr) { // Look up dialog. LteRlcStatisticsDialog *ws_dlg = static_cast<LteRlcStatisticsDialog *>(ws_dlg_ptr); const rlc_lte_tap_info *rlt_info = (const rlc_lte_tap_info *) rlc_lte_tap_info_ptr; if (!ws_dlg || !rlt_info) { - return FALSE; + return TAP_PACKET_DONT_REDRAW; } ws_dlg->incFrameCount(); @@ -807,7 +807,7 @@ gboolean LteRlcStatisticsDialog::tapPacket(void *ws_dlg_ptr, struct _packet_info // Update the UE from the information in the tap structure. ue_ti->update(rlt_info); - return TRUE; + return TAP_PACKET_REDRAW; } void LteRlcStatisticsDialog::tapDraw(void *ws_dlg_ptr) diff --git a/ui/qt/lte_rlc_statistics_dialog.h b/ui/qt/lte_rlc_statistics_dialog.h index 659350d808..aedaa22bd8 100644 --- a/ui/qt/lte_rlc_statistics_dialog.h +++ b/ui/qt/lte_rlc_statistics_dialog.h @@ -47,7 +47,7 @@ private: // Callbacks for register_tap_listener static void tapReset(void *ws_dlg_ptr); - static gboolean tapPacket(void *ws_dlg_ptr, struct _packet_info *, struct epan_dissect *, const void *rlc_lte_tap_info_ptr); + static tap_packet_status tapPacket(void *ws_dlg_ptr, struct _packet_info *, struct epan_dissect *, const void *rlc_lte_tap_info_ptr); static void tapDraw(void *ws_dlg_ptr); void updateHeaderLabels(); diff --git a/ui/qt/models/expert_info_model.cpp b/ui/qt/models/expert_info_model.cpp index 6f16fec56d..7cb5848cc1 100644 --- a/ui/qt/models/expert_info_model.cpp +++ b/ui/qt/models/expert_info_model.cpp @@ -375,23 +375,23 @@ void ExpertInfoModel::tapReset(void *eid_ptr) model->clear(); } -gboolean ExpertInfoModel::tapPacket(void *eid_ptr, struct _packet_info *pinfo, struct epan_dissect *, const void *data) +tap_packet_status ExpertInfoModel::tapPacket(void *eid_ptr, struct _packet_info *pinfo, struct epan_dissect *, const void *data) { ExpertInfoModel *model = static_cast<ExpertInfoModel*>(eid_ptr); expert_info_t *expert_info = (expert_info_t *) data; - gboolean draw_required = FALSE; + tap_packet_status status = TAP_PACKET_DONT_REDRAW; if (!pinfo || !model || !expert_info) - return FALSE; + return TAP_PACKET_DONT_REDRAW; model->addExpertInfo(*expert_info); if (model->numEvents((enum ExpertSeverity)expert_info->severity) < 1) - draw_required = TRUE; + status = TAP_PACKET_REDRAW; model->eventCounts_[(enum ExpertSeverity)expert_info->severity]++; - return draw_required; + return status; } void ExpertInfoModel::tapDraw(void *eid_ptr) diff --git a/ui/qt/models/expert_info_model.h b/ui/qt/models/expert_info_model.h index 50c9c61dae..ce22fb8d74 100644 --- a/ui/qt/models/expert_info_model.h +++ b/ui/qt/models/expert_info_model.h @@ -20,6 +20,7 @@ #include <ui/qt/capture_file.h> #include <epan/expert.h> +#include <epan/tap.h> #include <epan/column-utils.h> class ExpertPacketItem @@ -112,7 +113,7 @@ public: // Callbacks for register_tap_listener static void tapReset(void *eid_ptr); - static gboolean tapPacket(void *eid_ptr, struct _packet_info *pinfo, struct epan_dissect *, const void *data); + static tap_packet_status tapPacket(void *eid_ptr, struct _packet_info *pinfo, struct epan_dissect *, const void *data); static void tapDraw(void *eid_ptr); private: diff --git a/ui/qt/mtp3_summary_dialog.cpp b/ui/qt/mtp3_summary_dialog.cpp index 199fd99433..5c5f6ee270 100644 --- a/ui/qt/mtp3_summary_dialog.cpp +++ b/ui/qt/mtp3_summary_dialog.cpp @@ -298,7 +298,7 @@ mtp3_summary_reset( } -static gboolean +static tap_packet_status mtp3_summary_packet( void *tapdata, packet_info *, @@ -314,8 +314,9 @@ mtp3_summary_packet( /* * we thought this si_code was not used ? * is MTP3_NUM_SI_CODE out of date ? + * XXX - if this is an error, report it and return TAP_PACKET_FAILED. */ - return(FALSE); + return(TAP_PACKET_DONT_REDRAW); } /* @@ -341,8 +342,9 @@ mtp3_summary_packet( { /* * too many + * XXX - report an error and return TAP_PACKET_FAILED? */ - return(FALSE); + return(TAP_PACKET_DONT_REDRAW); } mtp3_num_used++; @@ -353,7 +355,7 @@ mtp3_summary_packet( (*stat_p)[i].mtp3_si_code[data_p->mtp3_si_code].num_msus++; (*stat_p)[i].mtp3_si_code[data_p->mtp3_si_code].size += data_p->size; - return(TRUE); + return(TAP_PACKET_REDRAW); } void diff --git a/ui/qt/rtp_analysis_dialog.cpp b/ui/qt/rtp_analysis_dialog.cpp index 46046cf787..51b6547bfe 100644 --- a/ui/qt/rtp_analysis_dialog.cpp +++ b/ui/qt/rtp_analysis_dialog.cpp @@ -656,20 +656,20 @@ void RtpAnalysisDialog::tapReset(void *tapinfo_ptr) rtp_analysis_dialog->resetStatistics(); } -gboolean RtpAnalysisDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *rtpinfo_ptr) +tap_packet_status RtpAnalysisDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *rtpinfo_ptr) { RtpAnalysisDialog *rtp_analysis_dialog = dynamic_cast<RtpAnalysisDialog *>((RtpAnalysisDialog*)tapinfo_ptr); - if (!rtp_analysis_dialog) return FALSE; + if (!rtp_analysis_dialog) return TAP_PACKET_DONT_REDRAW; const struct _rtp_info *rtpinfo = (const struct _rtp_info *)rtpinfo_ptr; - if (!rtpinfo) return FALSE; + if (!rtpinfo) return TAP_PACKET_DONT_REDRAW; /* we ignore packets that are not displayed */ if (pinfo->fd->passed_dfilter == 0) - return FALSE; + return TAP_PACKET_DONT_REDRAW; /* also ignore RTP Version != 2 */ else if (rtpinfo->info_version != 2) - return FALSE; + return TAP_PACKET_DONT_REDRAW; /* is it the forward direction? */ else if (rtpstream_id_equal_pinfo_rtp_info(&(rtp_analysis_dialog->fwd_statinfo_.id),pinfo,rtpinfo)) { @@ -680,7 +680,7 @@ gboolean RtpAnalysisDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epa rtp_analysis_dialog->addPacket(false, pinfo, rtpinfo); } - return FALSE; + return TAP_PACKET_DONT_REDRAW; } void RtpAnalysisDialog::tapDraw(void *tapinfo_ptr) diff --git a/ui/qt/rtp_analysis_dialog.h b/ui/qt/rtp_analysis_dialog.h index 652058f1ac..2e1971c430 100644 --- a/ui/qt/rtp_analysis_dialog.h +++ b/ui/qt/rtp_analysis_dialog.h @@ -115,7 +115,7 @@ private: // Tap callbacks static void tapReset(void *tapinfo_ptr); - static gboolean tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *rtpinfo_ptr); + static tap_packet_status tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *rtpinfo_ptr); static void tapDraw(void *tapinfo_ptr); void resetStatistics(); diff --git a/ui/qt/rtp_player_dialog.cpp b/ui/qt/rtp_player_dialog.cpp index d6d2c1f6e1..52fe9d93aa 100644 --- a/ui/qt/rtp_player_dialog.cpp +++ b/ui/qt/rtp_player_dialog.cpp @@ -557,24 +557,24 @@ void RtpPlayerDialog::setPlayPosition(double secs) } } -gboolean RtpPlayerDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *rtpinfo_ptr) +tap_packet_status RtpPlayerDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *rtpinfo_ptr) { RtpPlayerDialog *rtp_player_dialog = dynamic_cast<RtpPlayerDialog *>((RtpPlayerDialog*)tapinfo_ptr); - if (!rtp_player_dialog) return FALSE; + if (!rtp_player_dialog) return TAP_PACKET_DONT_REDRAW; const struct _rtp_info *rtpinfo = (const struct _rtp_info *)rtpinfo_ptr; - if (!rtpinfo) return FALSE; + if (!rtpinfo) return TAP_PACKET_DONT_REDRAW; /* we ignore packets that are not displayed */ if (pinfo->fd->passed_dfilter == 0) - return FALSE; + return TAP_PACKET_DONT_REDRAW; /* also ignore RTP Version != 2 */ else if (rtpinfo->info_version != 2) - return FALSE; + return TAP_PACKET_DONT_REDRAW; rtp_player_dialog->addPacket(pinfo, rtpinfo); - return FALSE; + return TAP_PACKET_DONT_REDRAW; } void RtpPlayerDialog::addPacket(packet_info *pinfo, const _rtp_info *rtpinfo) diff --git a/ui/qt/rtp_player_dialog.h b/ui/qt/rtp_player_dialog.h index d9e2581059..c1bc38c6be 100644 --- a/ui/qt/rtp_player_dialog.h +++ b/ui/qt/rtp_player_dialog.h @@ -118,7 +118,7 @@ private: // Tap callbacks // static void tapReset(void *tapinfo_ptr); - static gboolean tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *rtpinfo_ptr); + static tap_packet_status tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *rtpinfo_ptr); static void tapDraw(void *tapinfo_ptr); void addPacket(packet_info *pinfo, const struct _rtp_info *rtpinfo); diff --git a/ui/qt/voip_calls_dialog.cpp b/ui/qt/voip_calls_dialog.cpp index a39a900613..c72200949b 100644 --- a/ui/qt/voip_calls_dialog.cpp +++ b/ui/qt/voip_calls_dialog.cpp @@ -157,14 +157,14 @@ void VoipCallsDialog::changeEvent(QEvent *event) // voip_calls_tapinfo_t *tapinfo = (voip_calls_tapinfo_t *) tapinfo_ptr; //} -gboolean VoipCallsDialog::tapPacket(void *, packet_info *, epan_dissect_t *, const void *) +tap_packet_status VoipCallsDialog::tapPacket(void *, packet_info *, epan_dissect_t *, const void *) { #ifdef QT_MULTIMEDIA_LIB // voip_calls_tapinfo_t *tapinfo = (voip_calls_tapinfo_t *) tapinfo_ptr; // add_rtp_packet for voip player. -// return TRUE; +// return TAP_PACKET_REDRAW; #endif - return FALSE; + return TAP_PACKET_DONT_REDRAW; } void VoipCallsDialog::tapDraw(void *tapinfo_ptr) diff --git a/ui/qt/voip_calls_dialog.h b/ui/qt/voip_calls_dialog.h index 658be731d8..ef29cf829a 100644 --- a/ui/qt/voip_calls_dialog.h +++ b/ui/qt/voip_calls_dialog.h @@ -69,7 +69,7 @@ private: // Tap callbacks // static void tapReset(void *tapinfo_ptr); - static gboolean tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data); + static tap_packet_status tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data); static void tapDraw(void *tapinfo_ptr); void updateCalls(); diff --git a/ui/qt/wireless_timeline.cpp b/ui/qt/wireless_timeline.cpp index baac452847..c222bb14e3 100644 --- a/ui/qt/wireless_timeline.cpp +++ b/ui/qt/wireless_timeline.cpp @@ -349,14 +349,14 @@ void WirelessTimeline::tap_timeline_reset(void* tapdata) timeline->radio_packet_list = g_hash_table_new(g_direct_hash, g_direct_equal); } -gboolean WirelessTimeline::tap_timeline_packet(void *tapdata, packet_info* pinfo, epan_dissect_t* edt _U_, const void *data) +tap_packet_status WirelessTimeline::tap_timeline_packet(void *tapdata, packet_info* pinfo, epan_dissect_t* edt _U_, const void *data) { WirelessTimeline* timeline = (WirelessTimeline*)tapdata; const struct wlan_radio *wlan_radio_info = (const struct wlan_radio *)data; /* Save the radio information in our own (GUI) hashtable */ g_hash_table_insert(timeline->radio_packet_list, GUINT_TO_POINTER(pinfo->num), (gpointer)wlan_radio_info); - return FALSE; + return TAP_PACKET_DONT_REDRAW; } struct wlan_radio* WirelessTimeline::get_wlan_radio(guint32 packet_num) diff --git a/ui/qt/wireless_timeline.h b/ui/qt/wireless_timeline.h index 2c2d83913a..9a2972f067 100644 --- a/ui/qt/wireless_timeline.h +++ b/ui/qt/wireless_timeline.h @@ -28,6 +28,7 @@ #include <epan/prefs.h> #include <epan/plugin_if.h> +#include <epan/tap.h> #include <epan/timestamp.h> #include <epan/dissectors/packet-ieee80211-radio.h> @@ -71,7 +72,7 @@ public slots: protected: static void tap_timeline_reset(void* tapdata); - static gboolean tap_timeline_packet(void *tapdata, packet_info* pinfo, epan_dissect_t* edt, const void *data); + static tap_packet_status tap_timeline_packet(void *tapdata, packet_info* pinfo, epan_dissect_t* edt, const void *data); struct wlan_radio* get_wlan_radio(guint32 packet_num); diff --git a/ui/qt/wireshark_dialog.cpp b/ui/qt/wireshark_dialog.cpp index 2c7498a56e..d9535b7524 100644 --- a/ui/qt/wireshark_dialog.cpp +++ b/ui/qt/wireshark_dialog.cpp @@ -100,7 +100,7 @@ void WiresharkDialog::updateWidgets() setWindowTitleFromSubtitle(); } -bool WiresharkDialog::registerTapListener(const char *tap_name, void *tap_data, const char *filter, guint flags, void(*tap_reset)(void *), gboolean(*tap_packet)(void *, struct _packet_info *, struct epan_dissect *, const void *), void(*tap_draw)(void *)) +bool WiresharkDialog::registerTapListener(const char *tap_name, void *tap_data, const char *filter, guint flags, void (*tap_reset)(void *), tap_packet_status (*tap_packet)(void *, struct _packet_info *, struct epan_dissect *, const void *), void (*tap_draw)(void *)) { GString *error_string = register_tap_listener(tap_name, tap_data, filter, flags, tap_reset, tap_packet, tap_draw, NULL); diff --git a/ui/qt/wireshark_dialog.h b/ui/qt/wireshark_dialog.h index 57ec1eacb6..a91e6c5659 100644 --- a/ui/qt/wireshark_dialog.h +++ b/ui/qt/wireshark_dialog.h @@ -26,6 +26,8 @@ // BaseCaptureDialog, CaptureHelperDialog (or rename CaptureFileDialog to something else - WiresharkFileDialog). // TapDialog might make sense as well. +#include <epan/tap.h> + #include "capture_file.h" #include "geometry_state_dialog.h" @@ -93,7 +95,7 @@ protected: bool registerTapListener(const char *tap_name, void *tap_data, const char *filter, guint flags, void (*tap_reset)(void *tapdata), - gboolean (*tap_packet)(void *tapdata, struct _packet_info *pinfo, struct epan_dissect *edt, const void *data), + tap_packet_status (*tap_packet)(void *tapdata, struct _packet_info *pinfo, struct epan_dissect *edt, const void *data), void (*tap_draw)(void *tap_data)); /** diff --git a/ui/qt/wlan_statistics_dialog.cpp b/ui/qt/wlan_statistics_dialog.cpp index d6ecd64614..4e84a401f7 100644 --- a/ui/qt/wlan_statistics_dialog.cpp +++ b/ui/qt/wlan_statistics_dialog.cpp @@ -558,17 +558,17 @@ void WlanStatisticsDialog::tapReset(void *ws_dlg_ptr) ws_dlg->packet_count_ = 0; } -gboolean WlanStatisticsDialog::tapPacket(void *ws_dlg_ptr, _packet_info *, epan_dissect *, const void *wlan_hdr_ptr) +tap_packet_status WlanStatisticsDialog::tapPacket(void *ws_dlg_ptr, _packet_info *, epan_dissect *, const void *wlan_hdr_ptr) { WlanStatisticsDialog *ws_dlg = static_cast<WlanStatisticsDialog *>(ws_dlg_ptr); const wlan_hdr_t *wlan_hdr = (const wlan_hdr_t *)wlan_hdr_ptr; - if (!ws_dlg || !wlan_hdr) return FALSE; + if (!ws_dlg || !wlan_hdr) return TAP_PACKET_DONT_REDRAW; guint16 frame_type = wlan_hdr->type & 0xff0; if (!((frame_type == 0x0) || (frame_type == 0x20) || (frame_type == 0x30)) || ((frame_type == 0x20) && DATA_FRAME_IS_NULL(wlan_hdr->type))) { /* Not a management or non null data or extension frame; let's skip it */ - return FALSE; + return TAP_PACKET_DONT_REDRAW; } ws_dlg->packet_count_++; @@ -595,7 +595,7 @@ gboolean WlanStatisticsDialog::tapPacket(void *ws_dlg_ptr, _packet_info *, epan_ } wn_ti->update(wlan_hdr); - return TRUE; + return TAP_PACKET_REDRAW; } void WlanStatisticsDialog::tapDraw(void *ws_dlg_ptr) diff --git a/ui/qt/wlan_statistics_dialog.h b/ui/qt/wlan_statistics_dialog.h index 1dc2507741..2bc1233e45 100644 --- a/ui/qt/wlan_statistics_dialog.h +++ b/ui/qt/wlan_statistics_dialog.h @@ -32,7 +32,7 @@ private: // Callbacks for register_tap_listener static void tapReset(void *ws_dlg_ptr); - static gboolean tapPacket(void *ws_dlg_ptr, struct _packet_info *, struct epan_dissect *, const void *wlan_hdr_ptr); + static tap_packet_status tapPacket(void *ws_dlg_ptr, struct _packet_info *, struct epan_dissect *, const void *wlan_hdr_ptr); static void tapDraw(void *ws_dlg_ptr); virtual const QString filterExpression(); |