dnsmasq

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MerlinConfPath     = "/tmp/etc/dnsmasq.conf"
	MerlinJffsConfDir  = "/jffs/configs"
	MerlinJffsConfPath = "/jffs/configs/dnsmasq.conf"
	MerlinPostConfPath = "/jffs/scripts/dnsmasq.postconf"
)
View Source
const ConfigContentTmpl = `` /* 209-byte string literal not displayed */
View Source
const CtrldMarker = `# GENERATED BY ctrld - DO NOT MODIFY`
View Source
const MerlinPostConfMarker = `# GENERATED BY ctrld - EOF`
View Source
const MerlinPostConfTmpl = `` /* 1228-byte string literal not displayed */
View Source
const (
	UbiosConfName = "zzzctrld.conf"
)

Variables

This section is empty.

Functions

func AdditionalConfigFiles added in v1.4.5

func AdditionalConfigFiles() []string

AdditionalConfigFiles returns a list of Dnsmasq configuration files found in the "/tmp/etc" directory.

func AdditionalLeaseFiles added in v1.4.5

func AdditionalLeaseFiles() []string

AdditionalLeaseFiles returns a list of lease file paths corresponding to the Dnsmasq configuration files.

func ConfTmpl

func ConfTmpl(tmplText string, cfg *ctrld.Config) (string, error)

ConfTmpl generates dnsmasq configuration from ctrld config.

func ConfTmplWithCacheDisabled added in v1.3.4

func ConfTmplWithCacheDisabled(tmplText string, cfg *ctrld.Config, cacheDisabled bool) (string, error)

ConfTmplWithCacheDisabled is like ConfTmpl, but the caller can control whether dnsmasq cache is disabled using cacheDisabled parameter.

Generally, the caller should use ConfTmpl, but on some routers which dnsmasq config may be changed after ctrld started (like EdgeOS/Ubios, Firewalla ...), dnsmasq cache should not be disabled because the cache-size=0 generated by ctrld will conflict with router's generated config.

func FirewallaConfTmpl

func FirewallaConfTmpl(tmplText string, cfg *ctrld.Config) (string, error)

FirewallaConfTmpl generates dnsmasq config for Firewalla routers.

func FirewallaSelfInterfaces

func FirewallaSelfInterfaces() []*net.Interface

FirewallaSelfInterfaces returns list of interfaces that will be configured with default dnsmasq setup on Firewalla.

func InterfaceNameFromConfig

func InterfaceNameFromConfig(filename string) (string, error)

func UbiosConfPath added in v1.4.5

func UbiosConfPath() string

UbiosConfPath returns the appropriate configuration path based on the system's directory structure.

func UbiosPidFile added in v1.4.5

func UbiosPidFile() string

UbiosPidFile returns the appropriate dnsmasq pid file based on the system's directory structure.

Types

type Upstream

type Upstream struct {
	IP   string
	Port int
}

Jump to

Keyboard shortcuts

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