Files
Strix/pkg/probe/oui.go
T
eduard256 27117900eb Rewrite Strix from scratch as single binary
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
2026-03-25 10:38:46 +00:00

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
}