Names of capture files on the client now include the interface name so that it is easy to identify which capture belongs to which port when multiple captures are open in multiple Wireshark windows.

This commit is contained in:
Srivats P. 2015-01-16 20:29:11 +05:30
parent 02e442a6bf
commit ac7e378939
2 changed files with 6 additions and 2 deletions

View File

@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
#ifndef _PORT_H
#define _PORT_H
#include <QDir>
#include <QList>
#include <QString>
#include <QTemporaryFile>
@ -101,7 +102,10 @@ public:
QTemporaryFile* getCaptureFile()
{
delete capFile_;
capFile_ = new QTemporaryFile();
capFile_ = new QTemporaryFile(QString(QDir::tempPath())
.append("/")
.append(name())
.append(".XXXXXX"));
return capFile_;
}

View File

@ -98,7 +98,7 @@ PcapPort::PcapPort(int id, const char *device)
if (strcmp(device, dev->name) == 0)
{
#ifdef Q_OS_WIN32
data_.set_name(QString("if%1 ").arg(id).toStdString());
data_.set_name(QString("if%1").arg(id).toStdString());
#else
if (dev->name)
data_.set_name(dev->name);