Commit Graph

882 Commits

Author SHA1 Message Date
Srivats P
1699dba1cf Change raw_input to input in generated python code 2020-06-06 12:30:53 +05:30
Srivats P
be984135ac Fix diff in pcap import of IPv4 due to ip.flags
Some Wireshark/tshark versions have ip.flags as u16 instead of u8. Code
changed to be able to handle both.

Tested with Wireshark 3.2.4 (u16) and 1.14 (u8)
2020-06-04 21:02:09 +05:30
Srivats P
2028d0f25b Start the error/warn animation from center of app
Irrespective of whether logs window is visible or not, show and
animate the icon from the center of the main window; end point is center
of logs window if visible, or the logs window tab icon if not visible.
2020-05-31 21:01:10 +05:30
Srivats P
4487da1ae6 Add URL to why pcap diff from error message 2020-05-18 20:58:39 +05:30
Srivats P
f7ace4c5c2 Name threads for easier debugging 2020-05-15 18:55:03 +05:30
Srivats P
6f7cbae2dd
Merge pull request #306 from quanterium/isnan_error
Add missing include cmath in port.cpp
2020-05-15 17:56:36 +05:30
David Mueller
f14c02b065
Add missing include cmath 2020-05-13 09:28:59 -07:00
Srivats P
1f8bfd2393 Update copyright to 2020 in About 2020-05-13 20:48:37 +05:30
Srivats P
8859a4c152 Tweak the animated error/warn GIF icons
Two frames were deleted from each end of the sequence so that the icon
never goes fully white/blank
2020-05-13 20:39:45 +05:30
Srivats P
1bc2d08fdb Reset RPC input stream after aborting the connection
Without reset, on reconnection, the input stream reads the buffered
data before abort.
2020-05-12 21:56:40 +05:30
Srivats P
75ce626532 Convert RPC channel's static vars to data members
Using static vars meant all connections were using the same static vars!
A bug that has existed since 2009!

This code is ugly, but since it is such a fundamental piece of code for
every operation, no refactoring is being done except to convert the
static vars to data members renaming where required to avoid name
conflicts. The one exception is that `cumLen` which was a per hdr.type
variable is now a single data member across all types. Since for a
single connection messages will be sequential this is expected to work
(fingers crossed!)

For the future we should look at replacing the custom RPC code with GRPC
(issue #305).

Fixes #304
2020-05-12 21:33:54 +05:30
Srivats P
f92161e755 Add XXX note about LogsWindow::isVisible_ 2020-05-10 19:19:32 +05:30
Srivats P
0e72a58dd7 Call attention to the warn/error logs using animation 2020-05-10 18:43:08 +05:30
Srivats P
dccf2042f0 Abort connection if bad data received from drone
Currently we would crash because of qFatal(). The new behaviour is
better. Error is reported in the logs window alongwith a suggestion on
what to check.
2020-05-09 09:50:32 +05:30
Srivats P
1e1e0b0c48 Clear current and selection when restoring default view
This is done for all top level windows - ports, stats, logs

At startup, the local portgroup would automatically become current with
the result that the welcome page would not be visible. Not sure why but
an explicit setFocus of ports window seems to avoid it.
2020-05-07 18:40:31 +05:30
Srivats P
f309ce99cc Set top and bottom docks to equal height at startup 2020-05-06 18:01:44 +05:30
Srivats P
2006674fc1 Print Settings path at startup for debug 2020-05-06 17:52:18 +05:30
Srivats P
ad38a60171 Fix valid count range for variable fields
To allow full range of a field, the "count" of a variable field,
 * Minimum should be 1, not 0
 * Maximum should be max value of field + 1

Fixes #301
2020-05-04 19:15:49 +05:30
Srivats P
bd20ec724f Check if interface has a link layer (mac) address
Fixes #298
2020-05-04 18:55:57 +05:30
Srivats P
0897ae6dad Fix awk not found while importing pcap on Windows
For non-Windows platforms, the default paths for awk, diff, gzip are
fixed at compile time since these are standard utilities for these
platforms. However, for Windows, we ship these utilities along with
Ostinato, so we need to set default path as the application directory
which is known only at run time. This is done as part of
Preferences::initDefaults() and therefore should be called before
setting OstProtoLib external program paths
2020-04-09 18:43:00 +05:30
Srivats P
a1582ad67b Convert pcapng and other formats to pcap for import
Any capture format supported by tshark can now be imported by Ostinato.

Fixes #83
2020-04-07 21:18:34 +05:30
Srivats P
c335f34651 Import PDML text proto as hexdump if non-text chars 2020-04-07 21:15:27 +05:30
Srivats P
5efffb0c4b Ignore http.file_data during PDML import
This field is just a combination of other http fields
2020-04-07 21:14:44 +05:30
Srivats P
79ada3315a Ignore empty value fields during PDML import 2020-04-07 21:10:39 +05:30
Srivats P
c25256bfb5 Fix STP PCAP/PDML import
As originally written it worked only with Eth encap
2020-04-07 21:08:21 +05:30
Srivats P
63e648bbfe Fix IGMPv3 group record aux data
FieldValue, FieldFrameValue, FieldTextValue were all fixed. This used to
work earlier. I think somewhere across Qt versions, QByteArray() and
QString() changed such that it broke. Or more likely I was using those
incorrectly earlier but output was still correct which is no longer
true.

Anyway, it should be ok going forward (hopefully!)
2020-04-03 20:39:14 +05:30
Srivats P
487f3e653d Fix missing packet summary line in pcap import diff
Looks like starting somewhere in Wireshark 2.x, when we give -x to
tshark, we also need to explicitly give -P to include the one-line
summary of the packet. This one-line summary is used in the diff to find
out which packets experienced a diff.
2020-04-03 20:29:18 +05:30
Srivats P
f1a962a6c4 Fix compilation error with importpcap test 2020-04-03 20:27:42 +05:30
Srivats P
8f510635a9 Use UInt128 for IPv6 address modes (inc, dec, rnd)
Fixes #283
2020-03-27 21:15:49 +05:30
Srivats P
acb8222beb Fix IPv6 stream config prefixLength not being saved 2020-03-27 21:15:49 +05:30
Srivats P
f705f7f606 Fix build break 2020-03-23 20:37:47 +05:30
Srivats P
bfc5477807 Store mac in big-endian order in DeviceKey
This was a bug. The intention was to store it in big endian, so that the
sort order for devices would be VLANs+Mac.

Fixes #289
2020-03-23 18:48:36 +05:30
Srivats P
79ac3a2a20 Fix plain text copy to print selected columns
The case being fixed is when non contiguous columns were selected, e.g.
column 3 and 7
2020-03-22 13:26:38 +05:30
Srivats P
6791eb06dd Change port stats to use XTableView to support copy paste
Also fix plain text copy to only include selected column headers if the
selection behaviour is SelectColumns
2020-03-20 22:15:13 +05:30
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