Commit Graph

848 Commits

Author SHA1 Message Date
Srivats P
fae0bdb611 Remove copy support from Logs Model
XTableView now supports plain text copy for all models, so we don't need
this code in Logs Model
2020-03-18 20:56:07 +05:30
Srivats P
e6213a90ac Copy to clipboard in plain text format also
The plain text copy is written generically and should work with any
model that is attached to a XTableView
2020-03-18 20:50:29 +05:30
Srivats P
3b31a4fade Fix crash when updating 'cut' status
Also added a failsafe to workaround at run time if more problems are
detected in the field while updating cut-copy-paste action status
2020-03-17 18:50:20 +05:30
Srivats P
92fc7f140b Use a better heuristic to determine model canCut() 2020-03-17 18:49:12 +05:30
Srivats P
12f81a1dba Enable/Disable cut-copy-paste actions as required
Cut: focus widget has a selection, a 'cut' slot and 'canCut'
Copy: focus widget has a selection and a 'copy' slot
Paste: focus widget has a 'paste' slot and can accept the clipboard item
2020-03-16 22:26:16 +05:30
Srivats P
7227dd734b Fix build break due to missing include file 2020-03-14 21:42:29 +05:30
Srivats P
18d024481f Add cut-copy-paste to Edit menu and context-menu
Actions have been added to context-menu for stream list and device group
list only for now.
2020-03-14 21:13:24 +05:30
Srivats P
4b16c95b2a Add cut-copy-paste support for devicegroups 2020-03-11 18:19:55 +05:30
Srivats P
43f6959dcc Add cut-copy-paste support for streams 2020-03-11 18:19:55 +05:30
Srivats P
fd6f2c2508 Move copy support for Logs Window to Logs Model
The model is the correct place to determine what data gets copied. This
also paves way to support other models where the data to be copied is
not plain text
2020-03-11 18:19:55 +05:30
Srivats P
88ddb97a52 Find Wireshark exe path when given .app path
Also change the default Wireshark path value to match what recent
versions of Wireshark are using

Fixes #288
2020-02-14 18:47:02 +05:30
Srivats P
3889780d79 Allow editing of external program paths in Preferences
GUI file picker can still be used, but is not required.

Updates #288
2020-02-13 18:28:21 +05:30
Srivats P
db66d7c5ea Add support for npcap as winpcap replacement
For now both winpcap and npcap are supported with the latter being
experimentally supported till we get some feedback from users and
confirm that things are all working fine with npcap.

OID for link state has been changed to one that supports both.

To check which is being used, run 'drone -v'.

Fixes #236
2020-02-12 18:14:48 +05:30
Srivats P
018a8490cf Fix stream rate calculation when avg rate changes from 0 to > 0
Fixes #294
2020-01-30 18:06:47 +05:30
Srivats P
176fc7dd15 Redo fix for incorrect vlan parsing of rx emuldev frames
The previous fix in 6977278654 was incorrect and incomplete since it
won't handle the case when emulated devices have PRIO and/or CFI/DEI
set.

This is the correct fix where Prio and CFI/DEI are no longer part of the
device key.
2020-01-26 19:01:37 +05:30
Srivats P
f0dd0c307b Fix device emulation crash due to contention
Device emulation packets are received and processed in a different
thread compared to the main RPC processing thread where the emulated
devices are created/deleted. No packets should be processed while the
latter is in progress otherwise the former may access devices that have
been deleted.
2020-01-26 18:35:14 +05:30
Srivats P
d2ae04c488 Fix session file not saving port stream stats 2020-01-19 12:04:57 +05:30
Srivats P
6977278654 Fix incorrect vlan parsing of rx device emulation frames 2020-01-15 21:54:05 +05:30
Srivats P
64fe90e5b7 Fix jumbo error being reported multiple times
Also found and fixed another related bug where the loop to check pkt
size for trunc/jumbo ran for frameCount instead of
frameSizeVariableCount() - this change will reduce preflight check time
when frameSizeVariableCount is less than frameCount

Fixes #290
2019-12-29 20:38:08 +05:30
Srivats P
44a9eada48 Fix inputMask for IGMPv3 source IP
The old mask 009.009.009.009 does not compute to valid for input 1.2.3.4
and the Qt delegate doesn't accept it with Qt5 (not the case with Qt4)

Although the new mask 000.000.000.000 cannot prevent invalid entries
like 1.2.. or 300.400.500.600, I decided it was better to accept invalid
input (which gets converted to 0.0.0.0) instead of unintentionally not
allowing valid entries.

Fixes #292
2019-12-29 19:53:56 +05:30
Srivats P
3f76c533fd Add donation blurb to README 2019-09-21 12:28:26 +05:30
Srivats P
2966884fc8 Bump to version 1.0 - 11 years 'n 13 releases in the making! 2019-09-07 12:31:53 +05:30
Srivats P
8ea2e91b47 Add Qt widgets lib for PCAP import tests build
QtWidgets is required since we have ported the code to Qt5
2019-09-06 21:18:05 +05:30
Srivats P
518c7b804b Change logo icon to the full logo instead of a quadrant
* Changed Main Window icon - should change icon in taskbar also
* Changed Windows Icon
* Changed MacOS Icon
2019-08-28 21:37:45 +05:30
Srivats P
a88cfe35bb Increase main window height to make room for stats 2019-08-28 18:26:09 +05:30
Srivats P
884990d03c Set mac mode to fixed for pcap imported streams
We need to explicitly set it to fixed 'coz the default has changed from
fixed to resolve.

