Commit Graph

252 Commits

Author SHA1 Message Date
Srivats P
bfdcee2baa Recompute L4 checksum on-the-fly for TTag packets 2023-05-26 11:31:52 +05:30
Srivats P
c2967b663d Calculate L4 checksum offset for TTag packets 2023-05-26 11:31:52 +05:30
Srivats P
70b5e60440 Rename delay as latency in Protobuf/RPC
The GUI uses the term 'latency', so it's better if the API alsos use the same
term instead of 'delay'
2023-05-26 11:31:52 +05:30
Srivats P
ab713ce043 Integrate StreamTiming with the code
Bugs found during integration were fixed and minor code improvements were made
such as using consts, const params, renaming members etc.
2023-05-26 11:31:52 +05:30
Srivats P
21ce331c43 Create a Tx Ttag tracker thread
For now we are just debug printing timestamp with T-TagId and GUID. We
need to store this tuple and compare when we Rx the same - this will be
in a upcoming commit.
2023-05-26 11:31:52 +05:30
Srivats P
fdf8c77350 Change T-Tag on the fly 2023-05-26 11:31:52 +05:30
Srivats P
159cd7c0da Add T-Tag placeholder in sign protocol 2023-05-26 11:31:52 +05:30
Srivats P
e2369c02bc Fix value for str/bytes field when save as Python
Protobuf string type should be treated as a Python unicode string usable
in both Python 2.x and Python 3.x. Since we are now using unicode strings,
force encoding as utf-8.

Protobuf bytes type should be treated as a Python byte string. Use hex
values in byte literal even for printable characters, for a better UX.

escapeString() is no longer being used, but has been retained in the
code.
2022-12-28 19:30:50 +05:30
Srivats P
d44fdf4ae7 Add a prefix to combo protocol fields
For same protocol numbers (e.g. IP 4o4), use Outer/Inner as prefix. For
"similar" protocols like VlanStack or IP 4o6, use the protocol name as
the prefix.
2022-12-20 13:38:16 +05:30
Srivats P
42091e5221 Allow user to add a port description
If a user description is available, that is shown in the ports window
other wise the system determined description is shown.

Updates #223
2022-09-09 12:25:17 +05:30
Srivats P
94a6423a96 Add a 1.2.0 version updater test 2022-08-15 13:05:41 +05:30
Srivats P
06ad12777f Warn if sign proto may be followed by padding
For now, we check and tell the user. The actual fix should be for
sign proto to add padding before it's content, if required

Updates #313
2022-06-30 18:24:48 +05:30
Srivats P
701a058c7d Merge commit 'refs/subrepo/ostinato/fetch' into subrepo/ostinato
Update from master repo into turbo
2022-06-27 14:35:22 +05:30
Srivats P
9d42ed12cc Use a invalid GUID instead of 0 as default
If a packet does not have a sign/guid, use an invalid guid instead of 0
as the default, so that these packets get tracked against the invalid
guid which can be excluded while updating the port's stream stats.
2022-06-27 13:43:47 +05:30
Srivats P
843733567a Reoganize code using subrepo for Ostinato (part 2)
This commit includes all the new and modified files
2022-06-27 13:43:46 +05:30
Srivats P
5e7bf77b0c
Merge pull request #350 from pstavirs/streamrates
Add average rate per GUID in stream statistics
2022-06-20 17:27:24 +05:30
Srivats P
5a91dc4561 Remove TODOs from GRE implementation files 2022-05-26 17:30:29 +05:30
Srivats P
3d6f39e84d Implement override checksum for GRE 2022-05-25 15:16:33 +05:30
Srivats P
60f61ed947 Add and use UIntEdit for 32-bit GRE Key/Seq fields 2022-05-23 17:04:27 +05:30
Srivats P
25a91e52f6 Change GRE optional fields implementation
* frameFieldCount() always includes all frame fields whether or not
included in packet
* if an optional field is not included in packet
    - FieldName is still returned
    - FieldTextValue is returned as "<not-included>"
    - FieldBitWidth is 0
    - all remaining attributes are QVariant()
2022-05-23 13:18:18 +05:30
Srivats P
c8cc7a021f Merge branch 'master' into gre 2022-05-21 12:16:14 +05:30
Srivats P
329469dd6e Calculate port tx duration and send to controller
This commit only includes server side changes plus the .proto changes.

Client side UI changes are still pending.
2022-02-21 22:20:59 +05:30
Srivats P
b0a81fb231 Change recalc cksum defaults implementation
These are the existing and desired defaults -
 * GUI: recalcCksum = true
 * PCAP import test: recalcCksum = false

With the existing implementation, doing PCAP import in 'raw' mode twice
would lead to recalcCksum being checked in the dialog the second time.
This was because we were always forcing it to be true for the GUI case
without checking for anything.
2022-01-23 21:46:42 +05:30
Srivats P
735e960dcb Use nsec pcap as intermediate when opening non-pcap
When opening a non-PCAP file, we convert it to intermediate PCAP format.
Use nanosecond pcap format instead of standard microsec pcap format for
higher timestamp resolution.

