summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md2
-rw-r--r--dpibreak.1.in4
-rw-r--r--dpibreak.1.md10
-rw-r--r--src/opt.rs14
-rw-r--r--src/pkt.rs2
5 files changed, 17 insertions, 15 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index beba949..070ba8b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,8 @@
### Added
- Option `-o, --segment-order`: configure segment boundaries and
transmission order of the TLS ClientHello. (#20)
+- Short option `-t` and `-a` for `--fake-ttl` and `--fake-autottl`,
+ respectively.
- Short option `-d` for `--daemon`, deprecating `-D` (will be removed
on v1.0.0).
diff --git a/dpibreak.1.in b/dpibreak.1.in
index 4d99dfa..76b9c45 100644
--- a/dpibreak.1.in
+++ b/dpibreak.1.in
@@ -71,14 +71,14 @@ override it using the
options described below. Packets are transmitted in an interleaved
order: (fake 1), (orig 1), (fake 2), (orig 2), ...
.TP
-.B \-\-fake\-ttl \fI<u8>\fR
+.BR \-t ", " \-\-fake\-ttl " \fI<u8>\fR"
Override ttl (IPv4) / hop_limit (IPv6) of
.B fake
packet. Implicitly enables
.BR \-\-fake .
(Default: {{DEFAULT_FAKE_TTL}})
.TP
-.B \-\-fake\-autottl
+.BR \-a ", " \-\-fake\-autottl
Automatically infer the hop count (TTL/Hop Limit) to the destination by
analyzing the SYN/ACK packet. It assumes the server's initial TTL is
either 64, 128, or 255. The inferred value is used for
diff --git a/dpibreak.1.md b/dpibreak.1.md
index 2728b3b..ceb44a9 100644
--- a/dpibreak.1.md
+++ b/dpibreak.1.md
@@ -38,14 +38,14 @@ This only applies to TLS-based connections (HTTPS). UDP/QUIC (**RFC**
## OPTIONS
-**-D**, **--daemon**
+**-d**, **--daemon**
Run as a background daemon. Logs are written to
**/var/log/dpibreak.log.** If a daemon is already running, it will fail
with "unable to lock pid file". To stop it, run **kill \`cat
/run/dpibreak.pid\`** as root.
On Windows, this option enters the service controller entry point.
-Example: **sc create dpibreak binPath= "dpibreak.exe -D" start= auto; sc
+Example: **sc create dpibreak binPath= "dpibreak.exe -d" start= auto; sc
start dpibreak**
**--delay-ms *\<u64\>***
@@ -60,11 +60,11 @@ override it using the **--fake-\*** options described below. Packets are
transmitted in an interleaved order: (fake 1), (orig 1), (fake 2), (orig
2), ...
-**--fake-ttl *\<u8\>***
+**-t**, **--fake-ttl** *\<u8\>*
Override ttl (IPv4) / hop_limit (IPv6) of **fake** packet. Implicitly
enables **--fake**. (Default: 8)
-**--fake-autottl**
+**-a**, **--fake-autottl**
Automatically infer the hop count (TTL/Hop Limit) to the destination by
analyzing the SYN/ACK packet. It assumes the server's initial TTL is
either 64, 128, or 255. The inferred value is used for **fake** packet
@@ -124,7 +124,7 @@ Run with default options:
Run as daemon with fake ClientHello injection:
-> **dpibreak -D --fake-autottl**
+> **dpibreak -e --fake-autottl**
Send the TLS ClientHello with the second byte first, followed by the
remainder, then the first byte:
diff --git a/src/opt.rs b/src/opt.rs
index 7e2ed42..c5d9618 100644
--- a/src/opt.rs
+++ b/src/opt.rs
@@ -145,7 +145,7 @@ impl Opt {
let mut args = std::env::args().skip(1); // program name
let mut warned_loglevel_deprecated = false;
- let mut warned_D_deprecated = false;
+ let mut warned_daemon_deprecated = false;
while let Some(arg) = args.next() {
let argv = arg.as_str();
@@ -153,9 +153,9 @@ impl Opt {
match argv {
"-h" | "--help" => { usage(); std::process::exit(0); }
"-d" | "-D" | "--daemon" => {
- if argv == "--loglevel" && !warned_D_deprecated {
+ if argv == "--loglevel" && !warned_daemon_deprecated {
// FIXME(on release): remove this on v1.0.0
- warned_D_deprecated = true;
+ warned_daemon_deprecated = true;
eprintln!("Note: `{arg}' has been deprecated since v0.6.0 and planned to be removed on v1.0.0. Use `-d' instead.");
}
no_splash = true;
@@ -182,8 +182,8 @@ impl Opt {
}
"--fake" => { fake = true; }
- "--fake-ttl" => { fake = true; fake_ttl = take_value(&mut args, argv)?; }
- "--fake-autottl" => { fake = true; fake_autottl = true }
+ "-t" | "--fake-ttl" => { fake = true; fake_ttl = take_value(&mut args, argv)?; }
+ "-a" | "--fake-autottl" => { fake = true; fake_autottl = true }
"--fake-badsum" => { fake = true; fake_badsum = true }
#[cfg(target_os = "linux")]
@@ -324,8 +324,8 @@ fn usage() {
println!(" --no-splash Do not print splash messages\n");
println!(" --fake Enable fake clienthello injection");
- println!(" --fake-ttl <u8> Override ttl of fake clienthello (default: {DEFAULT_FAKE_TTL})");
- println!(" --fake-autottl Override ttl of fake clienthello automatically");
+ println!(" -t, --fake-ttl <u8> Override ttl of fake clienthello (default: {DEFAULT_FAKE_TTL})");
+ println!(" -a, --fake-autottl Override ttl of fake clienthello automatically");
println!(" --fake-badsum Modifies the TCP checksum of the fake packet to an invalid value.");
println!("");
println!(" -o, --segment-order <u32,u32,...> Byte offsets defining segment boundaries and transmission order.");
diff --git a/src/pkt.rs b/src/pkt.rs
index f7f2c52..bc5ac17 100644
--- a/src/pkt.rs
+++ b/src/pkt.rs
@@ -172,7 +172,7 @@ fn send_split(view: &PktView, order: &[opt::Segment], buf: &mut Vec<u8>) -> Resu
if start >= payload_len {
crate::warn!(
"send_split: segment {} exceeds payload len {payload_len}, skipping",
- Segment(start, end)
+ opt::Segment(start, end)
);
continue;
}