Commit Graph

167 Commits

Author SHA1 Message Date
Srivats P
4be8a2969d Create and print activation hash on request
To request, pass option -a on the command-line
2022-06-27 13:43:48 +05:30
Srivats P
46a54fd56b Define PCAP promisc flag only if not defined 2022-06-27 13:43:48 +05:30
Srivats P
d32f89d30b Enable libbpf logging when drone logs are enabled 2022-06-27 13:43:48 +05:30
Srivats P
1b647ade1b Print "Starting..." after processing command line args 2022-06-27 13:43:47 +05:30
Srivats P
789338c8e1 Add startup/shutdown console prints 2022-06-27 13:43:47 +05:30
Srivats P
898b56fc76 Add turbo license validation code
Signed up for and using keygen.sh licensing SAAS
2022-06-27 13:43:47 +05:30
Srivats P
c949dc6682 Integrate XdpPort more cleanly into port manager
* No ugly #ifdef TURBO
* Turbo ports need to be specified explicitly in drone.ini
* If a port is not a turbo port, fall back to LinuxPort
* Turbo ports set their description as 'Turbo' which shows up in GUI
* Some XdpPort creation/destruction error checks
2022-06-27 13:43:47 +05:30
Srivats P
eb2ca12f32 Reorg (part 4) - add left out file
ostinato/server/timespecops.h got left out from part 1 commit of
the reorg - because it was a new file and was ignored by a wrong
.gitignore rule
2022-06-27 13:43:46 +05:30
Srivats P
741202ca76 Remove compiler warning
Compiler treats literal '0' as int i.e. signed
2022-06-27 13:43:46 +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
cb9b648c71 Resolve only valid gateways
Not doing so would lead to errors showing up with host devices
2020-06-08 18:42:38 +05:30
Srivats P
f7ace4c5c2 Name threads for easier debugging 2020-05-15 18:55:03 +05:30
Srivats P
2006674fc1 Print Settings path at startup for debug 2020-05-06 17:52:18 +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
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
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
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
6977278654 Fix incorrect vlan parsing of rx device emulation frames 2020-01-15 21:54:05 +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
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
6974f4016f Replace the deprecated qSort with std::sort 2019-07-26 21:24:25 +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
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
Srivats P
13eed5f528
Merge pull request #275 from pstavirs/hostdev
Hostdev
2019-04-11 21:38:42 +05:30
Srivats P
cd9758f165 Merge branch 'master' into hostdev 2019-04-11 18:56:49 +05:30
Srivats P
677d56bf32 Don't inline sumUInt128 since it's used elsewhere as well 2019-04-04 21:38:47 +05:30
Srivats P
75c8f44079 Fix MacOS specific Hostdev bugs
* Fix SA_SIZE definition for MacOS
* Use sdl_index instead of rtm_index as the ifIndex
* Remove the embedded ifIndex in link local addresses
* Extract default IPv6 gateway correctly
2019-04-03 20:41:46 +05:30
Srivats P
0fb81e4d8e Send ARP/NDP request from emuldevice if unresolved 2019-03-12 19:04:59 +05:30
Srivats P
1c2e833c4a Don't trigger ARP/NDP if already resolved 2019-03-11 18:25:07 +05:30
Srivats P
44357178c4 Rename var 'fail' as 'error'
This better reflects the following -
RPC fail : complete failure of the RPC; no changes were made
RPC error: partial failure of the RPC; some changes were made, some had
           errors
2019-02-21 20:57:24 +05:30
Srivats P
adfe1380da Print drone version/revision first thing at startup
Currently these are printed at the end of init when we start waiting for
client connections - this was done so that this info doesn't get lost in
the barrage of init logs. The downside is if there is a crash during
init, we don't get to know the version/revision from the logs. With this
change this info is printed twice - first thing when we start and just
after init when we start waiting for client connections
2019-02-18 18:16:36 +05:30
Srivats P
fcca47e652 Rename kRpcFail as kRpcError
Distinguish RPC Failure and RPC Error - the latter is in case of partial
failures

Also make Ack.status required - missed out in last commit
2019-02-16 20:54:11 +05:30
Srivats P
7ea8c96543 Populate Ack for every RPC
Also make error strings in Ack and RPC failure consistent
2019-02-16 20:38:25 +05:30
Srivats P
8b9cceb7ed HostDev: Return smac/dmac resolve failure via RPC 2019-02-09 17:16:31 +05:30
Srivats P
88b3c287d0 Track smac/dmac resolve failures when building packet list 2019-02-05 18:31:43 +05:30
Srivats P
2726192b9c HostDev: Print interfaceInfo for debug purposes 2019-01-15 19:07:55 +05:30
Srivats P
86150a7e46 HostDev: Create Host Device even if no IP is configured 2019-01-14 18:26:24 +05:30
Srivats P
bac7fba1de HostDev: Fix Win crash if a NIC doesn't have IP address 2019-01-14 18:10:47 +05:30
Srivats P
178b942d6e HostDev: Start/stop emulation based on no. of deviceGroups
Host Devices are included in deviceCount() but not in deviceGroupCount()
and emulation is not applicable to Host devices
2018-12-23 21:54:38 +05:30
Srivats P
7e476a8361 HostDev: Return QString to avoid accessing out of scope variable
errMsg used toLocal8Bit() which uses a temporary stack variable which
could go out of scope if the function is not inlined by compiler, so
avoid it by returning QString and use qPrintable
2018-12-23 21:50:46 +05:30
Srivats P
edd326fb24 HostDev: Refactor device list(s) ops
Use function(s) to hide the insertion/removal from multiple internal
lists
2018-12-23 21:49:21 +05:30
Srivats P
e6592c03a2 HostDev: Fix another bunch of FIXME/TODOs 2018-12-12 22:00:09 +05:30
Srivats P
112c3ff788 HostDev: Fix typo causing Linux build break 2018-12-11 21:27:57 +05:30
Srivats P
545f740676 HostDev: Fixed a bunch of FIXME/TODOs 2018-12-11 18:57:53 +05:30
Srivats P
12d6713491 Fix MacOS build break due to missing SA_SIZE definition 2018-12-10 18:00:00 +05:30