Skip to content

Commit d749da2

Browse files
committed
Add some features to allow for best performance.
1 parent 5cf4dc5 commit d749da2

3 files changed

Lines changed: 348 additions & 167 deletions

File tree

src/constants.h

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,34 @@
11
#pragma once
22

3+
// The max packet length. This shouldn't be changed unless you know what you're doing.
4+
#define MAX_PCKT_LEN 0xFFFF
5+
6+
// The maximum amount of threads to support for sequences. 4096 should be enough I think... (lol)
7+
#define MAX_THREADS 4096
8+
9+
// The maximum length of a name (e.g. device name).
10+
#define MAX_NAME_LEN 64
11+
12+
// Enables AF_XDP socket support (required for now since we have no other techs \o/).
313
#define ENABLE_AF_XDP
414

515
// WARNING: Experimental
616
// When defined, the AF_XDP socket's UMEM frame buffers doesn't get the packet buffer copied to it after the first time. This should technically result in better throughput due to reduced memory copying, but only would work for completely static packets.
717
// #define AF_XDP_NO_REFILL_FRAMES
818

19+
// The default config path to parse.
920
#define CONF_PATH_DEFAULT "/etc/pcktbatch/conf.json"
1021

11-
// #define CONF_UNLOCK_RLIMIT
22+
// If defined, the program will attempt to raise the stack limit. This shouldn't be needed, but wanted to include just in case.
23+
// #define CONF_UNLOCK_RLIMIT
24+
25+
// If defined, the program uses a much more randomized seed by retrieving random bytes from `/dev/urandom`.
26+
// This results in more randomness with each packet, but adds a bit more overhead.
27+
// #define VERY_RANDOM
28+
29+
// If defined, if we only detect a single static packet being sent, we skip a lot of unnecessary steps.
30+
#define SEQUENCE_USE_STATIC_PKT
31+
32+
// If defined, attempts to generate the most amount of packets per second by sending single empty packets (of any of the protocols) with static packets.
33+
// All checks are also skipped including limits such as time, max packets, packet rates, etc. This is to achieve max throughput possible.
34+
// #define SEQUENCE_MAX_PERFORMANCE

0 commit comments

Comments
 (0)