| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | |
|
| |
|
|
| |
* Replace once_cell::Lazy with plain AtomicBool
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
* 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::.
|
| |
|
|
|
|
| |
* Remove nested TLSMsg::new() invocation.
* Introduce fragment variable for readability.
* Simplify control flow by flattening record parsing.
|
| |
|
|
|
|
|
| |
* 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.
|
| | |
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
Extracted common args.next() + parse logic into take_value() to remove
duplication in --delay-ms and --queue-num handling.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
- 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
|
| |
|
|
| |
It was none readable before.. like (Err: No such file)
|
| | |
|
| |
|
|
|
|
|
| |
- 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
|
| |
|
|
| |
revert me when use TLSMsg::get_vector
|
| |
|
|
|
|
|
| |
* 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
|
| | |
|
| |
|
|
| |
somewhat it works now... why?
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
* important: it works !!
|
| |
|
|
|
|
|
|
|
| |
* 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
|
| | |
|
| | |
|
| |
|
|
|
|
| |
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().
|
| | |
|
| | |
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
| |
* implement: get_tcp_payload, parse tcp payload from given ip payload
(seems like does not work well...)
|
| |
|
|
| |
filter clienthello packet
|