| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
Move option parsing to opt.rs and packet handling to pkt.rs from
main.rs
|
| |
|
|
|
|
| |
- 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.
|
| | |
|
| |
|
|
| |
Fake was enabled by default.....
|
| |
|
|
| |
Log runtime options on startup
|
| |
|
|
|
| |
- Add --fake flag to enable fake ClientHello injection
- Add --fake-ttl option to override TTL of fake packets
|
| |
|
|
| |
Introduce send_segment abstraction
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
* Extracted: repeated split/send/sleep logic from `handle_packet` into
new `split_packet_1` function for clarity and reuse.
* Simplifies: `handle_packet` by replacing manual steps with a single
call.
|
| |
|
|
| |
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`.
|
| | |
|
| | |
|
| |
|
|
| |
* Use: Cargo.toml inside on program
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Introduce: `DEFAULT_LOG_LEVEL` and `LOG_LEVEL_OVERRIDE` (OnceLock)
in log.rs.
* Add: `set_log_level()` and `current_log_level()`; gate defaults by
`debug_assertions`.
* Implement: `FromStr` for `LogLevel` with a proper error
type (`ParseLogLevelError`).
* Update: `log_println!` to respect `current_log_level()` and use
`format_args!`.
* Extend: CLI: `--loglevel <debug|info|warning|error>` and reflect it
in `usage()`.
* Replace: ad-hoc prints with `log_println!` and plumb parsed level
into `set_log_level`.
|
| |
|
|
|
|
| |
* Remove: unused `Fatal` variant from `LogLevel`.
* Update: comment on `Error` to indicate it represents unrecoverable
errors.
|
| |
|
|
|
|
|
|
|
| |
* Set: `LOG_LEVEL` to `Debug` in debug builds and `Warning` in release
builds via `#[cfg(debug_assertions)]`.
* Replace: direct `println!` calls with `log_println!` for packet
handling, warning messages, and argument parsing errors.
* Ensures: consistent log formatting and respects the global log level
configuration across the codebase.
|
| |
|
|
|
|
|
|
|
| |
Introduce `EnsureCleanup` struct with a `Drop` implementation that
calls `platform::cleanup()`. This guarantees cleanup is always
performed after a successful bootstrap, regardless of how execution
exits. Error handling is centralized in `main()`, where errors are
logged once with their cause chain, and the process exits with the
appropriate status code.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
* 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
|
| | |
|
| |
|
|
|
|
|
| |
- 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?
|
| | |
|
| | |
|
| | |
|
| | |
|