Changes for successful Linux compilation
This commit is contained in:
parent
c5bcc2e0c2
commit
be620e0ab6
@ -18,7 +18,8 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
: QMainWindow (parent)
|
||||
{
|
||||
localServer_ = new QProcess(this);
|
||||
localServer_->start("drone.exe");
|
||||
localServer_->setProcessChannelMode(QProcess::ForwardedChannels);
|
||||
localServer_->start("./drone.exe");
|
||||
|
||||
pgl = new PortGroupList;
|
||||
|
||||
|
@ -7,7 +7,8 @@ win32:LIBS += -L"../common/debug" -lostproto
|
||||
unix: LIBS += -L"../common" -lostproto
|
||||
win32:LIBS += -L"../rpc/debug" -lpbrpc
|
||||
unix:LIBS += -L"../rpc" -lpbrpc
|
||||
POST_TARGETDEPS += "../common/debug/libostproto.a" "../rpc/debug/libpbrpc.a"
|
||||
win32:POST_TARGETDEPS += "../common/debug/libostproto.a" "../rpc/debug/libpbrpc.a"
|
||||
unix:POST_TARGETDEPS += "../common/libostproto.a" "../rpc/libpbrpc.a"
|
||||
RESOURCES += ostinato.qrc
|
||||
HEADERS += \
|
||||
dumpview.h \
|
||||
|
@ -620,13 +620,18 @@ void PortGroup::processStopCaptureAck(OstProto::Ack *ack)
|
||||
|
||||
void PortGroup::processViewCaptureAck(OstProto::CaptureBuffer *buf, QFile *capFile)
|
||||
{
|
||||
#ifdef Q_OS_WIN32
|
||||
QString viewer("C:/Program Files/Wireshark/wireshark.exe");
|
||||
#else
|
||||
QString viewer("/usr/bin/wireshark");
|
||||
#endif
|
||||
|
||||
qDebug("In %s", __FUNCTION__);
|
||||
|
||||
capFile->flush();
|
||||
capFile->close();
|
||||
|
||||
if (!QProcess::startDetached("C:/Program Files/Wireshark/wireshark.exe",
|
||||
QStringList() << capFile->fileName()))
|
||||
if (!QProcess::startDetached(viewer, QStringList() << capFile->fileName()))
|
||||
qDebug("Failed starting Wireshark");
|
||||
|
||||
delete buf;
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "abstractprotocol.h"
|
||||
|
||||
#include "dot3.pb.h"
|
||||
#include "ui_Dot3.h"
|
||||
#include "ui_dot3.h"
|
||||
|
||||
class Dot3ConfigForm : public QWidget, public Ui::dot3
|
||||
{
|
||||
|
@ -10,7 +10,8 @@ unix:LIBS += -L"../common" -lostproto
|
||||
win32:LIBS += -L"../rpc/debug" -lpbrpc
|
||||
unix:LIBS += -L"../rpc" -lpbrpc
|
||||
LIBS += -lprotobuf
|
||||
POST_TARGETDEPS += "../common/debug/libostproto.a" "../rpc/debug/libpbrpc.a"
|
||||
win32:POST_TARGETDEPS += "../common/debug/libostproto.a" "../rpc/debug/libpbrpc.a"
|
||||
unix:POST_TARGETDEPS += "../common/libostproto.a" "../rpc/libpbrpc.a"
|
||||
RESOURCES += drone.qrc
|
||||
HEADERS += drone.h
|
||||
FORMS += drone.ui
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
#ifndef Q_OS_WIN32
|
||||
|
||||
//#define PCAP_OPENFLAG_PROMISCUOUS 1
|
||||
#define PCAP_OPENFLAG_PROMISCUOUS 1
|
||||
|
||||
struct pcap_send_queue
|
||||
{
|
||||
|
@ -22,6 +22,10 @@ PcapPort::PcapPort(int id, const char *device)
|
||||
{
|
||||
if (strcmp(device, dev->name) == 0)
|
||||
{
|
||||
#ifndef Q_OS_WIN32
|
||||
if (dev->name)
|
||||
data_.set_name(dev->name);
|
||||
#endif
|
||||
if (dev->description)
|
||||
data_.set_description(dev->description);
|
||||
|
||||
@ -214,7 +218,7 @@ void PcapPort::PortTransmitter::setHandle(pcap_t *handle)
|
||||
|
||||
void PcapPort::PortTransmitter::useExternalStats(AbstractPort::PortStats *stats)
|
||||
{
|
||||
if (usingInternalStats_);
|
||||
if (usingInternalStats_)
|
||||
delete stats_;
|
||||
stats_ = stats;
|
||||
usingInternalStats_ = false;
|
||||
@ -384,6 +388,7 @@ void PcapPort::PortCapturer::run()
|
||||
|
||||
if (stop_)
|
||||
{
|
||||
qDebug("user requested capture stop\n");
|
||||
stop_ = false;
|
||||
break;
|
||||
}
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include <pcap.h>
|
||||
|
||||
#include "abstractport.h"
|
||||
#include "pcapextra.h"
|
||||
|
||||
class PcapPort : public AbstractPort
|
||||
{
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
#include <pcap.h>
|
||||
|
||||
#include "pcapport.h"
|
||||
#include "winpcapport.h"
|
||||
|
||||
PortManager *PortManager::instance_ = NULL;
|
||||
|
@ -1,5 +1,7 @@
|
||||
#include "winpcapport.h"
|
||||
|
||||
#ifdef Q_OS_WIN32
|
||||
|
||||
const uint OID_GEN_MEDIA_CONNECT_STATUS = 0x00010114;
|
||||
|
||||
WinPcapPort::WinPcapPort(int id, const char *device)
|
||||
@ -140,3 +142,5 @@ void WinPcapPort::PortMonitor::run()
|
||||
QThread::msleep(1000);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +1,8 @@
|
||||
#ifndef _SERVER_WIN_PCAP_PORT_H
|
||||
#define _SERVER_WIN_PCAP_PORT_H
|
||||
|
||||
#ifdef Q_OS_WIN32
|
||||
|
||||
#include "pcapport.h"
|
||||
|
||||
#include <packet32.h>
|
||||
@ -27,3 +29,5 @@ private:
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user