mirror of
https://github.com/safing/portmaster
synced 2025-09-02 18:49:14 +00:00
30 lines
922 B
Go
30 lines
922 B
Go
package interception
|
|
|
|
import (
|
|
"github.com/safing/portmaster/firewall/interception/ebpf"
|
|
"github.com/safing/portmaster/firewall/interception/nfq"
|
|
"github.com/safing/portmaster/network"
|
|
"github.com/safing/portmaster/network/packet"
|
|
)
|
|
|
|
// start starts the interception.
|
|
func start(ch chan packet.Packet) error {
|
|
ebpf.StartEBPFWorker(ch)
|
|
return StartNfqueueInterception(ch)
|
|
}
|
|
|
|
// stop starts the interception.
|
|
func stop() error {
|
|
ebpf.StopEBPFWorker()
|
|
return StopNfqueueInterception()
|
|
}
|
|
|
|
// ResetVerdictOfAllConnections resets all connections so they are forced to go thought the firewall again.
|
|
func ResetVerdictOfAllConnections() error {
|
|
return nfq.DeleteAllMarkedConnection()
|
|
}
|
|
|
|
// UpdateVerdictOfConnection deletes the verdict of the given connection so it can be initialized again with the next packet.
|
|
func UpdateVerdictOfConnection(conn *network.Connection) error {
|
|
return nfq.DeleteMarkedConnection(conn)
|
|
}
|