Files
Strix/internal/models/probe.go
T
eduard256 3fec89be7f Add HTTP prober, optimize mDNS timeout, add Trassir/ZOSI to OUI
- Add HTTPProber: parallel HEAD+GET on ports 80/8080, extracts Server header
- Reduce mDNS timeout from 1s to 100ms using context wrapper around
  mdns.Query (HomeKit devices respond in 2-10ms, no need to wait 1s)
- Add Trassir (F0:23:B9) and ZOSI (00:05:FE) to camera OUI database
- Probe response time improved from ~1s to ~110ms for reachable devices
2026-03-16 14:46:58 +00:00

54 lines
1.7 KiB
Go

package models
// ProbeResponse represents the result of probing an IP address.
// The Type field determines which UI flow the frontend should use:
// - "unreachable" -- device did not respond to ping
// - "standard" -- normal IP camera (RTSP/HTTP/ONVIF)
// - "homekit" -- Apple HomeKit camera (needs PIN pairing)
type ProbeResponse struct {
IP string `json:"ip"`
Reachable bool `json:"reachable"`
LatencyMs float64 `json:"latency_ms,omitempty"`
Type string `json:"type"`
Error string `json:"error,omitempty"`
Probes ProbeResults `json:"probes"`
}
// ProbeResults contains results from all parallel probers.
// Nil fields mean the prober did not find anything or timed out.
type ProbeResults struct {
DNS *DNSProbeResult `json:"dns"`
ARP *ARPProbeResult `json:"arp"`
MDNS *MDNSProbeResult `json:"mdns"`
HTTP *HTTPProbeResult `json:"http"`
}
// HTTPProbeResult contains HTTP server identification from port 80.
type HTTPProbeResult struct {
Port int `json:"port"`
StatusCode int `json:"status_code"`
Server string `json:"server"`
}
// DNSProbeResult contains reverse DNS lookup result.
type DNSProbeResult struct {
Hostname string `json:"hostname"`
}
// ARPProbeResult contains ARP table lookup + OUI vendor identification.
type ARPProbeResult struct {
MAC string `json:"mac"`
Vendor string `json:"vendor"`
}
// MDNSProbeResult contains mDNS service discovery result (HomeKit).
type MDNSProbeResult struct {
Name string `json:"name"`
DeviceID string `json:"device_id"`
Model string `json:"model"`
Category string `json:"category"` // "camera", "doorbell"
Paired bool `json:"paired"`
Port int `json:"port"`
Feature string `json:"feature"`
}