package config

import (
	"gitea.sunhpc.com/kelvin/sunhpc/internal/pkg/util"
)

// DNSmasqConf represents the configuration for the DNSmasq service that
// Sunhpc will configure.
type DNSMASQConf struct {
	EnabledP    *bool  `yaml:"enabled,omitempty" default:"true"`
	Template    string `yaml:"template,omitempty" default:"default"`
	RangeStart  string `yaml:"range start,omitempty"`
	RangeEnd    string `yaml:"range end,omitempty"`
	Range6Start string `yaml:"range6 start,omitempty"`
	Range6End   string `yaml:"range6 end,omitempty"`
	SystemdName string `yaml:"systemd name,omitempty" default:"dhcpd"`
}

func (conf DNSMASQConf) Enabled() bool {
	return util.BoolP(conf.EnabledP)
}