-
-
Notifications
You must be signed in to change notification settings - Fork 275
/
callbacks.go
40 lines (33 loc) · 1 KB
/
callbacks.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package compat
import (
"net"
"github.com/safing/portmaster/network/packet"
"github.com/safing/portmaster/process"
)
// SubmitSystemIntegrationCheckPacket submit a packet for the system integrity check.
func SubmitSystemIntegrationCheckPacket(p packet.Packet) {
select {
case systemIntegrationCheckPackets <- p:
default:
}
}
// SubmitDNSCheckDomain submits a subdomain for the dns check.
func SubmitDNSCheckDomain(subdomain string) (respondWith net.IP) {
// Submit queried domain.
select {
case dnsCheckReceivedDomain <- subdomain:
default:
}
// Return the answer.
dnsCheckAnswerLock.Lock()
defer dnsCheckAnswerLock.Unlock()
return dnsCheckAnswer
}
// ReportSecureDNSBypassIssue reports a DNS bypassing issue for the given process.
func ReportSecureDNSBypassIssue(p *process.Process) {
secureDNSBypassIssue.notify(p)
}
// ReportMultiPeerUDPTunnelIssue reports a multi-peer UDP tunnel for the given process.
func ReportMultiPeerUDPTunnelIssue(p *process.Process) {
multiPeerUDPTunnelIssue.notify(p)
}