Wireshark 5.1.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
packet_list_record.h
Go to the documentation of this file.
1
9
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 <QPair>
24#include <QString>
25#include <QStringList>
26#include <QVariant>
27#include <QMetaType>
28
29struct conversation;
30struct _GStringChunk;
31
32typedef QList<QPair<QString,QString>> TagSegmentList;
33Q_DECLARE_METATYPE(TagSegmentList)
34
35
36
40{
41public:
47
51 virtual ~PacketListRecord();
52
57 void ensureColorized(capture_file *cap_file);
58
66 const QString columnString(capture_file *cap_file, int column, bool colorized = false);
67
72 frame_data *frameData() const { return fdata_; }
73
79 static int textColumn(int column) { return cinfo_column_.value(column, -1); }
80
85 bool colorized() { return colorized_ && (color_ver_ == rows_color_ver_); }
86
91 unsigned int conversation() { return conv_index_; }
92
97 const GSList* matchingColorFilters() const { return color_filters_; }
98
102 const QString &tagColumnString() const { return tag_column_str_; }
103
107 const QString &tagColumnTooltip() const { return tag_column_tip_; }
108
113 const TagSegmentList &tagColumnSegments() const { return tag_column_segments_; }
114
116 const TagSegmentList &tagLinkList() const { return tag_link_list_; }
117
122 bool hasMultipleColors() const { return color_filter_count_ > 1; }
123
128 int colorFilterCount() const { return color_filter_count_; }
129
135 int columnTextSize(const char *str);
136
140 void invalidateColorized() { colorized_ = false; }
141
145 void invalidateRecord() { col_text_cache_.remove(fdata_->num); }
146
150 static void invalidateAllRecords() { col_text_cache_.clear(); }
151
160 static void setMaxCache(int cost) { col_text_cache_.setMaxCost(cost); }
161
166 static void resetColumns(column_info *cinfo);
167
171 static void resetColorization() { rows_color_ver_++; }
172
177 static void setDissectionPaused(bool paused) { dissection_paused_ = paused; }
178
183 inline int lineCount() { return lines_; }
184
189 inline int lineCountChanged() { return line_count_changed_; }
190
195 inline void setRow(int row) { row_ = row; }
196
201 inline int row() const { return row_; }
202
207 inline uint32_t expertSeverity() const { return expert_severity_; }
208
209private:
210 static QCache<uint32_t, QStringList> col_text_cache_;
211 static bool dissection_paused_;
212
213 frame_data *fdata_;
214 int lines_;
215 bool line_count_changed_;
216 static QMap<int, int> cinfo_column_;
217
218 static unsigned int rows_color_ver_;
219 unsigned int color_ver_;
220 bool colorized_;
221
222 unsigned int conv_index_;
223
224 bool read_failed_;
225 int row_;
226 uint32_t expert_severity_;
227
228 GSList *color_filters_;
229 int color_filter_count_;
230
231 QString tag_column_str_;
232 QString tag_column_tip_;
233 TagSegmentList tag_column_segments_;
234 TagSegmentList tag_link_list_;
235 static bool any_tag_column_;
236
243 void dissect(capture_file *cap_file, bool dissect_columns, bool dissect_color = false);
244
249 void cacheColumnStrings(column_info *cinfo);
250};
251
252#endif // PACKET_LIST_RECORD_H
struct _capture_file capture_file
Represents a capture file and its associated metadata.
static void setDissectionPaused(bool paused)
Sets whether packet dissection is currently paused.
Definition packet_list_record.h:177
int row() const
Gets the logical row index of this record.
Definition packet_list_record.h:201
static void resetColorization()
Increments the global color version to reset colorization for all.
Definition packet_list_record.h:171
uint32_t expertSeverity() const
Gets the highest expert information severity found in the packet.
Definition packet_list_record.h:207
void ensureColorized(capture_file *cap_file)
Ensure that the record is colorized.
Definition packet_list_record.cpp:55
const QString & tagColumnTooltip() const
Tooltip text for the tag column (one "name: comment" line per matching rule).
Definition packet_list_record.h:107
const QString & tagColumnString() const
Concatenated tag_content strings for all matching rules (for COL_TAG display).
Definition packet_list_record.h:102
int lineCount()
Gets the number of lines this record spans.
Definition packet_list_record.h:183
bool hasMultipleColors() const
Check if packet has multiple color matches.
Definition packet_list_record.h:122
PacketListRecord(frame_data *frameData)
Constructs a PacketListRecord.
Definition packet_list_record.cpp:35
int colorFilterCount() const
Get count of matching color filters.
Definition packet_list_record.h:128
int columnTextSize(const char *str)
Calculates the size of the column text.
unsigned int conversation()
Retrieves the conversation index.
Definition packet_list_record.h:91
void setRow(int row)
Sets the logical row index for this record.
Definition packet_list_record.h:195
frame_data * frameData() const
Gets the underlying frame data.
Definition packet_list_record.h:72
const QString columnString(capture_file *cap_file, int column, bool colorized=false)
Return the string value for a column. Data is cached if possible.
Definition packet_list_record.cpp:74
const GSList * matchingColorFilters() const
Get list of all matching color filters.
Definition packet_list_record.h:97
static void setMaxCache(int cost)
Sets the maximum capacity of the column text cache.
Definition packet_list_record.h:160
const TagSegmentList & tagLinkList() const
Definition packet_list_record.h:116
void invalidateColorized()
Invalidates the current colorized state, forcing a re-evaluation.
Definition packet_list_record.h:140
void invalidateRecord()
Removes this specific record from the column text cache.
Definition packet_list_record.h:145
const TagSegmentList & tagColumnSegments() const
Per-segment (text, url) pairs for all matching rules in order. Used by TagColumnDelegate for per-emoj...
Definition packet_list_record.h:113
static void invalidateAllRecords()
Clears the column text cache for all records.
Definition packet_list_record.h:150
static int textColumn(int column)
packet_list->col_to_text in gtk/packet_list_store.c
Definition packet_list_record.h:79
int lineCountChanged()
Gets whether the line count has changed.
Definition packet_list_record.h:189
bool colorized()
Checks if the record is currently colorized up to date.
Definition packet_list_record.h:85
DIAG_OFF_PEDANTIC struct _frame_data frame_data
Frame data structure.
Definition conversation.h:284