| 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
25struct conversation;
26struct _GStringChunk;
27
28 class PacketListRecord
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
44 int columnTextSize(const char *str);
45
46 void invalidateColorized() { colorized_ = false; }
47 void invalidateRecord() { col_text_cache_.remove(fdata_->num); }
48 static void invalidateAllRecords() { col_text_cache_.clear(); }
49 /* In Qt 6, QCache maxCost is a qsizetype, but the QAbstractItemModel
50 * number of rows is still an int, so we're limited to INT_MAX anyway.
51 */
52 static void setMaxCache(int cost) { col_text_cache_.setMaxCost(cost); }
53 static void resetColumns(column_info *cinfo);
54 static void resetColorization() { rows_color_ver_++; }
55
56 inline int lineCount() { return lines_; }
57 inline int lineCountChanged() { return line_count_changed_; }
58 inline void setRow(int row) { row_ = row; }
59 inline int row() const { return row_; }
60
61private:
63 static QCache<uint32_t, QStringList> col_text_cache_;
64
65 frame_data *fdata_;
66 int lines_;
67 bool line_count_changed_;
68 static QMap<int, int> cinfo_column_;
69
71 static unsigned int rows_color_ver_;
72 unsigned int color_ver_;
73 bool colorized_;
74
76 unsigned int conv_index_;
77
78 bool read_failed_;
79 int row_;
80
81 void dissect(capture_file *cap_file, bool dissect_columns, bool dissect_color = false);
82 void cacheColumnStrings(column_info *cinfo);
83};
84
85#endif // PACKET_LIST_RECORD_H
cfile.h
PacketListRecord
Definition packet_list_record.h:29
column.h
packet.h
_capture_file
Definition cfile.h:67
conversation
Definition conversation.h:230
epan_column_info
Definition column-info.h:62