27117900eb
Complete architecture rewrite following go2rtc patterns: - pkg/ for pure logic (camdb, tester, probe, generate) - internal/ for application glue with Init() modules - Single HTTP server on :4567 with all endpoints - zerolog with password masking and memory ring buffer - Environment-based config only (no YAML files) API endpoints: /api/search, /api/streams, /api/test, /api/probe, /api/generate, /api/health, /api/log Dependencies: go2rtc v1.9.14, go-sqlite3, miekg/dns, zerolog
22 lines
463 B
Go
22 lines
463 B
Go
package probe
|
|
|
|
import (
|
|
"database/sql"
|
|
"strings"
|
|
)
|
|
|
|
// LookupOUI returns vendor name for MAC address from SQLite oui table.
|
|
// MAC format: "C0:56:E3:AA:BB:CC" -> prefix "C0:56:E3"
|
|
func LookupOUI(db *sql.DB, mac string) string {
|
|
if len(mac) < 8 {
|
|
return ""
|
|
}
|
|
|
|
prefix := strings.ToUpper(mac[:8])
|
|
prefix = strings.ReplaceAll(prefix, "-", ":")
|
|
|
|
var brand string
|
|
_ = db.QueryRow("SELECT brand FROM oui WHERE prefix = ?", prefix).Scan(&brand)
|
|
return brand
|
|
}
|