mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 21:27:31 +00:00
cmd/tailscaled,*: add start of configuration file support
Updates #1412 Co-authored-by: Maisem Ali <maisem@tailscale.com> Change-Id: I38d559c1784d09fc804f521986c9b4b548718f7d Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
71271e41d6
commit
18bd98d35b
@@ -5,6 +5,8 @@
|
||||
// preferences.
|
||||
package preftype
|
||||
|
||||
import "fmt"
|
||||
|
||||
// NetfilterMode is the firewall management mode to use when
|
||||
// programming the Linux network stack.
|
||||
type NetfilterMode int
|
||||
@@ -17,6 +19,19 @@ const (
|
||||
NetfilterOn NetfilterMode = 2 // manage tailscale chains and call them from main chains
|
||||
)
|
||||
|
||||
func ParseNetfilterMode(s string) (NetfilterMode, error) {
|
||||
switch s {
|
||||
case "off":
|
||||
return NetfilterOff, nil
|
||||
case "nodivert":
|
||||
return NetfilterNoDivert, nil
|
||||
case "on":
|
||||
return NetfilterOn, nil
|
||||
default:
|
||||
return NetfilterOff, fmt.Errorf("unknown netfilter mode %q", s)
|
||||
}
|
||||
}
|
||||
|
||||
func (m NetfilterMode) String() string {
|
||||
switch m {
|
||||
case NetfilterOff:
|
||||
|
Reference in New Issue
Block a user