| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
UAC elevation spawns a new console that closes when the process
exits, cutting off --help output and error messages. Add a pause
on Windows-only exit paths via _getch().
|
| |
|
|
|
| |
Previously checked `argv == "--loglevel"` by mistake, copied from the
--loglevel deprecation pattern. Now correctly checks `argv == "-D"`.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Replace hardcoded [0,1] split with send_split accepting &[Segment].
Segments exceeding payload length are warned and skipped. Add Segment
type to opt.rs with Display/Debug showing [start,end) notation.
|
| |
|
|
|
|
| |
Parse comma-separated split points into sorted segment ranges as
(start, end): pairs. Display shows original input with computed
ranges, e.g. "5,1,0,3 ([5,end), [1,3), [0,1), [3,5))".
|
| |
|
|
|
|
|
| |
SegmentOrder parses a comma-separated list of u32 split points, sorts
them, and precomputes segment ranges as (start, end) pairs for use in
send_split. The original input string is retained for Display. Parsing
logic is unimplemented and will follow in the next commit.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
set_opt() was logging each option as it set them, which created a
tight coupling between option initialization and log output timing.
This was particularly problematic for daemon mode: daemonize must
happen after set_opt() (to know whether -D was passed) but before
logging (so output goes to the log file, not stdout).
Split into set_opt() -> InitializedOpts and InitializedOpts::log(),
using a typestate pattern to enforce at compile time that log() cannot
be called before set_opt(). This lets each platform's bootstrap()
handle daemonization between the two steps:
let initialized = opt.set_opt()?;
platform::bootstrap()?; // daemonize here if needed
initialized.log(); // now safe to log
Also:
- Move daemonize_1() into platform::bootstrap() on both platforms
- Make daemonize_1() / service_main() private to their platform modules
- Fix the long-standing TODO about using log_println in daemonize()
|
| |
|
|
|
|
|
|
|
|
|
| |
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)
|
| | |
|
| |
|
|
|
| |
Closes: #2
Link: https://github.com/dilluti0n/dpibreak/issues/2
|
| | |
|
| |
|
|
| |
Now --fake-* options implicitly turn on --fake option.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Initialize log_level from DEFAULT_LOG_LEVEL instead of duplicated
cfg(debug_assertions) branches in parse_args_1().
|
| | |
|
| | |
|
|
|
Move option parsing to opt.rs and packet handling to pkt.rs from
main.rs
|