chore(i18n): finish translating code comments and scripts to English
CI / Format and clippy (push) Successful in 1m13s
CI / Dependency audit (push) Successful in 13s
CI / Tests (Linux) (push) Successful in 1m35s
Release / Create release (push) Successful in 7s
CI / Check desktop app (Linux) (push) Successful in 3m19s
Release / CLI (linux-aarch64) (push) Successful in 1m3s
Release / CLI (linux-x86_64) (push) Successful in 1m28s
Release / Desktop app (linux-aarch64) (push) Successful in 7m16s
Release / Desktop app (linux-x86_64) (push) Successful in 10m17s
Release / Desktop app (windows) (push) Successful in 4m54s
CI / Format and clippy (push) Successful in 1m13s
CI / Dependency audit (push) Successful in 13s
CI / Tests (Linux) (push) Successful in 1m35s
Release / Create release (push) Successful in 7s
CI / Check desktop app (Linux) (push) Successful in 3m19s
Release / CLI (linux-aarch64) (push) Successful in 1m3s
Release / CLI (linux-x86_64) (push) Successful in 1m28s
Release / Desktop app (linux-aarch64) (push) Successful in 7m16s
Release / Desktop app (linux-x86_64) (push) Successful in 10m17s
Release / Desktop app (windows) (push) Successful in 4m54s
Completes the English-only standardization for code, comments, scripts and CI templates (UI/CLI-facing strings stay bilingual pt-BR/en, untouched). Covers the remaining crates/, apps/gui/ui/ and apps/gui/src-tauri/ comments, .gitea/ workflow and template comments, .githooks/ hooks, and the scripts/ source comments for the files already renamed in a prior commit (check.sh, generate-logo.py, install-hooks.sh). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VAyr8d7HuAdUGB6aA5xmDD
This commit is contained in:
1 parent
bf059fd0bc
commit
55e19a8e5b
59 files changed
+935
-879
No files matched your search
@@ -1,9 +1,9 @@
|
||||
//! Captura crua de quadros 802.11 via `AF_PACKET`, sem depender de libpcap.
|
||||
//! Raw 802.11 frame capture via Linux `AF_PACKET` sockets without requiring `libpcap`.
|
||||
//!
|
||||
//! The interface must already be in monitor mode (see [`crate::netlink`]).
|
||||
//! Uses the same kernel packet socket interface that `libpcap` uses on Linux
|
||||
//! without adding an external system library dependency.
|
||||
//!
|
||||
//! A interface já precisa estar em modo monitor (ver [`crate::netlink`]).
|
||||
//! Isso só funciona em Linux — é exatamente o que o libpcap faz por baixo
|
||||
//! quando usado em modo monitor, então reimplementar aqui é pouco código e
|
||||
//! remove uma dependência de sistema.
|
||||
|
||||
#![cfg(target_os = "linux")]
|
||||
|
||||
@@ -21,8 +21,8 @@ pub struct RawCapture {
|
||||
}
|
||||
|
||||
impl RawCapture {
|
||||
/// Abre um socket raw ligado à interface `iface` (já em modo monitor).
|
||||
/// Exige `CAP_NET_RAW` (tipicamente root).
|
||||
/// Opens a raw `AF_PACKET` socket bound to `iface` (must already be in monitor mode).
|
||||
/// Requires `CAP_NET_RAW` (typically root).
|
||||
pub fn open(iface: &str) -> Result<Self> {
|
||||
let fd = unsafe { libc::socket(libc::AF_PACKET, libc::SOCK_RAW, ETH_P_ALL as i32) };
|
||||
if fd < 0 {
|
||||
@@ -57,8 +57,8 @@ impl RawCapture {
|
||||
Ok(Self { fd })
|
||||
}
|
||||
|
||||
/// Define um timeout de recepção, para o loop de captura poder checar
|
||||
/// periodicamente um sinal de parada sem travar para sempre em `recv`.
|
||||
/// Sets `SO_RCVTIMEO` so the capture loop can periodically check its stop flag
|
||||
/// without blocking indefinitely in `recv`.
|
||||
pub fn set_read_timeout(&self, timeout: Duration) -> Result<()> {
|
||||
let tv = libc::timeval {
|
||||
tv_sec: timeout.as_secs() as libc::time_t,
|
||||
@@ -79,7 +79,7 @@ impl RawCapture {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Lê um quadro. Retorna `Ok(None)` em timeout (ver `set_read_timeout`).
|
||||
/// Reads a single frame. Returns `Ok(None)` on receive timeout (see `set_read_timeout`).
|
||||
pub fn recv(&self, buf: &mut [u8]) -> Result<Option<usize>> {
|
||||
let n = unsafe { libc::recv(self.fd, buf.as_mut_ptr() as *mut libc::c_void, buf.len(), 0) };
|
||||
if n < 0 {
|
||||
@@ -114,8 +114,8 @@ fn if_index(name: &str) -> Result<i32> {
|
||||
Ok(idx as i32)
|
||||
}
|
||||
|
||||
/// Garante, de forma best-effort, que o processo tem privilégio para abrir
|
||||
/// sockets raw — útil para dar um erro claro antes de tentar o resto.
|
||||
/// Best-effort check that the process has privileges to open raw packet sockets.
|
||||
///
|
||||
pub fn check_capabilities() -> bool {
|
||||
let euid = unsafe { libc::geteuid() };
|
||||
euid == 0
|
||||
|
||||
Reference in new issue
Block a user