Initial commit
This commit is contained in:
commit
612a19c01a
23 changed files with 2402 additions and 0 deletions
31
checker/issues.go
Normal file
31
checker/issues.go
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
package checker
|
||||
|
||||
// computeCoverageView summarises per-transport / per-family reachability
|
||||
// from the raw endpoint probes. Pure raw-data aggregation (counts /
|
||||
// booleans), no severity or judgment is applied here; callers feed the
|
||||
// result back into the report header and (for judgment) into rules.
|
||||
func computeCoverageView(data *SIPData) Coverage {
|
||||
var cov Coverage
|
||||
for _, ep := range data.Endpoints {
|
||||
if ep.Reachable {
|
||||
if ep.IsIPv6 {
|
||||
cov.HasIPv6 = true
|
||||
} else {
|
||||
cov.HasIPv4 = true
|
||||
}
|
||||
}
|
||||
if !ep.OK() {
|
||||
continue
|
||||
}
|
||||
switch ep.Transport {
|
||||
case TransportUDP:
|
||||
cov.WorkingUDP = true
|
||||
case TransportTCP:
|
||||
cov.WorkingTCP = true
|
||||
case TransportTLS:
|
||||
cov.WorkingTLS = true
|
||||
}
|
||||
}
|
||||
cov.AnyWorking = cov.WorkingUDP || cov.WorkingTCP || cov.WorkingTLS
|
||||
return cov
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue