|
Wireshark 4.7.0
The Wireshark network protocol analyzer
|
DataModel for tap user data. More...
#include <atap_data_model.h>
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 } |
| 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... | |
Signals | |
| void | tapListenerChanged (bool enable) |
| Signal emitted when the tap listener state changes. | |
Public Member Functions | |
| 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.) | |
| virtual int | columnCount (const QModelIndex &parent=QModelIndex()) const =0 |
| Return the number of columns in the model. | |
| virtual QVariant | headerData (int section, Qt::Orientation orientation=Qt::Horizontal, int role=Qt::DisplayRole) const =0 |
| Return the header data for the specified section and orientation. | |
| virtual QVariant | data (const QModelIndex &idx, int role=Qt::DisplayRole) const =0 |
| Return the data for the specified index and role. | |
| 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. | |
| virtual void | setResolveNames (bool resolve)=0 |
| Enable or disable if names should be resolved. | |
| bool | allowsNameResolution () const |
| Does the model allow names to be resolved. | |
| virtual void | useAbsoluteTime (bool absolute)=0 |
| Use absolute time for any column supporting it. | |
| virtual void | useNanosecondTimestamps (bool nanoseconds)=0 |
| Use nanosecond timestamps if requested. | |
| 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_t * | hash () |
| Return the conversation hash table for this model. | |
| void | updateFlags (unsigned flag) |
| Update the flags. | |
Public Attributes | |
| conv_hash_t | hash_ |
Protected Member Functions | |
| 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_t * | registerTable () const |
| Gets the conversation registration table for this tap. | |
Static Protected Member Functions | |
| 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 | |
| dataModelType | _type |
| GArray * | storage_ |
| QString | _filter |
| bool | _absoluteTime |
| bool | _nanoseconds |
| bool | _resolveNames |
| bool | _machineReadable |
| bool | _disableTap |
| double | _minRelStartTime |
| double | _maxRelStopTime |
| unsigned | _tapFlags |
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
| anonymous enum |
Qt model data roles for endpoint and conversation table items.
| Enumerator | |
|---|---|
| DISPLAY_FILTER | Display filter string constructed from this row's address/port data |
| UNFORMATTED_DISPLAYDATA | Raw, unformatted cell value used for sorting and clipboard export |
| TIMELINE_DATA | Timing data used to render the traffic timeline bar in the row |
| ENDPOINT_DATATYPE | Endpoint address type tag (e.g. IPv4, IPv6, Ethernet) |
| PROTO_ID | Protocol ID (proto_id) associated with this endpoint or conversation |
| CONVERSATION_ID | Unique conversation identifier for this row |
| ROW_IS_FILTERED | True if this row is currently hidden by the active display filter |
| DATA_ADDRESS_TYPE | Address type enum value (address_type) for the primary address |
| DATA_IPV4_INTEGER | IPv4 address as a packed 32-bit integer, used for numeric sorting |
| DATA_IPV6_LIST | IPv6 address as a byte list, used for numeric sorting |
Identifies which statistical data model is active in the endpoint/conversation dialog.
|
explicit |
Construct a new ATapDataModel object.
The tap will not be created automatically, but must be enabled by calling enableTap
| type | an element of dataModelType. Either DATAMODEL_ENDPOINT or DATAMODEL_CONVERSATION are supported at this time |
| protoId | the protocol id for which the tap is created |
| filter | a potential filter to be used for the tap |
| parent | the parent for the class |
| bool ATapDataModel::allowsNameResolution | ( | ) | const |
Does the model allow names to be resolved.
|
pure virtual |
Return the number of columns in the model.
| parent | index of parent, QModelIndex() for the root |
Implemented in EndpointDataModel, and ConversationDataModel.
|
protectedvirtual |
Retrieves the callback function used to handle conversation packets.
|
pure virtual |
Return the data for the specified index and role.
| idx | The model index. |
| role | The data role. |
Implemented in EndpointDataModel, and ConversationDataModel.
| bool ATapDataModel::enableTap | ( | ) |
Enable tapping in this model.
This will register the tap listener with the corresponding packet function.
| QString ATapDataModel::filter | ( | ) | const |
Return a filter set for the model.
| conv_hash_t * ATapDataModel::hash | ( | ) |
Return the conversation hash table for this model.
|
pure virtual |
Return the header data for the specified section and orientation.
| section | The column or row index. |
| orientation | The orientation of the header. |
| role | The data role. |
Implemented in EndpointDataModel, and ConversationDataModel.
| bool ATapDataModel::isFilterApplied | ( | ) | const |
Checks if a display filter has to be applied.
Controls which columns to display, and in some cases their content
| void ATapDataModel::limitToDisplayFilter | ( | bool | limit | ) |
Limits the data model to the currently active display filter.
| limit | True to apply the display filter limit, false otherwise. |
| ATapDataModel::dataModelType ATapDataModel::modelType | ( | ) | const |
Return the model type.
| bool ATapDataModel::portsAreHidden | ( | ) | const |
Are ports hidden for this model.
| int ATapDataModel::protoId | ( | ) | const |
The protocol id for the tap.
|
protected |
Gets the conversation registration table for this tap.
| bool ATapDataModel::resolveNames | ( | ) | const |
Is the model set to resolve names in address and ports columns.
| 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.)
| parent | index of parent, QModelIndex() for the root |
| void ATapDataModel::setFilter | ( | QString | filter | ) |
Set the filter string.
A set filter can be reset by providing an empty string
| filter | the filter for the tap |
| void ATapDataModel::setMachineReadable | ( | bool | machineReadable | ) |
Sets whether the data should be presented in a machine-readable format.
| machineReadable | True to enable machine-readable format, false otherwise. |
|
pure virtual |
Enable or disable if names should be resolved.
| resolve | true if names should be resolved |
Implemented in EndpointDataModel, and ConversationDataModel.
| QString ATapDataModel::tap | ( | ) | const |
Returns the name for the tap being used.
|
staticprotected |
Callback to draw or update the tap data.
| tap_data | Pointer to the tap data to draw. |
|
signal |
Signal emitted when the tap listener state changes.
| enable | True to enable the listener, false to disable. |
|
staticprotected |
Callback to reset the tap data.
| tapdata | Pointer to the tap data to reset. |
|
protected |
Updates the model with new data.
| data | Pointer to a GArray containing the new data. |
|
pure virtual |
Use absolute time for any column supporting it.
| absolute | true to use absolute time values |
Implemented in EndpointDataModel, and ConversationDataModel.
|
pure virtual |
Use nanosecond timestamps if requested.
Otherwise, microsecond time resolution will be displayed
| nanoseconds | use nanosecond timestamps if required and requested |
Implemented in EndpointDataModel, and ConversationDataModel.
|
protected |
Flag indicating whether to use absolute time formats.
|
protected |
Flag indicating whether the underlying tap is disabled.
|
protected |
The display filter applied to the tap.
|
protected |
Flag indicating whether data is formatted for machine readability.
|
protected |
The maximum relative stop time of the processed packets.
|
protected |
The minimum relative start time of the processed packets.
|
protected |
Flag indicating whether to use nanosecond precision.
|
protected |
Flag indicating whether name resolution is enabled.
|
protected |
Bitmask of flags configuring the tap behavior.
|
protected |
The specific type of the data model.
| conv_hash_t ATapDataModel::hash_ |
Hash table mapping address/port tuples to their conversation or endpoint entries
|
protected |
Internal storage for the tap data records.