diff --git a/client/mainwindow.cpp b/client/mainwindow.cpp index 0f818c5..4b967a6 100644 --- a/client/mainwindow.cpp +++ b/client/mainwindow.cpp @@ -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; diff --git a/client/ostinato.pro b/client/ostinato.pro index 3afbdc2..a644eb9 100644 --- a/client/ostinato.pro +++ b/client/ostinato.pro @@ -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 \ diff --git a/client/portgroup.cpp b/client/portgroup.cpp index 4ec94c3..606393c 100644 --- a/client/portgroup.cpp +++ b/client/portgroup.cpp @@ -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; diff --git a/common/dot3.h b/common/dot3.h index af045db..925374a 100644 --- a/common/dot3.h +++ b/common/dot3.h @@ -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 { diff --git a/server/drone.pro b/server/drone.pro index e33bb5c..5fc71d5 100644 --- a/server/drone.pro +++ b/server/drone.pro @@ -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 diff --git a/server/pcapextra.h b/server/pcapextra.h index 1f1c9f3..de4cec1 100644 --- a/server/pcapextra.h +++ b/server/pcapextra.h @@ -6,7 +6,7 @@ #ifndef Q_OS_WIN32 -//#define PCAP_OPENFLAG_PROMISCUOUS 1 +#define PCAP_OPENFLAG_PROMISCUOUS 1 struct pcap_send_queue { diff --git a/server/pcapport.cpp b/server/pcapport.cpp index a133812..f709b26 100644 --- a/server/pcapport.cpp +++ b/server/pcapport.cpp @@ -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; } diff --git a/server/pcapport.h b/server/pcapport.h index a17e665..9f80e57 100644 --- a/server/pcapport.h +++ b/server/pcapport.h @@ -6,6 +6,7 @@ #include #include "abstractport.h" +#include "pcapextra.h" class PcapPort : public AbstractPort { diff --git a/server/portmanager.cpp b/server/portmanager.cpp index 6105559..6442c72 100644 --- a/server/portmanager.cpp +++ b/server/portmanager.cpp @@ -2,6 +2,7 @@ #include +#include "pcapport.h" #include "winpcapport.h" PortManager *PortManager::instance_ = NULL; diff --git a/server/winpcapport.cpp b/server/winpcapport.cpp index 4e64913..b6e536d 100644 --- a/server/winpcapport.cpp +++ b/server/winpcapport.cpp @@ -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 diff --git a/server/winpcapport.h b/server/winpcapport.h index 3f2a3b0..d351fe2 100644 --- a/server/winpcapport.h +++ b/server/winpcapport.h @@ -1,6 +1,8 @@ #ifndef _SERVER_WIN_PCAP_PORT_H #define _SERVER_WIN_PCAP_PORT_H +#ifdef Q_OS_WIN32 + #include "pcapport.h" #include @@ -27,3 +29,5 @@ private: }; #endif + +#endif