iputil

package module
v0.0.0-...-37f78ad Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 5 Imported by: 9

README

ip utility

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressFamily

type AddressFamily string
const (
	AddressFamilyIpv4    AddressFamily = "ipv4"
	AddressFamilyIpv6    AddressFamily = "ipv6"
	AddressFamilyUnknown AddressFamily = "unknown"
)

func (AddressFamily) String

func (s AddressFamily) String() string

type IsIPv6

type IsIPv6 bool

type Prefix

type Prefix struct {
	netip.Prefix
}

func New

func New(prefix string) (*Prefix, error)

func NewPrefixInfo

func NewPrefixInfo(p netip.Prefix) *Prefix

func (*Prefix) GetAddressFamily

func (r *Prefix) GetAddressFamily() AddressFamily

func (*Prefix) GetAddressPrefixLength

func (r *Prefix) GetAddressPrefixLength() PrefixLength

return 32 or 128

func (*Prefix) GetFirstIPAddress

func (r *Prefix) GetFirstIPAddress() netip.Addr

func (*Prefix) GetFirstIPPrefix

func (r *Prefix) GetFirstIPPrefix() netip.Prefix

func (*Prefix) GetIPAddress

func (r *Prefix) GetIPAddress() netip.Addr

func (*Prefix) GetIPAddressPrefix

func (r *Prefix) GetIPAddressPrefix() netip.Prefix

func (*Prefix) GetIPPrefix

func (r *Prefix) GetIPPrefix() netip.Prefix

func (*Prefix) GetIPPrefixWithPrefixLength

func (r *Prefix) GetIPPrefixWithPrefixLength(pl int) netip.Prefix

func (*Prefix) GetIPSubnet

func (r *Prefix) GetIPSubnet() netip.Prefix

func (*Prefix) GetLastIPAddress

func (r *Prefix) GetLastIPAddress() netip.Addr

func (*Prefix) GetLastIPPrefix

func (r *Prefix) GetLastIPPrefix() netip.Prefix

func (*Prefix) GetPrefixLength

func (r *Prefix) GetPrefixLength() PrefixLength

func (*Prefix) GetSubnetName

func (r *Prefix) GetSubnetName() string

func (*Prefix) IsAddressPrefix

func (r *Prefix) IsAddressPrefix() bool

func (*Prefix) IsFirst

func (r *Prefix) IsFirst() bool

func (*Prefix) IsIpv4

func (r *Prefix) IsIpv4() bool

func (*Prefix) IsIpv6

func (r *Prefix) IsIpv6() bool

func (*Prefix) IsLast

func (r *Prefix) IsLast() bool

func (*Prefix) IsNorLastNorFirst

func (r *Prefix) IsNorLastNorFirst() bool

func (*Prefix) IsPrefixPresentInSubnetMap

func (r *Prefix) IsPrefixPresentInSubnetMap(prefix string) bool

type PrefixClaims

type PrefixClaims map[IsIPv6][]*string

func (PrefixClaims) AddPrefix

func (r PrefixClaims) AddPrefix(isIPv6 IsIPv6, prefix *string)

type PrefixLength

type PrefixLength int

func (PrefixLength) Int

func (r PrefixLength) Int() int

func (PrefixLength) String

func (r PrefixLength) String() string

Jump to

Keyboard shortcuts

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