summaryrefslogtreecommitdiffhomepage
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Consolidate setup logic into run()dilluti0n2026-02-153-3/+16
| | | | | | | | | | | The bootstrap/run separation was unnecessary. Move all initialization (cleanup + nftables setup): into run() and skip bootstrap in daemon mode. We repurpose the bootstrap() function to only run in non-daemon mode for future foreground-only initialization. - Add OPT_DAEMON option to detect daemon mode - Move cleanup() and install_rules() from bootstrap() to run() - Make bootstrap() a no-op (only called in non-daemon mode)
* opt: refactor to detach parse_args and set_optdilluti0n2026-02-153-88/+112
|
* windows: implement windows servicedilluti0n2026-02-151-3/+42
| | | | | | | | | Revert lock_handle() send_to_raw cannot get a mutex since lock is not released per iteration. commit e08b57d281d8368dc02f06e3b6cd43edf88b2438
* linux: implement daemonizedilluti0n2026-02-153-10/+45
| | | | | Closes: #2 Link: https://github.com/dilluti0n/dpibreak/issues/2
* opt: add option -D, --daemondilluti0n2026-02-141-0/+18
|
* opt: add implicit dependancy between --fake-* and --fakedilluti0n2026-01-311-3/+3
| | | | Now --fake-* options implicitly turn on --fake option.
* pkt: fake: adjust autottl_delta to 1dilluti0n2026-01-231-1/+1
|
* pkt: remove pub on internal codesdilluti0n2026-01-231-8/+8
|
* Add benchmark for pkt/hoptab, add feature bench for internal benchesdilluti0n2026-01-231-0/+35
|
* pkt: hoptab: add testsdilluti0n2026-01-231-0/+140
|
* pkt: hoptab: implement priority-based evictiondilluti0n2026-01-231-35/+120
| | | | | | | | | | | | | | | | | - Introduce `EvictPriority` enum. - Optimize `is_stale` and `evict_priority` by passing entry references to eliminate redundant memory loads. pkt: hoptab: derive stale age from CAP Replace the magic `64` threshold with `STALE_AGE = CAP >> 1` and make the stale check inclusive (`age >= STALE_AGE`). This keeps the eviction/staleness policy consistent when CAP changes and documents the intended half-table age cutoff. pkt: hoptab: add compile time assertion for CAP pkt: hoptab: add comments
* pkt: hoptab: fix find_hop occupancy checkdilluti0n2026-01-231-3/+49
| | | | | Use ST_OCCUPIED instead of ST_EMPTY to avoid skipping valid entries; add debug logs
* pkt: fake: implement infer_hopsdilluti0n2026-01-231-2/+15
|
* pkt: implement hop cache for --fake-autottldilluti0n2026-01-233-15/+286
| | | | | | | | | - add pkt::hoptab: small fixed-size hash table keyed by IP (v4-mapped/v6) with TTL-based staleness + simple eviction - store (src_ip -> inferred hop) on SYN/ACK from :443 - lookup (dst_ip -> hop) when crafting fake ClientHello, fallback to --fake-ttl on miss - add PktView helpers: ttl(), saddr(), daddr()
* pkt: move fake ClientHello logic into pkt::fake moduledilluti0n2026-01-232-85/+121
|
* pkt: add SYN/ACK(443) detection hook for fake-autottldilluti0n2026-01-231-0/+17
|
* windows: extend WinDivert filter for --fake-autottldilluti0n2026-01-232-6/+19
| | | | | | | Build WinDivert filter at runtime: - Default: outbound TLS ClientHello packets - --fake-autottl: also capture inbound SYN/ACK from tcp sport 443 Keep !impostor to avoid recapture.
* linux: iptables: implement SYN/ACK capture on --fake-autottldilluti0n2026-01-231-0/+19
| | | | | | - Add mangle/INPUT jump to DPIBREAK - Queue tcp sport 443 SYN/ACK packets (NFQUEUE --queue-bypass) - Cleanup removes INPUT jump as well
* linux: nftables: queue SYN/ACK on --fake-autottldilluti0n2026-01-231-0/+59
| | | | - simplify nftables rules by removing DPIBREAK chain
* opt: add option --fake-autottldilluti0n2026-01-231-7/+18
|
* linux: refactor rules backend into iptables/nftables modulesdilluti0n2026-01-233-301/+310
| | | | | | | Split iptables and nftables rule management into dedicated modules. Keep linux.rs focused on shared helpers and rule dispatch. (cherry picked from commit 60c0011ca0cf5a463056fca17f2f747e762e19f9)
* platform: drop pub on internal constdilluti0n2026-01-221-2/+2
|
* linux: drop iptables crate (regex dep) to reduce binary sizedilluti0n2026-01-181-23/+75
| | | | Introduce minimal iptables wrapper.
* opt: change default release log level to Warning as expecteddilluti0n2026-01-161-1/+1
|
* pkt: add debug_assertions to prevent cargo warningsdilluti0n2026-01-161-1/+3
|
* opt: deprecate `--loglevel` in favor of `--log-level`dilluti0n2026-01-161-3/+13
|
* opt: set default opts to DEFAULT_* to centralize init & usage outputdilluti0n2026-01-161-36/+46
|
* opt: use DEFAULT_LOG_LEVEL in arg parserdilluti0n2026-01-161-4/+1
| | | | | Initialize log_level from DEFAULT_LOG_LEVEL instead of duplicated cfg(debug_assertions) branches in parse_args_1().
* opt: fix OPT_LOG_LEVEL not initialized panicdilluti0n2026-01-161-2/+4
|
* opt: add comment for OPT_LOG_LEVEL initialize seqdilluti0n2026-01-161-0/+1
|
* Refactor main.rs; modulize opt.rs and pkt.rsdilluti0n2026-01-165-269/+283
| | | | | Move option parsing to opt.rs and packet handling to pkt.rs from main.rs
* pkt: support overriding TCP checksum (badsum) in split_packet_0dilluti0n2026-01-162-12/+38
| | | | | | - Extend split_packet_0 to optionally override TCP checksum. - Compute L3 header length for IPv4/IPv6 and patch checksum field when requested. - Wire fake_clienthello to set checksum to 0 when fake_badsum() is enabled.
* windows: do not recalculate tcp checksum when send_to_rawdilluti0n2026-01-161-3/+3
| | | | For --fake-badsum work; Anyway, it is already calculated
* Add option --fake-badsumdilluti0n2026-01-142-0/+9
|
* Fix option --fake did not do anythingdilluti0n2026-01-051-2/+8
| | | | Fake was enabled by default.....
* Normalize option handling and OPT_* namingdilluti0n2025-12-302-16/+27
| | | | Log runtime options on startup
* Add fake ClientHello injection runtime optionsdilluti0n2025-12-302-3/+20
| | | | | - Add --fake flag to enable fake ClientHello injection - Add --fake-ttl option to override TTL of fake packets
* Consolidate fake ClientHello and split packet logicdilluti0n2025-12-302-35/+44
| | | | Introduce send_segment abstraction
* Prevent infinite loop on packet injection/filteringdilluti0n2025-12-303-6/+43
| | | | | - linux: fix infinite NFQUEUE loop by marking injected packets - windows: by marking packet to impostor
* Implement fake ClientHello injection with const TTLdilluti0n2025-12-302-42/+83
|
* Add dummy tls clienthello packetdilluti0n2025-12-301-0/+63
|
* linux: extract process execution into `exec_process` helperdilluti0n2025-12-291-17/+29
| | | | | | | | Introduce exec_process() to handle external command execution, stdin piping, and error reporting. Now cleanup() and apply_nft_rules() call exec_process() to call modprobe, nft respectively. This improves error handling for cleanup xt_u32.
* linux: ignore cleanup errors at startupdilluti0n2025-12-221-7/+3
| | | | | Do not log errors if cleanup fails during startup. Retain error logging for cleanup failures on shutdown.
* linux: switch to apply_nft_rules() from nftables-rs for rule settingdilluti0n2025-10-291-18/+13
| | | | | nftables-rs didn’t fit use case, so it was decoupled, and logging was improved.
* linux: implement apply_nft_rules() to log output sanelydilluti0n2025-10-291-0/+30
|
* linux: add option `--nft-command`dilluti0n2025-10-292-10/+23
|
* windows: avoid ERR_INVALID_NAME when uninstalling WinDivertdilluti0n2025-10-061-2/+9
| | | | | | | `CloseAction::Uninstall` triggers ERROR_INVALID_NAME (0x8007007B) on Windows, likely due to the crate passing a non–NUL-terminated "WinDivert" string to `OpenServiceA`. For now, skip uninstallation and just close the handle normally. Added a FIXME comment with details.
* platform: windows: close handle and uninstall driver sanelydilluti0n2025-10-061-9/+19
|
* platform: windows: only divert clienthello packet to userspacedilluti0n2025-10-032-2/+4
|
* platform: linux: filter only TLS ClientHello packets on nftablesdilluti0n2025-10-031-0/+21
| | | | | | | | Add additional nftables match expressions to detect TLS records (ContentType 0x16 = Handshake): and specifically ClientHello (HandshakeType 0x01):. Packets matching this pattern are queued to NFQUEUE. Mark xt_u32 as supported when nftables filtering is successfully applied.