Skip to content

Commit

Permalink
Merge pull request #34 from yestinj/qt5_port
Browse files Browse the repository at this point in the history
Qt5 port
  • Loading branch information
yestinj authored May 24, 2017
2 parents 5b02de9 + ae32cfb commit dce83de
Show file tree
Hide file tree
Showing 22 changed files with 445 additions and 272 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ src/inetvis
src/inetvis.pro.user
.moc/
qrc_icons.cpp
recorded/*
src/recorded/*
66 changes: 45 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,52 @@ This project is based off of the original work by JP van Riel and Barry Irwin of

# Notes

This project was originally written in Qt3 and compiled to 32-bit code, it has since been ported to native Qt4,
and been set to compile a 64-bit binary.
This project was originally written in Qt3 and compiled to 32-bit code, it has since been ported to Qt5,
and been updated to compile a 64-bit binary.

The instructions below have all been tested on the current version of Ubuntu, 17.04 64-bit.

# Installing InetVis (from release archive)

A compiled version of InetVis is available under the releases section of https://github.com/yestinj/inetvis.

In order to install and run the software please do the following:

1. Download the latest release archive from the releases page.
2. Extract the archive which will be called something like `inetvis-2.0.0.tgz`
3. Change into the extracted directory, something like `inetvis-2.0.0`
4. Run the `install_inetvis.sh` shell script to install the software.
1. This script will: install the software to `/opt/inetvis-<version>`
2. Create a symlink directory `/opt/inetvis` for convenience
3. Copy across the relevant files to the new directory under `/opt`.
4. Place an icon file in `/usr/share/icons/hicolor/48x48/apps/`
5. Place a `desktop` file in `/usr/share/applications`, allowing inetvis to be found in the menu on Ubuntu systems.
6. Create a symlink at `/usr/local/bin/inetvis` pointing to the main binary.
7. Set the `cap_net_raw`, and `cap_net_admin=eip` capabilities on the inetvis binary allowing for monitoring packets on local host without running as root.
5. If the script completes successfully inetvis should now be in your path, and also be in the menu system of your distribution.

# Running InetVis

To run InetVis do the following:

1. Download the latest InetVis release archive from the releases page.
* Alternatively clone the repository, and follow the build procedure above
2. Install the requirements (if necessary):
* `sudo apt-get install build-essential g++ libc6 libstdc++6 libc6-dev make libpcap-dev libgl1-mesa-dev libqt4-dev libqt4-dev qt4-dev-tools`
* Note: These are also the build requirements, installing them may not be necessary for simply running the application.

If you installed InetVis as per the instructions, you should simply be able
to run the `inetvis` command from your command line or menu system.

If you have built the binary yourself, please run it using manually using `./inetvis` from the src directory.

You will need to run your built binary as root should you wish to monitor local host.

Have fun! :-)

# Uninstalling InetVis

A convenience script is included in the release archive, namely `uninstall_inetvis.sh`, which can be used to completely remove inetvis from your system at any time.

# Building InetVis

Expand Down Expand Up @@ -38,30 +79,13 @@ Finally, build the `inetvis` binary:

This should result in a new `inetvis` binary being generated within the source directory.

# Running InetVis

To run InetVis do the following:

1. Download the latest InetVis binary from the releases page.
* Alternatively clone the repository and run the `inetvis` binary in the root directory.
* Or simply use the binary generated from the build process, in `src/`
2. Install the requirements (if necessary):
* `sudo apt-get install build-essential g++ libc6 libstdc++6 libc6-dev make libpcap-dev libgl1-mesa-dev libqt4-dev libqt4-dev qt4-dev-tools`
* Note: These are also the build requirements, installing them may not be necessary for simply running.

Next, locate the binary you downloaded/built and run it as follows: `./inetvis`

If you would like to monitor your own host for network events, instead of replaying capture files, please ensure that you run as root, i.e. `sudo ./inetvis`

Have fun! :-)

# Development

Development is currently done using a combination of Atom, vim, and Qt Creator.
Development is currently done using Qt Creator.

QT Creator allows for simple editing of source code, as well as graphical form editing, and can be
installed in Debian flavours of Linux by installing the `qtcreator` package.

# Versioning

This software will make use of Semantic Versioning 2.0.0 (http://semver.org/) once reaching the v1.0.0 release phase.
This software uses Semantic Versioning 2.0.0 (http://semver.org/) as of release v2.0.0.
Binary file removed inetvis
Binary file not shown.
File renamed without changes.
File renamed without changes.
35 changes: 17 additions & 18 deletions src/controlpanel.ui
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@
<x>0</x>
<y>0</y>
<width>630</width>
<height>25</height>
<height>22</height>
</rect>
</property>
<widget class="QMenu" name="fileMenu">
Expand Down Expand Up @@ -810,8 +810,7 @@
<action name="fileNewAction">
<property name="icon">
<iconset>
<normaloff/>
</iconset>
<normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>&amp;New</string>
Expand Down Expand Up @@ -1158,7 +1157,7 @@
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="text">
<string>Monitor &amp;Local Host</string>
Expand Down Expand Up @@ -1284,7 +1283,7 @@
</connection>
<connection>
<sender>fileExitAction</sender>
<signal>activated()</signal>
<signal>triggered()</signal>
<receiver>ControlPanel</receiver>
<slot>close()</slot>
<hints>
Expand All @@ -1300,7 +1299,7 @@
</connection>
<connection>
<sender>fileOpenAction</sender>
<signal>activated()</signal>
<signal>triggered()</signal>
<receiver>ControlPanel</receiver>
<slot>fileOpen()</slot>
<hints>
Expand All @@ -1316,7 +1315,7 @@
</connection>
<connection>
<sender>helpAboutAction</sender>
<signal>activated()</signal>
<signal>triggered()</signal>
<receiver>ControlPanel</receiver>
<slot>helpAbout()</slot>
<hints>
Expand All @@ -1332,7 +1331,7 @@
</connection>
<connection>
<sender>monitorLocalHostAction</sender>
<signal>activated()</signal>
<signal>triggered()</signal>
<receiver>ControlPanel</receiver>
<slot>monitorLocalHostSelected()</slot>
<hints>
Expand All @@ -1348,7 +1347,7 @@
</connection>
<connection>
<sender>pauseAction</sender>
<signal>activated()</signal>
<signal>triggered()</signal>
<receiver>ControlPanel</receiver>
<slot>pauseMenuAction()</slot>
<hints>
Expand All @@ -1364,7 +1363,7 @@
</connection>
<connection>
<sender>playAction</sender>
<signal>activated()</signal>
<signal>triggered()</signal>
<receiver>ControlPanel</receiver>
<slot>playMenuAction()</slot>
<hints>
Expand Down Expand Up @@ -1396,7 +1395,7 @@
</connection>
<connection>
<sender>recordCapture_Current_Frame_to_FileAction</sender>
<signal>activated()</signal>
<signal>triggered()</signal>
<receiver>ControlPanel</receiver>
<slot>takeSnapshot()</slot>
<hints>
Expand Down Expand Up @@ -1460,7 +1459,7 @@
</connection>
<connection>
<sender>replayCaptureFileAction</sender>
<signal>activated()</signal>
<signal>triggered()</signal>
<receiver>ControlPanel</receiver>
<slot>replayFileModeSelected()</slot>
<hints>
Expand Down Expand Up @@ -1524,7 +1523,7 @@
</connection>
<connection>
<sender>replayReplay_RateNormal_Playback_Speed_1xAction</sender>
<signal>activated()</signal>
<signal>triggered()</signal>
<receiver>ControlPanel</receiver>
<slot>setNormalReplaySpeed()</slot>
<hints>
Expand Down Expand Up @@ -1556,7 +1555,7 @@
</connection>
<connection>
<sender>timeScaleLineEdit</sender>
<signal>lostFocus()</signal>
<signal>editingFinished()</signal>
<receiver>ControlPanel</receiver>
<slot>timeScaleLineEditChanged()</slot>
<hints>
Expand Down Expand Up @@ -1716,7 +1715,7 @@
</connection>
<connection>
<sender>viewDisplayWindowAction</sender>
<signal>activated()</signal>
<signal>triggered()</signal>
<receiver>ControlPanel</receiver>
<slot>viewVisDisplayPanel()</slot>
<hints>
Expand All @@ -1732,7 +1731,7 @@
</connection>
<connection>
<sender>viewPlotterSettingsAction</sender>
<signal>activated()</signal>
<signal>triggered()</signal>
<receiver>ControlPanel</receiver>
<slot>viewPlotterSettings()</slot>
<hints>
Expand All @@ -1748,7 +1747,7 @@
</connection>
<connection>
<sender>viewReferenceFrameSettingsAction</sender>
<signal>activated()</signal>
<signal>triggered()</signal>
<receiver>ControlPanel</receiver>
<slot>viewReferenceFrameSettings()</slot>
<hints>
Expand All @@ -1764,7 +1763,7 @@
</connection>
<connection>
<sender>helpHelpAction</sender>
<signal>activated()</signal>
<signal>triggered()</signal>
<receiver>ControlPanel</receiver>
<slot>helpDoc()</slot>
<hints>
Expand Down
44 changes: 28 additions & 16 deletions src/controlpanelwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@

ControlPanelWidget::ControlPanelWidget(QMainWindow *parent) : QMainWindow(parent) {
setupUi(this);
// TODO: I think this would be called here.. need to confirm.
init();
}

ControlPanelWidget::~ControlPanelWidget() {
// TODO: Ensure this is correct.
destroy();
}

Expand Down Expand Up @@ -48,8 +46,6 @@ void ControlPanelWidget::init() {
//init about dialog
aboutDialog = new AboutDialogWidget((QWidget*)this);
helpDialog = new HelpDocumentationDialogWidget((QWidget*)this);
//aboutDialog->setShown(false);
//helpDialog->setShown(false);

//init error message dialog
qErrMsg = new QErrorMessage((QWidget*)this);
Expand Down Expand Up @@ -136,6 +132,11 @@ void ControlPanelWidget::fileOpen() {
replayPositionGroupBox->setEnabled(true);
ReplaySpeedGroupBox->setEnabled(true);
recordToolButton->setEnabled(true);

// if recording of live captures is disabled, turn this menu item back on now.
if (DISABLE_RECORDING_LIVE_CAPTURE) {
recordDump_to_Pcap_FileAction->setEnabled(true);
}
}
else {
//canceled
Expand All @@ -160,7 +161,15 @@ void ControlPanelWidget::monitorLocalHostSelected() {
//disable editing the replay position and time scale
replayPositionGroupBox->setEnabled(false);
ReplaySpeedGroupBox->setEnabled(false);
recordToolButton->setEnabled(true);

// Don't enable the record button if this flag is set.
if (!DISABLE_RECORDING_LIVE_CAPTURE) {
recordToolButton->setEnabled(true);
} else {
recordToolButton->setEnabled(false);
recordDump_to_Pcap_FileAction->setDisabled(true);
}

//TODO: In future may create temp file so that seeking back is possible
//while monitoring live

Expand Down Expand Up @@ -229,7 +238,6 @@ void ControlPanelWidget::captureFramesToFile(bool activate) {
{ captureFramesSetByUser = false;
recordCapture_Frames_to_FileAction->setChecked(false);
videoClipToolButton->setChecked(false);

//update UI log
if(LogUI::isEnabled())
LogUI::logEvent("[CP] frame capture stoped at replay time: "
Expand All @@ -241,35 +249,39 @@ void ControlPanelWidget::captureFramesToFile(bool activate) {
}

void ControlPanelWidget::record(bool buttonOn) {
if (recordToPcapFileSetByUser)
{ emit recordToFile(buttonOn);

if (recordToPcapFileSetByUser) {
emit recordToFile(buttonOn);

//update gui and sync menu with button
//recordToPcapFileSetByUser is a hack to avoid retriggering the
//record slot
if (buttonOn)
{ recordToPcapFileSetByUser = false;
//record slotf
if (buttonOn) {
recordToPcapFileSetByUser = false;
recordDump_to_Pcap_FileAction->setChecked(true);
recordToolButton->setChecked(true);
recordToPcapFileSetByUser = true;

//update UI log
if(LogUI::isEnabled())
if(LogUI::isEnabled()) {
LogUI::logEvent("[CP] packet recording started at replay time: "
+ strGetRepPos());
}
}
else
{ recordToPcapFileSetByUser = false;
else {

recordToPcapFileSetByUser = false;
recordDump_to_Pcap_FileAction->setChecked(false);
recordToolButton->setChecked(false);
recordToPcapFileSetByUser = true;

//update UI log
if(LogUI::isEnabled())
if(LogUI::isEnabled()) {
LogUI::logEvent("[CP] packet recording stoped at replay time: "
+ strGetRepPos());
}
}
}

}

void ControlPanelWidget::replayFileModeSelected() {
Expand Down
2 changes: 2 additions & 0 deletions src/controlpanelwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#include "helpdocumentationdialogwidget.h"
#include "logui.h"

#define DISABLE_RECORDING_LIVE_CAPTURE true

class ControlPanelWidget : public QMainWindow, public Ui::ControlPanel {
Q_OBJECT

Expand Down
Loading

0 comments on commit dce83de

Please sign in to comment.