| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
Prevent multiple non-daemon dpibreak instances using flock(). Show
existing PID on conflict and maintain lock until process termination.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
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)
|
| | |
|
| |
|
|
|
|
|
|
|
| |
Revert lock_handle()
send_to_raw cannot get a mutex since lock is not released per
iteration.
commit e08b57d281d8368dc02f06e3b6cd43edf88b2438
|
| |
|
|
|
| |
Closes: #2
Link: https://github.com/dilluti0n/dpibreak/issues/2
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
- Add mangle/INPUT jump to DPIBREAK
- Queue tcp sport 443 SYN/ACK packets (NFQUEUE --queue-bypass)
- Cleanup removes INPUT jump as well
|
| |
|
|
| |
- simplify nftables rules by removing DPIBREAK chain
|
| |
|
|
|
|
|
| |
Split iptables and nftables rule management into dedicated modules.
Keep linux.rs focused on shared helpers and rule dispatch.
(cherry picked from commit 60c0011ca0cf5a463056fca17f2f747e762e19f9)
|
| |
|
|
| |
Introduce minimal iptables wrapper.
|
| |
|
|
|
| |
Move option parsing to opt.rs and packet handling to pkt.rs from
main.rs
|
| |
|
|
| |
For --fake-badsum work; Anyway, it is already calculated
|
| |
|
|
| |
Log runtime options on startup
|
| |
|
|
|
| |
- linux: fix infinite NFQUEUE loop by marking injected packets
- windows: by marking packet to impostor
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
Do not log errors if cleanup fails during startup.
Retain error logging for cleanup failures on shutdown.
|
| |
|
|
|
| |
nftables-rs didn’t fit use case, so it was decoupled, and logging was
improved.
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
`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.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
Introduce nftables rules under a dedicated "dpibreak" table and
chain. Traffic on TCP port 443 is queued using NFQUEUE. If nftables
is not supported, fall back to the existing iptables-based rules
for both IPv4 and IPv6.
Also update cleanup logic to remove nftables table if used, or
iptables rules otherwise.
|
| | |
|
| |
|
|
| |
This removes unnecessary allocations per packet handling.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* Introduce: `splash!` macro in `log.rs` to print startup messages
conditionally, based on `--no-splash` flag.
* Move: `NO_SPLASH` management into `log.rs` with helper
functions: (`set_no_splash`, `no_splash`).
* Remove: old `splash()` function in `main.rs` and replace with
`splash!` macro usage.
* Set: default `LogLevel` according to build profile (Debug → Debug,
Release → Warning).
* Print: unified startup messages across Linux and Windows, including
`MESSAGE_AT_RUN`.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
* Remove: unused `Fatal` variant from `LogLevel`.
* Update: comment on `Error` to indicate it represents unrecoverable
errors.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Define the TCP:443 outbound filter as a constant and reuse it in
WinDivert::network. Add a log message when the handle is successfully
constructed for better visibility during runtime.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
* Replace once_cell::Lazy with plain AtomicBool
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
* Remove Arc<AtomicBool> indirection and introduce global RUNNING.
* Rename plant_handler() to trap_exit() for clarity.
* Update run() implementations on Linux and Windows to use RUNNING directly.
* Drop unused imports in main.rs, linux.rs, and windows.rs.
|
| |
|
|
|
|
|
|
|
|
|
| |
This change introduces basic CLI parsing for --delay-ms,
--queue-num (Linux only), and -h/--help. A usage() function was added,
and error/help output now goes to stdout for consistency.
Global constants DELAY_MS and QUEUE_NUM are replaced with
OnceLock-based initialization, with helper accessors delay_ms() and
queue_num(). The Linux platform code is updated accordingly to use
queue_num() instead of a constant.
|
| | |
|
| |
|
|
| |
It was none readable before.. like (Err: No such file)
|
| |
|
|
|
|
|
| |
* Extracted: `handle_packet!` macro to deduplicate match logic in both
Linux and Windows backend.
* Changed: `send_to_raw()` to return Result and propagate errors with
`anyhow!`.
|
| |
|
|
|
|
|
|
| |
Configured incompatible iptables errors to be propagated using
map_err into the anyhow type
* refactored: split_packet and handle_packet to return Result<>
instead of Option<>
|
| |
|
|
|
|
|
| |
modify to have a simmilar flow with windows build
* change ordering
* debug messages
|
| |
|