Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Public Types | Signals | Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
ATapDataModel Class Referenceabstract

DataModel for tap user data. More...

#include <atap_data_model.h>

Inheritance diagram for ATapDataModel:
ConversationDataModel EndpointDataModel

Public Types

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
}
 
enum  dataModelType { DATAMODEL_ENDPOINT , DATAMODEL_CONVERSATION , DATAMODEL_UNKNOWN }
 

Signals

void tapListenerChanged (bool enable)
 

Public Member Functions

 ATapDataModel (dataModelType type, int protoId, QString filter, QObject *parent=nullptr)
 Construct a new ATapDataModel object.
 
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.)
 
virtual int columnCount (const QModelIndex &parent=QModelIndex()) const =0
 
virtual QVariant headerData (int section, Qt::Orientation orientation=Qt::Horizontal, int role=Qt::DisplayRole) const =0
 
virtual QVariant data (const QModelIndex &idx, int role=Qt::DisplayRole) const =0
 
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.
 
void setResolveNames (bool resolve)
 Enable or disable if names should be resolved.
 
bool allowsNameResolution () const
 Does the model allow names to be resolved.
 
void useAbsoluteTime (bool absolute)
 Use absolute time for any column supporting it.
 
void useNanosecondTimestamps (bool nanoseconds)
 Use nanosecond timestamps if requested.
 
bool portsAreHidden () const
 Are ports hidden for this model.
 
bool showTotalColumn () const
 A total column is filled.
 
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 ()
 
void updateFlags (unsigned flag)
 Update the flags.
 

Public Attributes

conv_hash_t hash_
 

Protected Member Functions

virtual tap_packet_cb conversationPacketHandler ()
 
void resetData ()
 
void updateData (GArray *data)
 
register_ct_tregisterTable () const
 

Static Protected Member Functions

static void tapReset (void *tapdata)
 
static void tapDraw (void *tap_data)
 

Protected Attributes

dataModelType _type
 
GArray * storage_
 
QString _filter
 
bool _absoluteTime
 
bool _nanoseconds
 
bool _resolveNames
 
bool _disableTap
 
double _minRelStartTime
 
double _maxRelStopTime
 
unsigned _tapFlags
 

Detailed Description

DataModel for tap user data.

This datamodel provides the management for all tap data for the conversation and endpoint dialogs. It predominantly is implemented to work with conversation tap data. The management of displaying and correctly presenting the information is done in the corresponding type classes

See also
EndpointDataModel
ConversationDataModel

Constructor & Destructor Documentation

◆ ATapDataModel()

ATapDataModel::ATapDataModel ( dataModelType  type,
int  protoId,
QString  filter,
QObject *  parent = nullptr 
)
explicit

Construct a new ATapDataModel object.

The tap will not be created automatically, but must be enabled by calling enableTap

Parameters
typean element of dataModelType. Either DATAMODEL_ENDPOINT or DATAMODEL_CONVERSATION are supported at this time
protoIdthe protocol id for which the tap is created
filtera potential filter to be used for the tap
parentthe parent for the class
See also
enableTap

Member Function Documentation

◆ allowsNameResolution()

bool ATapDataModel::allowsNameResolution ( ) const

Does the model allow names to be resolved.

Returns
true yes, names may be resolved (set via setResolveNames)
false no, they won't be resolved
See also
setResolveNames
resolveNames

◆ enableTap()

bool ATapDataModel::enableTap ( )

Enable tapping in this model.

This will register the tap listener with the corresponding packet function.

Note
if the tap has not been disabled, this method will do nothing
Returns
true the tap has been enabled
false the tap has not been enabled

◆ filter()

QString ATapDataModel::filter ( ) const

Return a filter set for the model.

Returns
QString the filter string for the model

◆ modelType()

ATapDataModel::dataModelType ATapDataModel::modelType ( ) const

Return the model type.

Returns
dataModelType

◆ portsAreHidden()

bool ATapDataModel::portsAreHidden ( ) const

Are ports hidden for this model.

Returns
true the ports are hidden
false the ports are not hidden

◆ protoId()

int ATapDataModel::protoId ( ) const

The protocol id for the tap.

Returns
int the id given in the constructor

◆ resolveNames()

bool ATapDataModel::resolveNames ( ) const

Is the model set to resolve names in address and ports columns.

Returns
true yes, names will be resolved
false no they won't

◆ rowCount()

int ATapDataModel::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.)

Parameters
parentindex of parent, QModelIndex() for the root
Returns
int the number of rows under the parent

◆ setFilter()

void ATapDataModel::setFilter ( QString  filter)

Set the filter string.

A set filter can be reset by providing an empty string

Parameters
filterthe filter for the tap

◆ setResolveNames()

void ATapDataModel::setResolveNames ( bool  resolve)

Enable or disable if names should be resolved.

Parameters
resolvetrue if names should be resolved

◆ showTotalColumn()

bool ATapDataModel::showTotalColumn ( ) const

A total column is filled.

Returns
true if the column is filled
false the column is empty

◆ tap()

QString ATapDataModel::tap ( ) const

Returns the name for the tap being used.

Returns
QString the tap name, normally identical with the protocol name

◆ useAbsoluteTime()

void ATapDataModel::useAbsoluteTime ( bool  absolute)

Use absolute time for any column supporting it.

Parameters
absolutetrue to use absolute time values

◆ useNanosecondTimestamps()

void ATapDataModel::useNanosecondTimestamps ( bool  nanoseconds)

Use nanosecond timestamps if requested.

Parameters
nanosecondsuse nanosecond timestamps if required and requested

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