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

Tap data model for the Endpoints statistics dialog. More...

#include <atap_data_model.h>

Inheritance diagram for EndpointDataModel:
ATapDataModel

Public Types

enum  endpoint_column_type_e {
  ENDP_COLUMN_ADDR , ENDP_COLUMN_PORT , ENDP_COLUMN_PACKETS , ENDP_COLUMN_BYTES ,
  ENDP_COLUMN_PACKETS_TOTAL , ENDP_COLUMN_BYTES_TOTAL , ENDP_COLUMN_PKT_AB , ENDP_COLUMN_BYTES_AB ,
  ENDP_COLUMN_PKT_BA , ENDP_COLUMN_BYTES_BA , ENDP_NUM_COLUMNS , ENDP_COLUMN_GEO_COUNTRY = ENDP_NUM_COLUMNS ,
  ENDP_COLUMN_GEO_CITY , ENDP_COLUMN_GEO_LATITUDE , ENDP_COLUMN_GEO_LONGITUDE , ENDP_COLUMN_GEO_AS_NUM ,
  ENDP_COLUMN_GEO_AS_ORG , ENDP_NUM_GEO_COLUMNS
}
 Column indices for the endpoint statistics table. More...
 
- Public Types inherited from ATapDataModel
enum  {
  DISPLAY_FILTER = Qt::UserRole , UNFORMATTED_DISPLAYDATA , TIMELINE_DATA , ENDPOINT_DATATYPE ,
  PROTO_ID , CONVERSATION_ID , ROW_IS_FILTERED , DATA_ADDRESS_TYPE ,
  DATA_IPV4_INTEGER , DATA_IPV6_LIST
}
 Qt model data roles for endpoint and conversation table items. More...
 
enum  dataModelType { DATAMODEL_ENDPOINT , DATAMODEL_CONVERSATION , DATAMODEL_UNKNOWN }
 Identifies which statistical data model is active in the endpoint/conversation dialog. More...
 

Public Member Functions

 EndpointDataModel (int protoId, QString filter, QObject *parent=nullptr)
 Construct an EndpointDataModel for a given protocol and filter.
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 Return the number of columns, including GeoIP columns if available.
 
QVariant headerData (int section, Qt::Orientation orientation=Qt::Horizontal, int role=Qt::DisplayRole) const override
 Return header data for the endpoint table.
 
QVariant data (const QModelIndex &idx, int role=Qt::DisplayRole) const override
 Return data for a cell in the endpoint table.
 
void setResolveNames (bool resolve) override
 Enable or disable address name resolution for all address cells.
 
void useAbsoluteTime (bool absolute) override
 Switch timestamp display between absolute and relative time.
 
void useNanosecondTimestamps (bool nanoseconds) override
 Enable or disable nanosecond precision in timestamp display.
 
- Public Member Functions inherited from ATapDataModel
 ATapDataModel (dataModelType type, int protoId, QString filter, QObject *parent=nullptr)
 Construct a new ATapDataModel object.
 
virtual ~ATapDataModel ()
 Destructor.
 
int rowCount (const QModelIndex &parent=QModelIndex()) const
 Number of rows under the given parent in this model, which is the total number of rows for the empty QModelIndex, and 0 for any valid parent index (as no row has children; this is a flat table.)
 
QString tap () const
 Returns the name for the tap being used.
 
int protoId () const
 The protocol id for the tap.
 
void setFilter (QString filter)
 Set the filter string.
 
QString filter () const
 Return a filter set for the model.
 
bool resolveNames () const
 Is the model set to resolve names in address and ports columns.
 
bool allowsNameResolution () const
 Does the model allow names to be resolved.
 
void setMachineReadable (bool machineReadable)
 Sets whether the data should be presented in a machine-readable format.
 
void limitToDisplayFilter (bool limit)
 Limits the data model to the currently active display filter.
 
bool portsAreHidden () const
 Are ports hidden for this model.
 
bool isFilterApplied () const
 Checks if a display filter has to be applied.
 
bool enableTap ()
 Enable tapping in this model.
 
void disableTap ()
 Disable the tapping for this model.
 
dataModelType modelType () const
 Return the model type.
 
conv_hash_thash ()
 Return the conversation hash table for this model.
 
void updateFlags (unsigned flag)
 Update the flags.
 

Additional Inherited Members

- Signals inherited from ATapDataModel
void tapListenerChanged (bool enable)
 Signal emitted when the tap listener state changes.
 
- Public Attributes inherited from ATapDataModel
conv_hash_t hash_
 
- Protected Member Functions inherited from ATapDataModel
virtual tap_packet_cb conversationPacketHandler ()
 Retrieves the callback function used to handle conversation packets.
 
void resetData ()
 Resets the internal model data.
 
void updateData (GArray *data)
 Updates the model with new data.
 