Fixes #282
2019-08-25 10:48:46 +05:30
Srivats P
c8a4c3eee9 Restore XTreeView functionality
I thought Qt5 had fixed this behaviour 'bug', but apparently not. So we
still need XTreeView - for Qt5 also.
2019-08-24 12:14:50 +05:30
Srivats P
36e0a64f81 Revert "Use persistent model index in devices widget"
This reverts commit 46dd028a33.

The above commit caused a regression - issue #281

As seen in valgrind, crash was caused by portModel reset writing into
a freed block - presumably pertaining to persistent indexes. The block
was freed by the persistent index itself earlier when it was set to
invalid - so the model should not have been accessing that.

The application code seems correct - maybe the Qt code has a bug?
Unlikely but not impossible. For now go back to using QModelIndex
instead of QPersistentModelIndex

Fixes #281
2019-08-24 11:59:41 +05:30
Srivats P
3e46c1b991 Include <typeinfo> header for using typeid 2019-08-18 13:13:39 +05:30
Srivats P
635ca18bce Fix duplicate deletion of host devices
Since host devices are also included in the deviceList_, they are already
being deleted. Deleting them again causes a segfault.
2019-08-18 12:30:41 +05:30
Srivats P
46dd028a33 Use persistent model index in devices widget 2019-08-10 18:55:23 +05:30
Srivats P
64d1525f50 Fix infinite loop when stopping capture etc.
On some platforms and/or some libpcap verisons, libpcap doesn't support a
timeout which makes interactive stop not possible. So we now use a UNIX
signal to break out. Obviously this works only on *nix platforms - which
includes MacOS. For now the problem is not seen on Windows with WinPCAP,
so we should be fine. May need to revisit when we add Npcap support.

Fixes #215, #234
2019-08-10 13:26:04 +05:30
Srivats P
ea69335d29 Check we have interface info before printing it 2019-07-28 10:42:11 +05:30
Srivats P
1db768afba Remove QThreadX since we have ported to Qt5 2019-07-28 10:42:11 +05:30
Srivats P
e123934c73 Suppress deprecated declarations till next release
Qt5.13 has deprecated a bunch of Qt APIs that we are using - postponing
this activity till next release
2019-07-27 11:46:17 +05:30
Srivats P
6974f4016f Replace the deprecated qSort with std::sort 2019-07-26 21:24:25 +05:30
Srivats P
0a2154d31b Re-add about.png icon that was removed by mistake 2019-07-10 21:07:38 +05:30
Srivats P
23bc0c6890 Add 2019 to copyright years in About dialog 2019-07-10 20:39:58 +05:30
Srivats P
6e551017f4 Show all ports in port stats window at startup
If one or more ports were reserved, these were not shown at client
startup
2019-07-04 19:17:22 +05:30
Srivats P
98378b52e6 Fix ClearAllStats with View Reserved Ports Only 2019-07-04 19:00:13 +05:30
Srivats P
5e565167f2 Fix build break due to fprintf in previous commit 2019-07-02 19:14:38 +05:30
Srivats P
f24a6719fa Disable logs by default in release mode
Enable logs if '-d' command-line option is given.

Additional command-line options -
-v : print version
-h : print usage

Drone only:
-p <port-number> : use given port number for the RPC service
2019-07-02 18:25:31 +05:30
Srivats P
3fca24396d Report "Apply" time in logs 2019-07-02 18:24:55 +05:30
Srivats P
c43f7d1769 Typecast to quint64 before passing to qToBigEndian
For 64-bit arch, Qt defines quint64 as unsigned long long (and quint32 as unsigned int), but Protobuf's google::protobuf::uint64 is defined as unsigned long. Now Qt defines qbswap only for the Qt defined 8/16/32/64 integer types aka q[u]intXXX. So qbswap<unsigned long long> and qbswap<unsigned int> is defined but not qbswap<unsigned long>.

mld.cpp was using qToBigEndian (which uses qbswap in turn) with a protobuf uint64 triggering the undefined references on some 64bit platforms.

Fixes #265
2019-06-26 22:42:09 +05:30
Srivats P
913ef5c0ee Add start/stop tx buttons to stream list window 2019-06-19 22:22:01 +05:30
Srivats P
bb079b9508 Use Qt5's prettyProductName to get system info 2019-06-06 21:36:12 +05:30
Srivats P
64d4b38f41 Add protocol error checks to preflight check
Also commented out stream transmit duration check that was causing false
positives
2019-06-05 11:39:09 +05:30
Srivats P
6817d3f870 Resolve neighbors before build as part of "apply" 2019-05-31 18:34:07 +05:30
Srivats P
edc7ed677c Mark sync complete after build finish during apply
Since build is now the last step during "apply", use that to mark sync
complete. Since build will always be called irrespective of whether any
changes were made to devices/streams, we can now send the stream RPCs
only if required.

Additionally log RPC calls only if they are actually made.
2019-05-28 19:02:50 +05:30
Srivats P
7cf323202f Add new build() RPC
Make build an explicit RPC so that clients can call resolveNeighbor
before build
2019-05-28 18:46:58 +05:30