ipranger

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2020 License: MIT Imports: 7 Imported by: 34

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ips

func Ips(cidr string) ([]string, error)

Ips of a cidr

func IsCidr

func IsCidr(ip string) bool

IsCidr determines if the given ip is a cidr range

func IsIP

func IsIP(ip string) bool

IsIP determines if the given string is a valid ip

func ToCidr

func ToCidr(item string) *net.IPNet

Types

type BlackRock

type BlackRock struct {
	Rounds int64
	Seed   int64
	Range  int64
	A      int64
	B      int64
}

func NewBlackRock

func NewBlackRock(rangez, seed int64) *BlackRock

func (*BlackRock) F

func (blackrock *BlackRock) F(j, r, seed int64) int64

Inner permutation function

func (*BlackRock) Fe

func (blackrock *BlackRock) Fe(r, a, b, m, seed int64) int64

Outer feistal construction

func (*BlackRock) Shuffle

func (blackrock *BlackRock) Shuffle(m int64) int64

func (*BlackRock) UnShuffle

func (blackrock *BlackRock) UnShuffle(m int64) int64

func (*BlackRock) Unfe

func (blackrock *BlackRock) Unfe(r, a, b, m, seed int64) int64

Outer reverse feistal construction

type IPRanger

type IPRanger struct {
	TotalIps        uint64
	Ranger          cidranger.Ranger
	TotalExcludeIps uint64
	RangerExclude   cidranger.Ranger
	TotalFqdn       uint64
	Targets         *hybrid.HybridMap
}

func New

func New() (*IPRanger, error)

func (*IPRanger) Add

func (ir *IPRanger) Add(ipcidr string) error

func (*IPRanger) AddFqdn

func (ir *IPRanger) AddFqdn(ip, fqdn string) error

func (*IPRanger) AddIPNet

func (ir *IPRanger) AddIPNet(network *net.IPNet) error

func (*IPRanger) Close

func (ir *IPRanger) Close() error

func (*IPRanger) Contains

func (ir *IPRanger) Contains(ipcidr string) bool

func (*IPRanger) ContainsSkipExclude

func (ir *IPRanger) ContainsSkipExclude(ipcidr string) bool

func (*IPRanger) CountExcludedIps

func (ir *IPRanger) CountExcludedIps() int

func (*IPRanger) CountIPS

func (ir *IPRanger) CountIPS() int

func (*IPRanger) Delete

func (ir *IPRanger) Delete(ipcidr string) error

func (*IPRanger) Exclude

func (ir *IPRanger) Exclude(ipcidr string) error

func (*IPRanger) GetFQDNByIP

func (ir *IPRanger) GetFQDNByIP(ip string) ([]string, error)

func (*IPRanger) HasIP

func (ir *IPRanger) HasIP(ip string) bool

func (*IPRanger) IsExcluded

func (ir *IPRanger) IsExcluded(ipcidr string) bool

func (*IPRanger) Len

func (ir *IPRanger) Len() int

func (*IPRanger) LenExclude

func (ir *IPRanger) LenExclude() int

Jump to

Keyboard shortcuts

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