v0.5.0: Add syslog support, fix TCP send/both, EC-SRP5 server auth
All checks were successful
CI / test (push) Successful in 1m22s

New features:
- --syslog <address:port> sends structured events to remote syslog (RFC 5424 UDP)
  Events: AUTH_SUCCESS, AUTH_FAILURE, TEST_START, TEST_END, TEST_RESULT
- EC-SRP5 authentication for both client and server modes
- TCP multi-connection support (session tokens, all 3 directions)

Bug fixes since v0.2.0:
- EC-SRP5 server: fixed gamma parity (was 50% auth failure rate)
- EC-SRP5 server: use lift_x not redp1 for verification
- TCP send direction: server sends 12-byte status messages to client
- TCP both direction: TX loop injects status between data packets
- TCP data: send all zeros (no 0x07 header that MikroTik rejected)
- TCP disconnect detection: running flag set on EOF
- UDP multi-connection: unconnected socket accepts all source ports

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Siavash Sameni
2026-03-31 18:22:31 +04:00
parent f9289cca55
commit 2dec6cc007
6 changed files with 162 additions and 5 deletions

View File

@@ -4,6 +4,7 @@ mod client;
mod ecsrp5;
mod protocol;
mod server;
pub mod syslog_logger;
use clap::Parser;
use tracing_subscriber::EnvFilter;
@@ -65,6 +66,10 @@ struct Cli {
#[arg(short = 'n', long = "nat")]
nat: bool,
/// Send logs to remote syslog server (e.g., 192.168.1.1:514)
#[arg(long = "syslog")]
syslog: Option<String>,
/// Verbose logging (repeat for more: -v, -vv, -vvv)
#[arg(short = 'v', long = "verbose", action = clap::ArgAction::Count)]
verbose: u8,
@@ -87,6 +92,13 @@ async fn main() -> anyhow::Result<()> {
.with_target(false)
.init();
// Initialize syslog if requested
if let Some(ref syslog_addr) = cli.syslog {
if let Err(e) = syslog_logger::init(syslog_addr) {
eprintln!("Warning: failed to initialize syslog to {}: {}", syslog_addr, e);
}
}
if cli.server {
// Server mode
tracing::info!("Starting btest server on port {}", cli.port);