summaryrefslogtreecommitdiffhomepage
path: root/src/platform/linux.rs
Commit message (Collapse)AuthorAgeFilesLines
* 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-291-7/+11
|
* 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.
* platform: linux: add nftables support with iptables fallbackdilluti0n2025-10-031-11/+112
| | | | | | | | | | 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.
* platform: linux: split iptables helpers on bootstrap/cleanupdilluti0n2025-09-271-14/+25
|
* Refactor handle_packet to reuse external buffer for packet handlingdilluti0n2025-09-111-0/+4
| | | | This removes unnecessary allocations per packet handling.
* log: add splash! macro and centralize no-splash handlingdilluti0n2025-09-071-1/+3
| | | | | | | | | | | | | * 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`.
* Update copyright notices to notice email instead of github linkdilluti0n2025-09-051-1/+1
|
* Add license document and copyright notice headersdilluti0n2025-09-051-0/+17
|
* Tidy up LogLevel enum definitiondilluti0n2025-09-031-10/+10
| | | | | | * Remove: unused `Fatal` variant from `LogLevel`. * Update: comment on `Error` to indicate it represents unrecoverable errors.
* Refactor prefixed logs to using log.rs, leaving Errors untoucheddilluti0n2025-09-031-9/+10
|
* Add prefix [INFO] or [WARNNING] on log messagesdilluti0n2025-08-311-9/+9
|
* platform: linux: add verbose messages on bootstrapdilluti0n2025-08-311-3/+19
|
* platform: linux: unhardcode chain name DPIBREAKdilluti0n2025-08-311-7/+11
|
* platform: linux: decouple once_cellDilluti0n2025-08-231-6/+3
| | | | * Replace once_cell::Lazy with plain AtomicBool
* platform: linux: use standard library instead of once_cell on socketDilluti0n2025-08-231-3/+4
|
* platform: linux: make iptables helpers privateDilluti0n2025-08-231-5/+5
|
* Simplify signal handling with global AtomicBoolDilluti0n2025-08-231-3/+4
| | | | | | | * 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.
* Add command-line argument parsing and switch config to OnceLockhskim2025-08-231-4/+9
| | | | | | | | | | | 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.
* Wrap platform dependant main loops to platform::runhskim2025-08-221-0/+53
|
* platform: linux: provide more detailed error message for iptableshskim2025-08-201-7/+11
| | | | It was none readable before.. like (Err: No such file)
* refactor: add error propagation to send_to_rawdilluti0n2025-08-061-7/+8
| | | | | | | * 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!`.
* refactor: Unified all error types in the project to anyhow::Errordilluti0n2025-08-061-13/+12
| | | | | | | | 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<>
* minor: move platform-specific codes to seperate filesdilluti0n2025-08-061-0/+159