router

package
v1.3.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 29 Imported by: 0

Documentation

Index

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 CertPool added in v1.3.0

func CertPool() *x509.CertPool

CertPool returns the system certificate pool of the current router.

func DefaultInterfaceName added in v1.3.0

func DefaultInterfaceName() string

DefaultInterfaceName returns the default interface name of the current router.

func HomeDir added in v1.3.0

func HomeDir() (string, error)

HomeDir returns the home directory of ctrld on current router.

func IsGLiNet

func IsGLiNet() bool

IsGLiNet reports whether the router is an GL.iNet 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 Name

func Name() string

Name returns name of the router platform.

func SelfInterfaces added in v1.3.0

func SelfInterfaces() []*net.Interface

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.

func New added in v1.3.0

func New(cfg *ctrld.Config, cdMode bool) Router

New returns new Router interface.

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL