ip

package
v0.0.0-...-a9387a1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatHost

func FormatHost(host string) string

func IsIP

func IsIP(s string) bool

func LookupHost

func LookupHost(host string) ([]string, error)

func MatchIPNet

func MatchIPNet(child, parent *net.IPNet) bool

Types

type DHCP

type DHCP struct {
	IPNet     *IPNet
	Gateway   IP
	Boardcast IP
	IpSize    int
	// contains filtered or unexported fields
}

use for alloc ip address

func NewDHCP

func NewDHCP(ipnet *IPNet) *DHCP

func (*DHCP) Alloc

func (d *DHCP) Alloc() *IP

func (*DHCP) IsExistIP

func (d *DHCP) IsExistIP(ip IP) bool

func (*DHCP) Release

func (d *DHCP) Release(ip IP) bool

type IP

type IP [4]byte

func CopyIP

func CopyIP(ip net.IP) IP

func NewIP

func NewIP(b []byte) (ret IP)

func ParseIP

func ParseIP(s string) IP

func ParseIntIP

func ParseIntIP(ip uint32) IP

func (IP) Clone

func (ip IP) Clone() IP

func (IP) Equal

func (i IP) Equal(i2 IP) bool

func (IP) IP

func (ip IP) IP() net.IP

func (IP) Int

func (ip IP) Int() uint32

func (IP) String

func (i IP) String() string

type IPNet

type IPNet struct {
	IP   IP         // network number
	Mask net.IPMask // network mask
}

func ParseCIDR

func ParseCIDR(s string) (*IPNet, error)

func (IPNet) ParseArgs

func (IPNet) ParseArgs(args []string) (reflect.Value, error)

func (*IPNet) String

func (in *IPNet) String() string

func (*IPNet) ToNet

func (i *IPNet) ToNet() *net.IPNet

func (IPNet) Type

func (IPNet) Type() reflect.Type

Jump to

Keyboard shortcuts

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