register_ct_tregisterTable () const
 Gets the conversation registration table for this tap.
 
- Static Protected Member Functions inherited from ATapDataModel
static void tapReset (void *tapdata)
 Callback to reset the tap data.
 
static void tapDraw (void *tap_data)
 Callback to draw or update the tap data.
 
- Protected Attributes inherited from ATapDataModel
dataModelType _type
 
GArray * storage_
 
QString _filter
 
bool _absoluteTime
 
bool _nanoseconds
 
bool _resolveNames
 
bool _machineReadable
 
bool _disableTap
 
double _minRelStartTime
 
double _maxRelStopTime
 
unsigned _tapFlags
 

Detailed Description

Tap data model for the Endpoints statistics dialog.

Member Enumeration Documentation

◆ endpoint_column_type_e

Column indices for the endpoint statistics table.

Enumerator
ENDP_COLUMN_ADDR 

Endpoint address.

ENDP_COLUMN_PORT 

Endpoint port (transport protocols only).

ENDP_COLUMN_PACKETS 

Total packets in the filtered set.

ENDP_COLUMN_BYTES 

Total bytes in the filtered set.

ENDP_COLUMN_PACKETS_TOTAL 

Total packets across all traffic.

ENDP_COLUMN_BYTES_TOTAL 

Total bytes across all traffic.

ENDP_COLUMN_PKT_AB 

Packets transmitted from this endpoint.

ENDP_COLUMN_BYTES_AB 

Bytes transmitted from this endpoint.

ENDP_COLUMN_PKT_BA 

Packets received by this endpoint.

ENDP_COLUMN_BYTES_BA 

Bytes received by this endpoint.

ENDP_NUM_COLUMNS 

Total number of standard columns.

ENDP_COLUMN_GEO_COUNTRY 

GeoIP country name.

ENDP_COLUMN_GEO_CITY 

GeoIP city name.

ENDP_COLUMN_GEO_LATITUDE 

GeoIP latitude coordinate.

ENDP_COLUMN_GEO_LONGITUDE 

GeoIP longitude coordinate.

ENDP_COLUMN_GEO_AS_NUM 

GeoIP autonomous system number.

ENDP_COLUMN_GEO_AS_ORG 

GeoIP autonomous system organisation name.

ENDP_NUM_GEO_COLUMNS 

Total column count including GeoIP columns.

Constructor & Destructor Documentation

◆ EndpointDataModel()

EndpointDataModel::EndpointDataModel ( int  protoId,
QString  filter,
QObject *  parent = nullptr 
)
explicit

Construct an EndpointDataModel for a given protocol and filter.

Parameters
protoIdThe protocol ID whose endpoint tap should be registered.
filterOptional display filter string; empty means no filter.
parentThe parent QObject.

Member Function Documentation

◆ columnCount()

int EndpointDataModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
overridevirtual

Return the number of columns, including GeoIP columns if available.

Parameters
parentUnused; present for API compatibility.
Returns
ENDP_NUM_GEO_COLUMNS when GeoIP data is loaded, otherwise ENDP_NUM_COLUMNS.

Implements ATapDataModel.

◆ data()

QVariant EndpointDataModel::data ( const QModelIndex &  idx,
int  role = Qt::DisplayRole 
) const
overridevirtual

Return data for a cell in the endpoint table.

Parameters
idxThe model index of the cell to query.
roleThe data role (Qt::DisplayRole, Qt::UserRole, etc.).
Returns
The cell data, or an invalid QVariant if unavailable.

Implements ATapDataModel.

◆ headerData()

QVariant EndpointDataModel::headerData ( int  section,
Qt::Orientation  orientation = Qt::Horizontal,
int  role = Qt::DisplayRole 
) const
overridevirtual

Return header data for the endpoint table.

Parameters
sectionColumn index.
orientationMust be Qt::Horizontal.
roleThe data role; typically Qt::DisplayRole.
Returns
The column header label, or an invalid QVariant if unavailable.

Implements ATapDataModel.

◆ setResolveNames()

void EndpointDataModel::setResolveNames ( bool  resolve)
overridevirtual

Enable or disable address name resolution for all address cells.

Parameters
resolvetrue to resolve addresses to hostnames; false to show raw addresses.

Implements ATapDataModel.

◆ useAbsoluteTime()

void EndpointDataModel::useAbsoluteTime ( bool  absolute)
overridevirtual

Switch timestamp display between absolute and relative time.

Parameters
absolutetrue for absolute (wall-clock) timestamps; false for relative timestamps.

Implements ATapDataModel.

◆ useNanosecondTimestamps()

void EndpointDataModel::useNanosecondTimestamps ( bool  nanoseconds)
overridevirtual

Enable or disable nanosecond precision in timestamp display.

Parameters
nanosecondstrue to show nanosecond-resolution timestamps; false for microsecond resolution.

Implements ATapDataModel.


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