6 Commits
Author SHA1 Message Date
DragonSlayer_14 232e39f518 Merge remote-tracking branch 'origin/dev' into dev
TruffleHog Secret Scan / TruffleHog (push) Successful in 17s
Security Scans / Trivy & OSV-Scanner (push) Successful in 33s
Testing Build, Publish & Preview Release / Build, Publish Packages (Testing) & Create Preview Release (push) Skipped
Code Quality (Auto-Format & Clippy-Fix) / Formatierung & Clippy automatisch beheben (push) Successful in 36s
2026-09-15 00:50:56 +02:00
DragonSlayer_14 8ce23b6374 Merge branch 'main' into dev 2026-09-15 00:50:51 +02:00
DragonSlayer_14andClaude Sonnet 5 b094b11429 Chore: Terminal-Ausgaben ins Englische übersetzt
Log-Meldungen, Fehlertexte, CLI---help-Ausgabe und der interaktive
Vertrauens-Prompt erscheinen jetzt auf Englisch. Rustdoc-Kommentare
bleiben unverändert Deutsch; in cli.rs wird dafür ein separates
clap-help-Attribut (Englisch) neben dem deutschen Doc-Kommentar
verwendet.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011asoZDNEvn4RZBxxPQLCG9
2026-09-15 00:33:45 +02:00
DragonSlayer_14 fd441a95a6 Merge pull request 'chore(deps): update gitea actions' (#8) from renovate/gitea-actions into dev
Security Scans / Trivy & OSV-Scanner (push) Successful in 58s
TruffleHog Secret Scan / TruffleHog (push) Successful in 31s
Testing Build, Publish & Preview Release / Build, Publish Packages (Testing) & Create Preview Release (push) Skipped
Code Quality (Auto-Format & Clippy-Fix) / Formatierung & Clippy automatisch beheben (push) Successful in 1m33s
Reviewed-on: #8
Reviewed-by: dragonslayer14@murena.io <4+dragonslayer_14@noreply.localhost>
2026-09-14 10:52:11 +00:00
Renovate-Bot 2c8c9c885f chore(deps): update gitea actions
TruffleHog Secret Scan / TruffleHog (push) Successful in 17s
TruffleHog Secret Scan / TruffleHog (pull_request) Successful in 15s
Security Scans / Trivy & OSV-Scanner (pull_request) Successful in 28s
Testing Build, Publish & Preview Release / Build, Publish Packages (Testing) & Create Preview Release (push) Skipped
Unit-Tests / Unit-Tests (pull_request) Skipped
2026-09-14 10:01:00 +00:00
DragonSlayer_14 8073ee6a49 Merge pull request 'Merge testing in main: Release 1.0.0' (#6) from testing into main
Testing Build, Publish & Preview Release / Build, Publish Packages (Testing) & Create Preview Release (push) Skipped
Main Release & Publish / Erkenne relevante Code-Änderungen (push) Successful in 5s
Security Scans / Trivy & OSV-Scanner (push) Successful in 22s
Main Release & Publish / Build, Publish Packages (Stable) & Create Release (push) Successful in 12m27s
TruffleHog Secret Scan / TruffleHog (push) Successful in 10s
Reviewed-on: #6
Reviewed-by: dragonslayer14@murena.io <4+dragonslayer_14@noreply.localhost>
2026-09-13 20:46:58 +00:00
10 changed files with 84 additions and 54 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ jobs:
renovate: renovate:
name: Dependency-Updates prüfen & Pull Requests erstellen name: Dependency-Updates prüfen & Pull Requests erstellen
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: ghcr.io/renovatebot/renovate:44.83.0 container: ghcr.io/renovatebot/renovate:44.85.0
steps: steps:
- name: Renovate ausführen - name: Renovate ausführen
run: renovate run: renovate
+1 -1
View File
@@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
TRIVY_VERSION: "0.74.0" TRIVY_VERSION: "0.74.0"
OSV_SCANNER_VERSION: "2.5.1" OSV_SCANNER_VERSION: "2.6.0"
steps: steps:
- name: Checkout Repository - name: Checkout Repository
uses: actions/checkout@v7 uses: actions/checkout@v7
+11 -14
View File
@@ -68,7 +68,7 @@ impl Cache {
Err(e) => { Err(e) => {
crate::log::warn( crate::log::warn(
"cache", "cache",
&format!("Cache-Lesefehler (trusted_networks): {e}"), &format!("Cache read error (trusted_networks): {e}"),
); );
false false
} }
@@ -90,7 +90,7 @@ impl Cache {
{ {
crate::log::warn( crate::log::warn(
"cache", "cache",
&format!("Cache-Schreibfehler (trusted_networks, ignoriert): {e}"), &format!("Cache write error (trusted_networks, ignored): {e}"),
); );
} }
} }
@@ -108,7 +108,7 @@ impl Cache {
{ {
Ok(rows) => rows, Ok(rows) => rows,
Err(e) => { Err(e) => {
crate::log::warn("cache", &format!("Cache-Lesefehler: {e}")); crate::log::warn("cache", &format!("Cache read error: {e}"));
return None; return None;
} }
}; };
@@ -126,7 +126,7 @@ impl Cache {
} }
Ok(None) => None, Ok(None) => None,
Err(e) => { Err(e) => {
crate::log::warn("cache", &format!("Cache-Lesefehler: {e}")); crate::log::warn("cache", &format!("Cache read error: {e}"));
None None
} }
} }
@@ -145,7 +145,7 @@ impl Cache {
) )
.await .await
{ {
crate::log::warn("cache", &format!("Cache-Schreibfehler (ignoriert): {e}")); crate::log::warn("cache", &format!("Cache write error (ignored): {e}"));
} }
} }
} }
@@ -158,10 +158,7 @@ pub fn is_expired(updated_at: i64, now: i64, ttl_seconds: u64) -> bool {
fn ensure_cache_dir(dir: &Path) -> Result<(), String> { fn ensure_cache_dir(dir: &Path) -> Result<(), String> {
if !dir.exists() { if !dir.exists() {
std::fs::create_dir_all(dir).map_err(|e| { std::fs::create_dir_all(dir).map_err(|e| {
format!( format!("could not create directory '{}': {e}", dir.display())
"Verzeichnis '{}' konnte nicht angelegt werden: {e}",
dir.display()
)
})?; })?;
// create_dir_all() unterliegt dem Prozess-Umask; explizites chmod ist nötig, um // create_dir_all() unterliegt dem Prozess-Umask; explizites chmod ist nötig, um
// wirklich 0777 zu erreichen (Verzeichnis-Rechte steuern nicht die Umask neuer Dateien). // wirklich 0777 zu erreichen (Verzeichnis-Rechte steuern nicht die Umask neuer Dateien).
@@ -169,7 +166,7 @@ fn ensure_cache_dir(dir: &Path) -> Result<(), String> {
// unprivilegierter Aufruf auf root-eigenen Pfaden mit EPERM fehlschlagen. // unprivilegierter Aufruf auf root-eigenen Pfaden mit EPERM fehlschlagen.
#[cfg(unix)] #[cfg(unix)]
std::fs::set_permissions(dir, std::fs::Permissions::from_mode(0o777)) std::fs::set_permissions(dir, std::fs::Permissions::from_mode(0o777))
.map_err(|e| format!("Verzeichnis-Rechte konnten nicht gesetzt werden: {e}"))?; .map_err(|e| format!("could not set directory permissions: {e}"))?;
} }
Ok(()) Ok(())
} }
@@ -191,7 +188,7 @@ pub async fn try_open_cache(db_path: &Path) -> Option<Cache> {
if let Some(dir) = db_path.parent() if let Some(dir) = db_path.parent()
&& let Err(reason) = ensure_cache_dir(dir) && let Err(reason) = ensure_cache_dir(dir)
{ {
crate::log::warn("cache", &format!("Cache deaktiviert: {reason}")); crate::log::warn("cache", &format!("Cache disabled: {reason}"));
return None; return None;
} }
@@ -203,7 +200,7 @@ pub async fn try_open_cache(db_path: &Path) -> Option<Cache> {
Err(e) => { Err(e) => {
crate::log::warn( crate::log::warn(
"cache", "cache",
&format!("Cache-Datenbank konnte nicht geöffnet werden: {e}"), &format!("Could not open cache database: {e}"),
); );
return None; return None;
} }
@@ -212,7 +209,7 @@ pub async fn try_open_cache(db_path: &Path) -> Option<Cache> {
let conn = match db.connect() { let conn = match db.connect() {
Ok(c) => c, Ok(c) => c,
Err(e) => { Err(e) => {
crate::log::warn("cache", &format!("Cache-Verbindung fehlgeschlagen: {e}")); crate::log::warn("cache", &format!("Cache connection failed: {e}"));
return None; return None;
} }
}; };
@@ -221,7 +218,7 @@ pub async fn try_open_cache(db_path: &Path) -> Option<Cache> {
if let Err(e) = cache.init_schema().await { if let Err(e) = cache.init_schema().await {
crate::log::warn( crate::log::warn(
"cache", "cache",
&format!("Cache-Schema konnte nicht initialisiert werden: {e}"), &format!("Could not initialize cache schema: {e}"),
); );
return None; return None;
} }
+47 -10
View File
@@ -11,50 +11,87 @@ use crate::mac::MacAddress;
name = "mac2ip", name = "mac2ip",
author, author,
version, version,
about = "Findet zuverlässig die aktuelle IP-Adresse zu einer MAC-Adresse im lokalen Netzwerk", about = "Reliably finds the current IP address for a MAC address on the local network",
long_about = None long_about = None
)] )]
pub struct Cli { pub struct Cli {
/// MAC-Adresse, deren aktuelle IP-Adresse ermittelt werden soll (z. B. aa:bb:cc:dd:ee:ff) /// MAC-Adresse, deren aktuelle IP-Adresse ermittelt werden soll (z. B. aa:bb:cc:dd:ee:ff)
#[arg(help = "MAC address to look up the current IP address for (e.g. aa:bb:cc:dd:ee:ff)")]
pub mac: MacAddress, pub mac: MacAddress,
/// Gibt das Ergebnis als einzeiliges JSON-Objekt aus; unterdrückt alle sonstigen Log-Ausgaben /// Gibt das Ergebnis als einzeiliges JSON-Objekt aus; unterdrückt alle sonstigen Log-Ausgaben
#[arg(long)] #[arg(
long,
help = "Print the result as a single-line JSON object; suppresses all other log output"
)]
pub json: bool, pub json: bool,
/// Benutzerdefinierter Pfad zur Konfigurationsdatei /// Benutzerdefinierter Pfad zur Konfigurationsdatei
#[arg(long)] #[arg(long, help = "Custom path to the configuration file")]
pub config: Option<PathBuf>, pub config: Option<PathBuf>,
/// Logging-Level (error, warn, info, debug) /// Logging-Level (error, warn, info, debug)
#[arg(long, value_enum, env = "MAC2IP_LOG_LEVEL")] #[arg(
long,
value_enum,
env = "MAC2IP_LOG_LEVEL",
help = "Log level (error, warn, info, debug)"
)]
pub log_level: Option<LogLevelArg>, pub log_level: Option<LogLevelArg>,
/// Cache-TTL in Sekunden (Standard: 1800) /// Cache-TTL in Sekunden (Standard: 1800)
#[arg(long, env = "MAC2IP_CACHE_TTL_SECONDS")] #[arg(
long,
env = "MAC2IP_CACHE_TTL_SECONDS",
help = "Cache TTL in seconds (default: 1800)"
)]
pub cache_ttl_seconds: Option<u64>, pub cache_ttl_seconds: Option<u64>,
/// Pfad zur globalen Cache-Datenbankdatei (Standard: /var/lib/mac2ip/cache.db) /// Pfad zur globalen Cache-Datenbankdatei (Standard: /var/lib/mac2ip/cache.db)
#[arg(long, env = "MAC2IP_CACHE_DB_PATH")] #[arg(
long,
env = "MAC2IP_CACHE_DB_PATH",
help = "Path to the global cache database file (default: /var/lib/mac2ip/cache.db)"
)]
pub cache_db_path: Option<PathBuf>, pub cache_db_path: Option<PathBuf>,
/// Timeout in Sekunden für einen einzelnen nmap-Subnetz-Scan (Standard: 120) /// Timeout in Sekunden für einen einzelnen nmap-Subnetz-Scan (Standard: 120)
#[arg(long, env = "MAC2IP_NMAP_TIMEOUT_SECONDS")] #[arg(
long,
env = "MAC2IP_NMAP_TIMEOUT_SECONDS",
help = "Timeout in seconds for a single nmap subnet scan (default: 120)"
)]
pub nmap_timeout_seconds: Option<u64>, pub nmap_timeout_seconds: Option<u64>,
/// Kommagetrennte Liste von CIDR-Subnetzen für den nmap-Scan (überschreibt Auto-Erkennung) /// Kommagetrennte Liste von CIDR-Subnetzen für den nmap-Scan (überschreibt Auto-Erkennung)
#[arg(long, env = "MAC2IP_NETWORKS", value_delimiter = ',')] #[arg(
long,
env = "MAC2IP_NETWORKS",
value_delimiter = ',',
help = "Comma-separated list of CIDR subnets for the nmap scan (overrides auto-detection)"
)]
pub networks: Option<Vec<String>>, pub networks: Option<Vec<String>>,
/// Kommagetrennte Liste von Gateway-MAC-Adressen, deren Netzwerke ohne Rückfrage für /// Kommagetrennte Liste von Gateway-MAC-Adressen, deren Netzwerke ohne Rückfrage für
/// nmap-Scans (Schritt 3) vertraut werden (überschreibt die Konfigurationsdatei vollständig) /// nmap-Scans (Schritt 3) vertraut werden (überschreibt die Konfigurationsdatei vollständig)
#[arg(long, env = "MAC2IP_TRUSTED_NETWORKS", value_delimiter = ',')] #[arg(
long,
env = "MAC2IP_TRUSTED_NETWORKS",
value_delimiter = ',',
help = "Comma-separated list of gateway MAC addresses whose networks are trusted for \
nmap scans (step 3) without confirmation (fully overrides the config file)"
)]
pub trusted_networks: Option<Vec<MacAddress>>, pub trusted_networks: Option<Vec<MacAddress>>,
/// Beantwortet die "nmap-Scan in diesem Netzwerk erlauben?"-Rückfrage vor Schritt 3 /// Beantwortet die "nmap-Scan in diesem Netzwerk erlauben?"-Rückfrage vor Schritt 3
/// automatisch mit Ja (und merkt sich das Netzwerk dauerhaft im Cache), statt /// automatisch mit Ja (und merkt sich das Netzwerk dauerhaft im Cache), statt
/// interaktiv nachzufragen bzw. im --json-Modus den Scan abzulehnen /// interaktiv nachzufragen bzw. im --json-Modus den Scan abzulehnen
#[arg(long)] #[arg(
long,
help = "Automatically answers yes to the \"allow nmap scan on this network?\" prompt \
before step 3 (and remembers the network permanently in the cache), instead of \
asking interactively or rejecting the scan in --json mode"
)]
pub auto_trust_networks: bool, pub auto_trust_networks: bool,
} }
+5 -5
View File
@@ -4,15 +4,15 @@ use crate::mac::MacAddressError;
#[derive(Debug, thiserror::Error)] #[derive(Debug, thiserror::Error)]
pub enum Mac2IpError { pub enum Mac2IpError {
#[error("keine IP-Adresse für MAC '{mac}' gefunden")] #[error("no IP address found for MAC '{mac}'")]
NotFound { mac: String }, NotFound { mac: String },
#[error( #[error(
"nmap-Scan abgelehnt: Netzwerk nicht vertrauenswürdig{}", "nmap scan rejected: network not trusted{}",
.gateway_mac.as_ref().map(|m| format!(" (Gateway-MAC {m})")).unwrap_or_default() .gateway_mac.as_ref().map(|m| format!(" (gateway MAC {m})")).unwrap_or_default()
)] )]
UntrustedNetwork { gateway_mac: Option<String> }, UntrustedNetwork { gateway_mac: Option<String> },
#[error("MAC-Adresse ungültig: {0}")] #[error("invalid MAC address: {0}")]
InvalidMac(#[from] MacAddressError), InvalidMac(#[from] MacAddressError),
#[error("E/A-Fehler: {0}")] #[error("I/O error: {0}")]
Io(#[from] std::io::Error), Io(#[from] std::io::Error),
} }
+1 -1
View File
@@ -9,7 +9,7 @@ pub struct MacAddress([u8; 6]);
#[derive(Debug, thiserror::Error, Clone, PartialEq, Eq)] #[derive(Debug, thiserror::Error, Clone, PartialEq, Eq)]
pub enum MacAddressError { pub enum MacAddressError {
#[error("ungültige MAC-Adresse: '{0}'")] #[error("invalid MAC address: '{0}'")]
InvalidFormat(String), InvalidFormat(String),
} }
+3 -3
View File
@@ -86,11 +86,11 @@ pub enum SudoMode {
#[derive(Debug, thiserror::Error)] #[derive(Debug, thiserror::Error)]
pub enum NmapRunError { pub enum NmapRunError {
#[error("sudo-Zugangsdaten nicht verfügbar (nicht-interaktiver Modus)")] #[error("sudo credentials unavailable (non-interactive mode)")]
SudoUnavailable, SudoUnavailable,
#[error("nmap-Scan hat das Zeitlimit überschritten")] #[error("nmap scan exceeded the time limit")]
Timeout, Timeout,
#[error("E/A-Fehler: {0}")] #[error("I/O error: {0}")]
Io(#[from] std::io::Error), Io(#[from] std::io::Error),
} }
+3 -5
View File
@@ -42,12 +42,11 @@ pub fn print_success(result: &ResolveResult, json: bool) {
if json { if json {
println!( println!(
"{}", "{}",
serde_json::to_string(&success_json(result)) serde_json::to_string(&success_json(result)).expect("JSON serialization never fails")
.expect("JSON-Serialisierung schlägt nicht fehl")
); );
} else { } else {
println!( println!(
"{} -> {} (Quelle: {})", "{} -> {} (source: {})",
result.mac, result.mac,
result.ip, result.ip,
result.source.as_str() result.source.as_str()
@@ -59,8 +58,7 @@ pub fn print_failure(mac: &MacAddress, err: &Mac2IpError, json: bool) {
if json { if json {
println!( println!(
"{}", "{}",
serde_json::to_string(&failure_json(mac, err)) serde_json::to_string(&failure_json(mac, err)).expect("JSON serialization never fails")
.expect("JSON-Serialisierung schlägt nicht fehl")
); );
} else { } else {
crate::log::error("mac2ip", &err.to_string()); crate::log::error("mac2ip", &err.to_string());
+8 -8
View File
@@ -57,7 +57,7 @@ pub async fn resolve(
{ {
crate::log::info( crate::log::info(
"resolver", "resolver",
&format!("Treffer im Cache für {mac}: {}", entry.ip), &format!("Cache hit for {mac}: {}", entry.ip),
); );
return Ok(ResolveResult { return Ok(ResolveResult {
mac: *mac, mac: *mac,
@@ -69,13 +69,13 @@ pub async fn resolve(
// Schritt 2: ip neigh // Schritt 2: ip neigh
crate::log::debug( crate::log::debug(
"resolver", "resolver",
"Cache-Treffer nicht verfügbar, prüfe 'ip neigh show'", "No cache hit available, checking 'ip neigh show'",
); );
if let Ok(output) = network::run_ip_neigh_show().await if let Ok(output) = network::run_ip_neigh_show().await
&& let Some(ip) = network::parse_ip_neigh_output(&output, mac) && let Some(ip) = network::parse_ip_neigh_output(&output, mac)
&& network::ping_check(ip).await && network::ping_check(ip).await
{ {
crate::log::info("resolver", &format!("Treffer via ip neigh für {mac}: {ip}")); crate::log::info("resolver", &format!("Hit via ip neigh for {mac}: {ip}"));
if let Some(cache) = cache { if let Some(cache) = cache {
cache.upsert(mac, ip, MatchSource::Arp.as_str(), now).await; cache.upsert(mac, ip, MatchSource::Arp.as_str(), now).await;
} }
@@ -87,14 +87,14 @@ pub async fn resolve(
} }
// Schritt 3: nmap // Schritt 3: nmap
crate::log::debug("resolver", "Kein Treffer via ip neigh, starte nmap-Scan"); crate::log::debug("resolver", "No hit via ip neigh, starting nmap scan");
match trust::ensure_network_trusted(config, cache, auto_trust_networks, json_mode, now).await { match trust::ensure_network_trusted(config, cache, auto_trust_networks, json_mode, now).await {
TrustDecision::Allowed => {} TrustDecision::Allowed => {}
TrustDecision::Denied { gateway_mac } => { TrustDecision::Denied { gateway_mac } => {
crate::log::warn( crate::log::warn(
"resolver", "resolver",
"nmap-Scan übersprungen: Netzwerk nicht als vertrauenswürdig bestätigt", "nmap scan skipped: network not confirmed as trusted",
); );
return Err(Mac2IpError::UntrustedNetwork { return Err(Mac2IpError::UntrustedNetwork {
gateway_mac: gateway_mac.map(|m| m.to_string()), gateway_mac: gateway_mac.map(|m| m.to_string()),
@@ -125,7 +125,7 @@ pub async fn resolve(
if let Some(ip) = network::parse_nmap_output(&output, mac) if let Some(ip) = network::parse_nmap_output(&output, mac)
&& network::ping_check(ip).await && network::ping_check(ip).await
{ {
crate::log::info("resolver", &format!("Treffer via nmap für {mac}: {ip}")); crate::log::info("resolver", &format!("Hit via nmap for {mac}: {ip}"));
if let Some(cache) = cache { if let Some(cache) = cache {
cache.upsert(mac, ip, MatchSource::Nmap.as_str(), now).await; cache.upsert(mac, ip, MatchSource::Nmap.as_str(), now).await;
} }
@@ -139,12 +139,12 @@ pub async fn resolve(
Err(NmapRunError::SudoUnavailable) => { Err(NmapRunError::SudoUnavailable) => {
crate::log::warn( crate::log::warn(
"nmap", "nmap",
"sudo -n fehlgeschlagen (keine Zugangsdaten) - Schritt 3 wird abgebrochen", "sudo -n failed (no credentials available) - aborting step 3",
); );
break; // sudo-Session-Status ist global, ein Retry pro Subnetz bringt nichts break; // sudo-Session-Status ist global, ein Retry pro Subnetz bringt nichts
} }
Err(e) => { Err(e) => {
crate::log::warn("nmap", &format!("nmap-Scan für {cidr} fehlgeschlagen: {e}")); crate::log::warn("nmap", &format!("nmap scan for {cidr} failed: {e}"));
continue; // Fehler pro Subnetz (z. B. Timeout) - nächstes Subnetz versuchen continue; // Fehler pro Subnetz (z. B. Timeout) - nächstes Subnetz versuchen
} }
} }
+4 -6
View File
@@ -35,12 +35,12 @@ pub async fn ensure_network_trusted(
let Some(gateway_mac) = network::detect_default_gateway_mac().await else { let Some(gateway_mac) = network::detect_default_gateway_mac().await else {
crate::log::warn( crate::log::warn(
"trust", "trust",
"Gateway-MAC konnte nicht ermittelt werden, Netzwerk kann nicht identifiziert werden", "Could not determine gateway MAC, network cannot be identified",
); );
if auto_trust { if auto_trust {
crate::log::warn( crate::log::warn(
"trust", "trust",
"--auto-trust-networks gesetzt: nmap-Scan wird trotz unbekannter Gateway-MAC ausgeführt", "--auto-trust-networks set: running nmap scan despite unknown gateway MAC",
); );
return TrustDecision::Allowed; return TrustDecision::Allowed;
} }
@@ -60,9 +60,7 @@ pub async fn ensure_network_trusted(
if auto_trust { if auto_trust {
crate::log::info( crate::log::info(
"trust", "trust",
&format!( &format!("Network (gateway MAC {gateway_mac}) automatically marked as trusted"),
"Netzwerk (Gateway-MAC {gateway_mac}) automatisch als vertrauenswürdig markiert"
),
); );
if let Some(cache) = cache { if let Some(cache) = cache {
cache.trust_network(&gateway_mac, now).await; cache.trust_network(&gateway_mac, now).await;
@@ -95,7 +93,7 @@ pub async fn ensure_network_trusted(
async fn prompt_trust_confirmation(gateway_mac: MacAddress) -> bool { async fn prompt_trust_confirmation(gateway_mac: MacAddress) -> bool {
tokio::task::spawn_blocking(move || { tokio::task::spawn_blocking(move || {
eprint!( eprint!(
"Unbekanntes Netzwerk (Gateway-MAC {gateway_mac}). nmap-Scan in diesem Netzwerk erlauben und dauerhaft merken? [y/N]: " "Unknown network (gateway MAC {gateway_mac}). Allow nmap scan on this network and remember it permanently? [y/N]: "
); );
let _ = std::io::stderr().flush(); let _ = std::io::stderr().flush();