@ -10,6 +10,7 @@ import (
"fmt"
"fmt"
"io/ioutil"
"io/ioutil"
"log"
"log"
"net"
"os"
"os"
"path/filepath"
"path/filepath"
@ -24,6 +25,7 @@ type Prefs struct {
WantRunning bool
WantRunning bool
NotepadURLs bool
NotepadURLs bool
UsePacketFilter bool
UsePacketFilter bool
AdvertiseRoutes [ ] * net . IPNet
// The Persist field is named 'Config' in the file for backward
// The Persist field is named 'Config' in the file for backward
// compatibility with earlier versions.
// compatibility with earlier versions.
@ -34,7 +36,7 @@ type Prefs struct {
}
}
// IsEmpty reports whether p is nil or pointing to a Prefs zero value.
// IsEmpty reports whether p is nil or pointing to a Prefs zero value.
func ( uc * Prefs ) IsEmpty ( ) bool { return uc == nil || * uc == Prefs { } }
func ( uc * Prefs ) IsEmpty ( ) bool { return uc == nil || uc . Equals ( & Prefs { } ) }
func ( uc * Prefs ) Pretty ( ) string {
func ( uc * Prefs ) Pretty ( ) string {
var ucp string
var ucp string
@ -43,9 +45,9 @@ func (uc *Prefs) Pretty() string {
} else {
} else {
ucp = "Persist=nil"
ucp = "Persist=nil"
}
}
return fmt . Sprintf ( "Prefs{ra=%v mesh=%v dns=%v want=%v notepad=%v pf=%v %v}",
return fmt . Sprintf ( "Prefs{ra=%v mesh=%v dns=%v want=%v notepad=%v pf=%v routes=%v %v}",
uc . RouteAll , uc . AllowSingleHosts , uc . CorpDNS , uc . WantRunning ,
uc . RouteAll , uc . AllowSingleHosts , uc . CorpDNS , uc . WantRunning ,
uc . NotepadURLs , uc . UsePacketFilter , uc p)
uc . NotepadURLs , uc . UsePacketFilter , uc . AdvertiseRoutes , uc p)
}
}
func ( uc * Prefs ) ToBytes ( ) [ ] byte {
func ( uc * Prefs ) ToBytes ( ) [ ] byte {