Wireshark 4.7.3
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
ExportObjectModel Class Reference

A table model managing a list of exportable objects extracted from network traffic. More...

#include <export_objects_model.h>

Inheritance diagram for ExportObjectModel:

Public Types

enum  ExportObjectColumn {
  colPacket = 0 , colHostname , colContent , colSize ,
  colFilename , colExportObjectMax
}
 Enumerates the columns for the export object model. More...

Public Member Functions

 ExportObjectModel (register_eo_t *eo, QObject *parent)
 Constructs a new ExportObjectModel.
virtual ~ExportObjectModel ()
 Destroys the ExportObjectModel.
void addObjectEntry (export_object_entry_t *entry)
 Adds a new export object entry to the model.
export_object_entry_tobjectEntry (int row)
 Retrieves the export object entry at a specific row.
void resetObjects ()
 Resets and clears all object entries from the model.
bool saveEntry (const QModelIndex &index, QString filename)
 Saves a specific entry to a file.
void saveEntries (const QModelIndexList &indices, QString path)
 Saves multiple entries to a directory.
void saveAllEntries (QString path)
 Saves all entries in the model to a directory.
const char * getTapListenerName ()
 Retrieves the name of the tap listener.
void * getTapData ()
 Retrieves the tap data pointer.
tap_packet_cb getTapPacketFunc ()
 Retrieves the callback function used for processing tap packets.
void removeTap ()
 Removes the associated tap listener.
QVariant data (const QModelIndex &index, int role) const override
 Retrieves data from the model for a given index and role.
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 Retrieves the header data for a specific section and role.
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 Returns the number of rows under a given parent.
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 Returns the number of columns under a given parent.

Static Public Member Functions

static void resetTap (void *tapdata)
 Static callback used to reset the tap data.

Detailed Description

A table model managing a list of exportable objects extracted from network traffic.

Member Enumeration Documentation

◆ ExportObjectColumn

Enumerates the columns for the export object model.

Enumerator
colPacket 

Packet number column.

colHostname 

Hostname column.

colContent 

Content type column.

colSize 

Size of the object column.

colFilename 

Filename column.

colExportObjectMax 

End of columns marker.

Constructor & Destructor Documentation

◆ ExportObjectModel()

ExportObjectModel::ExportObjectModel ( register_eo_t * eo,
QObject * parent )

Constructs a new ExportObjectModel.

Parameters
eoPointer to the registered export object type.
parentThe parent QObject.

Member Function Documentation

◆ addObjectEntry()

void ExportObjectModel::addObjectEntry ( export_object_entry_t * entry)

Adds a new export object entry to the model.

Parameters
entryPointer to the export object entry.

◆ columnCount()

int ExportObjectModel::columnCount ( const QModelIndex & parent = QModelIndex()) const
override

Returns the number of columns under a given parent.

Parameters
parentThe parent model index (defaults to an invalid QModelIndex).
Returns
The number of columns.

◆ data()

QVariant ExportObjectModel::data ( const QModelIndex & index,
int role ) const
override

Retrieves data from the model for a given index and role.

Parameters
indexThe model index.
roleThe data role requested.
Returns
The data associated with the index and role.

◆ getTapData()

void * ExportObjectModel::getTapData ( )

Retrieves the tap data pointer.

Returns
Pointer to the tap data.

◆ getTapListenerName()

const char * ExportObjectModel::getTapListenerName ( )

Retrieves the name of the tap listener.

Returns
The tap listener name string.

◆ getTapPacketFunc()

tap_packet_cb ExportObjectModel::getTapPacketFunc ( )

Retrieves the callback function used for processing tap packets.

Returns
The tap packet callback function pointer.

◆ headerData()

QVariant ExportObjectModel::headerData ( int section,
Qt::Orientation orientation,
int role = Qt::DisplayRole ) const
override

Retrieves the header data for a specific section and role.

Parameters
sectionThe column or row section.
orientationThe orientation of the header.
roleThe data role requested (defaults to Qt::DisplayRole).
Returns
The header data.

◆ objectEntry()

export_object_entry_t * ExportObjectModel::objectEntry ( int row)

Retrieves the export object entry at a specific row.

Parameters
rowThe row index.
Returns
Pointer to the export object entry.

◆ resetTap()

void ExportObjectModel::resetTap ( void * tapdata)
static

Static callback used to reset the tap data.

Parameters
tapdataPointer to the tap data to reset.

◆ rowCount()

int ExportObjectModel::rowCount ( const QModelIndex & parent = QModelIndex()) const
override

Returns the number of rows under a given parent.

Parameters
parentThe parent model index (defaults to an invalid QModelIndex).
Returns
The number of rows.

◆ saveAllEntries()

void ExportObjectModel::saveAllEntries ( QString path)

Saves all entries in the model to a directory.

Parameters
pathThe destination directory path.

◆ saveEntries()

void ExportObjectModel::saveEntries ( const QModelIndexList & indices,
QString path )

Saves multiple entries to a directory.

Parameters
indicesThe list of model indices to save.
pathThe destination directory path.

◆ saveEntry()

bool ExportObjectModel::saveEntry ( const QModelIndex & index,
QString filename )

Saves a specific entry to a file.

Parameters
indexThe model index of the entry to save.
filenameThe destination filename.
Returns
True if saved successfully, false otherwise.

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