| 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 "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
25 struct conversation;
26 struct _GStringChunk;
27
28 class PacketListRecord
29{
30 public:
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
68 private:
70 static QCache<uint32_t, QStringList> col_text_cache_;
71
72 frame_data *fdata_;
73 int lines_;
74 bool line_count_changed_;
75 static QMap<int, int> cinfo_column_;
76
78 static unsigned int rows_color_ver_;
79 unsigned int color_ver_;
80 bool colorized_;
81
83 unsigned int conv_index_;
84
85 bool read_failed_;
86 int row_;
87
89 GSList *color_filters_;
90 int color_filter_count_;
91
92 void dissect(capture_file *cap_file, bool dissect_columns, bool dissect_color = false);
93 void cacheColumnStrings(column_info *cinfo);
94};
95
96#endif // PACKET_LIST_RECORD_H
cfile.h
PacketListRecord
Definition packet_list_record.h:29
PacketListRecord::hasMultipleColors
bool hasMultipleColors() const
Definition packet_list_record.h:47
PacketListRecord::colorFilterCount
int colorFilterCount() const
Definition packet_list_record.h:49
PacketListRecord::matchingColorFilters
const GSList * matchingColorFilters() const
Definition packet_list_record.h:45
column.h
packet.h
_capture_file
Definition cfile.h:67
conversation
Definition conversation.h:230
epan_column_info
Definition column-info.h:62