Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
packet_list_record.h
Go to the documentation of this file.
1
10#ifndef PACKET_LIST_RECORD_H
11#define PACKET_LIST_RECORD_H
12
13#include <config.h>
14
15#include <epan/cfile.h>
16
17#include <epan/column.h>
18#include <epan/packet.h>
19
20#include <QByteArray>
21#include <QCache>
22#include <QList>
23#include <QVariant>
24
25struct conversation;
26struct _GStringChunk;
27
29{
30public:
31 PacketListRecord(frame_data *frameData);
32 virtual ~PacketListRecord();
33
34 // Ensure that the record is colorized.
35 void ensureColorized(capture_file *cap_file);
36 // Return the string value for a column. Data is cached if possible.
37 const QString columnString(capture_file *cap_file, int column, bool colorized = false);
38 frame_data *frameData() const { return fdata_; }
39 // packet_list->col_to_text in gtk/packet_list_store.c
40 static int textColumn(int column) { return cinfo_column_.value(column, -1); }
41 bool colorized() { return colorized_ && (color_ver_ == rows_color_ver_); }
42 unsigned int conversation() { return conv_index_; }
43
45 const GSList* matchingColorFilters() const { return color_filters_; }
47 bool hasMultipleColors() const { return color_filter_count_ > 1; }
49 int colorFilterCount() const { return color_filter_count_; }
50
51 int columnTextSize(const char *str);
52
53 void invalidateColorized() { colorized_ = false; }
54 void invalidateRecord() { col_text_cache_.remove(fdata_->num); }
55 static void invalidateAllRecords() { col_text_cache_.clear(); }
56 /* In Qt 6, QCache maxCost is a qsizetype, but the QAbstractItemModel
57 * number of rows is still an int, so we're limited to INT_MAX anyway.
58 */
59 static void setMaxCache(int cost) { col_text_cache_.setMaxCost(cost); }
60 static void resetColumns(column_info *cinfo);
61 static void resetColorization() { rows_color_ver_++; }
62
63 inline int lineCount() { return lines_; }
64 inline int lineCountChanged() { return line_count_changed_; }
65 inline void setRow(int row) { row_ = row; }
66 inline int row() const { return row_; }
67 inline uint32_t expertSeverity() const { return expert_severity_; }
68
69private:
71 static QCache<uint32_t, QStringList> col_text_cache_;
72
73 frame_data *fdata_;
74 int lines_;
75 bool line_count_changed_;
76 static QMap<int, int> cinfo_column_;
77
79 static unsigned int rows_color_ver_;
80 unsigned int color_ver_;
81 bool colorized_;
82
84 unsigned int conv_index_;
85
86 bool read_failed_;
87 int row_;
88 uint32_t expert_severity_;
89
91 GSList *color_filters_;
92 int color_filter_count_;
93
94 void dissect(capture_file *cap_file, bool dissect_columns, bool dissect_color = false);
95 void cacheColumnStrings(column_info *cinfo);
96};
97
98#endif // PACKET_LIST_RECORD_H
Definition packet_list_record.h:29
bool hasMultipleColors() const
Definition packet_list_record.h:47
int colorFilterCount() const
Definition packet_list_record.h:49
const GSList * matchingColorFilters() const
Definition packet_list_record.h:45
Definition cfile.h:68
Definition conversation.h:227
Definition column-info.h:59