| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
field_information.h
Go to the documentation of this file.
1
9
10#ifndef FIELD_INFORMATION_H_
11#define FIELD_INFORMATION_H_
12
13#include <config.h>
14
15#include <epan/proto.h>
16
17#include <ui/qt/utils/proto_node.h>
18#include "data_printer.h"
19
20#include <QObject>
21
25 class FieldInformation : public QObject, public IDataPrintable
26{
27 Q_OBJECT
28 Q_INTERFACES(IDataPrintable)
29
30 public:
31
35 struct HeaderInfo
36 {
37 QString name;
38 QString description;
39 QString abbreviation;
40 bool isValid;
41 enum ftenum type;
42 int parent;
43 int id;
44 };
45
49 struct Position
50 {
51 unsigned start;
52 unsigned length;
53 };
54
60 explicit FieldInformation(field_info * fi, QObject * parent = Q_NULLPTR);
61
67 explicit FieldInformation(const ProtoNode * node, QObject * parent = Q_NULLPTR);
68
73 bool isValid() const;
74
79 bool isLink() const ;
80
85 field_info * fieldInfo() const;
86
91 HeaderInfo headerInfo() const;
92
97 Position position() const;
98
103 Position appendix() const;
104
109 void setParentField(field_info * fi);
110
115 int treeType();
116
121 FieldInformation * parentField() const;
122
128 bool tvbContains(FieldInformation * child);
129
135 unsigned flag(unsigned mask);
136
141 const QString moduleName();
142
147 QString toString();
148
153 QString url();
154
159 const QByteArray printableData() override;
160
161 private:
162
163 field_info * fi_;
164 field_info * parent_fi_;
165};
166
167
168#endif // FIELD_INFORMATION_H_
FieldInformation::toString
QString toString()
Converts the field information to a string representation.
Definition field_information.cpp:139
FieldInformation::setParentField
void setParentField(field_info *fi)
Sets the parent field for this field.
Definition field_information.cpp:58
FieldInformation::parentField
FieldInformation * parentField() const
Retrieves the parent FieldInformation object.
Definition field_information.cpp:105
FieldInformation::isValid
bool isValid() const
Checks if the field information is valid.
Definition field_information.cpp:31
FieldInformation::printableData
const QByteArray printableData() override
Gets the printable data for the field.
Definition field_information.cpp:197
FieldInformation::treeType
int treeType()
Gets the tree type associated with this field.
Definition field_information.cpp:63
FieldInformation::FieldInformation
FieldInformation(field_info *fi, QObject *parent=Q_NULLPTR)
Constructs a FieldInformation object from a core field_info struct.
Definition field_information.cpp:14
FieldInformation::appendix
Position appendix() const
Retrieves the position of the field's appendix (if any).
Definition field_information.cpp:185
FieldInformation::headerInfo
HeaderInfo headerInfo() const
Retrieves the header information for the field.
Definition field_information.cpp:77
FieldInformation::flag
unsigned flag(unsigned mask)
Retrieves a specific flag value based on a mask.
Definition field_information.cpp:118
FieldInformation::position
Position position() const
Retrieves the position of the field within the data source.
Definition field_information.cpp:162
FieldInformation::fieldInfo
field_info * fieldInfo() const
Retrieves the underlying field_info struct.
Definition field_information.cpp:72
FieldInformation::moduleName
const QString moduleName()
Retrieves the name of the module that registered this field.
Definition field_information.cpp:126
FieldInformation::url
QString url()
Retrieves a URL related to this field, if available.
Definition field_information.cpp:153
FieldInformation::isLink
bool isLink() const
Checks if the field represents a link.
Definition field_information.cpp:47
FieldInformation::tvbContains
bool tvbContains(FieldInformation *child)
Checks if the TVB associated with this field contains the given field.
Definition field_information.cpp:110
IDataPrintable
An interface for objects that can provide a printable data representation.
Definition idata_printable.h:26
ProtoNode
A wrapper class for the core proto_node structure, providing tree traversal and data access.
Definition proto_node.h:24
data_printer.h
ftenum
ftenum
Fundamental field value types used throughout the Wireshark dissector framework.
Definition ftypes.h:26
proto.h
proto_node.h
FieldInformation::HeaderInfo
Structure holding header field information.
Definition field_information.h:36
FieldInformation::HeaderInfo::abbreviation
QString abbreviation
Definition field_information.h:39
FieldInformation::HeaderInfo::type
enum ftenum type
Definition field_information.h:41
FieldInformation::HeaderInfo::isValid
bool isValid
Definition field_information.h:40
FieldInformation::HeaderInfo::description
QString description
Definition field_information.h:38
FieldInformation::HeaderInfo::name
QString name
Definition field_information.h:37
FieldInformation::HeaderInfo::parent
int parent
Definition field_information.h:42
FieldInformation::HeaderInfo::id
int id
Definition field_information.h:43
FieldInformation::Position
Structure representing the position of a field within data.
Definition field_information.h:50
FieldInformation::Position::start
unsigned start
Definition field_information.h:51
FieldInformation::Position::length
unsigned length
Definition field_information.h:52
field_info
Definition proto.h:822