mirror of
https://github.com/safing/portmaster
synced 2025-04-21 03:19:10 +00:00
* [service] Subscribe to systemd-resolver events * [service] Add disabled state to the resolver * [service] Add ETW DNS event listener * [service] DNS listener refactoring * [service] Add windows core dll project * [service] DNSListener refactoring, small bugfixes * [service] Change dns bypass rule * [service] Update gitignore * [service] Remove shim from integration module * [service] Add DNS packet analyzer * [service] Add self-check in dns monitor * [service] Fix go linter errors * [CI] Add github workflow for the windows core dll * [service] Minor fixes to the dns monitor
49 lines
904 B
Go
49 lines
904 B
Go
package integration
|
|
|
|
import (
|
|
"github.com/safing/portmaster/service/mgr"
|
|
"github.com/safing/portmaster/service/updates"
|
|
)
|
|
|
|
// OSIntegration module provides special integration with the OS.
|
|
type OSIntegration struct {
|
|
m *mgr.Manager
|
|
states *mgr.StateMgr
|
|
|
|
//nolint:unused
|
|
os OSSpecific
|
|
|
|
instance instance
|
|
}
|
|
|
|
// New returns a new OSIntegration module.
|
|
func New(instance instance) (*OSIntegration, error) {
|
|
m := mgr.New("OSIntegration")
|
|
module := &OSIntegration{
|
|
m: m,
|
|
states: m.NewStateMgr(),
|
|
|
|
instance: instance,
|
|
}
|
|
|
|
return module, nil
|
|
}
|
|
|
|
// Manager returns the module manager.
|
|
func (i *OSIntegration) Manager() *mgr.Manager {
|
|
return i.m
|
|
}
|
|
|
|
// Start starts the module.
|
|
func (i *OSIntegration) Start() error {
|
|
return i.Initialize()
|
|
}
|
|
|
|
// Stop stops the module.
|
|
func (i *OSIntegration) Stop() error {
|
|
return i.CleanUp()
|
|
}
|
|
|
|
type instance interface {
|
|
Updates() *updates.Updates
|
|
}
|