Documentation ¶
Index ¶
- Constants
- Variables
- func CheckAndGetNetworkProxy(log *base.LogObject, dns *types.DeviceNetworkStatus, ifname string, ...) error
- func DnsmasqLeaseFilePath(bridgeIfName string) string
- func IfnameToResolvConf(ifname string) string
- func IsExplicitProxyConfigured(proxyConfig types.ProxyConfig) bool
- func IsProxyConfigEmpty(proxyConfig types.ProxyConfig) bool
- func ResolvConfToIfname(resolvConf string) string
- type DNSResponse
Constants ¶
const ( // DhcpcdResolvConfDir : directory where dhcpcd stores resolv.conf // files separately for every interface (named <interface>.dhcp). DhcpcdResolvConfDir = "/run/dhcpcd/resolv.conf" // WwanResolvConfDir : directory where wwan microservice stores resolv.conf // files separately for every interface (named <interface>.dhcp). WwanResolvConfDir = "/run/wwan/resolv.conf" )
const ( // DPCBaseRTIndex : base index for per-port routing tables used for device // connectivity (between EVE and remote endpoints, such as the controller), // i.e. used for DevicePortConfig (abbreviated to DPC). // Routing table ID is a sum of the base with the interface index of the corresponding // physical interface. DPCBaseRTIndex = 500 // NIBaseRTIndex : base index for per-NI (network instance) routing tables used // for uplink connectivity (between applications and remote endpoints). // Routing table ID is a sum of the base with the "bridge number" allocated // (and persisted) for every network instance. NIBaseRTIndex = 800 // PbrLocalDestPrio : IP rule priority for packets destined to locally owned addresses PbrLocalDestPrio = 12000 // PbrLocalOrigPrio : IP rule priority for locally generated packets PbrLocalOrigPrio = 15000 // PbrNatOutGatewayPrio : IP rule priority for packets destined to gateway(bridge ip) coming from apps. PbrNatOutGatewayPrio = 9999 // PbrNatOutPrio : IP rule priority for packets destined to internet coming from apps PbrNatOutPrio = 10000 // PbrNatInPrio : IP rule priority for external packets coming in towards apps PbrNatInPrio = 11000 )
const ( // WpaFilename : path to WiFi wpa_supplicant file. WpaFilename = "/run/wlan/wpa_supplicant.conf" // RunWlanDir : directory for WLAN-related configuration. RunWlanDir = "/run/wlan" // WpaTempname : name used for a temporary wpa_supplicant file. WpaTempname = "wpa_supplicant.temp" )
const (
// DNSMaxParallelRequests is the maximum amount of parallel DNS requests
DNSMaxParallelRequests = 5
)
Variables ¶
var DnsmasqLeaseDir = "/run/zedrouter/dnsmasq.leases/"
DnsmasqLeaseDir is a directory with files (one per NI bridge) storing IP leases granted to applications by dnsmasq.
var ResolveConfDirs = []string{DhcpcdResolvConfDir, WwanResolvConfDir}
ResolveConfDirs : directories where resolv.conf for an interface could be found.
Functions ¶
func CheckAndGetNetworkProxy ¶
func CheckAndGetNetworkProxy(log *base.LogObject, dns *types.DeviceNetworkStatus, ifname string, metrics *zedcloud.AgentMetrics) error
Download a wpad file if so configured
func DnsmasqLeaseFilePath ¶
DnsmasqLeaseFilePath returns the path to a file with IP leases granted to applications connected to a given bridge.
func IfnameToResolvConf ¶
IfnameToResolvConf : Look for a file created by dhcpcd
func IsExplicitProxyConfigured ¶
func IsExplicitProxyConfigured(proxyConfig types.ProxyConfig) bool
IsExplicitProxyConfigured returns true if EVE is explicitly configured to route traffic via a proxy for a given uplink interface.
func IsProxyConfigEmpty ¶
func IsProxyConfigEmpty(proxyConfig types.ProxyConfig) bool
func ResolvConfToIfname ¶
ResolvConfToIfname : Returns the name of the interface for which the given resolv.conf file was created.
Types ¶
type DNSResponse ¶
DNSResponse represents a response from a DNS server (A Record)
func ResolveWithPortsLambda ¶
func ResolveWithPortsLambda(domain string, dns types.DeviceNetworkStatus, resolve func(string, net.IP, net.IP) ([]DNSResponse, error)) ([]DNSResponse, []error)
ResolveWithPortsLambda resolves a domain by using source IPs and dns servers from DeviceNetworkStatus As a resolver func ResolveWithSrcIP can be used
func ResolveWithSrcIP ¶
ResolveWithSrcIP resolves a domain with a given dns server and source Ip