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
32{
33public:
39
43 virtual ~PacketListRecord();
44
49 void ensureColorized(capture_file *cap_file);
50
58 const QString columnString(capture_file *cap_file, int column, bool colorized = false);
59
64 frame_data *frameData() const { return fdata_; }
65
71 static int textColumn(int column) { return cinfo_column_.value(column, -1); }
72
77 bool colorized() { return colorized_ && (color_ver_ == rows_color_ver_); }
78
83 unsigned int conversation() { return conv_index_; }
84
89 const GSList* matchingColorFilters() const { return color_filters_; }
90
95 bool hasMultipleColors() const { return color_filter_count_ > 1; }
96
101 int colorFilterCount() const { return color_filter_count_; }
102
108 int columnTextSize(const char *str);
109
113 void invalidateColorized() { colorized_ = false; }
114
118 void invalidateRecord() { col_text_cache_.remove(fdata_->num); }
119
123 static void invalidateAllRecords() { col_text_cache_.clear(); }
124
133 static void setMaxCache(int cost) { col_text_cache_.setMaxCost(cost); }
134
139 static void resetColumns(column_info *cinfo);
140
144 static void resetColorization() { rows_color_ver_++; }
145
150 static void setDissectionPaused(bool paused) { dissection_paused_ = paused; }
151
156 inline int lineCount() { return lines_; }
157
162 inline int lineCountChanged() { return line_count_changed_; }
163
168 inline void setRow(int row) { row_ = row; }
169
174 inline int row() const { return row_; }
175
180 inline uint32_t expertSeverity() const { return expert_severity_; }
181
182private:
183 static QCache<uint32_t, QStringList> col_text_cache_;
184 static bool dissection_paused_;
186 frame_data *fdata_;
187 int lines_;
188 bool line_count_changed_;
189 static QMap<int, int> cinfo_column_;
191 static unsigned int rows_color_ver_;
192 unsigned int color_ver_;
193 bool colorized_;
195 unsigned int conv_index_;
197 bool read_failed_;
198 int row_;
199 uint32_t expert_severity_;
201 GSList *color_filters_;
202 int color_filter_count_;
210 void dissect(capture_file *cap_file, bool dissect_columns, bool dissect_color = false);
211
216 void cacheColumnStrings(column_info *cinfo);
217};
218
219#endif // PACKET_LIST_RECORD_H
Represents a single record within the packet list.
Definition packet_list_record.h:32
static void setDissectionPaused(bool paused)
Sets whether packet dissection is currently paused.
Definition packet_list_record.h:150
int row() const
Gets the logical row index of this record.
Definition packet_list_record.h:174
static void resetColorization()
Increments the global color version to reset colorization for all.
Definition packet_list_record.h:144
uint32_t expertSeverity() const
Gets the highest expert information severity found in the packet.
Definition packet_list_record.h:180
void ensureColorized(capture_file *cap_file)
Ensure that the record is colorized.
Definition packet_list_record.cpp:51
int lineCount()
Gets the number of lines this record spans.
Definition packet_list_record.h:156
bool hasMultipleColors() const
Check if packet has multiple color matches.
Definition packet_list_record.h:95
int colorFilterCount() const
Get count of matching color filters.
Definition packet_list_record.h:101
int columnTextSize(const char *str)
Calculates the size of the column text.
static void resetColumns(column_info *cinfo)
Resets the columns configuration.
Definition packet_list_record.cpp:97
virtual ~PacketListRecord()
Destroys the PacketListRecord.
Definition packet_list_record.cpp:45
unsigned int conversation()
Retrieves the conversation index.
Definition packet_list_record.h:83
void setRow(int row)
Sets the logical row index for this record.
Definition packet_list_record.h:168
frame_data * frameData() const
Gets the underlying frame data.
Definition packet_list_record.h:64
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:70
const GSList * matchingColorFilters() const
Get list of all matching color filters.
Definition packet_list_record.h:89
static void setMaxCache(int cost)
Sets the maximum capacity of the column text cache.
Definition packet_list_record.h:133
void invalidateColorized()
Invalidates the current colorized state, forcing a re-evaluation.
Definition packet_list_record.h:113
void invalidateRecord()
Removes this specific record from the column text cache.
Definition packet_list_record.h:118
static void invalidateAllRecords()
Clears the column text cache for all records.
Definition packet_list_record.h:123
static int textColumn(int column)
packet_list->col_to_text in gtk/packet_list_store.c
Definition packet_list_record.h:71
int lineCountChanged()
Gets whether the line count has changed.
Definition packet_list_record.h:162
bool colorized()
Checks if the record is currently colorized up to date.
Definition packet_list_record.h:77
DIAG_OFF_PEDANTIC struct _frame_data frame_data
Frame data structure.
Represents a capture file and its associated metadata.
Definition cfile.h:84
Definition conversation.h:229
Definition column-info.h:59