Updates #238
2022-01-19 18:54:46 +05:30
Srivats P
226705f015 Use integer storage and arithmetic for nanosec pcap
quint64 has larger range than double so has better accuracy. However,
for calculating packet rate, use floating-point arithmetic since the
packet rate is a double

Updates #238
2022-01-19 18:46:09 +05:30
Srivats P
45d5e15f23 Save PCAP always in nanosecond PCAP format
Updates #238
2022-01-17 18:49:24 +05:30
Srivats P
d09d83000e Add comment specifying PDML reader needs PCAP file
Updates #238
2022-01-15 18:36:15 +05:30
Srivats P
0f322fb2d8 Read nanosec PCAP files natively in non-pdml mode
In PDML mode, nanosecond support is already present - in fact, only
nanosecond is supported not microseconds.

Updates #238
2022-01-15 16:22:28 +05:30
Srivats P
4bfd546f21 Change pcap import recalcCksum default to false
This was changed so that pcap import test produces minimal diffs like
earlier. However, for user, the import options dialog overrules this
default, so that user default remains recalcCksum as true
2021-12-12 11:06:36 +05:30
Srivats P
16b353ae30 Alloc/free Pcap import options dialog every time
The earlier code was trying to reuse the dialog but this was throwing
an unexpected error every time -

    External WM_DESTROY received for QWidgetWindow

This commit fixes this error message
2021-12-11 21:13:15 +05:30
Srivats P
dbdeee2a6f Add option to recalculate cksums during pcap import
Recalculate cksum is now the default.

This behaviour change has been done to facilitate rewriting packet
fields post PCAP import using the new Find & Replace feature. Without
this any change in fields may cause incorrect checksums.

The earlier rationale for retaining the checksums in the PCAP file
during import was to ensure replayed packet was same as the one in the
PCAP file.

User now has a choice with this option.
2021-12-11 19:27:44 +05:30
Srivats P
366022552f Update pcap import options UI as per latest QtDesigner
There are some file format changes - all cosmetic
2021-12-11 18:11:53 +05:30
Srivats P
8333e5fbf1 Use QList::last instead of constLast for b/w compatibility
constLast was introduced in Qt5.6; Travis CI has older Qt
2021-12-11 16:00:57 +05:30
Srivats P
969e16aaf3 Fix IGMP/MLD group address find/replace
fieldData/setFieldData changed to work with uint in addition to string
2021-12-11 15:58:30 +05:30
Srivats P
58d4ceb9c7 Ensure setFieldData return value for all protocols
Some protocol fields were not setting 'isOk' before returning it
2021-12-11 12:56:23 +05:30
Srivats P
dc7ac89c30 Verify find/replace mask works for all field types 2021-12-09 08:26:35 +05:30
Srivats P
4c6d8f35d6 Verify and fix Ip6Address type field edit 2021-12-08 21:36:39 +05:30
Srivats P
7cf9c91014 Verify and fix Ip4Address type field edit 2021-12-06 20:56:40 +05:30
Srivats P
9385b31bc5 Verify and fix MacAddress type field edit
Use QRegularExpression instead of QRegExp as the latter is deprecated in
Qt6
2021-12-05 12:09:02 +05:30
Srivats P
d3400f0897 Validate find-replace value based on field type
Only kUInt64 type has been verified for this commit.

Others are pending.
2021-12-04 12:17:37 +05:30
Srivats P
b60aad45d1 Implement find-replace logic for fields <= 64 bits 2021-12-03 19:01:32 +05:30
Srivats P
e19083ed3f Fleshed out some of the find-replace code 2021-11-27 22:13:55 +05:30
Srivats P
925edb8507 Add port speed and MTU properties
This commit only retreives these properties for Windows. Linux and
BSD/MacOS are pending
2021-11-06 21:27:55 +05:30
Srivats P
5180f57202 Fix comparison of different enum types 2021-09-23 09:34:09 +05:30
Srivats P
a3f0281c30 Fix comparison of difference enum types 2021-09-23 08:31:52 +05:30
Srivats P
d5365a25d4 Add IMIX as a Frame Length mode
Use Simple IMIX as defined in Wikipedia - Frame lengths 64, 594, 1518 in
a 7:4:1 ratio
2021-09-23 08:11:22 +05:30
Srivats P
9f70f29499 Refactor ICMP/IGMP checksums
Added a new CksumTypeIcmpIgmp and implemented it in AbstractProtocol.
2021-09-05 13:04:57 +05:30
Srivats P
a498dbf21a Fix incorrect UDP/ICMP checksums
For UDP encaps like VxLAN or Geneve, which can contain IP as
payload, the UDP checksum was incorrect because when summing
UDP payload (i.e. IP), we skipped the IPv4 checksum field,
which should not be skipped in this case.

Similar issue, for ICMP with IP as payload, ICMP checksum was
incorrect.

Essentially, any protocol which checksums over its payload and
the payload contains protocols with checksum fields.
2021-09-04 18:16:40 +05:30
Srivats P
1894a633e1 Fix comparison between different ARP mode enum types 2021-08-15 18:27:13 +05:30
Srivats P
226b6cf35c Fix comparison between different length mode enum types 2021-08-15 18:16:09 +05:30