Christian Deacon
1f1c76854b
Improve generic code.
2025-02-22 21:31:45 -05:00
Christian Deacon
fd765890e9
Rename loader.c to prog.c for organization.
2025-02-22 11:50:13 -05:00
Christian Deacon
e3b1f04c11
Organize cmdline util.
2025-02-22 11:41:48 -05:00
Christian Deacon
09491e1462
Add typedefs and organize code.
2025-02-22 10:24:21 -05:00
Christian Deacon
1b9e805207
Organize more code.
2025-02-22 10:06:32 -05:00
Christian Deacon
c7a1822ce5
Rename some config constants.
2025-02-22 10:05:49 -05:00
Christian Deacon
50b0efa58a
Add note about linked objects not working with __always_inline functions.
2025-02-22 10:02:35 -05:00
Christian Deacon
8756892791
Restructure project and organize code.
2025-02-22 09:50:57 -05:00
Christian Deacon
e3d47fda6f
Oops, fix error with USE_FLOW_RL commented.
2025-02-11 08:19:51 -05:00
Christian Deacon
376b39d307
No need to pass ip_stats to function.
2025-02-11 08:17:20 -05:00
Christian Deacon
82d3c50bf3
Add flow-based client stats by default for rate limits and organize/clean code.
2025-02-11 07:51:40 -05:00
Christian Deacon
91138f1116
Add IPv4 CIDR support and clean up code.
2024-08-13 02:55:01 -04:00
Christian Deacon
62c610f577
Decrease max filters from 80 to 60.
2024-07-15 21:44:13 -04:00
Christian Deacon
a53e01d0fe
Set interface option to NULL by default.
2024-06-13 20:36:23 -04:00
Christian Deacon
f480f06c4b
Rename config settings for consistency.
2024-06-13 20:33:09 -04:00
Christian Deacon
a80458efff
Uncomment DOSTATSONBLOCKMAP by default.
2024-06-13 20:24:40 -04:00
Christian Deacon
525b9465cf
Add std_update_time option.
2024-06-13 20:03:21 -04:00
Christian Deacon
bbacda45b3
Add pass counter for packets that don't match any rules and are passed to user-space.
2024-06-13 19:54:50 -04:00
Christian Deacon
648dbff479
Use unlikely() again.
2024-06-13 19:30:16 -04:00
Christian Deacon
1dad5509a4
Use unlikely with checking layer-4 headers.
2024-06-13 19:29:50 -04:00
Christian Deacon
e213b5c231
Rework PPS/BPS logic to improve performance.
2024-06-13 19:27:56 -04:00
Christian Deacon
1f66f7ab4e
Add NANO_TO_SEC constant.
2024-06-13 19:23:54 -04:00
Christian Deacon
69f7456423
Align filters structure by 8 bytes to per-CPU map.
2023-12-12 23:38:57 +00:00
Christian Deacon
b3530e3e68
Use per CPU array map for filter rules to increase performance.
2023-11-12 21:35:22 +00:00
Christian Deacon
c12496abb6
Lower MAX_FILTERS to 80 to fix error related to BPF program too large.
2023-10-11 22:05:30 +00:00
Christian Deacon
d5fe99c69a
XDP tools already defines bpf_printk() now.
2023-06-19 19:12:38 +00:00
Christian Deacon
c27398ecec
Indent code properly for neatness.
2023-06-19 19:11:42 +00:00
Christian Deacon
d088b4b157
Implement support for LibXDP and improve code.
2023-06-06 21:20:19 +00:00
Christian Deacon
8fbab9bf82
Decrease max filters to 90 due to stricter kernel limitations.
2023-05-15 18:27:56 +00:00
Phil
7b577e9548
Optimizing main loop ( #35 )
...
* Mem leak fix
Memleak fix for strdup()
* Typo fix
forgot ;
* Optimizing Main Loop
Filtersmap will only be updated if there is a newer version of our config.
* Include sys/stat.h
* Added myself in the credits
Thanks for the trust
2023-01-21 17:18:11 -05:00
Phil
48b52ae645
strdup() mem leak fix ( #33 )
...
* Mem leak fix
Memleak fix for strdup()
* Typo fix
forgot ;
2023-01-18 11:44:29 -06:00
gamemann
93a9fc96ff
Define and use memcpy() in XDP program itself for optimization.
2022-09-08 04:03:08 +00:00
gamemann
96d8a7079f
Use memcpy() to simplify and optimize code.
2022-09-07 09:24:09 +00:00
gamemann
8a77f1d4ec
Add IPv6 addresses to list menu.
2022-08-27 16:17:29 +00:00
gamemann
1c41ac296b
Add TCP ECE and CWR flags support.
2022-08-27 15:56:29 +00:00
gamemann
4c3f6950f9
Make help menu cleaner.
2022-08-27 15:37:29 +00:00
gamemann
3810a3695e
Count PPS/BPS values themselves when matching.
2022-08-27 15:27:07 +00:00
gamemann
2a41af6be2
Fix max length/TTLs.
2022-08-27 15:26:22 +00:00
gamemann
6092ca3337
Add correct line breaks into help menu.
2021-12-15 20:51:50 +00:00
gamemann
5012fc9ff8
Add time flag for how long to run the program for.
2021-12-15 20:51:23 +00:00
gamemann
21b15badf6
Allocate stats with MAX_CPUS and check for NULL index to attempt to fix seg fault on issue #10 .
2021-12-06 16:54:20 +00:00
gamemann
3ebb0a763b
We don't need to pass using reference.
2021-12-06 16:38:47 +00:00
gamemann
ef996a6596
Check BPF stats map lookup result.
2021-12-06 16:37:39 +00:00
gamemann
0dac160065
Remove stdint.h include since it's not needed inside of BPF program.
2021-11-16 00:35:57 +00:00
gamemann
7964f8986a
Move defines to header file for XDP program.
2021-11-16 00:33:30 +00:00
gamemann
e56a8e64ec
Remove linux/types.h include from BPF program.
2021-11-16 00:32:25 +00:00
gamemann
7c061a2570
Include Linux types in XDP program.
2021-11-13 01:14:17 +00:00
gamemann
ed89cfed28
Only set ifindex in attributes if hardware offload is set.
2021-11-12 21:23:44 +00:00
gamemann
d9d6167b4b
Add one more check.
2021-11-12 21:14:20 +00:00
gamemann
fe09dece3a
Check IP header validity everywhere else.
2021-11-12 21:12:50 +00:00