2016-10-01 06:54:57 +00:00
|
|
|
/* interface_frame.h
|
|
|
|
* Display of interfaces, including their respective data, and the
|
|
|
|
* capability to filter interfaces by type
|
2012-01-04 22:13:01 +00:00
|
|
|
*
|
|
|
|
* 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
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2012-01-04 22:13:01 +00:00
|
|
|
*/
|
|
|
|
|
2016-10-01 06:54:57 +00:00
|
|
|
#ifndef INTERFACE_FRAME_H
|
|
|
|
#define INTERFACE_FRAME_H
|
2012-01-04 22:13:01 +00:00
|
|
|
|
2015-01-03 20:52:54 +00:00
|
|
|
#include <config.h>
|
2012-08-03 23:30:47 +00:00
|
|
|
|
2012-01-04 22:13:01 +00:00
|
|
|
#include <glib.h>
|
|
|
|
|
2017-07-25 14:47:16 +00:00
|
|
|
#include <ui/qt/models/interface_tree_model.h>
|
|
|
|
#include <ui/qt/models/interface_sort_filter_model.h>
|
2012-01-04 22:13:01 +00:00
|
|
|
|
2016-10-01 06:54:57 +00:00
|
|
|
#include <QFrame>
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
#include <QAbstractButton>
|
|
|
|
#include <QTimer>
|
2016-10-17 09:57:00 +00:00
|
|
|
#include <QMenu>
|
|
|
|
#include <QPushButton>
|
2013-11-25 14:15:49 +00:00
|
|
|
|
2016-10-01 06:54:57 +00:00
|
|
|
namespace Ui {
|
|
|
|
class InterfaceFrame;
|
|
|
|
}
|
2015-04-28 08:26:46 +00:00
|
|
|
|
2017-11-23 12:34:19 +00:00
|
|
|
class InterfaceFrame : public QFrame
|
2012-01-04 22:13:01 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2016-10-01 06:54:57 +00:00
|
|
|
explicit InterfaceFrame(QWidget *parent = 0);
|
|
|
|
~InterfaceFrame();
|
2012-08-03 23:30:47 +00:00
|
|
|
|
2016-10-01 06:54:57 +00:00
|
|
|
int interfacesHidden();
|
2015-04-28 08:26:46 +00:00
|
|
|
|
2016-10-17 09:57:00 +00:00
|
|
|
QMenu * getSelectionMenu();
|
|
|
|
int interfacesPresent();
|
2017-07-16 21:26:51 +00:00
|
|
|
void ensureSelectedInterface();
|
2016-10-17 09:57:00 +00:00
|
|
|
|
2016-10-01 06:54:57 +00:00
|
|
|
Q_SIGNALS:
|
|
|
|
void showExtcapOptions(QString device_name);
|
|
|
|
void startCapture();
|
|
|
|
void itemSelectionChanged();
|
2016-10-17 09:57:00 +00:00
|
|
|
void typeSelectionChanged();
|
2016-10-01 06:54:57 +00:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void updateSelectedInterfaces();
|
|
|
|
void interfaceListChanged();
|
2016-10-20 07:34:49 +00:00
|
|
|
void toggleHiddenInterfaces();
|
2016-12-27 09:14:32 +00:00
|
|
|
#ifdef HAVE_PCAP_REMOTE
|
|
|
|
void toggleRemoteInterfaces();
|
|
|
|
#endif
|
2016-10-01 06:54:57 +00:00
|
|
|
void getPoints(int idx, PointList *pts);
|
2016-02-23 18:04:16 +00:00
|
|
|
|
2012-08-03 23:30:47 +00:00
|
|
|
protected:
|
|
|
|
void hideEvent(QHideEvent *evt);
|
|
|
|
void showEvent(QShowEvent *evt);
|
|
|
|
|
|
|
|
private:
|
2016-10-01 06:54:57 +00:00
|
|
|
|
2016-10-13 07:11:50 +00:00
|
|
|
void resetInterfaceTreeDisplay();
|
2016-10-01 06:54:57 +00:00
|
|
|
|
|
|
|
Ui::InterfaceFrame *ui;
|
|
|
|
|
|
|
|
InterfaceSortFilterModel * proxyModel;
|
|
|
|
InterfaceTreeModel * sourceModel;
|
|
|
|
|
|
|
|
QMap<int, QString> ifTypeDescription;
|
|
|
|
|
2013-10-11 21:26:26 +00:00
|
|
|
#ifdef HAVE_LIBPCAP
|
2012-08-31 22:25:51 +00:00
|
|
|
QTimer *stat_timer_;
|
2013-10-11 21:26:26 +00:00
|
|
|
#endif // HAVE_LIBPCAP
|
2012-01-04 22:13:01 +00:00
|
|
|
|
2016-10-01 06:54:57 +00:00
|
|
|
private slots:
|
|
|
|
void interfaceTreeSelectionChanged(const QItemSelection & selected, const QItemSelection & deselected);
|
2012-01-04 22:13:01 +00:00
|
|
|
|
2016-10-01 06:54:57 +00:00
|
|
|
void on_interfaceTree_doubleClicked(const QModelIndex &index);
|
2016-10-02 14:47:04 +00:00
|
|
|
#if defined(HAVE_EXTCAP) && defined(HAVE_LIBPCAP)
|
2016-10-01 06:54:57 +00:00
|
|
|
void on_interfaceTree_clicked(const QModelIndex &index);
|
|
|
|
#endif
|
2012-01-04 22:13:01 +00:00
|
|
|
|
2012-08-03 23:30:47 +00:00
|
|
|
void updateStatistics(void);
|
2016-10-01 06:54:57 +00:00
|
|
|
void actionButton_toggled(bool checked);
|
2016-10-17 09:57:00 +00:00
|
|
|
void triggeredIfTypeButton();
|
2012-01-04 22:13:01 +00:00
|
|
|
};
|
|
|
|
|
2016-10-01 06:54:57 +00:00
|
|
|
#endif // INTERFACE_FRAME_H
|
2012-09-04 08:18:31 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* 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:
|
|
|
|
*/
|