2015-06-08 18:33:16 +00:00
|
|
|
/* tap_parameter_dialog.h
|
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef TAP_PARAMETER_DIALOG_H
|
|
|
|
#define TAP_PARAMETER_DIALOG_H
|
|
|
|
|
2015-08-24 19:33:49 +00:00
|
|
|
/*
|
|
|
|
* @file Base class for statistics and analysis dialogs.
|
|
|
|
* Provides convenience classes for command-line tap parameters ("-z ...")
|
|
|
|
* and general tapping.
|
|
|
|
*/
|
|
|
|
|
2015-06-08 18:33:16 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
|
|
|
|
#include <epan/stat_groups.h>
|
2015-06-05 20:17:13 +00:00
|
|
|
#include <epan/stat_tap_ui.h>
|
2015-06-08 18:33:16 +00:00
|
|
|
|
2015-06-05 20:17:13 +00:00
|
|
|
#include <QMenu>
|
|
|
|
|
|
|
|
#include "filter_action.h"
|
2015-06-08 18:33:16 +00:00
|
|
|
#include "wireshark_dialog.h"
|
|
|
|
|
Add DCE-RPC and ONC-RPC service response time dialogs.
Add RpcServiceResponseTimeDialog, which handles DCE-RPC and ONC-RPC
service response time statistics. Try to make it as lightweight as
possible, since we might want to pull this into the RPC dissectors
similar to the other SRT statistics.
Allow program names on the command line in place of numbers or UUIDs. Make
matches case-insensitive. E.g. the following are equivalent:
-z rpc,srt,100003,3
-z rpc,srt,nfs,3
-z rpc,srt,NFS,3
as are the following:
-z dcerpc,srt,f5cc5a18-4264-101a-8c59-08002b2f8426,56
-z dcerpc,srt,nspi,56
-z dcerpc,srt,NSPI,56
Change-Id: Ie451c64bf6fbc776f27d81e3bc248435c5cbc9e4
Reviewed-on: https://code.wireshark.org/review/9981
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-11 18:48:07 +00:00
|
|
|
class QHBoxLayout;
|
2015-08-12 21:09:35 +00:00
|
|
|
class QLineEdit;
|
2015-06-08 18:33:16 +00:00
|
|
|
class QTreeWidget;
|
2015-06-05 20:17:13 +00:00
|
|
|
class QTreeWidgetItem;
|
2015-08-12 21:09:35 +00:00
|
|
|
class QVBoxLayout;
|
2015-06-08 18:33:16 +00:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class TapParameterDialog;
|
|
|
|
}
|
|
|
|
|
2015-06-05 20:17:13 +00:00
|
|
|
class TapParameterDialog;
|
|
|
|
typedef TapParameterDialog* (*tpdCreator)(QWidget &parent, const QString cfg_str, const QString arg, CaptureFile &cf);
|
|
|
|
|
2015-06-08 18:33:16 +00:00
|
|
|
class TapParameterDialog : public WiresharkDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit TapParameterDialog(QWidget &parent, CaptureFile &cf, int help_topic = 0);
|
|
|
|
~TapParameterDialog();
|
|
|
|
|
2015-07-08 22:44:04 +00:00
|
|
|
static const QString &actionName() { return action_name_; }
|
2015-06-05 20:17:13 +00:00
|
|
|
static void registerDialog(const QString title, const char *cfg_abbr, register_stat_group_t group, stat_tap_init_cb tap_init_cb, tpdCreator creator);
|
|
|
|
|
|
|
|
static TapParameterDialog *showTapParameterStatistics(QWidget &parent, CaptureFile &cf, const QString cfg_str, const QString arg, void *);
|
|
|
|
// Needed by static member functions in subclasses. Should we just make
|
|
|
|
// "ui" available instead?
|
2015-06-08 18:33:16 +00:00
|
|
|
QTreeWidget *statsTreeWidget();
|
2015-08-12 21:09:35 +00:00
|
|
|
QLineEdit *displayFilterLineEdit();
|
|
|
|
QPushButton *applyFilterButton();
|
|
|
|
QVBoxLayout *verticalLayout();
|
Add DCE-RPC and ONC-RPC service response time dialogs.
Add RpcServiceResponseTimeDialog, which handles DCE-RPC and ONC-RPC
service response time statistics. Try to make it as lightweight as
possible, since we might want to pull this into the RPC dissectors
similar to the other SRT statistics.
Allow program names on the command line in place of numbers or UUIDs. Make
matches case-insensitive. E.g. the following are equivalent:
-z rpc,srt,100003,3
-z rpc,srt,nfs,3
-z rpc,srt,NFS,3
as are the following:
-z dcerpc,srt,f5cc5a18-4264-101a-8c59-08002b2f8426,56
-z dcerpc,srt,nspi,56
-z dcerpc,srt,NSPI,56
Change-Id: Ie451c64bf6fbc776f27d81e3bc248435c5cbc9e4
Reviewed-on: https://code.wireshark.org/review/9981
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-11 18:48:07 +00:00
|
|
|
QHBoxLayout *filterLayout();
|
|
|
|
|
2015-06-08 18:33:16 +00:00
|
|
|
void drawTreeItems();
|
|
|
|
|
2015-06-05 20:17:13 +00:00
|
|
|
signals:
|
2016-06-22 19:44:02 +00:00
|
|
|
void filterAction(QString filter, FilterAction::Action action, FilterAction::ActionType type);
|
2015-08-28 19:28:24 +00:00
|
|
|
void updateFilter(QString filter);
|
2015-06-05 20:17:13 +00:00
|
|
|
|
2015-06-08 18:33:16 +00:00
|
|
|
public slots:
|
|
|
|
|
|
|
|
protected:
|
2015-06-05 20:17:13 +00:00
|
|
|
void contextMenuEvent(QContextMenuEvent *event);
|
2015-08-12 21:09:35 +00:00
|
|
|
void addFilterActions();
|
2015-08-17 11:18:30 +00:00
|
|
|
QString displayFilter();
|
2015-06-05 20:17:13 +00:00
|
|
|
void setDisplayFilter(const QString &filter);
|
Add DCE-RPC and ONC-RPC service response time dialogs.
Add RpcServiceResponseTimeDialog, which handles DCE-RPC and ONC-RPC
service response time statistics. Try to make it as lightweight as
possible, since we might want to pull this into the RPC dissectors
similar to the other SRT statistics.
Allow program names on the command line in place of numbers or UUIDs. Make
matches case-insensitive. E.g. the following are equivalent:
-z rpc,srt,100003,3
-z rpc,srt,nfs,3
-z rpc,srt,NFS,3
as are the following:
-z dcerpc,srt,f5cc5a18-4264-101a-8c59-08002b2f8426,56
-z dcerpc,srt,nspi,56
-z dcerpc,srt,NSPI,56
Change-Id: Ie451c64bf6fbc776f27d81e3bc248435c5cbc9e4
Reviewed-on: https://code.wireshark.org/review/9981
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-11 18:48:07 +00:00
|
|
|
void setHint(const QString &hint);
|
2015-08-21 22:02:20 +00:00
|
|
|
// Retap packets on first display. RPC stats need to disable this.
|
|
|
|
void setRetapOnShow(bool retap);
|
2015-06-05 20:17:13 +00:00
|
|
|
|
|
|
|
protected slots:
|
|
|
|
void filterActionTriggered();
|
2015-08-12 21:09:35 +00:00
|
|
|
void updateWidgets();
|
2015-06-08 18:33:16 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::TapParameterDialog *ui;
|
2015-08-12 21:09:35 +00:00
|
|
|
QMenu ctx_menu_;
|
|
|
|
QList<QAction *> filter_actions_;
|
2015-06-08 18:33:16 +00:00
|
|
|
int help_topic_;
|
2015-07-08 22:44:04 +00:00
|
|
|
static const QString action_name_;
|
2015-08-21 22:02:20 +00:00
|
|
|
QTimer *show_timer_;
|
2015-06-08 18:33:16 +00:00
|
|
|
|
2015-06-05 20:17:13 +00:00
|
|
|
virtual const QString filterExpression() { return QString(); }
|
|
|
|
QString itemDataToPlain(QVariant var, int width = 0);
|
|
|
|
virtual QList<QVariant> treeItemData(QTreeWidgetItem *) const;
|
|
|
|
virtual QByteArray getTreeAsString(st_format_type format);
|
2015-06-08 18:33:16 +00:00
|
|
|
|
|
|
|
private slots:
|
2015-08-20 15:56:04 +00:00
|
|
|
// Called by the constructor. The subclass should tap packets here.
|
|
|
|
virtual void fillTree() = 0;
|
|
|
|
|
2015-06-08 18:33:16 +00:00
|
|
|
void on_applyFilterButton_clicked();
|
|
|
|
void on_actionCopyToClipboard_triggered();
|
|
|
|
void on_actionSaveAs_triggered();
|
|
|
|
void on_buttonBox_helpRequested();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TAP_PARAMETER_DIALOG_H
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Editor modelines
|
|
|
|
*
|
|
|
|
* Local Variables:
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* ex: set shiftwidth=4 tabstop=8 expandtab:
|
|
|
|
* :indentSize=4:tabSize=8:noTabs=true:
|
|
|
|
*/
|