ipv6

package
v0.1.42 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GlobalUnicastName name for global unicast type
	GlobalUnicastName = "global-unicast"
	// LinkLocalName name for link local type
	LinkLocalName = "link-local"
	// UniqueLocalName name for unique local type
	UniqueLocalName = "unique-local"
	// PrivateName name for private type
	PrivateName = "private"
	// MulticastName name for multicast type
	MulticastName = "multicast"
	// InterfaceLocalMulticastName name for interface local multicast type
	InterfaceLocalMulticastName = "interface-local-multicast"
	// LinkLocalMulticastName name for link local multicast type
	LinkLocalMulticastName = "link-local-multicast"
)
View Source
const (
	// GlobalUnicast IPV6 type
	GlobalUnicast = iota
	// UniqueLocal IPV6 type
	UniqueLocal
	// LinkLocalUnicast IPV6 type
	LinkLocalUnicast
	// Loopback IPV6 type
	Loopback
	// Multicast IPV6 type
	Multicast
	// InterfaceLocalMulticast IPV6 type
	InterfaceLocalMulticast
	// LinkLocalMulticast IPV6 type
	LinkLocalMulticast
	// Private IPV6 type
	Private
	// Unspecified IPV6 type
	Unspecified
	// Unknown IPV6 type
	Unknown
)

Variables

This section is empty.

Functions

func Addr2BitString added in v0.1.32

func Addr2BitString(addr netip.Addr) (result string)

Addr2BitString complete address binary to 16 bit sections

func AddrGlobalID added in v0.1.32

func AddrGlobalID(addr netip.Addr) (hex string, err error)

AddrGlobalID get subsection of bits in network part of IP

func AddrLink(addr netip.Addr) (url string)

AddrLink get link for address

func AddrMulticastGroupID added in v0.1.32

func AddrMulticastGroupID(addr netip.Addr) (hex string, err error)

AddrMulticastGroupID id from range for multicast addresses

func AddrMulticastNetworkPrefix added in v0.1.32

func AddrMulticastNetworkPrefix(addr netip.Addr) (hex string, err error)

AddrMulticastNetworkPrefix get prefix specific to multicast (at end of IP before Group ID)

func AddrSolicitedNodeMulticast

func AddrSolicitedNodeMulticast(addr netip.Addr) (newAddr netip.Addr, err error)

AddrSolicitedNodeMulticast get solicited node multicast address for incoming unicast address EUI-64 compliance

func AddrSubnet added in v0.1.32

func AddrSubnet(addr netip.Addr) string

AddrSubnet get the string subnet section as a hex string

func AddrTypePrefix added in v0.1.32

func AddrTypePrefix(addr netip.Addr) (prefix netip.Prefix)

AddrTypePrefix the prefix for the IP type

func Arpa

func Arpa(addr netip.Addr) (addrStr string)

Arpa get the IPV6 ARPA address

func First

func First(addr netip.Addr) netip.Addr

First get firt IP from subnet

func HasType

func HasType(t int, candidates ...int) (hasType bool)

HasType is address const one of a list of candidates

func Interface added in v0.1.32

func Interface(addr netip.Addr) string

Interface get the string representation in hex of the interface bits

func IsARPA

func IsARPA(addr netip.Addr) (is bool)

IsARPA is the address relevant to ARPA addressing?

func Last

func Last(addr netip.Addr) netip.Addr

Last get last IP for subnet

func LinkLocalDefaultGateway

func LinkLocalDefaultGateway(addr netip.Addr) string

LinkLocalDefaultGateway get default gateway for link local

func RandAddrGlobalUnicast added in v0.1.32

func RandAddrGlobalUnicast() (addr netip.Addr, err error)

RandAddrGlobalUnicast get a global unicast random IPV6 address

func RandAddrInterfaceLocalMulticast added in v0.1.32

func RandAddrInterfaceLocalMulticast() (addr netip.Addr, err error)

RandAddrInterfaceLocalMulticast get a random interface local multicast address

func RandAddrLinkLocal added in v0.1.32

func RandAddrLinkLocal() (addr netip.Addr, err error)

RandAddrLinkLocal get a link-local random IPV6 address

func RandAddrLinkLocalMulticast added in v0.1.32

func RandAddrLinkLocalMulticast() (addr netip.Addr, err error)

RandAddrLinkLocalMulticast get a random link local multicast address

