summaryrefslogtreecommitdiffhomepage
Commit message (Collapse)AuthorAgeFilesLines
...
* Decouple once_cell by replacing it with standard libDilluti0n2025-08-233-11/+2
|
* 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
|
* Make platform and TLS imports explicitDilluti0n2025-08-231-8/+8
| | | | | | | | * Remove: wildcard import from platform and top-level TLSMsg import. * Add: local use of TLSMsg inside is_client_hello(). * Add: local use of send_to_raw() inside handle_packet(). * Qualify: IS_U32_SUPPORTED, QUEUE_NUM, bootstrap(), run(), and cleanup() with platform::.
* Clean up is_client_hello() for clarityDilluti0n2025-08-231-12/+11
| | | | | | * Remove nested TLSMsg::new() invocation. * Introduce fragment variable for readability. * Simplify control flow by flattening record parsing.
* Simplify signal handling with global AtomicBoolDilluti0n2025-08-233-17/+18
| | | | | | | * 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.
* Wrap planting handler to plant_handlerdilluti0n2025-08-231-9/+12
|
* Clear output buffer before writing in split_packethskim2025-08-231-2/+1
| | | | | | | Previously split_packet used truncate() after writing, which could leave stale data from earlier writes. This patch calls clear() before builder.write() to ensure the buffer only contains the current packet contents.
* Add command-line argument parsing and switch config to OnceLockhskim2025-08-232-26/+65
| | | | | | | | | | | 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.
* Deduplicate CLI argument parsinghskim2025-08-231-7/+22
| | | | | Extracted common args.next() + parse logic into take_value() to remove duplication in --delay-ms and --queue-num handling.
* Implement argument parserhskim2025-08-231-1/+21
|
* Wrap platform dependant main loops to platform::runhskim2025-08-223-66/+77
|
* Fix Message too long warning on send_to_rawdilluti0n2025-08-211-4/+1
|
* Remove unused field PktView.rawdilluti0n2025-08-211-2/+1
|
* Move use derivativesdilluti0n2025-08-211-2/+5
|
* Optimize split_packet to reuse caller-provided bufferdilluti0n2025-08-211-8/+16
| | | | | | | | - Change split_packet to take &mut Vec<u8> instead of returning Vec<u8> - Avoids allocating a new buffer for each split - Reserve additional capacity only when needed - Update handle_packet to reuse a single buffer across multiple calls - Add TODO for reusing IP header without extra copy
* platform: linux: provide more detailed error message for iptableshskim2025-08-201-7/+11
| | | | It was none readable before.. like (Err: No such file)
* Split TLS parsing into tls.rshskim2025-08-202-48/+53
|
* Introduce PktView to remove duplicate packet parsinghskim2025-08-202-14/+27
| | | | | | | - Added new `pkt.rs` with `PktView` struct wrapping `IpSlice` and `TcpSlice` - Updated `split_packet` and `handle_packet` to use `PktView` - Removed repeated calls to `IpSlice::from_slice` / `TcpSlice::from_slice` - Simplifies code and ensures parsing happens only once per packet
* chore: remove unused function get_vector (dead_code)dilluti0n2025-08-061-14/+0
| | | | revert me when use TLSMsg::get_vector
* refactor: add error propagation to send_to_rawdilluti0n2025-08-063-32/+42
| | | | | | | * 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-063-44/+46
| | | | | | | | 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<>
* build: add log for non-windows builddilluti0n2025-08-061-0/+1
|
* build: move windows app.manifest to res/app.manifest from build.rsdilluti0n2025-08-061-12/+1
|
* build: use winres to add manifest for windows binarydilluti0n2025-08-064-3/+75
|
* minor: remove handle_msg rapperdilluti0n2025-08-062-22/+19
| | | | | | | modify to have a simmilar flow with windows build * change ordering * debug messages
* minor: move platform-specific codes to seperate filesdilluti0n2025-08-064-205/+209
|
* fix: to use same windivert handle for recv/senddilluti0n2025-08-061-35/+21
| | | | somewhat it works now... why?
* minor: set WINDIVERT_PATH for windows builddilluti0n2025-08-064-1/+6
|
* implement: not-working framework for windowsdilluti0n2025-08-063-8/+58
|
* fix: windows build errorsdilluti0n2025-08-062-8/+16
|
* starting windows implementationdilluti0n2025-07-271-0/+17
|
* refactor: repeated queue number not to use magicdilluti0n2025-07-271-11/+13
|
* refactor: handle_packet to not depend on nfqdilluti0n2025-07-271-27/+34
|
* refactor: move platform-dependent code to mod platformdilluti0n2025-07-273-173/+312
|
* refactor: bootstrap and cleanup to support ip6tablesdilluti0n2025-07-261-6/+26
|
* fix: prevent possable array indexing panic on is_client_hellodilluti0n2025-07-241-1/+4
|
* revert ctrlc to override default SIGINT handlerdilluti0n2025-07-223-2/+41
|
* feat: poll NFQUEUE socket instead sleep on main loopdilluti0n2025-07-223-56/+30
| | | | | | | | | | The main motivation for using poll + recv (even with a single FD) is that blocking recv() is not interrupted by SIGINT, likely due to SA_RESTART being enabled by default. On the other hand, poll() is always interruptible by signals regardless of SA_RESTART. Instead of manually configuring sigaction in Rust, using poll here is simpler and more reliable.
* implement: send_to_raw; open raw socket and sendto it!dilluti0n2025-07-213-2/+65
| | | | * important: it works !!
* feat: Add TLS ClientHello splitting(TCP/IP) logic using etherparsedilluti0n2025-07-213-23/+94
| | | | | | | | | * Introduced `etherparse` and `arrayvec` dependencies to parse and reconstruct IP/TCP packets * Replaced legacy TCP payload extraction with robust parsing via `IpSlice` and `TcpSlice` * Added `split_packet` to split TCP payloads and reconstruct headers * Added stub `send_to_raw` function to transmit custom-crafted packets (implementation pending) * Modified `handle_packet` to detect ClientHello and perform split+delay packet transmission * Improved xt_u32 fallback logic and control flow using early returns and internal closure
* change: treat IS_U32_SUPPORTED to more rubust waydilluti0n2025-07-201-1/+5
|
* feat: add xft_u32 filtering for clienthello packetdilluti0n2025-07-203-12/+77
|
* refactor: is_client_hello and TLSMsg::get_bytesdilluti0n2025-07-201-23/+9
| | | | | | is_client_hello now passes the record's fragment field up to the end of the payload. TLSMsg::get_bytes now returns None if size exceeds payload.len().
* minor: add TODOs on main.rsdilluti0n2025-07-201-0/+2
|
* fix: when get_tcp_payload fails, pass the packet sanelydilluti0n2025-07-201-6/+6
|
* fix: handle fragmented TCP packet on TLSMsg::get_bytesdilluti0n2025-07-201-0/+1
| | | | | | Since we only interested in header, not robust parsing, full TCP reassembly isn't nece: Just prevent panic when the payload is shorter than expacted.
* refactor: try not to use tokio only for signal handlingdilluti0n2025-07-203-239/+83
| | | | | * implement: get_tcp_payload, parse tcp payload from given ip payload (seems like does not work well...)
* implement: TLS clienthello parserdilluti0n2025-07-191-3/+101
| | | | filter clienthello packet