transform

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: MIT Imports: 6 Imported by: 92

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PtrNameMagic

func PtrNameMagic(name, domain string) (string, error)

PtrNameMagic implements the PTR magic.

func ReverseDomainName

func ReverseDomainName(cidr string) (string, error)

ReverseDomainName turns a CIDR block into a reversed (in-addr) name.

func TransformIP

func TransformIP(address net.IP, transforms []IpConversion) (net.IP, error)

TransformIP transforms a single ip address. If the transform results in multiple new targets, an error will be returned.

func TransformIPToList

func TransformIPToList(address net.IP, transforms []IpConversion) ([]net.IP, error)

TransformIPToList manipulates an net.IP based on a list of IpConversions. It can potentially expand one ip address into multiple addresses.

func UintToIP

func UintToIP(u uint32) net.IP

UintToIP convert a 32-bit into into a net.IP.

Types

type IpConversion

type IpConversion struct {
	Low, High net.IP
	NewBases  []net.IP
	NewIPs    []net.IP
}

IpConversion describes an IP conversion.

func DecodeTransformTable

func DecodeTransformTable(transforms string) ([]IpConversion, error)

DecodeTransformTable turns a string-encoded table into a list of conversions.

Jump to

Keyboard shortcuts

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