Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
FieldInformation Class Reference

Represents information about a dissected packet field. More...

#include <field_information.h>

Inheritance diagram for FieldInformation:
IDataPrintable

Classes

struct  HeaderInfo
 Structure holding header field information. More...
 
struct  Position
 Structure representing the position of a field within data. More...
 

Public Member Functions

 FieldInformation (field_info *fi, QObject *parent=Q_NULLPTR)
 Constructs a FieldInformation object from a core field_info struct.
 
 FieldInformation (const ProtoNode *node, QObject *parent=Q_NULLPTR)
 Constructs a FieldInformation object from a ProtoNode.
 
bool isValid () const
 Checks if the field information is valid.
 
bool isLink () const
 Checks if the field represents a link.
 
field_infofieldInfo () const
 Retrieves the underlying field_info struct.
 
HeaderInfo headerInfo () const
 Retrieves the header information for the field.
 
Position position () const
 Retrieves the position of the field within the data source.
 
Position appendix () const
 Retrieves the position of the field's appendix (if any).
 
void setParentField (field_info *fi)
 Sets the parent field for this field.
 
int treeType ()
 Gets the tree type associated with this field.
 
FieldInformationparentField () const
 Retrieves the parent FieldInformation object.
 
bool tvbContains (FieldInformation *child)
 Checks if the TVB associated with this field contains the given field.
 
unsigned flag (unsigned mask)
 Retrieves a specific flag value based on a mask.
 
const QString moduleName ()
 Retrieves the name of the module that registered this field.
 
QString toString ()
 Converts the field information to a string representation.
 
QString url ()
 Retrieves a URL related to this field, if available.
 
const QByteArray printableData ()
 Gets the printable data for the field.
 
- Public Member Functions inherited from IDataPrintable
virtual ~IDataPrintable ()
 Destroys the IDataPrintable object.
 

Detailed Description

Represents information about a dissected packet field.

Constructor & Destructor Documentation

◆ FieldInformation() [1/2]

FieldInformation::FieldInformation ( field_info fi,
QObject *  parent = Q_NULLPTR 
)
explicit

Constructs a FieldInformation object from a core field_info struct.

Parameters
fiPointer to the underlying field_info struct.
parentThe parent object.

◆ FieldInformation() [2/2]

FieldInformation::FieldInformation ( const ProtoNode node,
QObject *  parent = Q_NULLPTR 
)
explicit

Constructs a FieldInformation object from a ProtoNode.

Parameters
nodePointer to the ProtoNode representing the field.
parentThe parent object.

Member Function Documentation

◆ appendix()

FieldInformation::Position FieldInformation::appendix ( ) const

Retrieves the position of the field's appendix (if any).

Returns
A Position structure with the start and length of the appendix.

◆ fieldInfo()

field_info * FieldInformation::fieldInfo ( ) const

Retrieves the underlying field_info struct.

Returns
Pointer to the field_info struct.

◆ flag()

unsigned FieldInformation::flag ( unsigned  mask)

Retrieves a specific flag value based on a mask.

Parameters
maskThe bitmask to apply to the field's flags.
Returns
The flag value.

◆ headerInfo()

FieldInformation::HeaderInfo FieldInformation::headerInfo ( ) const

Retrieves the header information for the field.

Returns
A HeaderInfo structure containing the data.

◆ isLink()

bool FieldInformation::isLink ( ) const

Checks if the field represents a link.

Returns
True if it is a link, false otherwise.

◆ isValid()

bool FieldInformation::isValid ( ) const

Checks if the field information is valid.

Returns
True if valid, false otherwise.

◆ moduleName()

const QString FieldInformation::moduleName ( )

Retrieves the name of the module that registered this field.

Returns
The module name as a QString.

◆ parentField()

FieldInformation * FieldInformation::parentField ( ) const

Retrieves the parent FieldInformation object.

Returns
Pointer to the parent FieldInformation, or nullptr if none.

◆ position()

FieldInformation::Position FieldInformation::position ( ) const

Retrieves the position of the field within the data source.

Returns
A Position structure with the start and length.

◆ printableData()

const QByteArray FieldInformation::printableData ( )
virtual

Gets the printable data for the field.

Returns
A QByteArray containing the printable data.

Implements IDataPrintable.

◆ setParentField()

void FieldInformation::setParentField ( field_info fi)

Sets the parent field for this field.

Parameters
fiPointer to the parent field_info.

◆ toString()

QString FieldInformation::toString ( )

Converts the field information to a string representation.

Returns
The string representation of the field.

◆ treeType()

int FieldInformation::treeType ( )

Gets the tree type associated with this field.

Returns
The tree type identifier.

◆ tvbContains()

bool FieldInformation::tvbContains ( FieldInformation child)

Checks if the TVB associated with this field contains the given field.

Parameters
childPointer to another FieldInformation to check.
Returns
True if this field's TVB contains the specified field, false otherwise.

◆ url()

QString FieldInformation::url ( )

Retrieves a URL related to this field, if available.

Returns
The URL string.

The documentation for this class was generated from the following files: