Documentation
¶
Index ¶
- Constants
- func CompareCIDRs(subnet1 string, subnet2 string) bool
- func FilterIPsInCIDRs(ips []net.IP, cidrs []string) (filteredIps []net.IP, err error)
- type Kea
- func (k Kea) ControlAgentGetIPsForLease(deviceName string) (ips []net.IP, err error)
- func (k Kea) ControlAgentGetIPsForReservation(deviceName string) (ips []net.IP, err error)
- func (k Kea) GetIPsForHostname(deviceName string) (ips []net.IP, err error)
- func (k Kea) MakeControlAgentRequest(requestBody string) (responseBody []byte, err error)
- func (k Kea) Name() string
- func (e Kea) Ready() bool
- func (k Kea) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)
- type KeaDHCP4Conf
- type KeaDHCP6Conf
- type KeaLeaseRecords
- type KeaReservationRecords
- type KeaResultCode
Constants ¶
View Source
const KEA_IPV4_SERVICE_NAME = "dhcp4"
View Source
const KEA_IPV6_SERVICE_NAME = "dhcp6"
View Source
const KEA_LIST_LEASES_BY_HOSTNAME_TEMPLATE = `{
"command": "lease4-get-by-hostname",
"arguments": {
"hostname": "%s"
},
"service": [
%s
]
}`
View Source
const KEA_LIST_RESERVATIONS_BY_HOSTNAME_TEMPLATE = `{
"command": "reservation-get-by-hostname",
"arguments": {
"hostname": "%s"
},
"service": [
%s
]
}`
Variables ¶
This section is empty.
Functions ¶
func CompareCIDRs ¶
Types ¶
type Kea ¶
type Kea struct {
ControlAgent string
Networks []string
ExtractHostname string
ControlAgentLeases string
ControlAgentReservations string
Insecure string
Next plugin.Handler
UseIPv4 string
UseIPv6 string
DHCP4ConfPath string
DHCP6ConfPath string
DHCP4Conf KeaDHCP4Conf
DHCP6Conf KeaDHCP6Conf
}
func (Kea) ControlAgentGetIPsForLease ¶
func (Kea) ControlAgentGetIPsForReservation ¶
func (Kea) GetIPsForHostname ¶
func (Kea) MakeControlAgentRequest ¶
type KeaDHCP4Conf ¶
type KeaDHCP4Conf struct {
Dhcp4 struct {
Subnet4 []struct {
Subnet string `json:"subnet"`
Reservations []struct {
IpAddress string `json:"ip-address"`
HwAddress string `json:"hw-address"`
Hostname string `json:"hostname,omitempty"`
} `json:"reservations,omitempty"`
} `json:"subnet4"`
} `json:"Dhcp4"`
}
type KeaDHCP6Conf ¶
type KeaDHCP6Conf struct {
Dhcp6 struct {
Subnet6 []struct {
Subnet string `json:"subnet"`
Reservations []struct {
IpAddresses []string `json:"ip-addresses"`
HwAddress string `json:"hw-address"`
Hostname string `json:"hostname,omitempty"`
} `json:"reservations,omitempty"`
} `json:"subnet6"`
} `json:"Dhcp6"`
}
type KeaLeaseRecords ¶
type KeaLeaseRecords []struct {
Arguments struct {
Leases []struct {
Cltt int `json:"cltt"`
FqdnFwd bool `json:"fqdn-fwd"`
FqdnRev bool `json:"fqdn-rev"`
Hostname string `json:"hostname"`
HwAddress string `json:"hw-address"`
IPAddress string `json:"ip-address"`
State int `json:"state"`
SubnetID int `json:"subnet-id"`
ValidLft int `json:"valid-lft"`
} `json:"leases"`
} `json:"arguments,omitempty"`
Result KeaResultCode `json:"result"`
Text string `json:"text"`
}
type KeaReservationRecords ¶
type KeaReservationRecords []struct {
Arguments struct {
Hosts []struct {
Hostname string `json:"hostname"`
HwAddress string `json:"hw-address"`
IPAddress string `json:"ip-address,omitempty"`
IPAddresses []string `json:"ip-addresses,omitempty"`
SubnetID int `json:"subnet-id"`
} `json:"hosts"`
} `json:"arguments,omitempty"`
Result KeaResultCode `json:"result"`
Text string `json:"text"`
}
type KeaResultCode ¶
type KeaResultCode int
const ( Success KeaResultCode = iota Error Unsupported NoContent )
Click to show internal directories.
Click to hide internal directories.