Documentation ¶
Index ¶
- Constants
- type APILease
- type APILeaseInfo
- type APILeasesDeleteInput
- type APILeasesGetInput
- type APILeasesGetOutput
- type APILeasesPutInput
- type APILeasesWOLInput
- type APIRoleConfigInput
- type APIRoleConfigOutput
- type APIScope
- type APIScopeStatistics
- type APIScopesDeleteInput
- type APIScopesGetInput
- type APIScopesGetOutput
- type APIScopesPutInput
- type Handler4
- type IPAM
- type IPUse
- type InternalIPAM
- func (i *InternalIPAM) GetSubnetMask() net.IPMask
- func (i *InternalIPAM) IsIPFree(ip netip.Addr, identifier *string) bool
- func (i *InternalIPAM) NextFreeAddress(identifier string) *netip.Addr
- func (i *InternalIPAM) UpdateConfig(s *Scope) error
- func (i *InternalIPAM) UsableSize() *big.Int
- func (i *InternalIPAM) UseIP(ip netip.Addr, identifier string)
- type Lease
- type Request4
- type Role
- func (r *Role) APILeasesDelete() usecase.Interactor
- func (r *Role) APILeasesGet() usecase.Interactor
- func (r *Role) APILeasesPut() usecase.Interactor
- func (r *Role) APILeasesWOL() usecase.Interactor
- func (r *Role) APIRoleConfigGet() usecase.Interactor
- func (r *Role) APIRoleConfigPut() usecase.Interactor
- func (r *Role) APIScopesDelete() usecase.Interactor
- func (r *Role) APIScopesGet() usecase.Interactor
- func (r *Role) APIScopesPut() usecase.Interactor
- func (r *Role) DeviceIdentifier(m *dhcpv4.DHCPv4) string
- func (r *Role) FindLease(req *Request4) *Lease
- func (r *Role) HandleDHCPDecline4(req *Request4) *dhcpv4.DHCPv4
- func (r *Role) HandleDHCPDiscover4(req *Request4) *dhcpv4.DHCPv4
- func (r *Role) HandleDHCPRequest4(req *Request4) *dhcpv4.DHCPv4
- func (r *Role) Handler4(re *Request4) *dhcpv4.DHCPv4
- func (r *Role) NewLease(identifier string) *Lease
- func (r *Role) NewRequest4(dhcp *dhcpv4.DHCPv4) *Request4
- func (r *Role) NewScope(name string) *Scope
- func (r *Role) Start(ctx context.Context, config []byte) error
- func (r *Role) Stop()
- type RoleConfig
- type Scope
- type ScopeDNS
Constants ¶
View Source
const InternalIPAMType = "internal"
View Source
const MaxDatagram = 1 << 16
MaxDatagram is the maximum length of message that can be received.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APILease ¶
type APILease struct { Info *APILeaseInfo `json:"info"` Identifier string `json:"identifier" required:"true"` Address string `json:"address" required:"true"` Hostname string `json:"hostname" required:"true"` AddressLeaseTime string `json:"addressLeaseTime" required:"true"` ScopeKey string `json:"scopeKey" required:"true"` DNSZone string `json:"dnsZone"` Expiry int64 `json:"expiry"` }
type APILeaseInfo ¶ added in v0.3.13
type APILeaseInfo struct {
Vendor string `json:"vendor"`
}
type APILeasesDeleteInput ¶
type APILeasesGetInput ¶
type APILeasesGetOutput ¶
type APILeasesGetOutput struct {
Leases []*APILease `json:"leases" required:"true"`
}
type APILeasesPutInput ¶
type APILeasesPutInput struct { Identifier string `query:"identifier" required:"true" maxLength:"255"` Scope string `query:"scope" required:"true" maxLength:"255"` Address string `json:"address" required:"true" maxLength:"40"` Hostname string `json:"hostname" required:"true" maxLength:"255"` AddressLeaseTime string `json:"addressLeaseTime" required:"true" maxLength:"40"` DNSZone string `json:"dnsZone" maxLength:"255"` Expiry int64 `json:"expiry"` }
type APILeasesWOLInput ¶
type APIRoleConfigInput ¶
type APIRoleConfigInput struct {
Config RoleConfig `json:"config" required:"true"`
}
type APIRoleConfigOutput ¶
type APIRoleConfigOutput struct {
Config RoleConfig `json:"config" required:"true"`
}
type APIScope ¶
type APIScope struct { IPAM map[string]string `json:"ipam" required:"true"` DNS *ScopeDNS `json:"dns"` Name string `json:"scope" required:"true"` SubnetCIDR string `json:"subnetCidr" required:"true"` Options []*types.DHCPOption `json:"options" required:"true"` TTL int64 `json:"ttl" required:"true"` Default bool `json:"default" required:"true"` Hook string `json:"hook" required:"true"` Statistics APIScopeStatistics `json:"statistics" required:"true"` }
type APIScopeStatistics ¶ added in v0.11.0
type APIScopesDeleteInput ¶
type APIScopesDeleteInput struct {
Scope string `query:"scope" required:"true"`
}
type APIScopesGetInput ¶ added in v0.4.6
type APIScopesGetInput struct {
Name string `query:"name" description:"Optionally get DHCP Scope by name"`
}
type APIScopesGetOutput ¶
type APIScopesGetOutput struct { Scopes []*APIScope `json:"scopes" required:"true"` Statistics APIScopeStatistics `json:"statistics" required:"true"` }
type APIScopesPutInput ¶
type APIScopesPutInput struct { IPAM map[string]string `json:"ipam"` DNS *ScopeDNS `json:"dns"` Name string `query:"scope" required:"true" maxLength:"255"` SubnetCIDR string `json:"subnetCidr" required:"true" maxLength:"40"` Options []*types.DHCPOption `json:"options" required:"true"` TTL int64 `json:"ttl" required:"true"` Default bool `json:"default" required:"true"` Hook string `json:"hook" required:"true"` }
type IPAM ¶
type IPAM interface { // Return the next free IP address, could be sequential or random NextFreeAddress(identifier string) *netip.Addr // Check if IP address is in usage (should also check if IP is in specified range and subnet) // Can optionally also check if the IP address is pingable // `identifier` might be given as well for a device that could request an address // that it had already taken IsIPFree(addr netip.Addr, identifier *string) bool // Get the subnet mask of the scope GetSubnetMask() net.IPMask // Mark an IP as used UseIP(addr netip.Addr, identifier string) // Update config when scope is updated UpdateConfig(s *Scope) error // Amount of usable IPs excluding any exclusions UsableSize() *big.Int }
type InternalIPAM ¶
type InternalIPAM struct { Start netip.Addr End netip.Addr SubnetCIDR netip.Prefix // contains filtered or unexported fields }
func NewInternalIPAM ¶
func NewInternalIPAM(role *Role, s *Scope) (*InternalIPAM, error)
func (*InternalIPAM) GetSubnetMask ¶
func (i *InternalIPAM) GetSubnetMask() net.IPMask
func (*InternalIPAM) IsIPFree ¶
func (i *InternalIPAM) IsIPFree(ip netip.Addr, identifier *string) bool
func (*InternalIPAM) NextFreeAddress ¶
func (i *InternalIPAM) NextFreeAddress(identifier string) *netip.Addr
func (*InternalIPAM) UpdateConfig ¶ added in v0.9.0
func (i *InternalIPAM) UpdateConfig(s *Scope) error
func (*InternalIPAM) UsableSize ¶ added in v0.11.0
func (i *InternalIPAM) UsableSize() *big.Int
type Lease ¶
type Lease struct { Identifier string `json:"-"` Address string `json:"address"` Hostname string `json:"hostname"` AddressLeaseTime string `json:"addressLeaseTime,omitempty"` ScopeKey string `json:"scopeKey"` DNSZone string `json:"dnsZone,omitempty"` // Set to -1 for a reservation Expiry int64 `json:"expiry"` // contains filtered or unexported fields }
func (*Lease) IsReservation ¶ added in v0.6.18
type Request4 ¶
type Role ¶
type Role struct {
// contains filtered or unexported fields
}
func (*Role) APILeasesDelete ¶
func (r *Role) APILeasesDelete() usecase.Interactor
func (*Role) APILeasesGet ¶
func (r *Role) APILeasesGet() usecase.Interactor
func (*Role) APILeasesPut ¶
func (r *Role) APILeasesPut() usecase.Interactor
func (*Role) APILeasesWOL ¶
func (r *Role) APILeasesWOL() usecase.Interactor
func (*Role) APIRoleConfigGet ¶
func (r *Role) APIRoleConfigGet() usecase.Interactor
func (*Role) APIRoleConfigPut ¶
func (r *Role) APIRoleConfigPut() usecase.Interactor
func (*Role) APIScopesDelete ¶
func (r *Role) APIScopesDelete() usecase.Interactor
func (*Role) APIScopesGet ¶
func (r *Role) APIScopesGet() usecase.Interactor
func (*Role) APIScopesPut ¶
func (r *Role) APIScopesPut() usecase.Interactor
type RoleConfig ¶
type Scope ¶
type Scope struct { DNS *ScopeDNS `json:"dns"` IPAM map[string]string `json:"ipam"` Name string `json:"-"` SubnetCIDR string `json:"subnetCidr"` Options []*types.DHCPOption `json:"options"` TTL int64 `json:"ttl"` Default bool `json:"default"` Hook string `json:"hook"` // contains filtered or unexported fields }
Source Files ¶
- api_leases.go
- api_scopes.go
- dhcp_handler4.go
- dhcp_handler4_decline.go
- dhcp_handler4_discover.go
- dhcp_handler4_request.go
- ethernet.go
- event_handler.go
- ipam.go
- ipam_internal.go
- leasees_wol.go
- leases.go
- leases_watch.go
- metrics.go
- middleware.go
- role.go
- role_config.go
- role_oui.go
- scopes.go
- scopes_watch.go
Click to show internal directories.
Click to hide internal directories.