addressmanager

package
v0.10.1-alpha.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache v2.0 license.

Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache v2.0 license.

Index

Constants

View Source
const (
	MacLengthBytes = 6
	MacLengthBits  = 48
	EcpMacPrefix   = "02:EC" // This is the default prefix chosen for ECP
)

Variables

This section is empty.

Functions

func DoMacpoolsOverlap

func DoMacpoolsOverlap(firstMacPool *MacPool, secondMacPool *MacPool) bool

func GetDefaultMacPoolRange

func GetDefaultMacPoolRange() (startMac string, endMac string)

func ValidatePoolRange

func ValidatePoolRange(startAddress net.HardwareAddr, endAddress net.HardwareAddr) error

Types

type Ipam

type Ipam struct {
	// contains filtered or unexported fields
}

func NewIpam

func NewIpam(prefix net.IP, prefixLengthBits uint) (*Ipam, error)

func (*Ipam) AllocateAddress

func (c *Ipam) AllocateAddress(ipAddressStr string) error

func (*Ipam) AllocateNextAvailable

func (c *Ipam) AllocateNextAvailable(ip *net.IP) (bool, *net.IP, error)

func (*Ipam) Clear

func (c *Ipam) Clear(ip *net.IP) error

func (*Ipam) ClearRange

func (c *Ipam) ClearRange(startIp *net.IP, endIp *net.IP, force bool) error

func (*Ipam) Get

func (c *Ipam) Get(ip *net.IP) (bool, error)

func (*Ipam) GetNextAllocated

func (c *Ipam) GetNextAllocated(ip *net.IP) (bool, *net.IP, error)

func (*Ipam) GetNextAvailable

func (c *Ipam) GetNextAvailable(ip *net.IP) (bool, *net.IP, error)

func (*Ipam) GetPreviousAllocated

func (c *Ipam) GetPreviousAllocated(ip *net.IP) (bool, *net.IP, error)

func (*Ipam) GetPreviousAvailable

func (c *Ipam) GetPreviousAvailable(ip *net.IP) (bool, *net.IP, error)

func (*Ipam) GetRange

func (c *Ipam) GetRange(startIp *net.IP, endIp *net.IP) (bool, error)

func (*Ipam) IsEmpty

func (c *Ipam) IsEmpty() bool

func (*Ipam) IsFull

func (c *Ipam) IsFull() bool

func (*Ipam) ReleaseAddress

func (c *Ipam) ReleaseAddress(ipAddressStr string) error

func (*Ipam) Set

func (c *Ipam) Set(ip *net.IP) error

func (*Ipam) SetRange

func (c *Ipam) SetRange(startIp *net.IP, endIp *net.IP) error

func (*Ipam) ToJson

func (c *Ipam) ToJson() (string, error)

type MacPool

type MacPool struct {
	// contains filtered or unexported fields
}

func NewMacPool

func NewMacPool(pbMacPool *pb.MacPool) (*MacPool, error)

func (*MacPool) AllocateAddress

func (c *MacPool) AllocateAddress(macAddressStr string) error

func (*MacPool) AllocateNextAvailable

func (c *MacPool) AllocateNextAvailable() (bool, string, error)

func (*MacPool) IsFull

func (c *MacPool) IsFull() bool

func (*MacPool) ReleaseAddress

func (c *MacPool) ReleaseAddress(macAddressStr string) error

func (*MacPool) ValidatePoolForMac

func (c *MacPool) ValidatePoolForMac(macAddressStr string) error

type MacRange

type MacRange struct {
	// contains filtered or unexported fields
}

type Macam

type Macam struct {
	// contains filtered or unexported fields
}

func NewMacAm

func NewMacAm(prefix net.HardwareAddr, prefixLengthBits uint) (*Macam, error)

func (*Macam) AddressToMac

func (c *Macam) AddressToMac(suffixAsAddress *bittree.BitTreeAddress) *net.HardwareAddr

func (*Macam) Clear

func (c *Macam) Clear(mac *net.HardwareAddr) error

func (*Macam) ClearRange

func (c *Macam) ClearRange(startIp *net.HardwareAddr, endIp *net.HardwareAddr, force bool) error

func (*Macam) Get

func (c *Macam) Get(mac *net.HardwareAddr) (bool, error)

func (*Macam) GetNextAllocated

func (c *Macam) GetNextAllocated(mac *net.HardwareAddr) (bool, *net.HardwareAddr, error)

func (*Macam) GetNextAvailable

func (c *Macam) GetNextAvailable(mac *net.HardwareAddr) (bool, *net.HardwareAddr, error)

func (*Macam) GetPreviousAllocated

func (c *Macam) GetPreviousAllocated(mac *net.HardwareAddr) (bool, *net.HardwareAddr, error)

func (*Macam) GetPreviousAvailable

func (c *Macam) GetPreviousAvailable(mac *net.HardwareAddr) (bool, *net.HardwareAddr, error)

func (*Macam) GetRange

func (c *Macam) GetRange(startIp *net.HardwareAddr, endIp *net.HardwareAddr) (bool, error)

func (*Macam) IsEmpty

func (c *Macam) IsEmpty() bool

func (*Macam) IsFull

func (c *Macam) IsFull() bool

func (*Macam) MacToAddress

func (c *Macam) MacToAddress(mac *net.HardwareAddr) (*bittree.BitTreeAddress, error)

Private functions

func (*Macam) Set

func (c *Macam) Set(mac *net.HardwareAddr) error

func (*Macam) SetRange

func (c *Macam) SetRange(startIp *net.HardwareAddr, endIp *net.HardwareAddr) error

func (*Macam) ToJson

func (c *Macam) ToJson() (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL