Skip to content

Commit 7973433

Browse files
docs: translate remaining portuguese godoc to english
Co-authored-by: mendsec <12684528+mendsec@users.noreply.github.com>
1 parent f4b1de9 commit 7973433

14 files changed

Lines changed: 73 additions & 73 deletions

File tree

‎internal/netutil/doc.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Package netutil contém utilitários internos para operações de rede.
1+
// Package netutil contains internal utilities for network operations.
22
//
3-
// Provê verificações que não fazem parte da API pública do catnet-core,
4-
// incluindo a validação rígida de formato de IPs (ex: ValidateIPv4).
3+
// Provides checks that are not part of the public API of catnet-core,
4+
// including strict format validation of IPs (e.g. ValidateIPv4).
55
package netutil

‎pkg/coreerr/doc.go‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
// Package coreerr define os erros sentinelas da biblioteca.
1+
// Package coreerr defines the sentinel errors of the library.
22
//
3-
// Centraliza todas as definições de erros conhecidos (timeout, input inválido,
4-
// cancelamento, erros de exportação) para que consumidores da API
5-
// possam realizar comparações via errors.Is() com segurança.
3+
// Centralizes all definitions of known errors (timeout, invalid input,
4+
// cancellation, export errors) so that API consumers
5+
// can safely perform comparisons via errors.Is().
66
//
7-
// Principais exportações:
8-
// - ErrInvalidInput: Erros de formato em IP ou configurações.
9-
// - ErrTimeout: Erros indicando que uma operação expirou o tempo.
10-
// - ErrCancelled: Indica que o contexto da varredura foi cancelado.
11-
// - ErrExport: Erros durante a serialização de dados.
7+
// Main exports:
8+
// - ErrInvalidInput: Format errors in IP or configurations.
9+
// - ErrTimeout: Errors indicating that an operation timed out.
10+
// - ErrCancelled: Indicates that the scan context was cancelled.
11+
// - ErrExport: Errors during data serialization.
1212
package coreerr

‎pkg/discovery/doc.go‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
// Package discovery implementa a detecção de atributos de hosts na rede.
1+
// Package discovery implements the detection of host attributes on the network.
22
//
3-
// Oferece abstrações multiplataforma para detecção de liveness via ICMP (Ping),
4-
// resolução reversa de DNS e obtenção de endereços MAC através da tabela ARP local.
5-
// Implementações específicas para Windows e POSIX estão disponíveis internamente.
3+
// Offers cross-platform abstractions for liveness detection via ICMP (Ping),
4+
// reverse DNS resolution and MAC address retrieval through the local ARP table.
5+
// Specific implementations for Windows and POSIX are available internally.
66
//
7-
// Principais exportações:
8-
// - Ping: Envia uma requisição ICMP Echo para verificar se um host está ativo.
9-
// - ReverseDNS: Obtém o hostname associado a um endereço IP.
10-
// - GetMAC: Obtém o endereço MAC correspondente a um IP.
7+
// Main exports:
8+
// - Ping: Sends an ICMP Echo request to check if a host is active.
9+
// - ReverseDNS: Obtains the hostname associated with an IP address.
10+
// - GetMAC: Obtains the MAC address corresponding to an IP.
1111
package discovery

‎pkg/discovery/net.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ import (
88
"github.com/catnet-io/engine/internal/netutil"
99
)
1010

11-
// Ping realiza um ping ICMP na máquina com timeout em milissegundos.
11+
// Ping performs an ICMP ping on the machine with a timeout in milliseconds.
1212
func Ping(ctx context.Context, ip string, timeoutMs int) bool {
1313
if err := netutil.ValidateIPv4(ip); err != nil {
1414
return false
1515
}
1616
return osPing(ctx, ip, timeoutMs)
1717
}
1818

