Documentation ¶
Index ¶
- func CanListenLocalhost() bool
- func CertPool() *x509.CertPool
- func DefaultInterfaceName() string
- func HomeDir() (string, error)
- func IsGLiNet() bool
- func IsNetGearOrbi() bool
- func IsOldOpenwrt() bool
- func LeaseFilesDir() string
- func LocalResolverIP() string
- func Name() string
- func SelfInterfaces() []*net.Interface
- type Router
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanListenLocalhost ¶ added in v1.3.0
func CanListenLocalhost() bool
CanListenLocalhost reports whether the ctrld can listen on localhost with current host.
func DefaultInterfaceName ¶ added in v1.3.0
func DefaultInterfaceName() string
DefaultInterfaceName returns the default interface name of the current router.
func IsNetGearOrbi ¶ added in v1.3.6
func IsNetGearOrbi() bool
IsNetGearOrbi reports whether the router is a Netgear Orbi router.
func IsOldOpenwrt ¶ added in v1.2.1
func IsOldOpenwrt() bool
IsOldOpenwrt reports whether the router is an "old" version of Openwrt, aka versions which don't have "service" command.
func LeaseFilesDir ¶ added in v1.3.1
func LeaseFilesDir() string
LeaseFilesDir is the directory which contains lease files.
func LocalResolverIP ¶ added in v1.3.0
func LocalResolverIP() string
LocalResolverIP returns the IP that could be used as nameserver in /etc/resolv.conf file.
func SelfInterfaces ¶ added in v1.3.0
SelfInterfaces return list of *net.Interface that will be source of requests from router itself.
Types ¶
type Router ¶ added in v1.3.0
type Router interface { Service // PreRun performs works need to be done before ctrld being run on router. // Implementation should only return if the pre-condition was met (e.g: ntp synced). PreRun() error // Setup configures ctrld to be run on the router. Setup() error // Cleanup cleans up works setup on router by ctrld. Cleanup() error }
Router is the interface for managing ctrld running on router.
type Service ¶ added in v1.3.0
type Service interface { // ConfigureService performs works for installing ctrla as a service on router. ConfigureService(*service.Config) error // Install performs necessary works after service.Install done. Install(*service.Config) error // Uninstall performs necessary works after service.Uninstallation done. Uninstall(*service.Config) error }
Service is the interface to manage ctrld service on router.