Documentation ¶
Overview ¶
Package ipam is a very simple IPAM it administers a single CIDR range, e.g "1000::/124".
The functions are NOT thread safe.
Index ¶
- func IPExists(ip net.IP) (bool, error)
- func LinkAddAddr(linkName, IP string) error
- func LinkAddGateway(linkName, gatewayIP string) error
- func LinkRename(old, new string) error
- func LinkSetMaster(linkName, masterName string) error
- func LinkSetNsByFile(filename, linkName string) error
- func LinkSetup(linkName string) error
- func MountNewNetworkNamespace(nsTarget string) (filesystem.Unmounter, error)
- func SetupBridge(name string) error
- func SetupVirtualEthernet(name, peer string) error
- type IPAM
- type Releaser
- type Unsetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LinkAddAddr ¶
func LinkAddGateway ¶
func LinkRename ¶
func LinkSetMaster ¶
func LinkSetNsByFile ¶
func MountNewNetworkNamespace ¶
func MountNewNetworkNamespace(nsTarget string) (filesystem.Unmounter, error)
func SetupBridge ¶
func SetupVirtualEthernet ¶
Types ¶
type IPAM ¶
type IPAM struct {
// contains filtered or unexported fields
}
IPAM holds the ipam state
func (*IPAM) Allocate ¶
Allocate allocates a new address. An error is returned if there is no addresses left.
func (*IPAM) MarshalJSON ¶
func (*IPAM) Reserve ¶
Reserve reserves an address. Error if the address is outside the CIDR or if the address is allocated already.
func (*IPAM) ReserveFirstAndLast ¶
func (i *IPAM) ReserveFirstAndLast()
ReserveFirstAndLast reserves the first and last address. These are valid addresses but some programs may refuse to use them. Note that the number of Unallocated addresses may become zero.
func (*IPAM) Unallocated ¶
Unallocated returns the number of unallocated addresses.
func (*IPAM) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.