19-
// ReverseDNS resolve o nome do host do endereço IP dado.
19+
// ReverseDNS resolves the hostname of the given IP address.
2020
func ReverseDNS(ctx context.Context, ip string) string {
2121
if err := netutil.ValidateIPv4(ip); err != nil {
2222
return ""
@@ -28,7 +28,7 @@ func ReverseDNS(ctx context.Context, ip string) string {
2828
return ""
2929
}
3030

31-
// GetMAC tenta obter o endereço MAC da máquina alvo.
31+
// GetMAC attempts to obtain the MAC address of the target machine.
3232
func GetMAC(ctx context.Context, ip string) string {
3333
if err := netutil.ValidateIPv4(ip); err != nil {
3434
return ""

‎pkg/discovery/os_posix.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"strings"
1414
)
1515

16-
// osPing faz ping em sistemas POSIX
16+
// osPing performs a ping on POSIX systems
1717
func osPing(ctx context.Context, ip string, timeoutMs int) bool {
1818
if net.ParseIP(ip) == nil {
1919
return false
@@ -40,7 +40,7 @@ func osPing(ctx context.Context, ip string, timeoutMs int) bool {
4040
return cmd.Run() == nil
4141
}
4242

43-
// osGetMAC obtém o MAC em sistemas POSIX
43+
// osGetMAC obtains the MAC on POSIX systems
4444
// ⚡ Bolt Optimization: Read directly from /proc/net/arp on Linux before falling back to `arp -an` exec.
4545
// This avoids expensive fork/exec overhead for a 100x+ speedup during concurrent scans.
4646
func osGetMAC(ctx context.Context, ip string) string {

‎pkg/discovery/os_windows.go‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var (
1818
sendARP = iphlpapi.NewProc("SendARP")
1919
)
2020

21-
// osPing faz ping no Windows
21+
// osPing performs a ping on Windows
2222
// ⚡ Bolt Optimization: Use native IcmpSendEcho from iphlpapi.dll instead of spawning ping.exe.
2323
// This avoids process-creation overhead on Windows for massive concurrent scans.
2424
func osPing(ctx context.Context, ip string, timeoutMs int) bool {
@@ -87,7 +87,7 @@ func osPing(ctx context.Context, ip string, timeoutMs int) bool {
8787
}
8888
}
8989

90-
// osGetMAC obtém o MAC usando SendARP no Windows
90+
// osGetMAC obtains the MAC using SendARP on Windows
9191
func osGetMAC(ctx context.Context, ip string) string {
9292
if ctx.Err() != nil {
9393
return ""
@@ -105,11 +105,11 @@ func osGetMAC(ctx context.Context, ip string) string {
105105
go func() {
106106
var mac [6]byte
107107
macLen := uint32(len(mac))
108-
// Segurança: mac é um array de tamanho fixo [6]byte alocado na stack.
109-
// macLen é inicializado com len(mac) == 6 antes da chamada.
110-
// O acesso via unsafe.Pointer é seguro porque o array não escapa do
111-
// escopo e seu tamanho é conhecido em tempo de compilação.
112-
// A validação `macLen == 6` após o retorno garante dados não corrompidos.
108+
// Security: mac is a fixed size array [6]byte allocated on the stack.
109+
// macLen is initialized with len(mac) == 6 before the call.
110+
// Access via unsafe.Pointer is safe because the array does not escape the
111+
// scope and its size is known at compile time.
112+
// The validation `macLen == 6` after the return guarantees uncorrupted data.
113113
ret, _, _ := sendARP.Call(
114114
uintptr(destIPUint32),
115115
0,

‎pkg/engine/doc.go‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
// Package engine orquestra a execução concorrente de varreduras na rede.
1+
// Package engine orchestrates concurrent network scans.
22
//
3-
// O pacote é o ponto de entrada principal do catnet-core, fornecendo a
4-
// função StartScan para gerenciar pools de goroutines, timeouts de
5-
// execução e a emissão de eventos assíncronos durante a varredura.
3+
// The package is the main entry point for catnet-core, providing the
4+
// StartScan function to manage goroutine pools, timeouts,
5+
// and the emission of asynchronous events during the scan.
66
//
7-
// Principais exportações:
8-
// - StartScan: Inicia uma varredura de rede.
9-
// - ScanConfig: Configurações como limites de concorrência e timeouts.
10-
// - EventCallback: Tipo para recebimento de eventos de progresso e resultados.
7+
// Main exports:
8+
// - StartScan: Starts a network scan.
9+
// - ScanConfig: Configuration such as concurrency limits and timeouts.
10+
// - EventCallback: Type for receiving progress and result events.
1111
package engine

‎pkg/exporter/doc.go‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// Package exporter lida com a formatação e serialização de relatórios.
1+
// Package exporter handles the formatting and serialization of reports.
22
//
3-
// Suporta a conversão de ScanReport em formatos padronizados (JSON, XML, CSV)
4-
// garantindo que as exportações evitem problemas de segurança como CSV Injection.
3+
// Supports the conversion of ScanReport into standardized formats (JSON, XML, CSV)
4+
// ensuring that exports avoid security issues like CSV Injection.
55
//
6-
// Principais exportações:
7-
// - ExportJSON: Exporta relatórios como JSON indentado.
8-
// - ExportXML: Exporta relatórios como XML válido.
9-
// - ExportCSV: Exporta relatórios para CSV, tratando injeção de fórmulas.
6+
// Main exports:
7+
// - ExportJSON: Exports reports as indented JSON.
8+
// - ExportXML: Exports reports as valid XML.
9+
// - ExportCSV: Exports reports to CSV, handling formula injection.
1010
package exporter

‎pkg/fingerprint/doc.go‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Package fingerprint provides heuristic and banner-based operating system
22
// and device type detection mechanisms.
33
//
4-
// Principais exportações:
5-
// - Fingerprint: Orquestra detecção de SO, tipo de dispositivo e vendor.
6-
// - GrabBanners: Coleta banners de portas abertas via conexão TCP.
7-
// - GuessOSFromTTL: Detecta família de SO a partir do valor TTL.
8-
// - VendorFromMAC: Identifica fabricante a partir do prefixo OUI do MAC.
9-
// - OsFromBanners: Infere SO e tipo de dispositivo a partir de banners coletados.
4+
// Main exports:
5+
// - Fingerprint: Orchestrates OS, device type, and vendor detection.
6+
// - GrabBanners: Collects banners of open ports via TCP connection.
7+
// - GuessOSFromTTL: Detects OS family from TTL value.
8+
// - VendorFromMAC: Identifies the manufacturer from the MAC OUI prefix.
9+
// - OsFromBanners: Infers OS and device type from collected banners.
1010
package fingerprint

‎pkg/ports/doc.go‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// Package ports implementa varredura concorrente de portas TCP.
1+
// Package ports implements concurrent TCP port scanning.
22
//
3-
// Utiliza tentativas de conexão com controle de simultaneidade interno
4-
// via semáforos para evitar exaustão de descritores de arquivo,
5-
// retornando de forma determinística portas que aceitam conexões ativas.
3+
// Uses connection attempts with internal concurrency control
4+
// via semaphores to prevent file descriptor exhaustion,
5+
// deterministically returning ports that accept active connections.
66
//
7-
// Principais exportações:
8-
// - ScanPorts: Varre uma lista de portas de um host de modo concorrente.
7+
// Main exports:
8+
// - ScanPorts: Concurrently scans a list of ports on a host.
99
package ports

0 commit comments

Comments
 (0)