mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-11 17:31:12 +01:00
ba7a39a4fc
Update the client's engine to apply firewall rules received from the manager (results of ACL policy).
28 lines
619 B
Go
28 lines
619 B
Go
//go:build !linux
|
|
|
|
package acl
|
|
|
|
import (
|
|
"fmt"
|
|
"runtime"
|
|
|
|
"github.com/netbirdio/netbird/client/firewall"
|
|
"github.com/netbirdio/netbird/client/firewall/uspfilter"
|
|
)
|
|
|
|
// Create creates a firewall manager instance
|
|
func Create(iface iFaceMapper) (manager *DefaultManager, err error) {
|
|
if iface.IsUserspaceBind() {
|
|
// use userspace packet filtering firewall
|
|
fm, err := uspfilter.Create(iface)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &DefaultManager{
|
|
manager: fm,
|
|
rulesPairs: make(map[string][]firewall.Rule),
|
|
}, nil
|
|
}
|
|
return nil, fmt.Errorf("not implemented for this OS: %s", runtime.GOOS)
|
|
}
|