ipam

package
v0.0.0-...-150aa9a Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IPOverflowError = "IP地址已用完"
)

Functions

This section is empty.

Types

type IPAddressManagement

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

IPAddressManagement 是IP地址管理器

func NewIPAddressManagement

func NewIPAddressManagement(c *config.CNIConfig, s *store.Store) (*IPAddressManagement, error)

NewIpAddressManagement 创建一个新的IP地址管理器

func (*IPAddressManagement) AllocateIP

func (im *IPAddressManagement) AllocateIP(id, ifName string) (net.IP, error)

AllocateIP 分配IP地址

func (*IPAddressManagement) CheckIP

func (im *IPAddressManagement) CheckIP(id string) (net.IP, error)

CheckIP 检查IP地址是否可用

func (*IPAddressManagement) Gateway

func (im *IPAddressManagement) Gateway() net.IP

Gateway 获取网关

func (*IPAddressManagement) IpNet

func (im *IPAddressManagement) IpNet(ip net.IP) *net.IPNet

IpNet 获取IP网段

func (*IPAddressManagement) Mask

func (im *IPAddressManagement) Mask() net.IPMask

Mask 获取子网掩码

func (*IPAddressManagement) NextIP

func (im *IPAddressManagement) NextIP(ip net.IP) (net.IP, error)

NextIP 获取下一个可用的IP地址

func (*IPAddressManagement) ReleaseIP

func (im *IPAddressManagement) ReleaseIP(id string) error

ReleaseIP 释放IP地址

Jump to

Keyboard shortcuts

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