12#ifndef EXPERT_INFO_MODEL_H
13#define EXPERT_INFO_MODEL_H
17#include <QAbstractItemModel>
50 unsigned int packetNum()
const {
return packet_num_; }
56 int group()
const {
return group_; }
68 int hfId()
const {
return hf_id_; }
80 QString
summary()
const {
return summary_; }
104 QString
groupKey(
bool group_by_summary);
147 unsigned int packet_num_;
166 QByteArray protocol_;
175 QList<ExpertPacketItem*> childItems_;
181 QHash<QString, ExpertPacketItem*> hashChild_;
234 QModelIndex
index(
int row,
int column,
235 const QModelIndex &
parent = QModelIndex())
const;
242 QModelIndex
parent(
const QModelIndex &
index)
const;
250 Qt::ItemFlags flags(
const QModelIndex &
index)
const;
259 QVariant data(
const QModelIndex &
index,
int role)
const;
305 static void tapReset(
void *eid_ptr);
321 static void tapDraw(
void *eid_ptr);
334 bool group_by_summary_;
340 QHash<enum ExpertSeverity, int> eventCounts_;
Manages a capture file and its associated state and operations.
Definition capture_file.h:27
A model managing the expert information tree data.
Definition expert_info_model.h:188
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Generates an index for the given row and column.
Definition expert_info_model.cpp:135
static tap_packet_status tapPacket(void *eid_ptr, struct _packet_info *pinfo, struct epan_dissect *, const void *data, tap_flags_t flags)
Callback used by register_tap_listener when a packet is processed.
Definition expert_info_model.cpp:446
QModelIndex parent(const QModelIndex &index) const
Retrieves the parent of a given index.
Definition expert_info_model.cpp:195
int numEvents(enum ExpertSeverity severity)
Gets the total number of events for a specific severity.
Definition expert_info_model.cpp:130
static void tapReset(void *eid_ptr)
Callback used by register_tap_listener to reset the tap.
Definition expert_info_model.cpp:437
ExpertColumn
Enumerates the columns in the expert info model.
Definition expert_info_model.h:205
@ colCount
Definition expert_info_model.h:210
@ colLast
Definition expert_info_model.h:213
@ colGroup
Definition expert_info_model.h:208
@ colSeverity
Definition expert_info_model.h:206
@ colProtocol
Definition expert_info_model.h:209
@ colPacket
Definition expert_info_model.h:211
@ colSummary
Definition expert_info_model.h:207
@ colHf
Definition expert_info_model.h:212
int rowCount(const QModelIndex &parent=QModelIndex()) const
Returns the number of rows under a given parent.
Definition expert_info_model.cpp:361
void addExpertInfo(const struct expert_info_s &expert_info)
Adds a new expert information entry to the model.
Definition expert_info_model.cpp:404
void setGroupBySummary(bool group_by_summary)
Sets whether the model groups items by summary.
Definition expert_info_model.cpp:354
void clear()
Clears all expert information data from the model.
Definition expert_info_model.cpp:107
int columnCount(const QModelIndex &parent=QModelIndex()) const
Returns the number of columns under a given parent.
Definition expert_info_model.cpp:399
ExpertSeverity
Enumerates the severity levels for expert information.
Definition expert_info_model.h:219
@ severityNote
Definition expert_info_model.h:222
@ severityComment
Definition expert_info_model.h:224
@ severityChat
Definition expert_info_model.h:223
@ severityError
Definition expert_info_model.h:220
@ severityWarn
Definition expert_info_model.h:221
virtual ~ExpertInfoModel()
Destroys the ExpertInfoModel.
Definition expert_info_model.cpp:102
static void tapDraw(void *eid_ptr)
Callback used by register_tap_listener to draw or update results.
Definition expert_info_model.cpp:464
Represents a single packet or group item in the expert information tree.
Definition expert_info_model.h:31
static QString groupKey(bool group_by_summary, int severity, int group, QString protocol, int expert_hf)
Generates a grouping key based on item properties.
Definition expert_info_model.cpp:42
ExpertPacketItem * parentItem()
Retrieves the parent of this item.
Definition expert_info_model.cpp:86
int row() const
Gets the row index of this item relative to its parent.
Definition expert_info_model.cpp:81
int group() const
Retrieves the expert group ID.
Definition expert_info_model.h:56
QString protocol() const
Retrieves the protocol name.
Definition expert_info_model.h:74
unsigned int packetNum() const
Retrieves the packet number.
Definition expert_info_model.h:50
void appendChild(ExpertPacketItem *child, QString hash)
Appends a child item to this item.
Definition expert_info_model.cpp:58
virtual ~ExpertPacketItem()
Destroys the ExpertPacketItem.
Definition expert_info_model.cpp:32
int childCount() const
Gets the number of children this item has.
Definition expert_info_model.cpp:76
QString colInfo() const
Retrieves the column info text.
Definition expert_info_model.h:86
int severity() const
Retrieves the severity level.
Definition expert_info_model.h:62
QString summary() const
Retrieves the summary text.
Definition expert_info_model.h:80
ExpertPacketItem * child(int row)
Retrieves the child item at a specific row.
Definition expert_info_model.cpp:66
int hfId() const
Retrieves the header field ID.
Definition expert_info_model.h:68
#define PI_CHAT
Definition proto.h:936
#define PI_WARN
Definition proto.h:940
#define PI_NOTE
Definition proto.h:938
#define PI_COMMENT
Definition proto.h:934
#define PI_ERROR
Definition proto.h:942
Represents a capture file and its associated metadata.
Definition cfile.h:84
Represents the metadata and indexing information for a single captured frame.
Definition packet_info.h:43
Definition column-info.h:59
Holds all state for the dissection of a single byte array, including session, buffer,...
Definition epan_dissect.h:28
Holds expert info data for a single packet event; used internally and for display purposes only.
Definition expert.h:26
tap_packet_status
Definition tap.h:22