func RandAddrMulticast added in v0.1.32

func RandAddrMulticast() (addr netip.Addr, err error)

RandAddrMulticast get a random multicast address

func RandAddrPrivate added in v0.1.32

func RandAddrPrivate() (addr netip.Addr, err error)

RandAddrPrivate get a unique local random IPV6 address

func RoutingPrefix added in v0.1.32

func RoutingPrefix(addr netip.Addr) string

RoutingPrefix get the routing prefix as a hex string

Types

type AddressInfo added in v0.1.34

type AddressInfo struct {
	Type    string `yaml:"type,omitempty" json:"type,omitempty"`
	Address string `yaml:"address,omitempty" json:"address,omitempty"`
}

AddressInfo information about an address

type DomainInfo added in v0.1.34

type DomainInfo struct {
	Domain string `yaml:"domain,omitempty" json:"domain,omitempty"`
	// Type        string        `yaml:"type,omitempty" json:"type,omitempty"`
	AddressInfo []AddressInfo  `yaml:"addresses,omitempty" json:"addresses,omitempty"`
	MXRecords   []MXRecordInfo `yaml:"mxrecords,omitempty" json:"mxrecords,omitempty"`
}

DomainInfo a set of properties for a domain including addresses and MX records

func NewDomainInfo added in v0.1.34

func NewDomainInfo() DomainInfo

NewDomainInfo get new domain info for a single domain

type DomainInfoSet added in v0.1.34

type DomainInfoSet struct {
	DomainInfo []DomainInfo `yaml:"domains,omitempty" json:"domains,omitempty"`
}

DomainInfoSet a set of information for domains

func NewDomainInfoSet added in v0.1.34

func NewDomainInfoSet() DomainInfoSet

NewDomainInfoSet get new domain info list

type IPSummary added in v0.1.34

type IPSummary struct {
	IPType                  string `yaml:"iptype,omitempty" json:"iptype,omitempty"`
	TypePrefix              string `yaml:"typeprefix,omitempty" json:"typeprefix,omitempty"`
	IP                      string `yaml:"ip,omitempty" json:"ip,omitempty"`
	SolicitedNodeMulticast  string `yaml:"solicitednodemulticast,omitempty" json:"solicitednodemulticast,omitempty"`
	Prefix                  string `yaml:"prefix,omitempty" json:"prefix,omitempty"`
	NetworkPrefix           string `yaml:"networkprefix,omitempty" json:"networkprefix,omitempty"`
	RoutingPrefix           string `yaml:"routingprefix,omitempty" json:"routingprefix,omitempty"`
	SubnetID                string `yaml:"subnetid,omitempty" json:"subnetid,omitempty"`
	Subnets                 int64  `yaml:"subnets,omitempty" json:"subnets,omitempty"`
	GlobalID                string `yaml:"globalid,omitempty" json:"globalid,omitempty"`
	GroupID                 string `yaml:"groupid,omitempty" json:"groupid,omitempty"`
	Groups                  int64  `yaml:"groups,omitempty" json:"groups,omitempty"`
	InterfaceID             string `yaml:"interfaceid,omitempty" json:"interfaceid,omitempty"`
	Addresses               int64  `yaml:"addresses,omitempty" json:"addresses,omitempty"`
	DefaultGateway          string `yaml:"defaultgateway,omitempty" json:"defaultgateway,omitempty"`
	Link                    string `yaml:"link,omitempty" json:"link,omitempty"`
	IPV6Arpa                string `yaml:"ipv6arpa,omitempty" json:"ipv6arpa,omitempty"`
	SubnetFirstAddress      string `yaml:"subnetfirstaddress,omitempty" json:"subnetfirstaddress,omitempty"`
	SubnetLastAddress       string `yaml:"subnetlastaddress,omitempty" json:"subnetlastaddress,omitempty"`
	FirstAddressFieldBinary string `yaml:"firstaddressbinary,omitempty" json:"firstaddressbinary,omitempty"`
}

IPSummary summary of properties for an IP

type MXRecordInfo added in v0.1.34

type MXRecordInfo struct {
	Domain string `yaml:"domain,omitempty" json:"domain,omitempty"`
	Pref   uint16 `yaml:"pref,omitempty" json:"pref,omitempty"`
}

MXRecordInfo an MX record

Jump to

Keyboard shortcuts

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