package config import "fmt" type ProxyNDP struct { // Address is the IPv6 address to proxy NDP for. Address string `yaml:"address"` // Interface is the local interface where the proxied host resides. Interface string `yaml:"interface,omitempty"` // External is the external-facing interface. External string `yaml:"external"` // HaveRoute indicates that a route to the address already exists. HaveRoute bool `yaml:"haveroute,omitempty"` // Persistent survives firewall restarts. Persistent bool `yaml:"persistent,omitempty"` Comment string `yaml:"comment,omitempty"` } func (c *Config) validateProxyNDP() error { for i, p := range c.ProxyNDP { if p.Address == "" { return fmt.Errorf("proxyndp[%d]: address required", i) } if p.External == "" { return fmt.Errorf("proxyndp[%d]: external required", i) } if p.Interface == "" && !p.HaveRoute { return fmt.Errorf("proxyndp[%d]: interface required unless haveroute is set", i) } } return nil }