aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-02-08 16:19:12 -0800
committerGuy Harris <guy@alum.mit.edu>2018-02-09 00:29:51 +0000
commit1f5f63f8ef98bfe9c4d734674cee0df64855555d (patch)
tree133dd3563cc8d2d29dd85d4d43cd9a4636283192 /ui
parente4c5efafb7da2d25b7d47fe2dac3b1556c0b67b0 (diff)
Generalize wtap_pkthdr into a structure for packet and non-packet records.
Separate the stuff that any record could have from the stuff that only particular record types have; put the latter into a union, and put all that into a wtap_rec structure. Add some record-type checks as necessary. Change-Id: Id6b3486858f826fce4b096c59231f463e44bfaa2 Reviewed-on: https://code.wireshark.org/review/25696 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui')
-rw-r--r--ui/gtk/capture_file_dlg.c8
-rw-r--r--ui/gtk/iax2_analysis.c2
-rw-r--r--ui/gtk/main.c4
-rw-r--r--ui/gtk/packet_list_store.c12
-rw-r--r--ui/gtk/packet_win.c10
-rw-r--r--ui/gtk/rtp_analysis.c2
-rw-r--r--ui/gtk/sctp_assoc_analyse.c2
-rw-r--r--ui/proto_hier_stats.c10
-rw-r--r--ui/qt/address_editor_frame.cpp2
-rw-r--r--ui/qt/bluetooth_att_server_attributes_dialog.cpp11
-rw-r--r--ui/qt/bluetooth_devices_dialog.cpp9
-rw-r--r--ui/qt/bluetooth_hci_summary_dialog.cpp9
-rw-r--r--ui/qt/capture_file_dialog.cpp8
-rw-r--r--ui/qt/iax2_analysis_dialog.cpp2
-rw-r--r--ui/qt/models/packet_list_record.cpp10
-rw-r--r--ui/qt/packet_dialog.cpp7
-rw-r--r--ui/qt/packet_dialog.h2
-rw-r--r--ui/qt/packet_list.cpp2
-rw-r--r--ui/qt/rtp_analysis_dialog.cpp2
-rw-r--r--ui/qt/utils/frame_information.cpp4
-rw-r--r--ui/tap-rlc-graph.c2
-rw-r--r--ui/tap-tcp-stream.c2
-rw-r--r--ui/tap_export_pdu.c31
-rw-r--r--ui/text_import.c20
24 files changed, 90 insertions, 83 deletions
diff --git a/ui/gtk/capture_file_dlg.c b/ui/gtk/capture_file_dlg.c
index 1205861acc..ce16de01a8 100644
--- a/ui/gtk/capture_file_dlg.c
+++ b/ui/gtk/capture_file_dlg.c
@@ -180,14 +180,14 @@ preview_do(GtkWidget *prev, wtap *wth)
gchar first_buff[PREVIEW_STR_MAX];
time_t ti_time;
struct tm *ti_tm;
- const struct wtap_pkthdr *phdr;
+ const wtap_rec *rec;
time(&time_preview);
while ( (wtap_read(wth, &err, &err_info, &data_offset)) ) {
- phdr = wtap_phdr(wth);
- if (phdr->presence_flags & WTAP_HAS_TS) {
- cur_time = nstime_to_sec(&phdr->ts);
+ rec = wtap_get_rec(wth);
+ if (rec->presence_flags & WTAP_HAS_TS) {
+ cur_time = nstime_to_sec(&rec->ts);
if (!have_times) {
start_time = cur_time;
stop_time = cur_time;
diff --git a/ui/gtk/iax2_analysis.c b/ui/gtk/iax2_analysis.c
index b52d996586..aba8f495ec 100644
--- a/ui/gtk/iax2_analysis.c
+++ b/ui/gtk/iax2_analysis.c
@@ -3569,7 +3569,7 @@ void iax2_analysis_cb(GtkAction *action _U_, gpointer user_data _U_)
return; /* error reading the record */
epan_dissect_init(&edt, cf->epan, TRUE, FALSE);
epan_dissect_prime_with_dfilter(&edt, sfcode);
- epan_dissect_run(&edt, cf->cd_t, &cf->phdr,
+ epan_dissect_run(&edt, cf->cd_t, &cf->rec,
frame_tvbuff_new_buffer(&cf->provider, fdata, &cf->buf),
fdata, NULL);
diff --git a/ui/gtk/main.c b/ui/gtk/main.c
index 24607d4dfe..dd7c4bec71 100644
--- a/ui/gtk/main.c
+++ b/ui/gtk/main.c
@@ -529,7 +529,7 @@ get_ip_address_list_from_packet_list_row(gpointer data)
epan_dissect_init(&edt, cfile.epan, FALSE, FALSE);
col_custom_prime_edt(&edt, &cfile.cinfo);
- epan_dissect_run(&edt, cfile.cd_t, &cfile.phdr,
+ epan_dissect_run(&edt, cfile.cd_t, &cfile.rec,
frame_tvbuff_new_buffer(&cfile.provider, fdata, &cfile.buf),
fdata, &cfile.cinfo);
epan_dissect_fill_in_columns(&edt, TRUE, TRUE);
@@ -571,7 +571,7 @@ get_filter_from_packet_list_row_and_column(gpointer data)
epan_dissect_init(&edt, cfile.epan, have_custom_cols(&cfile.cinfo), FALSE);
col_custom_prime_edt(&edt, &cfile.cinfo);
- epan_dissect_run(&edt, cfile.cd_t, &cfile.phdr,
+ epan_dissect_run(&edt, cfile.cd_t, &cfile.rec,
frame_tvbuff_new_buffer(&cfile.provider, fdata, &cfile.buf),
fdata, &cfile.cinfo);
epan_dissect_fill_in_columns(&edt, TRUE, TRUE);
diff --git a/ui/gtk/packet_list_store.c b/ui/gtk/packet_list_store.c
index 57f2ba1bdc..cf4cde81bc 100644
--- a/ui/gtk/packet_list_store.c
+++ b/ui/gtk/packet_list_store.c
@@ -1103,14 +1103,14 @@ packet_list_dissect_and_cache_record(PacketList *packet_list, PacketListRecord *
column_info *cinfo;
gint col;
gboolean create_proto_tree;
- struct wtap_pkthdr phdr; /* Packet header */
- Buffer buf; /* Packet data */
+ wtap_rec rec; /* Record metadata */
+ Buffer buf; /* Record data */
gboolean dissect_columns = (record->col_text == NULL);
g_return_if_fail(packet_list);
g_return_if_fail(PACKETLIST_IS_LIST(packet_list));
- wtap_phdr_init(&phdr);
+ wtap_rec_init(&rec);
fdata = record->fdata;
@@ -1123,7 +1123,7 @@ packet_list_dissect_and_cache_record(PacketList *packet_list, PacketListRecord *
cinfo = NULL;
ws_buffer_init(&buf, 1500);
- if (!cf_read_record_r(&cfile, fdata, &phdr, &buf)) {
+ if (!cf_read_record_r(&cfile, fdata, &rec, &buf)) {
/*
* Error reading the record.
*
@@ -1176,7 +1176,7 @@ packet_list_dissect_and_cache_record(PacketList *packet_list, PacketListRecord *
* XXX - need to catch an OutOfMemoryError exception and
* attempt to recover from it.
*/
- epan_dissect_run(&edt, cfile.cd_t, &phdr,
+ epan_dissect_run(&edt, cfile.cd_t, &rec,
frame_tvbuff_new_buffer(&cfile.provider, fdata, &buf),
fdata, cinfo);
@@ -1192,7 +1192,7 @@ packet_list_dissect_and_cache_record(PacketList *packet_list, PacketListRecord *
record->colorized = TRUE;
epan_dissect_cleanup(&edt);
- wtap_phdr_cleanup(&phdr);
+ wtap_rec_cleanup(&rec);
ws_buffer_free(&buf);
}
diff --git a/ui/gtk/packet_win.c b/ui/gtk/packet_win.c
index 15cd0ddd6b..67a8e82830 100644
--- a/ui/gtk/packet_win.c
+++ b/ui/gtk/packet_win.c
@@ -76,8 +76,8 @@
/* Data structure holding information about a packet-detail window. */
struct PacketWinData {
frame_data *frame; /* The frame being displayed */
- struct wtap_pkthdr phdr; /* Packet header */
- guint8 *pd; /* Packet data */
+ wtap_rec rec; /* Record metadata */
+ guint8 *pd; /* Record data */
GtkWidget *main;
GtkWidget *tv_scrollw;
GtkWidget *tree_view;
@@ -159,7 +159,7 @@ redissect_packet_window(gpointer object, gpointer user_data _U_)
proto_tree_draw(NULL, DataPtr->tree_view);
epan_dissect_cleanup(&(DataPtr->edt));
epan_dissect_init(&(DataPtr->edt), cfile.epan, TRUE, TRUE);
- epan_dissect_run(&(DataPtr->edt), cfile.cd_t, &DataPtr->phdr,
+ epan_dissect_run(&(DataPtr->edt), cfile.cd_t, &DataPtr->rec,
frame_tvbuff_new(&cfile.provider, DataPtr->frame, DataPtr->pd),
DataPtr->frame, NULL);
add_byte_views(&(DataPtr->edt), DataPtr->tree_view, DataPtr->bv_nb_ptr);
@@ -224,12 +224,12 @@ void new_packet_window(GtkWidget *w _U_, gboolean reference, gboolean editable _
/* XXX, protect cfile.epan from closing (ref counting?) */
DataPtr->frame = fd;
- DataPtr->phdr = cfile.phdr;
+ DataPtr->rec = cfile.rec;
DataPtr->pd = (guint8 *)g_malloc(DataPtr->frame->cap_len);
memcpy(DataPtr->pd, ws_buffer_start_ptr(&cfile.buf), DataPtr->frame->cap_len);
epan_dissect_init(&(DataPtr->edt), cfile.epan, TRUE, TRUE);
- epan_dissect_run(&(DataPtr->edt), cfile.cd_t, &DataPtr->phdr,
+ epan_dissect_run(&(DataPtr->edt), cfile.cd_t, &DataPtr->rec,
frame_tvbuff_new(&cfile.provider, DataPtr->frame, DataPtr->pd),
DataPtr->frame, &cfile.cinfo);
epan_dissect_fill_in_columns(&(DataPtr->edt), FALSE, TRUE);
diff --git a/ui/gtk/rtp_analysis.c b/ui/gtk/rtp_analysis.c
index 3f05f46f4a..936c68ea84 100644
--- a/ui/gtk/rtp_analysis.c
+++ b/ui/gtk/rtp_analysis.c
@@ -3900,7 +3900,7 @@ rtp_analysis_cb(GtkAction *action _U_, gpointer user_data _U_)
epan_dissect_init(&edt, cf->epan, TRUE, FALSE);
epan_dissect_prime_with_dfilter(&edt, sfcode);
epan_dissect_prime_with_hfid(&edt, hfid_rtp_ssrc);
- epan_dissect_run(&edt, cf->cd_t, &cf->phdr,
+ epan_dissect_run(&edt, cf->cd_t, &cf->rec,
frame_tvbuff_new_buffer(&cf->provider, fdata, &cf->buf),
fdata, NULL);
diff --git a/ui/gtk/sctp_assoc_analyse.c b/ui/gtk/sctp_assoc_analyse.c
index 4d6d98fed1..949b3d676f 100644
--- a/ui/gtk/sctp_assoc_analyse.c
+++ b/ui/gtk/sctp_assoc_analyse.c
@@ -1003,7 +1003,7 @@ sctp_analyse_cb(struct sctp_analyse *u_data, gboolean ext)
epan_dissect_init(&edt, cf->epan, TRUE, FALSE);
epan_dissect_prime_with_dfilter(&edt, sfcode);
- epan_dissect_run(&edt, cf->cd_t, &cf->phdr,
+ epan_dissect_run(&edt, cf->cd_t, &cf->rec,
frame_tvbuff_new_buffer(&cf->provider, fdata, &cf->buf),
fdata, NULL);
diff --git a/ui/proto_hier_stats.c b/ui/proto_hier_stats.c
index 91d93941ac..fd5e8aef74 100644
--- a/ui/proto_hier_stats.c
+++ b/ui/proto_hier_stats.c
@@ -150,22 +150,22 @@ process_tree(proto_tree *protocol_tree, ph_stats_t* ps)
process_record(capture_file *cf, frame_data *frame, column_info *cinfo, ph_stats_t* ps)
{
epan_dissect_t edt;
- struct wtap_pkthdr phdr;
+ wtap_rec rec;
Buffer buf;
double cur_time;
- wtap_phdr_init(&phdr);
+ wtap_rec_init(&rec);
/* Load the record from the capture file */
ws_buffer_init(&buf, 1500);
- if (!cf_read_record_r(cf, frame, &phdr, &buf))
+ if (!cf_read_record_r(cf, frame, &rec, &buf))
return FALSE; /* failure */
/* Dissect the record tree not visible */
epan_dissect_init(&edt, cf->epan, TRUE, FALSE);
/* Don't fake protocols. We need them for the protocol hierarchy */
epan_dissect_fake_protocols(&edt, FALSE);
- epan_dissect_run(&edt, cf->cd_t, &phdr,
+ epan_dissect_run(&edt, cf->cd_t, &rec,
frame_tvbuff_new_buffer(&cf->provider, frame, &buf),
frame, cinfo);
@@ -183,7 +183,7 @@ process_record(capture_file *cf, frame_data *frame, column_info *cinfo, ph_stats
/* Free our memory. */
epan_dissect_cleanup(&edt);
- wtap_phdr_cleanup(&phdr);
+ wtap_rec_cleanup(&rec);
ws_buffer_free(&buf);
return TRUE; /* success */
diff --git a/ui/qt/address_editor_frame.cpp b/ui/qt/address_editor_frame.cpp
index 3c2087a7d1..81faeb5d4f 100644
--- a/ui/qt/address_editor_frame.cpp
+++ b/ui/qt/address_editor_frame.cpp
@@ -69,7 +69,7 @@ void AddressEditorFrame::editAddresses(CaptureFile &cf, int column)
epan_dissect_init(&edt, cap_file_->epan, FALSE, FALSE);
col_custom_prime_edt(&edt, &cap_file_->cinfo);
- epan_dissect_run(&edt, cap_file_->cd_t, &cap_file_->phdr,
+ epan_dissect_run(&edt, cap_file_->cd_t, &cap_file_->rec,
frame_tvbuff_new_buffer(&cap_file_->provider, cap_file_->current_frame, &cap_file_->buf),
cap_file_->current_frame, &cap_file_->cinfo);
epan_dissect_fill_in_columns(&edt, TRUE, TRUE);
diff --git a/ui/qt/bluetooth_att_server_attributes_dialog.cpp b/ui/qt/bluetooth_att_server_attributes_dialog.cpp
index 4da92d8b3f..f897ab9037 100644
--- a/ui/qt/bluetooth_att_server_attributes_dialog.cpp
+++ b/ui/qt/bluetooth_att_server_attributes_dialog.cpp
@@ -236,12 +236,15 @@ gboolean BluetoothAttServerAttributesDialog::tapPacket(void *tapinfo_ptr, packet
if (dialog->file_closed_)
return FALSE;
- if (pinfo->phdr->presence_flags & WTAP_HAS_INTERFACE_ID) {
+ if (pinfo->rec->rec_type != REC_TYPE_PACKET)
+ return FALSE;
+
+ if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID) {
gchar *interface;
const char *interface_name;
- interface_name = epan_get_interface_name(pinfo->epan, pinfo->phdr->interface_id);
- interface = wmem_strdup_printf(wmem_packet_scope(), "%u: %s", pinfo->phdr->interface_id, interface_name);
+ interface_name = epan_get_interface_name(pinfo->epan, pinfo->rec->rec_header.packet_header.interface_id);
+ interface = wmem_strdup_printf(wmem_packet_scope(), "%u: %s", pinfo->rec->rec_header.packet_header.interface_id, interface_name);
if (dialog->ui->interfaceComboBox->findText(interface) == -1)
dialog->ui->interfaceComboBox->addItem(interface);
@@ -261,7 +264,7 @@ gboolean BluetoothAttServerAttributesDialog::tapPacket(void *tapinfo_ptr, packet
if (addr && dialog->ui->deviceComboBox->currentIndex() > 0) {
if (dialog->ui->deviceComboBox->currentText() != addr)
- return TRUE;
+ return TRUE;
}
handle.sprintf("0x%04x", tap_handles->handle);
diff --git a/ui/qt/bluetooth_devices_dialog.cpp b/ui/qt/bluetooth_devices_dialog.cpp
index a0b6c1d76c..b97b80cdc6 100644
--- a/ui/qt/bluetooth_devices_dialog.cpp
+++ b/ui/qt/bluetooth_devices_dialog.cpp
@@ -265,12 +265,15 @@ gboolean BluetoothDevicesDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo
if (dialog->file_closed_)
return FALSE;
- if (pinfo->phdr->presence_flags & WTAP_HAS_INTERFACE_ID) {
+ if (pinfo->rec->rec_type != REC_TYPE_PACKET)
+ return FALSE;
+
+ if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID) {
gchar *interface;
const char *interface_name;
- interface_name = epan_get_interface_name(pinfo->epan, pinfo->phdr->interface_id);
- interface = wmem_strdup_printf(wmem_packet_scope(), "%u: %s", pinfo->phdr->interface_id, interface_name);
+ interface_name = epan_get_interface_name(pinfo->epan, pinfo->rec->rec_header.packet_header.interface_id);
+ interface = wmem_strdup_printf(wmem_packet_scope(), "%u: %s", pinfo->rec->rec_header.packet_header.interface_id, interface_name);
if (dialog->ui->interfaceComboBox->findText(interface) == -1)
dialog->ui->interfaceComboBox->addItem(interface);
diff --git a/ui/qt/bluetooth_hci_summary_dialog.cpp b/ui/qt/bluetooth_hci_summary_dialog.cpp
index baf76ee777..a9cb363a47 100644
--- a/ui/qt/bluetooth_hci_summary_dialog.cpp
+++ b/ui/qt/bluetooth_hci_summary_dialog.cpp
@@ -346,14 +346,17 @@ gboolean BluetoothHciSummaryDialog::tapPacket(void *tapinfo_ptr, packet_info *pi
if (dialog->file_closed_)
return FALSE;
+ if (pinfo->rec->rec_type != REC_TYPE_PACKET)
+ return FALSE;
+
name = tr("Unknown");
- if (pinfo->phdr->presence_flags & WTAP_HAS_INTERFACE_ID) {
+ if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID) {
gchar *interface;
const char *interface_name;
- interface_name = epan_get_interface_name(pinfo->epan, pinfo->phdr->interface_id);
- interface = wmem_strdup_printf(wmem_packet_scope(), "%u: %s", pinfo->phdr->interface_id, interface_name);
+ interface_name = epan_get_interface_name(pinfo->epan, pinfo->rec->rec_header.packet_header.interface_id);
+ interface = wmem_strdup_printf(wmem_packet_scope(), "%u: %s", pinfo->rec->rec_header.packet_header.interface_id, interface_name);
if (dialog->ui->interfaceComboBox->findText(interface) == -1)
dialog->ui->interfaceComboBox->addItem(interface);
diff --git a/ui/qt/capture_file_dialog.cpp b/ui/qt/capture_file_dialog.cpp
index 4d94260118..e172a3bc35 100644
--- a/ui/qt/capture_file_dialog.cpp
+++ b/ui/qt/capture_file_dialog.cpp
@@ -690,7 +690,7 @@ void CaptureFileDialog::preview(const QString & path)
int err = 0;
gchar *err_info;
gint64 data_offset;
- const struct wtap_pkthdr *phdr;
+ const wtap_rec *rec;
double start_time = 0; /* seconds, with nsec resolution */
double stop_time = 0; /* seconds, with nsec resolution */
gboolean have_times = FALSE;
@@ -747,9 +747,9 @@ void CaptureFileDialog::preview(const QString & path)
time(&time_preview);
while ((wtap_read(wth, &err, &err_info, &data_offset))) {
- phdr = wtap_phdr(wth);
- if (phdr->presence_flags & WTAP_HAS_TS) {
- cur_time = nstime_to_sec(&phdr->ts);
+ rec = wtap_get_rec(wth);
+ if (rec->presence_flags & WTAP_HAS_TS) {
+ cur_time = nstime_to_sec(&rec->ts);
if (!have_times) {
start_time = cur_time;
stop_time = cur_time;
diff --git a/ui/qt/iax2_analysis_dialog.cpp b/ui/qt/iax2_analysis_dialog.cpp
index d5411a6016..30ea03135a 100644
--- a/ui/qt/iax2_analysis_dialog.cpp
+++ b/ui/qt/iax2_analysis_dialog.cpp
@@ -321,7 +321,7 @@ Iax2AnalysisDialog::Iax2AnalysisDialog(QWidget &parent, CaptureFile &cf) :
epan_dissect_init(&edt, cap_file_.capFile()->epan, TRUE, FALSE);
epan_dissect_prime_with_dfilter(&edt, sfcode);
- epan_dissect_run(&edt, cap_file_.capFile()->cd_t, &cap_file_.capFile()->phdr,
+ epan_dissect_run(&edt, cap_file_.capFile()->cd_t, &cap_file_.capFile()->rec,
frame_tvbuff_new_buffer(&cap_file_.capFile()->provider, fdata, &cap_file_.capFile()->buf),
fdata, NULL);
diff --git a/ui/qt/models/packet_list_record.cpp b/ui/qt/models/packet_list_record.cpp
index 6e9c6c3316..8c1228b188 100644
--- a/ui/qt/models/packet_list_record.cpp
+++ b/ui/qt/models/packet_list_record.cpp
@@ -99,8 +99,8 @@ void PacketListRecord::dissect(capture_file *cap_file, bool dissect_color)
epan_dissect_t edt;
column_info *cinfo = NULL;
gboolean create_proto_tree;
- struct wtap_pkthdr phdr; /* Packet header */
- Buffer buf; /* Packet data */
+ wtap_rec rec; /* Record metadata */
+ Buffer buf; /* Record data */
if (!col_text_) col_text_ = new ColumnTextList;
gboolean dissect_columns = col_text_->isEmpty() || data_ver_ != col_data_ver_;
@@ -109,14 +109,14 @@ void PacketListRecord::dissect(capture_file *cap_file, bool dissect_color)
return;
}
- memset(&phdr, 0, sizeof(struct wtap_pkthdr));
+ memset(&rec, 0, sizeof rec);
if (dissect_columns) {
cinfo = &cap_file->cinfo;
}
ws_buffer_init(&buf, 1500);
- if (!cf_read_record_r(cap_file, fdata_, &phdr, &buf)) {
+ if (!cf_read_record_r(cap_file, fdata_, &rec, &buf)) {
/*
* Error reading the record.
*
@@ -172,7 +172,7 @@ void PacketListRecord::dissect(capture_file *cap_file, bool dissect_color)
* XXX - need to catch an OutOfMemoryError exception and
* attempt to recover from it.
*/
- epan_dissect_run(&edt, cap_file->cd_t, &phdr,
+ epan_dissect_run(&edt, cap_file->cd_t, &rec,
frame_tvbuff_new_buffer(&cap_file->provider, fdata_, &buf),
fdata_, cinfo);
diff --git a/ui/qt/packet_dialog.cpp b/ui/qt/packet_dialog.cpp
index 326fd71aa9..f94a5ba2e9 100644
--- a/ui/qt/packet_dialog.cpp
+++ b/ui/qt/packet_dialog.cpp
@@ -35,13 +35,12 @@ PacketDialog::PacketDialog(QWidget &parent, CaptureFile &cf, frame_data *fdata)
ui(new Ui::PacketDialog),
proto_tree_(NULL),
byte_view_tab_(NULL),
- phdr_(wtap_pkthdr()),
+ rec_(wtap_rec()),
packet_data_(NULL)
{
ui->setupUi(this);
loadGeometry(parent.width() * 4 / 5, parent.height() * 4 / 5);
ui->hintLabel->setSmallText();
- phdr_.ft_specific_data = Buffer();
edt_.session = NULL;
edt_.tvb = NULL;
edt_.tree = NULL;
@@ -55,14 +54,14 @@ PacketDialog::PacketDialog(QWidget &parent, CaptureFile &cf, frame_data *fdata)
return;
}
- phdr_ = cap_file_.capFile()->phdr;
+ rec_ = cap_file_.capFile()->rec;
packet_data_ = (guint8 *) g_memdup(ws_buffer_start_ptr(&(cap_file_.capFile()->buf)), fdata->cap_len);
/* proto tree, visible. We need a proto tree if there's custom columns */
epan_dissect_init(&edt_, cap_file_.capFile()->epan, TRUE, TRUE);
col_custom_prime_edt(&edt_, &(cap_file_.capFile()->cinfo));
- epan_dissect_run(&edt_, cap_file_.capFile()->cd_t, &phdr_,
+ epan_dissect_run(&edt_, cap_file_.capFile()->cd_t, &rec_,
frame_tvbuff_new(&cap_file_.capFile()->provider, fdata, packet_data_),
fdata, &(cap_file_.capFile()->cinfo));
epan_dissect_fill_in_columns(&edt_, TRUE, TRUE);
diff --git a/ui/qt/packet_dialog.h b/ui/qt/packet_dialog.h
index 4779dd6f64..335b52a8d8 100644
--- a/ui/qt/packet_dialog.h
+++ b/ui/qt/packet_dialog.h
@@ -44,7 +44,7 @@ private:
ProtoTree *proto_tree_;
ByteViewTab *byte_view_tab_;
epan_dissect_t edt_;
- struct wtap_pkthdr phdr_;
+ wtap_rec rec_;
guint8 *packet_data_;
};
diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp
index 9ddf6cec8e..657928a749 100644
--- a/ui/qt/packet_list.cpp
+++ b/ui/qt/packet_list.cpp
@@ -985,7 +985,7 @@ QString PacketList::getFilterFromRowAndColumn()
epan_dissect_init(&edt, cap_file_->epan, have_custom_cols(&cap_file_->cinfo), FALSE);
col_custom_prime_edt(&edt, &cap_file_->cinfo);
- epan_dissect_run(&edt, cap_file_->cd_t, &cap_file_->phdr,
+ epan_dissect_run(&edt, cap_file_->cd_t, &cap_file_->rec,
frame_tvbuff_new_buffer(&cap_file_->provider, fdata, &cap_file_->buf),
fdata, &cap_file_->cinfo);
epan_dissect_fill_in_columns(&edt, TRUE, TRUE);
diff --git a/ui/qt/rtp_analysis_dialog.cpp b/ui/qt/rtp_analysis_dialog.cpp
index b8a950344d..db3438b180 100644
--- a/ui/qt/rtp_analysis_dialog.cpp
+++ b/ui/qt/rtp_analysis_dialog.cpp
@@ -1599,7 +1599,7 @@ void RtpAnalysisDialog::findStreams()
epan_dissect_init(&edt, cap_file_.capFile()->epan, TRUE, FALSE);
epan_dissect_prime_with_dfilter(&edt, sfcode);
epan_dissect_prime_with_hfid(&edt, hfid_rtp_ssrc);
- epan_dissect_run(&edt, cap_file_.capFile()->cd_t, &cap_file_.capFile()->phdr,
+ epan_dissect_run(&edt, cap_file_.capFile()->cd_t, &cap_file_.capFile()->rec,
frame_tvbuff_new_buffer(&cap_file_.capFile()->provider, fdata, &cap_file_.capFile()->buf),
fdata, NULL);
diff --git a/ui/qt/utils/frame_information.cpp b/ui/qt/utils/frame_information.cpp
index b3e6b12dfe..62ad88c12d 100644
--- a/ui/qt/utils/frame_information.cpp
+++ b/ui/qt/utils/frame_information.cpp
@@ -40,14 +40,14 @@ void FrameInformation::loadFrameTree()
if (!cf_read_record(cap_file_->capFile(), fi_))
return;
- struct wtap_pkthdr phdr_ = cap_file_->capFile()->phdr;
+ wtap_rec rec_ = cap_file_->capFile()->rec;
packet_data_ = (guint8 *) g_memdup(ws_buffer_start_ptr(&(cap_file_->capFile()->buf)), fi_->cap_len);
/* proto tree, visible. We need a proto tree if there's custom columns */
epan_dissect_init(&edt_, cap_file_->capFile()->epan, TRUE, TRUE);
col_custom_prime_edt(&edt_, &(cap_file_->capFile()->cinfo));
- epan_dissect_run(&edt_, cap_file_->capFile()->cd_t, &phdr_,
+ epan_dissect_run(&edt_, cap_file_->capFile()->cd_t, &rec_,
frame_tvbuff_new(&cap_file_->capFile()->provider, fi_, packet_data_),
fi_, &(cap_file_->capFile()->cinfo));
epan_dissect_fill_in_columns(&edt_, TRUE, TRUE);
diff --git a/ui/tap-rlc-graph.c b/ui/tap-rlc-graph.c
index 5be215d318..17620983cb 100644
--- a/ui/tap-rlc-graph.c
+++ b/ui/tap-rlc-graph.c
@@ -130,7 +130,7 @@ rlc_lte_tap_info *select_rlc_lte_session(capture_file *cf,
epan_dissect_init(&edt, cf->epan, TRUE, FALSE);
epan_dissect_prime_with_dfilter(&edt, sfcode);
- epan_dissect_run_with_taps(&edt, cf->cd_t, &cf->phdr,
+ epan_dissect_run_with_taps(&edt, cf->cd_t, &cf->rec,
frame_tvbuff_new_buffer(&cf->provider, fdata, &cf->buf),
fdata, NULL);
rel_ts = edt.pi.rel_ts;
diff --git a/ui/tap-tcp-stream.c b/ui/tap-tcp-stream.c
index a91ad14836..eae8b40a6c 100644
--- a/ui/tap-tcp-stream.c
+++ b/ui/tap-tcp-stream.c
@@ -306,7 +306,7 @@ select_tcpip_session(capture_file *cf, struct segment *hdrs)
epan_dissect_init(&edt, cf->epan, TRUE, FALSE);
epan_dissect_prime_with_dfilter(&edt, sfcode);
- epan_dissect_run_with_taps(&edt, cf->cd_t, &cf->phdr,
+ epan_dissect_run_with_taps(&edt, cf->cd_t, &cf->rec,
frame_tvbuff_new_buffer(&cf->provider, fdata, &cf->buf),
fdata, NULL);
rel_ts = edt.pi.rel_ts;
diff --git a/ui/tap_export_pdu.c b/ui/tap_export_pdu.c
index b58747c24f..750e39fdae 100644
--- a/ui/tap_export_pdu.c
+++ b/ui/tap_export_pdu.c
@@ -28,13 +28,13 @@ export_pdu_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const
{
const exp_pdu_data_t *exp_pdu_data = (const exp_pdu_data_t *)data;
exp_pdu_t *exp_pdu_tap_data = (exp_pdu_t *)tapdata;
- struct wtap_pkthdr pkthdr;
+ wtap_rec rec;
int err;
gchar *err_info;
int buffer_len;
guint8 *packet_buf;
- memset(&pkthdr, 0, sizeof(struct wtap_pkthdr));
+ memset(&rec, 0, sizeof rec);
buffer_len = exp_pdu_data->tvb_captured_length + exp_pdu_data->tlv_buffer_len;
packet_buf = (guint8 *)g_malloc(buffer_len);
@@ -45,26 +45,25 @@ export_pdu_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const
if(exp_pdu_data->tvb_captured_length > 0){
tvb_memcpy(exp_pdu_data->pdu_tvb, packet_buf+exp_pdu_data->tlv_buffer_len, 0, exp_pdu_data->tvb_captured_length);
}
- pkthdr.rec_type = REC_TYPE_PACKET;
- pkthdr.ts.secs = pinfo->abs_ts.secs;
- pkthdr.ts.nsecs = pinfo->abs_ts.nsecs;
- pkthdr.caplen = buffer_len;
- pkthdr.len = exp_pdu_data->tvb_reported_length + exp_pdu_data->tlv_buffer_len;
+ rec.rec_type = REC_TYPE_PACKET;
+ rec.presence_flags = WTAP_HAS_CAP_LEN|WTAP_HAS_INTERFACE_ID|WTAP_HAS_TS|WTAP_HAS_PACK_FLAGS;
+ rec.ts.secs = pinfo->abs_ts.secs;
+ rec.ts.nsecs = pinfo->abs_ts.nsecs;
+ rec.rec_header.packet_header.caplen = buffer_len;
+ rec.rec_header.packet_header.len = exp_pdu_data->tvb_reported_length + exp_pdu_data->tlv_buffer_len;
- pkthdr.pkt_encap = exp_pdu_tap_data->pkt_encap;
+ rec.rec_header.packet_header.pkt_encap = exp_pdu_tap_data->pkt_encap;
if (pinfo->fd->flags.has_user_comment) {
- pkthdr.opt_comment = g_strdup(epan_get_user_comment(edt->session, pinfo->fd));
- pkthdr.has_comment_changed = TRUE;
+ rec.opt_comment = g_strdup(epan_get_user_comment(edt->session, pinfo->fd));
+ rec.has_comment_changed = TRUE;
} else if (pinfo->fd->flags.has_phdr_comment) {
- pkthdr.opt_comment = g_strdup(pinfo->phdr->opt_comment);
+ rec.opt_comment = g_strdup(pinfo->rec->opt_comment);
}
- pkthdr.presence_flags = WTAP_HAS_CAP_LEN|WTAP_HAS_INTERFACE_ID|WTAP_HAS_TS|WTAP_HAS_PACK_FLAGS;
-
- /* XXX: should the pkthdr.pseudo_header be set to the pinfo's pseudo-header? */
+ /* XXX: should the rec.rec_header.packet_header.pseudo_header be set to the pinfo's pseudo-header? */
/* XXX: report errors! */
- if (!wtap_dump(exp_pdu_tap_data->wdh, &pkthdr, packet_buf, &err, &err_info)) {
+ if (!wtap_dump(exp_pdu_tap_data->wdh, &rec, packet_buf, &err, &err_info)) {
switch (err) {
case WTAP_ERR_UNWRITABLE_REC_DATA:
@@ -77,7 +76,7 @@ export_pdu_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const
}
g_free(packet_buf);
- g_free(pkthdr.opt_comment);
+ g_free(rec.opt_comment);
return FALSE; /* Do not redraw */
}
diff --git a/ui/text_import.c b/ui/text_import.c
index 6a4c2e998d..6cf315fb54 100644
--- a/ui/text_import.c
+++ b/ui/text_import.c
@@ -504,23 +504,23 @@ write_current_packet (void)
{
/* Write the packet */
- struct wtap_pkthdr pkthdr;
+ wtap_rec rec;
int err;
gchar *err_info;
- memset(&pkthdr, 0, sizeof(struct wtap_pkthdr));
+ memset(&rec, 0, sizeof rec);
- pkthdr.rec_type = REC_TYPE_PACKET;
- pkthdr.ts.secs = (guint32)ts_sec;
- pkthdr.ts.nsecs = ts_usec * 1000;
+ rec.rec_type = REC_TYPE_PACKET;
+ rec.ts.secs = (guint32)ts_sec;
+ rec.ts.nsecs = ts_usec * 1000;
if (ts_fmt == NULL) { ts_usec++; } /* fake packet counter */
- pkthdr.caplen = pkthdr.len = prefix_length + curr_offset + eth_trailer_length;
- pkthdr.pkt_encap = pcap_link_type;
- pkthdr.pack_flags |= direction;
- pkthdr.presence_flags = WTAP_HAS_CAP_LEN|WTAP_HAS_INTERFACE_ID|WTAP_HAS_TS|WTAP_HAS_PACK_FLAGS;
+ rec.rec_header.packet_header.caplen = rec.rec_header.packet_header.len = prefix_length + curr_offset + eth_trailer_length;
+ rec.rec_header.packet_header.pkt_encap = pcap_link_type;
+ rec.rec_header.packet_header.pack_flags |= direction;
+ rec.presence_flags = WTAP_HAS_CAP_LEN|WTAP_HAS_INTERFACE_ID|WTAP_HAS_TS|WTAP_HAS_PACK_FLAGS;
/* XXX - report errors! */
- if (!wtap_dump(wdh, &pkthdr, packet_buf, &err, &err_info)) {
+ if (!wtap_dump(wdh, &rec, packet_buf, &err, &err_info)) {
switch (err) {
case WTAP_ERR_UNWRITABLE_REC_DATA: